I have a problem to make MCU secure.
A user engages security by programming the NVOPT location, which can be done at the same time the FLASH memory is programmed.
I added the line for secure:
const byte NVOPT_INIT @0x0000FFBF = 0x00;
After building, in the hex file we can find this line :
After programming this flash image, MCU becomes secure, but the application doesn’t work. Without this line everything is ok, MCU work correctly. Why this way doesn’t work or how to secure this sensor?
I try to use FLASH PROGRAMMER with setting Security->Secure. The same result. MCU become secure, but doesn't work.
A found some solution, but I think it isn’t right way for mass production.
- I flash my code in USER FLASH.
- Dump memory from 0xC000 to 0xFFFF and save file.
- Change NVOPT value to 00 and checksum
- Flash new image in to the MCU and all is ok.
MCU becomes secure and works.
IDE codewarrior 10.5