MC9S12 Code memory was erased

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

MC9S12 Code memory was erased

1,467 Views
hs3401
Contributor I
Now I am using MC9S12DJ128 in our equiptment.
But I have one problem.
The codes I have writed in MC9S12DJ128 flash memory is erased sometimes.
When the code is erased, I write the codes again and it works well.
I don't know why.
This do not happen so often.
But, you know, it can be a big trouble.
 
Please help me to solve this problem!
 
 
Labels (1)
0 Kudos
Reply
1 Reply

351 Views
Alban
Senior Contributor II

Hello,

If you do have Flash programming routines inside your MCU, your ERASE function is maybe called.
There is a way to prevent this by securing your Flash, but it doesn't solve the root of the issue and could produce other un-desired behaviour.

Is it the whole Flash being erased or an area in particular ?
May be your code runs away and starts the erase routine. Try and put a special instruction to stop the MCU at start of routine if you can reproduce the issue.

Cheers,
Alban.

0 Kudos
Reply