Ver Fonte

待测试bin下载到EM800中

yang684665 há 1 ano atrás
pai
commit
01753c467f
44 ficheiros alterados com 94348 adições e 10216 exclusões
  1. 3 1
      app/.vscode/settings.json
  2. 13 0
      app/App/ec800m.h
  3. 3 2
      app/App/main.c
  4. 160 25
      app/App/otaEvent.c
  5. 2 0
      app/Proj/.vscode/keil-assistant.log
  6. 21 2
      app/Proj/.vscode/uv4.log
  7. 1 1
      app/Proj/.vscode/uv4.log.lock
  8. 89264 4601
      app/Proj/JLinkLog.txt
  9. 873 1187
      app/Proj/Listings/Ringzle.map
  10. BIN
      app/Proj/Objects/Ringzle.axf
  11. BIN
      app/Proj/Objects/Ringzle.bin
  12. 5 138
      app/Proj/Objects/Ringzle.build_log.htm
  13. 693 1753
      app/Proj/Objects/Ringzle.htm
  14. 2 2
      app/Proj/Objects/Ringzle.sct
  15. 25 21
      app/Proj/Objects/Ringzle_GD32F103C8T6.dep
  16. 2 2
      app/Proj/Objects/Ringzle_sct.Bak
  17. BIN
      app/Proj/Objects/ec800m.crf
  18. BIN
      app/Proj/Objects/gd32f10x_it.crf
  19. BIN
      app/Proj/Objects/log.crf
  20. BIN
      app/Proj/Objects/main.crf
  21. BIN
      app/Proj/Objects/mmodbus.crf
  22. BIN
      app/Proj/Objects/mqttrecv.crf
  23. BIN
      app/Proj/Objects/otaevent.crf
  24. 4 0
      app/Proj/Objects/otaevent.d
  25. BIN
      app/Proj/Objects/parsedevicemessage.crf
  26. BIN
      app/Proj/Objects/pc.crf
  27. BIN
      app/Proj/Objects/usart.crf
  28. 102 57
      app/Proj/Ringzle.uvguix.IBM
  29. 37 31
      app/Proj/Ringzle.uvoptx
  30. 1 1
      app/Proj/Ringzle.uvprojx
  31. 2 2
      app/bsp/usart.c
  32. 4 3
      bootloader/HW/Source/ota_message.c
  33. BIN
      bootloader/OBJ/bootloader.axf
  34. 25 2
      bootloader/OBJ/bootloader.build_log.htm
  35. 495 285
      bootloader/OBJ/bootloader.htm
  36. 5 5
      bootloader/OBJ/bootloader_bootloader.dep
  37. BIN
      bootloader/OBJ/ec800m.crf
  38. BIN
      bootloader/OBJ/main.crf
  39. BIN
      bootloader/OBJ/ota_message.crf
  40. 2044 1599
      bootloader/USER/JLinkLog.txt
  41. 543 476
      bootloader/USER/Listings/bootloader.map
  42. 13 13
      bootloader/USER/bootloader.uvguix.IBM
  43. 5 5
      bootloader/USER/bootloader.uvoptx
  44. 1 2
      bootloader/USER/main.c

+ 3 - 1
app/.vscode/settings.json

@@ -9,6 +9,8 @@
         "main.h": "c",
         "device_message.h": "c",
         "gd32f10x_gpio.h": "c",
-        "gd32f10x_exti.h": "c"
+        "gd32f10x_exti.h": "c",
+        "type_traits": "c",
+        "cstdio": "c"
     }
 }

+ 13 - 0
app/App/ec800m.h

@@ -19,6 +19,19 @@
 #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 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 DEL_otaMSG_FILE "AT+QFDEL=otaMSG.txt\r\n"
+
+#define OPEN_otaDATA_FILE "AT+QFOPEN=\"otaDATA.txt\",1\r\n"
+#define WRITE_otaDATA_FILE "AT+QFWRITE=1,128,2\r\n"
+#define CLOSE_otaDATA_FILE "AT+QFCLOSE=1\r\n"
+#define LOAD_otaDATA_FILE "AT+QFDWL=otaDATA.txt\r\n"
+#define DEL_otaDATA_FILE "AT+QFDEL=otaDATA.txt\r\n"
+
 #define ATI "ATI"
 
 #define CMD_MQTT_DISCONNECT "AT+QMTDISC=0\r\n"

+ 3 - 2
app/App/main.c

