How to protect Bootloader and Vector Table?

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

How to protect Bootloader and Vector Table?

Jump to solution
895 Views
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 Kudos
1 Solution
493 Views
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

View solution in original post

0 Kudos
2 Replies
494 Views
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 Kudos
493 Views
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 Kudos