DHCOM STM32MP1 Bootloader U-Boot

From Wiki-DB
Jump to navigation Jump to search

How to build U-Boot

Get sources from Github

1. Start the Console on Linux
2. git clone https://github.com/dh-electronics/u-boot-stm32mp1.git --branch dev/2021.01_dhsom
3. cd u-boot-stm32mp1

Configure and build the Device Tree + Kernel

4. ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make stm32mp15_dhcom_basic_defconfig
5. ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make -j`nproc`

U-boot console commands

loady - serial load command

SPI Flash Init
loady [addr [baud]]
Description:
The loady command is used to transfer a file to the device via the serial line using the YMODEM protocol.
The number of transferred bytes is saved in environment variable filesize.
addr = load address, defaults to environment variable loadaddr or if loadaddr is not set to configuration variable CONFIG_SYS_LOAD_ADDR
baud = baud rate for the ymodem transmission. After the transmission the baud rate is reset to the original value.
Example:
In the example below the terminal emulation program picocom was used to transfer a file to the device.
After entering the loady command the key sequence <CTRL-A><CTRL-S> is used to let picocom prompt for the file name. Picocom invokes the program sz for the file transfer.
How to start picocom on your PC: picocom --baud 115200 /dev/ttyUSB0
How to exit picocom on your PC: Entering the key sequence <CTRL-A><CTRL-X>
STM32MP> loady $loadaddr 115200
## Ready for binary (ymodem) download to 0xC2000000 at 115200 bps...
CC
*** file: Test_3444bytes.bin
$ sz -vv Test_3444bytes.bin
Sending: Test_3444bytes.bin
Bytes Sent:   3456   BPS:467                             
Sending: 
Ymodem sectors/kbytes sent:   0/ 0k
Transfer complete
*** exit status: 0
## Total Size      = 0x00000d74 = 3444 Bytes
STM32MP>