AnsweredAssumed Answered

FlashIAP driver for Mbed OS

Question asked by Chris Trowbridge on Jun 23, 2020
Latest reply on Jul 1, 2020 by Diego Charles



I have a customer project based on the LPC55S69 and am utilizing ARM's Mbed OS + Pelion cloud client.


To start debugging before the custom hardware was finished, I started with with a LPCXpresso55S69 dev kit (revision A2), and quickly found that there were some issues running the Pelion cloud client example for the LPC55S69 - the application simply hangs shortly after booting:

Mbed Bootloader booti

Using the JLink Commander tool, I was able to see that it was hitting a memory hard fault:

PC = 1000026A, CycleCnt = 0DCC84F9
R0 = 3000C700, R1 = 00094200, R2 = 00000200, R3 = 6B65666C
R4 = 1400C700, R5 = 00000000, R6 = 30000800, R7 = F17ECA89
R8 = 00000000, R9 = 00000000, R10= 20024DE8, R11= 00000000
R12= 1300413B
SP(R13)= 30000800, MSP= 30000800, PSP= 30000ED0, R14(LR) = FFFFFFED
XPSR = 01050003: APSR = nzcvq, EPSR = 01000000, IPSR = 003 (HardFaultMemManage)
CFBP = 00000001, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 01

Security extension regs:
MSP_S = 30000800, MSPLIM_S = 00000000
PSP_S = 30000ED0, PSPLIM_S = 30000800
MSP_NS = 20043F88, MSPLIM_NS = 20043C00
PSP_NS = 20024DA8, PSPLIM_NS = 20023BD8

FPS0 = 00000008, FPS1 = 3E7828C0, FPS2 = 00000000, FPS3 = 00000000
FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000
FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000
FPS12= 00000000, FPS13= 00000000, FPS14= 00000000, FPS15= 00000008
FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000
FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000
FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000
FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= 00000000
FPSCR= 03000000

At this point, I found another dev kit with an earlier revision (A1). Using the same application hex file as the first board, the application was able to continue on further (NOTE: I did not have a network interface attached, so the application ran into other expected errors):

Mbed Bootloader
bootiþERROR: No NetworkInterface found!
Start Device Management Client
Using hardcoded Root of Trust, not suitable for production use.
Starting developer flow
Failed to load developer credentials

Factory Configurator Client [ERROR]: KCM basic functionality failed.
Resets storage to an empty state.
Using hardcoded Root of Trust, not suitable for production use.
Starting developer flow
Application ready. Build at: Jun 12 2020 15:48:38
Mbed OS version 5.15.1
ERROR: No NetworkInterface found!

At this point, I realized that the revision A1 board uses a revision 0A of the chip, and the revision A2 board uses a revision 1B of the chip.

After adding some printfs to the underlying Mbed sources, I was able to see that the hard fault was occurring on the rev A2 board in the initialization of the FlashIAPBlockDevice, and it seems as though it's attempting to access the internal flash in an unsupported way.

Based on this, I fired up the MCUXpresso IDE and downloaded the latest example from NXP for the flash IAP driver. This example worked as expected on the rev A2 board (rev 1B chip). The flash IAP example utilizes version 2.7.1 of the SDK for the LPC55S69, so my guess is that the SDK in Mbed simply needs updated to the latest version. This is further supported by the information in this document published by NXP:

As there is some non-insignificant work to update the SDK in Mbed, are there any other quick changes I can make to the SDK version already in Mbed to pull in support for the Flash IAP driver for the rev 1B chip? Our custom hardware uses the rev 1B chip (which is the only revision that NXP now sells).