Secondary boot with APPLICATIONLOCKUP trigger
This sample demonstrates an automatic secondary boot triggered by a lockup of the application core CPU on the nRF54H20 DK. When the primary application triggers a CPU lockup, IronSide SE automatically boots the secondary image without requiring any application-level software intervention.
Requirements
The sample supports the following development kit:
Hardware platforms |
PCA |
Board name |
|
|---|---|---|---|
PCA10175 |
|
Overview
The sample consists of two applications:
Primary Image: Runs initially on the application core (
cpuapp), prints status messages, and deliberately triggers a CPU lockup by disabling fault exceptions and then causing a fault.Secondary Image: Automatically boots after the lockup is detected and runs continuously.
The UICR.SECONDARY.TRIGGER.APPLICATIONLOCKUP configuration causes IronSide SE to automatically boot the secondary image when a CPU lockup is detected.
Configuration
The sample uses the following UICR configuration in the sysbuild/uicr.conf file:
CONFIG_GEN_UICR_SECONDARY=y
CONFIG_GEN_UICR_SECONDARY_TRIGGER=y
CONFIG_GEN_UICR_SECONDARY_TRIGGER_APPLICATIONLOCKUP=y
This enables automatic secondary boot when the application core experiences a CPU lockup.
For more information about secondary firmware configuration and other available triggers, see Booting a secondary firmware.
Building and running
This sample can be found under samples/ironside_se/secondary_boot_trigger_lockup in the nRF Connect SDK folder structure.
For more security, it is recommended to use the */ns variant of the board target (see the Requirements section above.)
When built for this variant, the sample is configured to compile and run as a non-secure application using security by separation.
Therefore, it automatically includes Trusted Firmware-M that prepares the required peripherals and secure services to be available for the application.
To build the sample, follow the instructions in Building an application for your preferred building environment. See also Programming an application for programming steps and Testing and optimization for general information about testing and debugging in the nRF Connect SDK.
Note
When building repository applications in the SDK repositories, building with sysbuild is enabled by default.
If you work with out-of-tree freestanding applications, you need to manually pass the --sysbuild parameter to every build command or configure west to always use it.
To build the sample for the nRF54H20 DK, run the following command:
west build -b nrf54h20dk/nrf54h20/cpuapp samples/ironside_se/secondary_boot_trigger_lockup
To program the sample on the device, run the following command:
west flash
Testing
After programming the sample to your development kit, complete the following steps to test it:
Connect to the kit with a terminal emulator (for example, the Serial Terminal app). See Testing and optimization for the required settings and steps.
Reset the kit.
Observe in the console output the primary image startup and lockup trigger:
=== Primary Image: Demonstrating APPLICATIONLOCKUP trigger === This image will intentionally trigger a CPU lockup. The UICR.SECONDARY.TRIGGER.APPLICATIONLOCKUP configuration will automatically boot the secondary image. Triggering CPU lockup now! Step 1: Disabling fault exceptions and then accessing invalid memory...
Observe in the console output that the system automatically reboots into the secondary image:
=== Secondary Image: Successfully booted! === The system automatically booted the secondary image due to APPLICATION LOCKUP in the primary image. This demonstrates UICR.SECONDARY.TRIGGER.APPLICATIONLOCKUP automatic failover capability. Secondary image heartbeat - system is stable Secondary image heartbeat - system is stable ...
Dependencies
This sample uses the following nRF Connect SDK subsystems:
Sysbuild - Enables building multiple images in a single build process
UICR generation - Configures the User Information Configuration Registers for automatic secondary boot on lockup
In addition, it uses the following Zephyr subsystems: