cancel
Showing results for 
Search instead for 
Did you mean: 

TF-A Device Tree Comparison DK2 versus Custom Target based on DK2

JKell.6
Associate III

I'm having trouble getting TF-A to start from USB DFU using the STM32Programmer CLI. Here's what I get:

$ ./xpro_uboot_prgm.sh
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.11.0                  
      -------------------------------------------------------------------
 
 
 
Warning: Timeout is forced to 30000 ms
 
 
USB speed   : High Speed (480MBit/s)
Manuf. ID   : STMicroelectronics
Product ID  : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
SN          : 003B00403431510930393938
DFU protocol: 1.1
Board       : --
Device ID   : 0x0500
Device name : STM32MP1
Device type : MPU
Revision ID : --  
Device CPU  : Cortex-A7
 
Start Embedded Flashing service
 
 
 
Memory Programming ...
Opening and parsing file: tf-a-stm32mp153a-xpro-mp1-mx-usb.stm32
  File          : tf-a-stm32mp153a-xpro-mp1-mx-usb.stm32
  Size          : 220.38 KB 
  Partition ID  : 0x01 
 
Download in Progress:
[==================================================] 100% 
 
File download complete
Time elapsed during download operation: 00:00:02.309
 
RUNNING Program ... 
  PartID:      :0x01 
 
 
Error: Start operation failed at partition 0x01
Error: TSV flashing service failed

My assumption is my device tree is not correct and TF-A won't run. I've compared my device tree with TF-A for DK2 and there's a world of difference. I actually can't believe the DK2 device actually works its so short and missing things my tree seems to require (e.g. &pwr_regulators). Attached are the two DTS's.

I found these two wiki links but cannot access them yet. I'm hoping one of these will help me properly define my device tree.

This article below is a guideline to get an initial TF-A device tree from CubeMx and ST reference device tree files.

https://wiki.st.com/stm32mpu/wiki/How_to_create_your_board_device_tree#In_STM32STM32CubeMX 

Find further information about device tree HSE pin configuration depending on the choice of Crystal/resonator or Oscillator clock source  https://wiki.st.com/stm32mpu/wiki/Clock_device_tree_configuration_-_Bootloader_specific#DT_configuration_for_HSE

1 ACCEPTED SOLUTION

Accepted Solutions
Kevin HUBER
ST Employee

Hello @Community member​ ,

You can't compare your file generated by CubeMX with the DT of the DK2, just like this.

As you can see at the beginning of each dts file, there are some include done.

And for the "stm32mp157f-dk2.dts", the main file that is included is:

#include "stm32mp15xx-dkx.dtsi"

Where you can find way more node and especially the "pwr_regulator" one.

You can find more information about the structure of the device tree on the wiki:

https://wiki.st.com/stm32mpu/wiki/STM32_MPU_device_tree#Device_tree_structure

In general to make comparison between two DTs, you have to compare the DTB file directly and not the dts.

DTB file is the final configuration that is present inside the binary.

To compare them you can use the command "dtc" to uncompile the dtb file:

dtc [your_dtb_file] > [output_file_with_result_to_compare]
 
for example with
dtc stm32mp157f-dk2.dtb > extract-stm32mp157f-dk2.dtb

Then you will be able to compare your file with the one from dk2 more easily.

Hope it helps you,

Best 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.

View solution in original post

3 REPLIES 3
PatrickF
ST Employee

Hi @Community member​ 

Device tree structures are quite different between the ones provided inside OpenSTLinux packages and the one generated by CubeMx. Comparison is not straightforward.

See https://wiki.st.com/stm32mpu/wiki/STM32_MPU_device_tree

Regarding HSE, the second wiki page you are looking for does not exist anymore and your should use https://github.com/STMicroelectronics/arm-trusted-firmware/blob/v2.6-stm32mp/docs/devicetree/bindings/clock/st,stm32mp1-rcc.txt#L259

Regarding your particular issue, maybe worth to look at board console output if more useful messages appears.

We recommend to read the following to exclude classic pitfalls : https://community.st.com/s/article/FAQ-STM32MP1-Bring-up-procedure

Regards,

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.
Kevin HUBER
ST Employee

Hello @Community member​ ,

You can't compare your file generated by CubeMX with the DT of the DK2, just like this.

As you can see at the beginning of each dts file, there are some include done.

And for the "stm32mp157f-dk2.dts", the main file that is included is:

#include "stm32mp15xx-dkx.dtsi"

Where you can find way more node and especially the "pwr_regulator" one.

You can find more information about the structure of the device tree on the wiki:

https://wiki.st.com/stm32mpu/wiki/STM32_MPU_device_tree#Device_tree_structure

In general to make comparison between two DTs, you have to compare the DTB file directly and not the dts.

DTB file is the final configuration that is present inside the binary.

To compare them you can use the command "dtc" to uncompile the dtb file:

dtc [your_dtb_file] > [output_file_with_result_to_compare]
 
for example with
dtc stm32mp157f-dk2.dtb > extract-stm32mp157f-dk2.dtb

Then you will be able to compare your file with the one from dk2 more easily.

Hope it helps you,

Best 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.
JKell.6
Associate III

Thanks Patrick and Kevin for your feedback. I'll look at these things and see I can figure out what's missing. So early in the TF-A stage I'd be surprised if there's any device console output but hey I'll give it a try. Will provide response once I get further along in this.