Bläddra i källkod

实现字节读写和校验UFS文件

yang684665 1 år sedan
förälder
incheckning
bc5b60501f

+ 6 - 4
bootloader/HW/Include/ec800m.h

@@ -16,10 +16,12 @@
 #define CMD_GET_TO_FILE "AT+QHTTPREADFILE=\"UFS:http.txt\",80\r\n"
 #define CMD_HTTP_GET "QHTTPGET:"
 #define CMD_READ_FILE "AT+QFDWL=http.txt\r\n"
-#define CMD_READ_OTA_MSG_FILE "AT+QFDWL=otaMSG.txt\r\n"
-#define CMD_READ_OTA_DATA_FILE "AT+QFDWL=otaDATA.txt\r\n"
-#define CMD_DEL_OTA_MSG_FILE "AT+QFDEL=otaMSG.txt\r\n"
-#define CMD_DEL_OTA_DATA_FILE "AT+QFDEL=otaDATA.txt\r\n"
+
+#define OPEN_otaMSG_FILE "AT+QFOPEN=\"otaMSG.txt\",1\r\n"
+#define WRITE_otaMSG_FILE "AT+QFWRITE=1,1024,3\r\n"
+#define CLOSE_otaMSG_FILE "AT+QFCLOSE=1\r\n"
+#define LOAD_otaMSG_FILE "AT+QFDWL=otaMSG.txt\r\n"
+
 #define ATI "ATI"
 
 #define CMD_MQTT_DISCONNECT "AT+QMTDISC=0\r\n"

+ 47 - 42
bootloader/HW/Source/ota_message.c

@@ -5,6 +5,8 @@
 #include "usart.h"
 #include "delay.h"
 #include <stdio.h>
+
+#define BufferSize 100		//最大获取的数据空间
 static OTA_MESSAGE ota_message = {0};
 void clear_ota_message_config_block(void);
 void write_ota_message_to_flash(uint32_t *data, int size){
@@ -58,6 +60,26 @@ static uint16_t checksum(const char *str, uint16_t len)
   return sum;
 }
 
+//返回str在数组中的索引
+static char* find_string(char *strs, char *str, int len)
+{
+    int i = 0;
+	char *start = NULL;
+    while(i < len){
+		start = strstr(strs, str);
+        if(start != NULL){
+            break;
+        }
+        i++;
+        strs++;
+    }
+    if(i == len + 1){
+        return NULL;
+    }
+    return start;
+}
+
+
 /*
  *  函数名:static void extract_data_from_buffer(const char* buffer, uint32_t *len_ptr, uint16_t *checkCode_ptr)
  *  输入参数:buffer字符串
@@ -65,9 +87,9 @@ static uint16_t checksum(const char *str, uint16_t len)
  *  返回值:无
  *  函数作用:eg.   QFDWL: 621,3e23  从json信息最后端取出这段json的有效长度和校验码
  */
-static void extract_data_from_buffer(const char *buffer, uint32_t *len_ptr, uint16_t *checkCode_ptr)
+static void extract_data_from_buffer(char* buffer, uint32_t *len_ptr, uint16_t *checkCode_ptr)
 {
-  char *start = strstr(buffer, "+QFDWL:");
+  char *start = find_string(buffer, "+QFDWL:",BufferSize);
   if (start != NULL)
   {
     start += 8; // 跳过"+QFDWL:"
@@ -82,7 +104,7 @@ static void extract_data_from_buffer(const char *buffer, uint32_t *len_ptr, uint
   }
 }
 
-bool WaitForUpData(char *dmaBuffer)
+bool WaitForUpData(char* dmaBuffer)
 {
 	if (UART0_RX_STAT > 0)
   	{
@@ -103,21 +125,6 @@ bool WaitForUpData(char *dmaBuffer)
 	}
 }
 
-// 提取string字符串
-void parseStringField(const char *data, const char *field, char *value)
-{
-    char *ptr = strstr(data, field) + strlen(field);
-    sscanf(ptr, "%[^\"],", value);
-}
-// 提取int数据如果没有提取到数据则返回-1;提取到返回正确的值
-int parseIntField(const char *data, const char *field)
-{
-    char *ptr = strstr(data, field) + strlen(field);
-    int value;
-    value = strtol(ptr, &ptr, 10);
-    return value;
-}
-
 /*
  *  函数名:load_config_params(CONFIG_PARAMS *params)
  *  输入参数:无
@@ -128,29 +135,27 @@ int parseIntField(const char *data, const char *field)
 int load_ota_message_config_params()
 {
 	//检查校验码
-	uint32_t BufferSize=1024;//最大获取的数据空间
 	char *dmabuffer=malloc(BufferSize);
 	__LOAD_CONFIG:
 	// get data from UFS
 	dma_config_change(dmabuffer,BufferSize);
 	Delay_Ms(1000);
-	EC800MSendCmd(CMD_READ_OTA_MSG_FILE, strlen(CMD_READ_OTA_MSG_FILE)); //"AT+QFDWL=otaMSG.txt\r\n"
+	EC800MSendCmd(LOAD_otaMSG_FILE, strlen(LOAD_otaMSG_FILE)); //"AT+QFDWL=otaMSG.txt\r\n"
 	Delay_Ms(1000);
 	dma_config();
 	if(WaitForUpData(dmabuffer) == false) goto __LOAD_CONFIG;
 	// W25Q32_Read((uint8_t *)&ota_message, OTA_EVENT_BLOCK*64*1024, sizeof(OTA_MESSAGE)); //从W25Q32中读取结构体数据
 	// FLASH_Read(OTA_EVENT_START_ADDR,&ota_message,sizeof(OTA_MESSAGE));
-
-	if(parseIntField(dmabuffer,"\"otaflag\":") == 1U)
+	memset(&ota_message,0,sizeof(OTA_MESSAGE));
+	memcpy((uint8_t*)&ota_message,dmabuffer,sizeof(OTA_MESSAGE));
+	free(dmabuffer);
+	if(ota_message.otaflag == 1U)
 	{
-		ota_message.otaflag = 1;
-		ota_message.XmodemByte = parseIntField(dmabuffer,"\"XmodemByte\":");
-		free(dmabuffer);
+		
 		return 0;
 	}
 	else 
 	{
-		free(dmabuffer);
 		return -1;
 	}
 }
@@ -167,25 +172,25 @@ OTA_MESSAGE *get_config_params()
  */
 void clear_ota_message_config_block(void)
 {
-	// W25Q32_Erase64K(OTA_EVENT_BLOCK);//擦除一块区域的大小
-	//AT+QFDEL="UFS:1.txt" 
-	char string[] = "{otaflag:0,XmodemByte:0}"; 
-	char OPEN_NEW_FILE[] = "AT+QFOPEN=\"otaMSG.txt\",1\r\n";
-	char WRITEFILE[] = "AT+QFWRITE=1,8\r\n";
-	char CLOSEFILE[] = "AT+QFCLOSE=1\r\n";
-	char LOADFILE[] = "AT+QFDWL=otaMSG.txt\r\n";
-
-	EC800MSendCmd(OPEN_NEW_FILE,strlen(OPEN_NEW_FILE));
-	WaitResponse("QFOPEN:", 2000);
+	static OTA_MESSAGE ota_message = {0};
+	ota_message.otaflag = 1;
+	ota_message.XmodemByte = 200 * 1024;
+	
+	EC800MSendCmd(OPEN_otaMSG_FILE,strlen(OPEN_otaMSG_FILE));
+	if(WaitResponse("QFOPEN:", 2000) == 0)
+		return;
 
-	EC800MSendCmd(WRITEFILE,strlen(WRITEFILE));
-	WaitResponse("CONNECT", 2000);
+	EC800MSendCmd(WRITE_otaMSG_FILE,strlen(WRITE_otaMSG_FILE));
+	if(WaitResponse("CONNECT", 2000))
+		return;
 
-	EC800MSendCmd(string,strlen(string));
-	WaitResponse("QFWRITE", 2000);
+	EC800MSendCmd((uint8_t *)&ota_message,sizeof(OTA_MESSAGE));
+	if(WaitResponse("QFWRITE", 5000))
+		return;
 
-	EC800MSendCmd(CLOSEFILE,strlen(CLOSEFILE));
-	WaitResponse("OK", 2000);
+	EC800MSendCmd(CLOSE_otaMSG_FILE,strlen(CLOSE_otaMSG_FILE));
+	if(WaitResponse("OK", 2000))
+		return;
 
 	// EC800MSendCmd("AT+QFDEL=\"UFS:otaMSG.txt\r\n\"",27);	//删除文件
 }

BIN
bootloader/OBJ/bootloader.axf


+ 2 - 31
bootloader/OBJ/bootloader.build_log.htm

@@ -27,36 +27,7 @@ Project File Date:  10/28/2023
 <h2>Output:</h2>
 *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\software\MDK5\ARM\ARMCC\Bin'
 Build target 'bootloader'
-compiling main.c...
-..\CMSIS\Include\gd32f10x.h(44): warning:  #47-D: incompatible redefinition of macro "GD32F10X_XD" 
-  #define GD32F10X_XD
-main.h(25): warning:  #1295-D: Deprecated declaration task_fwdgt_reload - give arg types
-  void task_fwdgt_reload();
-..\HW\Include\ota_message.h(14): warning:  #1295-D: Deprecated declaration load_ota_message_config_params - give arg types
-  extern int load_ota_message_config_params();
-..\HW\Include\ota_message.h(16): warning:  #1295-D: Deprecated declaration get_config_params - give arg types
-  extern OTA_MESSAGE *get_config_params();
-..\HW\Include\ec800m.h(26): warning:  #2532-D: support for trigraphs is disabled
-  // ??MQTT??3.1.1 ??????--4(mqtt 3.1.1 )3(mqtt 3.1)
-main.c(15): warning:  #550-D: variable "ota_message"  was set but never used
-  	static OTA_MESSAGE ota_message = {0};
-main.c(18): warning:  #550-D: variable "i"  was set but never used
-  	uint32_t i = 0;
-main.c(22): warning:  #177-D: variable "OPEN_FILE"  was declared but never referenced
-  	char OPEN_FILE[] = "AT+QFOPEN=\"otaMSG.txt\",0\r\n";
-main.c(26): warning:  #177-D: variable "LOADFILE"  was declared but never referenced
-  	char LOADFILE[] = "AT+QFDWL=otaMSG.txt\r\n";
-main.c(75): warning:  #111-D: statement is unreachable
-  		ota_data=get_config_params();
-main.c(82): warning:  #111-D: statement is unreachable
-  		LOAD_A(GD32_A_SADDR);
-main.c(99): warning:  #1-D: last line of file ends without a newline
-  }
-main.c: 12 warnings, 0 errors
-linking...
-Program Size: Code=6988 RO-data=472 RW-data=120 ZI-data=73992  
-FromELF: creating hex file...
-"..\OBJ\bootloader.axf" - 0 Error(s), 12 Warning(s).
+"..\OBJ\bootloader.axf" - 0 Error(s), 0 Warning(s).
 
 <h2>Software Packages used:</h2>
 
@@ -69,7 +40,7 @@ Package Vendor: GigaDevice
   D:\software\MDK5\Pack\GigaDevice\GD32F10x_DFP\2.1.0\Device\Include
 
 <h2>Collection of Component Files used:</h2>
-Build Time Elapsed:  00:00:02
+Build Time Elapsed:  00:00:00
 </pre>
 </body>
 </html>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 301 - 336
bootloader/OBJ/bootloader.htm


+ 2 - 2
bootloader/OBJ/bootloader_bootloader.dep

@@ -246,7 +246,7 @@ I (D:\software\MDK5\ARM\ARMCC\include\stdlib.h)(0x60252374)
 I (..\LIB\Include\gd32f10x_misc.h)(0x6538DC55)
 I (..\HW\Include\spi.h)(0x6538DC55)
 I (..\HW\Include\w25q32.h)(0x6538DC55)
-F (..\HW\Source\ota_message.c)(0x653CE3BE)(--c99 --gnu -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ..\USER -I ..\CMSIS\Include -I ..\HW\Include -I ..\LIB\Include

-ID:\software\MDK5\Pack\GigaDevice\GD32F10x_DFP\2.1.0\Device\Include

-D__UVISION_VERSION="536" -DGD32F10X_XD -DUSE_STDPERIPH_DRIVER

-o ..\obj\ota_message.o --omf_browse ..\obj\ota_message.crf --depend ..\obj\ota_message.d)
+F (..\HW\Source\ota_message.c)(0x653F2600)(--c99 --gnu -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ..\USER -I ..\CMSIS\Include -I ..\HW\Include -I ..\LIB\Include

-ID:\software\MDK5\Pack\GigaDevice\GD32F10x_DFP\2.1.0\Device\Include

-D__UVISION_VERSION="536" -DGD32F10X_XD -DUSE_STDPERIPH_DRIVER

-o ..\obj\ota_message.o --omf_browse ..\obj\ota_message.crf --depend ..\obj\ota_message.d)
 I (..\HW\Include\ota_message.h)(0x653B9E15)
 I (D:\software\MDK5\ARM\ARMCC\include\stdint.h)(0x6025237E)
 I (..\HW\Include\fmc.h)(0x653C6670)
@@ -686,7 +686,7 @@ I (..\LIB\Include\gd32f10x_can.h)(0x6538DC55)
 I (..\LIB\Include\gd32f10x_enet.h)(0x6538DC55)
 I (D:\software\MDK5\ARM\ARMCC\include\stdlib.h)(0x60252374)
 I (..\LIB\Include\gd32f10x_misc.h)(0x6538DC55)
-F (.\main.c)(0x653CE4C6)(--c99 --gnu -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ..\USER -I ..\CMSIS\Include -I ..\HW\Include -I ..\LIB\Include

-ID:\software\MDK5\Pack\GigaDevice\GD32F10x_DFP\2.1.0\Device\Include

-D__UVISION_VERSION="536" -DGD32F10X_XD -DUSE_STDPERIPH_DRIVER

-o ..\obj\main.o --omf_browse ..\obj\main.crf --depend ..\obj\main.d)
+F (.\main.c)(0x653F0338)(--c99 --gnu -c --cpu Cortex-M3 -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I ..\USER -I ..\CMSIS\Include -I ..\HW\Include -I ..\LIB\Include

-ID:\software\MDK5\Pack\GigaDevice\GD32F10x_DFP\2.1.0\Device\Include

-D__UVISION_VERSION="536" -DGD32F10X_XD -DUSE_STDPERIPH_DRIVER

-o ..\obj\main.o --omf_browse ..\obj\main.crf --depend ..\obj\main.d)
 I (..\CMSIS\Include\gd32f10x.h)(0x653C6D66)
 I (..\CMSIS\Include\core_cm3.h)(0x6538DC55)
 I (D:\software\MDK5\ARM\ARMCC\include\stdint.h)(0x6025237E)

BIN
bootloader/OBJ/main.crf


BIN
bootloader/OBJ/ota_message.crf


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1599 - 3275
bootloader/USER/JLinkLog.txt


