This article explains how to update the bootloader objects of eMMC memory, located onto STM32MP157x-EV1 Evaluation board using STM32CubeIDE.
1. Overview[edit source]
The different steps to update eMMC with customized trusted image are the following ones:
- Initialize the eMMC with Starter Package image thanks to STM32CubeProgrammer.
- Within STM32CubeIDE:
- Check the new customization is correctly set up
All those steps are explained in chapters below.
2. Initialize eMMC with Starter Package[edit source]
Initialize the eMMC with Starter Package image thanks to STM32CubeProgrammer.
For that select the Starter package corresponding to the targeted STM32MP157x-EV1 Evaluation board and jump to chapter Downloading the image and flashing it on the board .
Before executing the next step, check the bootloader version, visible in boot messages:
- TF-A BL2 version, booting from eMMC memory
- U-boot version & extlinux.conf file used, booting from eMMC memory
- extlinux.conf content before update
3. Customize and update bootloader images on running STM32MP157x-EV1 board[edit source]
3.1. Build the trusted image inside STM32CubeIDE with the new expected device trees[edit source]
After customization of hardware resources within embedded STM32CubeMX, new device trees for Linux® and for bootloader are generated.
Next step is to build an update of the new trusted image; this is covered also within STM32CubeIDE with:
- bootloader images generation, as explained in How to manage OpenSTLinux projects in STM32CubeIDE#Bootloader_projects
- and Linux® device tree compilation How_to_manage_OpenSTLinux_projects_in_STM32CubeIDE#Linux_project
Note that for Linux®, only device tree has to be updated as described hereafter.
3.2. STM32MP157x-EV1 board update with new Linux® device tree[edit source]
In this step, STM32MP157x-EV1 board is up and running with network access: target status is green. After having compiled device tree generated by STM32CubeMX , you need to :
- update STM32MP15 target bootfs with new .dtb under /boot
- and adjust /boot/mmc1_extlinux/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 use Run button. You get in a dedicated Linux® Deployment console a message like this:
- Check extlinux.conf content after eMMC Linux® device tree update (DEFAULT and LABEL have changed)
3.3. STM32MP157x-EV1 board update with new bootloader images[edit source]
In this step, STM32MP157x-EV1 board is up and running with network access: target status is green.
After having built customized bootloader images, you need to update STM32MP157x-EV1 Evaluation board .
- 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, thanks to Scan... button.
This storage list depends on the board and on the used boot storage.
Then, select the storage to update (EMMC #0 here) and the TF-A BL2 & FIP image to update from FIP_artifacts/ .
Here is the corresponding STM32 Cortex-A Bootloader Deployment configuration:
- Click on Run, you get in a dedicated Bootloader Deployment console following message:
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 eMMC memory
- U-Boot updated version & Linux® device tree, booting from eMMC memory