From 845a1ed295871fff7ab46fd0316f55fdc8d3fc2f Mon Sep 17 00:00:00 2001 From: zhangsan Date: Thu, 7 Oct 2021 17:45:45 +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 196 -> 196 bytes source/app/app_config.c | 4 ++-- source/app/task_encrypt.c | 2 +- source/bsp/bsp_config.h | 6 +++--- 4 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 552e261c8c2ef8d546cec4e6aa306e04703d9fa1..309909cea7d2e84e440e5954f6b8e4782a6472a0 100644 GIT binary patch delta 33 lcmX@Yc!W_zn1O*^h=GBHlYxOj4Tzb6{D~sPjO-ITYyd{b1bqMi delta 33 icmX@Yc!W_zn1O*o2#7g>SPh7ofq0@wF(bpo4jTYPX#`{d diff --git a/source/app/app_config.c b/source/app/app_config.c index 2489081..3a19225 100644 --- a/source/app/app_config.c +++ b/source/app/app_config.c @@ -44,7 +44,7 @@ void L3_reg_2_iap(void) L0_uart0_sendstr("e2p write success"); } #endif - if(L1_eep_write_block(D_EEP_PARAM_IN_SECTOR, D_EEP_PARAM_IN_BLOCK, D_EEP_PARAM_BLOCK_SIZE, (U8*)&R.p,sizeof(R.p),TRUE) == 0) + if(L1_eep_write_block(D_EEP_PARAM_IN_SECTOR, D_EEP_PARAM_IN_BLOCK, D_EEP_SECTOR_BLOCK_SIZE, (U8*)&R.p,sizeof(R.p),TRUE) == 0) { L0_uart0_sendstr("e2p write success"); return; @@ -73,7 +73,7 @@ void L3_iap_2_reg(void) R.p.adc_blur_threshold[0] = iapData.adc_blur_threshold[0]; R.p.adc_blur_threshold[1] = iapData.adc_blur_threshold[1]; #endif - if(L1_eep_read_block(D_EEP_PARAM_IN_SECTOR, D_EEP_PARAM_IN_BLOCK, D_EEP_PARAM_BLOCK_SIZE, (U8*)&R.p, NULL) == 0) + if(L1_eep_read_block(D_EEP_PARAM_IN_SECTOR, D_EEP_PARAM_IN_BLOCK, D_EEP_SECTOR_BLOCK_SIZE, (U8*)&R.p, NULL) == 0) { L0_uart0_sendstr("e2p read success"); return; diff --git a/source/app/task_encrypt.c b/source/app/task_encrypt.c index 51c2e70..c7218ac 100644 --- a/source/app/task_encrypt.c +++ b/source/app/task_encrypt.c @@ -31,7 +31,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 c37d08f..126bc70 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