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?

1 ACCEPTED SOLUTION

Accepted Solutions
Kevin HUBER
ST Employee

Hello @Arnas Celkys​ 

Regarding the end of you question, it seems that you do not have the U-Boot sources in your developer package.

Anyway, I will help you ;).

Download Developer Package and U-Boot sources

The first step to be able to modify the configuration of U-Boot, is to get the Developer package. Please follow this page: https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package

The part related to the install of U-Boot is: https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package#Installing_the_U-Boot

Follow the steps and untar the sources.

Build U-Boot

Once you got the sources, you have to go in the extracted folder and follow the “README_HOWTO.txt�? to build the sources.

Modify configuration and enable DDR_INTERACTIVE

Firstly, to modify the configuration you have to use in the U-Boot folder, the command “make menuconfig�? as explained on the wiki: https://wiki.st.com/stm32mpu/wiki/Menuconfig_or_how_to_configure_kernel

CONFIG_STM32MP1_DDR_INTERACTIVE is not the easiest configuration to enable because it implies to have already enabled other configurations.

The first things to do is search “DDR_INTERACTIVE�?. To realize a search in the menuconfig, you have to hit “/�? key and type the text that you search.

A window like this appears:

0693W00000HoWvWQAV.png 

As you can see, “STM32MP1_DDR�? is set to [=n] because you have to enable “STM32MP1_DDR�? before being able to enable DDR_INTERACTIVE.

So search “STM32MP1_DDR�? .

0693W00000HoWwyQAF.pngYou see that you have to enable "OF_CONTROL" and "ARCH_STM32MP" before enabling your configuration

So one more search, search for “OF_CONTROL�?

0693W00000HoWxNQAV.png 

You can hit the key “1�? to directly go where the config is located or you can search it inside "-> Device Tree Control"

Enable the configuration. 

0693W00000HoWxwQAF.png 

Then to enable "ARCH_STM32MP", you have to change the architecture type from Sandbox to ARM.

This can be done at the root of the menu:

0693W00000HoWyQQAV.png 

Select ARM architecture in the list.

0693W00000HoWypQAF.png 

Now, a new menu appears “ARM Architecture�?. Go inside and looks at “Target select�?.

0693W00000HoX0HQAV.png Modify it to select “Support STMicroelectonics STM32MP Socs with cortex A�?

0693W00000HoX0RQAV.png 

Finally, you can search again “DDR_INTERACTIVE�? and you will see that you enabled the needed “STM32MP1_DDR�? !

0693W00000HoX1KQAV.pngHit the key “1�? to go directly in the correct submenu or go in:

Location:                                                                               │ 

 │    -> Device Drivers                                                                     │ 

    │      -> STM32MP1 DDR driver (STM32MP1_DDR [=y]) 

And enable it.

0693W00000HoX1ZQAV.png 

The CONFIG_STM32MP1_DDR_INTERACTIVE configuration is now activated.

Be careful to save your modifications.

You can now rebuild the U-Boot sources with these configurations enabled, by following the "README.HOW_TO.txt".

BUT doesn't apply again the default configuration by doing: make stm32mp15_<config>_defconfig

Otherwise you will lose your modifications.

Hope it helps you,

Regards,

Kevin

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.

View solution in original post

21 REPLIES 21
Kevin HUBER
ST Employee

Hello @Arnas Celkys​ 

Regarding the end of you question, it seems that you do not have the U-Boot sources in your developer package.

Anyway, I will help you ;).

Download Developer Package and U-Boot sources

The first step to be able to modify the configuration of U-Boot, is to get the Developer package. Please follow this page: https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package

The part related to the install of U-Boot is: https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package#Installing_the_U-Boot

Follow the steps and untar the sources.

Build U-Boot

Once you got the sources, you have to go in the extracted folder and follow the “README_HOWTO.txt�? to build the sources.

Modify configuration and enable DDR_INTERACTIVE

Firstly, to modify the configuration you have to use in the U-Boot folder, the command “make menuconfig�? as explained on the wiki: https://wiki.st.com/stm32mpu/wiki/Menuconfig_or_how_to_configure_kernel

CONFIG_STM32MP1_DDR_INTERACTIVE is not the easiest configuration to enable because it implies to have already enabled other configurations.

The first things to do is search “DDR_INTERACTIVE�?. To realize a search in the menuconfig, you have to hit “/�? key and type the text that you search.

A window like this appears:

