cancel
Showing results for 
Search instead for 
Did you mean: 

failed to download Segment[1] and Failed to start GDB server

FTrom
Associate II

Im trying to start ith TouchGFX with the X-Nucleo-GFX01M1.

with CubeProgrammer I have the error : failed to download Segment[1].

Using TouchGFX 4.18.1 Designer is possible to download the GUI. So, there is not problem of comunciation with the PC.

Using STM32Cube come the error Failed to start GDB server. I have read on internet that this error is connected to window dll bla bla bla. ok. fine. I have reinstalled all Window10. No solution and the same error.

Using CubeProgrammer and load the file example provide from ST: GFX01M1_HelloWorld.hex I have the error failed to download Segment[1].

15:17:45 : Memory Programming ...
  15:17:45 : Opening and parsing file: GFX01M1_HelloWorld.hex
  15:17:45 :   File          : GFX01M1_HelloWorld.hex
  15:17:45 :   Size          : 822184 Bytes
  15:17:45 :   Address       : 0x08000000 
  15:17:45 : Erasing memory corresponding to segment 0:
  15:17:45 : Erasing internal memory sectors [0 7]
  15:17:45 : Erasing memory corresponding to segment 1:
  15:17:45 : Download in Progress:
  15:17:46 : Error: failed to download Segment[1]
  15:17:46 : Error: failed to download the File

it is not a problem of my PC or SW because when I flash the easiest program generated from CubeMX, into STM32FG071RB it flashes without any problem.

Thanks.

5 REPLIES 5
N. SANTINI
ST Employee

Hi,

Are you using the external flash ?

If so, do you select the proper external loader in the STM32CubeProgrammer "EL" panel ?

If you do not find it in the STM32CubeProgrammer external loader list you need to :

  • close STM32CubeProgrammer
  • copy the MX25L6433F_STM32G071B_NUCLEO.stldr file from the gcc folder of your project to the folder : C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer.2.9.0\bin\ExternalLoader
  • relaunch STM32CubeProgrammer.

Note that STM32CubeIDE has its own embedded CubeProgrammer so the .stldr file must be copied to :

C:\ST\STM32CubeIDE_1.8.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.0.100.202110141430\tools\bin\ExternalLoader

see : https://support.touchgfx.com/4.18/docs/development/scenarios/touchgfx-on-lowcost-hardware#flash-loader

I hope this will help,

Best regards,

Nicolas

FTrom
Associate II

Hi

the CubeProgrammer has the file stldr  I don´t know if there was also before

0693W00000JMloZQAT.pngI follow your advice but I have still the same issue. I got it is diifficult to understand the issue, so i try to give you so much infot as possible. Following step by step. I have also attached a file word with the images.

  1. Create a prj with TouchGFX called Prj_v1 (it is just a white screen with a button)
  2. Generated the code
  3. I open with STM32CubeMX the file .ioc in Prj_v1 /TouchGFX
  4. Check the library TouchGFX are loaded
  5. with STM32CubeMX generate the code
  6. Open the project generated by STM32CubeMX with STM32CubeIDE 1.8.0
  7. Compile
  8. close STM32CubeIDE 1.8.0
  9. move the MX25L6433F_STM32G071B_NUCLEO.stldr in the folder C:\ST\STM32CubeIDE_1.8.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.0.100.202110141430\tools\bin\ExternalLoader
  10. open again STM32CubeIDE 1.8.0
  11. compile
  12. run 0693W00000JMlhRQAT.png

Thanks in advance

Fausto

Hi,

You can see in the error message at the bottom of your last picture that the external loader used is the S25FL032P and not the MX25L6433F. So you have properly added the MX25L6433F to your repository but you have not actually set your project to use it. To do so, click on either the arrow next to the debug or run options and go to the "Debug Configurations" or "Run Configurations" menus (in the following picture I go to the debug one).0693W00000JMo15QAD.pngWithin that new view, go to the Debugger tab, scroll down to the bottom and check the external loader used. If nothing is shown press the scan option and go through the list to select the correct version.

0693W00000JMo8aQAD.png 

/Romain

FTrom
Associate II

Hi,

I have followed your instruction and the S25FL032P_STM32G071B-NUCLEO.stldr was already selected.0693W00000JMw7KQAT.pngI did anyway a scan again-

When I compile it , I have the same error.

0693W00000JMw7yQAD.pngin the prject folder there is MX25L6433F_STM32G071B_NUCLEO.stldr. Should I change it manually with S25FL032P_STM32G071B-NUCLEO.stldr ?

And where could I find this file?

0693W00000JMw83QAD.png 

For my curiosity I have selected MX25L6433F to see what could happen given that in my project folder i have only that....and something strange happened:

