cancel
Showing results for 
Search instead for 
Did you mean: 

How do i run a custom built DDR_Test_Suite (U-Boot.SPL.STM32MP157C-DK2.stm32) using CubeMX?

DOlss.1
Associate II

I am trying to verify my build environment by building the U-boot code samples to be able to run the DDR Tuning tests.

First I start CubeMX (using the ubuntu image provided on one of your workshops) and under tools i choose the DDR Test Suite and select a prebuilt "u-boot-spl.stm32-stm32mp157c-dk2-basic" file found in en.FLASH-stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31.tar_v3.0.0.xz as the DDR utilities binary file. Selecting ttyACM0 for my connection renders a sucessfull connection and enables me to run the ddr tuning tests.

Now I need to build my own DDR utilities binary file so I use "en.SOURCES-stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31.tar_v3.0.0.xz" provided on your site and find the u-boot code in u-boot-stm32mp-2020.10.r1-r0.tar.gz which I extract in place.

I initialize my Terminal by going to the folder i intend to build:

cd ~/SDK/Developer-Package/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

Initialize:

source /home/osboxes/SDK/Developer-Package/SDK/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi

Create the config:

make stm32mp15_basic_defconfig

and build:

DEVICE_TREE=stm32mp157c-dk2 DDR_INTERACTIVE=1 make

This outputs:

CFGCHK u-boot.cfg

 UPD   include/generated/timestamp_autogenerated.h

 UPD   include/generated/dt.h

 HOSTCC tools/mkenvimage.o

 HOSTLD tools/mkenvimage

 HOSTCC tools/fit_image.o

 HOSTCC tools/image-host.o

 HOSTCC tools/dumpimage.o

 HOSTLD tools/dumpimage

 HOSTCC tools/mkimage.o

 HOSTLD tools/mkimage

 CC   cmd/version.o

 LD   cmd/built-in.o

 CC   common/main.o

 LD   common/built-in.o

 CC   drivers/fastboot/fb_getvar.o

 LD   drivers/fastboot/built-in.o

 LD   drivers/built-in.o

 CC   lib/smbios.o

 CC   lib/display_options.o

 LD   lib/built-in.o

 LD   u-boot

 OBJCOPY u-boot.srec

 OBJCOPY u-boot-nodtb.bin

 SHIPPED dts/dt.dtb

 FDTGREP dts/dt-spl.dtb

 CAT   u-boot-dtb.bin

 COPY  u-boot.bin

 SYM   u-boot.sym

 CC   spl/common/spl/spl.o

 LD   spl/common/spl/built-in.o

 CC   spl/lib/display_options.o

 LD   spl/lib/built-in.o

 LD   spl/u-boot-spl

 OBJCOPY spl/u-boot-spl-nodtb.bin

 COPY  spl/u-boot-spl.dtb

 CAT   spl/u-boot-spl-dtb.bin

 COPY  spl/u-boot-spl.bin

 MKIMAGE spl/u-boot-spl.stm32

 COPY  u-boot-spl.stm32

 MKIMAGE u-boot.img

 COPY  u-boot.dtb

 MKIMAGE u-boot-dtb.img

Now I expect that, when I replace the DDR utilities binary file from the prebuilt image with the fresh built "u-boot-spl.stm32" file, that I will be able to connect to it after SYSRAM Loading using the specified uart but this is not the case.

What am I doing wrong or have I fundamentally misunderstood something?

The ultimate goal is to compile the code for stm32mp151 and use a different uart to perform DDR Tuning on a custom board.

6 REPLIES 6
Olivier GALLIEN
ST Employee

Hi @DOlss.1​ ,

In your procedure to install and build U-boot you didn't mention the step "apply patch".

Did you do it ?

Please double check the whole build procedure refering to https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package#Building_and_deploying_the_U-Boot_for_the_first_time

Else

>> The ultimate goal is to compile the code for stm32mp151 and use a different uart to perform DDR Tuning on a custom board.

Are you flashing with USB or UART. In case of UART, I had to warn you that a limitation in U-boot restrict the DDR Tuning tool to the same UART used to load.

Olivier

Olivier GALLIEN
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 think USB was intended in out project but that might change. What is the easiest way to point out which uart to use for DDR Tuning? I found the definition of serial0 pointing to uart4 but none of those balls are accessible on our board though uart7 is. My hope was to set �?serial0 = &uart7�? and it would work, maybe i am missing something for defining uart7?

Yes looks good.

Don't forget to enable uart7 in DT and set is as console.

Olivier GALLIEN
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.

How do I do that? I guess i have to edit the stm32mp157c-dk2.dtsi file?Please elaborate!

Hi @DOlss.1​ ,

Please refer to https://wiki.st.com/stm32mpu/wiki/STM32MP15_device_tree to understand the Device Tree structure.

.dtsi shoud be let as is.

Customization have to be done at board.dts level.

You can either use CubeMX to generate the DT for your custom board based on MP151 or take example on delivered DT for ST board such as "stm32mp157c-dk2.dts" to build your flavor.

In any case you should get node and properties like this :

{
	model = "STMicroelectronics STM32MP157C-DK2 Discovery Board";
	compatible = "st,stm32mp157c-dk2", "st,stm32mp157";
 
	aliases {
		serial0 = &uart7;
	};
 
	chosen {
		stdout-path = "serial0:115200n8";
	};
 
&uart7 {
...
status ="okay"
}

Hope it help,

Olivier

Olivier GALLIEN
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.
PatrickF
ST Employee

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.