2022-10-28 02:36 AM
Hi there,
I just received the STM32157f-dk2 discovery board, and I just started to dive into the tutorials. I am trying to simply follow the step to just cross-compile and flash the kernel image. When I complete all the steps and reboot the board, the kernel does not start
U-Boot 2018.11-stm32mp-r4 (Nov 14 2018 - 16:10:06 +0000)
CPU: STM32MP157FAC Rev.Z
Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
Board: stm32mp1 in trusted mode (st,stm32mp157c-dk2)
Board: MB1272 Var4 Rev.C-02
DRAM: 512 MiB
Clocks:
- MPU : 800 MHz
- MCU : 208.878 MHz
- AXI : 266.500 MHz
- PER : 24 MHz
- DDR : 533 MHz
NAND: 0 MiB
MMC: STM32 SDMMC2: 0, STM32 SDMMC2: 1
Loading Environment from EXT4... OK
In: serial
Out: serial
Err: serial
Net: eth0: ethernet@5800a000
Hit any key to stop autoboot: 0
Boot over mmc0!
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:4...
Found U-Boot script /boot.scr.uimg
1628 bytes read in 1 ms (1.6 MiB/s)
## Executing script at c4100000
Scanning mmc 0:4...
Found /mmc0_stm32mp157c-dk2_extlinux/extlinux.conf
Retrieving file: /mmc0_stm32mp157c-dk2_extlinux/extlinux.conf
614 bytes read in 0 ms
Retrieving file: /splash.bmp
46180 bytes read in 3 ms (14.7 MiB/s)
Select the boot mode
1: stm32mp157c-dk2-sdcard
2: stm32mp157c-dk2-a7-examples-sdcard
3: stm32mp157c-dk2-m4-examples-sdcard
Enter choice: 1: stm32mp157c-dk2-sdcard
Retrieving file: /uImage
7704384 bytes read in 349 ms (21.1 MiB/s)
append: root=/dev/mmcblk0p6 rootwait rw console=ttySTM0,115200
Retrieving file: /stm32mp157c-dk2.dtb
117969 bytes read in 7 ms (16.1 MiB/s)
## Booting kernel from Legacy Image at c2000000 ...
Image Name: Linux-5.15.24
Created: 2022-10-27 15:36:14 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 7704320 Bytes = 7.3 MiB
Load Address: c2000040
Entry Point: c2000040
Verifying Checksum ... OK
## Flattened Device Tree blob at c4000000
Booting using the fdt blob at 0xc4000000
XIP Kernel Image ... OK
Using Device Tree in place at c4000000, end c401fcd0
Starting kernel ...
it holds Starting kernel... I'm pretty sure that I followed the steps correctly (I m not totally new to Linux embedded, but still a noob btw).
Anyone knows how?
Thanks
PS: I m running Ubuntu 20.04, and set up the SDK properly.
Solved! Go to Solution.
2022-11-02 03:17 AM
Hello @SScar.2,
Thank you for your feedback, I will test it when I will be back to office next week to check if there is a possible issue.
If you want to flash the F image by another method, you can do like this (easier than using STM32 Cube Programmer).
In the Starter Package that you have downloaded, go to en.FLASH-stm32mp1-openstlinux-5.15-yocto-kirkstone-mp1-v22.06.15/stm32mp1-openstlinux-5.15-yocto-kirkstone-mp1-v22.06.15/images/stm32mp1/scripts
Then you can use the script to create your SD card:
After this operation, the logs will display something like:
###########################################################################
###########################################################################
RAW IMAGE generated: ../flashlayout_st-image-weston/trusted/../../FlashLayout_sdcard_stm32mp157f-dk2-trusted.raw
WARNING: before to use the command dd, please umount all the partitions
associated to SDCARD.
sudo umount `lsblk --list | grep mmcblk0 | grep part | gawk '{ print $7 }' | tr '\n' ' '`
To put this raw image on sdcard:
sudo dd if=../flashlayout_st-image-weston/trusted/../../FlashLayout_sdcard_stm32mp157f-dk2-trusted.raw of=/dev/mmcblk0 bs=8M conv=fdatasync status=progress
(mmcblk0 can be replaced by:
sdX if it's a device dedicated to receive the raw image
(where X can be a, b, c, d, e)
###########################################################################
###########################################################################
Follow the instruction at the end to put the flash image on your SD card of minimum 8Gb, and it should work perfectly.
Let me inform if you have any trouble.
Kind regards,
Erwan.
2022-10-28 05:25 AM
Hello @SScar.2 ,
Welcome and thank you for your contribution.
Can you confirm that you well took the starter package (TF-A + U-boot ) from OSTL4.0 ?
I see your U-Boot says "U-Boot 2018.11-stm32mp-r4" that looks quite old.
My advices are:
I hope these different steps will help you to begin with our stuff.
Kind regards,
Erwan.
In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'
2022-10-28 05:47 AM
Hi Erwan, thank you for the fast answer.
I can confirm that I downloaded all binaries from OSTL4.0. By the way, I probably got wrong the part for UBoot (also to me 2018 version seems quite old). I will follow all the steps and I let you know!
Thanks
Simone
2022-11-02 01:48 AM
Hi @Erwan SZYMANSKI , I did some tests and have news for you, with a few ISSUES as well.
I was right about the versions, I was using the OSTL4.0 correctly and you were right in saying that it was a bootloader problem.
However, I found out that the packages for the dev kit STM32MP157F-DK2 are quite broken:
Following the tutorial specifically for the board (https://wiki.stmicroelectronics.cn/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Let%27s_start/Populate_the_target_and_boot_the_image) The flash layout for the specific STM32MP157F-DK2 can't complete the flashing operation. When I try to Download the partition table in CubeProgrammer (FlashLayout_sdcard_stm32mp157f-dk2-optee.tsv), the procedure always fails. After A LOT try and error, I found out that using the images for STM32MP157C-DK2 works perfectly!
I lost a lot of hours debugging these problems and it was quite annoying.
I kindly wait for your answer, Thanks for your time
Simone
2022-11-02 03:17 AM
Hello @SScar.2,
Thank you for your feedback, I will test it when I will be back to office next week to check if there is a possible issue.
If you want to flash the F image by another method, you can do like this (easier than using STM32 Cube Programmer).
In the Starter Package that you have downloaded, go to en.FLASH-stm32mp1-openstlinux-5.15-yocto-kirkstone-mp1-v22.06.15/stm32mp1-openstlinux-5.15-yocto-kirkstone-mp1-v22.06.15/images/stm32mp1/scripts
Then you can use the script to create your SD card:
After this operation, the logs will display something like:
###########################################################################
###########################################################################
RAW IMAGE generated: ../flashlayout_st-image-weston/trusted/../../FlashLayout_sdcard_stm32mp157f-dk2-trusted.raw
WARNING: before to use the command dd, please umount all the partitions
associated to SDCARD.
sudo umount `lsblk --list | grep mmcblk0 | grep part | gawk '{ print $7 }' | tr '\n' ' '`
To put this raw image on sdcard:
sudo dd if=../flashlayout_st-image-weston/trusted/../../FlashLayout_sdcard_stm32mp157f-dk2-trusted.raw of=/dev/mmcblk0 bs=8M conv=fdatasync status=progress
(mmcblk0 can be replaced by:
sdX if it's a device dedicated to receive the raw image
(where X can be a, b, c, d, e)
###########################################################################
###########################################################################
Follow the instruction at the end to put the flash image on your SD card of minimum 8Gb, and it should work perfectly.
Let me inform if you have any trouble.
Kind regards,
Erwan.
2022-11-02 03:49 AM
Hello @Erwan SZYMANSKI ,
I can confirm that this method works fine! You (ST) should totally add it to the tutorials as a possible alternative.
Thanks again
Simone
2022-11-02 07:56 AM
@SScar.2 ,
I am glad to see that you could have solved your issue.
Thanks again for your feedback.
Kind regards,
Erwan.