cancel
Showing results for 
Search instead for 
Did you mean: 

How to enter DDR interactive mode by defining CONFIG_STM32MP1_DDR_INTERACTIVE ?

Arnas Celkys
Associate II

I am using stm32MP157F-DK eval board (on windows) and I would like to try the DDR testing tool on cubeMX. But this is my first time trying to do so - I try to follow steps in "U-Boot SPL: DDR interactive mode" (url: https://wiki.st.com/stm32mpu/wiki/U-Boot_SPL:_DDR_int). It states i should define this mode under CONFIG_STM32MP1_DDR_INTERACTIVE - but I dont understand when or how should I do that? Should this be done on full flashlayout_st-image-*** or should i just have boot running?

21 REPLIES 21

Is there any alternatives to upload boot other than USB OTG? - it is a bit tricky when using linux on VM, is there any way to upload the .bin and .dtb. files over ethernet for example?

I also tried opening the SD card directlly on linux but the FIP storage does not appear:

****************solved by switching to dedicated Hw rather than using VM***********************

0693W00000HoiDgQAJ.png

Kevin HUBER
ST Employee

Hello @Arnas Celkys​  ,

I just saw that I provided you the complete procedure to activate the DDR_INTERACTIVE mode for the U-Boot, but I'm sorry because there was an easiest way as explained on the U-Boot SPL page:

https://wiki.st.com/stm32mpu/wiki/U-Boot_SPL:_DDR_interactive_mode#DDR_interactive_mode

It is possible to compile to force DDR_INTERACTIVE mode by adding DDR_INTERACTIVE=1 in the make option.

So you just have to add DDR_INTERACTIVE=1 in your make command line.

The option will be handled by the makefile : drivers/ram/stm32mp1/Makefile

That will force the activation of : CONFIG_STM32MP1_DDR_INTERACTIVE_FORCE

FIP

Regarding FIP, it is normal that you do not have FIP partition because you are using a partition scheme to use an U-Boot SPL.

I forgot that point during the previous answers.

So I explained you how to generate an image with a FIP package which is the normal way to use the environment v3.1.0, but it was not related to your main question.

DDR INTERACTIVE for U-Boot SPL

To answer your main question, the only thing that you need to do to build your U-Boot SPL with DDR_INTERACTIVE is explained in the chapter 5 of this page (you must expand the chapter that is not displayed by default): https://wiki.st.com/stm32mpu/wiki/STM32MP15_U-Boot#SPL_compilation

You have to use the basic config and not the trusted one:

PC $> make stm32mp15_basic_defconfig

and add the DDR_INTERACTIVE option in the make command:

PC $> make DEVICE_TREE=stm32mp157c-dk2 DDR_INTERACTIVE=1 all

And that's all!

You obtain your two files:

  • u-boot-spl.stm32 : FSBL = SPL binary with STM32 image header, loaded by ROM code
  • u-boot.img : SSBL = U-Boot binary with U-Boot image header (uImage), loaded by SPL

I'm sorry for all the other answers that were not really related to your main question, but at least, I hope that you learnt things about "make menuconfig" and "FIP package".

Hope it helps you,

Regards,

Kevin

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.

It was brilliant tutorial and glad I had opportunity to learn about  "make menuconfig" and "FIP package" it it's very valuable knowledge! Thank you! :)

Ok so now i have these files in my:<..>/sources/arm-ostl-linux-gnueabi/u-boot-stm32mp-v2020.10-stm32mp-r2-r0/build/stm32mp15_basic_defconfig/u-boot.img and

<..>/sources/arm-ostl-linux-gnueabi/u-boot-stm32mp-v2020.10-stm32mp-r2-r0/build/stm32mp15_basic_defconfig/u-boot-spl.stm32. They are re-generated either using make "menuconfig" or just "make <board branch>". Now I have to upload them to the board and I will be able to access the "DDR mode" - and use the DDR test tools provided by ST. What alternatives of upload do I have? Is it only possible to see the FIP - directory by using the USB OTG connection - it is a bit problematic when using VM.... :?

I have tried "How to populate the SD card with dd command" (url: https://wiki.st.com/stm32mpu/wiki/How_to_populate_the_SD_card_with_dd_command). But this requires the Distribution Package. Then I have followed the "https://wiki.st.com/stm32mpu/wiki/STM32MP1_Distribution_Package" to get the distribution package and got the following error to repo init ****. :

repo init -u https://github.com/STMicroelectronics/oe-manifest.git -b refs/tags/openstlinux-5.10-dunfell-mp1-21-11-17

 File "/stm32mpu_workspace/ecosys-3.0/Distribution-Pack/openstlinux-5.10-dunfell-mp1-21-11-17/.repo/repo/main.py", line 79

  file=sys.stderr)

    ^

SyntaxError: invalid syntax

0693W00000Hopv1QAB.pngso feels like I am in some deep rabbit hole :grinning_face_with_sweat:

Hello @Arnas Celkys​ ,

Thank you for your comprehension :)

No need to get the Distribution Package right now. The Distribution Package is a package that can be used when you want to generate your own linux and filesystem.

It is too advanced for what you want to do.

There is two possible ways to write the two binaries in your board https://wiki.st.com/stm32mpu/wiki/U-Boot_SPL:_DDR_interactive_mode#Boot_from_SD_card:

First option - Mass Storage via U-Boot

I don't understand why you are saying that it is problematic or a bit tricky with the VM. I always write the binaries like this, using the VM. Normally it is the easiest way.

You have to stop u-boot during the boot by hitting a key, then you use the command:

ums 0 mmc 0

Then as explained in my previous comment, the file u-boot-spl.stm32 is the FSBL. So you copy the file with DD in the two fsbl partitions:

dd if=u-boot-spl.stm32 of=/dev/sdb1 bs=1M conv=fdatasync

