Hello Francesco Salvatore,
I think you are facing a similar issue as the one discussed in the next thread:
MK22FN1M0VLQ12 SWAP: Return from UpErs to Ready
The SWAP system uses a sequential state machine, not intended to move backwards (e.g. from UPDATE-ERASED to READY state).
You can stay in UPDATE-ERASED state, erase the corrupted firmware and start flashing again the correct firmware.
Please let me know if I misunderstood your situation or use-case.
Best Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------