I am trying to secure my flash memory (setting the FSEC to 0xFF) using my JTAG debugger. I do seem to be modifying the proper location in flash memory. When I try to re-attach my debugger after programming, it does indicate that the device is secure.
The issue is that my firmware does not seem to execute properly after securing the device. It is either not booting up, or is hanging somewhere in the code. Since I cannot attach my JTAG debugger, I can not easily figure out what is going on. I do not see any such problem when the device is unsecure.
From what I understand, securing the flash memory is only supposed to inhibit external access to flash memory from the JTAG debugger - so what else could possibly be going on here?
I am using a KV58F1M0VLQ24, a PE Multilink FX, and also trying a PE Cyclone Max. I am also programming the FOPT bit to 0xFB to inhibit NMI interrupts.
Solved! Go to Solution.
I finally figured it out. Bits FBSL of SIM_SOPT2 determine the FlexBus security level. The reset default is 00 which does not allow off-chip accesses (instruction and data) via the FlexBus when the flash security is enabled. I changed this value to 10 and now off-chip data access is allowed. My LCD and some of my LEDs are on the FlexBus, so a lack of data access made it appear that the device wasn't even booting. Now, everything seems to be working fine.
I finally figured it out. Bits FBSL of SIM_SOPT2 determine the FlexBus security level. The reset default is 00 which does not allow off-chip accesses (instruction and data) via the FlexBus when the flash security is enabled. I changed this value to 10 and now off-chip data access is allowed. My LCD and some of my LEDs are on the FlexBus, so a lack of data access made it appear that the device wasn't even booting. Now, everything seems to be working fine.