+ 356 - 425
bootloader/USER/Listings/bootloader.map

@@ -92,9 +92,10 @@ Section Cross References
     ota_message.o(i.clear_ota_message_config_block) refers to ec800m.o(i.EC800MSendCmd) for EC800MSendCmd
     ota_message.o(i.clear_ota_message_config_block) refers to ec800m.o(i.WaitResponse) for WaitResponse
     ota_message.o(i.extract_data_from_buffer) refers to _scanf_int.o(.text) for _scanf_int
-    ota_message.o(i.extract_data_from_buffer) refers to strstr.o(.text) for strstr
+    ota_message.o(i.extract_data_from_buffer) refers to ota_message.o(i.find_string) for find_string
     ota_message.o(i.extract_data_from_buffer) refers to __0sscanf.o(.text) for __0sscanf
     ota_message.o(i.extract_data_from_buffer) refers to strchr.o(.text) for strchr
+    ota_message.o(i.find_string) refers to strstr.o(.text) for strstr
     ota_message.o(i.get_config_params) refers to ota_message.o(.data) for ota_message
     ota_message.o(i.load_ota_message_config_params) refers to malloc.o(i.malloc) for malloc
     ota_message.o(i.load_ota_message_config_params) refers to usart.o(i.dma_config_change) for dma_config_change
@@ -102,16 +103,8 @@ Section Cross References
     ota_message.o(i.load_ota_message_config_params) refers to ec800m.o(i.EC800MSendCmd) for EC800MSendCmd
     ota_message.o(i.load_ota_message_config_params) refers to usart.o(i.dma_config) for dma_config
     ota_message.o(i.load_ota_message_config_params) refers to ota_message.o(i.WaitForUpData) for WaitForUpData
-    ota_message.o(i.load_ota_message_config_params) refers to ota_message.o(i.parseIntField) for parseIntField
     ota_message.o(i.load_ota_message_config_params) refers to malloc.o(i.free) for free
     ota_message.o(i.load_ota_message_config_params) refers to ota_message.o(.data) for ota_message
-    ota_message.o(i.parseIntField) refers to strstr.o(.text) for strstr
-    ota_message.o(i.parseIntField) refers to strlen.o(.text) for strlen
-    ota_message.o(i.parseIntField) refers to strtol.o(.text) for strtol
-    ota_message.o(i.parseStringField) refers to _scanf_str.o(.text) for _scanf_string
-    ota_message.o(i.parseStringField) refers to strstr.o(.text) for strstr
-    ota_message.o(i.parseStringField) refers to strlen.o(.text) for strlen
-    ota_message.o(i.parseStringField) refers to __0sscanf.o(.text) for __0sscanf
     ota_message.o(i.save_ota_message_config_params) refers to ota_message.o(i.clear_ota_message_config_block) for clear_ota_message_config_block
     ota_message.o(i.save_ota_message_config_params) refers to ota_message.o(i.write_ota_message_to_flash) for write_ota_message_to_flash
     ota_message.o(i.save_ota_message_config_params) refers to ota_message.o(.data) for ota_message
@@ -292,9 +285,6 @@ Section Cross References
     __0sscanf.o(.text) refers to scanf_char.o(.text) for __vfscanf_char
     __0sscanf.o(.text) refers to _sgetc.o(.text) for _sgetc
     _scanf_int.o(.text) refers to _chval.o(.text) for _chval
-    strtol.o(.text) refers to ctype_o.o(.text) for __rt_ctype_table
-    strtol.o(.text) refers to _strtoul.o(.text) for _strtoul
-    strtol.o(.text) refers to errno.o(i.__aeabi_errno_addr) for __aeabi_errno_addr
     entry2.o(.ARM.Collect$$$$00000001) refers to entry2.o(.ARM.Collect$$$$00002712) for __lit__00000000
     entry2.o(.ARM.Collect$$$$00002712) refers to startup_gd32f10x_xd.o(STACK) for __initial_sp
     entry2.o(__vectab_stack_and_reset_area) refers to startup_gd32f10x_xd.o(STACK) for __initial_sp
@@ -302,31 +292,11 @@ Section Cross References
     entry5.o(.ARM.Collect$$$$00000004) refers to init.o(.text) for __scatterload
     entry9a.o(.ARM.Collect$$$$0000000B) refers to main.o(i.main) for main
     entry9b.o(.ARM.Collect$$$$0000000C) refers to main.o(i.main) for main
-    ctype_o.o(.text) refers to ctype_o.o(.constdata) for .constdata
-    ctype_o.o(.constdata) refers to ctype_o.o(.constdata) for __ctype_table
-    isalnum_o.o(.text) refers to ctype_o.o(.text) for __rt_ctype_table
-    isalpha_o.o(.text) refers to ctype_o.o(.text) for __rt_ctype_table
-    isblank_o.o(.text) refers to ctype_o.o(.constdata) for __ctype_table
-    iscntrl_o.o(.text) refers to ctype_o.o(.text) for __rt_ctype_table
-    isdigit_o.o(.text) refers to ctype_o.o(.text) for __rt_ctype_table
-    isgraph_o.o(.text) refers to ctype_o.o(.text) for __rt_ctype_table
-    islower_o.o(.text) refers to ctype_o.o(.text) for __rt_ctype_table
-    isprint_o.o(.text) refers to ctype_o.o(.text) for __rt_ctype_table
-    ispunct_o.o(.text) refers to ctype_o.o(.text) for __rt_ctype_table
-    isspace_o.o(.text) refers to ctype_o.o(.text) for __rt_ctype_table
-    isupper_o.o(.text) refers to ctype_o.o(.text) for __rt_ctype_table
-    isxdigit_o.o(.text) refers to ctype_o.o(.text) for __rt_ctype_table
-    errno.o(i.__aeabi_errno_addr) refers to errno.o(.data) for .data
-    errno.o(i.__read_errno) refers to errno.o(.data) for .data
-    errno.o(i.__set_errno) refers to errno.o(.data) for .data
     scanf_char.o(.text) refers to _scanf.o(.text) for __vfscanf
-    scanf_char.o(.text) refers to isspace_o.o(.text) for isspace
-    _strtoul.o(.text) refers to _chval.o(.text) for _chval
-    _strtoul.o(.text) refers to errno.o(i.__aeabi_errno_addr) for __aeabi_errno_addr
+    scanf_char.o(.text) refers to isspace_c.o(.text) for isspace
     init.o(.text) refers to entry5.o(.ARM.Collect$$$$00000004) for __main_after_scatterload
     isspace_c.o(.text) refers to ctype_c.o(.text) for __ctype_lookup
     _scanf.o(.text) refers (Weak) to _scanf_int.o(.text) for _scanf_int
-    _scanf.o(.text) refers (Weak) to _scanf_str.o(.text) for _scanf_string
     ctype_c.o(.text) refers to ctype_c.o(.constdata) for .constdata
 
 
@@ -371,7 +341,6 @@ Removing Unused input sections from the image.
     Removing ota_message.o(.revsh_text), (4 bytes).
     Removing ota_message.o(i.clear_ota_message_config_block), (304 bytes).
     Removing ota_message.o(i.get_config_params), (8 bytes).
-    Removing ota_message.o(i.parseStringField), (52 bytes).
     Removing ota_message.o(i.save_ota_message_config_params), (48 bytes).
     Removing ota_message.o(i.write_ota_message_to_flash), (20 bytes).
     Removing ec800m.o(.rev16_text), (4 bytes).
@@ -584,7 +553,7 @@ Removing Unused input sections from the image.
     Removing main.o(.rev16_text), (4 bytes).
     Removing main.o(.revsh_text), (4 bytes).
 
-249 unused section(s) (total 8694 bytes) removed from the image.
+248 unused section(s) (total 8642 bytes) removed from the image.
 
 ==============================================================================
 
@@ -594,41 +563,27 @@ Image Symbol Table
 
     Symbol Name                              Value     Ov Type        Size  Object(Section)
 
-    ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  ispunct_o.o ABSOLUTE
     ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  isspace_c.o ABSOLUTE
     ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  ctype_c.o ABSOLUTE
-    ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  islower_o.o ABSOLUTE
-    ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  isprint_o.o ABSOLUTE
-    ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  isspace_o.o ABSOLUTE
-    ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  isupper_o.o ABSOLUTE
-    ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  isxdigit_o.o ABSOLUTE
-    ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  ctype_o.o ABSOLUTE
-    ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  isalnum_o.o ABSOLUTE
-    ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  isalpha_o.o ABSOLUTE
-    ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  isblank_o.o ABSOLUTE
-    ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  iscntrl_o.o ABSOLUTE
-    ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  isdigit_o.o ABSOLUTE
-    ../clib/microlib/ctype/ctype.c           0x00000000   Number         0  isgraph_o.o ABSOLUTE
-    ../clib/microlib/errno.c                 0x00000000   Number         0  errno.o ABSOLUTE
-    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry2.o ABSOLUTE
-    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry.o ABSOLUTE
-    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry8b.o ABSOLUTE
-    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry8a.o ABSOLUTE
-    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry7a.o ABSOLUTE
-    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry5.o ABSOLUTE
-    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry12b.o ABSOLUTE
-    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry9a.o ABSOLUTE
     ../clib/microlib/init/entry.s            0x00000000   Number         0  entry9b.o ABSOLUTE
+    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry11b.o ABSOLUTE
     ../clib/microlib/init/entry.s            0x00000000   Number         0  entry10a.o ABSOLUTE
-    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry10b.o ABSOLUTE
     ../clib/microlib/init/entry.s            0x00000000   Number         0  entry11a.o ABSOLUTE
-    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry11b.o ABSOLUTE
+    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry12b.o ABSOLUTE
+    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry8a.o ABSOLUTE
+    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry9a.o ABSOLUTE
     ../clib/microlib/init/entry.s            0x00000000   Number         0  entry12a.o ABSOLUTE
+    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry10b.o ABSOLUTE
+    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry5.o ABSOLUTE
+    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry7a.o ABSOLUTE
     ../clib/microlib/init/entry.s            0x00000000   Number         0  entry7b.o ABSOLUTE
-    ../clib/microlib/malloc/malloc.c         0x00000000   Number         0  mallocr.o ABSOLUTE
-    ../clib/microlib/malloc/malloc.c         0x00000000   Number         0  mallocra.o ABSOLUTE
+    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry8b.o ABSOLUTE
+    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry2.o ABSOLUTE
+    ../clib/microlib/init/entry.s            0x00000000   Number         0  entry.o ABSOLUTE
     ../clib/microlib/malloc/malloc.c         0x00000000   Number         0  malloca.o ABSOLUTE
     ../clib/microlib/malloc/malloc.c         0x00000000   Number         0  malloc.o ABSOLUTE
+    ../clib/microlib/malloc/malloc.c         0x00000000   Number         0  mallocr.o ABSOLUTE
+    ../clib/microlib/malloc/malloc.c         0x00000000   Number         0  mallocra.o ABSOLUTE
     ../clib/microlib/malloc/mvars.c          0x00000000   Number         0  mvars.o ABSOLUTE
     ../clib/microlib/string/memcpy.c         0x00000000   Number         0  memcpya.o ABSOLUTE
     ../clib/microlib/string/memcpy.c         0x00000000   Number         0  memcpyb.o ABSOLUTE
@@ -637,15 +592,12 @@ Image Symbol Table
     ../clib/microlib/string/strcpy.c         0x00000000   Number         0  strcpy.o ABSOLUTE
     ../clib/microlib/string/strlen.c         0x00000000   Number         0  strlen.o ABSOLUTE
     ../clib/microlib/string/strstr.c         0x00000000   Number         0  strstr.o ABSOLUTE
+    ../clib/scanf.c                          0x00000000   Number         0  __0sscanf.o ABSOLUTE
     ../clib/scanf.c                          0x00000000   Number         0  scanf_char.o ABSOLUTE
-    ../clib/scanf.c                          0x00000000   Number         0  strtol.o ABSOLUTE
-    ../clib/scanf.c                          0x00000000   Number         0  _scanf_str.o ABSOLUTE
+    ../clib/scanf.c                          0x00000000   Number         0  _sgetc.o ABSOLUTE
     ../clib/scanf.c                          0x00000000   Number         0  _scanf_int.o ABSOLUTE
-    ../clib/scanf.c                          0x00000000   Number         0  __0sscanf.o ABSOLUTE
     ../clib/scanf.c                          0x00000000   Number         0  _scanf.o ABSOLUTE
     ../clib/scanf.c                          0x00000000   Number         0  _chval.o ABSOLUTE
-    ../clib/scanf.c                          0x00000000   Number         0  _strtoul.o ABSOLUTE
-    ../clib/scanf.c                          0x00000000   Number         0  _sgetc.o ABSOLUTE
     ..\CMSIS\Source\startup_gd32f10x_xd.s    0x00000000   Number         0  startup_gd32f10x_xd.o ABSOLUTE
     ..\CMSIS\Source\system_gd32f10x.c        0x00000000   Number         0  system_gd32f10x.o ABSOLUTE
     ..\HW\Source\boot.c                      0x00000000   Number         0  boot.o ABSOLUTE
@@ -713,108 +665,104 @@ Image Symbol Table
     .text                                    0x080001fa   Section        0  strcpy.o(.text)
     .text                                    0x0800020c   Section        0  __0sscanf.o(.text)
     .text                                    0x08000244   Section        0  _scanf_int.o(.text)