STMicroelectronics ST-LINK GDB server. Version 6.0.0
Copyright (c) 2021, STMicroelectronics. All rights reserved.
 
Starting server with the following options:
        Persistent Mode            : Disabled
        Logging Level              : 31
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Enabled
        SWD Debug                  : Enabled
 
COM frequency = 4000 kHz
Target connection mode: Attach
Reading ROM table for AP 0 @0xf0000fd0
Hardware watchpoint supported by the target 
ST-LINK Firmware version : V2J39M27
Device ID: 0x460
PC: 0x79fb0c
ST-LINK device status: RUN_MODE
ST-LINK detects target voltage = 3.23 V
ST-LINK device status: RUN_MODE
ST-LINK device initialization OK
Stm32Device, pollAndNotify running...
SwvSrv state change: 0 -> 1
Waiting for debugger connection...
Waiting for connection on port 61234...
Waiting for connection on port 61235...
Accepted connection on port 61234...
Debugger connected
Waiting for debugger connection...
Waiting for connection on port 61234...
GDB session thread running
GdbSessionManager, session started: 1
Try halt...
ST-LINK device status: HALT_MODE
Accepted connection on port 61234...
Debugger connected
Waiting for debugger connection...
Waiting for connection on port 61234...
GDB session thread running
GdbSessionManager, session started: 2
Stm32Device, closeDevice() entry
GDB session, device event: 5
GDB session, device event: 5
Stm32Device, pollAndNotify stopped
Stm32Device, closeDevice() exit
 ------ Switching to STM32CubeProgrammer ----- 
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.9.0-RC01                  
      -------------------------------------------------------------------
 
ST-LINK SN  : 0669FF313736504157223212
ST-LINK FW  : V2J39M27
Board       : NUCLEO-G071RB
Voltage     : 3.23V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x460
Revision ID : Rev B
Device name : STM32G07x/STM32G08x
Flash size  : 128 KBytes
Device type : MCU
Device CPU  : Cortex-M0+
BL Version  : --
Debug in Low Power mode enabled
 
 
 
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a11292.srec
  File          : ST-LINK_GDB_server_a11292.srec
  Size          : 148948 Bytes
  Address       : 0x08000000 
 
 
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 32]
Erasing memory corresponding to segment 1:
Erasing external memory sectors [0 1]
Download in Progress:
�������������������������������������������������� 0%
��������� 19%���������� 39%���������� 58%����� 65%����� 75%������ 86%����� 96%�� 100%
 
File download complete
Time elapsed during download operation: 00:00:03.544
 
 
 
Verifying ...
 
 
Read progress:
�������������������������������������������������� 50%
�  2%�  4%�  6%�  8%� 10%� 12%� 15%� 16%� 19%� 20%� 23%� 24%� 26%� 28%� 30%� 32%� 34%� 37%� 38%� 41%� 42%� 45%� 46%� 48%� 50%� 52%� 54%� 56%� 59%� 60%� 63%� 64%� 67%� 68%� 70%� 72%� 74%� 76%� 78%� 81%� 82%� 85%� 86%� 89%������ 100%����� 100%����� 100%����� 100%���� 100%���� 100%���� 100%��� 100%��� 100%�� 100%�� 100%�� 100%� 100%� 100%� 100%
 
Download verified successfully 
 
 
 ------ Switching context ----- 
COM frequency = 4000 kHz
Target connection mode: Default
Reading ROM table for AP 0 @0xf0000fd0
Hardware watchpoint supported by the target 
ST-LINK Firmware version : V2J39M27
Device ID: 0x460
PC: 0x80017cc
ST-LINK detects target voltage = 3.23 V
ST-LINK device status: HALT_MODE
GDB session, device event: 6
GDB session, device event: 6
Stm32Device, pollAndNotify running...
GDB session, device event: 3
GDB session, device event: 3
GDB session, device event: 1
GDB session, device event: 1
GDB session terminated: Client connection lost
GdbSessionManager, session terminated: 2
Received Ctrl-C from the client 
ST-LINK device status: RUN_MODE
Device not halted(0), performing Ctrl-C
GDB session, device event: 4
Device halted
ST-LINK device status: HALT_MODE
GDB session, device event: 0
Cleanup session: 2
GDB session disposed: 2
GDB session terminated: Client connection lost
GdbSessionManager, session terminated: 1
GdbSrv, master session terminated, signal dispose
Shutting down...
Stopping port 61234
Stopping port 61234

and I coud run it, i think...

STMicroelectronics ST-LINK GDB server. Version 6.0.0
Copyright (c) 2021, STMicroelectronics. All rights reserved.
 
Starting server with the following options:
        Persistent Mode            : Disabled
        Logging Level              : 31
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Enabled
        SWD Debug                  : Enabled
 
