MKL02z32 was programmed as a MKL16Z128 using PEMicro tools. How to reset to factory settings?

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

MKL02z32 was programmed as a MKL16Z128 using PEMicro tools. How to reset to factory settings?

2,815 Views
mikestevens53
Contributor I

MKL02z32 was programmed as a MKL16Z128 using PEMicro tools.  The application is in flash and seems OK, but the KL02 isn't responding to commands properly.  I suspect some incorrect register settings.  We tried reprogramming the part as a KL02, but that didn't fix the problem.

Is there a way to reset the KL02z32 back to a factory reset state? We have both PEMicro and IAR tools available.

I've found that a key operational difference is that my I2C lines look like they are going into contention (Data being held low, Clock at about 50% of it's normal voltage level after some initial code runs.  The I2C uses PTB3 and PTB4.

Today I also discovered that a number of memory values in in 0x400x xxxx and 0xe000 xxxx are different between a working product and the mis-programmed products.  Some of this makes sense since they are counters and comparators, but other values don't make sense, and I can't find a way to edit them.  Is there a way to cause this area to reset to default or factory settings?  Or edit these locations?  I've again verified that the lower flash area (bootloader and application) are identical.

Labels (1)
0 Kudos
Reply
7 Replies

2,586 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Mike Stevens

You can apply a mass erase to the flash and reset your device back to factory memory state, there is a way by the J-Link commander, please check https://mcuoneclipse.com/2014/10/05/unlocking-and-erasing-flash-with-segger-j-link/  where they explain how to do this.

Memory values 0x400x xxxx and 0xe000 xxxx are memory that you could program by your application, you can configure it as you working product.

Please tell me if you have any question.

Best Regards

Jorge Alcala

0 Kudos
Reply

2,586 Views
mikestevens53
Contributor I

Thanks, but that doesn’t work. Something in NV was set when the KL02 was programmed to a KL16 and then back to a KL02.

Mike Stevens

0 Kudos
Reply

2,586 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Mike Stevens

What do you mean with NV? non-volatile memory? the mass erase should erase your flash memory. Could you share your project and be more specific with the expected result and the values that you get?


Have a great day,
Jorge Alcala

0 Kudos
Reply

2,585 Views
mikestevens53
Contributor I

and then to a “masserase – erase chip”

0 Kudos
Reply

2,585 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Mike Stevens

Sorry, I didn't get what you say in the last post. What I see in your image is that you succesfully made a masserase. I use J-Link.exe from SEGGER, this is what I got:

pastedImage_0.png

After this, And if you didn't secure your device, you should be able to program normally.
Hope this helps
Jorge Alcala

0 Kudos
Reply

2,585 Views
mikestevens53
Contributor I

Actually, the Command Windows pictures claims that it did the mass erase, but also notes that there was an issue with “0x1C0020 is not correct”. Also functionality is still not working.

I borrowed a J-Link from a local NXP support person, used the command line utility to do a unlock Kinetis + erase, and that allowed the part to start working again.

Mike Stevens

0 Kudos
Reply

2,585 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Mike Stevens

Glad to hear that your part is working again. There shouldn't be problem with the IDR as 0x1C0020 because Kinetis-K series has ID:0x001C0000 and Kinetis(L/M/V/E) series have ID:0x001C0020 on MDM-AP IDR register:

pastedImage_0.png

Although, I will check this in the SigFlashCmd.exe for further information.


Have a great day.
Jorge Alcala

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply