Dear ,
I want to secure my chip through Flash configuration field in kl05z32.but I'm failed.
I define many constant variable in Flash configuration field.But I find the data can't writen into flash through cw10.3.
my project is in attachment .
best regards
Original Attachment has been moved to: KL05Z32_Security.rar
Solved! Go to Solution.
Hi Baode,
That is becase you try to secure the KL device, so that the Jlink will stop you in that case. Actually it is not recommend to secure the device if you still want to debug the application as debug is not supported on a secured device. so in debug phase, you may just set FSEC as 0x02, and in factory phase, turn it to 0x00. Please note to use the OpenSDA to download the secured image into device instead of Jlink.
Hope that helps,
B.R
Kan
Hi,
I have reviewed your project as well as the map file, they look fine, but when I tried to download the image into FRDM-KL05Z with the help of CW 10.4, the connection failed anyway, so I have to open a released KL05 project in the same workspace, for example, KL05_Freedom_Demo_cw as below,
and choose the connection type from that demo:
The download passed successfully and you may see the Flash configuration field was modified as you expected.
Hope that helps,
B.R
Kan
Dear Kan_Li,
you're right. in my project, I use BDM to debug.Now I use Jlink to debug the project and I also can see data is in flash. I think it's a bug of usbdm.
But another question comes out.
I watch the register of flash controller.I find the register don't be updated by data in flash configuration field.
In reference,
data in 0x40D is 0x00,But value in FOPT register is 0xff.
Why?
Hi Baode,
How did you confirm the value in FOPT register? Using the CW's register viewer? If you look into this via CW's viewer immediately after downloading the image, the FOPT is what before program. It is recommended to use the printf() fucntion to watch the updated value after a POR on this device.
Hope that helps,
B.R
Kan
Hi Kan,
I watch the value via CW's register viewer after downloading this image.
according to your suggestion,I use the printf() fucntion to watch the value and I find the value is the same as
the register viewer.
Hi Baode,
Did you disconnect the JTAG and KL05 device after downloading and power off and re-power on the device to run the embedded application? Please kindly help to clarify. Thanks for your patience!!
B.R
Kan
Hi Kan,
Thans for your patience. according to your suggestion,after i download my program and re-power on the device,I program my program again and i can see the value in register viewer and control consle.
But when i set FSEC as 0x00 and debug the program, codewarrior give me a warning dialog as follow.
How to configure my project to remove the dialog?
Hi Baode,
That is becase you try to secure the KL device, so that the Jlink will stop you in that case. Actually it is not recommend to secure the device if you still want to debug the application as debug is not supported on a secured device. so in debug phase, you may just set FSEC as 0x02, and in factory phase, turn it to 0x00. Please note to use the OpenSDA to download the secured image into device instead of Jlink.
Hope that helps,
B.R
Kan
Hi Kan,
Thanks.I see you.
Bye