-    .text                                    0x08000390   Section        0  strtol.o(.text)
-    .text                                    0x08000400   Section        0  ctype_o.o(.text)
-    .text                                    0x08000408   Section        0  isspace_o.o(.text)
-    .text                                    0x0800041a   Section        0  _chval.o(.text)
-    .text                                    0x08000438   Section        0  scanf_char.o(.text)
-    _scanf_char_input                        0x08000439   Thumb Code    12  scanf_char.o(.text)
-    .text                                    0x08000460   Section        0  _sgetc.o(.text)
-    .text                                    0x080004a0   Section        0  _strtoul.o(.text)
-    .text                                    0x08000540   Section       36  init.o(.text)
-    .text                                    0x08000564   Section        0  _scanf.o(.text)
-    i.BusFault_Handler                       0x08000894   Section        0  gd32f10x_it.o(i.BusFault_Handler)
-    i.Clear_DMA_Buffer                       0x08000898   Section        0  usart.o(i.Clear_DMA_Buffer)
-    i.DMA0_Channel4_IRQHandler               0x080008b4   Section        0  gd32f10x_it.o(i.DMA0_Channel4_IRQHandler)
-    i.DebugMon_Handler                       0x080008c8   Section        0  gd32f10x_it.o(i.DebugMon_Handler)
-    i.Delay_Init                             0x080008ca   Section        0  delay.o(i.Delay_Init)
-    i.Delay_Ms                               0x080008d4   Section        0  delay.o(i.Delay_Ms)
-    i.Delay_Us                               0x080008ee   Section        0  delay.o(i.Delay_Us)
-    i.EC800MPwoerOn                          0x08000928   Section        0  ec800m.o(i.EC800MPwoerOn)
-    i.EC800MSendCmd                          0x08000980   Section        0  ec800m.o(i.EC800MSendCmd)
-    i.EC800MWaitReady                        0x080009b4   Section        0  ec800m.o(i.EC800MWaitReady)
-    i.HardFault_Handler                      0x080009c8   Section        0  gd32f10x_it.o(i.HardFault_Handler)
-    i.MemManage_Handler                      0x080009cc   Section        0  gd32f10x_it.o(i.MemManage_Handler)
-    i.NMI_Handler                            0x080009d0   Section        0  gd32f10x_it.o(i.NMI_Handler)
-    i.PendSV_Handler                         0x080009d2   Section        0  gd32f10x_it.o(i.PendSV_Handler)
-    i.SVC_Handler                            0x080009d4   Section        0  gd32f10x_it.o(i.SVC_Handler)
-    i.SysTick_Handler                        0x080009d6   Section        0  gd32f10x_it.o(i.SysTick_Handler)
-    i.SystemInit                             0x080009d8   Section        0  system_gd32f10x.o(i.SystemInit)
-    i.USART0_IRQHandler                      0x08000aac   Section        0  gd32f10x_it.o(i.USART0_IRQHandler)
-    i.UsageFault_Handler                     0x08000af0   Section        0  gd32f10x_it.o(i.UsageFault_Handler)
-    i.WaitForUpData                          0x08000af4   Section        0  ota_message.o(i.WaitForUpData)
-    i.WaitResponse                           0x08000b34   Section        0  ec800m.o(i.WaitResponse)
-    i.__aeabi_errno_addr                     0x08000b90   Section        0  errno.o(i.__aeabi_errno_addr)
-    i.__scatterload_copy                     0x08000b98   Section       14  handlers.o(i.__scatterload_copy)
-    i.__scatterload_null                     0x08000ba6   Section        2  handlers.o(i.__scatterload_null)
-    i.__scatterload_zeroinit                 0x08000ba8   Section       14  handlers.o(i.__scatterload_zeroinit)
-    i.checksum                               0x08000bb6   Section        0  ota_message.o(i.checksum)
-    checksum                                 0x08000bb7   Thumb Code    66  ota_message.o(i.checksum)
-    i.dma_channel_disable                    0x08000bf8   Section        0  gd32f10x_dma.o(i.dma_channel_disable)
-    i.dma_channel_enable                     0x08000c2a   Section        0  gd32f10x_dma.o(i.dma_channel_enable)
-    i.dma_circulation_disable                0x08000c5c   Section        0  gd32f10x_dma.o(i.dma_circulation_disable)
-    i.dma_config                             0x08000c90   Section        0  usart.o(i.dma_config)
-    i.dma_config_change                      0x08000d18   Section        0  usart.o(i.dma_config_change)
-    i.dma_deinit                             0x08000d98   Section        0  gd32f10x_dma.o(i.dma_deinit)
-    i.dma_init                               0x08000e08   Section        0  gd32f10x_dma.o(i.dma_init)
-    i.dma_interrupt_enable                   0x08000f36   Section        0  gd32f10x_dma.o(i.dma_interrupt_enable)
-    i.dma_interrupt_flag_clear               0x08000f68   Section        0  gd32f10x_dma.o(i.dma_interrupt_flag_clear)
-    i.dma_memory_to_memory_disable           0x08000f78   Section        0  gd32f10x_dma.o(i.dma_memory_to_memory_disable)
-    i.dma_periph_and_channel_check           0x08000fac   Section        0  gd32f10x_dma.o(i.dma_periph_and_channel_check)
-    dma_periph_and_channel_check             0x08000fad   Thumb Code    18  gd32f10x_dma.o(i.dma_periph_and_channel_check)
-    i.extract_data_from_buffer               0x08000fc4   Section        0  ota_message.o(i.extract_data_from_buffer)
-    extract_data_from_buffer                 0x08000fc5   Thumb Code    78  ota_message.o(i.extract_data_from_buffer)
-    i.free                                   0x08001024   Section        0  malloc.o(i.free)
-    i.fwdgt_counter_reload                   0x08001074   Section        0  gd32f10x_fwdgt.o(i.fwdgt_counter_reload)
-    i.fwdgt_write_enable                     0x08001084   Section        0  gd32f10x_fwdgt.o(i.fwdgt_write_enable)
-    i.gd_EC800M_pin_init                     0x08001094   Section        0  usart.o(i.gd_EC800M_pin_init)
-    i.gd_com_init                            0x080010dc   Section        0  usart.o(i.gd_com_init)
-    i.gd_pull_EC800M_pwr_down                0x080011d8   Section        0  usart.o(i.gd_pull_EC800M_pwr_down)
-    i.gd_pull_EC800M_pwr_up                  0x080011e4   Section        0  usart.o(i.gd_pull_EC800M_pwr_up)
-    i.gd_pull_EC800M_rst_down                0x080011f0   Section        0  usart.o(i.gd_pull_EC800M_rst_down)
-    i.gd_pull_EC800M_rst_up                  0x08001200   Section        0  usart.o(i.gd_pull_EC800M_rst_up)
-    i.gpio_bit_set                           0x08001210   Section        0  gd32f10x_gpio.o(i.gpio_bit_set)
-    i.gpio_init                              0x08001214   Section        0  gd32f10x_gpio.o(i.gpio_init)
-    i.gpio_pin_remap_config                  0x080012c0   Section        0  gd32f10x_gpio.o(i.gpio_pin_remap_config)
-    i.load_ota_message_config_params         0x08001350   Section        0  ota_message.o(i.load_ota_message_config_params)
-    i.main                                   0x080013f8   Section        0  main.o(i.main)
-    i.malloc                                 0x08001440   Section        0  malloc.o(i.malloc)
-    i.my_test                                0x080014ac   Section        0  main.o(i.my_test)
-    i.nvic_config                            0x0800168c   Section        0  usart.o(i.nvic_config)
-    i.nvic_irq_enable                        0x080016ac   Section        0  gd32f10x_misc.o(i.nvic_irq_enable)
-    i.nvic_priority_group_set                0x08001758   Section        0  gd32f10x_misc.o(i.nvic_priority_group_set)
-    i.nvic_vector_table_set                  0x0800176c   Section        0  gd32f10x_misc.o(i.nvic_vector_table_set)
-    i.parseIntField                          0x08001784   Section        0  ota_message.o(i.parseIntField)
-    i.rcu_clock_freq_get                     0x080017b0   Section        0  gd32f10x_rcu.o(i.rcu_clock_freq_get)
-    i.rcu_periph_clock_enable                0x080018d4   Section        0  gd32f10x_rcu.o(i.rcu_periph_clock_enable)
-    i.rcu_periph_reset_disable               0x080018f4   Section        0  gd32f10x_rcu.o(i.rcu_periph_reset_disable)
-    i.rcu_periph_reset_enable                0x08001914   Section        0  gd32f10x_rcu.o(i.rcu_periph_reset_enable)
-    i.system_clock_108m_hxtal                0x08001934   Section        0  system_gd32f10x.o(i.system_clock_108m_hxtal)
-    system_clock_108m_hxtal                  0x08001935   Thumb Code   182  system_gd32f10x.o(i.system_clock_108m_hxtal)
-    i.system_clock_config                    0x080019f8   Section        0  system_gd32f10x.o(i.system_clock_config)
-    system_clock_config                      0x080019f9   Thumb Code     8  system_gd32f10x.o(i.system_clock_config)
-    i.systick_clksource_set                  0x08001a00   Section        0  gd32f10x_misc.o(i.systick_clksource_set)
-    i.task_fwdgt_reload                      0x08001a28   Section        0  main.o(i.task_fwdgt_reload)
-    i.usart_baudrate_set                     0x08001a34   Section        0  gd32f10x_usart.o(i.usart_baudrate_set)
-    i.usart_data_receive                     0x08001ac4   Section        0  gd32f10x_usart.o(i.usart_data_receive)
-    i.usart_data_transmit                    0x08001ace   Section        0  gd32f10x_usart.o(i.usart_data_transmit)
-    i.usart_deinit                           0x08001ad8   Section        0  gd32f10x_usart.o(i.usart_deinit)
-    i.usart_dma_transmit_config              0x08001b68   Section        0  gd32f10x_usart.o(i.usart_dma_transmit_config)
-    i.usart_enable                           0x08001b78   Section        0  gd32f10x_usart.o(i.usart_enable)
-    i.usart_flag_get                         0x08001b82   Section        0  gd32f10x_usart.o(i.usart_flag_get)
-    i.usart_hardware_flow_cts_config         0x08001ba0   Section        0  gd32f10x_usart.o(i.usart_hardware_flow_cts_config)
-    i.usart_hardware_flow_rts_config         0x08001bb0   Section        0  gd32f10x_usart.o(i.usart_hardware_flow_rts_config)
-    i.usart_interrupt_enable                 0x08001bc0   Section        0  gd32f10x_usart.o(i.usart_interrupt_enable)
-    i.usart_interrupt_flag_clear             0x08001bda   Section        0  gd32f10x_usart.o(i.usart_interrupt_flag_clear)
-    i.usart_interrupt_flag_get               0x08001bf4   Section        0  gd32f10x_usart.o(i.usart_interrupt_flag_get)
-    i.usart_parity_config                    0x08001c2c   Section        0  gd32f10x_usart.o(i.usart_parity_config)
-    i.usart_receive_config                   0x08001c3c   Section        0  gd32f10x_usart.o(i.usart_receive_config)
-    i.usart_stop_bit_set                     0x08001c4c   Section        0  gd32f10x_usart.o(i.usart_stop_bit_set)
-    i.usart_transmit_config                  0x08001c5c   Section        0  gd32f10x_usart.o(i.usart_transmit_config)
-    i.usart_word_length_set                  0x08001c6c   Section        0  gd32f10x_usart.o(i.usart_word_length_set)
-    .constdata                               0x08001c7c   Section      129  ctype_o.o(.constdata)
-    .constdata                               0x08001d00   Section        4  ctype_o.o(.constdata)
-    table                                    0x08001d00   Data           4  ctype_o.o(.constdata)
+    .text                                    0x08000390   Section        0  _chval.o(.text)
+    .text                                    0x080003ac   Section        0  scanf_char.o(.text)
+    _scanf_char_input                        0x080003ad   Thumb Code    12  scanf_char.o(.text)
+    .text                                    0x080003d4   Section        0  _sgetc.o(.text)
+    .text                                    0x08000414   Section       36  init.o(.text)
+    .text                                    0x08000438   Section        0  isspace_c.o(.text)
+    .text                                    0x08000444   Section        0  _scanf.o(.text)
+    .text                                    0x08000774   Section        0  ctype_c.o(.text)
+    i.BusFault_Handler                       0x0800079c   Section        0  gd32f10x_it.o(i.BusFault_Handler)
+    i.Clear_DMA_Buffer                       0x080007a0   Section        0  usart.o(i.Clear_DMA_Buffer)
+    i.DMA0_Channel4_IRQHandler               0x080007bc   Section        0  gd32f10x_it.o(i.DMA0_Channel4_IRQHandler)
+    i.DebugMon_Handler                       0x080007d0   Section        0  gd32f10x_it.o(i.DebugMon_Handler)
+    i.Delay_Init                             0x080007d2   Section        0  delay.o(i.Delay_Init)
+    i.Delay_Ms                               0x080007dc   Section        0  delay.o(i.Delay_Ms)
+    i.Delay_Us                               0x080007f6   Section        0  delay.o(i.Delay_Us)
+    i.EC800MPwoerOn                          0x08000830   Section        0  ec800m.o(i.EC800MPwoerOn)
+    i.EC800MSendCmd                          0x08000888   Section        0  ec800m.o(i.EC800MSendCmd)
+    i.EC800MWaitReady                        0x080008bc   Section        0  ec800m.o(i.EC800MWaitReady)
+    i.HardFault_Handler                      0x080008d0   Section        0  gd32f10x_it.o(i.HardFault_Handler)
+    i.MemManage_Handler                      0x080008d4   Section        0  gd32f10x_it.o(i.MemManage_Handler)
+    i.NMI_Handler                            0x080008d8   Section        0  gd32f10x_it.o(i.NMI_Handler)
+    i.PendSV_Handler                         0x080008da   Section        0  gd32f10x_it.o(i.PendSV_Handler)
+    i.SVC_Handler                            0x080008dc   Section        0  gd32f10x_it.o(i.SVC_Handler)
+    i.SysTick_Handler                        0x080008de   Section        0  gd32f10x_it.o(i.SysTick_Handler)
+    i.SystemInit                             0x080008e0   Section        0  system_gd32f10x.o(i.SystemInit)
+    i.USART0_IRQHandler                      0x080009b4   Section        0  gd32f10x_it.o(i.USART0_IRQHandler)
+    i.UsageFault_Handler                     0x080009f8   Section        0  gd32f10x_it.o(i.UsageFault_Handler)
+    i.WaitForUpData                          0x080009fc   Section        0  ota_message.o(i.WaitForUpData)
+    i.WaitResponse                           0x08000a3c   Section        0  ec800m.o(i.WaitResponse)
+    i.__scatterload_copy                     0x08000a98   Section       14  handlers.o(i.__scatterload_copy)
+    i.__scatterload_null                     0x08000aa6   Section        2  handlers.o(i.__scatterload_null)
+    i.__scatterload_zeroinit                 0x08000aa8   Section       14  handlers.o(i.__scatterload_zeroinit)
+    i.checksum                               0x08000ab6   Section        0  ota_message.o(i.checksum)
+    checksum                                 0x08000ab7   Thumb Code    66  ota_message.o(i.checksum)
+    i.dma_channel_disable                    0x08000af8   Section        0  gd32f10x_dma.o(i.dma_channel_disable)
+    i.dma_channel_enable                     0x08000b2a   Section        0  gd32f10x_dma.o(i.dma_channel_enable)
+    i.dma_circulation_disable                0x08000b5c   Section        0  gd32f10x_dma.o(i.dma_circulation_disable)
+    i.dma_config                             0x08000b90   Section        0  usart.o(i.dma_config)
+    i.dma_config_change                      0x08000c18   Section        0  usart.o(i.dma_config_change)
+    i.dma_deinit                             0x08000c98   Section        0  gd32f10x_dma.o(i.dma_deinit)
+    i.dma_init                               0x08000d08   Section        0  gd32f10x_dma.o(i.dma_init)
+    i.dma_interrupt_enable                   0x08000e36   Section        0  gd32f10x_dma.o(i.dma_interrupt_enable)
+    i.dma_interrupt_flag_clear               0x08000e68   Section        0  gd32f10x_dma.o(i.dma_interrupt_flag_clear)
+    i.dma_memory_to_memory_disable           0x08000e78   Section        0  gd32f10x_dma.o(i.dma_memory_to_memory_disable)
+    i.dma_periph_and_channel_check           0x08000eac   Section        0  gd32f10x_dma.o(i.dma_periph_and_channel_check)
+    dma_periph_and_channel_check             0x08000ead   Thumb Code    18  gd32f10x_dma.o(i.dma_periph_and_channel_check)
+    i.extract_data_from_buffer               0x08000ec4   Section        0  ota_message.o(i.extract_data_from_buffer)
+    extract_data_from_buffer                 0x08000ec5   Thumb Code    80  ota_message.o(i.extract_data_from_buffer)
+    i.find_string                            0x08000f24   Section        0  ota_message.o(i.find_string)
+    find_string                              0x08000f25   Thumb Code    56  ota_message.o(i.find_string)
+    i.free                                   0x08000f5c   Section        0  malloc.o(i.free)
+    i.fwdgt_counter_reload                   0x08000fac   Section        0  gd32f10x_fwdgt.o(i.fwdgt_counter_reload)
+    i.fwdgt_write_enable                     0x08000fbc   Section        0  gd32f10x_fwdgt.o(i.fwdgt_write_enable)
+    i.gd_EC800M_pin_init                     0x08000fcc   Section        0  usart.o(i.gd_EC800M_pin_init)
+    i.gd_com_init                            0x08001014   Section        0  usart.o(i.gd_com_init)
+    i.gd_pull_EC800M_pwr_down                0x08001110   Section        0  usart.o(i.gd_pull_EC800M_pwr_down)
+    i.gd_pull_EC800M_pwr_up                  0x0800111c   Section        0  usart.o(i.gd_pull_EC800M_pwr_up)
+    i.gd_pull_EC800M_rst_down                0x08001128   Section        0  usart.o(i.gd_pull_EC800M_rst_down)
+    i.gd_pull_EC800M_rst_up                  0x08001138   Section        0  usart.o(i.gd_pull_EC800M_rst_up)
+    i.gpio_bit_set                           0x08001148   Section        0  gd32f10x_gpio.o(i.gpio_bit_set)
+    i.gpio_init                              0x0800114c   Section        0  gd32f10x_gpio.o(i.gpio_init)
+    i.gpio_pin_remap_config                  0x080011f8   Section        0  gd32f10x_gpio.o(i.gpio_pin_remap_config)
+    i.load_ota_message_config_params         0x08001288   Section        0  ota_message.o(i.load_ota_message_config_params)
+    i.main                                   0x0800130c   Section        0  main.o(i.main)
+    i.malloc                                 0x08001354   Section        0  malloc.o(i.malloc)
+    i.my_test                                0x080013c0   Section        0  main.o(i.my_test)
+    i.nvic_config                            0x08001598   Section        0  usart.o(i.nvic_config)
+    i.nvic_irq_enable                        0x080015b8   Section        0  gd32f10x_misc.o(i.nvic_irq_enable)
+    i.nvic_priority_group_set                0x08001664   Section        0  gd32f10x_misc.o(i.nvic_priority_group_set)
+    i.nvic_vector_table_set                  0x08001678   Section        0  gd32f10x_misc.o(i.nvic_vector_table_set)
+    i.rcu_clock_freq_get                     0x08001690   Section        0  gd32f10x_rcu.o(i.rcu_clock_freq_get)
+    i.rcu_periph_clock_enable                0x080017b4   Section        0  gd32f10x_rcu.o(i.rcu_periph_clock_enable)
+    i.rcu_periph_reset_disable               0x080017d4   Section        0  gd32f10x_rcu.o(i.rcu_periph_reset_disable)
+    i.rcu_periph_reset_enable                0x080017f4   Section        0  gd32f10x_rcu.o(i.rcu_periph_reset_enable)
+    i.system_clock_108m_hxtal                0x08001814   Section        0  system_gd32f10x.o(i.system_clock_108m_hxtal)
+    system_clock_108m_hxtal                  0x08001815   Thumb Code   182  system_gd32f10x.o(i.system_clock_108m_hxtal)
+    i.system_clock_config                    0x080018d8   Section        0  system_gd32f10x.o(i.system_clock_config)
+    system_clock_config                      0x080018d9   Thumb Code     8  system_gd32f10x.o(i.system_clock_config)
+    i.systick_clksource_set                  0x080018e0   Section        0  gd32f10x_misc.o(i.systick_clksource_set)
+    i.task_fwdgt_reload                      0x08001908   Section        0  main.o(i.task_fwdgt_reload)
+    i.usart_baudrate_set                     0x08001914   Section        0  gd32f10x_usart.o(i.usart_baudrate_set)
+    i.usart_data_receive                     0x080019a4   Section        0  gd32f10x_usart.o(i.usart_data_receive)
+    i.usart_data_transmit                    0x080019ae   Section        0  gd32f10x_usart.o(i.usart_data_transmit)
+    i.usart_deinit                           0x080019b8   Section        0  gd32f10x_usart.o(i.usart_deinit)
+    i.usart_dma_transmit_config              0x08001a48   Section        0  gd32f10x_usart.o(i.usart_dma_transmit_config)
+    i.usart_enable                           0x08001a58   Section        0  gd32f10x_usart.o(i.usart_enable)
+    i.usart_flag_get                         0x08001a62   Section        0  gd32f10x_usart.o(i.usart_flag_get)
+    i.usart_hardware_flow_cts_config         0x08001a80   Section        0  gd32f10x_usart.o(i.usart_hardware_flow_cts_config)
+    i.usart_hardware_flow_rts_config         0x08001a90   Section        0  gd32f10x_usart.o(i.usart_hardware_flow_rts_config)
+    i.usart_interrupt_enable                 0x08001aa0   Section        0  gd32f10x_usart.o(i.usart_interrupt_enable)
+    i.usart_interrupt_flag_clear             0x08001aba   Section        0  gd32f10x_usart.o(i.usart_interrupt_flag_clear)
+    i.usart_interrupt_flag_get               0x08001ad4   Section        0  gd32f10x_usart.o(i.usart_interrupt_flag_get)
+    i.usart_parity_config                    0x08001b0c   Section        0  gd32f10x_usart.o(i.usart_parity_config)
+    i.usart_receive_config                   0x08001b1c   Section        0  gd32f10x_usart.o(i.usart_receive_config)
+    i.usart_stop_bit_set                     0x08001b2c   Section        0  gd32f10x_usart.o(i.usart_stop_bit_set)
+    i.usart_transmit_config                  0x08001b3c   Section        0  gd32f10x_usart.o(i.usart_transmit_config)
+    i.usart_word_length_set                  0x08001b4c   Section        0  gd32f10x_usart.o(i.usart_word_length_set)
+    .constdata                               0x08001b5c   Section       64  ctype_c.o(.constdata)
     .data                                    0x20000000   Section        8  ota_message.o(.data)
     ota_message                              0x20000000   Data           8  ota_message.o(.data)
     .data                                    0x20000008   Section       84  usart.o(.data)
