Difference between revisions of "How to manage OpenSTLinux projects in STM32CubeIDE/SD card update with customized trusted image"

[quality revision] [pending revision]
m
m
 
Applicable for STM32MP15x lines

This article gives details about updating the bootloader objects of SD card memory, located onto STM32MP157x-EV1 (e.g.), using STM32CubeIDE.

BackToNavigationTree button.png BackToNavigationTree button.png

1 Overview[edit]

The different steps to update SD card with customized trusted image are the following ones:

  • Initialize the SD card with Starter Package image thanks to STM32CubeProgrammer
  • Within STM32CubeIDE:
    • customize the trusted image, thanks to embedded STM32CubeMX generating device trees
    • compile corresponding Linux® device tree & bootloader images
    • update them on running STM32MP15 board
  • Check the new customization is correctly set up

All those steps are explained in chapters below.

2 Initialize SD card with Starter Package[edit]

Initialize the SD card 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 (e.g. here for STM32MP15 Evaluation board).

Before executing the next step, check the bootloader version, visible in boot messages:

  • TF-A BL2 version, booting from SD card memory
SD-Card initial setting: TF-A BL2 version


  • U-boot version & extlinux.conf file used, booting from SD card memory
SD-Card initial setting: U-boot version & extlinux.conf


  • extlinux.conf content before update
SD-Card initial setting: extlinux.conf content


3 Customize bootloader images and update them on running STM32MP15 board[edit]

3.1 Build the trusted image inside STM32CubeIDE with the new expected device trees[edit]

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:

Note that for Linux®, only device tree has to be updated as described hereafter.

3.2 STM32MP1 board update with new Linux® device tree[edit]

In this step, STM32MP15 board is up and running with network access: target status is green.
After having compiled device tree generated by STM32CubeMX , you need to :

  • update MP15 target bootfs with new .dtb under /boot
  • and adjust /boot/mmc0_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.
Linux® deployment configurationLinux® deployment configuration


  • Validate your choice and use Run button. You get in a dedicated Linux® Deployment console a message like this:
SD card Linux® deployment message


  • Check extlinux.conf content after SD card Linux® device tree update (DEFAULT and LABEL have changed)
SD card Linux® device tree update


3.3 STM32MP1 board update with new bootloader images[edit]

In this step, STM32MP15 board is up and running with network access: target status is green.
After having built customized bootloader images, you need to update STM32MP1 board.

  • Select Cortex-A project in STM32CubeIDE and click right to get Cortex-A Bootloader Deployment shortcut.
