Hi,
we are using an LPC5526, and we wanted some sort of Code Read Protection like we are used to with for instance LPC546xx devices:
So we implemented the locking mechanism, as described in LPC552x: How to write CMPA to disable debug subdomains from application?
Important note: to be able to unlock, the device should not be sealed (there is no way to unlock a sealed device), so use the 'development' mode.
However, unlocking a device will just do that: it won't erase the device like we are used to with the LPC546xx.
So we added a full Flash erase before unlocking.
To be able to do that we implemented is in a RAM function, seeLPC55xx (Mass) Flash erase with IAP
Now when testing this, we found that sometimes the device gets bricked:
After some testing we suspected that a connected (Segger) debugger causes this.
We can't explain why, but now we always disconnect the debugger (physically!) before locking/unlocking, and we no longer see bricked devices.
Is there some explanation for this, or another way to prevent this situation?
Is there a way to unbrick our products (in case SW-DAP can't be found)?
Thanks in advance,
Jan Pieter de Ruiter
Airios
Hello
Hope you are well.
The reason might be that the image could be corrupted during the loading with the debugger. I suggest you always keep enabled the ISP so it can be unlocked in case of SW-DAP cannot be found. If the SW-DAP and ISP cannot be used the MCU cannot be unlocked.
I apologize for the inconvenience this is might bring you. If you have more questions do not hesitate to ask me.
Best regards,
Omar
Hi Omar,
Thanks for the confirmation.
The device is completely bricked, so also over ISP not reachable I guess.
Furthermore enabling ISP would make it possible for anyone to unlock it, and that would make it useless in our usecase.
Best regards,
Jan Pieter de Ruiter