I am paying with the protection changing, using the kinetis bootloader 1.2
I use the g_bootloaderContext.memoryMap[ kIndexFlashArray ].memoryInterface->read( ... )
for reading the flash from address 0 to 4095 in a buffer. I change the protection at the offset of the configuration word,
setting one bit of the FPROT. Then I rewrite the buffer in flash.
The operation appears successful, If I enquiry the protection situation the section is flagged as protected (after a reset).
The problem is, if I try to repeat a similar operation, the reading of the flash is no more possible, the CPU resets.
What is happening???