LPC55S16 ThreadX Secure Boot Runtime Error

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

LPC55S16 ThreadX Secure Boot Runtime Error

558 Views
rjmalmeida0
Contributor III

Hello everyone,

I developed a simple application for LPC55S16 platform with ThreadX that blinks the blue LED every second. During debug and after board reset, all works fine: the LED blinks and the debug UART also logs data.

The next step I tested was secure boot flashing using the MCUXpresso Secure Provisioning tool. I booted the board on ISP mode and connected to it through UART w/ 57600 baud. I selected "Plain" on Boot tab and built the image with a Success status. Then I flashed the image on the "Write Image" tab (as shown in the screenshot). The log shows success, as shown below:

 

### Parse input arguments ###
### Check connection ###
/opt/nxp/MCUX_Provi_v7/bin/tools/spsdk /opt/nxp/MCUX_Provi_v7/bin
/opt/nxp/MCUX_Provi_v7/bin/tools/spsdk/blhost -t 2000 -p /dev/ttyUSB0,57600 -j -- get-property 1 0
/opt/nxp/MCUX_Provi_v7/bin
{
   "command": "get-property",
   "response": [
      1258487808
   ],
   "status": {
      "description": "0 (0x0) Success.",
      "value": 0
   }
}
blhost succeeded
### Write Customer Field Programmable Area [CFPA] ###
/opt/nxp/MCUX_Provi_v7/bin/tools/spsdk /opt/nxp/MCUX_Provi_v7/bin
/opt/nxp/MCUX_Provi_v7/bin/tools/spsdk/blhost -t 5000 -p /dev/ttyUSB0,57600 -j -- write-memory 0x0003DE00 /home/rui/environments/lpc55s16/secure_provisioning/gen_sb/cfpa.bin
/opt/nxp/MCUX_Provi_v7/bin
{
   "command": "write-memory",
   "response": [
      512
   ],
   "status": {
      "description": "0 (0x0) Success.",
      "value": 0
   }
}
blhost succeeded
### Write NON-SEALED Customer Manufacturing/Factory Programmable Area [CMPA] ###
/opt/nxp/MCUX_Provi_v7/bin/tools/spsdk /opt/nxp/MCUX_Provi_v7/bin
/opt/nxp/MCUX_Provi_v7/bin/tools/spsdk/blhost -t 5000 -p /dev/ttyUSB0,57600 -j -- write-memory 0x0003E400 /home/rui/environments/lpc55s16/secure_provisioning/gen_sb/cmpa_non_sealed.bin
/opt/nxp/MCUX_Provi_v7/bin
{
   "command": "write-memory",
   "response": [
      512
   ],
   "status": {
      "description": "0 (0x0) Success.",
      "value": 0
   }
}
blhost succeeded
### Erase flash ###
/opt/nxp/MCUX_Provi_v7/bin/tools/spsdk /opt/nxp/MCUX_Provi_v7/bin
/opt/nxp/MCUX_Provi_v7/bin/tools/spsdk/blhost -t 50215 -p /dev/ttyUSB0,57600 -j -- flash-erase-region 0x00000000 21504 0
/opt/nxp/MCUX_Provi_v7/bin
{
   "command": "flash-erase-region",
   "response": [],
   "status": {
      "description": "0 (0x0) Success.",
      "value": 0
   }
}
blhost succeeded
### Write image ###
/opt/nxp/MCUX_Provi_v7/bin/tools/spsdk /opt/nxp/MCUX_Provi_v7/bin
/opt/nxp/MCUX_Provi_v7/bin/tools/spsdk/blhost -t 5000 -p /dev/ttyUSB0,57600 -j -- write-memory 0x00000000 /home/rui/environments/lpc55s16/secure_provisioning/bootable_images/dfrb_app_v0_1.bin
/opt/nxp/MCUX_Provi_v7/bin
{
   "command": "write-memory",
   "response": [
      21112
   ],
   "status": {
      "description": "0 (0x0) Success.",
      "value": 0
   }
}
blhost succeeded

 

 After reset, the application does not start tho. The initializations are shown correctly but the threads do not run. Here's an example of the thread the blinks the blue LED:

 

/**
 * @brief Main application task
 *
 *  args null
 */
void thfnc_DFRBMngmnt(VOID *args)
{
    (void)args;
    PRINTF("starting thfnc_DFRBMngmnt...\r\n");
    /* Main entry */
    UINT status = TX_FALSE;
    UINT counter = 0;
    while (1)
    {
        /* Increment counter */
        counter++;
        /* Send message to transmission queue  */
        status = tx_queue_send(&thq_TxQueue, &counter, TX_WAIT_FOREVER);
        /* Log message */
        PRINTF("thfnc_DFRBMngmnt::sent message...\r\n");
        /* Toggle LED */
        GPIO_PortToggle(GPIO, BOARD_LED_PORT, 1u << BOARD_LED_PIN);
        /* Sleep for 1 second */
        tx_thread_sleep(1000);
    }
}

 

 No UART logs nor the LED blinks.

Is this a ThreadX configuration or am I doing something wrong?
Any help would be nice,
Rui

Labels (1)
0 Kudos
5 Replies

365 Views
rjmalmeida0
Contributor III

Any news on this matter?

Regards,
Rui

0 Kudos

362 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @rjmalmeida0 

How about reading data out then comparing with programed image?  

And which IDE do you used? How about using IDE program? Also compare the two value using two method programed.

 

BR

Alice

0 Kudos

465 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @rjmalmeida0 

How about first test with a simple led project without ThreadX?

About using MCUXpresso Secure Provisioning Tool, please refer to "LPC55(S)0x/1x/2x/6x device workflow" of <MCUXpresso Secure Provisioning Tool user guide>.

 

BR

Alice

0 Kudos

304 Views
rjmalmeida0
Contributor III

Have you tried to replicate the problem? 
I created another project for the same platform, a little more complex one. Still, same behaviour.

0 Kudos

462 Views
rjmalmeida0
Contributor III

Hello,

With a simple application without ThreadX the secure provisioning works fine.

 

Kind regards,

Rui

0 Kudos