Explorar el Código

平峰项目FTP软件,V0.0.0.8-测试

LAPTOP-KB7QFH2U\ChenJie-PC hace 2 años
padre
commit
12a89271d0

+ 18 - 11
Project_Settings/Linker_Files/linker_flash_s32k146.ld

@@ -31,13 +31,19 @@
 
 MEMORY
 {         
-    int_flash_interrupts    : ORIGIN = 0x00000000, LENGTH = 0x00000400    /* 1K */    /* Do not change this section */
-    int_flash_config        : ORIGIN = 0x00000400, LENGTH = 0x00000010    /* 16bytes */ /* Do not change this section */
-    int_flash               : ORIGIN = 0x00000410, LENGTH = 0x000FFBF0    /* ~1.0MB */ 
+    int_flash_interrupts    : ORIGIN = 0x00014200, LENGTH = 0x00000400    /* 1K */    /* Do not change this section */
+   /* int_flash_config        : ORIGIN = 0x00000400, LENGTH = 0x00000010    /* 16bytes */ /* Do not change this section */
+     int_flash               : ORIGIN = 0x00014600, LENGTH = 0x000EBA00    /* ~1.0MB */ 
+/*	int_flash_interrupts    : ORIGIN = 0x00080200, LENGTH = 0x00000400	/**/
+/*	int_flash               : ORIGIN = 0x00080600, LENGTH = 0x0007FA00	/**/
+	
+	m_flexram				: ORIGIN = 0x14000000, LENGTH = 0x00001000	
+	
     int_sram_results        : ORIGIN = 0x1FFF0000, LENGTH = 0x00000100    /* 256bytes */
     int_sram                : ORIGIN = 0x1FFF0100, LENGTH = 0x0001DF00    /* ~120K */
-    int_sram_stack_c0       : ORIGIN = 0x2000E000, LENGTH = 0x00001000    /* 4K  */
-    ram_rsvd2               : ORIGIN = 0x2000F000, LENGTH = 0             /* End of SRAM */
+    int_sram_stack_c0       : ORIGIN = 0x2000E000, LENGTH = 0x00001000 - 0x10    /* 4K  */
+    ram_rsvd2               : ORIGIN = 0x2000EFF0, LENGTH = 0             /* End of SRAM */
+    ExchangeInfo            : ORIGIN = 0x2000EFF0, LENGTH = 0x10          
 }
 
 
@@ -54,17 +60,17 @@ SECTIONS
     
 	.flash_interrupts :
 	{
-		. = ALIGN(4096);
+		. = ALIGN(512);
         __interrupts_rom_start = .;
         KEEP(*(.intc_vector))    
-        . = ALIGN(4);
+        . = ALIGN(512);
         __interrupts_rom_end = .;
 	} > int_flash_interrupts
 	
-	.flash_config :
-	{
-		KEEP(*(.flash_config))
-	} > int_flash_config
+/*	.flash_config :				*/
+/*	{							*/
+/*		KEEP(*(.flash_config))	*/
+/*	} > int_flash_config		*/
 	
 	.flash :
 	{
@@ -111,6 +117,7 @@ SECTIONS
 		__DATA_ROM = .;
 	} > int_flash
     
+    
     . = ALIGN(4);
     PROVIDE(__exidx_start = .);
     .ARM.exidx :

+ 11 - 18
Project_Settings/Linker_Files/linker_flash_s32k146.ldota → Project_Settings/Linker_Files/linker_flash_s32k146.ldfls

