[FLASH] erase and program

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

[FLASH] erase and program

ソリューションへジャンプ
1,561件の閲覧回数
Pogo
Contributor III

Hi,

I've one question about erase and program Flash. When I erased one sector(1K) on FLASH, but I didn't program one sector and just program 8 bytes. If I read those non-program data, it will return what data? keep data before erased or can't be read?

If the answer is it can't be read. That's mean that if I want to write only 8 bytes data to FLASH, I still need to erase one sector and program one sector. Or the non-program part can't be read. Is it right?

 

Regards,

Pogo

ラベル(1)
0 件の賞賛
返信
1 解決策
1,088件の閲覧回数
kef
Specialist I

After erase you should see all ones, each bit of flash in erased sector should read as =1. Each byte in flash sector should read as =0xFF. Old data is lost. Yes, to reprogram just 8 bytes you need to erase whole sector.

 

Maybe CW debugger confused you? For faster operation this debugger by default caches contents of NV memory and doesn't update it from flash, EEPROM etc. It may look as if data didn't change after erase. You may change this behaviour going to Multilink->Debugging memory map menu and checking update-on-halt checkboxes to make debugger updating data from MCU memory.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,089件の閲覧回数
kef
Specialist I

After erase you should see all ones, each bit of flash in erased sector should read as =1. Each byte in flash sector should read as =0xFF. Old data is lost. Yes, to reprogram just 8 bytes you need to erase whole sector.

 

Maybe CW debugger confused you? For faster operation this debugger by default caches contents of NV memory and doesn't update it from flash, EEPROM etc. It may look as if data didn't change after erase. You may change this behaviour going to Multilink->Debugging memory map menu and checking update-on-halt checkboxes to make debugger updating data from MCU memory.

0 件の賞賛
返信
1,088件の閲覧回数
Pogo
Contributor III

Hi Kef,

Thanks a lot.

 

Regards,

Pogo

0 件の賞賛
返信