Cant flash/debug VISUALGDB with STM32CUBEMX

Sysprogs forums Forums VisualGDB Cant flash/debug VISUALGDB with STM32CUBEMX

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #30509
    milamber
    Participant

    I have VS2019 and Visualgdb 5.5R4 build 3920.  I have an stlink v3 and my own board of  stm32h7XXX. When i create a solution based on the ’embedded  project wizard’ vgdb is able to correctly identify my stlink flash and debug my program. this is its output:

    C:\Users\george\AppData\Local\VisualGDB\EmbeddedDebugPackages\com.sysprogs.arm.openocd\bin\openocd.exe -c “gdb_port 62692” -c “telnet_port 62691” -f interface/stlink.cfg -f target/stm32h7x_dual_bank.cfg -c “echo VisualGDB_OpenOCD_Ready”
    Open On-Chip Debugger 0.10.0 (2020-12-28) [https://github.com/sysprogs/openocd]
    Licensed under GNU GPL v2
    libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    Info : auto-selecting first available session transport “hla_swd”. To override use ‘transport select <transport>’.
    Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
    VisualGDB_OpenOCD_Ready
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 62691 for telnet connections
    Info : clock speed 1800 kHz
    Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
    Info : STLINK V3J7M3B5S1 (API v3) VID:PID 0483:374F
    Info : Target voltage: 3.292205
    Info : stm32h7x.cpu0: hardware has 8 breakpoints, 4 watchpoints
    Info : starting gdb server for stm32h7x.cpu0 on 62692
    Info : Listening on port 62692 for gdb connections
    Info : accepting ‘gdb’ connection on tcp/62692
    target halted due to debug-request, current mode: Thread
    xPSR: 0x01000000 pc: 0x08007ac6 psp: 0x20000278
    Info : Device: STM32H7Ax/7Bx
    Info : flash size probed value 2048
    Info : STM32H7 flash has dual banks
    Info : Bank (0) size is 1024 kb, base address is 0x08000000
    Info : Device: STM32H7Ax/7Bx
    Info : flash size probed value 2048
    Info : STM32H7 flash has dual banks
    Info : Bank (1) size is 1024 kb, base address is 0x08100000
    Info : dropped ‘gdb’ connection (error -400)
    shutdown command invoked

     

    When i create a solution based on ‘STM32CUBEMX project wizard’ it fails to flash/debug and i get the following error:

    C:\Users\george\AppData\Local\VisualGDB\EmbeddedDebugPackages\com.sysprogs.arm.openocd\bin\openocd.exe -c “gdb_port 63046” -c “telnet_port 63045” -f interface/stlink.cfg -f target/stm32h7x_dual_bank.cfg -c init -c “reset init” -c “echo VisualGDB_OpenOCD_Ready”
    Open On-Chip Debugger 0.10.0 (2020-12-28) [https://github.com/sysprogs/openocd]
    Licensed under GNU GPL v2
    libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    Info : auto-selecting first available session transport “hla_swd”. To override use ‘transport select <transport>’.
    Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
    Info : clock speed 1800 kHz
    Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
    Info : STLINK V3J7M3B5S1 (API v3) VID:PID 0483:374F
    Info : Target voltage: 3.290606
    Info : stm32h7x.cpu0: hardware has 8 breakpoints, 4 watchpoints
    Info : starting gdb server for stm32h7x.cpu0 on 63046
    Info : Listening on port 63046 for gdb connections
    Error: timed out while waiting for target halted
    TARGET: stm32h7x.cpu0 – Not halted

     

     

    VisualGDB version: 5.5.104.3920
    —————— System.Exception ——————
    System.Exception: timed out while waiting for target halted
    at VisualGDB.Common_GUI.WPF.DebugMethodTestWindow.ThrowTestFailedException()
    at VisualGDB.Common_GUI.WPF.DebugMethodTestWindow.TestThreadBody()
    trace=[VisualGDB.Common_GUI.WPF.DebugMethodTestWindow.ThrowTestFailedException:56, VisualGDB.Common_GUI.WPF.DebugMethodTestWindow.TestThreadBody:198]

     

     

    this is the advanced log

    C:\Users\george\AppData\Local\VisualGDB\EmbeddedDebugPackages\com.sysprogs.arm.openocd\bin\openocd.exe -c “gdb_port 37568” -c “telnet_port 37567” -c “debug_level 3” -f interface/stlink.cfg -c “hla_serial 003500183038510334333935” -f target/stm32h7x_dual_bank.cfg -c init -c “reset init” -c “echo VisualGDB_OpenOCD_Ready”
    Open On-Chip Debugger 0.10.0 (2020-12-28) [https://github.com/sysprogs/openocd]
    Licensed under GNU GPL v2
    libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    User : 16 3 options.c:63 configuration_output_handler(): debug_level: 3
    User : 17 4 options.c:63 configuration_output_handler():
    Debug: 18 4 configuration.c:97 find_file(): found interface/stlink.cfg
    Debug: 19 6 command.c:146 script_debug(): command – adapter driver hla
    Debug: 21 6 command.c:146 script_debug(): command – hla_layout stlink
    Debug: 23 7 hla_interface.c:242 hl_interface_handle_layout_command(): hl_interface_handle_layout_command
    Debug: 24 7 command.c:146 script_debug(): command – hla_device_desc ST-LINK
    Debug: 26 7 hla_interface.c:216 hl_interface_handle_device_desc_command(): hl_interface_handle_device_desc_command
    Debug: 27 8 command.c:146 script_debug(): command – hla_vid_pid 0x0483 0x3744 0x0483 0x3748 0x0483 0x374b 0x0483 0x374d 0x0483 0x374e 0x0483 0x374f 0x0483 0x3752 0x0483 0x3753
    Debug: 29 8 command.c:146 script_debug(): command – hla_serial 003500183038510334333935
    Debug: 31 8 hla_interface.c:229 hl_interface_handle_serial_command(): hl_interface_handle_serial_command
    Debug: 32 9 configuration.c:97 find_file(): found target/stm32h7x_dual_bank.cfg
    Debug: 33 10 configuration.c:97 find_file(): found target/stm32h7x.cfg
    Debug: 34 11 configuration.c:97 find_file(): found target/swj-dp.tcl
    Debug: 35 11 command.c:146 script_debug(): command – transport select
    Info : 36 11 transport.c:275 jim_transport_select(): auto-selecting first available session transport “hla_swd”. To override use ‘transport select <transport>’.
    Debug: 37 12 hla_transport.c:205 hl_swd_transport_select(): hl_swd_transport_select
    Debug: 38 12 configuration.c:97 find_file(): found mem_helper.tcl
    Debug: 39 13 command.c:146 script_debug(): command – add_usage_text mrw address
    Debug: 41 13 command.c:1115 help_add_command(): added ‘mrw’ help text
    Debug: 42 13 command.c:146 script_debug(): command – add_help_text mrw Returns value of word in memory.
    Debug: 44 13 command.c:1128 help_add_command(): added ‘mrw’ help text
    Debug: 45 14 command.c:146 script_debug(): command – add_usage_text mrh address
    Debug: 47 14 command.c:1115 help_add_command(): added ‘mrh’ help text
    Debug: 48 14 command.c:146 script_debug(): command – add_help_text mrh Returns value of halfword in memory.
    Debug: 50 14 command.c:1128 help_add_command(): added ‘mrh’ help text
    Debug: 51 15 command.c:146 script_debug(): command – add_usage_text mrb address
    Debug: 53 15 command.c:1115 help_add_command(): added ‘mrb’ help text
    Debug: 54 15 command.c:146 script_debug(): command – add_help_text mrb Returns value of byte in memory.
    Debug: 56 16 command.c:1128 help_add_command(): added ‘mrb’ help text
    Debug: 57 16 command.c:146 script_debug(): command – add_usage_text mmw address setbits clearbits
    Debug: 59 16 command.c:1115 help_add_command(): added ‘mmw’ help text
    Debug: 60 16 command.c:146 script_debug(): command – add_help_text mmw Modify word in memory. new_val = (old_val & ~clearbits) | setbits;
    Debug: 62 17 command.c:1128 help_add_command(): added ‘mmw’ help text
    Debug: 63 17 command.c:146 script_debug(): command – transport select
    Debug: 64 18 command.c:146 script_debug(): command – transport select
    Debug: 65 18 command.c:146 script_debug(): command – transport select
    Debug: 66 18 command.c:146 script_debug(): command – swd newdap stm32h7x cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x6ba02477
    Debug: 67 18 hla_tcl.c:110 jim_hl_newtap_cmd(): Creating New Tap, Chip: stm32h7x, Tap: cpu, Dotted: stm32h7x.cpu, 8 params
    Debug: 68 19 hla_tcl.c:121 jim_hl_newtap_cmd(): Processing option: -irlen
    Debug: 69 19 hla_tcl.c:121 jim_hl_newtap_cmd(): Processing option: -ircapture
    Debug: 70 19 hla_tcl.c:121 jim_hl_newtap_cmd(): Processing option: -irmask
    Debug: 71 20 hla_tcl.c:121 jim_hl_newtap_cmd(): Processing option: -expected-id
    Debug: 72 20 core.c:1484 jtag_tap_init(): Created Tap: stm32h7x.cpu @ abs position 0, irlen 0, capture: 0x0 mask: 0x0
    Debug: 73 20 command.c:146 script_debug(): command – dap create stm32h7x.dap -chain-position stm32h7x.cpu
    Debug: 74 21 command.c:146 script_debug(): command – transport select
    Debug: 75 21 command.c:146 script_debug(): command – transport select
    Debug: 76 21 command.c:146 script_debug(): command – target create stm32h7x.cpu0 cortex_m -endian little -dap stm32h7x.dap -ap-num 0
    Info : 77 22 target.c:5746 target_create(): The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
    Debug: 78 22 hla_target.c:203 adapter_target_create(): adapter_target_create
    Debug: 79 23 hla_target.c:173 adapter_init_arch_info(): adapter_init_arch_info
    Debug: 80 23 command.c:375 register_command(): command ‘rtt’ is already registered in ‘<global>’ context
    Debug: 81 23 command.c:146 script_debug(): command – stm32h7x.cpu0 configure -work-area-phys 0x20000000 -work-area-size 0x10000 -work-area-backup 0
    Debug: 82 24 target.c:2151 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 83 24 target.c:2151 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 84 25 target.c:2151 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 85 25 command.c:146 script_debug(): command – flash bank stm32h7x.bank1.cpu0 stm32h7x 0x08000000 0 0 0 stm32h7x.cpu0
    Debug: 87 26 tcl.c:1319 handle_flash_bank_command(): ‘stm32h7x’ driver usage field missing
    Debug: 88 26 command.c:146 script_debug(): command – flash bank stm32h7x.bank2.cpu0 stm32h7x 0x08100000 0 0 0 stm32h7x.cpu0
    Debug: 90 27 command.c:375 register_command(): command ‘stm32h7x’ is already registered in ‘<global>’ context
    Debug: 91 27 command.c:375 register_command(): command ‘lock’ is already registered in ‘stm32h7x’ context
    Debug: 92 27 command.c:375 register_command(): command ‘unlock’ is already registered in ‘stm32h7x’ context
    Debug: 93 28 command.c:375 register_command(): command ‘mass_erase’ is already registered in ‘stm32h7x’ context
    Debug: 94 28 command.c:375 register_command(): command ‘option_read’ is already registered in ‘stm32h7x’ context
    Debug: 95 28 command.c:375 register_command(): command ‘option_write’ is already registered in ‘stm32h7x’ context
    Debug: 96 29 tcl.c:1319 handle_flash_bank_command(): ‘stm32h7x’ driver usage field missing
    Debug: 97 29 command.c:146 script_debug(): command – targets stm32h7x.cpu0
    Debug: 99 29 command.c:146 script_debug(): command – adapter speed 1800
    Debug: 101 30 core.c:1822 jtag_config_khz(): handle jtag khz
    Debug: 102 30 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
    Debug: 103 30 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
    Debug: 104 30 command.c:146 script_debug(): command – adapter srst delay 100
    Debug: 106 31 command.c:146 script_debug(): command – transport select
    Debug: 107 31 command.c:146 script_debug(): command – reset_config srst_only srst_nogate
    Debug: 109 31 command.c:146 script_debug(): command – transport select
    Debug: 110 31 command.c:146 script_debug(): command – stm32h7x.cpu0 configure -event examine-end
    # Enable D3 and D1 DBG clocks
    # DBGMCU_CR |= D3DBGCKEN | D1DBGCKEN
    stm32h7x_dbgmcu_mmw 0x004 0x00600000 0

    # Enable debug during low power modes (uses more power)
    # DBGMCU_CR |= DBG_STANDBY | DBG_STOP | DBG_SLEEP D1 Domain
    stm32h7x_dbgmcu_mmw 0x004 0x00000007 0
    # DBGMCU_CR |= DBG_STANDBY | DBG_STOP | DBG_SLEEP D2 Domain
    stm32h7x_dbgmcu_mmw 0x004 0x00000038 0

    # Stop watchdog counters during halt
    # DBGMCU_APB3FZ1 |= WWDG1
    stm32h7x_dbgmcu_mmw 0x034 0x00000040 0
    # DBGMCU_APB1LFZ1 |= WWDG2
    stm32h7x_dbgmcu_mmw 0x03C 0x00000800 0
    # DBGMCU_APB4FZ1 |= WDGLSD1 | WDGLSD2
    stm32h7x_dbgmcu_mmw 0x054 0x000C0000 0

    Debug: 111 34 command.c:146 script_debug(): command – stm32h7x.cpu0 configure -event trace-config
    # Set TRACECLKEN; TRACE_MODE is set to async; when using sync
    # change this value accordingly to configure trace pins
    # assignment
    stm32h7x_dbgmcu_mmw 0x004 0x00100000 0

    Debug: 112 35 command.c:146 script_debug(): command – stm32h7x.cpu0 configure -event reset-init
    # Clock after reset is HSI at 64 MHz, no need of PLL
    adapter speed 4000

    Debug: 113 35 command.c:146 script_debug(): command – init
    Debug: 115 35 command.c:146 script_debug(): command – target init
    Debug: 117 35 command.c:146 script_debug(): command – target names
    Debug: 118 35 command.c:146 script_debug(): command – stm32h7x.cpu0 cget -event gdb-flash-erase-start
    Debug: 119 35 command.c:146 script_debug(): command – stm32h7x.cpu0 configure -event gdb-flash-erase-start reset init
    Debug: 120 36 command.c:146 script_debug(): command – stm32h7x.cpu0 cget -event gdb-flash-write-end
    Debug: 121 36 command.c:146 script_debug(): command – stm32h7x.cpu0 configure -event gdb-flash-write-end reset halt
    Debug: 122 36 command.c:146 script_debug(): command – stm32h7x.cpu0 cget -event gdb-attach
    Debug: 123 36 command.c:146 script_debug(): command – stm32h7x.cpu0 configure -event gdb-attach halt 1000
    Debug: 124 36 target.c:1618 handle_target_init_command(): Initializing targets…
    Debug: 125 36 hla_target.c:193 adapter_init_target(): adapter_init_target
    Debug: 126 37 semihosting_common.c:97 semihosting_common_init():
    Debug: 127 37 hla_interface.c:109 hl_interface_init(): hl_interface_init
    Debug: 128 37 hla_layout.c:95 hl_layout_init(): hl_layout_init
    Debug: 129 37 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
    Debug: 130 37 core.c:1789 adapter_khz_to_speed(): have interface set up
    Debug: 131 37 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
    Debug: 132 37 core.c:1789 adapter_khz_to_speed(): have interface set up
    Info : 133 38 core.c:1565 adapter_init(): clock speed 1800 kHz
    Debug: 134 38 openocd.c:143 handle_init_command(): Debug Adapter init complete
    Debug: 135 38 command.c:146 script_debug(): command – transport init
    Debug: 137 38 transport.c:229 handle_transport_init(): handle_transport_init
    Debug: 138 38 hla_transport.c:156 hl_transport_init(): hl_transport_init
    Debug: 139 38 hla_transport.c:173 hl_transport_init(): current transport hla_swd
    Debug: 140 38 hla_interface.c:42 hl_interface_open(): hl_interface_open
    Debug: 141 38 hla_layout.c:40 hl_layout_open(): hl_layout_open
    Debug: 142 39 stlink_usb.c:2819 stlink_usb_open(): stlink_usb_open
    Debug: 143 39 stlink_usb.c:2831 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x3744 serial: 003500183038510334333935
    Debug: 144 39 stlink_usb.c:2831 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x3748 serial: 003500183038510334333935
    Debug: 145 39 stlink_usb.c:2831 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x374b serial: 003500183038510334333935
    Debug: 146 39 stlink_usb.c:2831 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x374d serial: 003500183038510334333935
    Debug: 147 39 stlink_usb.c:2831 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x374e serial: 003500183038510334333935
    Debug: 148 40 stlink_usb.c:2831 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x374f serial: 003500183038510334333935
    Debug: 149 40 stlink_usb.c:2831 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x3752 serial: 003500183038510334333935
    Debug: 150 40 stlink_usb.c:2831 stlink_usb_open(): transport: 4 vid: 0x0483 pid: 0x3753 serial: 003500183038510334333935
    Error: 151 135 libusb_helper.c:186 jtag_libusb_open(): libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
    Info : 152 138 stlink_usb.c:1098 stlink_usb_version(): STLINK V3J7M3B5S1 (API v3) VID:PID 0483:374F
    Debug: 153 138 stlink_usb.c:1323 stlink_usb_exit_mode(): MODE: 0x01
    Info : 154 139 stlink_usb.c:1134 stlink_usb_check_voltage(): Target voltage: 3.293804
    Debug: 155 140 stlink_usb.c:1391 stlink_usb_init_mode(): MODE: 0x01
    Debug: 156 140 stlink_usb.c:2606 stlink_dump_speed_map(): Supported clock speeds are:
    Debug: 157 141 stlink_usb.c:2609 stlink_dump_speed_map(): 24000 kHz
    Debug: 158 141 stlink_usb.c:2609 stlink_dump_speed_map(): 8000 kHz
    Debug: 159 141 stlink_usb.c:2609 stlink_dump_speed_map(): 3300 kHz
    Debug: 160 141 stlink_usb.c:2609 stlink_dump_speed_map(): 1000 kHz
    Debug: 161 141 stlink_usb.c:2609 stlink_dump_speed_map(): 200 kHz
    Debug: 162 141 stlink_usb.c:2609 stlink_dump_speed_map(): 50 kHz
    Debug: 163 142 stlink_usb.c:2609 stlink_dump_speed_map(): 5 kHz
    Debug: 164 147 stlink_usb.c:1450 stlink_usb_init_mode(): MODE: 0x02
    Debug: 165 148 stlink_usb.c:3238 stlink_usb_open_ap(): AP 0 enabled
    Debug: 166 149 stlink_usb.c:2990 stlink_usb_open(): Using TAR autoincrement: 1024
    Debug: 167 149 core.c:640 adapter_system_reset(): SRST line released
    Debug: 168 310 hla_interface.c:67 hl_interface_init_target(): hl_interface_init_target
    Debug: 169 311 stlink_usb.c:1683 stlink_usb_idcode(): IDCODE: 0x6BA02477
    Debug: 170 311 command.c:146 script_debug(): command – dap init
    Debug: 172 311 arm_dap.c:106 dap_init_all(): Initializing all DAPs …
    Debug: 173 311 openocd.c:160 handle_init_command(): Examining targets…
    Debug: 174 311 target.c:1804 target_call_event_callbacks(): target event 19 (examine-start) for core stm32h7x.cpu0
    Debug: 175 312 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0xe000ed00 4 1
    Debug: 176 318 target.c:2566 target_read_u32(): address: 0xe000ed00, value: 0x411fc271
    Debug: 177 318 cortex_m.c:2056 cortex_m_examine(): Cortex-M7 r1p1 processor detected
    Debug: 178 318 cortex_m.c:2068 cortex_m_examine(): cpuid: 0x411fc271
    Debug: 179 319 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0xe000ef40 4 1
    Debug: 180 325 target.c:2566 target_read_u32(): address: 0xe000ef40, value: 0x10110221
    Debug: 181 325 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0xe000ef44 4 1
    Debug: 182 332 target.c:2566 target_read_u32(): address: 0xe000ef44, value: 0x12000011
    Debug: 183 332 cortex_m.c:2091 cortex_m_examine(): Cortex-M7 floating point feature FPv5_DP found
    Debug: 184 332 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0xe000edf0 4 1
    Debug: 185 335 target.c:2566 target_read_u32(): address: 0xe000edf0, value: 0x01010001
    Debug: 186 335 target.c:2654 target_write_u32(): address: 0xe000edfc, value: 0x01000000
    Debug: 187 335 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0xe000edfc 4 1
    Debug: 188 337 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0xe0002000 4 1
    Debug: 189 339 target.c:2566 target_read_u32(): address: 0xe0002000, value: 0x10000080
    Debug: 190 339 target.c:2654 target_write_u32(): address: 0xe0002008, value: 0x00000000
    Debug: 191 339 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0xe0002008 4 1
    Debug: 192 342 target.c:2654 target_write_u32(): address: 0xe000200c, value: 0x00000000
    Debug: 193 342 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0xe000200c 4 1
    Debug: 194 344 target.c:2654 target_write_u32(): address: 0xe0002010, value: 0x00000000
    Debug: 195 344 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0xe0002010 4 1
    Debug: 196 351 target.c:2654 target_write_u32(): address: 0xe0002014, value: 0x00000000
    Debug: 197 351 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0xe0002014 4 1
    Debug: 198 358 target.c:2654 target_write_u32(): address: 0xe0002018, value: 0x00000000
    Debug: 199 358 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0xe0002018 4 1
    Debug: 200 360 target.c:2654 target_write_u32(): address: 0xe000201c, value: 0x00000000
    Debug: 201 360 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0xe000201c 4 1
    Debug: 202 361 target.c:2654 target_write_u32(): address: 0xe0002020, value: 0x00000000
    Debug: 203 362 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0xe0002020 4 1
    Debug: 204 363 target.c:2654 target_write_u32(): address: 0xe0002024, value: 0x00000000
    Debug: 205 363 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0xe0002024 4 1
    Debug: 206 366 cortex_m.c:2169 cortex_m_examine(): FPB fpcr 0x10000080, numcode 8, numlit 0
    Debug: 207 366 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0xe0001000 4 1
    Debug: 208 367 target.c:2566 target_read_u32(): address: 0xe0001000, value: 0x40000000
    Debug: 209 367 cortex_m.c:1886 cortex_m_dwt_setup(): DWT_CTRL: 0x40000000
    Debug: 210 367 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0xe0001fbc 4 1
    Debug: 211 368 target.c:2566 target_read_u32(): address: 0xe0001fbc, value: 0x00000000
    Debug: 212 368 cortex_m.c:1893 cortex_m_dwt_setup(): DWT_DEVARCH: 0x0
    Debug: 213 368 target.c:2654 target_write_u32(): address: 0xe0001028, value: 0x00000000
    Debug: 214 369 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0xe0001028 4 1
    Debug: 215 370 target.c:2654 target_write_u32(): address: 0xe0001038, value: 0x00000000
    Debug: 216 370 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0xe0001038 4 1
    Debug: 217 371 target.c:2654 target_write_u32(): address: 0xe0001048, value: 0x00000000
    Debug: 218 372 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0xe0001048 4 1
    Debug: 219 373 target.c:2654 target_write_u32(): address: 0xe0001058, value: 0x00000000
    Debug: 220 373 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0xe0001058 4 1
    Debug: 221 375 cortex_m.c:1940 cortex_m_dwt_setup(): DWT dwtcr 0x40000000, comp 4, watch/trigger
    Info : 222 375 cortex_m.c:2179 cortex_m_examine(): stm32h7x.cpu0: hardware has 8 breakpoints, 4 watchpoints
    Debug: 223 375 target.c:1804 target_call_event_callbacks(): target event 21 (examine-end) for core stm32h7x.cpu0
    Debug: 224 375 target.c:4849 target_handle_event(): target(0): stm32h7x.cpu0 (hla_target) event: 21 (examine-end) action:
    # Enable D3 and D1 DBG clocks
    # DBGMCU_CR |= D3DBGCKEN | D1DBGCKEN
    stm32h7x_dbgmcu_mmw 0x004 0x00600000 0

    # Enable debug during low power modes (uses more power)
    # DBGMCU_CR |= DBG_STANDBY | DBG_STOP | DBG_SLEEP D1 Domain
    stm32h7x_dbgmcu_mmw 0x004 0x00000007 0
    # DBGMCU_CR |= DBG_STANDBY | DBG_STOP | DBG_SLEEP D2 Domain
    stm32h7x_dbgmcu_mmw 0x004 0x00000038 0

    # Stop watchdog counters during halt
    # DBGMCU_APB3FZ1 |= WWDG1
    stm32h7x_dbgmcu_mmw 0x034 0x00000040 0
    # DBGMCU_APB1LFZ1 |= WWDG2
    stm32h7x_dbgmcu_mmw 0x03C 0x00000800 0
    # DBGMCU_APB4FZ1 |= WDGLSD1 | WDGLSD2
    stm32h7x_dbgmcu_mmw 0x054 0x000C0000 0

    Debug: 225 377 command.c:146 script_debug(): command – transport select
    Debug: 226 377 command.c:146 script_debug(): command – target current
    Debug: 227 378 command.c:146 script_debug(): command – stm32h7x.cpu0 mem2array value 32 1543507972 1
    Debug: 228 378 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0x5c001004 4 1
    Debug: 229 379 command.c:146 script_debug(): command – stm32h7x.cpu0 mww 1543507972 6291519
    Debug: 231 381 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0x5c001004 4 1
    Debug: 232 382 command.c:146 script_debug(): command – transport select
    Debug: 233 382 command.c:146 script_debug(): command – target current
    Debug: 234 382 command.c:146 script_debug(): command – stm32h7x.cpu0 mem2array value 32 1543507972 1
    Debug: 235 382 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0x5c001004 4 1
    Debug: 236 383 command.c:146 script_debug(): command – stm32h7x.cpu0 mww 1543507972 6291519
    Debug: 238 384 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0x5c001004 4 1
    Debug: 239 385 command.c:146 script_debug(): command – transport select
    Debug: 240 385 command.c:146 script_debug(): command – target current
    Debug: 241 385 command.c:146 script_debug(): command – stm32h7x.cpu0 mem2array value 32 1543507972 1
    Debug: 242 386 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0x5c001004 4 1
    Debug: 243 387 command.c:146 script_debug(): command – stm32h7x.cpu0 mww 1543507972 6291519
    Debug: 245 388 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0x5c001004 4 1
    Debug: 246 389 command.c:146 script_debug(): command – transport select
    Debug: 247 389 command.c:146 script_debug(): command – target current
    Debug: 248 389 command.c:146 script_debug(): command – stm32h7x.cpu0 mem2array value 32 1543508020 1
    Debug: 249 390 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0x5c001034 4 1
    Debug: 250 391 command.c:146 script_debug(): command – stm32h7x.cpu0 mww 1543508020 64
    Debug: 252 392 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0x5c001034 4 1
    Debug: 253 393 command.c:146 script_debug(): command – transport select
    Debug: 254 394 command.c:146 script_debug(): command – target current
    Debug: 255 394 command.c:146 script_debug(): command – stm32h7x.cpu0 mem2array value 32 1543508028 1
    Debug: 256 394 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0x5c00103c 4 1
    Debug: 257 396 command.c:146 script_debug(): command – stm32h7x.cpu0 mww 1543508028 2048
    Debug: 259 397 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0x5c00103c 4 1
    Debug: 260 398 command.c:146 script_debug(): command – transport select
    Debug: 261 398 command.c:146 script_debug(): command – target current
    Debug: 262 398 command.c:146 script_debug(): command – stm32h7x.cpu0 mem2array value 32 1543508052 1
    Debug: 263 398 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0x5c001054 4 1
    Debug: 264 400 command.c:146 script_debug(): command – stm32h7x.cpu0 mww 1543508052 786432
    Debug: 266 401 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0x5c001054 4 1
    Debug: 267 402 command.c:146 script_debug(): command – flash init
    Debug: 269 403 tcl.c:1385 handle_flash_init_command(): Initializing flash devices…
    Debug: 270 403 command.c:146 script_debug(): command – nand init
    Debug: 272 404 tcl.c:498 handle_nand_init_command(): Initializing NAND devices…
    Debug: 273 405 command.c:146 script_debug(): command – pld init
    Debug: 275 405 pld.c:206 handle_pld_init_command(): Initializing PLDs…
    Info : 276 405 gdb_server.c:3523 gdb_target_start(): starting gdb server for stm32h7x.cpu0 on 37568
    Info : 277 407 server.c:311 add_service(): Listening on port 37568 for gdb connections
    Debug: 278 407 command.c:146 script_debug(): command – reset init
    Debug: 280 408 target.c:1823 target_call_reset_callbacks(): target reset 3 (init)
    Debug: 281 408 command.c:146 script_debug(): command – target names
    Debug: 282 408 command.c:146 script_debug(): command – stm32h7x.cpu0 invoke-event reset-start
    Debug: 283 408 command.c:146 script_debug(): command – transport select
    Debug: 284 409 command.c:146 script_debug(): command – transport select
    Debug: 285 409 command.c:146 script_debug(): command – stm32h7x.cpu0 invoke-event examine-start
    Debug: 286 409 command.c:146 script_debug(): command – stm32h7x.cpu0 arp_examine allow-defer
    Debug: 287 409 command.c:146 script_debug(): command – stm32h7x.cpu0 invoke-event examine-end
    Debug: 288 409 target.c:4849 target_handle_event(): target(0): stm32h7x.cpu0 (hla_target) event: 21 (examine-end) action:
    # Enable D3 and D1 DBG clocks
    # DBGMCU_CR |= D3DBGCKEN | D1DBGCKEN
    stm32h7x_dbgmcu_mmw 0x004 0x00600000 0

    # Enable debug during low power modes (uses more power)
    # DBGMCU_CR |= DBG_STANDBY | DBG_STOP | DBG_SLEEP D1 Domain
    stm32h7x_dbgmcu_mmw 0x004 0x00000007 0
    # DBGMCU_CR |= DBG_STANDBY | DBG_STOP | DBG_SLEEP D2 Domain
    stm32h7x_dbgmcu_mmw 0x004 0x00000038 0

    # Stop watchdog counters during halt
    # DBGMCU_APB3FZ1 |= WWDG1
    stm32h7x_dbgmcu_mmw 0x034 0x00000040 0
    # DBGMCU_APB1LFZ1 |= WWDG2
    stm32h7x_dbgmcu_mmw 0x03C 0x00000800 0
    # DBGMCU_APB4FZ1 |= WDGLSD1 | WDGLSD2
    stm32h7x_dbgmcu_mmw 0x054 0x000C0000 0

    Debug: 289 411 command.c:146 script_debug(): command – transport select
    Debug: 290 411 command.c:146 script_debug(): command – target current
    Debug: 291 411 command.c:146 script_debug(): command – stm32h7x.cpu0 mem2array value 32 1543507972 1
    Debug: 292 411 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0x5c001004 4 1
    Debug: 293 413 command.c:146 script_debug(): command – stm32h7x.cpu0 mww 1543507972 6291519
    Debug: 295 413 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0x5c001004 4 1
    Debug: 296 415 command.c:146 script_debug(): command – transport select
    Debug: 297 415 command.c:146 script_debug(): command – target current
    Debug: 298 415 command.c:146 script_debug(): command – stm32h7x.cpu0 mem2array value 32 1543507972 1
    Debug: 299 415 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0x5c001004 4 1
    Debug: 300 417 command.c:146 script_debug(): command – stm32h7x.cpu0 mww 1543507972 6291519
    Debug: 302 417 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0x5c001004 4 1
    Debug: 303 418 command.c:146 script_debug(): command – transport select
    Debug: 304 418 command.c:146 script_debug(): command – target current
    Debug: 305 418 command.c:146 script_debug(): command – stm32h7x.cpu0 mem2array value 32 1543507972 1
    Debug: 306 418 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0x5c001004 4 1
    Debug: 307 420 command.c:146 script_debug(): command – stm32h7x.cpu0 mww 1543507972 6291519
    Debug: 309 420 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0x5c001004 4 1
    Debug: 310 421 command.c:146 script_debug(): command – transport select
    Debug: 311 421 command.c:146 script_debug(): command – target current
    Debug: 312 421 command.c:146 script_debug(): command – stm32h7x.cpu0 mem2array value 32 1543508020 1
    Debug: 313 422 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0x5c001034 4 1
    Debug: 314 423 command.c:146 script_debug(): command – stm32h7x.cpu0 mww 1543508020 64
    Debug: 316 423 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0x5c001034 4 1
    Debug: 317 425 command.c:146 script_debug(): command – transport select
    Debug: 318 425 command.c:146 script_debug(): command – target current
    Debug: 319 425 command.c:146 script_debug(): command – stm32h7x.cpu0 mem2array value 32 1543508028 1
    Debug: 320 425 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0x5c00103c 4 1
    Debug: 321 426 command.c:146 script_debug(): command – stm32h7x.cpu0 mww 1543508028 2048
    Debug: 323 427 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0x5c00103c 4 1
    Debug: 324 428 command.c:146 script_debug(): command – transport select
    Debug: 325 428 command.c:146 script_debug(): command – target current
    Debug: 326 428 command.c:146 script_debug(): command – stm32h7x.cpu0 mem2array value 32 1543508052 1
    Debug: 327 428 hla_target.c:602 adapter_read_memory(): adapter_read_memory 0x5c001054 4 1
    Debug: 328 429 command.c:146 script_debug(): command – stm32h7x.cpu0 mww 1543508052 786432
    Debug: 330 429 hla_target.c:617 adapter_write_memory(): adapter_write_memory 0x5c001054 4 1
    Debug: 331 430 command.c:146 script_debug(): command – stm32h7x.cpu0 invoke-event reset-assert-pre
    Debug: 332 430 command.c:146 script_debug(): command – transport select
    Debug: 333 431 command.c:146 script_debug(): command – stm32h7x.cpu0 arp_reset assert 1
    Debug: 334 431 target.c:2151 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 335 431 hla_target.c:344 hl_assert_reset(): hl_assert_reset
    Debug: 336 431 core.c:636 adapter_system_reset(): SRST line asserted
    Debug: 337 434 command.c:146 script_debug(): command – stm32h7x.cpu0 invoke-event reset-assert-post
    Debug: 338 434 command.c:146 script_debug(): command – stm32h7x.cpu0 invoke-event reset-deassert-pre
    Debug: 339 435 command.c:146 script_debug(): command – transport select
    Debug: 340 435 command.c:146 script_debug(): command – stm32h7x.cpu0 arp_reset deassert 1
    Debug: 341 435 target.c:2151 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 342 435 hla_target.c:403 hl_deassert_reset(): hl_deassert_reset
    Debug: 343 436 core.c:640 adapter_system_reset(): SRST line released
    Debug: 345 594 command.c:146 script_debug(): command – stm32h7x.cpu0 invoke-event reset-deassert-post
    Debug: 346 594 command.c:146 script_debug(): command – transport select
    Debug: 347 594 command.c:146 script_debug(): command – stm32h7x.cpu0 was_examined
    Debug: 348 594 command.c:146 script_debug(): command – stm32h7x.cpu0 arp_waitstate halted 1000
    Debug: 349 595 target.c:3220 target_wait_state(): waiting for target halted…
    Error: 351 1596 target.c:3228 target_wait_state(): timed out while waiting for target halted
    Debug: 352 1596 command.c:146 script_debug(): command – stm32h7x.cpu0 curstate
    Debug: 353 1596 command.c:628 run_command(): Command ‘reset’ failed with error code -4
    User : 354 1597 command.c:694 command_run_line(): TARGET: stm32h7x.cpu0 – Not halted
    Debug: 355 1597 target.c:2151 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 356 1597 hla_interface.c:117 hl_interface_quit(): hl_interface_quit
    Debug: 357 1598 stlink_usb.c:1323 stlink_usb_exit_mode(): MODE: 0x02

     

     

    #30510
    support
    Keymaster

    Hi,

    Most likely, when using the STM32CubeMX project, you select some settings that interfere with debugging. Please try checking if the project is debuggable with other tools (e.g. STM32CubeMX tool or by running OpenOCD manually). If not, please refer to your device datasheet to make sure all prerequisites for debugging are fulfilled.

    #30511
    milamber
    Participant

    when i generate code with STM32CubeMX  and create a STM32CubeIde project based on the exact same ioc definition STM32CubeIde  is capable of debug / flash it.

    Do you want me to try anything else?

    #30512
    milamber
    Participant

    it seems that STM32CubeIDE is able to connect when the debug probe is “st-link (st-link gdb server)” in the debugger configuration properties. if i change that to “st-link (openocd)” then i get the same behaviour. is it a problem with openocd?

     

    Open On-Chip Debugger 0.11.0-rc2+dev-00037-g4c4dbd9 (2021-02-09-13:39)
    Licensed under GNU GPL v2
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 4444 for telnet connections
    Info : STLINK V3J7M3B5S1 (API v3) VID:PID 0483:374F
    Info : Target voltage: 3.290606
    Info : clock speed 8000 kHz
    Info : stlink_dap_op_connect(connect)
    Info : SWD DPIDR 0x6ba02477
    Info : STM32H7A3ZITx.cm7: hardware has 8 breakpoints, 4 watchpoints
    Info : starting gdb server for STM32H7A3ZITx.cm7 on 3333
    Info : Listening on port 3333 for gdb connections
    Info : accepting ‘gdb’ connection on tcp/3333
    Error: timed out while waiting for target halted
    Error executing event gdb-attach on target STM32H7A3ZITx.cm7:
    TARGET: STM32H7A3ZITx.cm7 – Not halted
    Info : Device: STM32H7Ax/7Bx
    Info : flash size probed value 2048
    Info : STM32H7 flash has dual banks
    Info : Bank (0) size is 1024 kb, base address is 0x08000000
    Info : Device: STM32H7Ax/7Bx
    Info : flash size probed value 2048
    Info : STM32H7 flash has dual banks
    Info : Bank (1) size is 1024 kb, base address is 0x08100000
    Info : New GDB Connection: 1, Target STM32H7A3ZITx.cm7, state: running
    Warn : GDB connection 1 on target STM32H7A3ZITx.cm7 not halted
    Info : accepting ‘gdb’ connection on tcp/3333
    Error: timed out while waiting for target halted
    Error executing event gdb-attach on target STM32H7A3ZITx.cm7:
    TARGET: STM32H7A3ZITx.cm7 – Not halted
    Info : New GDB Connection: 2, Target STM32H7A3ZITx.cm7, state: running
    Warn : GDB connection 2 on target STM32H7A3ZITx.cm7 not halted
    Error: timed out while waiting for target halted
    Error executing event gdb-flash-erase-start on target STM32H7A3ZITx.cm7:
    TARGET: STM32H7A3ZITx.cm7 – Not halted
    Error: failed erasing sectors 0 to 4
    Error: flash_erase returned -304
    shutdown command invoked
    Info : dropped ‘gdb’ connection
    shutdown command invoked

    #30513
    milamber
    Participant

    I was able to communicate with the board using openocd and interface/stlink.cfg but i still get an error when trying to flash. the crc mode is activated in the project.

     

    VisualGDB version: 5.5.104.3920
    —————— f22+o1 ——————
    f22+o1: Failed to program 7 out of 7 sections
    at VisualGDB.Common_GUI.WPF.ItemizedProgressWindow.RunAction[_ResultType](kk1`1 action, String title, String caption, cs2 exceptionHandler, Int32 noFormTimeout, String[] stages)
    at xs1.d`1.c()
    at y01.q2[_Type](w`1 a)
    at xs1.s_2[_ResultType](kk1`1 d, String a, Int32 b, String[] c)
    at qc.LaunchGDBProjectWithoutDebugging.ExecuteForProject(qc instance, Project prj)
    trace=[VisualGDB.Common_GUI.WPF.ItemizedProgressWindow.RunAction:167, xs1+d`1.c:0, y01.q2:71, xs1.s_2:157, qc+LaunchGDBProjectWithoutDebugging.ExecuteForProject:193]

    C:\Users\george\AppData\Local\VisualGDB\EmbeddedDebugPackages\com.sysprogs.arm.openocd\bin\openocd.exe -c “gdb_port 43349” -c “telnet_port 43348” -f interface/stlink.cfg -c “transport select hla_swd” -f target/stm32h7x_dual_bank.cfg -c “echo VisualGDB_OpenOCD_Ready”
    Open On-Chip Debugger 0.10.0 (2020-12-28) [https://github.com/sysprogs/openocd]
    Licensed under GNU GPL v2
    libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    hla_swd
    Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
    VisualGDB_OpenOCD_Ready
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 43348 for telnet connections
    Info : clock speed 1800 kHz
    Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
    Info : STLINK V3J7M3B5S1 (API v3) VID:PID 0483:374F
    Info : Target voltage: 3.293804
    Info : stm32h7x.cpu0: hardware has 8 breakpoints, 4 watchpoints
    Info : starting gdb server for stm32h7x.cpu0 on 43349
    Info : Listening on port 43349 for gdb connections
    Info : accepting ‘gdb’ connection on tcp/43349
    Info : Device: STM32H7Ax/7Bx
    Info : flash size probed value 2048
    Info : STM32H7 flash has dual banks
    Info : Bank (0) size is 1024 kb, base address is 0x08000000
    Info : Device: STM32H7Ax/7Bx
    Info : flash size probed value 2048
    Info : STM32H7 flash has dual banks
    Info : Bank (1) size is 1024 kb, base address is 0x08100000
    Warn : Prefer GDB command “target extended-remote 43349” instead of “target remote 43349”
    Info : Device: STM32H7Ax/7Bx
    Info : flash size probed value 2048
    Info : STM32H7 flash has dual banks
    Info : Bank (0) size is 1024 kb, base address is 0x08000000
    Info : Device: STM32H7Ax/7Bx
    Info : flash size probed value 2048
    Info : STM32H7 flash has dual banks
    Info : Bank (1) size is 1024 kb, base address is 0x08100000
    flash_bank_summary:0x8000000|0x100000|stm32h7x.bank1.cpu0
    flash_bank_summary:0x8100000|0x100000|stm32h7x.bank2.cpu0
    FLASH progress reporting is now on

    Error: timed out while waiting for target halted
    Error executing event gdb-flash-erase-start on target stm32h7x.cpu0:
    TARGET: stm32h7x.cpu0 – Not halted
    Info : Erasing FLASH: 0x08000000-0x0800a000…
    Error: failed erasing sectors 0 to 4
    Error: flash_erase returned -304
    Warn : target not halted
    Error: error executing cortex_m crc algorithm
    Warn : target not halted
    Error: error executing cortex_m crc algorithm
    Warn : target not halted
    Error: error executing cortex_m crc algorithm
    Warn : target not halted
    Error: error executing cortex_m crc algorithm
    Warn : target not halted
    Error: error executing cortex_m crc algorithm
    Warn : target not halted
    Error: error executing cortex_m crc algorithm
    Warn : target not halted
    Error: error executing cortex_m crc algorithm
    Info : dropped ‘gdb’ connection (error -400)
    shutdown command invoked

     

    C:\SysGCC\arm-eabi\bin\arm-none-eabi-gdb.exe –interpreter mi “../Draft_test_mx/Draft_test_mx/build/VisualGDB/Debug/Draft_test_mx”
    C:\SysGCC\arm-eabi\bin\arm-none-eabi-gdb.exe –interpreter mi “../Draft_test_mx/Draft_test_mx/build/VisualGDB/Debug/Draft_test_mx”
    -gdb-version
    -gdb-version
    C:\SysGCC\arm-eabi\bin\arm-none-eabi-gdb.exe: warning: Couldn’t determine a path for the index cache directory.
    C:\SysGCC\arm-eabi\bin\arm-none-eabi-gdb.exe: warning: Couldn’t determine a path for the index cache directory.
    C:\SysGCC\arm-eabi\bin\arm-none-eabi-gdb.exe: warning: Couldn’t determine a path for the index cache directory.
    =thread-group-added,id=”i1″
    =thread-group-added,id=”i1″
    =thread-group-added,id=”i1″
    ~”GNU gdb (GDB) 9.2\n”
    ~”GNU gdb (GDB) 9.2\n”
    ~”GNU gdb (GDB) 9.2\n”
    ~”Copyright (C) 2020 Free Software Foundation, Inc.\n”
    ~”Copyright (C) 2020 Free Software Foundation, Inc.\n”
    ~”Copyright (C) 2020 Free Software Foundation, Inc.\n”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
    ~”\nType \”show copying\” and \”show warranty\” for details.\n”
    ~”\nType \”show copying\” and \”show warranty\” for details.\n”
    ~”\nType \”show copying\” and \”show warranty\” for details.\n”
    ~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
    ~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
    ~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
    ~”Type \”show configuration\” for configuration details.\n”
    ~”Type \”show configuration\” for configuration details.\n”
    ~”Type \”show configuration\” for configuration details.\n”
    ~”For bug reporting instructions, please see:\n”
    ~”For bug reporting instructions, please see:\n”
    ~”For bug reporting instructions, please see:\n”
    ~”<http://www.gnu.org/software/gdb/bugs/&gt;.\n”
    ~”<http://www.gnu.org/software/gdb/bugs/&gt;.\n”
    ~”<http://www.gnu.org/software/gdb/bugs/&gt;.\n”
    ~”Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/&gt;.”
    ~”Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/&gt;.”
    ~”Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/&gt;.”
    ~”\n\n”
    ~”\n\n”
    ~”\n\n”
    ~”For help, type \”help\”.\n”
    ~”For help, type \”help\”.\n”
    ~”For help, type \”help\”.\n”
    ~”Type \”apropos word\” to search for commands related to \”word\”…\n”
    ~”Type \”apropos word\” to search for commands related to \”word\”…\n”
    ~”Type \”apropos word\” to search for commands related to \”word\”…\n”
    ~”Reading symbols from /Draft_test_mx/Draft_test_mx/build/VisualGDB/Debug/Draft_test_mx…\n”
    ~”Reading symbols from /Draft_test_mx/Draft_test_mx/build/VisualGDB/Debug/Draft_test_mx…\n”
    ~”Reading symbols from/Draft_test_mx/Draft_test_mx/build/VisualGDB/Debug/Draft_test_mx…\n”
    (gdb)
    ~”GNU gdb (GDB) 9.2\n”
    ~”GNU gdb (GDB) 9.2\n”
    ~”GNU gdb (GDB) 9.2\n”
    ~”Copyright (C) 2020 Free Software Foundation, Inc.\n”
    ~”Copyright (C) 2020 Free Software Foundation, Inc.\n”
    ~”Copyright (C) 2020 Free Software Foundation, Inc.\n”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
    ~”\nType \”show copying\” and \”show warranty\” for details.\n”
    ~”\nType \”show copying\” and \”show warranty\” for details.\n”
    ~”\nType \”show copying\” and \”show warranty\” for details.\n”
    ~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
    ~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
    ~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
    ~”Type \”show configuration\” for configuration details.\n”
    ~”Type \”show configuration\” for configuration details.\n”
    ~”Type \”show configuration\” for configuration details.\n”
    ~”For bug reporting instructions, please see:\n”
    ~”For bug reporting instructions, please see:\n”
    ~”For bug reporting instructions, please see:\n”
    ~”<http://www.gnu.org/software/gdb/bugs/&gt;.\n”
    ~”<http://www.gnu.org/software/gdb/bugs/&gt;.\n”
    ~”<http://www.gnu.org/software/gdb/bugs/&gt;.\n”
    ~”Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/&gt;.”
    ~”Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/&gt;.”
    ~”Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/&gt;.”
    ~”\n\n”
    ~”\n\n”
    ~”\n\n”
    ~”For help, type \”help\”.\n”
    ~”For help, type \”help\”.\n”
    ~”For help, type \”help\”.\n”
    ~”Type \”apropos word\” to search for commands related to \”word\”.\n”
    ~”Type \”apropos word\” to search for commands related to \”word\”.\n”
    ~”Type \”apropos word\” to search for commands related to \”word\”.\n”
    ^done
    ^done
    ^done
    (gdb)
    -list-features
    -list-features
    ^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”,”data-disassemble-a-option”]
    ^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”,”data-disassemble-a-option”]
    ^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”,”data-disassemble-a-option”]
    (gdb)
    -gdb-set verbose on
    -gdb-set verbose on
    ^done
    ^done
    ^done
    (gdb)
    -gdb-set disassembly-flavor intel
    -gdb-set disassembly-flavor intel
    ^error,msg=”No symbol \”disassembly\” in current context.”
    ^error,msg=”No symbol \”disassembly\” in current context.”
    ^error,msg=”No symbol \”disassembly\” in current context.”
    (gdb)
    -gdb-set print demangle off
    -gdb-set print demangle off
    ^done
    ^done
    ^done
    (gdb)
    set remotetimeout 60
    set remotetimeout 60
    &”set remotetimeout 60\n”
    &”set remotetimeout 60\n”
    &”set remotetimeout 60\n”
    =cmd-param-changed,param=”remotetimeout”,value=”60″
    =cmd-param-changed,param=”remotetimeout”,value=”60″
    =cmd-param-changed,param=”remotetimeout”,value=”60″
    ^done
    ^done
    ^done
    (gdb)
    target remote :43349
    target remote :43349
    &”target remote :43349\n”
    &”target remote :43349\n”
    &”target remote :43349\n”
    ~”Remote debugging using :43349\n”
    ~”Remote debugging using :43349\n”
    ~”Remote debugging using :43349\n”
    =thread-group-started,id=”i1″,pid=”42000″
    =thread-group-started,id=”i1″,pid=”42000″
    =thread-group-started,id=”i1″,pid=”42000″
    =thread-created,id=”1″,group-id=”i1″
    =thread-created,id=”1″,group-id=”i1″
    =thread-created,id=”1″,group-id=”i1″
    &”warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.\n”
    &”warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.\n”
    &”warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.\n”
    ~”Reading in symbols for ../../../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c…”
    ~”Reading in symbols for ../../../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c…”
    ~”Reading in symbols for ../../../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c…”
    ~”done.\n”
    ~”done.\n”
    ~”done.\n”
    ~”0x08007df8 in HAL_RCC_OscConfig (RCC_OscInitStruct=0x1) at ../../../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c:618\n”
    ~”0x08007df8 in HAL_RCC_OscConfig (RCC_OscInitStruct=0x1) at ../../../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c:618\n”
    ~”0x08007df8 in HAL_RCC_OscConfig (RCC_OscInitStruct=0x1) at ../../../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c:618\n”
    ~”618\t tickstart = HAL_GetTick();\n”
    ~”618\t tickstart = HAL_GetTick();\n”
    ~”618\t tickstart = HAL_GetTick();\n”
    *stopped,frame={addr=”0x08007df8″,func=”HAL_RCC_OscConfig”,args=[{name=”RCC_OscInitStruct”,value=”0x1″}],file=”../../../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c”,fullname=”C:\\d\\LS\\DraftSensor.mcu\\Draft_test_mx\\Draft_test_mx\\Drivers\\STM32H7xx_HAL_Driver\\Src\\stm32h7xx_hal_rcc.c”,line=”618″,arch=”armv7e-m”},thread-id=”1″,stopped-threads=”all”
    *stopped,frame={addr=”0x08007df8″,func=”HAL_RCC_OscConfig”,args=[{name=”RCC_OscInitStruct”,value=”0x1″}],file=”../../../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c”,fullname=”C:\\d\\LS\\DraftSensor.mcu\\Draft_test_mx\\Draft_test_mx\\Drivers\\STM32H7xx_HAL_Driver\\Src\\stm32h7xx_hal_rcc.c”,line=”618″,arch=”armv7e-m”},thread-id=”1″,stopped-threads=”all”
    *stopped,frame={addr=”0x08007df8″,func=”HAL_RCC_OscConfig”,args=[{name=”RCC_OscInitStruct”,value=”0x1″}],file=”../../../Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c”,fullname=”C:\\d\\LS\\DraftSensor.mcu\\Draft_test_mx\\Draft_test_mx\\Drivers\\STM32H7xx_HAL_Driver\\Src\\stm32h7xx_hal_rcc.c”,line=”618″,arch=”armv7e-m”},thread-id=”1″,stopped-threads=”all”
    ^done
    ^done
    ^done
    (gdb)
    info shared
    info shared
    &”info shared\n”
    &”info shared\n”
    &”info shared\n”
    ~”No shared libraries loaded at this time.\n”
    ~”No shared libraries loaded at this time.\n”
    ~”No shared libraries loaded at this time.\n”
    ^done
    ^done
    ^done
    (gdb)
    mon halt
    mon halt
    &”mon halt\n”
    &”mon halt\n”
    &”mon halt\n”
    ^done
    ^done
    ^done
    (gdb)
    mon report_flash_progress 1
    mon report_flash_progress 1
    &”mon report_flash_progress 1\n”
    &”mon report_flash_progress 1\n”
    &”mon report_flash_progress 1\n”
    @”Device: STM32H7Ax/7Bx\n”
    @”Device: STM32H7Ax/7Bx\n”
    @”Device: STM32H7Ax/7Bx\n”
    @”flash size probed value 2048\n”
    @”flash size probed value 2048\n”
    @”flash size probed value 2048\n”
    @”STM32H7 flash has dual banks\n”
    @”STM32H7 flash has dual banks\n”
    @”STM32H7 flash has dual banks\n”
    @”Bank (0) size is 1024 kb, base address is 0x08000000\n”
    @”Bank (0) size is 1024 kb, base address is 0x08000000\n”
    @”Bank (0) size is 1024 kb, base address is 0x08000000\n”
    @”Device: STM32H7Ax/7Bx\n”
    @”Device: STM32H7Ax/7Bx\n”
    @”Device: STM32H7Ax/7Bx\n”
    @”flash size probed value 2048\n”
    @”flash size probed value 2048\n”
    @”flash size probed value 2048\n”
    @”STM32H7 flash has dual banks\n”
    @”STM32H7 flash has dual banks\n”
    @”STM32H7 flash has dual banks\n”
    @”Bank (1) size is 1024 kb, base address is 0x08100000\n”
    @”Bank (1) size is 1024 kb, base address is 0x08100000\n”
    @”Bank (1) size is 1024 kb, base address is 0x08100000\n”
    @”flash_bank_summary:0x8000000|0x100000|stm32h7x.bank1.cpu0\n”
    @”flash_bank_summary:0x8000000|0x100000|stm32h7x.bank1.cpu0\n”
    @”flash_bank_summary:0x8000000|0x100000|stm32h7x.bank1.cpu0\n”
    @”flash_bank_summary:0x8100000|0x100000|stm32h7x.bank2.cpu0\n”
    @”flash_bank_summary:0x8100000|0x100000|stm32h7x.bank2.cpu0\n”
    @”flash_bank_summary:0x8100000|0x100000|stm32h7x.bank2.cpu0\n”
    @”FLASH progress reporting is now on\n”
    @”FLASH progress reporting is now on\n”
    @”FLASH progress reporting is now on\n”
    @”\n”
    @”\n”
    @”\n”
    @”\n”
    @”\n”
    @”\n”
    ^done
    ^done
    ^done
    (gdb)
    load
    load
    &”load\n”
    &”load\n”
    &”load\n”
    &”Error erasing flash with vFlashErase packet\n”
    &”Error erasing flash with vFlashErase packet\n”
    &”Error erasing flash with vFlashErase packet\n”
    ^error,msg=”Error erasing flash with vFlashErase packet”
    ^error,msg=”Error erasing flash with vFlashErase packet”
    ^error,msg=”Error erasing flash with vFlashErase packet”
    (gdb)
    compare-sections
    compare-sections
    &”compare-sections\n”
    &”compare-sections\n”
    &”compare-sections\n”
    ~”Section .isr_vector, range 0x8000000 — 0x80002ac: MIS-MATCHED!\n”
    ~”Section .isr_vector, range 0x8000000 — 0x80002ac: MIS-MATCHED!\n”
    ~”Section .isr_vector, range 0x8000000 — 0x80002ac: MIS-MATCHED!\n”
    ~”Section .text, range 0x80002b0 — 0x80090a4: MIS-MATCHED!\n”
    ~”Section .text, range 0x80002b0 — 0x80090a4: MIS-MATCHED!\n”
    ~”Section .text, range 0x80002b0 — 0x80090a4: MIS-MATCHED!\n”
    ~”Section .rodata, range 0x80090a4 — 0x8009128: MIS-MATCHED!\n”
    ~”Section .rodata, range 0x80090a4 — 0x8009128: MIS-MATCHED!\n”
    ~”Section .rodata, range 0x80090a4 — 0x8009128: MIS-MATCHED!\n”
    ~”Section .ARM, range 0x8009128 — 0x8009130: MIS-MATCHED!\n”
    ~”Section .ARM, range 0x8009128 — 0x8009130: MIS-MATCHED!\n”
    ~”Section .ARM, range 0x8009128 — 0x8009130: MIS-MATCHED!\n”
    ~”Section .init_array, range 0x8009130 — 0x8009138: MIS-MATCHED!\n”
    ~”Section .init_array, range 0x8009130 — 0x8009138: MIS-MATCHED!\n”
    ~”Section .init_array, range 0x8009130 — 0x8009138: MIS-MATCHED!\n”
    ~”Section .fini_array, range 0x8009138 — 0x800913c: MIS-MATCHED!\n”
    ~”Section .fini_array, range 0x8009138 — 0x800913c: MIS-MATCHED!\n”
    ~”Section .fini_array, range 0x8009138 — 0x800913c: MIS-MATCHED!\n”
    ~”Section .data, range 0x800913c — 0x8009580: MIS-MATCHED!\n”
    ~”Section .data, range 0x800913c — 0x8009580: MIS-MATCHED!\n”
    ~”Section .data, range 0x800913c — 0x8009580: MIS-MATCHED!\n”
    &”warning: One or more sections of the target image does not match\nthe loaded file\n”
    &”warning: One or more sections of the target image does not match\nthe loaded file\n”
    &”warning: One or more sections of the target image does not match\nthe loaded file\n”
    &”\n”
    &”\n”
    &”\n”
    ^done
    ^done
    ^done
    (gdb)

    #30514
    support
    Keymaster

    Hi,

    The STM32CubeIDE uses a specialized ST fork of OpenOCD. You can configure VisualGDB to use it by selecting OpenOCD (ST Fork) instead of just OpenOCD as the debug method.

    If this doesn’t help, most likely the OpenOCD script used by STM32CubeIDE does some additional board-specific initialization. In this case, we would advise locating the OpenOCD command line in the STM32CubeIDE  debug logs, copying the script mentioned there to your project directory, and using the Advanced mode in VisualGDB Project Properties -> Debug Settings to use the same script instead of the default script. You can use expressions like $(ProjectDir) to refer to the project directory.

    You can also configure VisualGDB to use the ST-Link server same way as STM32CubeIDE does (since it is somewhat undocumented and not available as a separate executable, VisualGDB doesn’t support it out-of-the-box). Simply locate the ST-Link server command line and the GDB connection command (typically target remote <…> or -target-select remote <…>) in the STM32CubeIDE debug logs and copy them under VisualGDB Project Properties -> Debug Settings -> Custom GDB Stub. VisualGDB will then launch the server with the same parameters and it should work exactly the same way.

     

    #30515
    milamber
    Participant

    I dont see an openocd(st fork)  as a debug method . I see

    • openocd
    • segger j-link
    • mcuxpresso
    • pyocd
    • build in
    • etc

    how can i get the opencd(st fork) to appear as a selection parameter ?

     

    #30516
    support
    Keymaster

    Hi,

    Please try updating to VisualGDB 5.6 Beta 1 and then use Tools->VisualGDB->Manage VisualGDB Packages to get the latest list of debug methods.

    #30517
    milamber
    Participant

    I did update to VisualGDB 5.6 Beta 1 and then used Tools->VisualGDB->Manage VisualGDB Packages   to install the openocd(st fork) but i still cant select it as a debug method

    I got opencd (run remotely) but not the ST fork

    Also it seems now that i cant even connect to the stlink

    • This reply was modified 2 years, 11 months ago by milamber.
    #30519
    milamber
    Participant

    it gets better and better. Since i wasnt able to use the openocd (st fork) i copied the settings from the the cubeide it seems that the debug\start debuging with gdb option is able to download the image and start debuging. any other option either in the menu or solution explorer (program and start without debuging) dont work.

    C:\SysGCC\arm-eabi\bin\arm-none-eabi-gdb.exe –interpreter mi “../Draft_test_mx/Draft_test_mx/build/VisualGDB/Debug/Draft_test_mx”
    -gdb-version
    C:\SysGCC\arm-eabi\bin\arm-none-eabi-gdb.exe: warning: Couldn’t determine a path for the index cache directory.
    C:\SysGCC\arm-eabi\bin\arm-none-eabi-gdb.exe: warning: Couldn’t determine a path for the index cache directory.
    =thread-group-added,id=”i1″
    =thread-group-added,id=”i1″
    ~”GNU gdb (GDB) 9.2\n”
    ~”GNU gdb (GDB) 9.2\n”
    ~”Copyright (C) 2020 Free Software Foundation, Inc.\n”
    ~”Copyright (C) 2020 Free Software Foundation, Inc.\n”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
    ~”\nType \”show copying\” and \”show warranty\” for details.\n”
    ~”\nType \”show copying\” and \”show warranty\” for details.\n”
    ~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
    ~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
    ~”Type \”show configuration\” for configuration details.\n”
    ~”Type \”show configuration\” for configuration details.\n”
    ~”For bug reporting instructions, please see:\n”
    ~”For bug reporting instructions, please see:\n”
    ~”<http://www.gnu.org/software/gdb/bugs/&gt;.\n”
    ~”<http://www.gnu.org/software/gdb/bugs/&gt;.\n”
    ~”Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/&gt;.”
    ~”Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/&gt;.”
    ~”\n\n”
    ~”\n\n”
    ~”For help, type \”help\”.\n”
    ~”For help, type \”help\”.\n”
    ~”Type \”apropos word\” to search for commands related to \”word\”…\n”
    ~”Type \”apropos word\” to search for commands related to \”word\”…\n”
    ~”Reading symbols from C:/d/LS/DraftSensor.mcu/Draft_test_mx/Draft_test_mx/build/VisualGDB/Debug/Draft_test_mx…\n”
    ~”Reading symbols from C:/d/LS/DraftSensor.mcu/Draft_test_mx/Draft_test_mx/build/VisualGDB/Debug/Draft_test_mx…\n”
    (gdb)
    ~”GNU gdb (GDB) 9.2\n”
    ~”GNU gdb (GDB) 9.2\n”
    ~”Copyright (C) 2020 Free Software Foundation, Inc.\n”
    ~”Copyright (C) 2020 Free Software Foundation, Inc.\n”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.”
    ~”\nType \”show copying\” and \”show warranty\” for details.\n”
    ~”\nType \”show copying\” and \”show warranty\” for details.\n”
    ~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
    ~”This GDB was configured as \”–host=i686-w64-mingw32 –target=arm-none-eabi\”.\n”
    ~”Type \”show configuration\” for configuration details.\n”
    ~”Type \”show configuration\” for configuration details.\n”
    ~”For bug reporting instructions, please see:\n”
    ~”For bug reporting instructions, please see:\n”
    ~”<http://www.gnu.org/software/gdb/bugs/&gt;.\n”
    ~”<http://www.gnu.org/software/gdb/bugs/&gt;.\n”
    ~”Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/&gt;.”
    ~”Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/&gt;.”
    ~”\n\n”
    ~”\n\n”
    ~”For help, type \”help\”.\n”
    ~”For help, type \”help\”.\n”
    ~”Type \”apropos word\” to search for commands related to \”word\”.\n”
    ~”Type \”apropos word\” to search for commands related to \”word\”.\n”
    ^done
    ^done
    (gdb)
    -list-features
    ^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”,”data-disassemble-a-option”]
    ^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”,”data-disassemble-a-option”]
    (gdb)
    -gdb-set verbose on
    ^done
    ^done
    (gdb)
    -gdb-set disassembly-flavor intel
    ^error,msg=”No symbol \”disassembly\” in current context.”
    ^error,msg=”No symbol \”disassembly\” in current context.”
    (gdb)
    -gdb-set print demangle off
    ^done
    ^done
    (gdb)
    -target-select remote :61234
    =thread-group-started,id=”i1″,pid=”42000″
    =thread-group-started,id=”i1″,pid=”42000″
    =thread-created,id=”1″,group-id=”i1″
    =thread-created,id=”1″,group-id=”i1″
    &”warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.\n”
    &”warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.\n”
    ~”Reading in symbols for ../../../startup_stm32h7a3xx.s…”
    ~”Reading in symbols for ../../../startup_stm32h7a3xx.s…”
    ~”done.\n”
    ~”done.\n”
    ~”Reset_Handler () at ../../../startup_stm32h7a3xx.s:62\n”
    ~”Reset_Handler () at ../../../startup_stm32h7a3xx.s:62\n”
    ~”62\t ldr sp, =_estack /* set stack pointer */\n”
    ~”62\t ldr sp, =_estack /* set stack pointer */\n”
    *stopped,frame={addr=”0x08003a74″,func=”Reset_Handler”,args=[],file=”../../../startup_stm32h7a3xx.s”,fullname=”C:\\d\\LS\\DraftSensor.mcu\\Draft_test_mx\\Draft_test_mx\\startup_stm32h7a3xx.s”,line=”62″,arch=”armv7e-m”},thread-id=”1″,stopped-threads=”all”,core=”0″
    *stopped,frame={addr=”0x08003a74″,func=”Reset_Handler”,args=[],file=”../../../startup_stm32h7a3xx.s”,fullname=”C:\\d\\LS\\DraftSensor.mcu\\Draft_test_mx\\Draft_test_mx\\startup_stm32h7a3xx.s”,line=”62″,arch=”armv7e-m”},thread-id=”1″,stopped-threads=”all”,core=”0″
    ~”Current language: auto\n”
    ~”Current language: auto\n”
    ~”The current source language is \”auto; currently asm\”.\n”
    ~”The current source language is \”auto; currently asm\”.\n”
    ^connected
    ^connected
    (gdb)
    info shared
    &”info shared\n”
    &”info shared\n”
    ~”No shared libraries loaded at this time.\n”
    ~”No shared libraries loaded at this time.\n”
    ^done
    ^done
    (gdb)
    mon erase
    &”mon erase\n”
    &”mon erase\n”
    &”Protocol error with Rcmd\n”
    &”Protocol error with Rcmd\n”
    ^error,msg=”Protocol error with Rcmd”
    ^error,msg=”Protocol error with Rcmd”
    (gdb)
    load
    &”load\n”
    &”load\n”
    ~”Loading section .isr_vector, size 0x2ac lma 0x8000000\n”
    ~”Loading section .isr_vector, size 0x2ac lma 0x8000000\n”
    +download,{section=”.isr_vector”,section-size=”684″,total-size=”1985618″}
    +download,{section=”.isr_vector”,section-size=”684″,total-size=”1985618″}
    +download,{section=”.isr_vector”,section-sent=”684″,section-size=”684″,total-sent=”684″,total-size=”1985618″}
    +download,{section=”.isr_vector”,section-sent=”684″,section-size=”684″,total-sent=”684″,total-size=”1985618″}
    ~”Loading section .text, size 0x9054 lma 0x80002b0\n”
    ~”Loading section .text, size 0x9054 lma 0x80002b0\n”
    +download,{section=”.text”,section-size=”36948″,total-size=”1985618″}
    +download,{section=”.text”,section-size=”36948″,total-size=”1985618″}
    ~”Loading section .rodata, size 0x84 lma 0x8009304\n”
    ~”Loading section .rodata, size 0x84 lma 0x8009304\n”
    +download,{section=”.rodata”,section-size=”132″,total-size=”1985618″}
    +download,{section=”.rodata”,section-size=”132″,total-size=”1985618″}
    ~”Loading section .ARM, size 0x8 lma 0x8009388\n”
    ~”Loading section .ARM, size 0x8 lma 0x8009388\n”
    +download,{section=”.ARM”,section-size=”8″,total-size=”1985618″}
    +download,{section=”.ARM”,section-size=”8″,total-size=”1985618″}
    ~”Loading section .init_array, size 0x8 lma 0x8009390\n”
    ~”Loading section .init_array, size 0x8 lma 0x8009390\n”
    +download,{section=”.init_array”,section-size=”8″,total-size=”1985618″}
    +download,{section=”.init_array”,section-size=”8″,total-size=”1985618″}
    ~”Loading section .fini_array, size 0x4 lma 0x8009398\n”
    ~”Loading section .fini_array, size 0x4 lma 0x8009398\n”
    +download,{section=”.fini_array”,section-size=”4″,total-size=”1985618″}
    +download,{section=”.fini_array”,section-size=”4″,total-size=”1985618″}
    ~”Loading section .data, size 0x444 lma 0x800939c\n”
    ~”Loading section .data, size 0x444 lma 0x800939c\n”
    +download,{section=”.data”,section-size=”1092″,total-size=”1985618″}
    +download,{section=”.data”,section-size=”1092″,total-size=”1985618″}
    ~”Start address 0x08003a74, load size 38876\n”
    ~”Start address 0x08003a74, load size 38876\n”
    ~”Transfer rate: 32 KB/sec, 2046 bytes/write.\n”
    ~”Transfer rate: 32 KB/sec, 2046 bytes/write.\n”
    ^done
    ^done
    (gdb)
    compare-sections
    &”compare-sections\n”
    &”compare-sections\n”
    ~”Section .isr_vector, range 0x8000000 — 0x80002ac: MIS-MATCHED!\n”
    ~”Section .isr_vector, range 0x8000000 — 0x80002ac: MIS-MATCHED!\n”
    ~”Section .text, range 0x80002b0 — 0x8009304: MIS-MATCHED!\n”
    ~”Section .text, range 0x80002b0 — 0x8009304: MIS-MATCHED!\n”
    ~”Section .rodata, range 0x8009304 — 0x8009388: MIS-MATCHED!\n”
    ~”Section .rodata, range 0x8009304 — 0x8009388: MIS-MATCHED!\n”
    ~”Section .ARM, range 0x8009388 — 0x8009390: MIS-MATCHED!\n”
    ~”Section .ARM, range 0x8009388 — 0x8009390: MIS-MATCHED!\n”
    ~”Section .init_array, range 0x8009390 — 0x8009398: MIS-MATCHED!\n”
    ~”Section .init_array, range 0x8009390 — 0x8009398: MIS-MATCHED!\n”
    ~”Section .fini_array, range 0x8009398 — 0x800939c: MIS-MATCHED!\n”
    ~”Section .fini_array, range 0x8009398 — 0x800939c: MIS-MATCHED!\n”
    ~”Section .data, range 0x800939c — 0x80097e0: MIS-MATCHED!\n”
    ~”Section .data, range 0x800939c — 0x80097e0: MIS-MATCHED!\n”
    &”warning: One or more sections of the target image does not match\nthe loaded file\n”
    &”warning: One or more sections of the target image does not match\nthe loaded file\n”
    &”\n”
    &”\n”
    ^done
    ^done
    (gdb)

    #30524
    support
    Keymaster

    Hi,

    If the ST Fork of OpenOCD does not appear in VisualGDB GUI, please try attaching a screenshot of the debug method list, and a screenshot of the debug packages showing that the ST Fork package has been installed, so that we could see what is going on.

    If OpenOCD works differently under VisualGDB vs. STM32CubeIDE, please try comparing its command lines and make sure that all involved scripts are the same. If this doesn’t help, please try replacing the OpenOCD executable used by VisualGDB with the executable from the STM32CubeIDE. This should ensure that it works exactly the same way in both cases.

    #30525
    milamber
    Participant

    I am attaching the files. By using the custom gdb option from STM32CubeIDE i was able to debug (not just flash) the board

    Attachments:
    You must be logged in to view attached files.
    #30529
    support
    Keymaster

    Hi,

    Thanks, indeed the ST fork of OpenOCD would not appear for STM32CubeMX-based projects. We have fixed it in this build: VisualGDB-5.6.1.4114.msi

    You would also need to delete and re-download the ST fork of OpenOCD via Tools->Manage VisualGDB Packages.

    #30530
    milamber
    Participant

    it seems that my dual bank STM32H7A3ZIT6 is not included in the list of supported processors. I tried TARGET/STM32HX.CFG and i got this

    Open On-Chip Debugger 0.10.0 (2021-03-26)
    Licensed under GNU GPL v2
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    STM32H7A3ZIXx
    Info : auto-selecting first available session transport “hla_swd”. To override use ‘transport select <transport>’.
    DEPRECATED! use ‘swj_newdap’ not ‘hla newtap’

    multiple times

    DEPRECATED! use ‘swj_newdap’ not ‘hla newtap’

    DEPRECATED! use ‘swj_newdap’ not ‘hla newtap’
    DEPRECATED! use ‘swj_newdap’ not ‘hla newtap’
    embedded:startup.tcl:265: Error: Infinite eval recursion
    in procedure ‘script’
    at file “embedded:startup.tcl”, line 26
    in procedure ‘swj_newdap’ called at file “target/stm32h7x.cfg”, line 183
    in procedure ‘hla’ called at file “target/swj-dp.tcl”, line 28
    in procedure ‘swj_newdap’ called at file “embedded:startup.tcl”, line 265
    multiple times
    in procedure ‘swj_newdap’ called at file “embedded:startup.tcl”, line 265
    in procedure ‘hla’ called at file “target/swj-dp.tcl”, line 28
    in procedure ‘swj_newdap’ called at file “embedded:startup.tcl”, line 265
    in procedure ‘hla’ called at file “target/swj-dp.tcl”, line 28
    at file “embedded:startup.tcl”, line 265

    Attachments:
    You must be logged in to view attached files.
    #30532
    support
    Keymaster

    This can be caused by the differences in how STM32CubeIDE and VisualGDB handle OpenOCD scripts.

    STM32CubeIDE generates a per-device OpenOCD script that sets various variables and includes one of the regular scripts (e.g. stm32h7x.cfg). VisualGDB instead allows overriding these variables via command line (it automatically shows GUI for supported variables) and then includes one of the regular scripts directly via the “-f” argument. This works well for the devices we tested, however might miss some undocumented variables that could be set by STM32CubeIDE for your device.

    The easiest way to get everything working would be to copy the OpenOCD script generated by STM32CubeIDE into your project directory and reference it from the OpenOCD settings. You can also try reviewing its contents and comparing it with the setup when you select one of the scripts via VisualGDB GUI. If there is any obvious difference, we might be able to add a GUI setting accommodating it.

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.