can't set security of kl05z32

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

can't set security of kl05z32

跳至解决方案
2,404 次查看
wangbaode
Contributor IV

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.

6134_6134.pngpastedImage_0.png

 

my project is in attachment .

 

best regards

Original Attachment has been moved to: KL05Z32_Security.rar

标记 (2)
0 项奖励
回复
1 解答
2,265 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

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

在原帖中查看解决方案

0 项奖励
回复
8 回复数
2,265 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

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,

2.png

and choose the connection type from that demo:

3.png

The download passed successfully and you may see the Flash configuration field was modified as you expected.

1.png

Hope that helps,

B.R

Kan

2,265 次查看
wangbaode
Contributor IV

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.

pastedImage_0.png

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,

pastedImage_0.png

data in 0x40D is 0x00,But value in FOPT register is 0xff.

Why?

0 项奖励
回复
2,265 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

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

2,265 次查看
wangbaode
Contributor IV

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.

pastedImage_0.png

pastedImage_1.png

pastedImage_2.png

0 项奖励
回复
2,265 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复
2,265 次查看
wangbaode
Contributor IV

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.

pastedImage_1.png

But when i set FSEC as 0x00 and debug the program, codewarrior give me a warning dialog as follow.

pastedImage_2.png

How to configure my project to remove the dialog?

0 项奖励
回复
2,266 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复
2,265 次查看
wangbaode
Contributor IV

Hi Kan,

Thanks.I see you.

Bye

0 项奖励
回复