kinetis mcu keeps getting locked/bricked

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

kinetis mcu keeps getting locked/bricked

1,379 Views
Psy_coder
Contributor II

Flip what the hell is wrong with this mcus, or the problem is me. I saw a message suggesting I have to do a complete erase of this mcu while trying to upload a code through "debug with segger j-link probes" button inside mcuxpresso. After clicking "yes" for erase the mcu could no longer connect anymore, even on the jlink commander. My supervisor told me I might have bricked the mcu, and I was given another one to work with. Before I did anything with it I created a "hello word" project using the sdk, I built the project, and before I clicked the "debug with segger j-link probes" button again I started by clicking " Erase flash using segger j-link probes" and it never erased, instead it just popped three error windows suggesting the target refused connection actively. Then when I tried to connect through j-link commander again it refused with the error saying TDO is constant high. When my supervisor saw this, he said I bricked the mcu again with my code. I didn't believe this because my code never got uploaded cos the only thing I had attempted to do was to erase not to program. Then my supervisor looked at my project and made me realise while creating the project I selected "MK10DN512VLK10" under device packages whereas the mcu I'm working with is an mpBGA and the correct package should be MK10DN512VMC10. So I was convinced that just trying to erase while a wrong package was selected could have bricked the mcu. Then I was given another mcu. I created a project fine and I started writing my code, I am trying to set-up can bus driver. I managed to flash the code onto the mcu .I was able to run the debug and step through my whole code about 10 times and went out for lunch. At this time I was so worried that anything small could brick the mcu again, so I was very careful I don't have any other project in the workspace apart from the only one that I've been able to run the debug with. When I came back from the lunch and tried connecting the segger, I could already see the led on the jtag becomes orange as soon as I connect on the debug port. Then when I try to connect via jlink commander the " TDO is constant high" error was all that kept coming up on the screen on the new mcu, that has been working fine before lunch. With exactly the same code that was running before the lunch. I was worried I'm always going to my supervisor with locked mcus whereas he keep giving me new ones, so I decided I'm going to try and find a way to unlock it if it is indeed locked. I followed a lot of people's suggestions on forums the whole night with none of the suggestions working. Suddenly after about six hours of struggle I just saw the mcu starting to connect on the jlink commander again, then I was able to run debug again then I was able to debug my can-driver code again. I told my supervisor and he believed it was still my code's fault. I ran the debugger more that 10 times again with success, until I stopped the debugger and got busy with other things. Then now today in the morning when I got to work, the moment I connect on the jtag port the led is turning orange again, which once again I can't continue with my actual job, I'm afraid when my supervisor arrives he won't believe I never changed a project from the last time it ran. I'm not mad because what is happening doesn't make sense to me too, how can you convince someone to believe something that doesn't make sense to you anyway. The segger website is just telling me the orange led indicates "RESET" pin is kept high. "Wasn't it kept high the last time when I ran the debug successfully?" i don't understand

I'm part of a very crucial project right now and I'm running out of time because I can't do anything if the mcus keep locking like this, on their own, without me having changed anything hardware wise. Even software wise I believed if I'm working in just one project that has been working fine and only changing the code in the source file, I should be very far from locking the mcu, but here it is, it might be locked.

1. What does it take to brick an mcu?

2. How do you know if an mcu is really bricked, like is there specific errors that you get only when the mcu is bricked?

3. When connecting the jtag to the mcu it instantly changes the led color from green to orange. Is there any hope for this mcu to work again?

0 Kudos
Reply
1 Reply

1,374 Views
ErichStyger
Specialist I

Just trying to help:

>>1. What does it take to brick an mcu?

'bricking conditions' depend on the details of the MCU, but basically it is about flash protection and erase protection, or that the needed debug pins are disabled.

I wrote a few articles on that subject, so they might help to understand the details behind it:

https://mcuoneclipse.com/2012/11/04/how-not-to-secure-my-microcontroller/

https://mcuoneclipse.com/2014/10/05/unlocking-and-erasing-flash-with-segger-j-link/

>>2. How do you know if an mcu is really bricked, like is there specific errors that you get only when the mcu is bricked?

That depends, usually you won't be able to connect to the target. See above.

If the problem is that the MCU immediately turns off the debug pins, then you might have a chance to reset/connect with a power cycle, see https://mcuoneclipse.com/2021/05/20/recovering-cortex-m-microcontroller-with-a-power-glitch/

 

>>3. When connecting the jtag to the mcu it instantly changes the led color from green to orange. Is there any hope for this mcu to work again?

The orange LED means that the CPU is resetting all the time. So that looks like the MCU has a wrong program loaded. If you are able to pull the reset line low with the debug probe, then you should be able to regain control with above trick. But for that tool you need a P&E Multilink.

 

I hope this helps,

Erich