Skip to main content
Senior II
June 2, 2025
Solved

STM32MP157f-DK2 How to use external power supply?

On DK2,  ADC is used to measure the voltage on cc lines, how to skip

can u give me the yocto steps to follow on commenting the following line in uBoot Device Tree:

do u have to create a new layer or can we edit the patch file in the uboot device tree and build it.

This topic has been closed for replies.
SharanBest answer
Senior II
September 19, 2025

https://wiki.st.com/stm32mpu/wiki/How_to_cross-compile_with_the_Distribution_Package                                              1)Go to the build directory

cd /home/sharan/STM32MPU/Distribution-Package/build-openstlinuxweston-stm32mp15-disco/tmp-glibc/work-shared/stm32mp15-disco/uboot-source/board/st/stm32mp1/

2)Start to work with u-boot

devtool modify u-boot-stm32mp

3)Edit the ./board/st/stm32mp1/stm32mp1.c source file
Add a log information in the checkboard function

 

4)Cross-compile the U-Boot

devtool build u-boot-stm32mp
bitbake u-boot-stm32mp -c deploy

5)if u want to modify again and the first modification                                                                                                           devtool reset u-boot-stm32mp # Wipe previous work if needed and repeat step 2 to 4                                                    

6)U-Boot are put on FIP image via TF-a fip generation

bitbake fip-stm32mp

7)Go to the directory in which the compilation results are stored

cd <build dir>/tmp-glibc/deploy/images/<machine name>/fip

8)Reboot the board, and hit any key to stop in the U-boot shell

reboot
[...]
Hit any key to stop autoboot: 0
STM32MP>

9)Connect a USB cable between the host machine and the board via the USB OTG ports

In the U-Boot shell, call the USB mass storage function

STM32MP> ums 0 mmc 0

10)Copy the binary (fip-<board name>-optee-<storage>.bin) to the dedicated partition

dd if=fip-<board name>-optee-<storage>.bin of=/dev/sdc5 bs=1M conv=fdatasync

(here fip-stm32mp157f-dk2-optee.bin for stm32mp15-disco machine)

11)Reset the U-Boot shell

STM32MP> reset

Have a look at the new U-Boot log information when the board reboots

[...]
U-Boot <U-Boot version>

CPU: STM32MP157FAC Rev.Z
Model: STMicroelectronics STM32MP157F-DK2 Discovery Board
Board: stm32mp1 in trusted mode (st,stm32mp157f-dk2)
U-Boot simple example
[...]

 

1 reply

SharanAuthorBest answer
Senior II
September 19, 2025

https://wiki.st.com/stm32mpu/wiki/How_to_cross-compile_with_the_Distribution_Package                                              1)Go to the build directory

cd /home/sharan/STM32MPU/Distribution-Package/build-openstlinuxweston-stm32mp15-disco/tmp-glibc/work-shared/stm32mp15-disco/uboot-source/board/st/stm32mp1/

2)Start to work with u-boot

devtool modify u-boot-stm32mp

3)Edit the ./board/st/stm32mp1/stm32mp1.c source file
Add a log information in the checkboard function

 

4)Cross-compile the U-Boot

devtool build u-boot-stm32mp
bitbake u-boot-stm32mp -c deploy

5)if u want to modify again and the first modification                                                                                                           devtool reset u-boot-stm32mp # Wipe previous work if needed and repeat step 2 to 4                                                    

6)U-Boot are put on FIP image via TF-a fip generation

bitbake fip-stm32mp

7)Go to the directory in which the compilation results are stored

cd <build dir>/tmp-glibc/deploy/images/<machine name>/fip

8)Reboot the board, and hit any key to stop in the U-boot shell

reboot
[...]
Hit any key to stop autoboot: 0
STM32MP>

9)Connect a USB cable between the host machine and the board via the USB OTG ports

In the U-Boot shell, call the USB mass storage function

STM32MP> ums 0 mmc 0

10)Copy the binary (fip-<board name>-optee-<storage>.bin) to the dedicated partition

dd if=fip-<board name>-optee-<storage>.bin of=/dev/sdc5 bs=1M conv=fdatasync

(here fip-stm32mp157f-dk2-optee.bin for stm32mp15-disco machine)

11)Reset the U-Boot shell

STM32MP> reset

Have a look at the new U-Boot log information when the board reboots

[...]
U-Boot <U-Boot version>

CPU: STM32MP157FAC Rev.Z
Model: STMicroelectronics STM32MP157F-DK2 Discovery Board
Board: stm32mp1 in trusted mode (st,stm32mp157f-dk2)
U-Boot simple example
[...]