Removing power during SB2 update bricks the LPC55

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

Removing power during SB2 update bricks the LPC55

1,202 Views
cp1
Contributor III

I've configured my LPC55s69 for secure boot and can reliably boot it and secure update it using a signed SB2 file.

However, if I disconnect power before the SB2 file update finishes, the chip does not boot back up again (no ISP).  My expectation was that the secure boot would fail, and it would then fall through to the ISP.  I can restore the chip by asserting the ISP pin, and re-powering, but this is not going to be an option for users in the field applying updates.

Is there a method I can safely update with an SB2 file, and in the event of power loss, the chip will still boot the ISP?  Maybe I can tell the bootrom not to boot anything until after the SB2 update completed somehow?

I'm using 1B chip version.

Labels (1)
6 Replies

1,030 Views
EugeneHiihtaja
Senior Contributor I

Hi cp@solokeys.com‌  and alexisandalon‌ !

Just interesting to know what kind of impression you have got about SB2.1 file upload to MCU.

At what phase you interrupt power ?

When file is loaded to SRAM or when it authenticated and erase and write is ongoing ?

But from other side MCU have 320KB of SRAM and Flash size 640KB.

Can I cook one SB2.1 and update 512 KB of flash at once ?

Or SB2.1 is really is not loaded to SRAM and erase operation is happens at beginning and after that data is written on fly to flash memory of MCU. In this case MCU is sensitive for sudden power loss quite long time.

Regards,

Eugene

0 Kudos

1,030 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Eugene,

As far as I could check there's is no limitation of the size of the SB, so you could do the update of the 512Kb but I will strongly suggest to not cut the power between the firmware update, this will cause the image to crash and would need to do the process again.

Best Regards,

Alexis Andalon

0 Kudos

1,030 Views
EugeneHiihtaja
Senior Contributor I

Hi nxf46116‌ !

It means if power is ended in last moment when everything is written and just not verified, firmware can be in place but host not have evidence about it. Can host via ISP get current FW version and execute consistency check for be sure if firmware is valid ?

Not all SB file load details is clear for me yet.

Regards,

Eugene

0 Kudos

1,030 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Eugene,

As it mention in the manual of the blhost (link here) you can obtain the firmware version previously programmed in the bd file if you use the get-property command:

pastedImage_2.png

pastedImage_3.png

Best Regards,

Alexis Andalon

0 Kudos

1,030 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Conor,

It looks like the only way to recover from a corrupted image is by using the Debug Mailbox command but this also looks a little impractical, I will ask the applications team if there's any other way to recover the MCU in field.

Best Regards,

Alexis Andalon

1,030 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Conor,

Confirming with the applications team the only way to enter again to the ISP bootloader after a reset is using the pin.

Sorry for the inconvenience this may cause you.

Best Regards,

Alexis Andalon