I wrote my own boot loader to program an allocated section in the flash memory. Erase and program seem to work, my code also performs a post updatezero checksum test for the particular mem section and it passes. I can also tell the program update works by viewing the memory window after update. However the micro failed to boot and run after power cycle.
So I re-ran the the update sequence. This time I noticed both Flash Option Register (FOPT) @ 0x40c and
Flash Security Register (FSEC) @ 0x40d now containing different settings, after the erase call (by invoking the stand API FlashEraseSector()) . Instead of 0x3ffe. they now read as 0xffff. According to the KL17 reference manual, 0xfe read of FSEC indicates MCU flash secure status. Would it prevent the micro from running?