@@ -829,11 +777,9 @@ Image Symbol Table
     ota_message                              0x20000064   Data           8  main.o(.data)
     .data                                    0x2000006c   Section        4  mvars.o(.data)
     .data                                    0x20000070   Section        4  mvars.o(.data)
-    .data                                    0x20000074   Section        4  errno.o(.data)
-    _errno                                   0x20000074   Data           4  errno.o(.data)
-    .bss                                     0x20000078   Section     4354  usart.o(.bss)
-    HEAP                                     0x20001180   Section    65536  startup_gd32f10x_xd.o(HEAP)
-    STACK                                    0x20011180   Section     4096  startup_gd32f10x_xd.o(STACK)
+    .bss                                     0x20000074   Section     4354  usart.o(.bss)
+    HEAP                                     0x20001178   Section    65536  startup_gd32f10x_xd.o(HEAP)
+    STACK                                    0x20011178   Section     4096  startup_gd32f10x_xd.o(STACK)
 
     Global Symbols
 
@@ -849,6 +795,7 @@ Image Symbol Table
     _microlib_exit                            - Undefined Weak Reference
     _scanf_longlong                           - Undefined Weak Reference
     _scanf_real                               - Undefined Weak Reference
+    _scanf_string                             - Undefined Weak Reference
     __Vectors_Size                           0x00000130   Number         0  startup_gd32f10x_xd.o ABSOLUTE
     __Vectors                                0x08000000   Data           4  startup_gd32f10x_xd.o(RESET)
     __Vectors_End                            0x08000130   Data           0  startup_gd32f10x_xd.o(RESET)
@@ -937,111 +884,106 @@ Image Symbol Table
     strcpy                                   0x080001fb   Thumb Code    18  strcpy.o(.text)
     __0sscanf                                0x0800020d   Thumb Code    48  __0sscanf.o(.text)
     _scanf_int                               0x08000245   Thumb Code   332  _scanf_int.o(.text)
