Skip to main content
Visitor II
January 21, 2022
Solved

“Error: failed to download Segment[0] ? Populate the target and boot the image example

  • January 21, 2022
  • 14 replies
  • 5820 views

“Error: failed to download Segment[0]�?

I looked at the other items with the same title but did not see an answer that would help me.

I am using the STM32MP157F-DK2

The demo code was working when box was opened

I tried to run the demo

“Populate the target and boot the image�?

at

https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2

I am using ecosystem release v3.1.0

And

STM32CubeProgrammer 2.9.0

Down load eventually fails with “Error: failed to download Segment[0]�?

Any help on the matter would be appreciated

Below is the Log

 10:53:37 : USB speed  : High Speed (480MBit/s)

 10:53:37 : Manuf. ID  : STMicroelectronics

 10:53:37 : Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000

 10:53:37 : SN         : 002A001B3438511436383238

 10:53:37 : FW version : 0x0110

 10:53:37 : Board      : --

 10:53:37 : Device ID  : 0x0500

 10:53:48 : Start Embedded Flashing service

 10:53:48 : Memory Programming ...

 10:53:48 : Opening and parsing file: tf-a-stm32mp157f-dk2-usb.stm32

 10:53:48 :  File         : tf-a-stm32mp157f-dk2-usb.stm32

 10:53:48 :  Size         : 225596 Bytes

 10:53:48 :  Partition ID : 0x01

 10:53:48 : Download in Progress:

 10:53:48 : File download complete

 10:53:48 : Time elapsed during download operation: 00:00:00.473

 10:53:48 : RUNNING Program ...

 10:53:48 :  PartID:     :0x01

 10:53:48 : Start operation done successfully at partition 0x01

 10:53:48 : Flashlayout Programming ...

 10:53:48 : Running Flashlayout Partition ...

 10:53:48 : Flashlayout partition started successfully

 10:53:48 : Memory Programming ...

 10:53:48 : Opening and parsing file: fip-stm32mp157f-dk2-trusted.bin

 10:53:48 :  File         : fip-stm32mp157f-dk2-trusted.bin

 10:53:48 :  Size         : 1090807 Bytes

 10:53:48 :  Partition ID : 0x03

 10:53:48 : Download in Progress:

 10:53:50 : File download complete

 10:53:50 : Time elapsed during download operation: 00:00:01.428

 10:53:50 : RUNNING Program ...

 10:53:50 :  PartID:     :0x03

 10:53:50 : Reconnecting the device ...

 10:53:53 : USB speed  : High Speed (480MBit/s)

 10:53:53 : Manuf. ID  : STMicroelectronics

 10:53:53 : Product ID : USB download gadget@Device ID /0x500, @Revision ID /0x2001, @Name /STM32MP157FAC Rev.Z,

 10:53:53 : SN         : 002A001B3438511436383238

 10:53:53 : FW version : 0x0110

 10:53:53 : Board      : --

 10:53:53 : Device ID  : 0x0500

 10:53:53 : Device name : STM32MP157FAC Rev.Z

 10:53:53 : Device type :

 10:53:53 : Device CPU :

 10:53:53 : Start operation done successfully at partition 0x03

 10:53:53 : Memory Programming ...

 10:53:53 : Opening and parsing file: tf-a-stm32mp157f-dk2-sdcard.stm32

 10:53:53 :  File         : tf-a-stm32mp157f-dk2-sdcard.stm32

 10:53:53 :  Size         : 225489 Bytes

 10:53:53 :  Partition ID : 0x04

 10:53:53 : Download in Progress:

 10:53:56 : Error: failed to download Segment[0]

 10:53:56 : Error: failed to download the File

 10:53:56 : Error: Download partition 0x04 failed

 10:53:56 : Error: TSV flashing service failed

 10:53:56 : Warning: Connection to device 0x500 is lost

 10:53:56 : Disconnected from device.

    This topic has been closed for replies.
    Best answer by Kevin HUBER

    Hello @JAmia.1​ ,

    We identified an issue with 1 or 2 faulty boards, out of the box, with the same symptoms than yours, when running at 800MHz.

    • The problem never happens if you are using the file from 157c-dk2 instead of 157f-dk2 because they are running at 650Mhz.
    • Or it is possible to use the board without the screen even at 800MHz, what you have done by using the files 157d-dk1.

    Unfortunately, you have to contact your supplier to have your board replaced.

    Or you can continue to use it, but with 157c-dk2 files only.

    Regards,

    Kevin

    14 replies

    JAmia.1Author
    Visitor II
    February 2, 2022

    ogrammer_CLI -c port=usb1 -vb 2 -w flashlayout_st-image-weston/trusted/FlashLayout_sdcard_stm32mp157f-dk2-trusted_test_.tsv

       -------------------------------------------------------------------

                STM32CubeProgrammer v2.9.0          

       -------------------------------------------------------------------

    USB speed  : High Speed (480MBit/s)

    Manuf. ID  : STMicroelectronics

    Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000

    SN     : 002A001B3438511436383238

    FW version : 0x0110

    Board    : --

    Device ID  : 0x0500

      AREA NAME     SECT.NBR    PARTITION.ID  SIZE     TYPE

      Partition0      0000     0x00000000   0256 KB   RW

      FSBL         0000     0x00000001   0001 MB   RW

      Partition2      0000     0x00000002   0001 MB   RW

      Partition3      0000     0x00000003   0016 MB   RW

      Partition4      0000     0x00000004   0016 MB   RW

      virtual       0000     0x000000f1   0512 B    R

    Device name : STM32MP1

    Device type : MPU

    Revision ID : --  

    Device CPU : Cortex-A7

    Start Embedded Flashing service

    sending a set alternate setting request with index: 5

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 1

    Memory Programming ...

    Opening and parsing file: tf-a-stm32mp157c-dk2-usb.stm32

     File     : tf-a-stm32mp157c-dk2-usb.stm32

     Size     : 225596 Bytes

     Partition ID : 0x01 

    Download in Progress:

     Size     : 225596 Bytes

    Segment[0] downloaded successfully

    File download complete

    Time elapsed during download operation: 00:00:00.568

    RUNNING Program ... 

     PartID:   :0x01 

    sending a dfu end of download request

    sending a set alternate setting request with index: 5

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 0

    Request detach value = 0 

    Start operation done successfully at partition 0x01

    sending a set alternate setting request with index: 5

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 0

    Flashlayout Programming ...

    Running Flashlayout Partition ...

    sending a dfu end of download request

    sending a set alternate setting request with index: 5

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 3

    Request detach value = 0 

    Flashlayout partition started successfully

    sending a set alternate setting request with index: 5

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 3

    Memory Programming ...

    Opening and parsing file: fip-stm32mp157c-dk2-trusted.bin

     File     : fip-stm32mp157c-dk2-trusted.bin

     Size     : 1090377 Bytes

     Partition ID : 0x03 

    Download in Progress:

     Size     : 1090377 Bytes

    Segment[0] downloaded successfully

    File download complete

    Time elapsed during download operation: 00:00:01.464

    RUNNING Program ... 

     PartID:   :0x03 

    sending a dfu end of download request

    sending a set alternate setting request with index: 5

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 0

    Request detach value = 1 

    Reconnecting the device ...

    Reconnecting...

    Reconnected

    USB speed  : High Speed (480MBit/s)

    Manuf. ID  : STMicroelectronics

    Product ID : USB download gadget@Device ID /0x500, @Revision ID /0x2001, @Name /STM32MP157FAC Rev.Z,

    SN     : 002A001B3438511436383238

    FW version : 0x0110

    Board    : --

    Device ID  : 0x0500

    Device name : STM32MP157FAC Rev.Z

    Device type : MPU

    Device CPU : Cortex-A7

      AREA NAME     SECT.NBR    PARTITION.ID  SIZE     TYPE

      fsbl1        0000     0x00000004   0256 KB   RW

      fsbl2        0000     0x00000005   0256 KB   RW

      fip         0000     0x00000006   0004 MB   RW

      boot         0000     0x00000010   0064 MB   RW

      vendorfs       0000     0x00000011   0016 MB   RW

      rootfs        0000     0x00000012   0744 MB   RW

      userfs        0000     0x00000013   14364 MB   RW

      virtual       0000     0x000000f1   0512 B    RW

      OTP         0000     0x000000f2   1024 B    RW

      PMIC         0000     0x000000f4   0008 B    RW

    Start operation done successfully at partition 0x03

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 0

    Memory Programming ...

    Opening and parsing file: tf-a-stm32mp157f-dk2-sdcard.stm32

     File     : tf-a-stm32mp157f-dk2-sdcard.stm32

     Size     : 225489 Bytes

     Partition ID : 0x04 

    Download in Progress:

     Size     : 225489 Bytes

    Segment[0] downloaded successfully

    File download complete

    Time elapsed during download operation: 00:00:00.072

    RUNNING Program ... 

     PartID:   :0x04 

    sending a dfu end of download request

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 1

    Request detach value = 0 

    Start operation done successfully at partition 0x04

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 1

    Memory Programming ...

    Opening and parsing file: tf-a-stm32mp157f-dk2-sdcard.stm32

     File     : tf-a-stm32mp157f-dk2-sdcard.stm32

     Size     : 225489 Bytes

     Partition ID : 0x05 

    Download in Progress:

     Size     : 225489 Bytes

    Segment[0] downloaded successfully

    File download complete

    Time elapsed during download operation: 00:00:00.083

    JAmia.1Author
    Visitor II
    February 2, 2022

    RUNNING Program ... 

     PartID:   :0x05 

    sending a dfu end of download request

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 2

    Request detach value = 0 

    Start operation done successfully at partition 0x05

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 2

    Memory Programming ...

    Opening and parsing file: fip-stm32mp157f-dk2-trusted.bin

     File     : fip-stm32mp157f-dk2-trusted.bin

     Size     : 1090807 Bytes

     Partition ID : 0x06 

    Download in Progress:

     Size     : 1090807 Bytes

    Segment[0] downloaded successfully

    File download complete

    Time elapsed during download operation: 00:00:00.391

    RUNNING Program ... 

     PartID:   :0x06 

    sending a dfu end of download request

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 3

    Request detach value = 0 

    Start operation done successfully at partition 0x06

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 3

    Memory Programming ...

    Opening and parsing file: st-image-bootfs-openstlinux-weston-stm32mp1.ext4

     File     : st-image-bootfs-openstlinux-weston-stm32mp1.ext4

     Size     : 64 MBytes

     Partition ID : 0x10 

    Download in Progress:

     Size     : 67108864 Bytes

    Segment[0] downloaded successfully

    File download complete

    Time elapsed during download operation: 00:00:33.349

    RUNNING Program ... 

     PartID:   :0x10 

    sending a dfu end of download request

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 4

    Request detach value = 0 

    Start operation done successfully at partition 0x10

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 4

    Memory Programming ...

    Opening and parsing file: st-image-vendorfs-openstlinux-weston-stm32mp1.ext4

     File     : st-image-vendorfs-openstlinux-weston-stm32mp1.ext4

     Size     : 16 MBytes

     Partition ID : 0x11 

    Download in Progress:

     Size     : 16777216 Bytes

    Segment[0] downloaded successfully

    File download complete

    Time elapsed during download operation: 00:00:08.599

    RUNNING Program ... 

     PartID:   :0x11 

    sending a dfu end of download request

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 5

    Request detach value = 0 

    Start operation done successfully at partition 0x11

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 5

    Memory Programming ...

    Opening and parsing file: st-image-weston-openstlinux-weston-stm32mp1.ext4

     File     : st-image-weston-openstlinux-weston-stm32mp1.ext4

     Size     : 622752 KBytes

     Partition ID : 0x12 

    Download in Progress:

     Size     : 104857600 Bytes

    Segment[0] downloaded successfully

    File download complete

    Time elapsed during download operation: 00:05:29.957

    RUNNING Program ... 

     PartID:   :0x12 

    sending a dfu end of download request

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 6

    Request detach value = 0 

    Start operation done successfully at partition 0x12

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    sending a set alternate setting request with index: 6

    Memory Programming ...

    Opening and parsing file: st-image-userfs-openstlinux-weston-stm32mp1.ext4

     File     : st-image-userfs-openstlinux-weston-stm32mp1.ext4

     Size     : 128 MBytes

     Partition ID : 0x13 

    Download in Progress:

     Size     : 134217728 Bytes

    Segment[0] downloaded successfully

    File download complete

    Time elapsed during download operation: 00:01:07.174

    RUNNING Program ... 

     PartID:   :0x13 

    sending a dfu end of download request

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    Request detach value = 0 

    Start operation done successfully at partition 0x13

    sending a set alternate setting request with index: 7

    receiving packet

    UpLoading data

    Flashing service completed successfully

    JAmia.1Author
    Visitor II
    February 2, 2022

    That worked. had to enter log in two parts as it was to large.

    Also note I changed the file name to _test_ as the command line did not like (test)

    don't know if its worth repeating but

    the file 157d-dk1- worked using the cube programmer

    Technical Moderator
    February 3, 2022

    Hello @JAmia.1​ ,

    We identified an issue with 1 or 2 faulty boards, out of the box, with the same symptoms than yours, when running at 800MHz.

    • The problem never happens if you are using the file from 157c-dk2 instead of 157f-dk2 because they are running at 650Mhz.
    • Or it is possible to use the board without the screen even at 800MHz, what you have done by using the files 157d-dk1.

    Unfortunately, you have to contact your supplier to have your board replaced.

    Or you can continue to use it, but with 157c-dk2 files only.

    Regards,

    Kevin

    Visitor II
    February 13, 2023

    I had the same issue in the STM32CubeProgrammer, but solved it somehow in another way:

    In Erasing & Programming tab:

    1. Uncheck "skip flash erase before programming".
    2. Click Start programming. (This also failed for me)
    3. Recheck "skip flash erase before..."
    4. Start programming (this was successful)