@@ -129,7 +129,8 @@ int main(void)
 	while (1)
 	{
 		check_ota_event();                              //检测是否有ota事件产生
-		MQTT_Alarm_clock(gateway->inboundTime, gateway);
+		// MQTT_Alarm_clock(gateway->inboundTime, gateway);
+		delay_1ms(5000);
 	}
 }
 /*
@@ -210,7 +211,7 @@ void readID(char *strId)
  */
 void http_load_config(uint8_t *httpURL)
 {
-	uint32_t BufferSize=46*1024;//最大获取的数据空间
+	uint32_t BufferSize=46*1024;//最大获取的数据空间4KB
 	char *dmabuffer=malloc(BufferSize);
 	__LOAD_CONFIG:
 	if (EC800MGetUrl(httpURL,dmabuffer,BufferSize) == true) // 从http获取信息,获取成功则保存到本地

+ 160 - 25
app/App/otaEvent.c

@@ -3,6 +3,9 @@
 #include "systick.h"
 #include "w25q32.h"
 #include "main.h"
+#include "ec800m.h"
+#include <stdio.h>
+#include "string.h"
 
 #define APPBLOCKNB 2      	//下载的程序位于block的第3块中
 #define OTA_EVENT_BLOCKNB 1 //OTA事件完成标志存储的位置位于第2块中
@@ -13,8 +16,6 @@
 #define EOT 0x04 // 结束标志
 int8_t xmodem(uint16_t timeout);
 OTA_T ota_data;
-uint8_t w25q32_data[256];  //存放w25q32数据
-
 uint16_t Xmodem_CRC16(uint8_t *data, uint16_t datalen);
 /*
  *  函数名:uint8_t check_ota_event()
@@ -29,8 +30,9 @@ int8_t check_ota_event()
 	// 当标志位为1时证明ota事件产生,将进入ota升级路线
 	if (ota_data.ota_flag == 1)
 	{
-		W25Q32_Erase64K(APPBLOCKNB);                    //程序文件在第三block以后
-		int8_t recvSta = xmodem(1000);
+		// W25Q32_Erase64K(APPBLOCKNB);                    //程序文件在第三block以后
+		EC800MSendCmd(DEL_otaDATA_FILE, strlen(DEL_otaDATA_FILE));	//清空OTA数据文件
+		int8_t recvSta = xmodem(1000);						//在1000秒内解决OTA更新
 		if (recvSta == 0)
 		{
 			return 0;
@@ -44,6 +46,38 @@ int8_t check_ota_event()
 		return 0;
 }
 
+uint8_t WaitResponse_value(int timeout)
+{
+	bool timeoutFlag = false;
+	if (timeout >= 0)
+	{
+		timeoutFlag = true;
+	}
+
+	while (1)
+	{
+		delay_1ms(50);
+		if (UART0_RX_STAT > 0)
+		{
+			UART0_RX_STAT = 0;
+			char *p = strstr((char *)&UART0_RX_BUF, ": ") + 2;
+			if (p)
+			{
+				uint8_t ret = 0;
+				ret = strtol(p, &p, 10);
+				Clear_DMA_Buffer();
+				return ret;
+			}
+		}
+		timeout -= 50;
+		if (timeoutFlag == true && timeout <= 0)
+		{
+			Clear_DMA_Buffer();
+			return 0;
+		}
+	};
+}
+
 int8_t xmodem(uint16_t timeout)
 {
 	int startTime = gettick();
@@ -54,10 +88,17 @@ int8_t xmodem(uint16_t timeout)
 	while(1)
 	{
 		task_fwdgt_reload();                                 //喂狗
-		if(gettick()-startTime>timeout*1000)return 0;
-		usart_data_transmit(COM_232, 'C');
+		if(gettick()-startTime>timeout*1000)return 0;		//如果一直得不到上位机的xmode数据相应,超时则跳出本函数
+		usart_data_transmit(COM_232, 'C');					//向上位机发送'C',表明请求xmodem数据
 		delay_1ms(1000);
-		if(ota_data.done==1)break;
+		if(ota_data.done==1)
+		{
+			//打开otaMSG.txt文件
+			EC800MSendCmd(OPEN_otaDATA_FILE,strlen(OPEN_otaDATA_FILE));
+			if(WaitResponse("QFOPEN:", 2000) == 0)
+				return 0;
+			break;							//如果上位机响应请求则跳出循环等待
+		}
 	}
 	// 判断数据帧头是否符合标准
 	while (gettick() - startTime < timeout * 1000)
@@ -65,23 +106,43 @@ int8_t xmodem(uint16_t timeout)
 		if (ota_data.done == 1)
 		{
 			task_fwdgt_reload();                                       //喂狗
-			if (ota_data.data[0] == SOH && ota_data.data_cnt == 133)
+			if (ota_data.data[0] == SOH && ota_data.data_cnt == 133)	//如果xmodem数据包是满的128个字节
 			{
-				uint16_t XCRC = Xmodem_CRC16(ota_data.data + 3, 128);
+				uint16_t XCRC = Xmodem_CRC16(ota_data.data + 3, 128);	
 				if (XCRC == ota_data.data[131] * 256 + ota_data.data[132]) // 经过校验的数据一致时将进行数据处理
 				{
-					data_flag.xmodemNB++;
-					//因为W25Q32只支持按页写入数据、所以将128字节数据找了一个暂存空间,两次应答才进行一次数据写入,最后在结束语句判断是否为奇数在进行
-					//数据尾部的处理
-					if(ota_data.data[1]%2==0)                                      
+					data_flag.xmodemNB++;	//xmodem数据包计数
+					// W25Q32_PageWrite(w25q32_data,APPBLOCKNB*256+(data_flag.xmodemNB-1)/2);
+					uint8_t sed_flg = 0;
+					while(sed_flg < 2)
 					{
-						memcpy(w25q32_data+128,ota_data.data + 3,128);
-						W25Q32_PageWrite(w25q32_data,APPBLOCKNB*256+(data_flag.xmodemNB-1)/2);
-						memset(w25q32_data,0,256);
+						EC800MSendCmd(WRITE_otaDATA_FILE,strlen(WRITE_otaDATA_FILE));
+						if(WaitResponse("CONNECT", 2000) == 0)
+						{
+							sed_flg++;
+						}
+						else
+						{
+							sed_flg = 0;
+							break;
+						}	
 					}
-					else
+					while(sed_flg < 2)
 					{
-						memcpy(w25q32_data,ota_data.data + 3,128);
+						EC800MSendCmd(ota_data.data + 3,128);
+						int x = WaitResponse_value(2000);
+						if(x != 128)
+						{
+							sed_flg++;
+							char* QFSEEK_CMD;
+							sprintf(QFSEEK_CMD,"AT+QFSEEK=1,%d,2",x);
+							EC800MSendCmd(QFSEEK_CMD,strlen(QFSEEK_CMD));	//出错的话文件指针向左偏移x个字节
+						}
+						else
+						{
+							sed_flg = 0;
+							break;
+						}
 					}
 					
 					ota_data.data_cnt = 0;
@@ -101,21 +162,95 @@ int8_t xmodem(uint16_t timeout)
 			//进入结束的包处理
 			else if (ota_data.data[0] == EOT && ota_data.data_cnt == 1)
 			{
-				if(data_flag.xmodemNB%2!=0)                                            //将可能为奇数的数据写入进去
+				// if(data_flag.xmodemNB%2!=0)                                            //将可能为奇数的数据写入进去
+				// {
+					// W25Q32_PageWrite(w25q32_data,APPBLOCKNB*256+(data_flag.xmodemNB-1)/2);
+				// }
+				// 保存UFS文件
+				uint8_t sed_flg = 0;
+				while(sed_flg < 2)
 				{
-					W25Q32_PageWrite(w25q32_data,APPBLOCKNB*256+(data_flag.xmodemNB-1)/2);
+					EC800MSendCmd(CLOSE_otaDATA_FILE,strlen(CLOSE_otaDATA_FILE));
+					if(WaitResponse("OK", 2000) == 0)
+					{
+						sed_flg++;
+					}
+					else
+					{
+						sed_flg = 0;
+						break;
+					}	
 				}
-				
-				
-				
+
 				usart_data_transmit(COM_232, ACK);
 				//完成xmodem协议的交互将完成的标志存储到内存中
 				OTA_MESSAGE ota_message;
 				ota_message.Completion_flag=1U;
 				ota_message.XmodemByte=data_flag.xmodemNB*128;//后续补齐的0x1A还需要进一步考虑
 
-				W25Q32_Erase64K(OTA_EVENT_BLOCKNB);//擦除原先的数据
-				W25Q32_PageWrite((uint8_t *)&ota_message,OTA_EVENT_BLOCKNB*256);
+				while(sed_flg < 2)
+				{
+					EC800MSendCmd(OPEN_otaMSG_FILE,strlen(OPEN_otaMSG_FILE));
+					if(WaitResponse("QFOPEN:", 2000) == 0)
+					{
+						sed_flg++;
+					}
+					else
+					{
+						sed_flg = 0;
+						break;
+					}
+				}
+				
+
+				while(sed_flg < 2)
+				{
+					EC800MSendCmd(WRITE_otaMSG_FILE,strlen(WRITE_otaMSG_FILE));
+					if(WaitResponse("CONNECT", 2000) == 0)
+					{
+						sed_flg++;
+					}
+					else
+					{
+						sed_flg = 0;
+						break;
+					}
+				}
+
+				while(sed_flg < 2)
+				{
+					EC800MSendCmd((uint8_t *)&ota_message,sizeof(OTA_MESSAGE));
+					int x = WaitResponse_value(2000);
+					if(x != sizeof(OTA_MESSAGE))
+					{
+						sed_flg++;
+						char* QFSEEK_CMD;
+						sprintf(QFSEEK_CMD,"AT+QFSEEK=1,%d,2",x);
+						EC800MSendCmd(QFSEEK_CMD,strlen(QFSEEK_CMD));	//出错的话文件指针向左偏移x个字节
+					}
+					else
+					{
+						sed_flg = 0;
+						break;
+					}
+				}
+
+				while(sed_flg < 2)
+				{
+					EC800MSendCmd(CLOSE_otaMSG_FILE,strlen(CLOSE_otaMSG_FILE));
+					if(WaitResponse("OK", 2000))
+					{
+						sed_flg++;
+					}
+					else
+					{
+						sed_flg = 0;
+						break;
+					}
+				}
+
+				// W25Q32_Erase64K(OTA_EVENT_BLOCKNB);//擦除原先的数据
+				// W25Q32_PageWrite((uint8_t *)&ota_message,OTA_EVENT_BLOCKNB*256);
 			
 				delay_1ms(50);
 				// 写入事件完成标志后重启设备,其他状态页无需回滚,写入完成会执行重启指令

+ 2 - 0
app/Proj/.vscode/keil-assistant.log

@@ -10,3 +10,5 @@
 
 [info] Log at : 2023/10/27|08:38:12|GMT+0800
 
+[info] Log at : 2023/10/30|19:23:45|GMT+0800
+

+ 21 - 2
app/Proj/.vscode/uv4.log

@@ -1,5 +1,24 @@
 *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\software\MDK5\ARM\ARMCC\Bin'
 Build target 'GD32F103C8T6'
+compiling otaEvent.c...
+..\App\otaEvent.h(26): warning:  #1295-D: Deprecated declaration check_ota_event - give arg types
+  int8_t check_ota_event();
+..\App\device_message.h(99): warning:  #1295-D: Deprecated declaration get_gateway_config_params - give arg types
+  GATEWAY_PARAMS *get_gateway_config_params();
+..\App\otaEvent.c(47): warning:  #940-D: missing return statement at end of non-void function "check_ota_event" 
+  }
+..\App\otaEvent.c(51): warning:  #188-D: enumerated type mixed with another type
+  	bool timeoutFlag = false;
+..\App\otaEvent.c(54): warning:  #188-D: enumerated type mixed with another type
+  		timeoutFlag = true;
+..\App\otaEvent.c(132): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *"
+  						EC800MSendCmd(ota_data.data + 3,128);
+..\App\otaEvent.c(222): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *"
+  					EC800MSendCmd((uint8_t *)&ota_message,sizeof(OTA_MESSAGE));
+..\App\otaEvent.c: 7 warnings, 0 errors
+linking...
+Program Size: Code=16396 RO-data=524 RW-data=164 ZI-data=82836  
+FromELF: creating hex file...
 After Build - User command #1: fromelf --bin --output ./Objects/Ringzle.bin ./Objects/Ringzle.axf
-".\Objects\Ringzle.axf" - 0 Error(s), 0 Warning(s).
-Build Time Elapsed:  00:00:01
+".\Objects\Ringzle.axf" - 0 Error(s), 7 Warning(s).
+Build Time Elapsed:  00:00:03

+ 1 - 1
app/Proj/.vscode/uv4.log.lock

@@ -1 +1 @@
-2023/10/25 17:58:17
+2023/10/30 19:26:18

Diff do ficheiro suprimidas por serem muito extensas
+ 89264 - 4601
app/Proj/JLinkLog.txt


Diff do ficheiro suprimidas por serem muito extensas
+ 873 - 1187
app/Proj/Listings/Ringzle.map


BIN
app/Proj/Objects/Ringzle.axf


BIN
app/Proj/Objects/Ringzle.bin


+ 5 - 138
app/Proj/Objects/Ringzle.build_log.htm

@@ -22,100 +22,11 @@ Dialog DLL:      TCM.DLL V1.53.0.0
  
 <h2>Project:</h2>
 D:\project\dtu_gateway\app\Proj\Ringzle.uvprojx
-Project File Date:  10/28/2023
+Project File Date:  10/30/2023
 
 <h2>Output:</h2>
 *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\software\MDK5\ARM\ARMCC\Bin'
 Build target 'GD32F103C8T6'
-compiling gd32f10x_it.c...
-..\App\device_message.h(99): warning:  #1295-D: Deprecated declaration get_gateway_config_params - give arg types
-  GATEWAY_PARAMS *get_gateway_config_params();
-..\App\parseDeviceMessage.h(13): warning:  #1295-D: Deprecated declaration Read_Data - give arg types
-  void Read_Data();
-..\App\gd32f10x_it.c: 2 warnings, 0 errors
-compiling ec800m.c...
-..\App\device_message.h(99): warning:  #1295-D: Deprecated declaration get_gateway_config_params - give arg types
-  GATEWAY_PARAMS *get_gateway_config_params();
-..\App\ec800m.c(53): warning:  #188-D: enumerated type mixed with another type
-  	bool timeoutFlag = false;
-..\App\ec800m.c(56): warning:  #188-D: enumerated type mixed with another type
-  		timeoutFlag = true;
-..\App\ec800m.c(70): warning:  #188-D: enumerated type mixed with another type
-  				return true;
-..\App\ec800m.c(77): warning:  #188-D: enumerated type mixed with another type
-  			return false;
-..\App\ec800m.c(121): warning:  #223-D: function "sprintf" declared implicitly
-  	sprintf(command, CMD_SET_URL, strlen(url)); // CMD_SET_URL "%d\r\n"
-..\App\ec800m.c(128): warning:  #188-D: enumerated type mixed with another type
-  		return false;
-..\App\ec800m.c(134): warning:  #188-D: enumerated type mixed with another type
-  		return false;
-..\App\ec800m.c(141): warning:  #188-D: enumerated type mixed with another type
-  		return false;
-..\App\ec800m.c(151): warning:  #188-D: enumerated type mixed with another type
-  	return true;
-..\App\ec800m.c(163): warning:  #188-D: enumerated type mixed with another type
-  	bool success = false;
-..\App\ec800m.c(173): warning:  #223-D: function "sprintf" declared implicitly
-  	sprintf(cmd, "AT+QMTCFG=\"qmtping\",0,%d\r\n", keepalive);
-..\App\ec800m.c(214): warning:  #223-D: function "sprintf" declared implicitly
-  	sprintf((char *)payload_out,"{\"deviceId\":\"%s\",\"data\":[",gateway->deviceId);//缁勬垚json澶撮儴
-..\App\ec800m.c(249): warning:  #111-D: statement is unreachable
-  								break;
-..\App\ec800m.c(344): warning:  #223-D: function "sprintf" declared implicitly
-  	sprintf(AT_SUB, "AT+QMTSUB=0,1,\"%s\",0\r\n", commandTopic);
-..\App\ec800m.c(345): warning:  #188-D: enumerated type mixed with another type
-  	bool success = false;
-..\App\ec800m.c: 16 warnings, 0 errors
-compiling systick.c...
-compiling device_message.c...
-..\App\device_message.h(99): warning:  #1295-D: Deprecated declaration get_gateway_config_params - give arg types
-  GATEWAY_PARAMS *get_gateway_config_params();
-..\App\device_message.c(48): warning:  #940-D: missing return statement at end of non-void function "addGatewayParams" 
-  }
-..\App\device_message.c(135): warning:  #223-D: function "sscanf" declared implicitly
-            sscanf((const char *)&string[j * 2], "%2hhx", &byte);
-..\App\device_message.c(127): warning:  #177-D: variable "read_modbus_command"  was declared but never referenced
-  				READ_MODBUS_COMMAND *read_modbus_command =NULL;
-..\App\device_message.c(157): warning:  #177-D: variable "read_dlt645_command"  was declared but never referenced
-  				READ_DLT645_COMMAND *read_dlt645_command = NULL;
-..\App\device_message.c(221): warning:  #223-D: function "sscanf" declared implicitly
-      sscanf(ptr, "%[^\"],", value);
-..\App\device_message.c(222): warning:  #1-D: last line of file ends without a newline
-  }
-..\App\device_message.c: 7 warnings, 0 errors
-compiling mqttRecv.c...
-..\App\device_message.h(99): warning:  #1295-D: Deprecated declaration get_gateway_config_params - give arg types
-  GATEWAY_PARAMS *get_gateway_config_params();
-..\App\parseDeviceMessage.h(13): warning:  #1295-D: Deprecated declaration Read_Data - give arg types
-  void Read_Data();
-..\App\mqttRecv.c(25): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "const char *"
-          for (; i < strlen(UART0_RX_BUF); i++)
-..\App\mqttRecv.c(71): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *restrict"
-                  strcpy(json, (char *)json_buf); // 将JSON数据拷贝到输出缓冲区中
-..\App\mqttRecv.c: 4 warnings, 0 errors
-compiling parseDeviceMessage.c...
-..\App\device_message.h(99): warning:  #1295-D: Deprecated declaration get_gateway_config_params - give arg types
-  GATEWAY_PARAMS *get_gateway_config_params();
-..\App\parseDeviceMessage.h(13): warning:  #1295-D: Deprecated declaration Read_Data - give arg types
-  void Read_Data();
-..\App\parseDeviceMessage.c(71): warning:  #177-D: variable "temp"  was declared but never referenced
-  		char *temp;
-..\App\parseDeviceMessage.c(84): warning:  #940-D: missing return statement at end of non-void function "WaitForUpData" 
-  }
-..\App\parseDeviceMessage.c(205): warning:  #188-D: enumerated type mixed with another type
-  			mmodbus_set16bitOrder(currentDevice->MDBbigLittleFormat);               //璁剧疆澶у皬绔?
-..\App\parseDeviceMessage.c(379): warning:  #167-D: argument of type "char *" is incompatible with parameter of type "uint8_t *"
-      while (MQTT_BUFFER_READ(json))
-..\App\parseDeviceMessage.c(387): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *restrict"
-          strcpy(action1, processStringData(mqtt_sub_json, "action"));
-..\App\parseDeviceMessage.c(440): warning:  #188-D: enumerated type mixed with another type
-  								mmodbus_set16bitOrder(currentDevice->MDBbigLittleFormat);
-..\App\parseDeviceMessage.c(520): warning:  #188-D: enumerated type mixed with another type
-  									mmodbus_set16bitOrder(currentDevice->MDBbigLittleFormat);
-..\App\parseDeviceMessage.c(528): warning:  #177-D: variable "value1"  was declared but never referenced
-                      uint8_t value1;
-..\App\parseDeviceMessage.c: 10 warnings, 0 errors
 compiling main.c...
 ..\App\device_message.h(99): warning:  #1295-D: Deprecated declaration get_gateway_config_params - give arg types
   GATEWAY_PARAMS *get_gateway_config_params();
@@ -129,58 +40,14 @@ compiling main.c...
   void task_fwdgt_reload();
 ..\App\main.c(104): warning:  #167-D: argument of type "char *" is incompatible with parameter of type "uint8_t *"
    	http_load_config(httpURL);
-..\App\main.c(216): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *"
+..\App\main.c(217): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *"
   	if (EC800MGetUrl(httpURL,dmabuffer,BufferSize) == true) // 从http获取信息,获取成功则保存到本地
 ..\App\main.c: 7 warnings, 0 errors
-compiling PC.c...
-..\App\device_message.h(99): warning:  #1295-D: Deprecated declaration get_gateway_config_params - give arg types
-  GATEWAY_PARAMS *get_gateway_config_params();
-..\App\parseDeviceMessage.h(13): warning:  #1295-D: Deprecated declaration Read_Data - give arg types
-  void Read_Data();
-..\App\otaEvent.h(26): warning:  #1295-D: Deprecated declaration check_ota_event - give arg types
-  int8_t check_ota_event();
-..\App\PC.c(25): warning:  #1295-D: Deprecated declaration read_json_config - give arg types
-  void read_json_config();
-..\App\PC.c(264): warning:  #167-D: argument of type "char *" is incompatible with parameter of type "const uint8_t *"
-  	uint16_t CRC16=mmodbus_crc16(gatewayConfigData+1,strlen(gatewayConfigData)-1);
-..\App\PC.c(269): warning:  #167-D: argument of type "char *" is incompatible with parameter of type "uint8_t *"
-  	gd_com_232_send(gatewayConfigData,strlen(gatewayConfigData));
-..\App\PC.c(426): warning:  #223-D: function "delay_1ms" declared implicitly
-  		delay_1ms(50);
-..\App\PC.c: 7 warnings, 0 errors
-compiling key.c...
-..\App\device_message.h(99): warning:  #1295-D: Deprecated declaration get_gateway_config_params - give arg types
-  GATEWAY_PARAMS *get_gateway_config_params();
-..\bsp\key.c: 1 warning, 0 errors
-compiling otaEvent.c...
-..\App\otaEvent.h(26): warning:  #1295-D: Deprecated declaration check_ota_event - give arg types
-  int8_t check_ota_event();
-..\App\otaEvent.c(45): warning:  #940-D: missing return statement at end of non-void function "check_ota_event" 
-  }
-..\App\otaEvent.c(78): warning:  #223-D: function "memcpy" declared implicitly
-  						memcpy(w25q32_data+128,ota_data.data + 3,128);
-..\App\otaEvent.c(80): warning:  #223-D: function "memset" declared implicitly
-  						memset(w25q32_data,0,256);
-..\App\otaEvent.c(84): warning:  #223-D: function "memcpy" declared implicitly
-  						memcpy(w25q32_data,ota_data.data + 3,128);
-..\App\otaEvent.c(88): warning:  #223-D: function "memset" declared implicitly
-  					memset(ota_data.data, 0, 133);
-..\App\otaEvent.c(96): warning:  #223-D: function "memset" declared implicitly
-  					memset(ota_data.data, 0, 133);
-..\App\otaEvent.c(127): warning:  #223-D: function "memset" declared implicitly
-  				memset(ota_data.data, 0, 133);
-..\App\otaEvent.c: 8 warnings, 0 errors
-compiling dlt645_port.c...
-..\dlt\port\dlt645_port.c(84): warning:  #223-D: function "memcpy" declared implicitly
-  			memcpy(msg, &(dlt645_port.rxBuf[4]), len-4);
-..\dlt\port\dlt645_port.c(103): warning:  #223-D: function "memset" declared implicitly
-  	memset(dlt645_port.rxBuf, 0, DLT_RXSIZE);
-..\dlt\port\dlt645_port.c: 2 warnings, 0 errors
 linking...
-Program Size: Code=31044 RO-data=1696 RW-data=224 ZI-data=83224  
+Program Size: Code=16404 RO-data=524 RW-data=164 ZI-data=82836  
 FromELF: creating hex file...
 After Build - User command #1: fromelf --bin --output ./Objects/Ringzle.bin ./Objects/Ringzle.axf
-".\Objects\Ringzle.axf" - 0 Error(s), 64 Warning(s).
+".\Objects\Ringzle.axf" - 0 Error(s), 7 Warning(s).
 
 <h2>Software Packages used:</h2>
 
@@ -193,7 +60,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:05
+Build Time Elapsed:  00:00:02
 </pre>
 </body>
 </html>

Diff do ficheiro suprimidas por serem muito extensas
+ 693 - 1753
app/Proj/Objects/Ringzle.htm


+ 2 - 2
app/Proj/Objects/Ringzle.sct

@@ -2,8 +2,8 @@
 ; *** Scatter-Loading Description File generated by uVision ***
 ; *************************************************************
 
-LR_IROM1 0x08037000 0x00100000  {    ; load region size_region
-  ER_IROM1 0x08037000 0x00100000  {  ; load address = execution address
+LR_IROM1 0x08005000 0x00100000  {    ; load region size_region
+  ER_IROM1 0x08005000 0x00100000  {  ; load address = execution address
    *.o (RESET, +First)
    *(InRoot$$Sections)
    .ANY (+RO)

Diff do ficheiro suprimidas por serem muito extensas
+ 25 - 21
app/Proj/Objects/Ringzle_GD32F103C8T6.dep


+ 2 - 2
app/Proj/Objects/Ringzle_sct.Bak

@@ -2,8 +2,8 @@
 ; *** Scatter-Loading Description File generated by uVision ***
 ; *************************************************************
 
-LR_IROM1 0x08005000 0x00100000  {    ; load region size_region
-  ER_IROM1 0x08005000 0x00100000  {  ; load address = execution address
+LR_IROM1 0x08037000 0x00100000  {    ; load region size_region
+  ER_IROM1 0x08037000 0x00100000  {  ; load address = execution address
    *.o (RESET, +First)
    *(InRoot$$Sections)
    .ANY (+RO)

BIN
app/Proj/Objects/ec800m.crf


BIN
app/Proj/Objects/gd32f10x_it.crf


BIN
app/Proj/Objects/log.crf


BIN
app/Proj/Objects/main.crf


BIN
app/Proj/Objects/mmodbus.crf


BIN
app/Proj/Objects/mqttrecv.crf


BIN
app/Proj/Objects/otaevent.crf


+ 4 - 0
app/Proj/Objects/otaevent.d

@@ -36,3 +36,7 @@
 .\objects\otaevent.o: ..\App\systick.h
 .\objects\otaevent.o: ..\bsp\w25q32.h
 .\objects\otaevent.o: ..\App\main.h
+.\objects\otaevent.o: ..\App\ec800m.h
+.\objects\otaevent.o: ..\App\device_message.h
+.\objects\otaevent.o: D:\software\MDK5\ARM\ARMCC\Bin\..\include\stdio.h
+.\objects\otaevent.o: D:\software\MDK5\ARM\ARMCC\Bin\..\include\string.h

BIN
app/Proj/Objects/parsedevicemessage.crf


BIN
app/Proj/Objects/pc.crf


BIN
app/Proj/Objects/usart.crf


Diff do ficheiro suprimidas por serem muito extensas
+ 102 - 57
app/Proj/Ringzle.uvguix.IBM


+ 37 - 31
app/Proj/Ringzle.uvoptx

@@ -157,73 +157,79 @@
         <Bp>
           <Number>0</Number>
           <Type>0</Type>
-          <LineNumber>374</LineNumber>
+          <LineNumber>36</LineNumber>
           <EnabledFlag>1</EnabledFlag>
-          <Address>134261490</Address>
+          <Address>134248206</Address>
           <ByteObject>0</ByteObject>
           <HtxType>0</HtxType>
           <ManyObjects>0</ManyObjects>
           <SizeOfObject>0</SizeOfObject>
           <BreakByAccess>0</BreakByAccess>
           <BreakIfRCount>1</BreakIfRCount>
-          <Filename>..\App\parseDeviceMessage.c</Filename>
+          <Filename>..\App\otaEvent.c</Filename>
           <ExecCommand></ExecCommand>
-          <Expression>\\Ringzle\../App/parseDeviceMessage.c\374</Expression>
+          <Expression>\\Ringzle\../App/otaEvent.c\36</Expression>
         </Bp>
         <Bp>
           <Number>1</Number>
           <Type>0</Type>
-          <LineNumber>94</LineNumber>
+          <LineNumber>131</LineNumber>
           <EnabledFlag>1</EnabledFlag>
-          <Address>0</Address>
+          <Address>134251774</Address>
           <ByteObject>0</ByteObject>
           <HtxType>0</HtxType>
           <ManyObjects>0</ManyObjects>
           <SizeOfObject>0</SizeOfObject>
           <BreakByAccess>0</BreakByAccess>
-          <BreakIfRCount>0</BreakIfRCount>
+          <BreakIfRCount>1</BreakIfRCount>
           <Filename>..\App\main.c</Filename>
           <ExecCommand></ExecCommand>
-          <Expression></Expression>
+          <Expression>\\Ringzle\../App/main.c\131</Expression>
         </Bp>
         <Bp>
           <Number>2</Number>
           <Type>0</Type>
-          <LineNumber>110</LineNumber>
+          <LineNumber>50</LineNumber>
           <EnabledFlag>1</EnabledFlag>
-          <Address>0</Address>
+          <Address>134243688</Address>
           <ByteObject>0</ByteObject>
           <HtxType>0</HtxType>
           <ManyObjects>0</ManyObjects>
           <SizeOfObject>0</SizeOfObject>
           <BreakByAccess>0</BreakByAccess>
-          <BreakIfRCount>0</BreakIfRCount>
-          <Filename>..\App\main.c</Filename>
-          <ExecCommand></ExecCommand>
-          <Expression></Expression>
-        </Bp>
-        <Bp>
-          <Number>3</Number>
-          <Type>0</Type>
-          <LineNumber>149</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>..\App\main.c</Filename>
+          <BreakIfRCount>1</BreakIfRCount>
+          <Filename>..\App\PC.c</Filename>
           <ExecCommand></ExecCommand>
-          <Expression></Expression>
+          <Expression>\\Ringzle\../App/PC.c\50</Expression>
         </Bp>
       </Breakpoint>
+      <WatchWindow1>
+        <Ww>
+          <count>0</count>
+          <WinNumber>1</WinNumber>
+          <ItemText>Serial_RxData</ItemText>
+        </Ww>
+        <Ww>
+          <count>1</count>
+          <WinNumber>1</WinNumber>
+          <ItemText>RxPacket.data[1]</ItemText>
+        </Ww>
+        <Ww>
+          <count>2</count>
+          <WinNumber>1</WinNumber>
+          <ItemText>RxPacket</ItemText>
+        </Ww>
+        <Ww>
+          <count>3</count>
+          <WinNumber>1</WinNumber>
+          <ItemText>ota_data.data</ItemText>
+        </Ww>
+      </WatchWindow1>
       <MemoryWindow1>
         <Mm>
           <WinNumber>1</WinNumber>
           <SubType>8</SubType>
-          <ItemText>dmaBuffer</ItemText>
+          <ItemText>RxPacket</ItemText>
           <AccSizeX>0</AccSizeX>
         </Mm>
       </MemoryWindow1>
@@ -582,7 +588,7 @@
       <GroupNumber>4</GroupNumber>
       <FileNumber>24</FileNumber>
       <FileType>1</FileType>
-      <tvExp>1</tvExp>
+      <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
       <PathWithFileName>..\Firmware\Source\gd32f10x_fmc.c</PathWithFileName>

+ 1 - 1
app/Proj/Ringzle.uvprojx

@@ -275,7 +275,7 @@
               </OCR_RVCT3>
               <OCR_RVCT4>
                 <Type>1</Type>
-                <StartAddress>0x8037000</StartAddress>
+                <StartAddress>0x8005000</StartAddress>
                 <Size>0x100000</Size>
               </OCR_RVCT4>
               <OCR_RVCT5>

+ 2 - 2
app/bsp/usart.c

@@ -120,8 +120,8 @@ void gd_com_init(uint32_t com)
     usart_transmit_config(com, USART_TRANSMIT_ENABLE);
     usart_enable(com);
 	// usart_interrupt_enable(com, USART_INT_TBE);
-	  usart_interrupt_enable(com, USART_INT_RBNE);
-   	usart_interrupt_enable(com, USART_INT_IDLE);
+	  usart_interrupt_enable(com, USART_INT_RBNE);  //开启接受终端
+   	usart_interrupt_enable(com, USART_INT_IDLE);    //开启空闲终端,也叫帧终端
     
 }
 

+ 4 - 3
bootloader/HW/Source/ota_message.c

@@ -6,7 +6,6 @@
 #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){
@@ -89,7 +88,7 @@ static char* find_string(char *strs, char *str, int len)
  */
 static void extract_data_from_buffer(char* buffer, uint32_t *len_ptr, uint16_t *checkCode_ptr)
 {
-  char *start = find_string(buffer, "+QFDWL:",BufferSize);
+  char *start = find_string(buffer, "+QFDWL:",128);
   if (start != NULL)
   {
     start += 8; // 跳过"+QFDWL:"
@@ -135,9 +134,11 @@ bool WaitForUpData(char* dmaBuffer)
 int load_ota_message_config_params()
 {
 	//检查校验码
-	char *dmabuffer=malloc(BufferSize);
+	uint8_t BufferSize = 128;		//最大获取的数据空间
+	char dmabuffer[BufferSize];
 	__LOAD_CONFIG:
 	// get data from UFS
+	memset(dmabuffer,0,BufferSize);
 	dma_config_change(dmabuffer,BufferSize);
 	Delay_Ms(1000);
 	EC800MSendCmd(LOAD_otaMSG_FILE, strlen(LOAD_otaMSG_FILE)); //"AT+QFDWL=otaMSG.txt\r\n"

BIN
bootloader/OBJ/bootloader.axf


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

@@ -27,7 +27,30 @@ 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'
-"..\OBJ\bootloader.axf" - 0 Error(s), 0 Warning(s).
+compiling ota_message.c...
+..\CMSIS\Include\gd32f10x.h(44): warning:  #47-D: incompatible redefinition of macro "GD32F10X_XD" 
+  #define GD32F10X_XD
+..\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(28): warning:  #2532-D: support for trigraphs is disabled
+  // ??MQTT??3.1.1 ??????--4(mqtt 3.1.1 )3(mqtt 3.1)
+..\HW\Source\ota_message.c(118): warning:  #188-D: enumerated type mixed with another type
+  			return true;
+..\HW\Source\ota_message.c(122): warning:  #188-D: enumerated type mixed with another type
+  			return false;
+..\HW\Source\ota_message.c(113): warning:  #177-D: variable "temp"  was declared but never referenced
+  			char *temp;
+..\HW\Source\ota_message.c(125): warning:  #940-D: missing return statement at end of non-void function "WaitForUpData" 
+  }
+..\HW\Source\ota_message.c(188): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *"
+  	EC800MSendCmd((uint8_t *)&ota_message,sizeof(OTA_MESSAGE));
+..\HW\Source\ota_message.c: 9 warnings, 0 errors
+linking...
+Program Size: Code=8444 RO-data=400 RW-data=128 ZI-data=73992  
+FromELF: creating hex file...
+"..\OBJ\bootloader.axf" - 0 Error(s), 9 Warning(s).
 
 <h2>Software Packages used:</h2>
 
@@ -40,7 +63,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:00
+Build Time Elapsed:  00:00:01
 </pre>
 </body>
 </html>

Diff do ficheiro suprimidas por serem muito extensas
+ 495 - 285
bootloader/OBJ/bootloader.htm


+ 5 - 5
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)(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)
+F (..\HW\Source\ota_message.c)(0x653F6C21)(--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)
@@ -282,12 +282,12 @@ I (..\LIB\Include\gd32f10x_enet.h)(0x6538DC55)
 I (D:\software\MDK5\ARM\ARMCC\include\stdlib.h)(0x60252374)
 I (..\LIB\Include\gd32f10x_misc.h)(0x6538DC55)
 I (..\HW\Include\w25q32.h)(0x6538DC55)
-I (..\HW\Include\ec800m.h)(0x653C7780)
+I (..\HW\Include\ec800m.h)(0x653F28AB)
 I (..\HW\Include\usart.h)(0x653C8151)
 I (..\HW\Include\delay.h)(0x6538DC55)
 I (D:\software\MDK5\ARM\ARMCC\include\stdio.h)(0x60252374)
 F (..\HW\Source\ec800m.c)(0x653CB6AE)(--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\ec800m.o --omf_browse ..\obj\ec800m.crf --depend ..\obj\ec800m.d)
-I (..\HW\Include\ec800m.h)(0x653C7780)
+I (..\HW\Include\ec800m.h)(0x653F28AB)
 I (..\CMSIS\Include\gd32f10x.h)(0x653C6D66)
 I (..\CMSIS\Include\core_cm3.h)(0x6538DC55)
 I (D:\software\MDK5\ARM\ARMCC\include\stdint.h)(0x6025237E)
@@ -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)(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)
+F (.\main.c)(0x653F6749)(--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)
@@ -724,6 +724,6 @@ I (..\HW\Include\delay.h)(0x6538DC55)
 I (..\HW\Include\fmc.h)(0x653C6670)
 I (..\HW\Include\ota_message.h)(0x653B9E15)
 I (..\HW\Include\usart.h)(0x653C8151)
-I (..\HW\Include\ec800m.h)(0x653C7780)
+I (..\HW\Include\ec800m.h)(0x653F28AB)
 I (..\HW\Include\boot.h)(0x6538DC55)
 I (..\HW\Include\w25q32.h)(0x6538DC55)

BIN
bootloader/OBJ/ec800m.crf


BIN
bootloader/OBJ/main.crf


BIN
bootloader/OBJ/ota_message.crf


Diff do ficheiro suprimidas por serem muito extensas
+ 2044 - 1599
bootloader/USER/JLinkLog.txt


Diff do ficheiro suprimidas por serem muito extensas
+ 543 - 476
bootloader/USER/Listings/bootloader.map


Diff do ficheiro suprimidas por serem muito extensas
+ 13 - 13
bootloader/USER/bootloader.uvguix.IBM


+ 5 - 5
bootloader/USER/bootloader.uvoptx

@@ -157,18 +157,18 @@
         <Bp>
           <Number>0</Number>
           <Type>0</Type>
-          <LineNumber>166</LineNumber>
+          <LineNumber>71</LineNumber>
           <EnabledFlag>1</EnabledFlag>
-          <Address>134222532</Address>
+          <Address>134224354</Address>
           <ByteObject>0</ByteObject>
           <HtxType>0</HtxType>
           <ManyObjects>0</ManyObjects>
           <SizeOfObject>0</SizeOfObject>
           <BreakByAccess>0</BreakByAccess>
           <BreakIfRCount>1</BreakIfRCount>
-          <Filename>..\HW\Source\ota_message.c</Filename>
+          <Filename>.\main.c</Filename>
           <ExecCommand></ExecCommand>
-          <Expression>\\bootloader\../HW/Source/ota_message.c\166</Expression>
+          <Expression>\\bootloader\main.c\71</Expression>
         </Bp>
       </Breakpoint>
       <WatchWindow1>
@@ -217,7 +217,7 @@
         <Mm>
           <WinNumber>2</WinNumber>
           <SubType>0</SubType>
-          <ItemText>ota_message</ItemText>
+          <ItemText>dmabuffer</ItemText>
           <AccSizeX>0</AccSizeX>
         </Mm>
       </MemoryWindow2>

+ 1 - 2
bootloader/USER/main.c

@@ -16,7 +16,7 @@ void my_test(void)	//
 	char str[100];
 	char string[] = "{\"otaflag\":1,\"XmodemByte\":102400}"; 
 	uint32_t i = 0;
-	ota_message.otaflag = 1;
+	ota_message.otaflag = 0;
 	ota_message.XmodemByte = 200 * 1024;
 	memcpy(str,string,strlen(string)+1);
 	char OPEN_FILE[] = "AT+QFOPEN=\"otaMSG.txt\",0\r\n";
@@ -77,7 +77,6 @@ int main(void)
 	//ûÓÐOTAʼþ²úÉúÌøתAÇø
 	else
 	{
-		while(1){Delay_Ms(1000);};
 		LOAD_A(GD32_A_SADDR);
 	}