0693W00000HoWvWQAV.png 

As you can see, “STM32MP1_DDR�? is set to [=n] because you have to enable “STM32MP1_DDR�? before being able to enable DDR_INTERACTIVE.

So search “STM32MP1_DDR�? .

0693W00000HoWwyQAF.pngYou see that you have to enable "OF_CONTROL" and "ARCH_STM32MP" before enabling your configuration

So one more search, search for “OF_CONTROL�?

0693W00000HoWxNQAV.png 

You can hit the key “1�? to directly go where the config is located or you can search it inside "-> Device Tree Control"

Enable the configuration. 

0693W00000HoWxwQAF.png 

Then to enable "ARCH_STM32MP", you have to change the architecture type from Sandbox to ARM.

This can be done at the root of the menu:

0693W00000HoWyQQAV.png 

Select ARM architecture in the list.

0693W00000HoWypQAF.png 

Now, a new menu appears “ARM Architecture�?. Go inside and looks at “Target select�?.

0693W00000HoX0HQAV.png Modify it to select “Support STMicroelectonics STM32MP Socs with cortex A�?

0693W00000HoX0RQAV.png 

Finally, you can search again “DDR_INTERACTIVE�? and you will see that you enabled the needed “STM32MP1_DDR�? !

0693W00000HoX1KQAV.pngHit the key “1�? to go directly in the correct submenu or go in:

Location:                                                                               │ 

 │    -> Device Drivers                                                                     │ 

    │      -> STM32MP1 DDR driver (STM32MP1_DDR [=y]) 

And enable it.

0693W00000HoX1ZQAV.png 

The CONFIG_STM32MP1_DDR_INTERACTIVE configuration is now activated.

Be careful to save your modifications.

You can now rebuild the U-Boot sources with these configurations enabled, by following the "README.HOW_TO.txt".

BUT doesn't apply again the default configuration by doing: make stm32mp15_<config>_defconfig

Otherwise you will lose your modifications.

Hope it helps you,

Regards,

Kevin

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.
Error while parsing Rich Text Content

Good afternoon, Kevin, - great answer finally got idea on how that "make menuconfig" works, thanks! :D

1. I have made changes to u-boot and menuconfig looks like this now:


_legacyfs_online_stmicro_images_0693W00000HoY08.png2.I have created a custom ***.config file and named it RAMTEST.config and followed the readme.txt

$ make RAMTEST.config

$ make DEVICE_TREE=stm32mp157c-dk2 all

Is this correct so far ? :?

Hi @Arnas Celkys​ ,

Great news!

How did you proceed to save your configuration in a RAMTEST.config?

Did you followed the chapter about savedefconfig? :https://wiki.st.com/stm32mpu/wiki/Menuconfig_or_how_to_configure_kernel#Menuconfig_and_Developer_Package

To be sure that "STM32MP1_DDR_INTERACTIVE" is enabled, before doing the "make DEVICE_TREE=stm32mp157c-dk2 all", you can open the file".config", in the U-Boot folder root and search the value of STM32MP1_DDR_INTERACTIVE .

It must be set to =Y

This file summarize all the configurations currently set that will be used during the build with the command "make DEVICE_TREE=stm32mp157c-dk2 all"

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.

I just saved new file with the menuconfig UI at the bottom <Save>, and after opened created file RAMTEST.config with <Load>. And checked the values. Is this reasonable approach?

0693W00000HoYYFQA3.pngso after making the configuration changes, I tried to follow the "README_HOW_TO.txt" - 5.2 Compilation for several targets: use Makefile.sdk (with FIP). But ran into some issues when trying to create an image with "make -f $PWD/../Makefile.sdk all"

>>make -f $PWD/../Makefile.sdk help

<< /../

>>export FIP_DEPLOYDIR_ROOT=$PWD/../../FIP_artifacts

<</../

>>make -f $PWD/../Makefile.sdk help

>>/../

Missing u-boot-stm32mp157a-dk1-trusted.dtb file in folder: '$FIP_DEPLOYDIR_UBOOT' or '$FIP_DEPLOYDIR_ROOT/u-boot'

/stm32mpu_workspace/kernel_my/en.SOURCES-stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/sources/arm-ostl-linux-gnueabi/u-boot-stm32mp-2020.10.r1-r0/u-boot-stm32mp-2020.10.r1/../Makefile.sdk:136: recipe for target 'fip' failed

make: *** [fip] Error 1

