2021-12-14 12:36 AM
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?
Solved! Go to Solution.
2021-12-14 02:46 AM
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:
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�? .
You see that you have to enable "OF_CONTROL" and "ARCH_STM32MP" before enabling your configuration
So one more search, search for “OF_CONTROL�?
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.
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:
Select ARM architecture in the list.
Now, a new menu appears “ARM Architecture�?. Go inside and looks at “Target select�?.
Modify it to select “Support STMicroelectonics STM32MP Socs with cortex A�?
Finally, you can search again “DDR_INTERACTIVE�? and you will see that you enabled the needed “STM32MP1_DDR�? !
Hit 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.
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'
2021-12-14 02:46 AM
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:
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�? .
You see that you have to enable "OF_CONTROL" and "ARCH_STM32MP" before enabling your configuration
So one more search, search for “OF_CONTROL�?
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.
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:
Select ARM architecture in the list.
Now, a new menu appears “ARM Architecture�?. Go inside and looks at “Target select�?.
Modify it to select “Support STMicroelectonics STM32MP Socs with cortex A�?
Finally, you can search again “DDR_INTERACTIVE�? and you will see that you enabled the needed “STM32MP1_DDR�? !
Hit 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.
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'
2021-12-14 04:04 AM
2021-12-14 04:05 AM - edited 2023-11-20 09:04 AM
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:
2.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 ? :?
2021-12-14 04:49 AM
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
2021-12-14 05:29 AM
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?
so 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
echo $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
2021-12-14 08:07 AM
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
2021-12-15 01:05 AM
Thank you. Kevin, its a great help! :)
2021-12-15 02:55 AM - edited 2023-11-20 09:04 AM
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
so 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! :)
2021-12-15 03:17 AM
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:
Regards,
Kevin