2025-12-16 8:09 AM
I am trying to create custom sd card image for the stm32mp157f-dk2 board. For device tree I used dts files from basic project created by STM32CubeIDE for that board, for now I didn''t do any changes to device tree.
I used latest sources from v.25.08.27 and sdk v.25.06.11 to build kernel, modules and all required loaders.
But when I try to flash sd card with created loaders, STM32CubeProgrammer gets stuck on trying to reconnect to the board over USB connection:
10:21:44 : STM32CubeProgrammer API v2.20.0 | Linux-64Bits
10:22:15 : Read TSV File: /home/ivan/workspace/DeviceTree/FIP_artifacts_MP1/FlashLayout_sdcard_p6_mp1-optee.tsv
10:22:15 : Number of partitions: 13
10:22:28 : USB speed : High Speed (480MBit/s)
10:22:28 : Manuf. ID : STMicroelectronics
10:22:28 : Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
10:22:28 : SN : 002700353133511735343431
10:22:28 : DFU protocol: 1.1
10:22:28 : Board : --
10:22:28 : Device ID : 0x0500
10:22:29 : Start Embedded Flashing service
10:22:29 : Opening and parsing file: tf-a-stm32mp157f-p6_mp1-mx-optee-programmer-usb.stm32
10:22:29 : Memory Programming ...
10:22:29 : File : tf-a-stm32mp157f-p6_mp1-mx-optee-programmer-usb.stm32
10:22:29 : Size : 220.41 KB
10:22:29 : Partition ID : 0x01
10:22:29 : Download in Progress:
10:22:31 : File download complete
10:22:31 : Time elapsed during download operation: 00:00:02.146
10:22:31 : RUNNING Program ...
10:22:31 : PartID: :0x01
10:22:31 : Start operation done successfully at partition 0x01
10:22:31 : Opening and parsing file: fip-stm32mp157f-p6_mp1-mx-optee-programmer-usb.bin
10:22:31 : Memory Programming ...
10:22:31 : File : fip-stm32mp157f-p6_mp1-mx-optee-programmer-usb.bin
10:22:31 : Size : 1.46 MB
10:22:31 : Partition ID : 0x03
10:22:31 : Download in Progress:
10:22:34 : File download complete
10:22:34 : Time elapsed during download operation: 00:00:02.102
10:22:34 : RUNNING Program ...
10:22:34 : PartID: :0x03
10:22:34 : Reconnecting the device ...
10:23:04 : USB speed : High Speed (480MBit/s)
10:23:04 : Manuf. ID : STMicroelectronics
10:23:04 : Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
10:23:04 : SN : 002700353133511735343431
10:23:04 : DFU protocol: 1.1
10:23:04 : Board : --
10:23:04 : Device ID : 0x0500
10:23:04 : Device name :
10:23:04 : Device type :
10:23:04 : Device CPU :
10:23:04 : Start operation done successfully at partition 0x03
10:23:04 : Opening and parsing file: tf-a-stm32mp157f-p6_mp1-mx-optee-programmer-usb.stm32
10:23:04 : Memory Programming ...
10:23:04 : File : tf-a-stm32mp157f-p6_mp1-mx-optee-programmer-usb.stm32
10:23:04 : Size : 220.41 KB
10:23:04 : Partition ID : 0x01
10:23:04 : Download in Progress:
10:23:06 : File download complete
10:23:06 : Time elapsed during download operation: 00:00:02.140
10:23:06 : RUNNING Program ...
10:23:06 : PartID: :0x01
10:23:06 : Start operation done successfully at partition 0x01
10:23:06 : Opening and parsing file: fip-stm32mp157f-p6_mp1-mx-optee-programmer-usb.bin
10:23:06 : Memory Programming ...
10:23:06 : File : fip-stm32mp157f-p6_mp1-mx-optee-programmer-usb.bin
10:23:06 : Size : 1.46 MB
10:23:06 : Partition ID : 0x03
10:23:06 : Download in Progress:
10:23:08 : File download complete
10:23:08 : Time elapsed during download operation: 00:00:02.032
10:23:08 : RUNNING Program ...
10:23:08 : PartID: :0x03
10:23:09 : Reconnecting the device ...
10:23:39 : USB speed : High Speed (480MBit/s)
10:23:39 : Manuf. ID : STMicroelectronics
10:23:39 : Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
10:23:39 : SN : 002700353133511735343431
10:23:39 : DFU protocol: 1.1
10:23:39 : Board : --
10:23:39 : Device ID : 0x0500
10:23:39 : Device name :
10:23:39 : Device type :
10:23:39 : Device CPU :
10:23:39 : Start operation done successfully at partition 0x03
10:23:39 : Opening and parsing file: tf-a-stm32mp157f-p6_mp1-mx-optee-programmer-usb.stm32
10:23:39 : Memory Programming ...
10:23:39 : File : tf-a-stm32mp157f-p6_mp1-mx-optee-programmer-usb.stm32
10:23:39 : Size : 220.41 KB
10:23:39 : Partition ID : 0x01
10:23:39 : Download in Progress:
10:23:41 : File download complete
10:23:41 : Time elapsed during download operation: 00:00:02.048
10:23:41 : RUNNING Program ...
10:23:41 : PartID: :0x01
10:23:41 : Start operation done successfully at partition 0x01
10:23:41 : Opening and parsing file: fip-stm32mp157f-p6_mp1-mx-optee-programmer-usb.bin
10:23:41 : Memory Programming ...
10:23:41 : File : fip-stm32mp157f-p6_mp1-mx-optee-programmer-usb.bin
10:23:41 : Size : 1.46 MB
10:23:41 : Partition ID : 0x03
10:23:41 : Download in Progress:
10:23:43 : File download complete
10:23:43 : Time elapsed during download operation: 00:00:02.009
10:23:43 : RUNNING Program ...
10:23:43 : PartID: :0x03
10:23:44 : Reconnecting the device ...
10:24:14 : USB speed : High Speed (480MBit/s)
10:24:14 : Manuf. ID : STMicroelectronics
10:24:14 : Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
10:24:14 : SN : 002700353133511735343431
10:24:14 : DFU protocol: 1.1
10:24:14 : Board : --
10:24:14 : Device ID : 0x0500
10:24:14 : Device name :
10:24:14 : Device type :
10:24:14 : Device CPU :
10:24:14 : Start operation done successfully at partition 0x03
10:24:14 : Opening and parsing file: tf-a-stm32mp157f-p6_mp1-mx-optee-programmer-usb.stm32
10:24:14 : Memory Programming ...
10:24:14 : File : tf-a-stm32mp157f-p6_mp1-mx-optee-programmer-usb.stm32
10:24:14 : Size : 220.41 KB
10:24:14 : Partition ID : 0x01
10:24:14 : Download in Progress:
10:24:16 : File download complete
10:24:16 : Time elapsed during download operation: 00:00:02.027
10:24:16 : RUNNING Program ...
10:24:16 : PartID: :0x01
10:24:16 : Start operation done successfully at partition 0x01
10:24:16 : Opening and parsing file: fip-stm32mp157f-p6_mp1-mx-optee-programmer-usb.bin
10:24:16 : Memory Programming ...
10:24:16 : File : fip-stm32mp157f-p6_mp1-mx-optee-programmer-usb.bin
10:24:16 : Size : 1.46 MB
10:24:16 : Partition ID : 0x03
10:24:16 : Download in Progress:
10:24:18 : File download complete
10:24:18 : Time elapsed during download operation: 00:00:01.986
10:24:18 : RUNNING Program ...
10:24:18 : PartID: :0x03
10:24:18 : Reconnecting the device ...
When I tried images from FLASH package for this board, everything is flashed fine, but I see what is missing in flashing of my custom loaders:
Opening and parsing file: fip-stm32mp157f-dk2-optee-programmer-usb.bin
10:31:11 : Memory Programming ...
10:31:11 : File : fip-stm32mp157f-dk2-optee-programmer-usb.bin
10:31:11 : Size : 1.76 MB
10:31:11 : Partition ID : 0x03
10:31:11 : Download in Progress:
10:31:14 : File download complete
10:31:14 : Time elapsed during download operation: 00:00:02.513
10:31:14 : RUNNING Program ...
10:31:14 : PartID: :0x03
10:31:14 : Reconnecting the device ...
10:31:18 : USB speed : High Speed (480MBit/s)
10:31:18 : Manuf. ID : STMicroelectronics
10:31:18 : Product ID : USB download gadget@Device ID /0x500, @Revision ID /0x2001, @Name /STM32MP157FAC Rev.Z,
10:31:18 : SN : 002700353133511735343431
10:31:18 : DFU protocol: 1.1
10:31:18 : Board : --
10:31:18 : Device ID : 0x0500
10:31:18 : Device name : STM32MP157FAC Rev.Z
10:31:18 : Device type :
10:31:18 : Device CPU :
10:31:18 : Start operation done successfully at partition 0x03
It seems that custom dts for tf-a loaders is missing some USB initialization? How can I fixed this issue?
Any help would be appreciated.