Sysprogs forums › Forums › VisualGDB › Connection under reset problem
- This topic has 3 replies, 2 voices, and was last updated 12 minutes ago by
support.
-
AuthorPosts
-
August 14, 2025 at 08:05 #36841
Juergen
ParticipantI have the following problem: I imported sample code from CubeIDE into VisualGDB, which unfortunately only works if I have previously started it once in CubeIDE. I could find out that it gets stuck in the following line
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
while (!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}After searching on Google, I found out that I need to set “Connect under reset” in the debugger, which I did in the VisualGDB settings. Unfortunately, this does not work either.
Here is my hardware and a screenshot of the debug settings.NUCLEO-H753ZI
-
This topic was modified 3 hours ago by
Juergen.
Attachments:
You must be logged in to view attached files.August 14, 2025 at 08:38 #36844support
KeymasterHi,
This is most likely caused by some subtle differences between the OpenOCD scripts used by STM32CubeIDE and VisualGDB. You can troubleshoot it as follows:
- Try starting OpenOCD manually using the command line shown in the VisualGDB Output window. Make sure it listens at the gdb port specified via command line (see the log for more details).
- Try starting arm-eabi-gdb.exe <your ELF file> and run the following commands:
- target remote :<gdb port>
- load
- break main
- run
If you can reproduce the same problem (connection gets lost instead of being able to hit breakpoints and step), you would need to try switching out parts of the setup with STM32CubeIDE equivalents:
- Try running OpenOCD from STM32CubeIDE with its script
- Try running VisualGDB’s OpenoCD with the script from STM32CubeIDE
- Optionally, try comparing the scripts and moving individual statements between them
If you can find a particular statement in the script that triggers the problem, feel free to let us know and we might be able to add a GUI option for controlling it directly.
August 14, 2025 at 10:22 #36845Juergen
ParticipantHello, here are the CubeIDE settings
<div>
<div># This is an NUCLEO-H743ZI board with a single STM32H743ZITx chip</div>
<div>#</div>
<div># Generated by STM32CubeIDE</div>
<div># Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)</div>
<div>source [find interface/stlink-dap.cfg]</div>
<div>set WORKAREASIZE 0x8000</div>
<div>transport select “dapdirect_swd”</div>
<div>set CHIPNAME STM32H743ZITx</div>
<div>set BOARDNAME NUCLEO-H743ZI</div>
<div># Enable debug when in low power modes</div>
<div>set ENABLE_LOW_POWER 0</div>
<div># Stop Watchdog counters when halt</div>
<div>set STOP_WATCHDOG 0</div>
<div># STlink Debug clock frequency</div>
<div>set CLOCK_FREQ 8000</div>
<div># Reset configuration</div>
<div># use software system reset if reset done</div>
<div>reset_config none</div>
<div>set CONNECT_UNDER_RESET 0</div>
<div>set CORE_RESET 0</div>
<div># ACCESS PORT NUMBER</div>
<div>set AP_NUM 0</div>
<div># GDB PORT</div>
<div>set GDB_PORT 3333</div>
<div>set DUAL_BANK 1</div>
<div># BCTM CPU variables</div>
<div>source [find target/stm32h7x.cfg]It just doesn’t work the first time after turning on the BOARD, but once I start with CubeIDE, VisualGDB also works afterwards, regardless of the settings.
I have read the points above, but I am still a beginner and don’t know exactly where to find what I need. You have to tell me exactly what to do.
</div>
</div>August 14, 2025 at 10:54 #36846support
KeymasterSorry, we do not have any other instructions. If you are not able to follow them, please consider reading more about the involved tools, or doing something easier.
-
This topic was modified 3 hours ago by
-
AuthorPosts
- You must be logged in to reply to this topic.