cancel
Showing results for 
Search instead for 
Did you mean: 

STM32157f-dk2 getting started not working for compile and flashing kernel

SScar.2
Senior

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Erwan SZYMANSKI
ST Employee

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:

  • PC$> ./create_sdcard_from_flashlayout.sh ../flashlayout_st-image-weston/trusted/FlashLayout_sdcard_stm32mp157f-dk2-trusted.tsv

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

6 REPLIES 6
Erwan SZYMANSKI
ST Employee

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:

  • Follow starter package from OSTL-4.0 and generate a new clean SD card with right versions of TF-A and U-boot
  • Try to launch your board with it and confirms that it works well.
  • Now you can begin to work with the kernel with following the steps described in the Developer package article, and more precisely the steps for Kernel if this is what you want to change. Please to compile and deploy it on your target, do not forget to well follow the README.HOW_TO.txt.
  • By the way, double check that your SDK version is the good one, that matches with yout OSTL4.0 version.

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'

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
SScar.2
Senior

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

SScar.2
Senior

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

Erwan SZYMANSKI
ST Employee

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:

  • PC$> ./create_sdcard_from_flashlayout.sh ../flashlayout_st-image-weston/trusted/FlashLayout_sdcard_stm32mp157f-dk2-trusted.tsv

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

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

@SScar.2​ ,

I am glad to see that you could have solved your issue.

Thanks again for your feedback.

Kind regards,

Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.