How to protect Bootloader and Vector Table?

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

How to protect Bootloader and Vector Table?

跳至解决方案
1,517 次查看
ignisuti
Contributor IV

I want my bootloader and vector tables stored at the begining of flash protected in such a way that they can only be overwritten by a JTAG device.

 

I thought the FTFL_FSEC register would handle this, but it appears this register ALSO has the ability to even lock out a JTAG device from writting to the flash. 

 

So, how do I accomplish my goal?

0 项奖励
回复
1 解答
1,115 次查看
ignisuti
Contributor IV

I figured out what I was doing wrong.

 

FSEC occurs after FOPT. However, I was focusing on this information from the Reference Manual which shows FSEC occurring before FOPT.

 

Address: FTFL_FSEC is 4002_0000h base + 2h offset = 4002_0002hAddress: FTFL_FOPT is 4002_0000h base + 3h offset = 4002_0003h

 

The actual address (for the purposes of loading this configuration data into FLASH) are...

FSEC = 0x0_040C  

FOPT = 0x0_040D

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,116 次查看
ignisuti
Contributor IV

I figured out what I was doing wrong.

 

FSEC occurs after FOPT. However, I was focusing on this information from the Reference Manual which shows FSEC occurring before FOPT.

 

Address: FTFL_FSEC is 4002_0000h base + 2h offset = 4002_0002hAddress: FTFL_FOPT is 4002_0000h base + 3h offset = 4002_0003h

 

The actual address (for the purposes of loading this configuration data into FLASH) are...

FSEC = 0x0_040C  

FOPT = 0x0_040D

0 项奖励
回复
1,115 次查看
evgenik
Contributor IV

Hi Joe.

Are you using K60 or K61 MCU? In K61 you can do 'Secure enable' (can connect with JTag) and 'Mass erase disble' (can't connect more with JTag, but can remove flash lock with key that you prepare on secure MCU). The address for secure the flash are the same in K60 and K61, but K60 haven't 'Mass erase disble' option.

What option you use for write these

FSEC = 0x0_040C

FOPT = 0x0_040D

registers (from code, by JTag, by macro)?

Thanks.

Evgeni.

0 项奖励
回复