This article gives details about updating, using STM32CubeIDE, the NAND memory bootloader objects, located onto STM32MP157x-EV1 (e.g.).
1. Overview[edit source]
The different steps to update NAND with customized trusted image are the following ones:
- Initialize the NAND with Starter Package image thanks to STM32CubeProgrammer.
- Build the trusted image inside STM32CubeIDE with new device tree configured thanks to STM32CubeMX.
- Update STM32MP15 board with new device tree
- Check the new customization is correctly set up
All those steps are explained in chapters below.
2. Initialize NAND with Starter Package[edit source]
Initialize the NAND with Starter Package image thanks to STM32CubeProgrammer.
For that select the Starter package corresponding to the targeted STM32MP1 board and jump to chapter Downloading the image and flashing it on the board (eg here for STM32MP15 Evaluation board)
Before executing the next step, check the bootloader version, visible in boot messages:
- TF-A BL2 version, booting from NAND memory
- U-boot version & extlinux.conf file used, booting from NAND memory
- extlinux.conf content before update
3. Customize bootloader using STM32CubeIDE[edit source]
3.1. Build the trusted image inside STM32CubeIDE with the new expected device tree[edit source]
The devive tree can be generated by STM32CubeMX following procedure given in How to manage OpenSTLinux projects in STM32CubeIDE#Bootloader_projects
3.2. Configure STM32MP1 board with new device tree[edit source]
After having compiled device tree generated by STM32CubeMX , you need to :
- update MP15 target bootfs with new .dtb under /boot
- and adjust /boot/nand0_extlinux/stm32mp157c-ev1_extlinux.conf in order to declare new device tree and set it as default.
For that, follow steps explained below:
- select the "Cortex-A Linux® Deployment" shortcut configuration available from Linux® project Run As... menu.
- Validate your choice and run the ?project? : NAND Linux® deployment message should be like this
- Check extlinux.conf content after NAND Linux® device tree update (DEFAULT and LABEL have changed)
3.3. Start STM32MP1 board with new device tree[edit source]
To get STM32MP15 board up and running with network access :
- Select Cortex-A project in STM32CubeIDE and click right to get Cortex-A Bootloader Deployment shortcut.
→ Connection is automatically set and you need to scan STM32MP15 target storage.
This storage list depends on the board and on the used boot storage.
- Then, select the storage to update (NAND #0 here) and the TF-A BL2 & FIP image to update from FIP_artifacts/ .
- Validate your choice : NAND Linux® deployment configuration message should be like this
4. Check new bootloader version after customization with STM32CubeIDE[edit source]
After the update, the new bootloader version can be checked by comparing version appearing in boot messages : TF-A BL2 and U-Boot versions are modified and Linux® uses the generated device tree.
Here are the new boot messages :
- TF-A BL2 updated version, booting from NAND memory
- U-Boot updated version & Linux® device tree, booting from NAND memory