How to preserve EEPROM when debugging

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to preserve EEPROM when debugging

1,711 次查看
rogerfl
Contributor III

Hello, I'm using the freedom K20 board with CW 10.4 and trying to use EEPROM. I think it is working but every time I Debug, the flash gets erased so anything I might have saved in EEPROM is erased as well. Trying to use advanced options of debugger - see dialog attached - to preserve the whole data flash. When I do that it fails to load and I get the following error:

INF: Re-programming preserved data range $10000000-$10007FFF ...     

INF:         Done.

INF: CMD>PM

INF: Programming.

INF: Processing Object File Data ...

INF: .

INF: Programmed.

INF: CMD>VC

INF: Verifying object file CRC-16 to device ranges ...

INF:    block 00000000-0000BDEF ...

INF: CRC-16 Error in block. (File = $E27B, Device = $0000)

Any ideas?

Roger

标签 (1)
0 项奖励
回复
2 回复数

1,043 次查看
pavel_sadek
NXP Employee
NXP Employee

Hi

you can target your code to RAM, that is one option that allows you to keep the flash completely untouched, or you have options directly inside CW - look at these blogs, it might help you

http://mcuoneclipse.com/2012/10/10/attach-connect-download/

http://mcuoneclipse.com/2012/04/27/programming-part-of-flash/

Pavel

1,043 次查看
rogerfl
Contributor III

Thanks Pavel that helped. Using an Attach debug configuration allowed me to observe EEPROM working without getting erased by the Download debug configuration. Also just running without any debug session let me see what I wanted to see on the console I have configured...

EEPROM Loaded and checksum passed

Still, I would hope there is some way to preserve EEPROM between download debug sessions.  I would like for the download to NOT do an Erase All - Erase Block on the program flash block would be OK.

0 项奖励
回复