-    strtol                                   0x08000391   Thumb Code   112  strtol.o(.text)
-    __rt_ctype_table                         0x08000401   Thumb Code     4  ctype_o.o(.text)
-    isspace                                  0x08000409   Thumb Code    18  isspace_o.o(.text)
-    _chval                                   0x0800041b   Thumb Code    28  _chval.o(.text)
-    __vfscanf_char                           0x08000445   Thumb Code    20  scanf_char.o(.text)
-    _sgetc                                   0x08000461   Thumb Code    30  _sgetc.o(.text)
-    _sbackspace                              0x0800047f   Thumb Code    34  _sgetc.o(.text)
-    _strtoul                                 0x080004a1   Thumb Code   158  _strtoul.o(.text)
-    __scatterload                            0x08000541   Thumb Code    28  init.o(.text)
-    __scatterload_rt2                        0x08000541   Thumb Code     0  init.o(.text)
-    __vfscanf                                0x08000565   Thumb Code   810  _scanf.o(.text)
-    BusFault_Handler                         0x08000895   Thumb Code     4  gd32f10x_it.o(i.BusFault_Handler)
-    Clear_DMA_Buffer                         0x08000899   Thumb Code    20  usart.o(i.Clear_DMA_Buffer)
-    DMA0_Channel4_IRQHandler                 0x080008b5   Thumb Code    14  gd32f10x_it.o(i.DMA0_Channel4_IRQHandler)
-    DebugMon_Handler                         0x080008c9   Thumb Code     2  gd32f10x_it.o(i.DebugMon_Handler)
-    Delay_Init                               0x080008cb   Thumb Code    10  delay.o(i.Delay_Init)
-    Delay_Ms                                 0x080008d5   Thumb Code    26  delay.o(i.Delay_Ms)
-    Delay_Us                                 0x080008ef   Thumb Code    58  delay.o(i.Delay_Us)
-    EC800MPwoerOn                            0x08000929   Thumb Code    82  ec800m.o(i.EC800MPwoerOn)
-    EC800MSendCmd                            0x08000981   Thumb Code    48  ec800m.o(i.EC800MSendCmd)
-    EC800MWaitReady                          0x080009b5   Thumb Code    14  ec800m.o(i.EC800MWaitReady)
-    HardFault_Handler                        0x080009c9   Thumb Code     4  gd32f10x_it.o(i.HardFault_Handler)
-    MemManage_Handler                        0x080009cd   Thumb Code     4  gd32f10x_it.o(i.MemManage_Handler)
-    NMI_Handler                              0x080009d1   Thumb Code     2  gd32f10x_it.o(i.NMI_Handler)
-    PendSV_Handler                           0x080009d3   Thumb Code     2  gd32f10x_it.o(i.PendSV_Handler)
-    SVC_Handler                              0x080009d5   Thumb Code     2  gd32f10x_it.o(i.SVC_Handler)
-    SysTick_Handler                          0x080009d7   Thumb Code     2  gd32f10x_it.o(i.SysTick_Handler)
-    SystemInit                               0x080009d9   Thumb Code   196  system_gd32f10x.o(i.SystemInit)
-    USART0_IRQHandler                        0x08000aad   Thumb Code    50  gd32f10x_it.o(i.USART0_IRQHandler)
-    UsageFault_Handler                       0x08000af1   Thumb Code     4  gd32f10x_it.o(i.UsageFault_Handler)
-    WaitForUpData                            0x08000af5   Thumb Code    60  ota_message.o(i.WaitForUpData)
-    WaitResponse                             0x08000b35   Thumb Code    82  ec800m.o(i.WaitResponse)
-    __aeabi_errno_addr                       0x08000b91   Thumb Code     4  errno.o(i.__aeabi_errno_addr)
-    __rt_errno_addr                          0x08000b91   Thumb Code     0  errno.o(i.__aeabi_errno_addr)
-    __scatterload_copy                       0x08000b99   Thumb Code    14  handlers.o(i.__scatterload_copy)
-    __scatterload_null                       0x08000ba7   Thumb Code     2  handlers.o(i.__scatterload_null)
-    __scatterload_zeroinit                   0x08000ba9   Thumb Code    14  handlers.o(i.__scatterload_zeroinit)
-    dma_channel_disable                      0x08000bf9   Thumb Code    50  gd32f10x_dma.o(i.dma_channel_disable)
-    dma_channel_enable                       0x08000c2b   Thumb Code    50  gd32f10x_dma.o(i.dma_channel_enable)
-    dma_circulation_disable                  0x08000c5d   Thumb Code    50  gd32f10x_dma.o(i.dma_circulation_disable)
-    dma_config                               0x08000c91   Thumb Code   122  usart.o(i.dma_config)
-    dma_config_change                        0x08000d19   Thumb Code   120  usart.o(i.dma_config_change)
-    dma_deinit                               0x08000d99   Thumb Code   112  gd32f10x_dma.o(i.dma_deinit)
-    dma_init                                 0x08000e09   Thumb Code   302  gd32f10x_dma.o(i.dma_init)
-    dma_interrupt_enable                     0x08000f37   Thumb Code    50  gd32f10x_dma.o(i.dma_interrupt_enable)
-    dma_interrupt_flag_clear                 0x08000f69   Thumb Code    16  gd32f10x_dma.o(i.dma_interrupt_flag_clear)
-    dma_memory_to_memory_disable             0x08000f79   Thumb Code    50  gd32f10x_dma.o(i.dma_memory_to_memory_disable)
-    free                                     0x08001025   Thumb Code    76  malloc.o(i.free)
-    fwdgt_counter_reload                     0x08001075   Thumb Code    10  gd32f10x_fwdgt.o(i.fwdgt_counter_reload)
-    fwdgt_write_enable                       0x08001085   Thumb Code    10  gd32f10x_fwdgt.o(i.fwdgt_write_enable)
-    gd_EC800M_pin_init                       0x08001095   Thumb Code    62  usart.o(i.gd_EC800M_pin_init)
-    gd_com_init                              0x080010dd   Thumb Code   210  usart.o(i.gd_com_init)
-    gd_pull_EC800M_pwr_down                  0x080011d9   Thumb Code     8  usart.o(i.gd_pull_EC800M_pwr_down)
-    gd_pull_EC800M_pwr_up                    0x080011e5   Thumb Code     8  usart.o(i.gd_pull_EC800M_pwr_up)
-    gd_pull_EC800M_rst_down                  0x080011f1   Thumb Code    10  usart.o(i.gd_pull_EC800M_rst_down)
-    gd_pull_EC800M_rst_up                    0x08001201   Thumb Code    10  usart.o(i.gd_pull_EC800M_rst_up)
-    gpio_bit_set                             0x08001211   Thumb Code     4  gd32f10x_gpio.o(i.gpio_bit_set)
-    gpio_init                                0x08001215   Thumb Code   172  gd32f10x_gpio.o(i.gpio_init)
-    gpio_pin_remap_config                    0x080012c1   Thumb Code   138  gd32f10x_gpio.o(i.gpio_pin_remap_config)
-    load_ota_message_config_params           0x08001351   Thumb Code   112  ota_message.o(i.load_ota_message_config_params)
-    main                                     0x080013f9   Thumb Code    68  main.o(i.main)
-    malloc                                   0x08001441   Thumb Code    92  malloc.o(i.malloc)
-    my_test                                  0x080014ad   Thumb Code   290  main.o(i.my_test)
-    nvic_config                              0x0800168d   Thumb Code    32  usart.o(i.nvic_config)
-    nvic_irq_enable                          0x080016ad   Thumb Code   162  gd32f10x_misc.o(i.nvic_irq_enable)
-    nvic_priority_group_set                  0x08001759   Thumb Code    10  gd32f10x_misc.o(i.nvic_priority_group_set)
-    nvic_vector_table_set                    0x0800176d   Thumb Code    16  gd32f10x_misc.o(i.nvic_vector_table_set)
-    parseIntField                            0x08001785   Thumb Code    42  ota_message.o(i.parseIntField)
-    rcu_clock_freq_get                       0x080017b1   Thumb Code   264  gd32f10x_rcu.o(i.rcu_clock_freq_get)
-    rcu_periph_clock_enable                  0x080018d5   Thumb Code    28  gd32f10x_rcu.o(i.rcu_periph_clock_enable)
-    rcu_periph_reset_disable                 0x080018f5   Thumb Code    28  gd32f10x_rcu.o(i.rcu_periph_reset_disable)
-    rcu_periph_reset_enable                  0x08001915   Thumb Code    28  gd32f10x_rcu.o(i.rcu_periph_reset_enable)
-    systick_clksource_set                    0x08001a01   Thumb Code    40  gd32f10x_misc.o(i.systick_clksource_set)
-    task_fwdgt_reload                        0x08001a29   Thumb Code    12  main.o(i.task_fwdgt_reload)
-    usart_baudrate_set                       0x08001a35   Thumb Code   136  gd32f10x_usart.o(i.usart_baudrate_set)
-    usart_data_receive                       0x08001ac5   Thumb Code    10  gd32f10x_usart.o(i.usart_data_receive)
-    usart_data_transmit                      0x08001acf   Thumb Code     8  gd32f10x_usart.o(i.usart_data_transmit)
-    usart_deinit                             0x08001ad9   Thumb Code   136  gd32f10x_usart.o(i.usart_deinit)
-    usart_dma_transmit_config                0x08001b69   Thumb Code    16  gd32f10x_usart.o(i.usart_dma_transmit_config)
-    usart_enable                             0x08001b79   Thumb Code    10  gd32f10x_usart.o(i.usart_enable)
-    usart_flag_get                           0x08001b83   Thumb Code    30  gd32f10x_usart.o(i.usart_flag_get)
-    usart_hardware_flow_cts_config           0x08001ba1   Thumb Code    16  gd32f10x_usart.o(i.usart_hardware_flow_cts_config)
-    usart_hardware_flow_rts_config           0x08001bb1   Thumb Code    16  gd32f10x_usart.o(i.usart_hardware_flow_rts_config)
-    usart_interrupt_enable                   0x08001bc1   Thumb Code    26  gd32f10x_usart.o(i.usart_interrupt_enable)
-    usart_interrupt_flag_clear               0x08001bdb   Thumb Code    26  gd32f10x_usart.o(i.usart_interrupt_flag_clear)
-    usart_interrupt_flag_get                 0x08001bf5   Thumb Code    56  gd32f10x_usart.o(i.usart_interrupt_flag_get)
-    usart_parity_config                      0x08001c2d   Thumb Code    16  gd32f10x_usart.o(i.usart_parity_config)
-    usart_receive_config                     0x08001c3d   Thumb Code    16  gd32f10x_usart.o(i.usart_receive_config)
-    usart_stop_bit_set                       0x08001c4d   Thumb Code    16  gd32f10x_usart.o(i.usart_stop_bit_set)
-    usart_transmit_config                    0x08001c5d   Thumb Code    16  gd32f10x_usart.o(i.usart_transmit_config)
-    usart_word_length_set                    0x08001c6d   Thumb Code    16  gd32f10x_usart.o(i.usart_word_length_set)
-    __ctype_table                            0x08001c7c   Data         129  ctype_o.o(.constdata)
-    Region$$Table$$Base                      0x08001d04   Number         0  anon$$obj.o(Region$$Table)
-    Region$$Table$$Limit                     0x08001d24   Number         0  anon$$obj.o(Region$$Table)
+    _chval                                   0x08000391   Thumb Code    28  _chval.o(.text)
+    __vfscanf_char                           0x080003b9   Thumb Code    20  scanf_char.o(.text)
+    _sgetc                                   0x080003d5   Thumb Code    30  _sgetc.o(.text)
+    _sbackspace                              0x080003f3   Thumb Code    34  _sgetc.o(.text)
+    __scatterload                            0x08000415   Thumb Code    28  init.o(.text)
+    __scatterload_rt2                        0x08000415   Thumb Code     0  init.o(.text)
+    isspace                                  0x08000439   Thumb Code    10  isspace_c.o(.text)
+    __vfscanf                                0x08000445   Thumb Code   810  _scanf.o(.text)
+    __ctype_lookup                           0x08000775   Thumb Code    34  ctype_c.o(.text)
+    BusFault_Handler                         0x0800079d   Thumb Code     4  gd32f10x_it.o(i.BusFault_Handler)
+    Clear_DMA_Buffer                         0x080007a1   Thumb Code    20  usart.o(i.Clear_DMA_Buffer)
+    DMA0_Channel4_IRQHandler                 0x080007bd   Thumb Code    14  gd32f10x_it.o(i.DMA0_Channel4_IRQHandler)
+    DebugMon_Handler                         0x080007d1   Thumb Code     2  gd32f10x_it.o(i.DebugMon_Handler)
+    Delay_Init                               0x080007d3   Thumb Code    10  delay.o(i.Delay_Init)
+    Delay_Ms                                 0x080007dd   Thumb Code    26  delay.o(i.Delay_Ms)
+    Delay_Us                                 0x080007f7   Thumb Code    58  delay.o(i.Delay_Us)
+    EC800MPwoerOn                            0x08000831   Thumb Code    82  ec800m.o(i.EC800MPwoerOn)
+    EC800MSendCmd                            0x08000889   Thumb Code    48  ec800m.o(i.EC800MSendCmd)
+    EC800MWaitReady                          0x080008bd   Thumb Code    14  ec800m.o(i.EC800MWaitReady)
+    HardFault_Handler                        0x080008d1   Thumb Code     4  gd32f10x_it.o(i.HardFault_Handler)
+    MemManage_Handler                        0x080008d5   Thumb Code     4  gd32f10x_it.o(i.MemManage_Handler)
+    NMI_Handler                              0x080008d9   Thumb Code     2  gd32f10x_it.o(i.NMI_Handler)
+    PendSV_Handler                           0x080008db   Thumb Code     2  gd32f10x_it.o(i.PendSV_Handler)
+    SVC_Handler                              0x080008dd   Thumb Code     2  gd32f10x_it.o(i.SVC_Handler)
+    SysTick_Handler                          0x080008df   Thumb Code     2  gd32f10x_it.o(i.SysTick_Handler)
+    SystemInit                               0x080008e1   Thumb Code   196  system_gd32f10x.o(i.SystemInit)
+    USART0_IRQHandler                        0x080009b5   Thumb Code    50  gd32f10x_it.o(i.USART0_IRQHandler)
+    UsageFault_Handler                       0x080009f9   Thumb Code     4  gd32f10x_it.o(i.UsageFault_Handler)
+    WaitForUpData                            0x080009fd   Thumb Code    60  ota_message.o(i.WaitForUpData)
+    WaitResponse                             0x08000a3d   Thumb Code    82  ec800m.o(i.WaitResponse)
+    __scatterload_copy                       0x08000a99   Thumb Code    14  handlers.o(i.__scatterload_copy)
+    __scatterload_null                       0x08000aa7   Thumb Code     2  handlers.o(i.__scatterload_null)
+    __scatterload_zeroinit                   0x08000aa9   Thumb Code    14  handlers.o(i.__scatterload_zeroinit)
+    dma_channel_disable                      0x08000af9   Thumb Code    50  gd32f10x_dma.o(i.dma_channel_disable)
+    dma_channel_enable                       0x08000b2b   Thumb Code    50  gd32f10x_dma.o(i.dma_channel_enable)
+    dma_circulation_disable                  0x08000b5d   Thumb Code    50  gd32f10x_dma.o(i.dma_circulation_disable)
+    dma_config                               0x08000b91   Thumb Code   122  usart.o(i.dma_config)
+    dma_config_change                        0x08000c19   Thumb Code   120  usart.o(i.dma_config_change)
+    dma_deinit                               0x08000c99   Thumb Code   112  gd32f10x_dma.o(i.dma_deinit)
+    dma_init                                 0x08000d09   Thumb Code   302  gd32f10x_dma.o(i.dma_init)
+    dma_interrupt_enable                     0x08000e37   Thumb Code    50  gd32f10x_dma.o(i.dma_interrupt_enable)
+    dma_interrupt_flag_clear                 0x08000e69   Thumb Code    16  gd32f10x_dma.o(i.dma_interrupt_flag_clear)
+    dma_memory_to_memory_disable             0x08000e79   Thumb Code    50  gd32f10x_dma.o(i.dma_memory_to_memory_disable)
+    free                                     0x08000f5d   Thumb Code    76  malloc.o(i.free)
+    fwdgt_counter_reload                     0x08000fad   Thumb Code    10  gd32f10x_fwdgt.o(i.fwdgt_counter_reload)
+    fwdgt_write_enable                       0x08000fbd   Thumb Code    10  gd32f10x_fwdgt.o(i.fwdgt_write_enable)
+    gd_EC800M_pin_init                       0x08000fcd   Thumb Code    62  usart.o(i.gd_EC800M_pin_init)
+    gd_com_init                              0x08001015   Thumb Code   210  usart.o(i.gd_com_init)
+    gd_pull_EC800M_pwr_down                  0x08001111   Thumb Code     8  usart.o(i.gd_pull_EC800M_pwr_down)
+    gd_pull_EC800M_pwr_up                    0x0800111d   Thumb Code     8  usart.o(i.gd_pull_EC800M_pwr_up)
+    gd_pull_EC800M_rst_down                  0x08001129   Thumb Code    10  usart.o(i.gd_pull_EC800M_rst_down)
+    gd_pull_EC800M_rst_up                    0x08001139   Thumb Code    10  usart.o(i.gd_pull_EC800M_rst_up)
+    gpio_bit_set                             0x08001149   Thumb Code     4  gd32f10x_gpio.o(i.gpio_bit_set)
+    gpio_init                                0x0800114d   Thumb Code   172  gd32f10x_gpio.o(i.gpio_init)
+    gpio_pin_remap_config                    0x080011f9   Thumb Code   138  gd32f10x_gpio.o(i.gpio_pin_remap_config)
+    load_ota_message_config_params           0x08001289   Thumb Code   102  ota_message.o(i.load_ota_message_config_params)
+    main                                     0x0800130d   Thumb Code    68  main.o(i.main)
+    malloc                                   0x08001355   Thumb Code    92  malloc.o(i.malloc)
+    my_test                                  0x080013c1   Thumb Code   282  main.o(i.my_test)
+    nvic_config                              0x08001599   Thumb Code    32  usart.o(i.nvic_config)
+    nvic_irq_enable                          0x080015b9   Thumb Code   162  gd32f10x_misc.o(i.nvic_irq_enable)
+    nvic_priority_group_set                  0x08001665   Thumb Code    10  gd32f10x_misc.o(i.nvic_priority_group_set)
+    nvic_vector_table_set                    0x08001679   Thumb Code    16  gd32f10x_misc.o(i.nvic_vector_table_set)
+    rcu_clock_freq_get                       0x08001691   Thumb Code   264  gd32f10x_rcu.o(i.rcu_clock_freq_get)
+    rcu_periph_clock_enable                  0x080017b5   Thumb Code    28  gd32f10x_rcu.o(i.rcu_periph_clock_enable)
+    rcu_periph_reset_disable                 0x080017d5   Thumb Code    28  gd32f10x_rcu.o(i.rcu_periph_reset_disable)
+    rcu_periph_reset_enable                  0x080017f5   Thumb Code    28  gd32f10x_rcu.o(i.rcu_periph_reset_enable)
+    systick_clksource_set                    0x080018e1   Thumb Code    40  gd32f10x_misc.o(i.systick_clksource_set)
+    task_fwdgt_reload                        0x08001909   Thumb Code    12  main.o(i.task_fwdgt_reload)
+    usart_baudrate_set                       0x08001915   Thumb Code   136  gd32f10x_usart.o(i.usart_baudrate_set)
+    usart_data_receive                       0x080019a5   Thumb Code    10  gd32f10x_usart.o(i.usart_data_receive)
+    usart_data_transmit                      0x080019af   Thumb Code     8  gd32f10x_usart.o(i.usart_data_transmit)
+    usart_deinit                             0x080019b9   Thumb Code   136  gd32f10x_usart.o(i.usart_deinit)
+    usart_dma_transmit_config                0x08001a49   Thumb Code    16  gd32f10x_usart.o(i.usart_dma_transmit_config)
+    usart_enable                             0x08001a59   Thumb Code    10  gd32f10x_usart.o(i.usart_enable)
+    usart_flag_get                           0x08001a63   Thumb Code    30  gd32f10x_usart.o(i.usart_flag_get)
+    usart_hardware_flow_cts_config           0x08001a81   Thumb Code    16  gd32f10x_usart.o(i.usart_hardware_flow_cts_config)
+    usart_hardware_flow_rts_config           0x08001a91   Thumb Code    16  gd32f10x_usart.o(i.usart_hardware_flow_rts_config)
+    usart_interrupt_enable                   0x08001aa1   Thumb Code    26  gd32f10x_usart.o(i.usart_interrupt_enable)
+    usart_interrupt_flag_clear               0x08001abb   Thumb Code    26  gd32f10x_usart.o(i.usart_interrupt_flag_clear)
+    usart_interrupt_flag_get                 0x08001ad5   Thumb Code    56  gd32f10x_usart.o(i.usart_interrupt_flag_get)
+    usart_parity_config                      0x08001b0d   Thumb Code    16  gd32f10x_usart.o(i.usart_parity_config)
+    usart_receive_config                     0x08001b1d   Thumb Code    16  gd32f10x_usart.o(i.usart_receive_config)
+    usart_stop_bit_set                       0x08001b2d   Thumb Code    16  gd32f10x_usart.o(i.usart_stop_bit_set)
+    usart_transmit_config                    0x08001b3d   Thumb Code    16  gd32f10x_usart.o(i.usart_transmit_config)
+    usart_word_length_set                    0x08001b4d   Thumb Code    16  gd32f10x_usart.o(i.usart_word_length_set)
+    __ctype_categories                       0x08001b5c   Data          64  ctype_c.o(.constdata)
+    Region$$Table$$Base                      0x08001b9c   Number         0  anon$$obj.o(Region$$Table)
+    Region$$Table$$Limit                     0x08001bbc   Number         0  anon$$obj.o(Region$$Table)
     UART0_RX_STAT                            0x20000054   Data           1  usart.o(.data)
     UART0_RX_MQTT_SUB_STAT                   0x20000055   Data           1  usart.o(.data)
     UART0_RX_NUM                             0x20000058   Data           4  usart.o(.data)
     UpDataA                                  0x2000005c   Data           8  main.o(.data)
     __microlib_freelist                      0x2000006c   Data           4  mvars.o(.data)
     __microlib_freelist_initialised          0x20000070   Data           4  mvars.o(.data)
