From 99f7e63d69c6b7f851495cc6da44dd7acdd0fa04 Mon Sep 17 00:00:00 2001 From: kyz Date: Tue, 31 Dec 2024 10:37:24 +0800 Subject: [PATCH] =?utf8?q?=E5=85=B3=E9=97=AD=E5=88=9D=E5=A7=8B=E5=8C=96?= =?utf8?q?=E6=95=B0=E6=8D=AE=E5=8E=8B=E7=BC=A9=EF=BC=8C=E5=9B=BA=E4=BB=B6?= =?utf8?q?=E4=B8=AD=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=A0=81=E5=A4=A7=E5=B0=8F?= =?utf8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- STM32/IAR_config/linker/stm32f407xx_flash.icf | 2 +- STM32/code/app/main_task.c | 4 ++++ STM32/code/main.c | 2 -- STM32/code/mcu_com/mcu_com.c | 5 ++--- STM32/code/startup/startup_stm32f407xx.s | 12 +++++++++++- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/STM32/IAR_config/linker/stm32f407xx_flash.icf b/STM32/IAR_config/linker/stm32f407xx_flash.icf index 14541d10..0c12d689 100644 --- a/STM32/IAR_config/linker/stm32f407xx_flash.icf +++ b/STM32/IAR_config/linker/stm32f407xx_flash.icf @@ -24,7 +24,7 @@ define region CCMRAM_region = mem:[from __ICFEDIT_region_CCMRAM_start__ to _ define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; -initialize by copy { readwrite }; +initialize by copy with packing=none { readwrite }; do not initialize { section .noinit }; place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; diff --git a/STM32/code/app/main_task.c b/STM32/code/app/main_task.c index e08ea8fb..f6e7978e 100644 --- a/STM32/code/app/main_task.c +++ b/STM32/code/app/main_task.c @@ -34,8 +34,12 @@ #include "partial_discharge.h" #include "App_Lora.h" #include "Get_EquipmentData.h" +#include "app_ver.h" + extern tEngRamDbase s_Ram_eng; BOOL IF_UPADTING = FALSE; + +const uint8_t SW_VER[4] = { SW_VER_MAJOR, SW_VER_MINOR, 0, 0 }; /* ¸´Î»»òÕßµôµçÒª´æ´¢µ±Ç°µôµçÊý¾Ý */ diff --git a/STM32/code/main.c b/STM32/code/main.c index 454c1697..018ca8a5 100644 --- a/STM32/code/main.c +++ b/STM32/code/main.c @@ -92,8 +92,6 @@ int main(void) /* Ó¦Óóõʼ»¯ */ App_Init(); - printf( "app start...\n" ); - while (1) { last_tick = HAL_GetTick(); diff --git a/STM32/code/mcu_com/mcu_com.c b/STM32/code/mcu_com/mcu_com.c index 286778f0..2f56a4b5 100644 --- a/STM32/code/mcu_com/mcu_com.c +++ b/STM32/code/mcu_com/mcu_com.c @@ -1798,12 +1798,11 @@ void Mqtt_Proactive_Escalation(void) } #endif //发送mcu软件版本信息 +extern uint8_t SW_VER[4]; void send_mcuSoftWare_Version(void) { uint8_t len; - uint8_t data[2] = {SW_VER_MAJOR, SW_VER_MINOR};//版本1.4 - - len = McuCom_Sensor_Packet(GET_SOFT_VERSION, 0x02, data, 2); + len = McuCom_Sensor_Packet(GET_SOFT_VERSION, 0x02, SW_VER, 2); UART_Tx_One_Frame(PORT_UART_IFACE_WIFI, com_temp, len); } diff --git a/STM32/code/startup/startup_stm32f407xx.s b/STM32/code/startup/startup_stm32f407xx.s index 261246e2..df2a8018 100644 --- a/STM32/code/startup/startup_stm32f407xx.s +++ b/STM32/code/startup/startup_stm32f407xx.s @@ -49,6 +49,9 @@ EXTERN __iar_program_start EXTERN SystemInit + EXTERN SW_VER + EXTERN Region$$Table$$Base + EXTERN Region$$Table$$Limit PUBLIC __vector_table DATA @@ -154,7 +157,14 @@ __vector_table DCD 0 ; Reserved DCD HASH_RNG_IRQHandler ; Hash and RNG DCD FPU_IRQHandler ; FPU - + + DS8 __vector_table + 0x200 - . + DCD 0x0055434D ;'MCU\0' + DCD SW_VER + DCD __vector_table + DCD Region$$Table$$Base + DCD Region$$Table$$Limit + DS8 __vector_table + 0x240 - . ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. -- 2.34.1