Installing U-Boot to the STM32H7 SOM (uClinux)
This application note explains how to install the U-Boot firmware to the STM32H7 SOM. Refer to https://voxelbotics.atlassian.net/wiki/spaces/DOC/pages/302481451 as a pre-requisite to understanding the installation procedure.
1. Hardware Set-Up
The following hardware set-up is required for installation of the software to the STM32H7 SOM:
STM32H7-SOM Rev 2A soldered onto the STM32H7-BSB Rev 4A baseboard;
The USB Type C cable connected to the J10 connector on the baseboard (to provide the STM32H7 serial console to the development host);
The ST-LINK/V2 debugger/programmer connected to the 20-pin P3 ARM JTAG connector on the baseboard.
The following picture illustrates the above hardware set-up:
NOTE: The STM32H7-BSB Rev 1A/2A baseboards are supported by BSP version 2.5.0. The newer versions support the STM32H7-BSB Rev 4A baseboard only.
2. Installable Images
The images to be installed onto the STM32H7 SOM can be obtained using one of the two approaches, as follows:
Build the images from the sources, as documented in: https://voxelbotics.atlassian.net/wiki/spaces/DOC/pages/302088259 .
Use the prebuilt images and the Kermit script provided by Emcraft.
3. Installing U-Boot SPL to Internal Flash
Step through the following procedure to install the U-Boot SPL to the internal Flash of the STM32H750:
Run the following command on the Linux development host:
[root@workbench linux-cm-stm32h7-2.6.1]# st-flash write u-boot/spl/\ u-boot-spl.bin 0x08000000 st-flash 1.7.0-120-gbeffed4 2024-05-03T05:15:24 INFO common.c: H74x/H75x: 128 KiB SRAM, 22633 KiB flash in at least 128 KiB pages. file u-boot-spl.bin md5 checksum: d4d01d8f8aa453144bbe499de1181, stlink checksum: 0x0050b4bb 2024-05-03T05:15:24 INFO common.c: Attempting to write 61229 (0xef2d) bytes to stm32 address: 134217728 (0x8000000) 2024-05-03T05:15:24 WARN common.c: unaligned len 0xef2d -- padding with zero 2024-05-03T05:15:25 INFO common.c: Flash page at addr: 0x08000000 erased 2024-05-03T05:15:25 INFO common.c: Finished erasing 1 pages of 131072 (0x20000) bytes 2024-05-03T05:15:25 INFO common.c: Starting Flash write for H7 61230/61230 bytes written 2024-05-03T05:15:27 INFO common.c: Starting verification of write complete 2024-05-03T05:15:27 INFO common.c: Flash written and verified! jolly good! [root@workbench linux-cm-stm32h7-2.6.1]#
Verify that the U-Boot SPL has been successfully installed. Reset the SOM by pressing the S3 button on the carrier board and confirm that the following output appears on the serial UART console:
U-Boot SPL 2019.04- (May 03 2024 - 06:09:05 +0000) Hit 's' key to enter spl shell: Trying to boot from SPI
4. Installing U-Boot "Proper" to QSPI Flash
Step through the following procedure to install the U-Boot "Proper" to the QSPI Flash:
On the development host, make sure that your serial terminal utility (such as
picocom
) is not connected to the board serial console (/dev/ttyUSB1
in this example). Exit the utility or just kill it, for example:[sasha_d@workbench ~]$ killall picocom [sasha_d@workbench ~]$
Run the following command on the Linux development host:
Reset the target board to start programming
u-boot/u-boot.img
via/dev/ttyUSB1
.Reset the SOM by pressing the S3 button on the carrier board.
Wait for the
kermit
utility to load the U-Boot image (observe the progress indicators).The script will exit successfully at the end of the installation procedure:
Connect to the SOM console using a serial terminal utility, for example:
Verify that the U-Boot "proper" has been successfully installed. Reset the SOM by pressing the S3 button on the carrier board and confirm that the following output appears on the serial UART console:
5. Enabling LCD and Splash Screen on Starter Kit with LCD
If your starter kit includes the LCD, it can be enabled in software by installing the U-Boot splash screen image to the QSPI Flash. Step through the following procedure to install the stm32h7-splash-24bpp.bmp
picture as the splash screen:
On the development host, make sure that your serial terminal utility (such as
picocom
) is not connected to the board serial console (/dev/ttyUSB1
in this example). Exit the utility or just kill it, for example:Run the following command on the Linux development host:
Reset the target board to start programming
./u-boot/board/emcraft/stm32h7-som/stm32h7-splash-24bpp.bmp
via/dev/ttyUSB1
.Reset the SOM by pressing the S3 button on the carrier board.
Wait for the
kermit
utility to load the splash image (observe the progress indicators).The script will exit successfully at the end of the installation procedure:.
Reset the SOM by pressing the S3 button on the carrier board and confirm that the splash image is displayed on the LCD.