-    UART0_RX_BUF                             0x20000078   Data        4096  usart.o(.bss)
-    usart1_rx_buf                            0x20001078   Data         258  usart.o(.bss)
-    __heap_base                              0x20001180   Data           0  startup_gd32f10x_xd.o(HEAP)
-    __heap_limit                             0x20011180   Data           0  startup_gd32f10x_xd.o(HEAP)
-    __initial_sp                             0x20012180   Data           0  startup_gd32f10x_xd.o(STACK)
+    UART0_RX_BUF                             0x20000074   Data        4096  usart.o(.bss)
+    usart1_rx_buf                            0x20001074   Data         258  usart.o(.bss)
+    __heap_base                              0x20001178   Data           0  startup_gd32f10x_xd.o(HEAP)
+    __heap_limit                             0x20011178   Data           0  startup_gd32f10x_xd.o(HEAP)
+    __initial_sp                             0x20012178   Data           0  startup_gd32f10x_xd.o(STACK)
 
 
 
@@ -1051,151 +993,143 @@ Memory Map of the image
 
   Image Entry point : 0x08000131
 
-  Load Region LR_IROM1 (Base: 0x08000000, Size: 0x00001d9c, Max: 0x00005000, ABSOLUTE)
+  Load Region LR_IROM1 (Base: 0x08000000, Size: 0x00001c30, Max: 0x00005000, ABSOLUTE)
 
-    Execution Region ER_IROM1 (Exec base: 0x08000000, Load base: 0x08000000, Size: 0x00001d24, Max: 0x00005000, ABSOLUTE)
+    Execution Region ER_IROM1 (Exec base: 0x08000000, Load base: 0x08000000, Size: 0x00001bbc, Max: 0x00005000, ABSOLUTE)
 
     Exec Addr    Load Addr    Size         Type   Attr      Idx    E Section Name        Object
 
     0x08000000   0x08000000   0x00000130   Data   RO          136    RESET               startup_gd32f10x_xd.o
-    0x08000130   0x08000130   0x00000000   Code   RO         2158  * .ARM.Collect$$$$00000000  mc_w.l(entry.o)
-    0x08000130   0x08000130   0x00000004   Code   RO         2211    .ARM.Collect$$$$00000001  mc_w.l(entry2.o)
-    0x08000134   0x08000134   0x00000004   Code   RO         2214    .ARM.Collect$$$$00000004  mc_w.l(entry5.o)
-    0x08000138   0x08000138   0x00000000   Code   RO         2216    .ARM.Collect$$$$00000008  mc_w.l(entry7b.o)
-    0x08000138   0x08000138   0x00000000   Code   RO         2218    .ARM.Collect$$$$0000000A  mc_w.l(entry8b.o)
-    0x08000138   0x08000138   0x00000008   Code   RO         2219    .ARM.Collect$$$$0000000B  mc_w.l(entry9a.o)
-    0x08000140   0x08000140   0x00000004   Code   RO         2226    .ARM.Collect$$$$0000000E  mc_w.l(entry12b.o)
-    0x08000144   0x08000144   0x00000000   Code   RO         2221    .ARM.Collect$$$$0000000F  mc_w.l(entry10a.o)
-    0x08000144   0x08000144   0x00000000   Code   RO         2223    .ARM.Collect$$$$00000011  mc_w.l(entry11a.o)
-    0x08000144   0x08000144   0x00000004   Code   RO         2212    .ARM.Collect$$$$00002712  mc_w.l(entry2.o)
+    0x08000130   0x08000130   0x00000000   Code   RO         2151  * .ARM.Collect$$$$00000000  mc_w.l(entry.o)
+    0x08000130   0x08000130   0x00000004   Code   RO         2200    .ARM.Collect$$$$00000001  mc_w.l(entry2.o)
+    0x08000134   0x08000134   0x00000004   Code   RO         2203    .ARM.Collect$$$$00000004  mc_w.l(entry5.o)
+    0x08000138   0x08000138   0x00000000   Code   RO         2205    .ARM.Collect$$$$00000008  mc_w.l(entry7b.o)
+    0x08000138   0x08000138   0x00000000   Code   RO         2207    .ARM.Collect$$$$0000000A  mc_w.l(entry8b.o)
+    0x08000138   0x08000138   0x00000008   Code   RO         2208    .ARM.Collect$$$$0000000B  mc_w.l(entry9a.o)
+    0x08000140   0x08000140   0x00000004   Code   RO         2215    .ARM.Collect$$$$0000000E  mc_w.l(entry12b.o)
+    0x08000144   0x08000144   0x00000000   Code   RO         2210    .ARM.Collect$$$$0000000F  mc_w.l(entry10a.o)
+    0x08000144   0x08000144   0x00000000   Code   RO         2212    .ARM.Collect$$$$00000011  mc_w.l(entry11a.o)
+    0x08000144   0x08000144   0x00000004   Code   RO         2201    .ARM.Collect$$$$00002712  mc_w.l(entry2.o)
     0x08000148   0x08000148   0x00000024   Code   RO          137    .text               startup_gd32f10x_xd.o
