Default Bootloader "stm32mp15xx-dhcor-testbench"

From Wiki-DB
Revision as of 09:32, 27 September 2022 by Ageisreiter (talk | contribs) (→‎Download prebuilt binaries)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Each DHCOR STM32MP1 module comes with preprogrammed default bootloader.

Features/Supported interfaces

  • Bootloader console (UART4)
  • PMIC (STPMIC1APQR)
  • DDR3 Memory (size is coded by DDR3 coding pins)
  • CPU type (STM32MP151, STM32MP153 and STM32MP157)
  • On-Board I2C (I2C4)
  • microSD (SDMMC1)
  • eMMC (SDMMC2)
  • SPI boot Flash (QSPI_BK1)
  • Gbit Ethernet KSZ9031 (ETH1)
  • USB Host and Device

Download/Build U-Boot SPL and U-Boot binaries

There are two ways to get the required U-Boot binaries. These can either be downloaded or built from the sources by yourself. Follow one of the two steps below.

Download prebuilt binaries

Dropbox: u-boot_stm32mp1-testbench_2022.07_g5d247d61.zip (source)

Build binaries from source

Checkout source code

git clone -b v2022.07_testbench https://github.com/dh-electronics/u-boot-stm32mp1.git
cd u-boot-stm32mp1

Download and extract toolchain Toolchain from: https://developer.arm.com/downloads/-/gnu-a

wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf.tar.xz
tar xf gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf.tar.xz -C /opt/toolchains

Set env variables

export ARCH=arm
export CROSS_COMPILE=/opt/toolchains/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-
export SOURCE_DATE_EPOCH=1664184598 # Mon Sep 26 09:29:58 2022 UTC

Create config, set testbench as default and build

make stm32mp15_dhcor_basic_defconfig
sed -i 's/stm32mp15xx-dhcor-avenger96/stm32mp15xx-dhcor-testbench/g' .config
make -j16

Check sha256 sums and compare with sha256sum.txt

sha256sum u-boot.itb u-boot-spl.stm32

Simple U-Boot update via USB flash drive

Attention: Do not switch off the voltage during the update

  • Copy binaries to USB drive.
  • Startup U-Boot, connect to console and plugin USB drive with binary files.
  • Set update_sf command:
env set update_sf 'usb start && setexpr loadaddr1 ${loadaddr} + 0x1000000 && load usb 0 ${loadaddr1} u-boot-spl_stm32mp1-testbench_2022.07_g5d247d61.stm32 && env set filesize1 ${filesize} && load usb 0 ${loadaddr} u-boot_stm32mp1-testbench_2022.07_g5d247d61.itb && sf probe && sf erase 0 0x200000 && sf update ${loadaddr1} 0 ${filesize1} && sf update ${loadaddr1} 0x40000 ${filesize1} && sf update ${loadaddr} 0x80000 ${filesize} && env set filesize1 && env set loadaddr1'
  • Start bootloader update
run update_sf