0693W00000HoYe8QAF.png0693W00000HoYemQAF.pngecho $FIP_DEPLOYDIR_ROOT/u-boot

/stm32mpu_workspace/kernel_my/en.SOURCES-stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/sources/arm-ostl-linux-gnueabi/u-boot-stm32mp-2020.10.r1-r0/u-boot-stm32mp-2020.10.r1/../../FIP_artifacts/u-boot

/stm32mpu_workspace/kernel_my/en.SOURCES-stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/sources/arm-ostl-linux-gnueabi/FIP_artifacts/u-boot$ ls

u-boot-nodtb-stm32mp15.bin     u-boot-stm32mp157d-dk1-trusted.dtb

u-boot-stm32mp157a-dk1-trusted.dtb u-boot-stm32mp157d-ev1-trusted.dtb

u-boot-stm32mp157a-ev1-trusted.dtb u-boot-stm32mp157f-dk2-trusted.dtb

u-boot-stm32mp157c-dk2-trusted.dtb u-boot-stm32mp157f-ed1-trusted.dtb

u-boot-stm32mp157c-ed1-trusted.dtb u-boot-stm32mp157f-ev1-trusted.dtb

u-boot-stm32mp157c-ev1-trusted.dtb

$FIP_DEPLOYDIR_UBOOT - is empty

did i miss something? :D

Hi @Arnas Celkys​ ,

The recommanded way to generate the FIP is to create it automatically when you build your TF-A, please have a look to the README.HOW_TO.txt of the TF-A.

Please install it and build it by following this page if you do not have it yet: https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package#Installing_the_TF-A

To learn more things about the FIP, you can read the ecosystem release note: https://wiki.st.com/stm32mpu/wiki/STM32MP15_ecosystem_release_note_-_v3.0.0#OpenSTLinux_-28Cortex-C2-AE-A7-29

or this part of the TF-A overview: https://wiki.st.com/stm32mpu/wiki/TF-A_overview#FIP

Regarding U-Boot

Since the ecosystem v3.0.0, two binaries are needed from u-boot:

https://wiki.st.com/stm32mpu/wiki/U-Boot_overview#Output_files

u-boot.dtb and u-boot-nodtb.bin

I recommand you to build with a command line like this: make -f $PWD/../Makefile.sdk DEVICE_TREE=stm32mp157c-dk2 uboot

u-boot instead of all in last parameter, to only generate u-boot binaries.

For what I know, you have too manually copy them from your U-Boot build directory to the FIP directory (FIP_artifacts/u-boot).

But before doing the copy I recommend you to rename the file u-boot-nodtb-stm32mp15.bin and u-boot-stm32mp157c-dk2-trusted.dtb to keep a copy of them.

The files that need to be copied from your build directory to the FIP directory are:

u-boot-nodtb.bin -> u-boot-nodtb-stm32mp15.bin

arch/arm/dts/<your-board-file>.dtb -> u-boot-stm32mp157c-dk2-trusted.dtb

Once you have copied the U-Boot files in the FIP directory, you will be able to generate the FIP when you build your TF-A.

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.

Thank you. Kevin, its a great help! :)

I have cleaned the project and started all over using the TF-A. And I believe i managed to build FIP according to my changes. My mistake was that when following README.HOW_TO.txt i was following "5.1 Compilation for one target (one defconfig, one device tree) - and no FIP" when I should have been using the "5.2 Compilation for several targets: use Makefile.sdk (with FIP)" because I have TF-A installed - atleast my this is my guess :D


_legacyfs_online_stmicro_images_0693W00000HogFV.pngso now I have successfully have generated all versions of ***.bin and ***.dtb (example: u-boot-stm32mp157c-dk2-trusted.dtb and fip-stm32mp157c-dk2-trusted.bin) files according to "myboot.config" content. Atleast I am guessing they follow my config file - no way to know untill I upload them right?

What should be the next step now, how should i upload them them now? Thanks! :)

Hi @Arnas Celkys​ ,

Yes it seems ok now, but next time, you can specify the TF_A_DEVICETREE to only generate the needed fip for your board.

I advise you to follow the How to cross-compile with the Developer Package wiki page and especially the parts on U-Boot and TF-A. It is explained how to copy the binaries on the board using ums 0 mmc 0:

https://wiki.st.com/stm32mpu/wiki/How_to_cross-compile_with_the_Developer_Package#Modifying_the_U-Boot

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.