How to preserve EEPROM when debugging

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to preserve EEPROM when debugging

1,267 Views
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

Labels (1)
0 Kudos
2 Replies

599 Views
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

599 Views
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 Kudos