2024-06-05 11:52 PM
I could not complete loading a board following the WiKi How to load U-Boot with dfu-util.
The process describes sending the tf-a file then the fip file however this always fails the correct procedure is to send the tf-a file then send the flashlayout file then only send the fip file.
Looking at the output of the stm32 programmer its clear the order must be tf-a then flashlayout then fip
11:49:35 : Start Embedded Flashing service
11:49:35 : Memory Programming ...
11:49:35 : Opening and parsing file: tf-a-stm32mp157c-comb_ns_combo-mx-usb.stm32
11:49:35 : File : tf-a-stm32mp157c-comb_ns_combo-mx-usb.stm32
11:49:35 : Size : 220.31 KB
11:49:35 : Partition ID : 0x01
11:49:35 : Download in Progress:
11:49:39 : File download complete
11:49:39 : Time elapsed during download operation: 00:00:03.926
11:49:39 : RUNNING Program ...
11:49:39 : PartID: :0x01
11:49:39 : Start operation done successfully at partition 0x01
11:49:39 : Flashlayout Programming ...
11:49:39 : Running Flashlayout Partition ...
11:49:39 : Flashlayout partition started successfully
11:49:39 : Memory Programming ...
11:49:39 : Opening and parsing file: fip-stm32mp157c-comb_ns_combo-mx-trusted.bin
11:49:39 : File : fip-stm32mp157c-comb_ns_combo-mx-trusted.bin
11:49:39 : Size : 1.01 MB
11:49:39 : Partition ID : 0x03
11:49:39 : Download in Progress:
11:49:42 : File download complete
11:49:42 : Time elapsed during download operation: 00:00:02.403
11:49:42 : RUNNING Program ...
11:49:42 : PartID: :0x03
11:49:42 : Reconnecting the device ...
From the console of the device
NOTICE: CPU: STM32MP157F?? Rev.Z
NOTICE: Model: Comb Combo NS Board (OSD32MP157C)
INFO: Reset reason (0x15):
INFO: Power-on Reset (rst_por)
INFO: PMIC version = 0x21
INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe2000
INFO: FCONF: Reading firmware configuration information for: stm32mp_io
INFO: Using USB
INFO: Instance 2
INFO: Boot used partition fsbl1
NOTICE: BL2: v2.4-r2.1(debug):v2.4-dirty
NOTICE: BL2: Built : 16:43:51, Nov 17 2020
INFO: BL2: Doing platform setup
INFO: RAM: DDR3-DDR3L 16bits 533000kHz
INFO: Memory size = 0x20000000 (512 MB)
INFO: DFU USB START...
INFO: phase ID :0, Manifestation 0 at c0000140
INFO: phase ID :3, Manifestation 3 at c810277a
INFO: Send detach request
INFO: Receive DFU Detach
INFO: DFU USB STOP...
Please note that AN5275 shows the same process as the wiki.
2024-06-06 02:51 AM
Hi,
WIKI describes the procedure for actual version of OpenSTlinux
we change the sequence on new product STM32MP13 and we align this sequence for STM32MP15 to simplify the management of the DFU stack in bootloaders (in TF-A):
U-Boot load himself the flashlayout and make a USB re-enumeration.
This change is transparent for STM32CubeProgrammer because it use the Get Phase command to know when read the flashlayout), but thta impact sequence with dfu-util.
reference= new behavior
https://wiki.st.com/stm32mpu/wiki/How_to_load_U-Boot_with_dfu-util
https://wiki.st.com/stm32mpu-ecosystem-v4/wiki/How_to_load_U-Boot_with_dfu-util
for STM32MP15
dfu-util -a 1 -D tf-a-usb.stm32
dfu-util -a 3 -D fip.bin
dfu-util -a 0 -e
dfu-util -a 0 -D flashlayout.stm32 (oe script.uimg)
dfu-util -a 0 -e
reference= previously (with OpenSTLinux V3.X / STM32MP15)
https://wiki.st.com/stm32mpu-ecosystem-v3/wiki/How_to_load_U-Boot_with_dfu-util
dfu-util -a 1 -D tf-a.bin
dfu-util -a 0 -D flashlayout.stm32
dfu-util -a 3 -D fip.bin
dfu-util -a 0 -e
The application note (last version) also reflects the behavior of new product / new OpenSTLinux version.
NB: the protocol is the same (it is the main purpose of this AN), only the programming sequence change.
Regards
Patrick
2024-06-06 05:46 AM
Thanks i have implemented the get phase approach in a bash script i use to load the device its working well just wanted to point out the issue as it took a while to get to bottom of it appreciate you looking at it and replying.
Regards