您好,我在使用kea128单片机时遇到一个问题。
我想让单片机的Flash不会被外部设备所读取,但是使用Jlink配置这个的时候,我不能配置,请告诉我有什么方法可以打开这个Flash security?或者有代码可以分享一下吗?
谢谢!
__root const uint8_t ChipSecure@0x40EU = 0x7CU;
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.
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
十分感谢您的回复,我按照你的指示,找到了启动文件,最后一个字节修改成FF,如图所示
但是,我重新编译了一下下载进去,发现使用JLINK还是能够读取到Flash内容
请问是哪里不对吗?少了些步骤吗?
Hi,
那您读一读FTFE_FSEC寄存器的值(其地址为0x002_0002),看看SEC bits改了没有。
BR
XiangJun Rong
十分感谢您的回复,我尝试修改FTMRE_FSEC这个值,但发现无论如何都不能修改成功。查看手册,KEA128单片机似乎不支持写操作。
Hi,
您不能直接写FTMRE-FSEC register, 您必须写flash configuration field space, 系统会拷贝flash configuration field space的数据到寄存器。
多谢
XiangJun Rong