Default Bootloader "stm32mp15xx-dhcor-testbench": Difference between revisions

From Wiki-DB
Jump to navigationJump to search
Ageisreiter (talk | contribs)
No edit summary
Ageisreiter (talk | contribs)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
Each DHCOR STM32MP1 module comes with preprogrammed default bootloader.
Each DHCOR STM32MP1 module comes with preprogrammed default bootloader.
== Features/Suported interfaces==
== Features/Supported interfaces==
* Bootloader console (UART4)
* Bootloader console (UART4)
* PMIC (STPMIC1APQR)
* PMIC (STPMIC1APQR)
Line 11: Line 11:
* Gbit Ethernet KSZ9031 (ETH1)
* Gbit Ethernet KSZ9031 (ETH1)
* USB Host and Device
* 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 ===
[https://www.dropbox.com/s/ew6xxok49o2asce/u-boot_stm32mp1-testbench_2022.07_g5d247d61.zip?dl=0 Dropbox: u-boot_stm32mp1-testbench_2022.07_g5d247d61.zip] ([https://github.com/dh-electronics/u-boot-stm32mp1/tree/v2022.07_testbench source])
==== Build binaries from source ====
Checkout source code
<syntaxhighlight lang="shell">
git clone -b v2022.07_testbench https://github.com/dh-electronics/u-boot-stm32mp1.git
cd u-boot-stm32mp1
</syntaxhighlight>
Download and extract toolchain
Toolchain from: https://developer.arm.com/downloads/-/gnu-a
<syntaxhighlight lang="shell">
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
</syntaxhighlight>
Set env variables
<syntaxhighlight lang="shell">
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
</syntaxhighlight>
Create config, set testbench as default and build
<syntaxhighlight lang="shell">
make stm32mp15_dhcor_basic_defconfig
sed -i 's/stm32mp15xx-dhcor-avenger96/stm32mp15xx-dhcor-testbench/g' .config
make -j16
</syntaxhighlight>
Check sha256 sums and compare with sha256sum.txt
<syntaxhighlight lang="shell">
sha256sum u-boot.itb u-boot-spl.stm32
</syntaxhighlight>
== 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:
<syntaxhighlight lang="shell">
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'
</syntaxhighlight>
* Start bootloader update
<syntaxhighlight lang="shell">
run update_sf
</syntaxhighlight>

Latest revision as of 09:32, 27 September 2022

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