program flash data?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

program flash data?

1,148件の閲覧回数
zengxianke
Contributor II

I have two global variables.

int a = 123;

int F_a = 789;

my ld script is :

e.g.

.asec

{

.data.a

} > myram; // no load address, only reserve spaces in ram.

.Fsec

{

.data.F_a

} > myflash; // only load data 789 to FLASH

after boot then main then...init:   copy F_a data in flash to .data.a 's ram address. now  a value is 789.

 

then calibrate a to 790 for example through can or sci or something else, and then PROGRAM 790 to F_a in the flash for next power up and init a with 790.

but CAN NOT ERASE & PROGRAM Success!   WHY?

0 件の賞賛
返信
2 返答(返信)

881件の閲覧回数
jiri_kral
NXP Employee
NXP Employee

Hi, 

which MCU are you using - S32K144? 

For calibration data and S32K144 is better idea use FlexNVM configured as EEEROM. With direct write into pflash you have to erase at least one sector then program it and verify. With EEEROM you only call FLASH_DRV_EEEWrite() fucntion. 

You can look at flash_partitioning_s32k144 S32DS Example. 

Jiri 

881件の閲覧回数
zengxianke
Contributor II

Thank you. It is a good suggestion. In fact, the flash content changed, but the debugger not update. I guess it read the data from elf file once. I use some array for check my program flash action, it is correct. Maybe debugger find that the ld script say the range is data initial value, so it doesn't update the viewer from flash volatilely. Thank you so much.

0 件の賞賛
返信