dp512 flash erase during programming

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

dp512 flash erase during programming

Jump to solution
2,055 Views
israel
Contributor I
Hello,
I am using mot V1.2 codewarrior with the icd12 P&E BDM and dp512.
In my project I write and read amount of data from ppage $28 of the flash. these operation are done well. when I reprogram from the codewarrior IDE this page is overwritten with zeros (not 0xff) and the data is lost.
I tried to check if it has somthing to do with the preload.cmd file where I erase the page modules but it seems not.
1. can it be that the program itself ovrewrites this page?
2. is it possible to burn just the program data without burning the other pages? where can I find some more information how this proccess is done?
any idea why?
3.
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
861 Views
CrasyCat
Specialist III

Hello

Basically when you start a debug session, the debugger will perform a bulk erase of the whole flash prior to sownloading the code. After a download content of the page 28 should be set to 0xFF (if you do not have anything loaded to that page.

If you have 0x00 there, you probably have some variable defined there...

If you have some constant data from a S record file that you want to store on page 0x28, you can link an existing S record file to the application using the command HEXFILE in the linker .prm file.

Please refer to the SmartLinker manual for more info on that command.

I hope this helps. 

CrasyCat

View solution in original post

0 Kudos
Reply
2 Replies
862 Views
CrasyCat
Specialist III

Hello

Basically when you start a debug session, the debugger will perform a bulk erase of the whole flash prior to sownloading the code. After a download content of the page 28 should be set to 0xFF (if you do not have anything loaded to that page.

If you have 0x00 there, you probably have some variable defined there...

If you have some constant data from a S record file that you want to store on page 0x28, you can link an existing S record file to the application using the command HEXFILE in the linker .prm file.

Please refer to the SmartLinker manual for more info on that command.

I hope this helps. 

CrasyCat

0 Kudos
Reply
861 Views
UK_CF_FAE
NXP Employee
NXP Employee
Hi,
 
"DP512"
 
I assume this is a MC9S12DP512. Erase state of this flash is 0xFF, and so the application must have some data in page 0x28 that is causing the flash to be written to 0x00 after the mass erase.
 
I'm not familiar with CW V1.2 - this is very old now - but there will be a technique with the flash programming tool to erase and program a page of flash at a time.
 
Mark