how to set kea128 Flash security?

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

how to set kea128 Flash security?

1,148 Views
LiangDevJack
Contributor II

您好,我在使用kea128单片机时遇到一个问题。

LiangDevJack_0-1731925837255.png

我想让单片机的Flash不会被外部设备所读取,但是使用Jlink配置这个的时候,我不能配置,请告诉我有什么方法可以打开这个Flash security?或者有代码可以分享一下吗?

LiangDevJack_1-1731926087299.png

谢谢!

 

0 Kudos
Reply
6 Replies

799 Views
winter1999
Contributor I

__root const uint8_t ChipSecure@0x40EU = 0x7CU;

0 Kudos
Reply

1,123 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls refer to the startup_kea128.c, there is Flash_Config array.  If you set the last BYTE in the red circle as FE, the flash will be in unsecurity mode, the SWD/JTAG can be accessed. If you set the last BYTE in the red circle as FF, or FD, the flash will be in security mode, the SWD/JTAG can NOT be accessed.

But you can execute mass-erase to set the flash in unsecurity mode.

xiangjun_rong_0-1731984724910.png

Because I have not the project based on KEA family, so I use the K64 project, but the Flash_Config array is the same.

Hope it can help you

BR

Xiangjun Rong

0 Kudos
Reply

1,115 Views
LiangDevJack
Contributor II

十分感谢您的回复,我按照你的指示,找到了启动文件,最后一个字节修改成FF,如图所示

LiangDevJack_0-1731996223592.png

但是,我重新编译了一下下载进去,发现使用JLINK还是能够读取到Flash内容

LiangDevJack_1-1731996567482.png

请问是哪里不对吗?少了些步骤吗?

 

0 Kudos
Reply

1,093 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

那您读一读FTFE_FSEC寄存器的值(其地址为0x002_0002),看看SEC bits改了没有。

BR

XiangJun Rong

1,067 Views
LiangDevJack
Contributor II

十分感谢您的回复,我尝试修改FTMRE_FSEC这个值,但发现无论如何都不能修改成功。查看手册,KEA128单片机似乎不支持写操作。

LiangDevJack_0-1732177558388.png

 

0 Kudos
Reply

1,001 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

您不能直接写FTMRE-FSEC register, 您必须写flash configuration field space, 系统会拷贝flash configuration field space的数据到寄存器。

xiangjun_rong_0-1732779584550.png

多谢

XiangJun Rong

0 Kudos
Reply