Locking an LPC55xx sometimes bricks the device

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Locking an LPC55xx sometimes bricks the device

515 Views
janpieterderuit
Contributor IV

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:

  • Lock the device in Production, so it can't be read over SWD or SPI/I2C etc (FlashMagic) anymore
  • Unlock the device, so it can be reprogrammed in Production.

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:

  • The bootloader/application no longer runs, so we are not able to unlock anymore
  • The device cannot be reached:
    • When trying to connect over SWD connection fails (SW-DAP can't even be found..., which it can when it is correctly locked)
    • Also FlashMagic cannot connect

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 

0 Kudos
2 Replies

499 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

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

0 Kudos

489 Views
janpieterderuit
Contributor IV

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

0 Kudos