AnsweredAssumed Answered


Question asked by Viktor Sonesten on Nov 29, 2019

On accidentally flashing an S32K144EVB-Q100 with an incorrectly linked binary, some program flash protection bits were flipped to secure, so device programming currently fails with "Error: Failed to erase sectors 0 @ address 0x00000000 (Algo91: Flash protection violation. Flash is write-protected.)". From the reference manual, executing ERSALLU seems like the easiest fix, so with SEGGER's JLink Commander I execute:


J-Link> w1 40020007 49 # configure FCCOB0 for ERSALLU 
J-Link> w1 40020000 80 # write 1 to FSTAT[CCIF], executing configured command (ERSALLU) 
J-Link> mem 40020000 1 # read back FSTAT register 
40020000 = A0 # FSTAT[ACCERR] set, ERSALLU failed 


ACCERR indicates that ERSALLU is unavailable in current mode/security, or that a non-zero amount of CSEc keys have been allocated. I have never configured CSEc keys to be stored persistently on the device (unless this was done by the incorrectly linked program), but am aware of no other run mode in which security would be lifted. If there such a mode I can enter? Or is there another way to remove the write-protection?