DHCOM STM32MP1 Bootloader U-Boot: Difference between revisions

From Wiki-DB
Jump to navigationJump to search
Ageisreiter (talk | contribs)
No edit summary
Ageisreiter (talk | contribs)
 
(3 intermediate revisions by the same user not shown)
Line 6: Line 6:
|
|
1. Start the Console on Linux<br/>
1. Start the Console on Linux<br/>
2. <tt>''git clone https://github.com/dh-electronics/u-boot-stm32mp1.git --branch dev/2021.01_dhsom''</tt><br/>
2. <tt>''git clone https://github.com/dh-electronics/u-boot-stm32mp1.git --branch <<branche-name>>''</tt><br/>
3. <tt>''cd u-boot-stm32mp1''</tt>
3. <tt>''cd u-boot-stm32mp1''</tt>
|}
|}
Line 14: Line 14:
4. <tt>''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''</tt><br/>
4. <tt>''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''</tt><br/>
5. <tt>''ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make -j`nproc`</tt>
5. <tt>''ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- make -j`nproc`</tt>
|}
|}
|}


==U-boot console commands==
==U-boot console commands==
=== SPI Flash ===
=== loady - serial load command ===


:'''SPI Flash Init'''
:'''SPI Flash Init'''


:{| 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.
:Description: Initializes the OnBoard SPI Flash
: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.


:'''SPI Flash Read'''
: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>


:{| class="wikitable"
STM32MP> loady $loadaddr 115200
|''<code>sf read <SDRAM address> <SPI Flash address> <Bytes></code>''
## 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>

Latest revision as of 13:17, 28 November 2022

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 <<branche-name>>
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>