cancel
Showing results for 
Search instead for 
Did you mean: 

Cube MX + ecosystem 5 + custom stm32mp153 board results in missing dtb needed for optee build

LinuxAddict
Associate II

Hi all.

I'm working through the lab material for the STM32MP1 workshop and have run into a snag after following the "extra hands on" presentation "Lab-MP15_FromPartNumber_To_BasicDeviceTree_with_CubeMx.pdf". My high level goal is to get binaries (TF-A, FIP) to enable production eMMC programming via USB DFU.

While we've got working eMMC images produced by buildroot (based on an earlier version of the ecosystem) we've discovered that the versions of the boot chain we're using don't support USB DFU (specifically TF-A).

To remedy I've gone through the lab materials and Cube MX for ecosystem 5 along with modifications for our custom board and have the resulting input DTS files for building the boot chain binaries:

├── kernel
│   └── stm32mp153c-som-dfu-mx.dts
├── optee-os
│   └── stm32mp153c-som-dfu-mx.dts
├── tf-a
│   ├── stm32mp15-mx.dtsi
│   ├── stm32mp153c-som-dfu-mx-fw-config.dts
│   └── stm32mp153c-som-dfu-mx.dts
└── u-boot
    ├── stm32mp153c-som-dfu-mx-u-boot.dtsi
    └── stm32mp153c-som-dfu-mx.dts

 

I've muddled my way through building TF-A with the following make command:

$ make -f $PWD/../Makefile.sdk TF_A_CONFIG="usb" TF_A_DEVICETREE=stm32mp153c-som-dfu-mx all

This results in a binary that I can load up with via USB DFU which boots up to the point where optee loads and then fails during execution as its built-in DTB does not match our custom board (I'm starting with DK2 binaries and replacing them as I go).

 

Next I try building optee:

$ CFG_STM32MP_PROFILE=system_services CFG_DRAM_SIZE=0x20000000 make -f $PWD/../Makefile.sdk CFG_EMBED_DTB_SOURCE_FILE=stm32mp153c-som-dfu-mx all

This builds fine until fiptool is called:

FIP_DEPLOYDIR_OPTEE=/home/user/<snip>/sources/optee-os-stm32mp-3.19.0-stm32mp-r1-r0/optee-os-stm32mp-3.19.0-stm32mp-r1/../deploy FIP_DEVICETREE="stm32mp153c-som-dfu-mx" FIP_CONFIG="optee" FIP_BL32_CONF="optee" fiptool-stm32mp

fiptool-stm32mp config:
optee:
bl32 config value: optee
devicetree config: stm32mp153c-som-dfu-mx

Switch configuration:
FIP_BL31_ENABLE :

Output folders:
FIP_DEPLOYDIR_ROOT :
FIP_DEPLOYDIR_FIP : /fip
FIP_DEPLOYDIR_TFA : /arm-trusted-firmware/bl32
FIP_DEPLOYDIR_BL31 : /arm-trusted-firmware/bl31
FIP_DEPLOYDIR_FWCONF: /arm-trusted-firmware/fwconfig
FIP_DEPLOYDIR_OPTEE : /home/user/<snip>/sources/optee-os-stm32mp-3.19.0-stm32mp-r1-r0/optee-os-stm32mp-3.19.0-stm32mp-r1/../deploy
FIP_DEPLOYDIR_UBOOT : /u-boot

Missing stm32mp153c-som-dfu-mx-fw-config-optee.dtb file in folder: $FIP_DEPLOYDIR_FWCONF or '$FIP_DEPLOYDIR_ROOT/arm-trusted-firmware/fwconfig'

This DTB is nowhere to be found in the source code tree. How is it to be made? I'm assuming I've skipped a step or two.

 

1 ACCEPTED SOLUTION

Accepted Solutions
LinuxAddict
Associate II

Erwan,

Thank you for the quick response. I think I'm moving again.

For others that might be in the same boat I had to pass the optee configuration target (in addition to usb) to Makefile.sdk when compiling TF-A:

$ make -f $PWD/../Makefile.sdk TF_A_CONFIG="usb" TF_A_DEVICETREE=stm32mp153c-som-dfu-mx all

becomes:

$ make -f $PWD/../Makefile.sdk TF_A_CONFIG="usb optee" TF_A_DEVICETREE="stm32mp153c-som-dfu-mx" all

This produces the needed stm32mp153c-som-dfu-fw-config-optee.dtb in the TF-A deploy directory. Hopefully it is correctly formed as well as correctly named.

Thanks,

_LinuxAddict_

View solution in original post

3 REPLIES 3
Erwan SZYMANSKI
ST Employee

Hello @LinuxAddict ,
As explained in the FIP information here : https://wiki.st.com/stm32mpu/wiki/How_to_configure_TF-A_FIP#STM32MP1_series, the FW config dtb is a one located and compiled in TF-A. 

Maybe there is an error in the file name Makefile.sdk is looking for. In TF-A sources, can you find your FW config DTB built somewhere ? (probably in ftds folder).

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.
LinuxAddict
Associate II

Erwan,

Thank you for the quick response. I think I'm moving again.

For others that might be in the same boat I had to pass the optee configuration target (in addition to usb) to Makefile.sdk when compiling TF-A:

$ make -f $PWD/../Makefile.sdk TF_A_CONFIG="usb" TF_A_DEVICETREE=stm32mp153c-som-dfu-mx all

becomes:

$ make -f $PWD/../Makefile.sdk TF_A_CONFIG="usb optee" TF_A_DEVICETREE="stm32mp153c-som-dfu-mx" all

This produces the needed stm32mp153c-som-dfu-fw-config-optee.dtb in the TF-A deploy directory. Hopefully it is correctly formed as well as correctly named.

Thanks,

_LinuxAddict_

@LinuxAddict ,
Thank you for your precious sharing to the community.

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.