2025-07-16 9:58 AM
Hello all,
I am following the following guide: https://wiki.stmicroelectronics.cn/stm32mpu/wiki/STM32MP25_Discovery_kits_-_Starter_Package In order to bring up a STM32MP257F-DK board and am running into a problem when I try to use the Programmer to flash the board. It gets to Partition 0x3 and at 31% fails saying it failed to download sector[0]. Specifically this is the output in the terminal:
-------------------------------------------------------------------
STM32CubeProgrammer v2.20.0
-------------------------------------------------------------------
USB speed : High Speed (480MBit/s)
Manuf. ID : STMicroelectronics
Product ID : DFU in HS Mode @Device ID /0x505, @Revision ID /0x2000
SN : 003700494236501700363847
DFU protocol: 1.1
Board : --
Device ID : 0x0505
Device name : STM32MP23xx/25xx
Device type : MPU
Revision ID : --
Device CPU : Cortex-A35
Start Embedded Flashing service
Opening and parsing file: tf-a-stm32mp257f-dk-optee-programmer-usb.stm32
Memory Programming ...
File : tf-a-stm32mp257f-dk-optee-programmer-usb.stm32
Size : 202.95 KB
Partition ID : 0x01
Download in Progress:
[==================================================] 100%
File download complete
Time elapsed during download operation: 00:00:07.388
RUNNING Program ...
PartID: :0x01
Reconnecting the device ...
USB speed : High Speed (480MBit/s)
Manuf. ID : STMicroelectronics
Product ID : DFU @Device ID /0x505, @Revision ID /0x0011, @Name /STM32MP257FAK Rev.Y,
SN : 003700494236501700363847
DFU protocol: 1.1
Board : --
Device ID : 0x0505
Device name : STM32MP257FAK Rev.Y
Device type : MPU
Device CPU : Cortex-A35
Start operation done successfully at partition 0x01
Opening and parsing file: fip-stm32mp257f-dk-ddr-optee-programmer-usb.bin
Memory Programming ...
File : fip-stm32mp257f-dk-ddr-optee-programmer-usb.bin
Size : 33.67 KB
Partition ID : 0x02
Download in Progress:
[==================================================] 100%
File download complete
Time elapsed during download operation: 00:00:01.050
RUNNING Program ...
PartID: :0x02
Reconnecting the device ...
USB speed : High Speed (480MBit/s)
Manuf. ID : STMicroelectronics
Product ID : DFU @Device ID /0x505, @Revision ID /0x0011, @Name /STM32MP257FAK Rev.Y,
SN : 003700494236501700363847
DFU protocol: 1.1
Board : --
Device ID : 0x0505
Device name : STM32MP257FAK Rev.Y
Device type : MPU
Device CPU : Cortex-A35
Start operation done successfully at partition 0x02
Opening and parsing file: fip-stm32mp257f-dk-optee-programmer-usb.bin
Memory Programming ...
File : fip-stm32mp257f-dk-optee-programmer-usb.bin
Size : 2.99 MB
Partition ID : 0x03
Download in Progress:
[=============== ] 30%
Error: failed to download Sector[0]
Error: failed to download the File
Error: Download partition 0x03 failed
Error: TSV flashing service failed
I am unsure how to fix this and any help would be greatly appreciated. Thanks!
Solved! Go to Solution.
2025-07-18 9:03 AM
Hi @Gregory PLANCHON & @PatrickF,
I figured out the problem, it seems that the USB port I was connected to, on the front of my PC was a 3.0 USB which apparently doesn't work and I needed to connect it to a USB port on the back of my computer. I can flash it now! Thank you both for your help.
2025-07-17 12:11 AM
Hi @Carson ,
I've done the test myself and haven't encountered any problems, but could you please check these points:
If all of the above is correct, could you please try running the script mentioned in part 6.3?
Regards,
Grégory
2025-07-17 8:53 AM
After going through again it still gives me the same error, below are some more specifics on each of your bullets:
On the prerequisites, I have done all the steps it mentions about installing and setting up the programmer tool and I have setup the USB for serial flashing. It doesn't mention in that chapter any other prerequisites so I assume that is good. I also did some of the prerequisites under the PC prerequisites tab although it seems those are only for Distribution and Developer packages and not the Starter Package.
On the connected to cube programmer, I have tried flashing in the GUI and in the Terminal, and if I connect in the GUI then try to flash in the terminal it doesn't work saying target device not found. Either way the Programmer seems to work.
On the directory, specifically my directory when I try to flash is /Desktop/STM32MPU-Ecosystem-v6.1.0/Starter-Package/stm32mp2-openstlinux-6.6-yocto-scarthgap-mpu-v25.06.11/images/stm32mp2. I assume that's fine, or does my Starter package need to be in my home directory?
When I try to run the script mentioned I get the following out:
dd: fsync failed for 'standard output': Invalid argument
640+0 records in
640+0 records out
5368709120 bytes (5.4 GB, 5.0 GiB) copied, 48.676 s, 110 MB/s
So I don't think it worked unfortunately.
NOTE: One thing I have to differently from the guide is in section 6.1 when downloading the image. In the guide it says to run:
tar xvf en.FLASH-stm32mp2-openstlinux-6.6-yocto-scarthgap-mpu-v25.06.11.tar.gz
However this command does not work for me it has a problem with the tar command and saying it doesn't see the file as a tar file. so instead I have to run:
gunzip FLASH-stm32mp2-openstlinux-6.6-yocto-scarthgap-mpu-v25.06.11.tar.gz
tar xvf FLASH-stm32mp2-openstlinux-6.6-yocto-scarthgap-mpu-v25.06.11.tar
I didn't think this would cause a problem but maybe it is, I'm unsure.
Thanks,
Carson
2025-07-17 11:48 AM - edited 2025-07-17 3:34 PM
Also @Gregory PLANCHON,
I saw this part of the datasheet where it mentions "To identify correctly all device interfaces from the host PC, install the evaluation USB driver available on the www.st.com website, before connecting the board." I then went to www.st.com and searched for the evaluation USB driver but only the STSW-AEK-SPC5LNK, which seems to be just for windows. So is there a different driver I need to find or am I going down the wrong rabbit hole completely. Also I am unsure if the COM LED is supposed to be blinking multiple times or just once. It blinks once upon plugging it into power and that's it.
Thanks,
Carson
2025-07-17 11:45 PM
Hi @Carson ,
Have you configured the boot pin as described on the wiki page?
Could you also try reinstalling the starter package from scratch by downloading the latest version and using the tar command?
Could you also let me know what command you used for the script?
Regards,
grégory
2025-07-17 11:51 PM
HI @Carson ,
COM led is not very meaningful.
You should have red led LD7 blinking until PC is recognized on 'USB DRD port' (so blink once if USB is already connected). But as the flashload seems to start correctly, there is probably no issue here.
Some points to check below:
Check/replace your USB cable.
Check/replace USB supply.
Confirm PC USB is connected on CN16 'USB DRD' (and USB supply on CN21 'USB PWR STLINK').
Check cubeprogrammer command line you are using
You mention that CubeProgrammer GUI should does not connect. Please check you use 'USB' in the blue dropdown box.
Did you try flashing on a windows PC or another machine ?
Does it always fail at 30% of the "fip-stm32mp257f-dk-optee-programmer-usb.bin" file ?
Which version of the board are you using ? Should be MB1605C on the PCB and MB1605-MP257F-C01 on the sticker ?
If possible, dump of the STLINK UART console during flashing might help to identify issue.
Regards.
2025-07-18 9:03 AM
Hi @Gregory PLANCHON & @PatrickF,
I figured out the problem, it seems that the USB port I was connected to, on the front of my PC was a 3.0 USB which apparently doesn't work and I needed to connect it to a USB port on the back of my computer. I can flash it now! Thank you both for your help.