From d7129bc2778d1ae18943b92295d6d245558fc9da Mon Sep 17 00:00:00 2001 From: zhangsan Date: Thu, 7 Oct 2021 17:40:24 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=20=E4=BF=AE=E6=AD=A3eeprom=20block=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- si4/ps5ws.si4project/soft_ps5ws.sip_xm | Bin 144 -> 140 bytes source/app/common.c | 6 +++--- source/bsp/bsp_config.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/si4/ps5ws.si4project/soft_ps5ws.sip_xm b/si4/ps5ws.si4project/soft_ps5ws.sip_xm index 38c549dfea2dcdd85573c513fa7d47b2e36faf0f..a6f024462fca34cad37843fd7250dfa0fc1f8db4 100644 GIT binary patch delta 9 QcmbQh*uywMVWLV701mPO@Bjb+ delta 11 ScmeBSoWM9ifsu2fY(4-IW&-vA diff --git a/source/app/common.c b/source/app/common.c index 6c4c417..b397d79 100644 --- a/source/app/common.c +++ b/source/app/common.c @@ -29,7 +29,7 @@ void L3_eeprom_read_param() } } #endif - if(L1_eep_read_block(D_EEP_PARAM_IN_SECTOR, D_EEP_PARAM_IN_BLOCK, D_EEP_PARAM_BLOCK_SIZE, (U8*)&G.p, NULL) == 0) + if(L1_eep_read_block(D_EEP_PARAM_IN_SECTOR, D_EEP_PARAM_IN_BLOCK, D_EEP_SECTOR_BLOCK_SIZE, (U8*)&G.p, NULL) == 0) { //L0_uart0_sendstr("e2p read success"); return; @@ -51,7 +51,7 @@ void L3_eeprom_persist_param() L0_Iap_Erase(EEP_PARAM_ADDR); L0_Iap_Program_array(EEP_PARAM_ADDR, (U8*)&eep_param, 2 + dlen + 2); #endif - if(L1_eep_write_block(D_EEP_PARAM_IN_SECTOR, D_EEP_PARAM_IN_BLOCK, D_EEP_PARAM_BLOCK_SIZE, (U8*)&G.p,sizeof(G.p),TRUE) == 0) + if(L1_eep_write_block(D_EEP_PARAM_IN_SECTOR, D_EEP_PARAM_IN_BLOCK, D_EEP_SECTOR_BLOCK_SIZE, (U8*)&G.p,sizeof(G.p),TRUE) == 0) { //L0_uart0_sendstr("e2p write success"); return; @@ -109,7 +109,7 @@ int L3_mcu_id_ok(void) U8 i = 0; //1. 获取eeprom中存储的enc信息 - if(L1_eep_read_block(D_EEP_ENC_IN_SECTOR, D_EEP_ENC_IN_BLOCK, D_EEP_ENC_BLOCK_SIZE, (U8*)&eep_enc,NULL) == 1) + if(L1_eep_read_block(D_EEP_ENC_IN_SECTOR, D_EEP_ENC_IN_BLOCK, D_EEP_SECTOR_BLOCK_SIZE, (U8*)&eep_enc,NULL) == 1) { //L0_uart0_sendstr("e2p read enc failed"); return 0; diff --git a/source/bsp/bsp_config.h b/source/bsp/bsp_config.h index d5d635d..952b972 100644 --- a/source/bsp/bsp_config.h +++ b/source/bsp/bsp_config.h @@ -116,13 +116,13 @@ //EEP User Defined 参数区存储配置 #define D_EEP_PARAM_IN_SECTOR 1 //eeprom参数区扇区地址,从0开始 #define D_EEP_PARAM_IN_BLOCK 0 //eeprom参数区数据块地址,从0开始 - #define D_EEP_PARAM_BLOCK_SIZE (D_EEP_SECTOR_BLOCK_SIZE) //参数区每个块大小,必须:D_EEP_PARAM_BLOCK_SIZE<=D_EEP_SECTOR_BLOCK_SIZE!!!,因为eeprom.h中是按照D_EEP_SECTOR_BLOCK_SIZE分配的buf - #define D_EEP_PARAM_BLOCK_NUM (D_EEP_SECTOR_SIZE / D_EEP_PARAM_BLOCK_SIZE) //每个扇区数据块的数量 + //#define D_EEP_PARAM_BLOCK_SIZE (D_EEP_SECTOR_BLOCK_SIZE) //参数区每个块大小,必须:D_EEP_PARAM_BLOCK_SIZE<=D_EEP_SECTOR_BLOCK_SIZE!!!,因为eeprom.h中是按照D_EEP_SECTOR_BLOCK_SIZE分配的buf + //#define D_EEP_PARAM_BLOCK_NUM (D_EEP_SECTOR_SIZE / D_EEP_PARAM_BLOCK_SIZE) //每个扇区数据块的数量 //EEP 加密区存储配置 #if(D_CODE_ENCRYPTION_TYPE == TYPE_ENCRYPTION_ENABLE) #define D_EEP_ENC_IN_SECTOR 0 //eeprom加密区扇区地址,从0开始 #define D_EEP_ENC_IN_BLOCK 0 //eeprom加密区数据块地址,从0开始 - #define D_EEP_ENC_BLOCK_SIZE 0x20 //ENC_BLOCK_SIZE必须与加密程序中的ENC_BLOCK_SIZE匹配,此处不建议修改,如需修改,请同时修改加密程序 + //#define D_EEP_ENC_BLOCK_SIZE 0x20 //ENC_BLOCK_SIZE必须与加密程序中的ENC_BLOCK_SIZE匹配,此处不建议修改,如需修改,请同时修改加密程序 #endif #elif xxx