@@ -31,19 +31,13 @@
 
 MEMORY
 {         
-    int_flash_interrupts    : ORIGIN = 0x00014200, LENGTH = 0x00000400    /* 1K */    /* Do not change this section */
-   /* int_flash_config        : ORIGIN = 0x00000400, LENGTH = 0x00000010    /* 16bytes */ /* Do not change this section */
-     int_flash               : ORIGIN = 0x00014600, LENGTH = 0x000EBA00    /* ~1.0MB */ 
-/*	int_flash_interrupts    : ORIGIN = 0x00080200, LENGTH = 0x00000400	/**/
-/*	int_flash               : ORIGIN = 0x00080600, LENGTH = 0x0007FA00	/**/
-	
-	m_flexram				: ORIGIN = 0x14000000, LENGTH = 0x00001000	
-	
+    int_flash_interrupts    : ORIGIN = 0x00000000, LENGTH = 0x00000400    /* 1K */    /* Do not change this section */
+    int_flash_config        : ORIGIN = 0x00000400, LENGTH = 0x00000010    /* 16bytes */ /* Do not change this section */
+    int_flash               : ORIGIN = 0x00000410, LENGTH = 0x000FFBF0    /* ~1.0MB */ 
     int_sram_results        : ORIGIN = 0x1FFF0000, LENGTH = 0x00000100    /* 256bytes */
     int_sram                : ORIGIN = 0x1FFF0100, LENGTH = 0x0001DF00    /* ~120K */
-    int_sram_stack_c0       : ORIGIN = 0x2000E000, LENGTH = 0x00001000 - 0x10    /* 4K  */
-    ram_rsvd2               : ORIGIN = 0x2000EFF0, LENGTH = 0             /* End of SRAM */
-    ExchangeInfo            : ORIGIN = 0x2000EFF0, LENGTH = 0x10          
+    int_sram_stack_c0       : ORIGIN = 0x2000E000, LENGTH = 0x00001000    /* 4K  */
+    ram_rsvd2               : ORIGIN = 0x2000F000, LENGTH = 0             /* End of SRAM */
 }
 
 
@@ -60,17 +54,17 @@ SECTIONS
     
 	.flash_interrupts :
 	{
-		. = ALIGN(512);
+		. = ALIGN(4096);
         __interrupts_rom_start = .;
         KEEP(*(.intc_vector))    
-        . = ALIGN(512);
+        . = ALIGN(4);
         __interrupts_rom_end = .;
 	} > int_flash_interrupts
 	
-/*	.flash_config :				*/
-/*	{							*/
-/*		KEEP(*(.flash_config))	*/
-/*	} > int_flash_config		*/
+	.flash_config :
+	{
+		KEEP(*(.flash_config))
+	} > int_flash_config
 	
 	.flash :
 	{
@@ -117,7 +111,6 @@ SECTIONS
 		__DATA_ROM = .;
 	} > int_flash
     
-    
     . = ALIGN(4);
     PROVIDE(__exidx_start = .);
     .ARM.exidx :

+ 1 - 1
src/AppGlobalVar.h

@@ -26,7 +26,7 @@
 #define HWVERSION 0x0001
 #define BLSWVERSION 0x00000002
 #define DRVSWVERSION 0x00000003
-#define APPSWVERSION 0x00000006
+#define APPSWVERSION 0x00000008
 #define BMS_MANUFACTURE 0xFF
 #define BMS_INFO 0xFF
 #define DATA_MODULE_TYPE 0x02

+ 5 - 20
src/AppTaskMain.c

@@ -26,24 +26,6 @@ void MainTask(void *pvParameters)
 	#if UARTPRINTF==1
 		create_ringBuffer(&printfRingBuffer,ringbuffer,sizeof(ringbuffer));
 	#endif
