Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updating numbered headings

...

This application note explains how to build the U-Boot and FreeRTOS target run-time images for the Emcraft STM32H7 SOM and Starter kit.

1. FreeRTOS gits

Emcraft maintains the U-Boot and FreeRTOS sources for the STM32H7 SOM and Starter Kit in the following repositories:

2. Build Host

The FreeRTOS build runs on a Linux development host.

...

  • Fedora CoreOS 31;

  • Ubuntu 20.04.

3. Software Set-Up

The following software set-up is required on the Linux development host, in order to build U-Boot and FreeRTOS:

  1. Install the M7 toolchain.

    1. For Fedora:

      Code Block
      $ sudo dnf install arm-none-eabi-gcc-cs arm-none-eabi-binutils-cs
    2. For Ubuntu:

      Code Block
      $ sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
      $ sudo apt-get update
      $ sudo apt install gcc-arm-none-eabi binutils
  2. Install the uboot-tools package.

    1. For Fedora:

      Code Block
      $ sudo dnf install uboot-tools
    2. For Ubuntu:

      Code Block
      $ sudo apt install u-boot-tools
  3. Install the openss-devel package.

    1. For Fedora:

      Code Block
      $ sudo dnf install openssl-devel
    2. For Ubuntu:

      Code Block
      $ sudo apt install libssl-dev
  4. Install the stlink package.

    1. For Fedora:

      Code Block
      $ sudo dnf install stlink
    2. For Ubuntu:

      Code Block
      $ sudo apt install stlink

      Please note that the stlink package should be version 1.7.0 or higher. If the new version is not available for your distribution then build it manually from the sources, refer to https://github.com/stlink-org/stlink/blob/develop/doc/compiling.md .

  5. Install the ckermit package.

    1. For Fedora:

      Code Block
      $ sudo dnf install ckermit
    2. For Ubuntu:

      Code Block
      $ sudo apt install ckermit

4. Build Procedure

Run the following step-wise procedure to build the U-Boot and FreeRTOS run-time images for the STM32H7 SOM and Starter Kit:

  1. Create a separate directory and clone the U-Boot and FreeRTOS repositories:

    Code Block
    $ mkdir stm32h7-som 
    $ cd stm32h7-som 
    $ git clone git@gitlab.com:emcraft/STM32H7/u-boot-upstream -b \
    emcraft-2019.04 
    $ git clone git@gitlab.com:emcraft/STM32H7/STM32CubeH7 -b master-1.11.0
  2. Generate cryptographic keys to sign the bootable image:

    Code Block
    $ mkdir keys 
    $ openssl genrsa -F4 -out keys/dev.key 2048 
    $ openssl req -batch -new -x509 -key keys/dev.key -out keys/dev.crt
  3. Create links to the keys in the U-Boot and FreeRTOS sources:

    Code Block
    $ ln -s ../keys u-boot-upstream/ 
    $ ln -s ../keys STM32CubeH7/
  4. Go to the top of the U-Boot source tree:

    Code Block
    $ cd u-boot-upstream/
  5. Configure the U-Boot sources to build for the STM32H750 System-on-Module:

    Code Block
    $ make ARCH=arm CROSS_COMPILE=arm-none-eabi- stm32h7_som_nor_defconfig
      HOSTCC  scripts/basic/fixdep
    ...
    # configuration written to .config
    ...
    $
  6. Build U-Boot for the STM32H750 System-on-Module:

    Code Block
    $ make ARCH=arm CROSS_COMPILE=arm-none-eabi-
    scripts/kconfig/conf  --syncconfig Kconfig
      CHK     include/config.h
    ...
      CFGCHK  u-boot.cfg
    $
  7. Go to the top of the FreeRTOS source tree:

    Code Block
    $ cd -
    $ cd STM32CubeH7/
  8. Configure the BSP for your STM32H7-BSB revision in Projects/STM32H7_SOM/Applications/FreeRTOS/freertos_stm32h750/Inc/stm32h7xx_hal_conf.h:

    • For the STM32H7-BSB Rev 1A board, set the BSB_REV_2B constant value to 0.

    • For the STM32H7-BSB Rev 2A board, set the BSB_REV_2B constant value to 1.

  9. Build the firmware image:

    Code Block
    $ sh mk_release.sh

5. Build Artifacts

The build procedure described above creates the following target run-time images. These images are ready for installation to the STM32H7 SOM:

...