and

dd if=u-boot-spl.stm32 of=/dev/sdb2 bs=1M conv=fdatasync

Then you must copy the u-boot.img in the SSBL partition:

dd if=u-boot.img of=/dev/sdb3 bs=1M conv=fdatasync

Then on the board, to synchronize the memory and the storage, you can run:

sync

and reboot your board.

Second option - Use CubeProgrammer with a custom tsv

Explained in the wiki page: https://wiki.st.com/stm32mpu/wiki/U-Boot_SPL:_DDR_interactive_mode#Writing_SPL_in_SDMMC_with_STM32CubeProgrammer

You must make a custom_flashlayout.tsv that looks like:

#Option	Id	Name	Type	Device	Offset		Binary
P	0x01	fsbl1	Binary	SDMMC1	0x00004400	spl/u-boot-spl.stm32
PE	0x02	fsbl2	Binary	SDMMC1	0x00044400	none
P	0x03	ssbl	Binary	SDMMC1	0x00084400	u-boot.img.bin

To understand the flashlayout please read the layout wiki page: https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer_flashlayout

Regards,

Kevin

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.

Good morning,

Well I had some issues when using VM - I am not able to access the SD card content via USB OTG. Windows do detect the SD card but i had issues accessing it (using oracle VM + ubuntu 18xx - also the issues I had previously also is related to too old ubuntu version, so I am updating it now and will see if it sortes it out). Thanks, Kevin, I will just update my ubuntu version and try again following your information - as always it's a great help for us all!, thanks !:D

Ok so perhaps you have an idea why my VM does not detect the USB OTG.

1.Reboot board and set the "ums 0 mmc 0" massstorage mode:

0693W00000Hp5ZuQAJ.png2.The masstorages (multiple) appear on windows.

0693W00000Hp5a9QAB.png3.Then I try to access the storage on my VM.

0693W00000Hp5aYQAR.png4.then i try to access it on the VM - but it does not detect the massstorage for some reason

0693W00000Hp5aiQAB.pngPerhaps any idea what is causing the issue?

I am using OracleVM.

I have tried following this to allow USB 3.0 devices input on VM:https://techsviewer.com/how-to-install-virtualbox-extension-pack-and-enable-usb-3-0/

But no luck, After selecting Devices->USB->STxxxx USB download gadget, the mass-storage device dissapears from windows but does not appear on oracle-VM. Also tested this with normal mass-storage device plugged to windows then selecting it via VM - works fine.

****************solved by switching to dedicated Hw rather than using VM***********************

ok so so I switched from VM to dedicated PC and now I have no problems accessing the board as masstorage with "ums 0 mmc 0". I can fully access the device board now. And this is what i see:

ls -l /dev/disk/by-partlabel/

total 0

lrwxrwxrwx 1 root root 10 gruod. 22 12:48 boot -> ../../sdb4

lrwxrwxrwx 1 root root 10 gruod. 21 22:55 'EFI\x20System\x20Partition' -> ../../sda1

lrwxrwxrwx 1 root root 10 gruod. 22 12:48 fsbl1 -> ../../sdb1

lrwxrwxrwx 1 root root 10 gruod. 22 12:48 fsbl2 -> ../../sdb2

lrwxrwxrwx 1 root root 10 gruod. 22 12:48 rootfs -> ../../sdb6

lrwxrwxrwx 1 root root 10 gruod. 22 12:48 ssbl -> ../../sdb3

lrwxrwxrwx 1 root root 10 gruod. 22 12:48 userfs -> ../../sdb7

lrwxrwxrwx 1 root root 10 gruod. 22 12:48 vendorfs -> ../../sdb5

Then I have moved the files to the board with:

sudo dd if=u-boot-spl.stm32 of=/dev/sdb1 bs=1M conv=fdatasync

[sudo] password for arnas:

0+1 records in

0+1 records out

139765 bytes (140 kB, 136 KiB) copied, 0,0315782 s, 4,4 MB/s

sudo dd if=u-boot-spl.stm32 of=/dev/sdb2 bs=1M conv=fdatasync

0+1 records in

0+1 records out

139765 bytes (140 kB, 136 KiB) copied, 0,0324089 s, 4,3 MB/s

sudo dd if=u-boot.img of=/dev/sdb3 bs=1M conv=fdatasync

0+1 records in

0+1 records out

978054 bytes (978 kB, 955 KiB) copied, 0,178401 s, 5,5 MB/s

After this you mentioned I MUST use the sync on board?

I reboot the board and now it does not work at all.... Any ideas what went wrong and how to fix it? :?

*************************************update**********************************************

also I have updated the starter-package, so now when i open it the massstorage looks like this:

ls -l /dev/disk/by-partlabel/

total 0

lrwxrwxrwx 1 root root 10 gruod. 22 14:48 boot -> ../../sdb4

lrwxrwxrwx 1 root root 10 gruod. 21 22:55 'EFI\x20System\x20Partition' -> ../../sda1

lrwxrwxrwx 1 root root 10 gruod. 22 14:48 fip -> ../../sdb3

lrwxrwxrwx 1 root root 10 gruod. 22 14:48 fsbl1 -> ../../sdb1

lrwxrwxrwx 1 root root 10 gruod. 22 14:48 fsbl2 -> ../../sdb2

lrwxrwxrwx 1 root root 10 gruod. 22 14:48 rootfs -> ../../sdb6

lrwxrwxrwx 1 root root 10 gruod. 22 14:48 userfs -> ../../sdb7

lrwxrwxrwx 1 root root 10 gruod. 22 14:48 vendorfs -> ../../sdb5

I repeat the update for /fsbl1 & /fsbl2 & /fip - directories and reboot the board - but again it does not boot - no data coming from serial-stlink connection.