I'm getting SSP_ERR_CMD_LOCKED error (often, not every boot) after using the blankCheck function on S5D5. Comments indicate that this error happens because of an attempt to erase code flash protected by an access window. However, as far as I can tell code flash is only written to by the debugger during programming of the firmware. I have some code that can write to the code flash in my bootloader but it isn't called before this error occurs. Before this error I have calls to open, blankCheck, read close and open of the flash api.
Rebooting when this error occurs sometimes fixes this problem, but sometimes the error keeps ocurring until I flash a different binary in between.
The programmer is set to use SWD. I also see this error without the programmer attached.
Any ideas about this? Should I avoid opening and closing the flash repeatedly? Right now I simply do this at start and end of my read function to avoid keeping track of flash open state between bootloader and main program.