-    0x0800016c   0x0800016c   0x00000024   Code   RO         2161    .text               mc_w.l(memcpya.o)
-    0x08000190   0x08000190   0x00000024   Code   RO         2163    .text               mc_w.l(memseta.o)
-    0x080001b4   0x080001b4   0x00000024   Code   RO         2165    .text               mc_w.l(strstr.o)
-    0x080001d8   0x080001d8   0x00000014   Code   RO         2167    .text               mc_w.l(strchr.o)
-    0x080001ec   0x080001ec   0x0000000e   Code   RO         2169    .text               mc_w.l(strlen.o)
-    0x080001fa   0x080001fa   0x00000012   Code   RO         2171    .text               mc_w.l(strcpy.o)
-    0x0800020c   0x0800020c   0x00000038   Code   RO         2203    .text               mc_w.l(__0sscanf.o)
-    0x08000244   0x08000244   0x0000014c   Code   RO         2205    .text               mc_w.l(_scanf_int.o)
-    0x08000390   0x08000390   0x00000070   Code   RO         2209    .text               mc_w.l(strtol.o)
-    0x08000400   0x08000400   0x00000008   Code   RO         2227    .text               mc_w.l(ctype_o.o)
-    0x08000408   0x08000408   0x00000012   Code   RO         2249    .text               mc_w.l(isspace_o.o)
-    0x0800041a   0x0800041a   0x0000001c   Code   RO         2264    .text               mc_w.l(_chval.o)
-    0x08000436   0x08000436   0x00000002   PAD
-    0x08000438   0x08000438   0x00000028   Code   RO         2266    .text               mc_w.l(scanf_char.o)
-    0x08000460   0x08000460   0x00000040   Code   RO         2268    .text               mc_w.l(_sgetc.o)
-    0x080004a0   0x080004a0   0x0000009e   Code   RO         2270    .text               mc_w.l(_strtoul.o)
-    0x0800053e   0x0800053e   0x00000002   PAD
-    0x08000540   0x08000540   0x00000024   Code   RO         2272    .text               mc_w.l(init.o)
-    0x08000564   0x08000564   0x00000330   Code   RO         2276    .text               mc_w.l(_scanf.o)
-    0x08000894   0x08000894   0x00000004   Code   RO          273    i.BusFault_Handler  gd32f10x_it.o
-    0x08000898   0x08000898   0x0000001c   Code   RO          570    i.Clear_DMA_Buffer  usart.o
-    0x080008b4   0x080008b4   0x00000014   Code   RO          274    i.DMA0_Channel4_IRQHandler  gd32f10x_it.o
-    0x080008c8   0x080008c8   0x00000002   Code   RO          275    i.DebugMon_Handler  gd32f10x_it.o
-    0x080008ca   0x080008ca   0x0000000a   Code   RO          209    i.Delay_Init        delay.o
-    0x080008d4   0x080008d4   0x0000001a   Code   RO          210    i.Delay_Ms          delay.o
-    0x080008ee   0x080008ee   0x0000003a   Code   RO          211    i.Delay_Us          delay.o
-    0x08000928   0x08000928   0x00000058   Code   RO          532    i.EC800MPwoerOn     ec800m.o
-    0x08000980   0x08000980   0x00000034   Code   RO          533    i.EC800MSendCmd     ec800m.o
-    0x080009b4   0x080009b4   0x00000014   Code   RO          534    i.EC800MWaitReady   ec800m.o
-    0x080009c8   0x080009c8   0x00000004   Code   RO          276    i.HardFault_Handler  gd32f10x_it.o
-    0x080009cc   0x080009cc   0x00000004   Code   RO          277    i.MemManage_Handler  gd32f10x_it.o
-    0x080009d0   0x080009d0   0x00000002   Code   RO          278    i.NMI_Handler       gd32f10x_it.o
-    0x080009d2   0x080009d2   0x00000002   Code   RO          279    i.PendSV_Handler    gd32f10x_it.o
-    0x080009d4   0x080009d4   0x00000002   Code   RO          280    i.SVC_Handler       gd32f10x_it.o
-    0x080009d6   0x080009d6   0x00000002   Code   RO          281    i.SysTick_Handler   gd32f10x_it.o
-    0x080009d8   0x080009d8   0x000000d4   Code   RO            3    i.SystemInit        system_gd32f10x.o
-    0x08000aac   0x08000aac   0x00000044   Code   RO          282    i.USART0_IRQHandler  gd32f10x_it.o
-    0x08000af0   0x08000af0   0x00000004   Code   RO          283    i.UsageFault_Handler  gd32f10x_it.o
-    0x08000af4   0x08000af4   0x00000040   Code   RO          451    i.WaitForUpData     ota_message.o
-    0x08000b34   0x08000b34   0x0000005c   Code   RO          535    i.WaitResponse      ec800m.o
-    0x08000b90   0x08000b90   0x00000008   Code   RO         2257    i.__aeabi_errno_addr  mc_w.l(errno.o)
-    0x08000b98   0x08000b98   0x0000000e   Code   RO         2283    i.__scatterload_copy  mc_w.l(handlers.o)
-    0x08000ba6   0x08000ba6   0x00000002   Code   RO         2284    i.__scatterload_null  mc_w.l(handlers.o)
-    0x08000ba8   0x08000ba8   0x0000000e   Code   RO         2285    i.__scatterload_zeroinit  mc_w.l(handlers.o)
-    0x08000bb6   0x08000bb6   0x00000042   Code   RO          452    i.checksum          ota_message.o
-    0x08000bf8   0x08000bf8   0x00000032   Code   RO         1583    i.dma_channel_disable  gd32f10x_dma.o
-    0x08000c2a   0x08000c2a   0x00000032   Code   RO         1584    i.dma_channel_enable  gd32f10x_dma.o
-    0x08000c5c   0x08000c5c   0x00000032   Code   RO         1585    i.dma_circulation_disable  gd32f10x_dma.o
-    0x08000c8e   0x08000c8e   0x00000002   PAD
-    0x08000c90   0x08000c90   0x00000088   Code   RO          571    i.dma_config        usart.o
-    0x08000d18   0x08000d18   0x00000080   Code   RO          572    i.dma_config_change  usart.o
-    0x08000d98   0x08000d98   0x00000070   Code   RO         1587    i.dma_deinit        gd32f10x_dma.o
-    0x08000e08   0x08000e08   0x0000012e   Code   RO         1590    i.dma_init          gd32f10x_dma.o
-    0x08000f36   0x08000f36   0x00000032   Code   RO         1592    i.dma_interrupt_enable  gd32f10x_dma.o
-    0x08000f68   0x08000f68   0x00000010   Code   RO         1593    i.dma_interrupt_flag_clear  gd32f10x_dma.o
-    0x08000f78   0x08000f78   0x00000032   Code   RO         1598    i.dma_memory_to_memory_disable  gd32f10x_dma.o
-    0x08000faa   0x08000faa   0x00000002   PAD
-    0x08000fac   0x08000fac   0x00000018   Code   RO         1602    i.dma_periph_and_channel_check  gd32f10x_dma.o
-    0x08000fc4   0x08000fc4   0x00000060   Code   RO          454    i.extract_data_from_buffer  ota_message.o
-    0x08001024   0x08001024   0x00000050   Code   RO         2175    i.free              mc_w.l(malloc.o)
-    0x08001074   0x08001074   0x00000010   Code   RO         1522    i.fwdgt_counter_reload  gd32f10x_fwdgt.o
-    0x08001084   0x08001084   0x00000010   Code   RO         1528    i.fwdgt_write_enable  gd32f10x_fwdgt.o
-    0x08001094   0x08001094   0x00000048   Code   RO          573    i.gd_EC800M_pin_init  usart.o
-    0x080010dc   0x080010dc   0x000000fc   Code   RO          574    i.gd_com_init       usart.o
-    0x080011d8   0x080011d8   0x0000000c   Code   RO          575    i.gd_pull_EC800M_pwr_down  usart.o
-    0x080011e4   0x080011e4   0x0000000c   Code   RO          576    i.gd_pull_EC800M_pwr_up  usart.o
-    0x080011f0   0x080011f0   0x00000010   Code   RO          577    i.gd_pull_EC800M_rst_down  usart.o
-    0x08001200   0x08001200   0x00000010   Code   RO          578    i.gd_pull_EC800M_rst_up  usart.o
-    0x08001210   0x08001210   0x00000004   Code   RO          995    i.gpio_bit_set      gd32f10x_gpio.o
-    0x08001214   0x08001214   0x000000ac   Code   RO         1002    i.gpio_init         gd32f10x_gpio.o
-    0x080012c0   0x080012c0   0x00000090   Code   RO         1008    i.gpio_pin_remap_config  gd32f10x_gpio.o
-    0x08001350   0x08001350   0x000000a8   Code   RO          456    i.load_ota_message_config_params  ota_message.o
-    0x080013f8   0x080013f8   0x00000048   Code   RO         2122    i.main              main.o
-    0x08001440   0x08001440   0x0000006c   Code   RO         2176    i.malloc            mc_w.l(malloc.o)
-    0x080014ac   0x080014ac   0x000001e0   Code   RO         2123    i.my_test           main.o
-    0x0800168c   0x0800168c   0x00000020   Code   RO          579    i.nvic_config       usart.o
-    0x080016ac   0x080016ac   0x000000ac   Code   RO          708    i.nvic_irq_enable   gd32f10x_misc.o
-    0x08001758   0x08001758   0x00000014   Code   RO          709    i.nvic_priority_group_set  gd32f10x_misc.o
-    0x0800176c   0x0800176c   0x00000018   Code   RO          710    i.nvic_vector_table_set  gd32f10x_misc.o
-    0x08001784   0x08001784   0x0000002a   Code   RO          457    i.parseIntField     ota_message.o
-    0x080017ae   0x080017ae   0x00000002   PAD
-    0x080017b0   0x080017b0   0x00000124   Code   RO          771    i.rcu_clock_freq_get  gd32f10x_rcu.o
-    0x080018d4   0x080018d4   0x00000020   Code   RO          788    i.rcu_periph_clock_enable  gd32f10x_rcu.o
-    0x080018f4   0x080018f4   0x00000020   Code   RO          791    i.rcu_periph_reset_disable  gd32f10x_rcu.o
-    0x08001914   0x08001914   0x00000020   Code   RO          792    i.rcu_periph_reset_enable  gd32f10x_rcu.o
-    0x08001934   0x08001934   0x000000c4   Code   RO            4    i.system_clock_108m_hxtal  system_gd32f10x.o
-    0x080019f8   0x080019f8   0x00000008   Code   RO            5    i.system_clock_config  system_gd32f10x.o
-    0x08001a00   0x08001a00   0x00000028   Code   RO          713    i.systick_clksource_set  gd32f10x_misc.o
-    0x08001a28   0x08001a28   0x0000000c   Code   RO         2124    i.task_fwdgt_reload  main.o
-    0x08001a34   0x08001a34   0x00000090   Code   RO         1851    i.usart_baudrate_set  gd32f10x_usart.o
-    0x08001ac4   0x08001ac4   0x0000000a   Code   RO         1852    i.usart_data_receive  gd32f10x_usart.o
-    0x08001ace   0x08001ace   0x00000008   Code   RO         1853    i.usart_data_transmit  gd32f10x_usart.o
-    0x08001ad6   0x08001ad6   0x00000002   PAD
-    0x08001ad8   0x08001ad8   0x00000090   Code   RO         1854    i.usart_deinit      gd32f10x_usart.o
-    0x08001b68   0x08001b68   0x00000010   Code   RO         1857    i.usart_dma_transmit_config  gd32f10x_usart.o
-    0x08001b78   0x08001b78   0x0000000a   Code   RO         1858    i.usart_enable      gd32f10x_usart.o
-    0x08001b82   0x08001b82   0x0000001e   Code   RO         1860    i.usart_flag_get    gd32f10x_usart.o
-    0x08001ba0   0x08001ba0   0x00000010   Code   RO         1864    i.usart_hardware_flow_cts_config  gd32f10x_usart.o
-    0x08001bb0   0x08001bb0   0x00000010   Code   RO         1865    i.usart_hardware_flow_rts_config  gd32f10x_usart.o
-    0x08001bc0   0x08001bc0   0x0000001a   Code   RO         1867    i.usart_interrupt_enable  gd32f10x_usart.o
-    0x08001bda   0x08001bda   0x0000001a   Code   RO         1868    i.usart_interrupt_flag_clear  gd32f10x_usart.o
-    0x08001bf4   0x08001bf4   0x00000038   Code   RO         1869    i.usart_interrupt_flag_get  gd32f10x_usart.o
-    0x08001c2c   0x08001c2c   0x00000010   Code   RO         1879    i.usart_parity_config  gd32f10x_usart.o
-    0x08001c3c   0x08001c3c   0x00000010   Code   RO         1881    i.usart_receive_config  gd32f10x_usart.o
-    0x08001c4c   0x08001c4c   0x00000010   Code   RO         1887    i.usart_stop_bit_set  gd32f10x_usart.o
-    0x08001c5c   0x08001c5c   0x00000010   Code   RO         1891    i.usart_transmit_config  gd32f10x_usart.o
-    0x08001c6c   0x08001c6c   0x00000010   Code   RO         1892    i.usart_word_length_set  gd32f10x_usart.o
-    0x08001c7c   0x08001c7c   0x00000081   Data   RO         2228    .constdata          mc_w.l(ctype_o.o)
-    0x08001cfd   0x08001cfd   0x00000003   PAD
-    0x08001d00   0x08001d00   0x00000004   Data   RO         2229    .constdata          mc_w.l(ctype_o.o)
-    0x08001d04   0x08001d04   0x00000020   Data   RO         2281    Region$$Table       anon$$obj.o
+    0x0800016c   0x0800016c   0x00000024   Code   RO         2154    .text               mc_w.l(memcpya.o)
+    0x08000190   0x08000190   0x00000024   Code   RO         2156    .text               mc_w.l(memseta.o)
+    0x080001b4   0x080001b4   0x00000024   Code   RO         2158    .text               mc_w.l(strstr.o)
+    0x080001d8   0x080001d8   0x00000014   Code   RO         2160    .text               mc_w.l(strchr.o)
+    0x080001ec   0x080001ec   0x0000000e   Code   RO         2162    .text               mc_w.l(strlen.o)
+    0x080001fa   0x080001fa   0x00000012   Code   RO         2164    .text               mc_w.l(strcpy.o)
+    0x0800020c   0x0800020c   0x00000038   Code   RO         2196    .text               mc_w.l(__0sscanf.o)
+    0x08000244   0x08000244   0x0000014c   Code   RO         2198    .text               mc_w.l(_scanf_int.o)
+    0x08000390   0x08000390   0x0000001c   Code   RO         2218    .text               mc_w.l(_chval.o)
+    0x080003ac   0x080003ac   0x00000028   Code   RO         2220    .text               mc_w.l(scanf_char.o)
+    0x080003d4   0x080003d4   0x00000040   Code   RO         2222    .text               mc_w.l(_sgetc.o)
+    0x08000414   0x08000414   0x00000024   Code   RO         2224    .text               mc_w.l(init.o)
+    0x08000438   0x08000438   0x0000000a   Code   RO         2226    .text               mc_w.l(isspace_c.o)
+    0x08000442   0x08000442   0x00000002   PAD
+    0x08000444   0x08000444   0x00000330   Code   RO         2228    .text               mc_w.l(_scanf.o)
+    0x08000774   0x08000774   0x00000028   Code   RO         2230    .text               mc_w.l(ctype_c.o)
+    0x0800079c   0x0800079c   0x00000004   Code   RO          273    i.BusFault_Handler  gd32f10x_it.o
+    0x080007a0   0x080007a0   0x0000001c   Code   RO          563    i.Clear_DMA_Buffer  usart.o
+    0x080007bc   0x080007bc   0x00000014   Code   RO          274    i.DMA0_Channel4_IRQHandler  gd32f10x_it.o
+    0x080007d0   0x080007d0   0x00000002   Code   RO          275    i.DebugMon_Handler  gd32f10x_it.o
+    0x080007d2   0x080007d2   0x0000000a   Code   RO          209    i.Delay_Init        delay.o
+    0x080007dc   0x080007dc   0x0000001a   Code   RO          210    i.Delay_Ms          delay.o
+    0x080007f6   0x080007f6   0x0000003a   Code   RO          211    i.Delay_Us          delay.o
+    0x08000830   0x08000830   0x00000058   Code   RO          525    i.EC800MPwoerOn     ec800m.o
+    0x08000888   0x08000888   0x00000034   Code   RO          526    i.EC800MSendCmd     ec800m.o
+    0x080008bc   0x080008bc   0x00000014   Code   RO          527    i.EC800MWaitReady   ec800m.o
+    0x080008d0   0x080008d0   0x00000004   Code   RO          276    i.HardFault_Handler  gd32f10x_it.o
+    0x080008d4   0x080008d4   0x00000004   Code   RO          277    i.MemManage_Handler  gd32f10x_it.o
+    0x080008d8   0x080008d8   0x00000002   Code   RO          278    i.NMI_Handler       gd32f10x_it.o
+    0x080008da   0x080008da   0x00000002   Code   RO          279    i.PendSV_Handler    gd32f10x_it.o
+    0x080008dc   0x080008dc   0x00000002   Code   RO          280    i.SVC_Handler       gd32f10x_it.o
+    0x080008de   0x080008de   0x00000002   Code   RO          281    i.SysTick_Handler   gd32f10x_it.o
+    0x080008e0   0x080008e0   0x000000d4   Code   RO            3    i.SystemInit        system_gd32f10x.o
+    0x080009b4   0x080009b4   0x00000044   Code   RO          282    i.USART0_IRQHandler  gd32f10x_it.o
+    0x080009f8   0x080009f8   0x00000004   Code   RO          283    i.UsageFault_Handler  gd32f10x_it.o
+    0x080009fc   0x080009fc   0x00000040   Code   RO          451    i.WaitForUpData     ota_message.o
+    0x08000a3c   0x08000a3c   0x0000005c   Code   RO          528    i.WaitResponse      ec800m.o
+    0x08000a98   0x08000a98   0x0000000e   Code   RO         2235    i.__scatterload_copy  mc_w.l(handlers.o)
+    0x08000aa6   0x08000aa6   0x00000002   Code   RO         2236    i.__scatterload_null  mc_w.l(handlers.o)
+    0x08000aa8   0x08000aa8   0x0000000e   Code   RO         2237    i.__scatterload_zeroinit  mc_w.l(handlers.o)
+    0x08000ab6   0x08000ab6   0x00000042   Code   RO          452    i.checksum          ota_message.o
+    0x08000af8   0x08000af8   0x00000032   Code   RO         1576    i.dma_channel_disable  gd32f10x_dma.o
+    0x08000b2a   0x08000b2a   0x00000032   Code   RO         1577    i.dma_channel_enable  gd32f10x_dma.o
+    0x08000b5c   0x08000b5c   0x00000032   Code   RO         1578    i.dma_circulation_disable  gd32f10x_dma.o
+    0x08000b8e   0x08000b8e   0x00000002   PAD
+    0x08000b90   0x08000b90   0x00000088   Code   RO          564    i.dma_config        usart.o
+    0x08000c18   0x08000c18   0x00000080   Code   RO          565    i.dma_config_change  usart.o
+    0x08000c98   0x08000c98   0x00000070   Code   RO         1580    i.dma_deinit        gd32f10x_dma.o
+    0x08000d08   0x08000d08   0x0000012e   Code   RO         1583    i.dma_init          gd32f10x_dma.o
+    0x08000e36   0x08000e36   0x00000032   Code   RO         1585    i.dma_interrupt_enable  gd32f10x_dma.o
+    0x08000e68   0x08000e68   0x00000010   Code   RO         1586    i.dma_interrupt_flag_clear  gd32f10x_dma.o
+    0x08000e78   0x08000e78   0x00000032   Code   RO         1591    i.dma_memory_to_memory_disable  gd32f10x_dma.o
+    0x08000eaa   0x08000eaa   0x00000002   PAD
+    0x08000eac   0x08000eac   0x00000018   Code   RO         1595    i.dma_periph_and_channel_check  gd32f10x_dma.o
+    0x08000ec4   0x08000ec4   0x00000060   Code   RO          454    i.extract_data_from_buffer  ota_message.o
+    0x08000f24   0x08000f24   0x00000038   Code   RO          455    i.find_string       ota_message.o
+    0x08000f5c   0x08000f5c   0x00000050   Code   RO         2168    i.free              mc_w.l(malloc.o)
+    0x08000fac   0x08000fac   0x00000010   Code   RO         1515    i.fwdgt_counter_reload  gd32f10x_fwdgt.o
+    0x08000fbc   0x08000fbc   0x00000010   Code   RO         1521    i.fwdgt_write_enable  gd32f10x_fwdgt.o
+    0x08000fcc   0x08000fcc   0x00000048   Code   RO          566    i.gd_EC800M_pin_init  usart.o
+    0x08001014   0x08001014   0x000000fc   Code   RO          567    i.gd_com_init       usart.o
+    0x08001110   0x08001110   0x0000000c   Code   RO          568    i.gd_pull_EC800M_pwr_down  usart.o
+    0x0800111c   0x0800111c   0x0000000c   Code   RO          569    i.gd_pull_EC800M_pwr_up  usart.o
+    0x08001128   0x08001128   0x00000010   Code   RO          570    i.gd_pull_EC800M_rst_down  usart.o
+    0x08001138   0x08001138   0x00000010   Code   RO          571    i.gd_pull_EC800M_rst_up  usart.o
+    0x08001148   0x08001148   0x00000004   Code   RO          988    i.gpio_bit_set      gd32f10x_gpio.o
+    0x0800114c   0x0800114c   0x000000ac   Code   RO          995    i.gpio_init         gd32f10x_gpio.o
+    0x080011f8   0x080011f8   0x00000090   Code   RO         1001    i.gpio_pin_remap_config  gd32f10x_gpio.o
+    0x08001288   0x08001288   0x00000084   Code   RO          457    i.load_ota_message_config_params  ota_message.o
+    0x0800130c   0x0800130c   0x00000048   Code   RO         2115    i.main              main.o
+    0x08001354   0x08001354   0x0000006c   Code   RO         2169    i.malloc            mc_w.l(malloc.o)
+    0x080013c0   0x080013c0   0x000001d8   Code   RO         2116    i.my_test           main.o
+    0x08001598   0x08001598   0x00000020   Code   RO          572    i.nvic_config       usart.o
+    0x080015b8   0x080015b8   0x000000ac   Code   RO          701    i.nvic_irq_enable   gd32f10x_misc.o
+    0x08001664   0x08001664   0x00000014   Code   RO          702    i.nvic_priority_group_set  gd32f10x_misc.o
+    0x08001678   0x08001678   0x00000018   Code   RO          703    i.nvic_vector_table_set  gd32f10x_misc.o
+    0x08001690   0x08001690   0x00000124   Code   RO          764    i.rcu_clock_freq_get  gd32f10x_rcu.o
+    0x080017b4   0x080017b4   0x00000020   Code   RO          781    i.rcu_periph_clock_enable  gd32f10x_rcu.o
+    0x080017d4   0x080017d4   0x00000020   Code   RO          784    i.rcu_periph_reset_disable  gd32f10x_rcu.o
+    0x080017f4   0x080017f4   0x00000020   Code   RO          785    i.rcu_periph_reset_enable  gd32f10x_rcu.o
+    0x08001814   0x08001814   0x000000c4   Code   RO            4    i.system_clock_108m_hxtal  system_gd32f10x.o
+    0x080018d8   0x080018d8   0x00000008   Code   RO            5    i.system_clock_config  system_gd32f10x.o
+    0x080018e0   0x080018e0   0x00000028   Code   RO          706    i.systick_clksource_set  gd32f10x_misc.o
+    0x08001908   0x08001908   0x0000000c   Code   RO         2117    i.task_fwdgt_reload  main.o
+    0x08001914   0x08001914   0x00000090   Code   RO         1844    i.usart_baudrate_set  gd32f10x_usart.o
+    0x080019a4   0x080019a4   0x0000000a   Code   RO         1845    i.usart_data_receive  gd32f10x_usart.o
+    0x080019ae   0x080019ae   0x00000008   Code   RO         1846    i.usart_data_transmit  gd32f10x_usart.o
+    0x080019b6   0x080019b6   0x00000002   PAD
+    0x080019b8   0x080019b8   0x00000090   Code   RO         1847    i.usart_deinit      gd32f10x_usart.o
+    0x08001a48   0x08001a48   0x00000010   Code   RO         1850    i.usart_dma_transmit_config  gd32f10x_usart.o
+    0x08001a58   0x08001a58   0x0000000a   Code   RO         1851    i.usart_enable      gd32f10x_usart.o
+    0x08001a62   0x08001a62   0x0000001e   Code   RO         1853    i.usart_flag_get    gd32f10x_usart.o
+    0x08001a80   0x08001a80   0x00000010   Code   RO         1857    i.usart_hardware_flow_cts_config  gd32f10x_usart.o
+    0x08001a90   0x08001a90   0x00000010   Code   RO         1858    i.usart_hardware_flow_rts_config  gd32f10x_usart.o
+    0x08001aa0   0x08001aa0   0x0000001a   Code   RO         1860    i.usart_interrupt_enable  gd32f10x_usart.o
+    0x08001aba   0x08001aba   0x0000001a   Code   RO         1861    i.usart_interrupt_flag_clear  gd32f10x_usart.o
+    0x08001ad4   0x08001ad4   0x00000038   Code   RO         1862    i.usart_interrupt_flag_get  gd32f10x_usart.o
+    0x08001b0c   0x08001b0c   0x00000010   Code   RO         1872    i.usart_parity_config  gd32f10x_usart.o
+    0x08001b1c   0x08001b1c   0x00000010   Code   RO         1874    i.usart_receive_config  gd32f10x_usart.o
+    0x08001b2c   0x08001b2c   0x00000010   Code   RO         1880    i.usart_stop_bit_set  gd32f10x_usart.o
+    0x08001b3c   0x08001b3c   0x00000010   Code   RO         1884    i.usart_transmit_config  gd32f10x_usart.o
+    0x08001b4c   0x08001b4c   0x00000010   Code   RO         1885    i.usart_word_length_set  gd32f10x_usart.o
+    0x08001b5c   0x08001b5c   0x00000040   Data   RO         2231    .constdata          mc_w.l(ctype_c.o)
+    0x08001b9c   0x08001b9c   0x00000020   Data   RO         2233    Region$$Table       anon$$obj.o
 
 
-    Execution Region RW_IRAM1 (Exec base: 0x20000000, Load base: 0x08001d24, Size: 0x00012180, Max: 0x00018000, ABSOLUTE)
+    Execution Region RW_IRAM1 (Exec base: 0x20000000, Load base: 0x08001bbc, Size: 0x00012178, Max: 0x00018000, ABSOLUTE)
 
     Exec Addr    Load Addr    Size         Type   Attr      Idx    E Section Name        Object
 