Bootloader update shortcutBootloader update 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 (SD-Card #0 here) and the TF-A BL2 & FIP image to update from FIP_artifacts/ .
Here is the corresponding STM32 Cortex-A Bootloader Deployment configuration:

SD card Bootloader deployment configurationSD card Bootloader deployment configuration


  • Click on Run, you get in a dedicated Bootloader Deployment console following message:
SD card Bootloader deployment messageSD card Bootloader deployment message


4 Check new bootloader version after customization with STM32CubeIDE[edit]

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 SD card memory
SD-Card updated TF-A BL2 version


  • U-Boot updated version & Linux® device tree, booting from SD card memory
SD-Card updated U-Boot version & Linux® Device TreeSD-Card updated U-Boot version & Linux® Device Tree


BackToNavigationTree button.png BackToNavigationTree button.png

<noinclude>
{{ApplicableFor
| MPUs list=STM32MP15x 
| MPUs checklist=STM32MP13x, STM32MP15x}}<br>
</noinclude>
{{ClonedFrom|stm32mpuv3}}

This article gives details about updating the bootloader objects of SD card memory, located onto STM32MP157x-EV1 (e.g.), using STM32CubeIDE.

[[File:BackToNavigationTree button.png|200px300px|link=How to manage OpenSTLinux projects in STM32CubeIDE]]

==Overview==
The different steps to update SD card with customized trusted image are the following ones:
* Initialize the SD card with Starter Package image thanks to STM32CubeProgrammer
* Within STM32CubeIDE:
** customize the trusted image, thanks to embedded STM32CubeMX generating device trees
** compile corresponding Linux® device tree & bootloader images
** update them on running STM32MP15 board
* Check the new customization is correctly set up
All those steps are explained in chapters below.

==Initialize SD card with Starter Package==
Initialize the SD card with [[:Category:Starter_Package | Starter Package]] image thanks to [[STM32CubeProgrammer]].<br>

For that select the Starter package corresponding to the targeted STM32MP1 board and jump to chapter [[STM32MP15_Evaluation_boards_-_Starter_Package#Downloading_the_image_and_flashing_it_on_the_board| Downloading the image and flashing it on the board ]] (e.g. here for STM32MP15 Evaluation board).

Before executing the next step, check the bootloader version, visible in ''boot messages'':

* TF-A BL2 version, booting from SD card memory
[[File:SD-before-1.png|center|frame|SD-Card initial setting: TF-A BL2 version| link=]]

* U-boot version & extlinux.conf file used, booting from SD card memory
[[File:SD-before-2.png|frame|center|SD-Card initial setting: U-boot version & extlinux.conf| link=]]

* extlinux.conf content before update
[[File:SD-before-3.png|frame|center|SD-Card initial setting: extlinux.conf content| link=]]

==Customize bootloader images and update them on running STM32MP15 board==
===Build the ''trusted image'' inside STM32CubeIDE with the new expected device trees===
After customization of hardware resources within embedded STM32CubeMX, new device trees for Linux<sup>®</sup> and for bootloader are generated. <br>

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<sup>®</sup> device tree compilation [[How_to_manage_OpenSTLinux_projects_in_STM32CubeIDE#Linux_project]]

Note that for Linux<sup>®</sup>, only device tree has to be updated as described hereafter. 

===STM32MP1 board update with new Linux<sup>®</sup> device tree===
In this step, STM32MP15 board is up and running with network access: [[How to use the Target Status widget in STM32CubeIDE|target status]] is green.<br>

After having compiled device tree generated by STM32CubeMX , you need to :
* update MP15 target bootfs with new '''''.dtb''''' under '''''/boot'''''  
* and adjust '''''/boot/mmc0_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<sup>®</sup> Deployment''''' shortcut configuration available from Linux<sup>®</sup> project '''''Run As...''''' menu.
[[File:SD-init-1.png|850px700px|center|Linux<sup>®</sup> deployment configuration| link=]]

*Validate your choice and use '''''Run''''' button. You get in a dedicated '''''Linux<sup>®</sup> Deployment''''' console a message like this:
[[File:SD-init-2.png|850px|center|SD card Linux<sup>®</sup> deployment message| link=]]

*Check extlinux.conf content after SD card Linux<sup>®</sup> device tree update (DEFAULT  and LABEL have changed)
[[File:SD-init-3.png|600px|center|SD card Linux<sup>®</sup> device tree update| link=]]

===STM32MP1 board update with new bootloader images===
In this step, STM32MP15 board is up and running with network access: [[How to use the Target Status widget in STM32CubeIDE|target status]] is green.<br>

After having built customized bootloader images, you need to update STM32MP1 board.

* Select Cortex-A project in STM32CubeIDE and click  right to get '''''Cortex-A Bootloader Deployment''''' shortcut. 
[[File:SD-init-0.png|850px750px|center|Bootloader update shortcut]]


Connection is automatically set and you need to scan STM32MP15 target storage, thanks to '''''Scan...''''' button.<br> 

This storage list depends on the board and on the used boot storage.

Then, select the storage to update (SD-Card #0 here) and the TF-A BL2 & FIP image to update from FIP_artifacts/ .  <br>

Here is the corresponding ''STM32 Cortex-A Bootloader Deployment'' configuration:
[[File:SD-init-4.png|850px750px|center|SD card Bootloader deployment configuration| link=]]

* Click on '''''Run''''', you get in a dedicated '''''Bootloader Deployment''''' console following message: 
[[File:SD-init-5.png|850px750px|center|SD card Bootloader deployment message| link=]]

==Check new bootloader version after customization with STM32CubeIDE==
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<sup>®</sup> uses the generated device tree. <br>

Here are the new ''boot messages'' :

* TF-A BL2 updated version,  booting from SD card memory
[[File:SD-after-1.png|600px|center|SD-Card updated TF-A BL2 version| link=]]

* U-Boot updated version & Linux<sup>®</sup> device tree, booting from SD card memory
[[File:SD-after-2.png|800px600px|center|SD-Card updated U-Boot version & Linux<sup>®</sup> Device Tree| link=]]

[[File:BackToNavigationTree button.png|200px300px|link=How to manage OpenSTLinux projects in STM32CubeIDE]]
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>
+
<noinclude>{{ApplicableFor
{{ApplicableFor | MPUs list=STM32MP15x | MPUs checklist=STM32MP13x, STM32MP15x}}<br>
+
| MPUs list=STM32MP15x  
</noinclude>
+
| MPUs checklist=STM32MP13x, STM32MP15x}}</noinclude>
 
+
{{ClonedFrom|stm32mpuv3}}
 
This article gives details about updating the bootloader objects of SD card memory, located onto STM32MP157x-EV1 (e.g.), using STM32CubeIDE.
 
This article gives details about updating the bootloader objects of SD card memory, located onto STM32MP157x-EV1 (e.g.), using STM32CubeIDE.
   
[[File:BackToNavigationTree button.png|200px|link=How to manage OpenSTLinux projects in STM32CubeIDE]]
+
[[File:BackToNavigationTree button.png|300px|link=How to manage OpenSTLinux projects in STM32CubeIDE]]
   
 
==Overview==
 
==Overview==
Line 52: Line 52:
 
For that, follow steps explained below:
 
For that, follow steps explained below:
 
* select the '''''Cortex-A Linux<sup>®</sup> Deployment''''' shortcut configuration available from Linux<sup>®</sup> project '''''Run As...''''' menu.
 
* select the '''''Cortex-A Linux<sup>®</sup> Deployment''''' shortcut configuration available from Linux<sup>®</sup> project '''''Run As...''''' menu.
[[File:SD-init-1.png|850px|center|Linux<sup>®</sup> deployment configuration| link=]]
+
[[File:SD-init-1.png|700px|center|Linux<sup>®</sup> deployment configuration| link=]]
   
   
Line 68: Line 68:
 
   
 
   
 
* Select Cortex-A project in STM32CubeIDE and click  right to get '''''Cortex-A Bootloader Deployment''''' shortcut.  
 
* Select Cortex-A project in STM32CubeIDE and click  right to get '''''Cortex-A Bootloader Deployment''''' shortcut.  
[[File:SD-init-0.png|850px|center|Bootloader update shortcut]]
+
[[File:SD-init-0.png|750px|center|Bootloader update shortcut]]
   
   
Line 77: Line 77:
 
Then, select the storage to update (SD-Card #0 here) and the TF-A BL2 & FIP image to update from FIP_artifacts/ .  <br>
 
Then, select the storage to update (SD-Card #0 here) and the TF-A BL2 & FIP image to update from FIP_artifacts/ .  <br>
 
Here is the corresponding ''STM32 Cortex-A Bootloader Deployment'' configuration:
 
Here is the corresponding ''STM32 Cortex-A Bootloader Deployment'' configuration:
[[File:SD-init-4.png|850px|center|SD card Bootloader deployment configuration| link=]]
+
[[File:SD-init-4.png|750px|center|SD card Bootloader deployment configuration| link=]]
   
   
 
* Click on '''''Run''''', you get in a dedicated '''''Bootloader Deployment''''' console following message:  
 
* Click on '''''Run''''', you get in a dedicated '''''Bootloader Deployment''''' console following message:  
[[File:SD-init-5.png|850px|center|SD card Bootloader deployment message| link=]]
+
[[File:SD-init-5.png|750px|center|SD card Bootloader deployment message| link=]]
   
   
Line 94: Line 94:
   
 
* U-Boot updated version & Linux<sup>®</sup> device tree, booting from SD card memory
 
* U-Boot updated version & Linux<sup>®</sup> device tree, booting from SD card memory
[[File:SD-after-2.png|800px|center|SD-Card updated U-Boot version & Linux<sup>®</sup> Device Tree| link=]]
+
[[File:SD-after-2.png|600px|center|SD-Card updated U-Boot version & Linux<sup>®</sup> Device Tree| link=]]
   
   
[[File:BackToNavigationTree button.png|200px|link=How to manage OpenSTLinux projects in STM32CubeIDE]]
+
[[File:BackToNavigationTree button.png|300px|link=How to manage OpenSTLinux projects in STM32CubeIDE]]