From adaac8789f6b2c75f3d0088a74a502ddda08ed4a Mon Sep 17 00:00:00 2001 From: supowang Date: Fri, 22 May 2020 11:57:26 +0800 Subject: [PATCH] add mqtt client support for ec20 LTE DTU add mqtt client support for ec20 LTE DTU --- .../BSP/.mxproject | 0 .../BSP/Inc/gpio.h | 0 .../BSP/Inc/i2c.h | 0 .../BSP/Inc/main.h | 0 .../BSP/Inc/mcu_init.h | 0 .../BSP/Inc/stm32f1xx_hal_conf.h | 0 .../BSP/Inc/stm32f1xx_it.h | 0 .../BSP/Inc/usart.h | 0 .../BSP/LTE_DTU_SIM7600.ioc | 0 .../BSP/Src/gpio.c | 0 .../BSP/Src/i2c.c | 0 .../BSP/Src/main.c | 2 +- .../BSP/Src/mcu_init.c | 0 .../BSP/Src/mqtt_client.c | 94 ++ .../BSP/Src/stm32f1xx_hal_msp.c | 0 .../BSP/Src/stm32f1xx_it.c | 0 .../BSP/Src/stm32f1xx_it_module.c | 0 .../BSP/Src/system_stm32f1xx.c | 0 .../BSP/Src/usart.c | 0 .../KEIL/mqtt_client/TencentOS_Tiny.uvoptx} | 449 ++++++++- .../KEIL/mqtt_client/TencentOS_Tiny.uvprojx} | 201 +++- .../KEIL/mqtt_client}/startup_stm32f103xb.s | 0 .../TOS_CONFIG/mqtt_config.h | 48 + .../TOS_CONFIG/tos_config.h | 0 board/LTE_DTU_SIM7600/BSP/Inc/tos_at.h | 460 --------- board/LTE_DTU_SIM7600/BSP/Inc/tos_at_utils.h | 23 - board/LTE_DTU_SIM7600/BSP/Src/tcp_test.c | 85 -- .../KEIL/hello_world/LTE_DTU_SIM7600.uvoptx | 892 ------------------ .../KEIL/hello_world/LTE_DTU_SIM7600.uvprojx | 707 -------------- .../tcp_through_module/startup_stm32f103xb.s | 307 ------ 30 files changed, 760 insertions(+), 2508 deletions(-) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/.mxproject (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Inc/gpio.h (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Inc/i2c.h (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Inc/main.h (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Inc/mcu_init.h (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Inc/stm32f1xx_hal_conf.h (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Inc/stm32f1xx_it.h (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Inc/usart.h (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/LTE_DTU_SIM7600.ioc (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Src/gpio.c (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Src/i2c.c (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Src/main.c (92%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Src/mcu_init.c (100%) create mode 100644 board/LTE_DTU_EC20_SIM7600CE/BSP/Src/mqtt_client.c rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Src/stm32f1xx_hal_msp.c (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Src/stm32f1xx_it.c (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Src/stm32f1xx_it_module.c (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Src/system_stm32f1xx.c (100%) rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/BSP/Src/usart.c (100%) rename board/{LTE_DTU_SIM7600/KEIL/tcp_through_module/LTE_DTU_SIM7600.uvoptx => LTE_DTU_EC20_SIM7600CE/KEIL/mqtt_client/TencentOS_Tiny.uvoptx} (68%) rename board/{LTE_DTU_SIM7600/KEIL/tcp_through_module/LTE_DTU_SIM7600.uvprojx => LTE_DTU_EC20_SIM7600CE/KEIL/mqtt_client/TencentOS_Tiny.uvprojx} (76%) rename board/{LTE_DTU_SIM7600/KEIL/hello_world => LTE_DTU_EC20_SIM7600CE/KEIL/mqtt_client}/startup_stm32f103xb.s (100%) create mode 100644 board/LTE_DTU_EC20_SIM7600CE/TOS_CONFIG/mqtt_config.h rename board/{LTE_DTU_SIM7600 => LTE_DTU_EC20_SIM7600CE}/TOS_CONFIG/tos_config.h (100%) delete mode 100644 board/LTE_DTU_SIM7600/BSP/Inc/tos_at.h delete mode 100644 board/LTE_DTU_SIM7600/BSP/Inc/tos_at_utils.h delete mode 100644 board/LTE_DTU_SIM7600/BSP/Src/tcp_test.c delete mode 100644 board/LTE_DTU_SIM7600/KEIL/hello_world/LTE_DTU_SIM7600.uvoptx delete mode 100644 board/LTE_DTU_SIM7600/KEIL/hello_world/LTE_DTU_SIM7600.uvprojx delete mode 100644 board/LTE_DTU_SIM7600/KEIL/tcp_through_module/startup_stm32f103xb.s diff --git a/board/LTE_DTU_SIM7600/BSP/.mxproject b/board/LTE_DTU_EC20_SIM7600CE/BSP/.mxproject similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/.mxproject rename to board/LTE_DTU_EC20_SIM7600CE/BSP/.mxproject diff --git a/board/LTE_DTU_SIM7600/BSP/Inc/gpio.h b/board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/gpio.h similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Inc/gpio.h rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/gpio.h diff --git a/board/LTE_DTU_SIM7600/BSP/Inc/i2c.h b/board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/i2c.h similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Inc/i2c.h rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/i2c.h diff --git a/board/LTE_DTU_SIM7600/BSP/Inc/main.h b/board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/main.h similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Inc/main.h rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/main.h diff --git a/board/LTE_DTU_SIM7600/BSP/Inc/mcu_init.h b/board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/mcu_init.h similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Inc/mcu_init.h rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/mcu_init.h diff --git a/board/LTE_DTU_SIM7600/BSP/Inc/stm32f1xx_hal_conf.h b/board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/stm32f1xx_hal_conf.h similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Inc/stm32f1xx_hal_conf.h rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/stm32f1xx_hal_conf.h diff --git a/board/LTE_DTU_SIM7600/BSP/Inc/stm32f1xx_it.h b/board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/stm32f1xx_it.h similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Inc/stm32f1xx_it.h rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/stm32f1xx_it.h diff --git a/board/LTE_DTU_SIM7600/BSP/Inc/usart.h b/board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/usart.h similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Inc/usart.h rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Inc/usart.h diff --git a/board/LTE_DTU_SIM7600/BSP/LTE_DTU_SIM7600.ioc b/board/LTE_DTU_EC20_SIM7600CE/BSP/LTE_DTU_SIM7600.ioc similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/LTE_DTU_SIM7600.ioc rename to board/LTE_DTU_EC20_SIM7600CE/BSP/LTE_DTU_SIM7600.ioc diff --git a/board/LTE_DTU_SIM7600/BSP/Src/gpio.c b/board/LTE_DTU_EC20_SIM7600CE/BSP/Src/gpio.c similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Src/gpio.c rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Src/gpio.c diff --git a/board/LTE_DTU_SIM7600/BSP/Src/i2c.c b/board/LTE_DTU_EC20_SIM7600CE/BSP/Src/i2c.c similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Src/i2c.c rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Src/i2c.c diff --git a/board/LTE_DTU_SIM7600/BSP/Src/main.c b/board/LTE_DTU_EC20_SIM7600CE/BSP/Src/main.c similarity index 92% rename from board/LTE_DTU_SIM7600/BSP/Src/main.c rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Src/main.c index 1929bebb..8b77ee28 100644 --- a/board/LTE_DTU_SIM7600/BSP/Src/main.c +++ b/board/LTE_DTU_EC20_SIM7600CE/BSP/Src/main.c @@ -1,7 +1,7 @@ #include "mcu_init.h" #include "cmsis_os.h" -#define APPLICATION_TASK_STK_SIZE 512 +#define APPLICATION_TASK_STK_SIZE 1024 extern void application_entry(void *arg); osThreadDef(application_entry, osPriorityNormal, 1, APPLICATION_TASK_STK_SIZE); diff --git a/board/LTE_DTU_SIM7600/BSP/Src/mcu_init.c b/board/LTE_DTU_EC20_SIM7600CE/BSP/Src/mcu_init.c similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Src/mcu_init.c rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Src/mcu_init.c diff --git a/board/LTE_DTU_EC20_SIM7600CE/BSP/Src/mqtt_client.c b/board/LTE_DTU_EC20_SIM7600CE/BSP/Src/mqtt_client.c new file mode 100644 index 00000000..5125571a --- /dev/null +++ b/board/LTE_DTU_EC20_SIM7600CE/BSP/Src/mqtt_client.c @@ -0,0 +1,94 @@ +#include "ec20.h" +#include "mcu_init.h" +#include "tos_k.h" +#include "mqttclient.h" + +//#define USE_SIM7600CE + +#define USE_EC20 + +mqtt_client_t client; +client_init_params_t init_params; + +static void tos_topic_handler(void* client, message_data_t* msg) +{ + (void) client; + LOG_I("-----------------------------------------------------------------------------------"); + LOG_I("%s:%d %s()...\ntopic: %s, qos: %d. \nmessage:\n\t%s\n", __FILE__, __LINE__, __FUNCTION__, + msg->topic_name, msg->message->qos, (char*)msg->message->payload); + LOG_I("-----------------------------------------------------------------------------------\n"); +} + + +void mqttclient_task(void) +{ + int error; + + char buf[100] = { 0 }; + + mqtt_message_t msg; + + memset(&msg, 0, sizeof(msg)); + +#ifdef USE_SIM7600CE + sim7600ce_sal_init(HAL_UART_PORT_2); +#endif + +#ifdef USE_EC20 + ec20_sal_init(HAL_UART_PORT_2); +#endif + + init_params.read_buf_size = 256; + init_params.write_buf_size = 256; + +#ifdef MQTT_NETWORK_TYPE_TLS + init_params.connect_params.network_params.network_ssl_params.ca_crt = test_ca_get(); + init_params.connect_params.network_params.port = "8883"; +#else + init_params.connect_params.network_params.port = "1883"; +#endif + init_params.connect_params.network_params.addr = "111.230.189.156"; //"47.95.164.112";//"jiejie01.top"; //"129.204.201.235"; //"192.168.1.101"; + + init_params.connect_params.user_name = "RUAP1R610Vsupowang;12010126;OQHZL;1626061655"; // random_string(10); //"jiejietop-acer1"; + init_params.connect_params.password = "ed41ae0cdf9100ce2aa5d5874566f8f4f77b1eab80b19ede4d1419eafe92eb54;hmacsha256"; //random_string(10); // "123456"; + init_params.connect_params.client_id = "RUAP1R610Vsupowang";; //random_string(10); // "clientid-acer1"; + init_params.connect_params.clean_session = 1; + + log_init(); + + mqtt_init(&client, &init_params); + + error = mqtt_connect(&client); + + LOG_D("mqtt connect error is %#x", error); + + //mqtt_set_interceptor_handler(&client,tos_topic_handler); + + mqtt_subscribe(&client, "RUAP1R610V/supowang/data", QOS0, tos_topic_handler); + + LOG_D("mqtt subscribe error is %#x", error); + + memset(&msg, 0, sizeof(msg)); + + for (;;) { + + sprintf(buf, "welcome to mqttclient, this is a publish test, a rand number: %d ...", random_number()); + + msg.qos = QOS0; + msg.payload = (void *) buf; + + error = mqtt_publish(&client, "RUAP1R610V/supowang/data", &msg); + + tos_task_delay(4000); + } +} + + +void application_entry(void *arg) +{ + mqttclient_task(); + while (1) { + printf("This is a mqtt demo!\r\n"); + tos_task_delay(1000); + } +} diff --git a/board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_hal_msp.c b/board/LTE_DTU_EC20_SIM7600CE/BSP/Src/stm32f1xx_hal_msp.c similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_hal_msp.c rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Src/stm32f1xx_hal_msp.c diff --git a/board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_it.c b/board/LTE_DTU_EC20_SIM7600CE/BSP/Src/stm32f1xx_it.c similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_it.c rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Src/stm32f1xx_it.c diff --git a/board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_it_module.c b/board/LTE_DTU_EC20_SIM7600CE/BSP/Src/stm32f1xx_it_module.c similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_it_module.c rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Src/stm32f1xx_it_module.c diff --git a/board/LTE_DTU_SIM7600/BSP/Src/system_stm32f1xx.c b/board/LTE_DTU_EC20_SIM7600CE/BSP/Src/system_stm32f1xx.c similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Src/system_stm32f1xx.c rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Src/system_stm32f1xx.c diff --git a/board/LTE_DTU_SIM7600/BSP/Src/usart.c b/board/LTE_DTU_EC20_SIM7600CE/BSP/Src/usart.c similarity index 100% rename from board/LTE_DTU_SIM7600/BSP/Src/usart.c rename to board/LTE_DTU_EC20_SIM7600CE/BSP/Src/usart.c diff --git a/board/LTE_DTU_SIM7600/KEIL/tcp_through_module/LTE_DTU_SIM7600.uvoptx b/board/LTE_DTU_EC20_SIM7600CE/KEIL/mqtt_client/TencentOS_Tiny.uvoptx similarity index 68% rename from board/LTE_DTU_SIM7600/KEIL/tcp_through_module/LTE_DTU_SIM7600.uvoptx rename to board/LTE_DTU_EC20_SIM7600CE/KEIL/mqtt_client/TencentOS_Tiny.uvoptx index d867692e..50d2d829 100644 --- a/board/LTE_DTU_SIM7600/KEIL/tcp_through_module/LTE_DTU_SIM7600.uvoptx +++ b/board/LTE_DTU_EC20_SIM7600CE/KEIL/mqtt_client/TencentOS_Tiny.uvoptx @@ -22,7 +22,7 @@ - LTE_DTU_SIM7600 + LTE_DTU 0x4 ARM-ADS @@ -45,7 +45,7 @@ 79 66 8 - + .\List\ 1 @@ -148,24 +148,7 @@ -U303030303030303030303031 -O2254 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM) - - - 0 - 0 - 686 - 1 -
134235520
- 0 - 0 - 0 - 0 - 0 - 1 - ..\..\..\..\net\at\src\tos_at.c - - \\LTE_DTU_SIM7600\../../../../net/at/src/tos_at.c\686 -
-
+ 0 @@ -240,7 +223,7 @@ Application/User - 0 + 1 0 0 0 @@ -923,8 +906,8 @@ 0 0 0 - ..\..\BSP\Src\tcp_test.c - tcp_test.c + ..\..\BSP\Src\mqtt_client.c + mqtt_client.c 0 0 @@ -968,6 +951,18 @@ 0 0 + + 10 + 57 + 1 + 0 + 0 + 0 + ..\..\..\..\devices\ec20\ec20.c + ec20.c + 0 + 0 + @@ -978,7 +973,7 @@ 0 11 - 57 + 58 1 0 0 @@ -998,7 +993,7 @@ 0 12 - 58 + 59 1 0 0 @@ -1010,6 +1005,410 @@ + + mqttclient + 0 + 0 + 0 + 0 + + 13 + 60 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\mqttclient\mqttclient.c + mqttclient.c + 0 + 0 + + + + + mqttclient/mqtt + 0 + 0 + 0 + 0 + + 14 + 61 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTConnectClient.c + MQTTConnectClient.c + 0 + 0 + + + 14 + 62 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTConnectServer.c + MQTTConnectServer.c + 0 + 0 + + + 14 + 63 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTDeserializePublish.c + MQTTDeserializePublish.c + 0 + 0 + + + 14 + 64 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTFormat.c + MQTTFormat.c + 0 + 0 + + + 14 + 65 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTPacket.c + MQTTPacket.c + 0 + 0 + + + 14 + 66 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTSerializePublish.c + MQTTSerializePublish.c + 0 + 0 + + + 14 + 67 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTSubscribeClient.c + MQTTSubscribeClient.c + 0 + 0 + + + 14 + 68 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTSubscribeServer.c + MQTTSubscribeServer.c + 0 + 0 + + + 14 + 69 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTUnsubscribeClient.c + MQTTUnsubscribeClient.c + 0 + 0 + + + 14 + 70 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTUnsubscribeServer.c + MQTTUnsubscribeServer.c + 0 + 0 + + + + + mqttclient/salof + 0 + 0 + 0 + 0 + + 15 + 71 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\common\log\fifo.c + fifo.c + 0 + 0 + + + 15 + 72 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\common\log\format.c + format.c + 0 + 0 + + + 15 + 73 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\common\log\salof.c + salof.c + 0 + 0 + + + 15 + 74 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\common\log\arch\tencentos-tiny\arch.c + arch.c + 0 + 0 + + + 15 + 75 + 5 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\common\log\salof_config.h + salof_config.h + 0 + 0 + + + + + mqttclient/common + 0 + 0 + 0 + 0 + + 16 + 76 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\common\list.c + list.c + 0 + 0 + + + 16 + 77 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\common\random.c + random.c + 0 + 0 + + + 16 + 78 + 5 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\common\error.h + error.h + 0 + 0 + + + 16 + 79 + 5 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\common\log.h + log.h + 0 + 0 + + + + + mqttclient/network + 0 + 0 + 0 + 0 + + 17 + 80 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\network\network.c + network.c + 0 + 0 + + + + + mqttclient/platform + 0 + 0 + 0 + 0 + + 18 + 81 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_memory.c + platform_memory.c + 0 + 0 + + + 18 + 82 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_mutex.c + platform_mutex.c + 0 + 0 + + + 18 + 83 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_net_socket.c + platform_net_socket.c + 0 + 0 + + + 18 + 84 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_nettype_tcp.c + platform_nettype_tcp.c + 0 + 0 + + + 18 + 85 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_nettype_tls.c + platform_nettype_tls.c + 0 + 0 + + + 18 + 86 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_thread.c + platform_thread.c + 0 + 0 + + + 18 + 87 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_timer.c + platform_timer.c + 0 + 0 + + + + + mqttclient/config + 0 + 0 + 0 + 0 + + 19 + 88 + 5 + 0 + 0 + 0 + ..\..\TOS_CONFIG\mqtt_config.h + mqtt_config.h + 0 + 0 + + + ::CMSIS 0 diff --git a/board/LTE_DTU_SIM7600/KEIL/tcp_through_module/LTE_DTU_SIM7600.uvprojx b/board/LTE_DTU_EC20_SIM7600CE/KEIL/mqtt_client/TencentOS_Tiny.uvprojx similarity index 76% rename from board/LTE_DTU_SIM7600/KEIL/tcp_through_module/LTE_DTU_SIM7600.uvprojx rename to board/LTE_DTU_EC20_SIM7600CE/KEIL/mqtt_client/TencentOS_Tiny.uvprojx index 44c239e3..ac7fcea2 100644 --- a/board/LTE_DTU_SIM7600/KEIL/tcp_through_module/LTE_DTU_SIM7600.uvprojx +++ b/board/LTE_DTU_EC20_SIM7600CE/KEIL/mqtt_client/TencentOS_Tiny.uvprojx @@ -7,7 +7,7 @@ - LTE_DTU_SIM7600 + LTE_DTU 0x4 ARM-ADS 5060750::V5.06 update 6 (build 750)::ARMCC @@ -48,14 +48,14 @@ 0 1 - LTE_DTU_SIM7600\ - LTE_DTU_SIM7600 + .\OBJ\ + TencentOS_Tiny 1 0 1 1 0 - + .\List\ 1 0 0 @@ -338,7 +338,7 @@ USE_HAL_DRIVER,STM32F103xB,USE_HAL_DRIVER,STM32F103xB - ..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32F1xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m3\armcc;..\..\..\..\kernel\core\include;..\..\..\..\kernel\hal\include;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\TOS_CONFIG;..\..\..\..\devices\sim7600ce;..\..\..\..\net\sal_module_wrapper + ..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32F1xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m3\armcc;..\..\..\..\kernel\core\include;..\..\..\..\kernel\hal\include;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\TOS_CONFIG;..\..\..\..\devices\sim7600ce;..\..\..\..\net\sal_module_wrapper;..\..\..\..\net\at\include;..\..\..\..\devices\ec20;..\..\..\..\components\connectivity\mqttclient\common;..\..\..\..\components\connectivity\mqttclient\common\log;..\..\..\..\components\connectivity\mqttclient\mqtt;..\..\..\..\components\connectivity\mqttclient\mqttclient;..\..\..\..\components\connectivity\mqttclient\network;..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny @@ -683,9 +683,9 @@ examples - tcp_test.c + mqtt_client.c 1 - ..\..\BSP\Src\tcp_test.c + ..\..\BSP\Src\mqtt_client.c @@ -707,6 +707,11 @@ 1 ..\..\..\..\devices\sim7600ce\sim7600ce.c + + ec20.c + 1 + ..\..\..\..\devices\ec20\ec20.c + @@ -729,6 +734,186 @@ + + mqttclient + + + mqttclient.c + 1 + ..\..\..\..\components\connectivity\mqttclient\mqttclient\mqttclient.c + + + + + mqttclient/mqtt + + + MQTTConnectClient.c + 1 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTConnectClient.c + + + MQTTConnectServer.c + 1 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTConnectServer.c + + + MQTTDeserializePublish.c + 1 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTDeserializePublish.c + + + MQTTFormat.c + 1 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTFormat.c + + + MQTTPacket.c + 1 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTPacket.c + + + MQTTSerializePublish.c + 1 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTSerializePublish.c + + + MQTTSubscribeClient.c + 1 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTSubscribeClient.c + + + MQTTSubscribeServer.c + 1 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTSubscribeServer.c + + + MQTTUnsubscribeClient.c + 1 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTUnsubscribeClient.c + + + MQTTUnsubscribeServer.c + 1 + ..\..\..\..\components\connectivity\mqttclient\mqtt\MQTTUnsubscribeServer.c + + + + + mqttclient/salof + + + fifo.c + 1 + ..\..\..\..\components\connectivity\mqttclient\common\log\fifo.c + + + format.c + 1 + ..\..\..\..\components\connectivity\mqttclient\common\log\format.c + + + salof.c + 1 + ..\..\..\..\components\connectivity\mqttclient\common\log\salof.c + + + arch.c + 1 + ..\..\..\..\components\connectivity\mqttclient\common\log\arch\tencentos-tiny\arch.c + + + salof_config.h + 5 + ..\..\..\..\components\connectivity\mqttclient\common\log\salof_config.h + + + + + mqttclient/common + + + list.c + 1 + ..\..\..\..\components\connectivity\mqttclient\common\list.c + + + random.c + 1 + ..\..\..\..\components\connectivity\mqttclient\common\random.c + + + error.h + 5 + ..\..\..\..\components\connectivity\mqttclient\common\error.h + + + log.h + 5 + ..\..\..\..\components\connectivity\mqttclient\common\log.h + + + + + mqttclient/network + + + network.c + 1 + ..\..\..\..\components\connectivity\mqttclient\network\network.c + + + + + mqttclient/platform + + + platform_memory.c + 1 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_memory.c + + + platform_mutex.c + 1 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_mutex.c + + + platform_net_socket.c + 1 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_net_socket.c + + + platform_nettype_tcp.c + 1 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_nettype_tcp.c + + + platform_nettype_tls.c + 1 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_nettype_tls.c + + + platform_thread.c + 1 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_thread.c + + + platform_timer.c + 1 + ..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny\platform_timer.c + + + + + mqttclient/config + + + mqtt_config.h + 5 + ..\..\TOS_CONFIG\mqtt_config.h + + + ::CMSIS @@ -742,7 +927,7 @@ - + diff --git a/board/LTE_DTU_SIM7600/KEIL/hello_world/startup_stm32f103xb.s b/board/LTE_DTU_EC20_SIM7600CE/KEIL/mqtt_client/startup_stm32f103xb.s similarity index 100% rename from board/LTE_DTU_SIM7600/KEIL/hello_world/startup_stm32f103xb.s rename to board/LTE_DTU_EC20_SIM7600CE/KEIL/mqtt_client/startup_stm32f103xb.s diff --git a/board/LTE_DTU_EC20_SIM7600CE/TOS_CONFIG/mqtt_config.h b/board/LTE_DTU_EC20_SIM7600CE/TOS_CONFIG/mqtt_config.h new file mode 100644 index 00000000..c2caeb53 --- /dev/null +++ b/board/LTE_DTU_EC20_SIM7600CE/TOS_CONFIG/mqtt_config.h @@ -0,0 +1,48 @@ +/* + * @Author: jiejie + * @Github: https://github.com/jiejieTop + * @Date: 2019-12-15 00:42:16 + * @LastEditTime: 2020-02-25 09:25:35 + * @Description: the code belongs to jiejie, please keep the author information and source code according to the license. + */ +#ifndef _MQTT_CONFIG_H_ +#define _MQTT_CONFIG_H_ + +//#define LOG_IS_SALOF + +#define LOG_LEVEL DEBUG_LEVEL //WARN_LEVEL DEBUG_LEVEL + +#ifdef LOG_IS_SALOF + #define USE_LOG (1U) + #define USE_SALOF (1U) + #define SALOF_OS USE_TENCENTOS + #define USE_IDLE_HOOK (0U) + #define LOG_COLOR (0U) + #define LOG_TS (0U) + #define LOG_TAR (0U) + #define SALOF_BUFF_SIZE (512U) + #define SALOF_FIFO_SIZE (1024U) + #define SALOF_TASK_STACK_SIZE (1024U) + #define SALOF_TASK_TICK (50U) +#endif + + +#define MQTT_MAX_PACKET_ID (0xFFFF - 1) +#define MQTT_TOPIC_LEN_MAX 64 +#define MQTT_ACK_HANDLER_NUM_MAX 64 +#define MQTT_DEFAULT_BUF_SIZE 1024 +#define MQTT_DEFAULT_CMD_TIMEOUT 4000 +#define MQTT_MAX_CMD_TIMEOUT 20000 +#define MQTT_MIN_CMD_TIMEOUT 1000 +#define MQTT_KEEP_ALIVE_INTERVAL 100 // unit: second +#define MQTT_VERSION 4 // 4 is mqtt 3.1.1 +#define MQTT_RECONNECT_DEFAULT_DURATION 1000 +#define MQTT_THREAD_STACK_SIZE 2048 +#define MQTT_THREAD_PRIO 5 +#define MQTT_THREAD_TICK 50 + +#define MQTT_NETSOCKET_USE_AT + +//#define MQTT_NETWORK_TYPE_TLS + +#endif /* _MQTT_CONFIG_H_ */ diff --git a/board/LTE_DTU_SIM7600/TOS_CONFIG/tos_config.h b/board/LTE_DTU_EC20_SIM7600CE/TOS_CONFIG/tos_config.h similarity index 100% rename from board/LTE_DTU_SIM7600/TOS_CONFIG/tos_config.h rename to board/LTE_DTU_EC20_SIM7600CE/TOS_CONFIG/tos_config.h diff --git a/board/LTE_DTU_SIM7600/BSP/Inc/tos_at.h b/board/LTE_DTU_SIM7600/BSP/Inc/tos_at.h deleted file mode 100644 index 6d6c706d..00000000 --- a/board/LTE_DTU_SIM7600/BSP/Inc/tos_at.h +++ /dev/null @@ -1,460 +0,0 @@ -/*---------------------------------------------------------------------------- - * Tencent is pleased to support the open source community by making TencentOS - * available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * If you have downloaded a copy of the TencentOS binary from Tencent, please - * note that the TencentOS binary is licensed under the BSD 3-Clause License. - * - * If you have downloaded a copy of the TencentOS source code from Tencent, - * please note that TencentOS source code is licensed under the BSD 3-Clause - * License, except for the third-party components listed below which are - * subject to different license terms. Your integration of TencentOS into your - * own projects may require compliance with the BSD 3-Clause License, as well - * as the other licenses applicable to the third-party components included - * within TencentOS. - *---------------------------------------------------------------------------*/ - -#ifndef _TOS_AT_H_ -#define _TOS_AT_H_ - -#include "tos_k.h" -#include "tos_at_utils.h" -#include "tos_hal.h" - -#define AT_AGENT_ECHO_OK "OK" -#define AT_AGENT_ECHO_FAIL "FAIL" -#define AT_AGENT_ECHO_ERROR "ERROR" - -#define AT_DATA_CHANNEL_NUM 6 -#define AT_DATA_CHANNEL_FIFO_BUFFER_SIZE (1024) - -#define AT_UART_RX_FIFO_BUFFER_SIZE (1024) -#define AT_RECV_CACHE_SIZE 1024 - -#define AT_CMD_BUFFER_SIZE 256 - -#define AT_PARSER_TASK_STACK_SIZE 1024 -#define AT_PARSER_TASK_PRIO 2 - -typedef enum at_status_en { - AT_STATUS_OK, - AT_STATUS_ERROR, - AT_STATUS_INVALID_ARGS, -} at_status_t; - -typedef struct at_cache_st { - uint8_t *buffer; - size_t buffer_size; - size_t recv_len; -} at_cache_t; - -typedef enum at_parse_status_en { - AT_PARSE_STATUS_NONE, - AT_PARSE_STATUS_NEWLINE, - AT_PARSE_STATUS_EVENT, - AT_PARSE_STATUS_EXPECT, - AT_PARSE_STATUS_OVERFLOW, -} at_parse_status_t; - -typedef enum at_echo_status_en { - AT_ECHO_STATUS_NONE, - AT_ECHO_STATUS_OK, - AT_ECHO_STATUS_FAIL, - AT_ECHO_STATUS_ERROR, - AT_ECHO_STATUS_EXPECT, -} at_echo_status_t; - -typedef enum at_channel_status_en { - AT_CHANNEL_STATUS_NONE, /*< usually means we are try to get a channel status with invalid id */ - AT_CHANNEL_STATUS_HANGING, /*< channel is not used */ - AT_CHANNEL_STATUS_WORKING, /*< channel is being using */ - AT_CHANNEL_STATUS_BROKEN, /*< channel is broken(module link to remote server is broken) */ -} at_channel_status_t; - -typedef struct at_data_channel_st { - uint8_t is_free; - k_chr_fifo_t rx_fifo; - uint8_t *rx_fifo_buffer; - k_mutex_t rx_lock; - - at_channel_status_t status; - - const char *remote_ip; - const char *remote_port; -} at_data_channel_t; - -typedef struct at_echo_st { - char *buffer; - size_t buffer_size; - char *echo_expect; - int line_num; - at_echo_status_t status; - size_t __w_idx; - int __is_expecting; - k_sem_t __expect_notify; -} at_echo_t; - -typedef void (*at_event_callback_t)(void); - -typedef struct at_event_st { - const char *event_header; - at_event_callback_t event_callback; -} at_event_t; - -typedef struct at_agent_st { - at_data_channel_t data_channel[AT_DATA_CHANNEL_NUM]; - - at_event_t *event_table; - size_t event_table_size; - - at_echo_t *echo; - - k_task_t parser; - at_cache_t recv_cache; - - at_timer_t timer; - - k_mutex_t global_lock; - - char *cmd_buf; - k_mutex_t cmd_buf_lock; - - hal_uart_t uart; - k_mutex_t uart_tx_lock; - k_mutex_t uart_rx_lock; - k_sem_t uart_rx_sem; - k_chr_fifo_t uart_rx_fifo; - uint8_t *uart_rx_fifo_buffer; -} at_agent_t; - -#define AT_AGENT ((at_agent_t *)(&at_agent)) - -/** - * @brief Write data to a channel. - * Write data to a channel with certain id. - * - * @attention None - * - * @param[in] channel_id id of the channel. - * @param[in] buffer data buffer to write. - * @param[in] buffer_len length of the buffer. - * - * @return errcode - * @retval -1 write failed(error). - * @retval none -1 the number of bytes written. - */ -int tos_at_channel_write(int channel_id, uint8_t *buffer, size_t buffer_len); - -/** - * @brief Read data from a channel. - * Read data from a channel with a timeout. - * - * @attention None - * - * @param[in] channel_id id of the channel. - * @param[out] buffer buffer to hold the data read. - * @param[in] buffer_len length of the buffer. - * @param[in] timeout timeout. - * - * @return errcode - * @retval -1 read failed(error). - * @retval none -1 the number of bytes read. - */ -int tos_at_channel_read_timed(int channel_id, uint8_t *buffer, size_t buffer_len, uint32_t timeout); - -/** - * @brief Read data from a channel. - * Read data from a channel. - * - * @attention None - * - * @param[in] channel_id id of the channel. - * @param[out] buffer buffer to hold the data read. - * @param[in] buffer_len length of the buffer. - * - * @return errcode - * @retval -1 read failed(error). - * @retval none -1 the number of bytes read. - */ -int tos_at_channel_read(int channel_id, uint8_t *buffer, size_t buffer_len); - -/** - * @brief Allocate a channel. - * Allocate a channel with certain id. - * - * @attention None - * - * @param[in] channel_id id of the channel. - * @param[in] ip remote ip of the channel. - * @param[in] port remote port of the channel. - * - * @return errcode - * @retval -1 allocate failed(error). - * @retval none -1 the id of the channel. - */ -int tos_at_channel_alloc_id(int channel_id, const char *ip, const char *port); - -/** - * @brief Allocate a channel. - * Allocate a channel. - * - * @attention None - * - * @param[in] ip remote ip of the channel. - * @param[in] port remote port of the channel. - * - * @return errcode - * @retval -1 allocate failed(error). - * @retval none -1 the id of the channel. - */ -int tos_at_channel_alloc(const char *ip, const char *port); - -/** - * @brief Free a channel. - * Free a channel with certain id. - * - * @attention None - * - * @param[in] channel_id id of the channel. - * - * @return errcode - * @retval -1 free failed(error). - * @retval 0 free successfully. - */ -int tos_at_channel_free(int channel_id); - -/** - * @brief Set channel broken. - * - * @attention None - * - * @param[in] channel_id id of the channel. - * - * @return errcode - * @retval -1 set failed(error). - * @retval 0 set successfully. - */ -__API__ int tos_at_channel_set_broken(int channel_id); - -/** - * @brief Judge whether channel is working. - * - * @attention None - * - * @param[in] channel_id id of the channel. - * - * @return at channel status(type of at_channel_status_t) - */ -__API__ int tos_at_channel_is_working(int channel_id); - -/** - * @brief Initialize the at framework. - * - * @attention None - * - * @param[in] uart_port port number of the uart thougth which the module connect to the MCU. - * @param[in] event_table the listened event table. - * @param[in] event_table_size the size of the listened event table. - * - * @return errcode - * @retval -1 initialize failed(error). - * @retval 0 initialize successfully. - */ -int tos_at_init(hal_uart_port_t uart_port, at_event_t *event_table, size_t event_table_size); - -/** - * @brief De-initialize the at framework. - * - * @attention None - * - * @return -None - */ -void tos_at_deinit(void); - -/** - * @brief Create a echo struct. - * - * @attention None - * - * @param[in] echo pointer to the echo struct. - * @param[out] buffer buffer to hold the received message from the module. - * @param[in] buffer_size size of the buffer. - * @param[in] echo_expect the expected echo message. - * - * @return errcode - * @retval -1 create failed(error). - * @retval 0 create successfully. - */ -int tos_at_echo_create(at_echo_t *echo, char *buffer, size_t buffer_size, char *echo_expect); - -/** - * @brief Execute an at command. - * - * @attention None - * - * @param[in] echo pointer to the echo struct. - * @param[in] timeout command wait timeout . - * @param[in] cmd at command. - * - * @return errcode - * @retval -1 execute failed(error). - * @retval 0 execute successfully. - */ -int tos_at_cmd_exec(at_echo_t *echo, uint32_t timeout, const char *cmd, ...); - -/** - * @brief Execute an at command. - * Execute an at command and wait until the expected echo message received or timeout. - * - * @attention None - * - * @param[in] echo pointer to the echo struct. - * @param[in] timeout command wait timeout . - * @param[in] cmd at command. - * - * @return errcode - * @retval -1 execute failed(error). - * @retval 0 execute successfully. - */ -int tos_at_cmd_exec_until(at_echo_t *echo, uint32_t timeout, const char *cmd, ...); - -/** - * @brief Send raw data througth uart. - * - * @attention None - * - * @param[in] echo pointer to the echo struct. - * @param[in] timeout command wait timeout . - * @param[in] buf data to send. - * @param[in] size size of the buf. - * - * @return errcode - * @retval -1 execute failed(error). - * @retval 0 execute successfully. - */ -int tos_at_raw_data_send(at_echo_t *echo, uint32_t timeout, const uint8_t *buf, size_t size); - -/** - * @brief Send raw data througth uart. - * Send raw data througth uart and wait until the expected echo message received or timeout. - * - * @attention None - * - * @param[in] echo pointer to the echo struct. - * @param[in] timeout command wait timeout . - * @param[in] buf data to send. - * @param[in] size size of the buf. - * - * @return errcode - * @retval -1 execute failed(error). - * @retval 0 execute successfully. - */ -int tos_at_raw_data_send_until(at_echo_t *echo, uint32_t timeout, const uint8_t *buf, size_t size); - -/** - * @brief Write byte to the at uart. - * The function called by the uart interrupt, to put the data from the uart to the at framework. - * - * @attention None - * - * @param[in] data uart received data. - * - * @return None - */ -void tos_at_uart_input_byte(uint8_t data); - -/** - * @brief A global lock provided by at framework. - * The lock usually used to make a atomic function. - * - * @attention None - * - * @param None. - * - * @return errcode - * @retval -1 pend failed(error). - * @retval 0 pend successfully. - */ -int tos_at_global_lock_pend(void); - -/** - * @brief A global lock provided by at framework. - * The lock usually used to make a atomic function. - * - * @attention None - * - * @param None. - * - * @return errcode - * @retval -1 post failed(error). - * @retval 0 post successfully. - */ -int tos_at_global_lock_post(void); - -/** - * @brief Read data from the uart. - * Read data from the uart, usually called in listened event callback. - * - * @attention None - * - * @param[out] buffer buffer to hold the data read from the uart. - * @param[in] buffer_len length of the buffer. - * - * @return length of the data read from the uart. - */ -int tos_at_uart_read(uint8_t *buffer, size_t buffer_len); - -/** - * @brief Read data from the uart. - * Read data from the uart until meet a '\n', usually called in listened event callback. - * - * @attention None - * - * @param[out] buffer buffer to hold the data read from the uart. - * @param[in] buffer_len length of the buffer. - * - * @return length of the data read from the uart. - */ -int tos_at_uart_readline(uint8_t *buffer, size_t buffer_len); - -/** - * @brief Read data from the uart. - * Read data from the uart until no more incoming data, usually called in listened event callback. - * - * @attention None - * - * @param[out] buffer buffer to hold the data read from the uart. - * @param[in] buffer_len length of the buffer. - * - * @return length of the data read from the uart. - */ -int tos_at_uart_drain(uint8_t *buffer, size_t buffer_len); - -/** - * @brief Get the remote ip of a channel. - * Get the remote ip of a channel with certain id. - * - * @attention None - * - * @param[in] channel_id id of the channel. - * - * @return remote ip of the channel. - */ -const char *tos_at_agent_channel_ip_get(int channel_id); - -/** - * @brief Get the remote port of a channel. - * Get the remote port of a channel with certain id. - * - * @attention None - * - * @param[in] channel_id id of the channel. - * - * @return remote port of the channel. - */ -const char *tos_at_agent_channel_port_get(int channel_id); - -#endif /* __AT_AGENT_H_ */ - diff --git a/board/LTE_DTU_SIM7600/BSP/Inc/tos_at_utils.h b/board/LTE_DTU_SIM7600/BSP/Inc/tos_at_utils.h deleted file mode 100644 index b4930d7a..00000000 --- a/board/LTE_DTU_SIM7600/BSP/Inc/tos_at_utils.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef _TOS_AT_UTILS_H_ -#define _TOS_AT_UTILS_H_ - -typedef struct at_timer_st { - k_tick_t end_time; -} at_timer_t; - -void at_delay(k_tick_t tick); - -void at_delay_ms(uint32_t millisec); - -int at_timer_is_expired(at_timer_t *tmr); - -void at_timer_countdown(at_timer_t *tmr, k_tick_t tick); - -void at_timer_countdown_ms(at_timer_t *tmr, uint32_t millisec); - -k_tick_t at_timer_remain(at_timer_t *tmr); - -void at_timer_init(at_timer_t *tmr); - -#endif - diff --git a/board/LTE_DTU_SIM7600/BSP/Src/tcp_test.c b/board/LTE_DTU_SIM7600/BSP/Src/tcp_test.c deleted file mode 100644 index a9973917..00000000 --- a/board/LTE_DTU_SIM7600/BSP/Src/tcp_test.c +++ /dev/null @@ -1,85 +0,0 @@ -#include "sim7600ce.h" -#include "mcu_init.h" -#include "sal_module_wrapper.h" -#include "cmsis_os.h" - -#define TCP_TEST_TASK0_STK_SIZE 512 -void tcp_test0(void); -osThreadDef(tcp_test0, osPriorityNormal, 1, TCP_TEST_TASK0_STK_SIZE); - -#define TCP_TEST_TASK1_STK_SIZE 512 -void tcp_test1(void); -osThreadDef(tcp_test1, osPriorityNormal, 1, TCP_TEST_TASK1_STK_SIZE); - -int socket_id_0 = -1; -int socket_id_1 = -1; - -#define RECV_LEN 1024 -uint8_t recv_data_0[RECV_LEN]; -uint8_t recv_data_1[RECV_LEN]; - -void tcp_test0(void) -{ - int recv_len = -1; - - while (1) { - tos_sal_module_send(socket_id_0, (const void*)"This is TCP Test!\r\n", strlen("This is TCP Test!\r\n")); - - recv_len = tos_sal_module_recv_timeout(socket_id_0, recv_data_0, sizeof(recv_data_0), 8000); - if (recv_len < 0) { - printf("task0 receive error\n"); - } else if (recv_len == 0) { - printf("task0 receive none\n"); - } else { - recv_data_0[recv_len] = 0; - printf("task0: receive len: %d\nmsg from remote: %s\n", recv_len, recv_data_0); - } - - tos_sleep_ms(2000); - } -} - -void tcp_test1(void) -{ - int recv_len = -1; - - while (1) { - tos_sal_module_send(socket_id_1, (const void *)"Hello Tencent!\r\n", strlen("Hello Tencent!\r\n")); - - recv_len = tos_sal_module_recv_timeout(socket_id_1, recv_data_1, sizeof(recv_data_1), 8000); - if (recv_len < 0) { - printf("task1 receive error\n\r"); - } else if (recv_len == 0) { - printf("task1 receive none\n"); - } else { - recv_data_1[recv_len] = 0; - printf("task1: receive len: %d\nmsg from remote: %s\n", recv_len, recv_data_1); - } - - tos_sleep_ms(2000); - } -} - - -void application_entry(void *arg) -{ - sim7600ce_sal_init(HAL_UART_PORT_2); - - socket_id_0 = tos_sal_module_connect("39.108.190.129", "8080", TOS_SAL_PROTO_TCP); - if (socket_id_0 == -1) { - printf("TCP0 connect failed\r\n"); - } else { - printf("TCP0 connect success! fd: %d\n", socket_id_0); - } - -// socket_id_1 = tos_sal_module_connect("39.108.190.129", "8001", TOS_SAL_PROTO_TCP); -// if (socket_id_1 == -1) { -// printf("TCP1 connect failed\r\n"); -// } else { -// printf("TCP1 connect success! fd: %d\n", socket_id_1); -// } - - osThreadCreate(osThread(tcp_test0), NULL); - //osThreadCreate(osThread(tcp_test1), NULL); -} - diff --git a/board/LTE_DTU_SIM7600/KEIL/hello_world/LTE_DTU_SIM7600.uvoptx b/board/LTE_DTU_SIM7600/KEIL/hello_world/LTE_DTU_SIM7600.uvoptx deleted file mode 100644 index 2731ae29..00000000 --- a/board/LTE_DTU_SIM7600/KEIL/hello_world/LTE_DTU_SIM7600.uvoptx +++ /dev/null @@ -1,892 +0,0 @@ - - - - 1.0 - -
### uVision Project, (C) Keil Software
- - - *.c - *.s*; *.src; *.a* - *.obj; *.o - *.lib - *.txt; *.h; *.inc - *.plm - *.cpp - 0 - - - - 0 - 0 - - - - LTE_DTU_SIM7600 - 0x4 - ARM-ADS - - 72000000 - - 1 - 1 - 0 - 1 - 0 - - - 1 - 65535 - 0 - 0 - 0 - - - 79 - 66 - 8 - - - - 1 - 1 - 1 - 0 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - 0 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 0 - 0 - - - 1 - 0 - 1 - - 18 - - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 0 - 6 - - - - - - - - - - - STLink\ST-LINKIII-KEIL_SWO.dll - - - - 0 - UL2CM3 - UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128 -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM)) - - - 0 - ST-LINKIII-KEIL_SWO - -U303030303030303030303031 -O2254 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM) - - - - - 0 - - - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - 0 - 0 - 0 - - - - - - - - - - 1 - 1 - 0 - 2 - 10000000 - - - - - - Application/MDK-ARM - 0 - 0 - 0 - 0 - - 1 - 1 - 2 - 0 - 0 - 0 - startup_stm32f103xb.s - startup_stm32f103xb.s - 0 - 0 - - - - - Application/User - 1 - 0 - 0 - 0 - - 2 - 2 - 1 - 0 - 0 - 0 - ..\..\BSP\Src\gpio.c - gpio.c - 0 - 0 - - - 2 - 3 - 1 - 0 - 0 - 0 - ..\..\BSP\Src\i2c.c - i2c.c - 0 - 0 - - - 2 - 4 - 1 - 0 - 0 - 0 - ..\..\BSP\Src\main.c - main.c - 0 - 0 - - - 2 - 5 - 1 - 0 - 0 - 0 - ..\..\BSP\Src\mcu_init.c - mcu_init.c - 0 - 0 - - - 2 - 6 - 1 - 0 - 0 - 0 - ..\..\BSP\Src\stm32f1xx_hal_msp.c - stm32f1xx_hal_msp.c - 0 - 0 - - - 2 - 7 - 1 - 0 - 0 - 0 - ..\..\BSP\Src\stm32f1xx_it.c - stm32f1xx_it.c - 0 - 0 - - - 2 - 8 - 1 - 0 - 0 - 0 - ..\..\BSP\Src\usart.c - usart.c - 0 - 0 - - - - - Drivers/STM32F1xx_HAL_Driver - 0 - 0 - 0 - 0 - - 3 - 9 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c - stm32f1xx_hal.c - 0 - 0 - - - 3 - 10 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c - stm32f1xx_hal_cortex.c - 0 - 0 - - - 3 - 11 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c - stm32f1xx_hal_dma.c - 0 - 0 - - - 3 - 12 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c - stm32f1xx_hal_exti.c - 0 - 0 - - - 3 - 13 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c - stm32f1xx_hal_flash.c - 0 - 0 - - - 3 - 14 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c - stm32f1xx_hal_flash_ex.c - 0 - 0 - - - 3 - 15 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c - stm32f1xx_hal_gpio.c - 0 - 0 - - - 3 - 16 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c - stm32f1xx_hal_gpio_ex.c - 0 - 0 - - - 3 - 17 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_i2c.c - stm32f1xx_hal_i2c.c - 0 - 0 - - - 3 - 18 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c - stm32f1xx_hal_pwr.c - 0 - 0 - - - 3 - 19 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c - stm32f1xx_hal_rcc.c - 0 - 0 - - - 3 - 20 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c - stm32f1xx_hal_rcc_ex.c - 0 - 0 - - - 3 - 21 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c - stm32f1xx_hal_tim.c - 0 - 0 - - - 3 - 22 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c - stm32f1xx_hal_tim_ex.c - 0 - 0 - - - 3 - 23 - 1 - 0 - 0 - 0 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c - stm32f1xx_hal_uart.c - 0 - 0 - - - - - Drivers/CMSIS - 0 - 0 - 0 - 0 - - 4 - 24 - 1 - 0 - 0 - 0 - ..\..\BSP\Src\system_stm32f1xx.c - system_stm32f1xx.c - 0 - 0 - - - - - tos/arch - 0 - 0 - 0 - 0 - - 5 - 25 - 1 - 0 - 0 - 0 - ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c - tos_cpu.c - 0 - 0 - - - 5 - 26 - 1 - 0 - 0 - 0 - ..\..\..\..\arch\arm\arm-v7m\cortex-m3\armcc\port_c.c - port_c.c - 0 - 0 - - - 5 - 27 - 2 - 0 - 0 - 0 - ..\..\..\..\arch\arm\arm-v7m\cortex-m3\armcc\port_s.S - port_s.S - 0 - 0 - - - - - tos/kernel - 0 - 0 - 0 - 0 - - 6 - 28 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_binary_heap.c - tos_binary_heap.c - 0 - 0 - - - 6 - 29 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_char_fifo.c - tos_char_fifo.c - 0 - 0 - - - 6 - 30 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_completion.c - tos_completion.c - 0 - 0 - - - 6 - 31 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_countdownlatch.c - tos_countdownlatch.c - 0 - 0 - - - 6 - 32 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_event.c - tos_event.c - 0 - 0 - - - 6 - 33 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_global.c - tos_global.c - 0 - 0 - - - 6 - 34 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_mail_queue.c - tos_mail_queue.c - 0 - 0 - - - 6 - 35 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_message_queue.c - tos_message_queue.c - 0 - 0 - - - 6 - 36 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_mmblk.c - tos_mmblk.c - 0 - 0 - - - 6 - 37 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_mmheap.c - tos_mmheap.c - 0 - 0 - - - 6 - 38 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_mutex.c - tos_mutex.c - 0 - 0 - - - 6 - 39 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_pend.c - tos_pend.c - 0 - 0 - - - 6 - 40 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_priority_mail_queue.c - tos_priority_mail_queue.c - 0 - 0 - - - 6 - 41 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_priority_message_queue.c - tos_priority_message_queue.c - 0 - 0 - - - 6 - 42 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_priority_queue.c - tos_priority_queue.c - 0 - 0 - - - 6 - 43 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_ring_queue.c - tos_ring_queue.c - 0 - 0 - - - 6 - 44 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_robin.c - tos_robin.c - 0 - 0 - - - 6 - 45 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_sched.c - tos_sched.c - 0 - 0 - - - 6 - 46 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_sem.c - tos_sem.c - 0 - 0 - - - 6 - 47 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_sys.c - tos_sys.c - 0 - 0 - - - 6 - 48 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_task.c - tos_task.c - 0 - 0 - - - 6 - 49 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_tick.c - tos_tick.c - 0 - 0 - - - 6 - 50 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_time.c - tos_time.c - 0 - 0 - - - 6 - 51 - 1 - 0 - 0 - 0 - ..\..\..\..\kernel\core\tos_timer.c - tos_timer.c - 0 - 0 - - - - - tos/cmsis - 0 - 0 - 0 - 0 - - 7 - 52 - 1 - 0 - 0 - 0 - ..\..\..\..\osal\cmsis_os\cmsis_os.c - cmsis_os.c - 0 - 0 - - - - - examples - 0 - 0 - 0 - 0 - - 8 - 53 - 1 - 0 - 0 - 0 - ..\..\..\..\examples\hello_world\hello_world.c - hello_world.c - 0 - 0 - - - - - ::CMSIS - 0 - 0 - 0 - 1 - - -
diff --git a/board/LTE_DTU_SIM7600/KEIL/hello_world/LTE_DTU_SIM7600.uvprojx b/board/LTE_DTU_SIM7600/KEIL/hello_world/LTE_DTU_SIM7600.uvprojx deleted file mode 100644 index 0932173d..00000000 --- a/board/LTE_DTU_SIM7600/KEIL/hello_world/LTE_DTU_SIM7600.uvprojx +++ /dev/null @@ -1,707 +0,0 @@ - - - - 2.1 - -
### uVision Project, (C) Keil Software
- - - - LTE_DTU_SIM7600 - 0x4 - ARM-ADS - 5060750::V5.06 update 6 (build 750)::ARMCC - 0 - - - STM32F103RB - STMicroelectronics - Keil.STM32F1xx_DFP.2.2.0 - http://www.keil.com/pack/ - IRAM(0x20000000-0x20004FFF) IROM(0x8000000-0x801FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3") - - - - - - - - - - - - - - - $$Device:STM32F103RB$SVD\STM32F103xx.svd - 0 - 0 - - - - - - - 0 - 0 - 0 - 0 - 1 - - LTE_DTU_SIM7600\ - LTE_DTU_SIM7600 - 1 - 0 - 1 - 1 - 0 - - 1 - 0 - 0 - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 0 - 0 - - - 0 - 0 - 0 - 0 - - 0 - - - - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 3 - - - 0 - - - SARMCM3.DLL - -REMAP - DCM.DLL - -pCM3 - SARMCM3.DLL - - TCM.DLL - -pCM3 - - - - 1 - 0 - 0 - 0 - 16 - - - - - 1 - 0 - 0 - 1 - 1 - 4107 - - 1 - STLink\ST-LINKIII-KEIL_SWO.dll - - - - - - 0 - - - - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 0 - 1 - 1 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 0 - 0 - "Cortex-M3" - - 0 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 8 - 1 - 0 - 0 - 0 - 3 - 3 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 1 - 0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x20000000 - 0x5000 - - - 1 - 0x8000000 - 0x20000 - - - 0 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x8000000 - 0x20000 - - - 1 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x20000000 - 0x5000 - - - 0 - 0x0 - 0x0 - - - - - - 1 - 4 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 2 - 0 - 0 - 1 - 0 - 0 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - - - USE_HAL_DRIVER,STM32F103xB,USE_HAL_DRIVER,STM32F103xB - - ..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32F1xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m3\armcc;..\..\..\..\kernel\core\include;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\TOS_CONFIG - - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - - 1 - 0 - 0 - 0 - 1 - 0 - 0x08000000 - 0x20000000 - - - - - - - - - - - - - Application/MDK-ARM - - - startup_stm32f103xb.s - 2 - startup_stm32f103xb.s - - - - - Application/User - - - gpio.c - 1 - ..\..\BSP\Src\gpio.c - - - i2c.c - 1 - ..\..\BSP\Src\i2c.c - - - main.c - 1 - ..\..\BSP\Src\main.c - - - mcu_init.c - 1 - ..\..\BSP\Src\mcu_init.c - - - stm32f1xx_hal_msp.c - 1 - ..\..\BSP\Src\stm32f1xx_hal_msp.c - - - stm32f1xx_it.c - 1 - ..\..\BSP\Src\stm32f1xx_it.c - - - usart.c - 1 - ..\..\BSP\Src\usart.c - - - - - Drivers/STM32F1xx_HAL_Driver - - - stm32f1xx_hal.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c - - - stm32f1xx_hal_cortex.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c - - - stm32f1xx_hal_dma.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c - - - stm32f1xx_hal_exti.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c - - - stm32f1xx_hal_flash.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c - - - stm32f1xx_hal_flash_ex.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c - - - stm32f1xx_hal_gpio.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c - - - stm32f1xx_hal_gpio_ex.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c - - - stm32f1xx_hal_i2c.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_i2c.c - - - stm32f1xx_hal_pwr.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c - - - stm32f1xx_hal_rcc.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c - - - stm32f1xx_hal_rcc_ex.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c - - - stm32f1xx_hal_tim.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c - - - stm32f1xx_hal_tim_ex.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c - - - stm32f1xx_hal_uart.c - 1 - ..\..\..\..\platform\vendor_bsp\st\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c - - - - - Drivers/CMSIS - - - system_stm32f1xx.c - 1 - ..\..\BSP\Src\system_stm32f1xx.c - - - - - tos/arch - - - tos_cpu.c - 1 - ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c - - - port_c.c - 1 - ..\..\..\..\arch\arm\arm-v7m\cortex-m3\armcc\port_c.c - - - port_s.S - 2 - ..\..\..\..\arch\arm\arm-v7m\cortex-m3\armcc\port_s.S - - - - - tos/kernel - - - tos_binary_heap.c - 1 - ..\..\..\..\kernel\core\tos_binary_heap.c - - - tos_char_fifo.c - 1 - ..\..\..\..\kernel\core\tos_char_fifo.c - - - tos_completion.c - 1 - ..\..\..\..\kernel\core\tos_completion.c - - - tos_countdownlatch.c - 1 - ..\..\..\..\kernel\core\tos_countdownlatch.c - - - tos_event.c - 1 - ..\..\..\..\kernel\core\tos_event.c - - - tos_global.c - 1 - ..\..\..\..\kernel\core\tos_global.c - - - tos_mail_queue.c - 1 - ..\..\..\..\kernel\core\tos_mail_queue.c - - - tos_message_queue.c - 1 - ..\..\..\..\kernel\core\tos_message_queue.c - - - tos_mmblk.c - 1 - ..\..\..\..\kernel\core\tos_mmblk.c - - - tos_mmheap.c - 1 - ..\..\..\..\kernel\core\tos_mmheap.c - - - tos_mutex.c - 1 - ..\..\..\..\kernel\core\tos_mutex.c - - - tos_pend.c - 1 - ..\..\..\..\kernel\core\tos_pend.c - - - tos_priority_mail_queue.c - 1 - ..\..\..\..\kernel\core\tos_priority_mail_queue.c - - - tos_priority_message_queue.c - 1 - ..\..\..\..\kernel\core\tos_priority_message_queue.c - - - tos_priority_queue.c - 1 - ..\..\..\..\kernel\core\tos_priority_queue.c - - - tos_ring_queue.c - 1 - ..\..\..\..\kernel\core\tos_ring_queue.c - - - tos_robin.c - 1 - ..\..\..\..\kernel\core\tos_robin.c - - - tos_sched.c - 1 - ..\..\..\..\kernel\core\tos_sched.c - - - tos_sem.c - 1 - ..\..\..\..\kernel\core\tos_sem.c - - - tos_sys.c - 1 - ..\..\..\..\kernel\core\tos_sys.c - - - tos_task.c - 1 - ..\..\..\..\kernel\core\tos_task.c - - - tos_tick.c - 1 - ..\..\..\..\kernel\core\tos_tick.c - - - tos_time.c - 1 - ..\..\..\..\kernel\core\tos_time.c - - - tos_timer.c - 1 - ..\..\..\..\kernel\core\tos_timer.c - - - - - tos/cmsis - - - cmsis_os.c - 1 - ..\..\..\..\osal\cmsis_os\cmsis_os.c - - - - - examples - - - hello_world.c - 1 - ..\..\..\..\examples\hello_world\hello_world.c - - - - - ::CMSIS - - - - - - - - - - - - - - - - - - -
diff --git a/board/LTE_DTU_SIM7600/KEIL/tcp_through_module/startup_stm32f103xb.s b/board/LTE_DTU_SIM7600/KEIL/tcp_through_module/startup_stm32f103xb.s deleted file mode 100644 index b10b2ed3..00000000 --- a/board/LTE_DTU_SIM7600/KEIL/tcp_through_module/startup_stm32f103xb.s +++ /dev/null @@ -1,307 +0,0 @@ -;******************** (C) COPYRIGHT 2017 STMicroelectronics ******************** -;* File Name : startup_stm32f103xb.s -;* Author : MCD Application Team -;* Description : STM32F103xB Devices vector table for MDK-ARM toolchain. -;* This module performs: -;* - Set the initial SP -;* - Set the initial PC == Reset_Handler -;* - Set the vector table entries with the exceptions ISR address -;* - Configure the clock system -;* - Branches to __main in the C library (which eventually -;* calls main()). -;* After Reset the Cortex-M3 processor is in Thread mode, -;* priority is Privileged, and the Stack is set to Main. -;****************************************************************************** -;* @attention -;* -;* Copyright (c) 2017 STMicroelectronics. -;* All rights reserved. -;* -;* This software component is licensed by ST under BSD 3-Clause license, -;* the "License"; You may not use this file except in compliance with the -;* License. You may obtain a copy of the License at: -;* opensource.org/licenses/BSD-3-Clause -;* -;****************************************************************************** - -; Amount of memory (in bytes) allocated for Stack -; Tailor this value to your application needs -; Stack Configuration -; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - -Stack_Size EQU 0x400 - - AREA STACK, NOINIT, READWRITE, ALIGN=3 -Stack_Mem SPACE Stack_Size -__initial_sp - - -; Heap Configuration -; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - -Heap_Size EQU 0x200 - - AREA HEAP, NOINIT, READWRITE, ALIGN=3 -__heap_base -Heap_Mem SPACE Heap_Size -__heap_limit - - PRESERVE8 - THUMB - - -; Vector Table Mapped to Address 0 at Reset - AREA RESET, DATA, READONLY - EXPORT __Vectors - EXPORT __Vectors_End - EXPORT __Vectors_Size - -__Vectors DCD __initial_sp ; Top of Stack - DCD Reset_Handler ; Reset Handler - DCD NMI_Handler ; NMI Handler - DCD HardFault_Handler ; Hard Fault Handler - DCD MemManage_Handler ; MPU Fault Handler - DCD BusFault_Handler ; Bus Fault Handler - DCD UsageFault_Handler ; Usage Fault Handler - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD 0 ; Reserved - DCD SVC_Handler ; SVCall Handler - DCD DebugMon_Handler ; Debug Monitor Handler - DCD 0 ; Reserved - DCD PendSV_Handler ; PendSV Handler - DCD SysTick_Handler ; SysTick Handler - - ; External Interrupts - DCD WWDG_IRQHandler ; Window Watchdog - DCD PVD_IRQHandler ; PVD through EXTI Line detect - DCD TAMPER_IRQHandler ; Tamper - DCD RTC_IRQHandler ; RTC - DCD FLASH_IRQHandler ; Flash - DCD RCC_IRQHandler ; RCC - DCD EXTI0_IRQHandler ; EXTI Line 0 - DCD EXTI1_IRQHandler ; EXTI Line 1 - DCD EXTI2_IRQHandler ; EXTI Line 2 - DCD EXTI3_IRQHandler ; EXTI Line 3 - DCD EXTI4_IRQHandler ; EXTI Line 4 - DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 - DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 - DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 - DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 - DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 - DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 - DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 - DCD ADC1_2_IRQHandler ; ADC1_2 - DCD USB_HP_CAN1_TX_IRQHandler ; USB High Priority or CAN1 TX - DCD USB_LP_CAN1_RX0_IRQHandler ; USB Low Priority or CAN1 RX0 - DCD CAN1_RX1_IRQHandler ; CAN1 RX1 - DCD CAN1_SCE_IRQHandler ; CAN1 SCE - DCD EXTI9_5_IRQHandler ; EXTI Line 9..5 - DCD TIM1_BRK_IRQHandler ; TIM1 Break - DCD TIM1_UP_IRQHandler ; TIM1 Update - DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation - DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare - DCD TIM2_IRQHandler ; TIM2 - DCD TIM3_IRQHandler ; TIM3 - DCD TIM4_IRQHandler ; TIM4 - DCD I2C1_EV_IRQHandler ; I2C1 Event - DCD I2C1_ER_IRQHandler ; I2C1 Error - DCD I2C2_EV_IRQHandler ; I2C2 Event - DCD I2C2_ER_IRQHandler ; I2C2 Error - DCD SPI1_IRQHandler ; SPI1 - DCD SPI2_IRQHandler ; SPI2 - DCD USART1_IRQHandler ; USART1 - DCD USART2_IRQHandler ; USART2 - DCD USART3_IRQHandler ; USART3 - DCD EXTI15_10_IRQHandler ; EXTI Line 15..10 - DCD RTC_Alarm_IRQHandler ; RTC Alarm through EXTI Line - DCD USBWakeUp_IRQHandler ; USB Wakeup from suspend -__Vectors_End - -__Vectors_Size EQU __Vectors_End - __Vectors - - AREA |.text|, CODE, READONLY - -; Reset handler -Reset_Handler PROC - EXPORT Reset_Handler [WEAK] - IMPORT __main - IMPORT SystemInit - LDR R0, =SystemInit - BLX R0 - LDR R0, =__main - BX R0 - ENDP - -; Dummy Exception Handlers (infinite loops which can be modified) - -NMI_Handler PROC - EXPORT NMI_Handler [WEAK] - B . - ENDP -HardFault_Handler\ - PROC - EXPORT HardFault_Handler [WEAK] - B . - ENDP -MemManage_Handler\ - PROC - EXPORT MemManage_Handler [WEAK] - B . - ENDP -BusFault_Handler\ - PROC - EXPORT BusFault_Handler [WEAK] - B . - ENDP -UsageFault_Handler\ - PROC - EXPORT UsageFault_Handler [WEAK] - B . - ENDP -SVC_Handler PROC - EXPORT SVC_Handler [WEAK] - B . - ENDP -DebugMon_Handler\ - PROC - EXPORT DebugMon_Handler [WEAK] - B . - ENDP -PendSV_Handler PROC - EXPORT PendSV_Handler [WEAK] - B . - ENDP -SysTick_Handler PROC - EXPORT SysTick_Handler [WEAK] - B . - ENDP - -Default_Handler PROC - - EXPORT WWDG_IRQHandler [WEAK] - EXPORT PVD_IRQHandler [WEAK] - EXPORT TAMPER_IRQHandler [WEAK] - EXPORT RTC_IRQHandler [WEAK] - EXPORT FLASH_IRQHandler [WEAK] - EXPORT RCC_IRQHandler [WEAK] - EXPORT EXTI0_IRQHandler [WEAK] - EXPORT EXTI1_IRQHandler [WEAK] - EXPORT EXTI2_IRQHandler [WEAK] - EXPORT EXTI3_IRQHandler [WEAK] - EXPORT EXTI4_IRQHandler [WEAK] - EXPORT DMA1_Channel1_IRQHandler [WEAK] - EXPORT DMA1_Channel2_IRQHandler [WEAK] - EXPORT DMA1_Channel3_IRQHandler [WEAK] - EXPORT DMA1_Channel4_IRQHandler [WEAK] - EXPORT DMA1_Channel5_IRQHandler [WEAK] - EXPORT DMA1_Channel6_IRQHandler [WEAK] - EXPORT DMA1_Channel7_IRQHandler [WEAK] - EXPORT ADC1_2_IRQHandler [WEAK] - EXPORT USB_HP_CAN1_TX_IRQHandler [WEAK] - EXPORT USB_LP_CAN1_RX0_IRQHandler [WEAK] - EXPORT CAN1_RX1_IRQHandler [WEAK] - EXPORT CAN1_SCE_IRQHandler [WEAK] - EXPORT EXTI9_5_IRQHandler [WEAK] - EXPORT TIM1_BRK_IRQHandler [WEAK] - EXPORT TIM1_UP_IRQHandler [WEAK] - EXPORT TIM1_TRG_COM_IRQHandler [WEAK] - EXPORT TIM1_CC_IRQHandler [WEAK] - EXPORT TIM2_IRQHandler [WEAK] - EXPORT TIM3_IRQHandler [WEAK] - EXPORT TIM4_IRQHandler [WEAK] - EXPORT I2C1_EV_IRQHandler [WEAK] - EXPORT I2C1_ER_IRQHandler [WEAK] - EXPORT I2C2_EV_IRQHandler [WEAK] - EXPORT I2C2_ER_IRQHandler [WEAK] - EXPORT SPI1_IRQHandler [WEAK] - EXPORT SPI2_IRQHandler [WEAK] - EXPORT USART1_IRQHandler [WEAK] - EXPORT USART2_IRQHandler [WEAK] - EXPORT USART3_IRQHandler [WEAK] - EXPORT EXTI15_10_IRQHandler [WEAK] - EXPORT RTC_Alarm_IRQHandler [WEAK] - EXPORT USBWakeUp_IRQHandler [WEAK] - -WWDG_IRQHandler -PVD_IRQHandler -TAMPER_IRQHandler -RTC_IRQHandler -FLASH_IRQHandler -RCC_IRQHandler -EXTI0_IRQHandler -EXTI1_IRQHandler -EXTI2_IRQHandler -EXTI3_IRQHandler -EXTI4_IRQHandler -DMA1_Channel1_IRQHandler -DMA1_Channel2_IRQHandler -DMA1_Channel3_IRQHandler -DMA1_Channel4_IRQHandler -DMA1_Channel5_IRQHandler -DMA1_Channel6_IRQHandler -DMA1_Channel7_IRQHandler -ADC1_2_IRQHandler -USB_HP_CAN1_TX_IRQHandler -USB_LP_CAN1_RX0_IRQHandler -CAN1_RX1_IRQHandler -CAN1_SCE_IRQHandler -EXTI9_5_IRQHandler -TIM1_BRK_IRQHandler -TIM1_UP_IRQHandler -TIM1_TRG_COM_IRQHandler -TIM1_CC_IRQHandler -TIM2_IRQHandler -TIM3_IRQHandler -TIM4_IRQHandler -I2C1_EV_IRQHandler -I2C1_ER_IRQHandler -I2C2_EV_IRQHandler -I2C2_ER_IRQHandler -SPI1_IRQHandler -SPI2_IRQHandler -USART1_IRQHandler -USART2_IRQHandler -USART3_IRQHandler -EXTI15_10_IRQHandler -RTC_Alarm_IRQHandler -USBWakeUp_IRQHandler - - B . - - ENDP - - ALIGN - -;******************************************************************************* -; User Stack and Heap initialization -;******************************************************************************* - IF :DEF:__MICROLIB - - EXPORT __initial_sp - EXPORT __heap_base - EXPORT __heap_limit - - ELSE - - IMPORT __use_two_region_memory - EXPORT __user_initial_stackheap - -__user_initial_stackheap - - LDR R0, = Heap_Mem - LDR R1, =(Stack_Mem + Stack_Size) - LDR R2, = (Heap_Mem + Heap_Size) - LDR R3, = Stack_Mem - BX LR - - ALIGN - - ENDIF - - END - -;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****