-    0x20000000   0x08001d24   0x00000008   Data   RW          461    .data               ota_message.o
-    0x20000008   0x08001d2c   0x00000054   Data   RW          581    .data               usart.o
-    0x2000005c   0x08001d80   0x00000010   Data   RW         2125    .data               main.o
-    0x2000006c   0x08001d90   0x00000004   Data   RW         2255    .data               mc_w.l(mvars.o)
-    0x20000070   0x08001d94   0x00000004   Data   RW         2256    .data               mc_w.l(mvars.o)
-    0x20000074   0x08001d98   0x00000004   Data   RW         2260    .data               mc_w.l(errno.o)
-    0x20000078        -       0x00001102   Zero   RW          580    .bss                usart.o
-    0x2000117a   0x08001d9c   0x00000006   PAD
-    0x20001180        -       0x00010000   Zero   RW          135    HEAP                startup_gd32f10x_xd.o
-    0x20011180        -       0x00001000   Zero   RW          134    STACK               startup_gd32f10x_xd.o
+    0x20000000   0x08001bbc   0x00000008   Data   RW          460    .data               ota_message.o
+    0x20000008   0x08001bc4   0x00000054   Data   RW          574    .data               usart.o
+    0x2000005c   0x08001c18   0x00000010   Data   RW         2118    .data               main.o
+    0x2000006c   0x08001c28   0x00000004   Data   RW         2216    .data               mc_w.l(mvars.o)
+    0x20000070   0x08001c2c   0x00000004   Data   RW         2217    .data               mc_w.l(mvars.o)
+    0x20000074        -       0x00001102   Zero   RW          573    .bss                usart.o
+    0x20001176   0x08001c30   0x00000002   PAD
+    0x20001178        -       0x00010000   Zero   RW          135    HEAP                startup_gd32f10x_xd.o
+    0x20011178        -       0x00001000   Zero   RW          134    STACK               startup_gd32f10x_xd.o
 
 
 ==============================================================================
@@ -1215,16 +1149,16 @@ Image component sizes
        256         28          0          0          0       2244   gd32f10x_misc.o
        388         40          0          0          0       2524   gd32f10x_rcu.o
        582         16          0          0          0       9456   gd32f10x_usart.o
-       564        194          0         16          0       2939   main.o
-       436         78          0          8          0       4097   ota_message.o
+       556        194          0         16          0       2939   main.o
+       414         50          0          8          0       4173   ota_message.o
         36          8        304          0      69632        784   startup_gd32f10x_xd.o
        416         30          0          0          0      34877   system_gd32f10x.o
        704        102          0         84       4354       7108   usart.o
 
     ----------------------------------------------------------------------
-      4906        570        336        108      73992      81291   Object Totals
+      4874        542        336        108      73988      81367   Object Totals
          0          0         32          0          0          0   (incl. Generated)
-         8          0          0          0          6          0   (incl. Padding)
+         6          0          0          0          2          0   (incl. Padding)
 
     ----------------------------------------------------------------------
 
@@ -1235,8 +1169,7 @@ Image component sizes
        816          6          0          0          0        112   _scanf.o
        332          0          0          0          0         96   _scanf_int.o
         64          0          0          0          0         84   _sgetc.o
-       158          0          0          0          0         92   _strtoul.o
-         8          4        133          0          0         68   ctype_o.o
+        40          6         64          0          0         68   ctype_c.o
          0          0          0          0          0          0   entry.o
          0          0          0          0          0          0   entry10a.o
          0          0          0          0          0          0   entry11a.o
@@ -1246,10 +1179,9 @@ Image component sizes
          0          0          0          0          0          0   entry7b.o
          0          0          0          0          0          0   entry8b.o
          8          4          0          0          0          0   entry9a.o
-         8          4          0          4          0         68   errno.o
         30          0          0          0          0          0   handlers.o
         36          8          0          0          0         68   init.o
-        18          0          0          0          0         76   isspace_o.o
+        10          0          0          0          0         68   isspace_c.o
        188         20          0          0          0        160   malloc.o
         36          0          0          0          0         68   memcpya.o
         36          0          0          0          0        108   memseta.o
@@ -1259,20 +1191,19 @@ Image component sizes
         18          0          0          0          0         68   strcpy.o
         14          0          0          0          0         68   strlen.o
         36          0          0          0          0         80   strstr.o
-       112          0          0          0          0         88   strtol.o
 
     ----------------------------------------------------------------------
-      2082         66        136         12          0       1608   Library Totals
-         4          0          3          0          0          0   (incl. Padding)
+      1826         64         64          8          0       1352   Library Totals
+         2          0          0          0          0          0   (incl. Padding)
 
     ----------------------------------------------------------------------
 
       Code (inc. data)   RO Data    RW Data    ZI Data      Debug   Library Name
 
-      2078         66        133         12          0       1608   mc_w.l
+      1824         64         64          8          0       1352   mc_w.l
 
     ----------------------------------------------------------------------
-      2082         66        136         12          0       1608   Library Totals
+      1826         64         64          8          0       1352   Library Totals
 
     ----------------------------------------------------------------------
 
@@ -1281,15 +1212,15 @@ Image component sizes
 
       Code (inc. data)   RO Data    RW Data    ZI Data      Debug   
 
-      6988        636        472        120      73992      78371   Grand Totals
-      6988        636        472        120      73992      78371   ELF Image Totals
-      6988        636        472        120          0          0   ROM Totals
+      6700        606        400        116      73988      78295   Grand Totals
+      6700        606        400        116      73988      78295   ELF Image Totals
+      6700        606        400        116          0          0   ROM Totals
 
 ==============================================================================
 
-    Total RO  Size (Code + RO Data)                 7460 (   7.29kB)
-    Total RW  Size (RW Data + ZI Data)             74112 (  72.38kB)
-    Total ROM Size (Code + RO Data + RW Data)       7580 (   7.40kB)
+    Total RO  Size (Code + RO Data)                 7100 (   6.93kB)
+    Total RW  Size (RW Data + ZI Data)             74104 (  72.37kB)
+    Total ROM Size (Code + RO Data + RW Data)       7216 (   7.05kB)
 
 ==============================================================================
 

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 24 - 15
bootloader/USER/bootloader.uvguix.IBM


+ 40 - 22
bootloader/USER/bootloader.uvoptx

@@ -157,9 +157,9 @@
         <Bp>
           <Number>0</Number>
           <Type>0</Type>
-          <LineNumber>144</LineNumber>
+          <LineNumber>166</LineNumber>
           <EnabledFlag>1</EnabledFlag>
-          <Address>134222734</Address>
+          <Address>134222532</Address>
           <ByteObject>0</ByteObject>
           <HtxType>0</HtxType>
           <ManyObjects>0</ManyObjects>
@@ -168,30 +168,48 @@
           <BreakIfRCount>1</BreakIfRCount>
           <Filename>..\HW\Source\ota_message.c</Filename>
           <ExecCommand></ExecCommand>
-          <Expression>\\bootloader\../HW/Source/ota_message.c\144</Expression>
-        </Bp>
-        <Bp>
-          <Number>1</Number>
-          <Type>0</Type>
-          <LineNumber>134</LineNumber>
-          <EnabledFlag>1</EnabledFlag>
-          <Address>0</Address>
-          <ByteObject>0</ByteObject>
-          <HtxType>0</HtxType>
-          <ManyObjects>0</ManyObjects>
-          <SizeOfObject>0</SizeOfObject>
-          <BreakByAccess>0</BreakByAccess>
-          <BreakIfRCount>0</BreakIfRCount>
-          <Filename>..\HW\Source\ota_message.c</Filename>
-          <ExecCommand></ExecCommand>
-          <Expression></Expression>
+          <Expression>\\bootloader\../HW/Source/ota_message.c\166</Expression>
         </Bp>
       </Breakpoint>
+      <WatchWindow1>
+        <Ww>
+          <count>0</count>
+          <WinNumber>1</WinNumber>
+          <ItemText>dmabuffer</ItemText>
+        </Ww>
+        <Ww>
+          <count>1</count>
+          <WinNumber>1</WinNumber>
+          <ItemText>dmaBuffer</ItemText>
+        </Ww>
+        <Ww>
+          <count>2</count>
+          <WinNumber>1</WinNumber>
+          <ItemText>dmabuffer[100]</ItemText>
+        </Ww>
+        <Ww>
+          <count>3</count>
+          <WinNumber>1</WinNumber>
+          <ItemText>\\bootloader\../HW/Source/ota_message.c\load_ota_message_config_params\dmabuffer[10]</ItemText>
+        </Ww>
+        <Ww>
+          <count>4</count>
+          <WinNumber>1</WinNumber>
+          <ItemText>start</ItemText>
+        </Ww>
+      </WatchWindow1>
+      <WatchWindow2>
+        <Ww>
+          <count>0</count>
+          <WinNumber>2</WinNumber>
+          <ItemText>ota_message</ItemText>
+        </Ww>
+      </WatchWindow2>
       <MemoryWindow1>
         <Mm>
           <WinNumber>1</WinNumber>
           <SubType>0</SubType>
-          <ItemText>dmabuffer</ItemText>
+          <ItemText>strs</ItemText>
           <AccSizeX>0</AccSizeX>
         </Mm>
       </MemoryWindow1>
@@ -199,7 +217,7 @@
         <Mm>
           <WinNumber>2</WinNumber>
           <SubType>0</SubType>
-          <ItemText>0x08005000</ItemText>
+          <ItemText>ota_message</ItemText>
           <AccSizeX>0</AccSizeX>
         </Mm>
       </MemoryWindow2>
@@ -207,7 +225,7 @@
         <Mm>
           <WinNumber>3</WinNumber>
           <SubType>0</SubType>
-          <ItemText>0x08043800</ItemText>
+          <ItemText>ota_message</ItemText>
           <AccSizeX>0</AccSizeX>
         </Mm>
       </MemoryWindow3>

+ 2 - 3
bootloader/USER/main.c

@@ -21,7 +21,7 @@ void my_test(void)	//
 	memcpy(str,string,strlen(string)+1);
 	char OPEN_FILE[] = "AT+QFOPEN=\"otaMSG.txt\",0\r\n";
 	char OPEN_NEW_FILE[] = "AT+QFOPEN=\"otaMSG.txt\",1\r\n";
-	char WRITEFILE[] = "AT+QFWRITE=1,33\r\n";
+	char WRITEFILE[] = "AT+QFWRITE=1,8\r\n";
 	char CLOSEFILE[] = "AT+QFCLOSE=1\r\n";
 	char LOADFILE[] = "AT+QFDWL=otaMSG.txt\r\n";
 	// GD32_EraseFlash(420,1);
@@ -38,7 +38,7 @@ void my_test(void)	//
 	strcpy(str,(char *)&UART0_RX_BUF);
 	i = WaitResponse("CONNECT", 2000);
 
-	EC800MSendCmd(string,strlen(string));
+	EC800MSendCmd((uint8_t *)&ota_message,sizeof(OTA_MESSAGE));
 	memset(str,0,sizeof(str));
 	strcpy(str,(char *)&UART0_RX_BUF);
 	i = WaitResponse("QFWRITE", 2000);
@@ -70,7 +70,6 @@ int main(void)
 	my_test();
 	if(load_ota_message_config_params()==0)
 	{
-		while(1){Delay_Ms(1000);};
 		//otaʼþ²úÉúÁË£¬½øÈëBootloader·ÖÖ§
 		ota_data=get_config_params();
 		BootLoader_Brance(ota_data->XmodemByte);