Can USBDM be used to secure my chip? I don't want to other people read my program from my chip.
if USBDM Can secure the chip,the configure as follow is OK?
I open HCS08 programmer
In security , I select Secure.and program flash.
In order to secure the flash of the device, What the user has to do, is to store the value to be written in a parrticular Non-Volatile location(Flash Options Register - FOPT and NVOPT at address 0xffbf). This is a special address in Flash memory and everytime the MCU comes out of RESET, the value at this flash address is automatically loaded into the Flash Security register. What the user has to do is to declare a constant value and make sure it as secure. To declare such a value, in your code you have to declare a constant. Under CodeWarror, the syntax would be : unsigned char NVOPT_INIT @0xffbf = 0x7C; When you download the code into chip, the chip get secured. Next time when you access chip with BDM, the debugger will remind you the chip is secured. to access it, the only way is to mass erase flash.
The USBDM programmers provide the security option as you have seen, All this does if program the security area as mentioned above by Jun. It actually modifies the Flash image before programming it to the chip.
If you select the Secure option it will program a default value to the security area of the Flash that will secure the chip. However this is a bit simplistic. The details vary by chip family and you should inspect the actual value being used on the Advanced programming page and make sure you are happy with the default chosen.
You may override the security values on the Advanced page to have a customised security choice.
I suggest you look at the chip manual for the device being used and compare the values used by USBDM with the discussion in the Manual.
Alternatively, you can modify your code to incorporate the appropriate security values into the image to be programmed. This is very device & tool specific. If you do this then you should choose the 'Image' option under security when programming otherwise the value in the image will be overwritten by the USBDM programmer.
For the HCS08 devices the relevant areas of Flash can be seen on the Advanced page of the USBDM programmer:
I suggest you make sure you understand what all the fields mentioned do.
security has four options.
what is smart option function?
The smart option will program the device to unsecured if the security area in the flash image doesn't already contain information.
Please have a look at the programming manual for more information.
It looks like security configurations using Processor Expert in CodeWarrior 10.4 does not work with FRDM-KL25Z board with USBDM OpenSDA firmware. MCU can be still accessed. I have been using USBDM 4.10.5 on Windows 7.
Do you mean when using the stand-alone programmer or from within Codewarrior?
Within Codewarrior the programmer always programs the chip as unsecured to allow debugging. IMHO it wouldn't make sense to allow securing the chip in this situation.
The stand-alone programmer has options to override the default security but if image is chosen it just programs the image unchanged so should work with PE.
Note however that USBDM does not allow the setting of secured and mass erase disabled as it is irreversible in many cases and in any case I can't see the advantage of doing so.
I was using CodeWarrior. I will try with stand-alone programmer. Anyway, original firmware on Freedom KL25Z board allow to programm chip with memory protection. Simply it can't be entered in debug mode again. I have also problem with configuration of Reset pin as GPIO. It is still with reset function after programming. I'm using Processor Expert to change reset pin function according to this tutorial: http://mcuoneclipse.com/2012/11/12/tutorial-bits-and-pins-with-kinetis/ Could it be related to the same thing as security options, or is it a subject for another topic? It works fine when original OpenSDA firmware is used but not when USBDM.
Yes it's part of the same issue but I should really fix this.
USBDM treats the 16-byte flash configuration field as part of the security area. This includes FOPT which is what you are playing with. The stand-alone programmer will be OK (in fact it lets you customise all 16 bytes).
When used with Codewarrior it sets the 16 bytes to a predefined Unsecured value (as does the stand-alone programmer with Unsecured option selected). I will eventually add an option for this in Codewarrior as it appears there is a demonstrated need.
It would be great to heve these options in CodeWarrior (security and reset configuration). Can you give me some estimates when eventually it would be possible?
Retrieving data ...