cancel
Showing results for 
Search instead for 
Did you mean: 

PROBLEM Debug project with external loader

NBita.1
Associate II

Debug project with external loader 

Hi all,

I have a project with an external loader and I didn't succeed to enter to debug and download the hex (sometimes is and sometimes it is not it didn't consistency

i didn't understand if it's the st programmer or 

see log  :

STMicroelectronics ST-LINK GDB server. Version 7.0.0

Copyright (c) 2022, STMicroelectronics. All rights reserved.

Starting server with the following options:

    Persistent Mode      : Disabled

    LogFile Name        : C:\TFS\Software\Projects\RK\source_code\release\code_2024\controlller\1\rks_controller\debug_new\st-link_gdbserver_log.txt

    Logging Level       : 31

    Listen Port Number     : 61244

    Status Refresh Delay    : 15s

    Verbose Mode        : Enabled

    SWD Debug         : Enabled

    InitWhile         : Enabled

COM frequency = 4000 kHz

Target connection mode: Under reset

Reading ROM table for AP 0 @0xe00fdfd0

Hardware watchpoint supported by the target 

ST-LINK Firmware version : V2J40S7

Device ID: 0x452

PC: 0x800b380

ST-LINK device status: HALT_MODE

ST-LINK detects target voltage = 3.22 V

ST-LINK device status: HALT_MODE

Run external memory initializer

ST-LINK device initialization OK

Stm32Device, pollAndNotify running...

SwvSrv state change: 0 -> 1

Waiting for connection on port 61245...

Waiting for debugger connection...

Waiting for connection on port 61244...

Accepted connection on port 61244...

Debugger connected

Waiting for debugger connection...

Waiting for connection on port 61244...

GDB session thread running

GdbSessionManager, session started: 1

Warning: Ignoring a '-' sent by client.... 

Stm32Device, closeDevice() entry

GDB session, device event: 5

Stm32Device, pollAndNotify stopped

Stm32Device, closeDevice() exit

 ------ Switching to STM32CubeProgrammer ----- 

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

            STM32CubeProgrammer v2.8.0          

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

Log output file:  C:\Users\nbitan\AppData\Local\Temp\STM32CubeProgrammer_a25876.log

Warning: Wrong connect parameter: speed=fast

ST-Link Server is running on port : 7184

ST-LINK SN : 50FF6F067788545406291867

ST-LINK FW : V2J40S7

Board    : --

Voltage   : 3.22V

SWD freq  : 4000 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Device ID  : 0x452

Revision ID : Rev A

Device name : STM32F72x/STM32F73x

Flash size : 64 KBytes

Device type : MCU

Device CPU : Cortex-M7

BL Version : 0x__

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a25876.srec

 File     : ST-LINK_GDB_server_a25876.srec

 Size     : 594368 Bytes

 Address    : 0x08000000 

Erasing memory corresponding to segment 0:

Erasing memory corresponding to segment 1:

Erasing external memory sectors [0 8]

Download in Progress:

�������������������������������������������������� 0%

��������������������� 43%

Error: failed to download Segment[0]

Error: failed to download the File

 ------ Switching context ----- 

COM frequency = 4000 kHz

Target connection mode: Under reset

Reading ROM table for AP 0 @0xe00fdfd0

Hardware watchpoint supported by the target 

ST-LINK Firmware version : V2J40S7

Device ID: 0x452

PC: 0x800b380

ST-LINK detects target voltage = 3.22 V

ST-LINK device status: HALT_MODE

Run external memory initializer

GDB session, device event: 3

GDB session, device event: 1

ST-LINK device status: RUN_MODE

GDB session, device event: 4

GDB session, device event: 4

GDB session, device event: 6

Stm32Device, pollAndNotify running...

ST-LINK device status: HALT_MODE

GDB session, device event: 0

GDB session, device event: 3

GDB session, device event: 1

GDB session, device event: 0

NVIC_DFSR_REG = 0x0000000B 

GDB session, device event: 3

GDB session, device event: 1

ST-LINK device status: RUN_MODE

5 REPLIES 5

What you've provided here isn't particularly enlightening.

Is this a custom board, using a custom loader?

What STM32, pins and memory chip?

Is this something where you've previously tested the code?

Best to debug the BSP code outside of the loader first.

Use current version of the STM32 Cube Programmer, use higher Verbose level to understand the programmer's perspective.

Instrument your loader to use resources on your board, like a UART, to provide details from the loader's perspective.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
NBita.1
Associate II

so the story is that I have 2 projects

  1. STM32F730+GD25Q16E external flash -custom board,custom loader
  2. STM32H750+GD25Q127CSIGR external flash -custom board,custom loader

Both of them work great we succeed to burn and operate

I use cube ide 10

in the project -STM32H750+GD25Q127CSIGR external flash -custom board, custom loader

in the start, I have a problem with the download but after replacing the cube programmer from version 2.11 to 2.8 it all work very (succeed in downloading and debugging well)

with the st-link tool connected to SWD

  1. But in the project STM32F730+GD25Q16E external flash -custom board, custom loader

I face issues some of the time it's successful to download and most of the time not and not enter to debug

what do you mean by -use higher Verbose level 

any advice?

NBita.1
Associate II

any answer?

Sorry lot of specific stuff that I don't have, on a project that's not mine..

Both the GUI and CLI versions of STM32 Cube Programmer have methods to select the "Verbosity" of the logging output. These might provide some insight into what interactions are failing. Things like registers, timing of the interactions, timeouts, etc.

If you want insight into what the loader sees from inside the MCU you'll have to add instrumentation to report via a serial port that's available on your board.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
NBita.1
Associate II

Hi

I am working from the cubeIDE can you please be more specific on how to active the verbose mode in the debug? i try to read about that and didn't find info