DHCOM STM32MP1 Bootloader U-Boot: Difference between revisions

From Wiki-DB
Jump to navigationJump to search
Ageisreiter (talk | contribs)
Ageisreiter (talk | contribs)
Line 23: Line 23:


:{| class="wikitable"
:{| class="wikitable"
|''<code>sf probe</code>''
|''<code>loady [addr [baud]]</code>''
|}
|}


:Example: <code>sf probe</code>
: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.
:<code>addr</code> = load address, defaults to environment variable loadaddr or if loadaddr is not set to configuration variable CONFIG_SYS_LOAD_ADDR
:<code>baud</code> = baud rate for the ymodem transmission. After the transmission the baud rate is reset to the original value.


:Description: Initializes the OnBoard SPI Flash
: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: <code>picocom --baud 115200 /dev/ttyUSB0</code>
:How to exit picocom on your PC: Entering the key sequence <CTRL-A><CTRL-X>


:'''SPI Flash Read'''
STM32MP> loady $loadaddr 115200
 
## Ready for binary (ymodem) download to 0xC2000000 at 115200 bps...
:{| class="wikitable"
CC
|''<code>sf read <SDRAM address> <SPI Flash address> <Bytes></code>''
*** 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>

Revision as of 15:12, 3 December 2021

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>