Everytime we try to program, debug or erase our Freescale Freedom board using the OpenSDA JTAG interface we get this error inside CodeWarrior:
"Device is secure. Erase to unsecure?"
The board has been working fine before.
Then we used the "Flash Programmer" inside CodeWarrior to program one of the binary files (.bin) from the "kl25_sc" package (sample codes) and since that we haven't been able to program, debug or erase.
Has the device mistakenly been put into "Mass erase disable"-mode? If yes, howcome and why did this happen - CodeWarrior didn't even warn us!?
Solved! Go to Solution.
I just began experiencing the exact same issue. I resolve it by setting the speed of the Multilink to 0.2 Mhz instead of 1Mhz.
Though I find it interesting because the prompt doesn't say what device is secure.
The KEIL debugger does not modify the flash configuration fields if the binary that you tried to program does not explicitly tell KEIL to modify these fields. Consequently, if you have setup your environment to perform a mass erase, and then program the binary (which doesn't modify the flash configuration fields), then your part will be in a secured state with mass erase enabled.
To fix this, try setting KEIL to only perform sector erases and see if this helps.
Also, if you will provide us with the binary that you tried, we can fix the binary in our next sample code release so that a mass erase is possible without this frustration you are experiencing.
I have the same problem, I use MK10DX256VLK7, "multilink universal" and IAR environment. (also codewarrior is available).
I have no idea what happend. This build what I have flashed is used on other board without any problem. I have never touch any scecure bits.
1. Is any way what I may do in order to unsecure it?
2. is it possible that it is hardware problem with board (uC or connection)?
I have try adjusting debug speed as mentioned above but without any success.
Please advise if someone has any idea.
see about secure/protecting the device: http://mcuoneclipse.com/2012/11/04/how-not-to-secure-my-microcontroller/
So I hope the 'mass erase disabled' bit is not set, otherwise the device is really locked.
Sometimes it is false alarm too, if the connection is not working properly, or wrong files are used, see Device is secure? | MCU on Eclipse
I hope this helps,
missed to mention that if you have a Segger J-Link, you load the Segger OpenSDA firmware on your FRDM board (but your device does not indicate that you are using a FRDM board)?
Thank you for support.
I use custom board, only access by JTAG.
under address 0x40C i 0x31 and 0x40D is 0x30. So it looks ok for me, mass erase i enabled.
I do not have any other tool than multilink universal.
I wonder if it may be a hardware problem with connection to uC.
Yes, I think it could be a hardware/connection problem. Because that 'secure' message comes up too if the microcontroller is not really accessible or does not respond. You might check the reset line and the other debug lines with an oscilloscope.
Ok, just throwing in something here, and it is a wild guess.
I run into a clock setup issue for running the USB port. For this I had to use the external clock.
Are you using the external clock? If so, maybe the device is clocked so weird that the opeSDA has a problem to connect to the KL25Z.
It is at least worth a try: if your board has R25 not populated, add that 1 MOhm resistor to it. Maybe it makes a difference?
I really hope that helps.
If not: maybe send me the S19 file of the application you have programmed. I'll take the risk to burn one of my boards.
Thomas has sent me a binary file which indeed secures the device (that dialog pops up), but I can successfully recover and reflash the device. And I can do this with CodeWarrior and the OpenSDA (no Multilink needed).
I was able to do this with two black boards, one with R25 and the other without that resistor. It does not make a difference for me, at least with this file.
Here are is the information from my boards:
Board Name is: FRDM-KL25Z
MicroBoot Kernel Version is: 1.01
Bootloader Version is: 1.01
Installed Application: PEMicro Debug App
Application Version is: 1.02
Could you verify you have the same? You get that information if you plug-in the board in Bootloader mode and open the SDA_INFO.HTM from the MSD device (see OpenSDA on the Freedom KL25Z Board | MCU on Eclipse).
One thing to note: if your application disables the mass erase bit, then you cannot recover the board (as disabling the mass erase means really locking the microcontroller!!!!).
Hope this helps,
good news: I finally have received a binary file, and now I can reproduce it with my board. The good news is: It seems I have found a way how to get control back and perform a mass erase with CodeWarrior. I'll write up the steps and verify again that it works for me, and I can hopefully report back positive news very soon.
which *.bin file have you used? In the kl25_sc these are all Keil and IAR projects, but they should not set the mass erase disable flag. 'Device is secure' is shown in case the OpenSDA is not able to get hold of the device. At least with OSBDM/OSJTAG I had cases where OSBDM/OSJTAG was not able to recover a device, showing that dialog. Using the P&E Universal Multilink (with a JTAG/BDM connector) I was able to recover the device.
Hope this helps,