Installing FreeRTOS to STM32H7 SOM via UART
This application note explains how to install FreeRTOS to the STM32H7 System-On-Module using the UART interface as the download channel.
Refer to Understanding STM32H7 SOM Boot Architecture 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 1A soldered onto the STM32H7-BSB Rev 1A or STM32H7-BSB Rev 2A baseboard;
The microUSB cable connected to the P1 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 for STM32H7-BSB Rev 1A:
The following picture illustrates the above hardware set-up for STM32H7-BSB Rev 2A:
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 Building FreeRTOS .
Use the prebuilt images provided by Emcraft. The prebuilt images can be found in the location documented in Release Notes.
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 stm32h7-som]# st-flash write u-boot-upstream/spl/u-boot-spl.bin 0x08000000 st-flash 1.7.0-246-gc721751 2023-04-21T01:27:56 INFO common.c: STM32H74x_H75x: 128 KiB SRAM, 128 KiB flash in at least 128 KiB pages. file u-boot-spl.bin md5 checksum: 5b12ae3943ed667fd35456dbae306ab9, stlink checksum: 0x00519191 2023-04-21T01:27:56 INFO common_flash.c: Attempting to write 61757 (0xf13d) bytes to stm32 address: 134217728 (0x8000000) 2023-04-21T01:27:56 WARN common_flash.c: unaligned len 0xf13d -- padding with zero -> Flash page at 0x8000000 erased (size: 0x20000) 2023-04-21T01:27:57 INFO flashloader.c: Starting Flash write for H7 61758/61758 bytes written 2023-04-21T01:27:58 INFO common_flash.c: Starting verification of write complete 2023-04-21T01:27:59 INFO common_flash.c: Flash written and verified! jolly good! [root@workbench stm32h7-som]#
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-emcraft-h7-2.0.0-g5445b38714 (Apr 19 2023 - 14:03:32 +0400) Hit 's' key to enter spl shell: Trying to boot from SPI
4. Installing U-Boot "Proper" and FreeRTOS to QSPI Flash
Step through the following procedure to install the U-Boot "Proper" and FreeRTOS 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).Run the following command on the Linux development host:
[sasha_d@workbench stm32h7-som]$ ./u-boot-upstream/board/emcraft/ stm32h7-som/stm32h7-som-prog.kermit /dev/ttyUSB1 u-boot-upstream/ u-boot.img STM32CubeH7/Release/freertos_stm32h750.img Reset the board to start programming "u-boot-upstream/u-boot.img" via "/dev/ttyUSB1"
Reset the SOM by pressing the S3 button on the carrier board.
Wait for the C-Kermit utility to load the U-Boot and FreeRTOS images (observe the progress indicators).
The script will exit successfully at the end of the installation procedure:
Verify that the U-Boot "proper" and FreeRTOS have 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. It is done simultaneously with installing U-Boot "Proper" and FreeRTOS, as described above. Use the following command on the Linux development host to install the stm32h7-splash-24bpp.bmp
picture as the splash screen: