Commit b7655a31 authored by 张明扬's avatar 张明扬 🇨🇳

fix:修改22服务数据存储地址为0x500800ul,

共用同一地址时会导致频繁更新BOOT程序与22服务信息
parent fa9fdbc9
...@@ -168,7 +168,7 @@ void Write_App_InValid(uint32_t m32) ...@@ -168,7 +168,7 @@ void Write_App_InValid(uint32_t m32)
/*写22服务数据*/ /*写22服务数据*/
void DFlash_init(void) void DFlash_init(void)
{ {
DiagDFlashData* ReadDiagDataForDFlash =(DiagDFlashData*)0x500200; DiagDFlashData* ReadDiagDataForDFlash =(DiagDFlashData*)APP_DATA_INFO;
if( (ReadDiagDataForDFlash->Flag != 0x5AA5A77Au)|| if( (ReadDiagDataForDFlash->Flag != 0x5AA5A77Au)||
(0!=memcmp(ReadDiagDataForDFlash->DID_F180 , MCU_FBLversion,sizeof(MCU_FBLversion)))|| (0!=memcmp(ReadDiagDataForDFlash->DID_F180 , MCU_FBLversion,sizeof(MCU_FBLversion)))||
...@@ -180,9 +180,9 @@ void DFlash_init(void) ...@@ -180,9 +180,9 @@ void DFlash_init(void)
Data_Set_DiagPara(); Data_Set_DiagPara();
DiagDataForDFlash.Flag = 0x5AA5A77Au; DiagDataForDFlash.Flag = 0x5AA5A77Au;
//擦除扇区 //擦除扇区
EraseSector (0x500200ul); EraseSector (APP_DATA_INFO);
//App程序状态和22服务数据全写进去 //App程序状态和22服务数据全写进去
ProgramPage (0x500200ul, sizeof(DiagDataForDFlash), (uint8_t *)(&DiagDataForDFlash)); ProgramPage (APP_DATA_INFO, sizeof(DiagDataForDFlash), (uint8_t *)(&DiagDataForDFlash));
} }
else else
{ {
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#define NoNeedWait 0x00u #define NoNeedWait 0x00u
#define NeedWait 0x01u #define NeedWait 0x01u
#define APP_STATUS_ADDR (0x500400ul) #define APP_STATUS_ADDR (0x500400ul)
#define APP_DATA_INFO (0x500800ul)
#define Data_Flash_Addr_BootValid_OFFSET 0x00000000 #define Data_Flash_Addr_BootValid_OFFSET 0x00000000
#define Data_Flash_Addr_DiagReceive_OFFSET 0x00002000 #define Data_Flash_Addr_DiagReceive_OFFSET 0x00002000
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment