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?
Solved! Go to Solution.
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
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
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.