-//#if SEGGER_PRINTF==1
-//	uint8 temp[1024];
-//	uint32 dataLen = 1024;
-//	while(dataLen!=0x028f24)
-//	{
-//    	Hal_FlsRead(0x200 + dataLen, temp, 1024, 100);
-//    	for(uint16 i=0;i<dataLen;i++)
-//    	{
-//    		SEGGER_RTT_printf("%02X ",temp[i]);
-//    		if(i%16==0)
-//    		{
-//    			SEGGER_RTT_printf(",i=%d\r\n",i);
-//    		}
-//    	}
-//    	dataLen = min(1024,0x028f24-dataLen);
-//    }
-//    	SEGGER_RTT_printf("\r\n");
-//#endif
 	while(1)
 	{
 //#if SEGGER_PRINTF==1
@@ -61,11 +43,14 @@ void MainTask(void *pvParameters)
 		{
 			if(IsFeedWdg == TRUE)
 			{
-				//WATCHDOG_HAL_Feed();
+				WATCHDOG_HAL_Feed();
 			}
 		}
-		if(TimerCounter%200==0)
+		if(TimerCounter%1000==0)
 		{
+#if SEGGER_PRINTF==1
+	SEGGER_RTT_printf("[%d] TimerCounter=%d,eol=%d\r\n",__LINE__,TimerCounter,AppConfigInfo.eolFlg);
+#endif
 			if(AppConfigInfo.eolFlg==true)
 			{
 				Dio_FlipChannel(DioConf_DioChannel_PTE9_GPIO_OUT_MCU_LED5);

+ 28 - 12
src/AppTaskUart1.c

@@ -46,6 +46,7 @@ static void TcpDataInfoRecvHandle(uint8 *DataRecv, uint16 DataRecvLen);
 static void GetCSQValue(uint8 *out);
 void Fota_Ftp(uint8 *dataPtrIn);
 void tcpUdsFunc(uint8 *Ptr,uint8 *AnsPtr);
+static void vTimer1000msCallback(TimerHandle_t pxTimer);
 void Uart_4G_Task(void *pvParameters)
 {
 	(void)pvParameters;
@@ -64,6 +65,9 @@ void Uart_4G_Task(void *pvParameters)
 	Dio_WriteChannel(DioConf_DioChannel_PTA7_GPIO_OUT_MCU_4G_PWRKEY, STD_OFF);
 	_4G_Status = Dio_ReadChannel(DioConf_DioChannel_PTB1_GPIO_IN_MCU_4G_STATUS);
 	InitFunc(); // 4G模块初始化,注:AT同步不通过,没有进行次数判定及跳转
+	TimerHandle_t monitorTimer1000ms;
+	monitorTimer1000ms = xTimerCreate("monitor1ms",1,pdTRUE,(void *)0,vTimer1000msCallback);
+	xTimerStart(monitorTimer1000ms,0);
 	for (;;)
 	{
 		switch (gProcess_Tcp_Task)
@@ -82,6 +86,9 @@ void Uart_4G_Task(void *pvParameters)
 			}
 			else if (AppConfigInfo.eolFlg == 1 && (TimerCounter - SendTimerCounter) >= 1000 && TcpWorkState==0)
 			{
+#if SEGGER_PRINTF==1
+	SEGGER_RTT_printf("[%d] SendTimerCounter=%d\r\n",__LINE__,SendTimerCounter);
+#endif
 				SendTimerCounter = TimerCounter;
 				PROC_TCP_STATE_SWITCH(PROCESS_TCP_SEND);
 			}
@@ -188,6 +195,11 @@ void Uart_4G_Task(void *pvParameters)
 		}
 	}
 }
+static void vTimer1000msCallback(TimerHandle_t pxTimer)
+{
+	uint32 ulTimerID;
+	ulTimerID = (uint32)pvTimerGetTimerID(pxTimer);
+}
 sint8 TcpDataSendFunc(sint8 ConnectId)
 {
 	sint8 outValue = -1;
@@ -264,7 +276,7 @@ sint8 TcpConnectFunc(sint8 *ConnectId)
 			if (ATRet >= 0)
 			{
 				*ConnectId = ATRet;
-				return 1;
+				return 2;
 			}
 			else
 			{
@@ -655,7 +667,7 @@ sint8 at_callbackFunc(char *PSendStr, char *pReadStr, uint8 CmdIdx, uint16 pRead
 		if (retptr)
 		{
 			retptr = (uint8 *)strstr((char *)pReadStr, (char *)("CIPOPEN:"));
-			if (retptr)
+			if (retptr&&pReadLen>9)
 			{
 				SocketId = CharToHex(*(retptr + 9));
 			}
@@ -683,7 +695,7 @@ sint8 at_callbackFunc(char *PSendStr, char *pReadStr, uint8 CmdIdx, uint16 pRead
 }
 void TcpDataEncode(uint32 *PtrSendAddr, uint16 *SendLen)
 {
-	UTC8TimeType UTC8TimeTcp;
+	static UTC8TimeType UTC8TimeTcp;
 	uint8 *SendBuffer = NULL;
 	uint8 DataIdx = 0;
 	static uint32 TcpSendTimeCounter = 0;
@@ -1096,12 +1108,15 @@ void GetUtc8Time(UTC8TimeType *UTC8TimeTcp)
 		if ((uint8 *)strstr((char *)UartRecvPtr, (char *)("OK")))
 		{
 			retptr = (uint8 *)strstr((char *)UartRecvPtr, (char *)("+CCLK:"));
-			UTC8TimeTcp->year = CharToHex(*(retptr + 8)) * 10 + CharToHex(*(retptr + 9));
-			UTC8TimeTcp->month = CharToHex(*(retptr + 11)) * 10 + CharToHex(*(retptr + 12));
-			UTC8TimeTcp->day = CharToHex(*(retptr + 14)) * 10 + CharToHex(*(retptr + 15));
-			UTC8TimeTcp->hour = CharToHex(*(retptr + 17)) * 10 + CharToHex(*(retptr + 18));
-			UTC8TimeTcp->minute = CharToHex(*(retptr + 20)) * 10 + CharToHex(*(retptr + 21));
-			UTC8TimeTcp->second = CharToHex(*(retptr + 23)) * 10 + CharToHex(*(retptr + 24));
+			if(retptr)
+			{
+				UTC8TimeTcp->year = CharToHex(*(retptr + 8)) * 10 + CharToHex(*(retptr + 9));
+				UTC8TimeTcp->month = CharToHex(*(retptr + 11)) * 10 + CharToHex(*(retptr + 12));
+				UTC8TimeTcp->day = CharToHex(*(retptr + 14)) * 10 + CharToHex(*(retptr + 15));
+				UTC8TimeTcp->hour = CharToHex(*(retptr + 17)) * 10 + CharToHex(*(retptr + 18));
+				UTC8TimeTcp->minute = CharToHex(*(retptr + 20)) * 10 + CharToHex(*(retptr + 21));
+				UTC8TimeTcp->second = CharToHex(*(retptr + 23)) * 10 + CharToHex(*(retptr + 24));
+			}
 		}
 	}
 }
@@ -1341,10 +1356,11 @@ sint8 tcpipConnectionSend(uint8 TcpConnectId, uint8 *SendDataPtr, uint16 SendDat
 	while(outValue!=0&&sendErrConuter<3)
 	{
 		ret = UART_Query_Data(UART_LPUART1, UART_LPUART1, (uint8 *)AtCmdSend, AtCmdSendTotalLen, UartRecvPtr, &ReadLen, 5000);
-		if (((ret==0)&&(ReadLen>0)&&((uint8 *)strstr((char *)UartRecvPtr, (char *)(">"))))||1)//一个字节收不到的问题,IDE中断间隔过大不行,同时收不到> 引起AT指令不回的问题
+		if (((ret==0)&&(ReadLen>0)&&((uint8 *)strstr((char *)UartRecvPtr, (char *)(">"))))||1)//此IF条件默认通过
 		{
-			UART_Query_Data(UART_LPUART1, UART_LPUART1, (uint8 *)SendDataPtr, SendDataLen, UartRecvPtr, &ReadLen, 5000);
-			if (ReadLen>0&&(uint8 *)strstr((char *)UartRecvPtr, (char *)("\r\nOK\r\n\r\n+CIPSEND")))
+			UART_Send_Data(UART_LPUART1, (uint8 *)SendDataPtr, SendDataLen, 1000);
+			sint8 ret = AtcmdDelayRecvFunc(UART_LPUART1,(char *)("+CIPSEND"),5000);
+			if (ret==0)
 			{
 				outValue = 0;
 			}

+ 57 - 46
src/hal_adapter.c

@@ -97,9 +97,25 @@ uint32_t write_ringBuffer(uint8_t *buffer, uint32_t size, ringbuffer_t *ringBuf)
     volatile uint32_t ringBuf_bw     = ringBuf->bw;
     uint32_t ringBuf_len    = ringBuf->length;
     uint8_t *ringBuf_source = ringBuf->source;
+
+    if( (ringBuf_bw + size) > ringBuf_len  )
+    {
+    	ringBuf_bw = 0;
+    }
+    memcpy(ringBuf_source + ringBuf_bw, buffer, size);
+    ringBuf->bw = (ringBuf->bw + size) % ringBuf_len;
+    ringBuf->btoRead += size;
+
+/*
+    if(ringBuf->br!=0)
+    {
+        memcpy(ringBuf_source, buffer, size);
+        ringBuf->br = 0;
+    }
+*/
+/*
     if( (ringBuf_bw + size) <= ringBuf_len  )
     {
-    	memset(ringBuf_source + ringBuf_bw, 0x00, size);
         memcpy(ringBuf_source + ringBuf_bw, buffer, size);
     }
     else
@@ -110,6 +126,8 @@ uint32_t write_ringBuffer(uint8_t *buffer, uint32_t size, ringbuffer_t *ringBuf)
     }
     ringBuf->bw = (ringBuf->bw + size) % ringBuf_len;
     ringBuf->btoRead += size;
+*/
+
     return size;
 }
 uint32_t read_ringBuffer(uint8_t *buffer, uint32_t size, ringbuffer_t *ringBuf)
@@ -118,44 +136,44 @@ uint32_t read_ringBuffer(uint8_t *buffer, uint32_t size, ringbuffer_t *ringBuf)
     volatile uint32_t ringBuf_br     = ringBuf->br;
     uint32_t ringBuf_len    = ringBuf->length;
     uint8_t *ringBuf_source = ringBuf->source;
-#if SEGGER_PRINTF==1
-    if(ringBuf_source==0x1fffa63c)
-    {
-    	SEGGER_RTT_printf("[%d]buffer=%X,ringBuf_len=%d-%d-%d\r\n",__LINE__,buffer,ringBuf_len,ringBuf_br,size);
-    }
-#endif
-    if( (ringBuf_br + size ) <= ringBuf_len )
-    {
-        memcpy(buffer, ringBuf_source + ringBuf_br, size);
-    }
-    else
-    {
-        len = ringBuf_len - ringBuf_br;
-        memcpy(buffer, ringBuf_source + ringBuf_br, len);
-        memcpy(buffer + len, ringBuf_source, size - len);
-    }
-    ringBuf->br = (ringBuf->br + size) % ringBuf_len;
-    ringBuf->btoRead -= size;
+
+    memcpy(buffer, ringBuf_source, size);
+    ringBuf->br = size;
+
+//    if( (ringBuf_br + size ) <= ringBuf_len )
+//    {
+//        memcpy(buffer, ringBuf_source + ringBuf_br, size);
+//    }
+//    else
+//    {
+//        len = ringBuf_len - ringBuf_br;
+//        memcpy(buffer, ringBuf_source + ringBuf_br, len);
+//        memcpy(buffer + len, ringBuf_source, size - len);
+//    }
+//    ringBuf->br = (ringBuf->br + size) % ringBuf_len;
+//    ringBuf->btoRead -= size;
+
     return size;
 }
 Std_ReturnType UART_Query_Data(uint8 transChannel, uint8 recvChannel, uint8 *txBuffer, uint16 sendLength, uint8 *rxBuffer, uint16 *rxlen, uint32 T_timeout)
 {
-	uint16 queueRecvSize = 0;
+	UartMsg_t UartRecvMsg;
 	UartMsg_t UartSendMsg;
 	BaseType_t Sendret = pdFALSE;
 	BaseType_t Recvret = pdFALSE;
 	uint32 retVal = E_NOT_OK;
 	UartSendMsg.DataLen = sendLength;
-	UartSendMsg.dataPrt = txBuffer;
+	UartSendMsg.dataPtr = txBuffer;
 	*rxlen = 0;
 	Sendret = xQueueSend(UartSendQueue[transChannel],&UartSendMsg,50);
 	if(Sendret == pdTRUE)
 	{
-		Recvret = xQueueReceive(UartRecvQueue[recvChannel],&queueRecvSize,T_timeout);
+		Recvret = xQueueReceive(UartRecvQueue[recvChannel],&UartRecvMsg,T_timeout);
 		if(Recvret == pdTRUE)
 		{
-			*rxlen = queueRecvSize;
-			read_ringBuffer(rxBuffer, queueRecvSize, &uartRingBuffer[recvChannel]);
+			*rxlen = UartRecvMsg.DataLen;
+	//		read_ringBuffer(rxBuffer, queueRecvSize, &uartRingBuffer[recvChannel]);
+			memcpy(rxBuffer,(uint8 *)(UartRecvMsg.dataAddr),UartRecvMsg.DataLen);
 			retVal = E_OK;
 		}
 		else
@@ -171,15 +189,16 @@ Std_ReturnType UART_Query_Data(uint8 transChannel, uint8 recvChannel, uint8 *txB
 }
 Std_ReturnType UART_Receive_Data(uint8 recvChannel, uint8 *rxBuffer, uint8 *rxlen, uint32 T_timeout)
 {
-	uint16 queueRecvSize = 0;
+	UartMsg_t UartRecvMsg;
 	BaseType_t ret = pdFALSE;
 	uint32 retVal = E_NOT_OK;
 	*rxlen = 0;
-	ret = xQueueReceive(UartRecvQueue[recvChannel],&queueRecvSize,T_timeout);
+	ret = xQueueReceive(UartRecvQueue[recvChannel],&UartRecvMsg,T_timeout);
 	if(ret == pdTRUE)
 	{
-		*rxlen = queueRecvSize;
-		read_ringBuffer(rxBuffer, queueRecvSize, &uartRingBuffer[recvChannel]);
+		*rxlen = UartRecvMsg.DataLen;
+//		read_ringBuffer(rxBuffer, queueRecvSize, &uartRingBuffer[recvChannel]);
+		memcpy(rxBuffer,(uint8 *)UartRecvMsg.dataAddr,UartRecvMsg.DataLen);
 		retVal = E_OK;
 	}
 	return retVal;
@@ -196,7 +215,7 @@ Std_ReturnType UART_Send_Data(uint8 transChannel, const uint8 *txBuffer, uint32
 	BaseType_t ret = pdFALSE;
 	uint32 retVal = E_NOT_OK;
 	UartSendMsg.DataLen = sendLength;
-	UartSendMsg.dataPrt = txBuffer;
+	UartSendMsg.dataPtr = txBuffer;
 	ret = xQueueSend(UartSendQueue[transChannel],&UartSendMsg,T_timeout);
 	if(ret == pdTRUE)
 	{
@@ -209,9 +228,9 @@ Std_ReturnType UART_Send_Data(uint8 transChannel, const uint8 *txBuffer, uint32
 	 create_ringBuffer(&uartRingBuffer[0],ringBufferforUart[0],sizeof(ringBufferforUart[0]));
 	 create_ringBuffer(&uartRingBuffer[1],ringBufferforUart[1],sizeof(ringBufferforUart[1]));
 	 create_ringBuffer(&uartRingBuffer[2],ringBufferforUart[2],sizeof(ringBufferforUart[2]));
-	 UartRecvQueue[0] = xQueueCreate(6, sizeof(uint16));
-	 UartRecvQueue[1] = xQueueCreate(6, sizeof(uint16));
-	 UartRecvQueue[2] = xQueueCreate(6, sizeof(uint16));
+	 UartRecvQueue[0] = xQueueCreate(6, sizeof(UartMsg_t));
+	 UartRecvQueue[1] = xQueueCreate(6, sizeof(UartMsg_t));
+	 UartRecvQueue[2] = xQueueCreate(6, sizeof(UartMsg_t));
 	 UartSendQueue[0] = xQueueCreate(3, sizeof(UartMsg_t));
 	 UartSendQueue[1] = xQueueCreate(1, sizeof(UartMsg_t));
 	 UartSendQueue[2] = xQueueCreate(1, sizeof(UartMsg_t));
@@ -252,6 +271,7 @@ Std_ReturnType UART_Send_Data(uint8 transChannel, const uint8 *txBuffer, uint32
  void Uart_Hal_RecvTask(void *pvParameters)
  {
 	 UartHalMsg_t UartHalMsgRecv;
+	 UartMsg_t UartRecvMsg;
 	 uint16 recvSize = 0;
 	 BaseType_t ret = pdFALSE;
 	 BaseType_t ret_send = pdFALSE;
@@ -291,19 +311,10 @@ Std_ReturnType UART_Send_Data(uint8 transChannel, const uint8 *txBuffer, uint32
 					if(UartHalMsgRecv.value>0)
 					{
 						recvSize = write_ringBuffer(RX_Buffer[UartHalMsgRecv.Channel],UartHalMsgRecv.value,&uartRingBuffer[UartHalMsgRecv.Channel]);
-						ret_send = xQueueSend(UartRecvQueue[UartHalMsgRecv.Channel],&recvSize,10);
+						UartRecvMsg.DataLen = UartHalMsgRecv.value;
+						UartRecvMsg.dataAddr = (uint32)(uartRingBuffer[UartHalMsgRecv.Channel].bw + uartRingBuffer[UartHalMsgRecv.Channel].source - recvSize);
+						ret_send = xQueueSend(UartRecvQueue[UartHalMsgRecv.Channel],&UartRecvMsg,10);
 					}
-#if SEGGER_PRINTF==1
-					if(UartHalMsgRecv.Channel==1)
-					{
-						SEGGER_RTT_printf("uart1_recv= ");
-						for(uint16 i=0;i<recvSize;i++)
-						{
-							SEGGER_RTT_printf("%02X ",RX_Buffer[UartHalMsgRecv.Channel][i]);
-						}
-						SEGGER_RTT_printf("\r\n");
-					}
-#endif
 					T_timeout[UartHalMsgRecv.Channel] = 0;
 					UartState[UartHalMsgRecv.Channel] = UartRecvComplete;
 			  }
@@ -331,10 +342,10 @@ Std_ReturnType UART_Send_Data(uint8 transChannel, const uint8 *txBuffer, uint32
 #if SEGGER_PRINTF==1
 					if(UartIdx==1)
 					{
-						SEGGER_RTT_printf("[%d]uart1_s=%s\r\n",__LINE__,UartSendMsg.dataPrt);
+						SEGGER_RTT_printf("[%d]uart1_s=%s\r\n",__LINE__,UartSendMsg.dataPtr);
 					}
 #endif
-			 T_Uart_Status[UartIdx] = Uart_AsyncSend(UartIdx, UartSendMsg.dataPrt, UartSendMsg.DataLen);
+			 T_Uart_Status[UartIdx] = Uart_AsyncSend(UartIdx, UartSendMsg.dataPtr, UartSendMsg.DataLen);
 		     if (E_OK != T_Uart_Status[UartIdx])
 		     {
 		         Uart_Abort(UartIdx, UART_SEND);

+ 2 - 1
src/hal_adapter.h

@@ -91,7 +91,8 @@ typedef struct {
  typedef struct
  {
      uint16 DataLen;
-     uint8 *dataPrt;
+     uint8 *dataPtr;
+     uint32 dataAddr;
  } UartMsg_t;
  typedef struct
  {

+ 2 - 2
src/main.c

@@ -155,7 +155,7 @@ int main(void)
 	/* Enable the Gpt notification to periodically service the Wdg */
 	Gpt_EnableNotification(GptConf_GptChannelConfiguration_GptChannelConfiguration_0);
 
-	//WdgInit();
+	WdgInit();
 	IP_LPUART0->CTRL |= LPUART_CTRL_ILT(1);
 	IP_LPUART1->CTRL |= LPUART_CTRL_ILT(1);
 	IP_LPUART2->CTRL |= LPUART_CTRL_ILT(1);
@@ -176,7 +176,7 @@ int main(void)
 	SEGGER_RTT_printf("[%d] boot -%d\r\n",__LINE__,bootreason);
 #endif
 	UartInit();
-	xTaskCreate(MainTask, (const char *const)"MainTask", 256, (void *)0, main_TASK_PRIORITY + 3, NULL);
+	xTaskCreate(MainTask, (const char *const)"MainTask", 256, (void *)0, main_TASK_PRIORITY + 6, NULL);
 	xTaskCreate(Uart0Task, (const char *const)"Uart0_Bms_Task", 1024, (void *)0, main_TASK_PRIORITY + 2, NULL);
 	xTaskCreate(CanTask, (const char *const)"CanTask", 512, (void *)0, main_TASK_PRIORITY + 2, NULL);
 	xTaskCreate(GpsTask, (const char *const)"GpsTask", 512, (void *)0, main_TASK_PRIORITY + 1, NULL);