COM frequency = 4000 kHz
Target connection mode: Attach
Reading ROM table for AP 0 @0xf0000fd0
Hardware watchpoint supported by the target 
ST-LINK Firmware version : V2J39M27
Device ID: 0x460
PC: 0x79fb0c
ST-LINK device status: RUN_MODE
ST-LINK detects target voltage = 3.23 V
ST-LINK device status: RUN_MODE
ST-LINK device initialization OK
Stm32Device, pollAndNotify running...
SwvSrv state change: 0 -> 1
Waiting for debugger connection...
Waiting for connection on port 61234...
Waiting for connection on port 61235...
Accepted connection on port 61234...
Debugger connected
Waiting for debugger connection...
Waiting for connection on port 61234...
GDB session thread running
GdbSessionManager, session started: 1
Try halt...
ST-LINK device status: HALT_MODE
Accepted connection on port 61234...
Debugger connected
Waiting for debugger connection...
Waiting for connection on port 61234...
GDB session thread running
GdbSessionManager, session started: 2
Stm32Device, closeDevice() entry
GDB session, device event: 5
GDB session, device event: 5
Stm32Device, pollAndNotify stopped
Stm32Device, closeDevice() exit
 ------ Switching to STM32CubeProgrammer ----- 
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.9.0-RC01                  
      -------------------------------------------------------------------
 
ST-LINK SN  : 0669FF313736504157223212
ST-LINK FW  : V2J39M27
Board       : NUCLEO-G071RB
Voltage     : 3.23V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x460
Revision ID : Rev B
Device name : STM32G07x/STM32G08x
Flash size  : 128 KBytes
Device type : MCU
Device CPU  : Cortex-M0+
BL Version  : --
Debug in Low Power mode enabled
 
 
 
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a08036.srec
  File          : ST-LINK_GDB_server_a08036.srec
  Size          : 148948 Bytes
  Address       : 0x08000000 
 
 
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 32]
Erasing memory corresponding to segment 1:
Erasing external memory sectors [0 1]
Download in Progress:
�������������������������������������������������� 0%
��������� 19%���������� 39%���������� 58%����� 65%����� 75%������ 86%����� 96%�� 100%
 
File download complete
Time elapsed during download operation: 00:00:03.431
 
 
 
Verifying ...
 
 
Read progress:
�������������������������������������������������� 50%
�  2%�  4%�  6%�  8%� 10%� 12%� 15%� 16%� 19%� 20%� 23%� 24%� 26%� 28%� 30%� 32%� 34%� 37%� 38%� 41%� 42%� 45%� 46%� 48%� 50%� 52%� 54%� 56%� 59%� 60%� 63%� 64%� 67%� 68%� 70%� 72%� 74%� 76%� 78%� 81%� 82%� 85%� 86%� 89%������ 100%����� 100%����� 100%����� 100%���� 100%���� 100%���� 100%��� 100%��� 100%�� 100%�� 100%�� 100%� 100%� 100%� 100%
 
Download verified successfully 
 
 
 ------ Switching context ----- 
COM frequency = 4000 kHz
Target connection mode: Default
Reading ROM table for AP 0 @0xf0000fd0
Hardware watchpoint supported by the target 
ST-LINK Firmware version : V2J39M27
Device ID: 0x460
PC: 0x80017cc
ST-LINK detects target voltage = 3.23 V
ST-LINK device status: HALT_MODE
GDB session, device event: 6
GDB session, device event: 6
Stm32Device, pollAndNotify running...
GDB session, device event: 3
GDB session, device event: 3
GDB session, device event: 1
GDB session, device event: 1
GDB session terminated: Client connection lost
GdbSessionManager, session terminated: 2
Received Ctrl-C from the client 
ST-LINK device status: RUN_MODE
Device not halted(0), performing Ctrl-C
GDB session, device event: 4
Device halted
ST-LINK device status: HALT_MODE
GDB session, device event: 0
GDB session terminated: Client connection lost
GdbSessionManager, session terminated: 1
GdbSrv, master session terminated, signal dispose
Shutting down...
Stopping port 61234
Received stop for port 61234, not accepting new connections.
GdbSrv, deInit entry.
GdbSessionManager, deInit entry.
GDB session disposed: 2
GDB session disposed: 1
GdbSessionManager, deInit exit
SwvSrv deInit entry
Stopping port 61235
Stopping port 61234
 
 
 

 is it correct all of these instructions?

Fausto

You misunderstood my message. You should use the MX25L6433F_STM32G071B_NUCLEO.stldr and not S25FL032P_STM32G071B-NUCLEO.stldr which was the one set in your project.

I'm a bit confused about the "switching context" messages but it might be something expected.

/Romain