Browse Source

平峰正式版提交

LAPTOP-KB7QFH2U\ChenJie-PC 2 years ago
parent
commit
f8abc5278d

+ 11 - 18
Project_Settings/Linker_Files/linker_flash_s32k146.ld

@@ -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 :

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

@@ -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 :

+ 4 - 4
src/AppGlobalVar.c

@@ -41,10 +41,10 @@ sint8 SocketId = -1;//
 sint8 RegChkRet = 0;//פÍø״̬
 char WebSiteIp[20] = {0};
 uint8 TcpWorkState = 0;
-//const char WebSiteName[] = "\"iotp.fast-fun.cn\"";
-//uint16 WebSitePort = 8712;
-const char WebSiteName[] = "\"nas.fast-fun.cn\"";
-uint16 WebSitePort = 8812;
+const char WebSiteName[] = "\"iotp.fast-fun.cn\"";
+uint16 WebSitePort = 8712;
+//const char WebSiteName[] = "\"nas.fast-fun.cn\"";
+//uint16 WebSitePort = 8812;
 
 #define EEP_START_SEC_VAR_INIT_8_NO_CACHEABLE
 #include "Eep_MemMap.h"

+ 1 - 1
src/AppTaskUart0.c

@@ -194,7 +194,7 @@ void Uart0Task(void *pvParameters)
 				PutErrorNum(ErrorArray, sizeof(ErrorArray)/2, 1);
 				vTaskDelay(pdMS_TO_TICKS(5000));
 			}
-			if(readCnt%60==0)
+			if(readCnt%60==0||0)
 			{
 				/**µç±íÊý¾Ý¶ÁÈ¡*/
 				for(uint8 i=0;i<2;i++)

+ 8 - 1
src/AppTaskUart1.c

@@ -411,6 +411,7 @@ void InitFunc(void)
 	char *ATCmdSend = NULL;
 	uint8 ATCmdSendLen = 0;
 	uint8 *UartRecvPtr = NULL;
+	uint8 ATerrorCnt = 0;
 	while (1)
 	{
 		switch (_4G_InitStep)
@@ -420,11 +421,17 @@ void InitFunc(void)
 			AtcmdTransmit(AT_CMD_TEST, NULL, 0, &ATRet,100);
 			if (ATRet == 0)
 			{
+				ATerrorCnt = 0;
 				_4G_InitStep++;
 			}
 			else
 			{
-				vTaskDelay(pdMS_TO_TICKS(100));
+				vTaskDelay(pdMS_TO_TICKS(1000));
+				ATerrorCnt++;
+				if(ATerrorCnt>60*5)
+				{
+					SystemSoftwareReset();
+				}
 			}
 			break;
 		}

+ 1 - 1
src/hal_adapter.h

@@ -50,7 +50,7 @@ typedef signed char INT8;
 typedef signed short INT16;
 typedef signed long INT32;
 
-#define UARTPRINTF 1
+#define UARTPRINTF 0
 #define CAN0 0
 #define CAN1 1
 #ifndef min

+ 1 - 1
src/main.c

@@ -170,7 +170,7 @@ int main(void)
 
 	UartInit();
 	xTaskCreate(MainTask, (const char *const)"MainTask", 512, (void *)0, main_TASK_PRIORITY + 3, NULL);
-//	xTaskCreate(Uart0Task, (const char *const)"Uart0_Bms_Task", 512, (void *)0, main_TASK_PRIORITY + 2, NULL);
+	xTaskCreate(Uart0Task, (const char *const)"Uart0_Bms_Task", 512, (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);
 	xTaskCreate(Uart_4G_Task, (const char *const)"Uart_4G_Task", 2048, (void *)0, main_TASK_PRIORITY + 0, NULL);