admin管理员组

文章数量:1123035

Arduino 2.3.4 (upload method: stm32cubeProgrammer (SWD)), Nucleo F103RB is selected, Stm32duino, Windows 10.

I saw a video on youtube where an author said that there is a debugging for stm32 in Arduino IDE. I wanted to try it but it doesn't work for me. I put several stop points in a while loop with a blink code but stepping through them doesn't affect board's behavior and I don't see change in a global variable inside a while loop at each cycle.

Please help me.

Sketch uses 11024 bytes (8%) of program storage space. Maximum is 131072 bytes.
Global variables use 1136 bytes (5%) of dynamic memory, leaving 19344 bytes for local variables. Maximum is 20480 bytes.
Selected interface: swd
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.14.0                  
      -------------------------------------------------------------------

ST-LINK SN  : 066FFF504857788667214513
ST-LINK FW  : V2J45M31
Board       : NUCLEO-F103RB
Voltage     : 3.25V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x410
Revision ID : Rev X
Device name : STM32F101/F102/F103 Medium-density
Flash size  : 128 KBytes
Device type : MCU
Device CPU  : Cortex-M3
BL Version  : --


`Memory Programming ...
Opening and parsing file: Blink.ino.bin
  File          : Blink.ino.bin
  Size          : 11.05 KB 
  Address       : 0x08000000 


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 11]
Download in Progress:


File download complete
Time elapsed during download operation: 00:00:00.825`
RUNNING Program ... 
  Address:      : 0x8000000
Application is running, Please Hold on...
Start operation achieved successfully
xPack Open On-Chip Debugger 0.12.0+dev-01685-gb9224c0c0-dirty (2024-08-02-19:51)
Licensed under GNU GPL v2
For bug reports, read
        .html
DEPRECATED! use 'gdb port', not 'gdb_port'
DEPRECATED! use 'tcl port' not 'tcl_port'
CDRTOSConfigure
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Info : clock speed 1000 kHz
Info : STLINK V2J45M31 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.250952
Info : [stm32f1x.cpu] Cortex-M3 r1p1 processor detected
Info : [stm32f1x.cpu] target has 6 breakpoints, 4 watchpoints
Info : [stm32f1x.cpu] Examination succeed
Info : [stm32f1x.cpu] starting gdb server on 50000
Info : Listening on port 50000 for gdb connections
Info : accepting 'gdb' connection on tcp/50000
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x81000000 pc: 0x08000210 msp: 0x20004fe0
Info : device id = 0x20036410
Info : flash size = 128 KiB
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001e94 msp: 0x20005000
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001e94 msp: 0x20005000
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001e94 msp: 0x20005000
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001e94 msp: 0x20005000
xPack Open On-Chip Debugger 0.12.0+dev-01685-gb9224c0c0-dirty (2024-08-02-19:51)
Licensed under GNU GPL v2
For bug reports, read
        .html
DEPRECATED! use 'gdb port', not 'gdb_port'
DEPRECATED! use 'tcl port' not 'tcl_port'
CDRTOSConfigure
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 50008 for tcl connections
Info : Listening on port 50009 for telnet connections
Info : clock speed 1000 kHz
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: open failed


[2025-01-10T15:52:56.288Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

several uploads and disconnection

Arduino 2.3.4 (upload method: stm32cubeProgrammer (SWD)), Nucleo F103RB is selected, Stm32duino, Windows 10.

I saw a video on youtube where an author said that there is a debugging for stm32 in Arduino IDE. I wanted to try it but it doesn't work for me. I put several stop points in a while loop with a blink code but stepping through them doesn't affect board's behavior and I don't see change in a global variable inside a while loop at each cycle.

Please help me.

Sketch uses 11024 bytes (8%) of program storage space. Maximum is 131072 bytes.
Global variables use 1136 bytes (5%) of dynamic memory, leaving 19344 bytes for local variables. Maximum is 20480 bytes.
Selected interface: swd
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.14.0                  
      -------------------------------------------------------------------

ST-LINK SN  : 066FFF504857788667214513
ST-LINK FW  : V2J45M31
Board       : NUCLEO-F103RB
Voltage     : 3.25V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x410
Revision ID : Rev X
Device name : STM32F101/F102/F103 Medium-density
Flash size  : 128 KBytes
Device type : MCU
Device CPU  : Cortex-M3
BL Version  : --


`Memory Programming ...
Opening and parsing file: Blink.ino.bin
  File          : Blink.ino.bin
  Size          : 11.05 KB 
  Address       : 0x08000000 


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 11]
Download in Progress:


File download complete
Time elapsed during download operation: 00:00:00.825`
RUNNING Program ... 
  Address:      : 0x8000000
Application is running, Please Hold on...
Start operation achieved successfully
xPack Open On-Chip Debugger 0.12.0+dev-01685-gb9224c0c0-dirty (2024-08-02-19:51)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'gdb port', not 'gdb_port'
DEPRECATED! use 'tcl port' not 'tcl_port'
CDRTOSConfigure
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Info : clock speed 1000 kHz
Info : STLINK V2J45M31 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.250952
Info : [stm32f1x.cpu] Cortex-M3 r1p1 processor detected
Info : [stm32f1x.cpu] target has 6 breakpoints, 4 watchpoints
Info : [stm32f1x.cpu] Examination succeed
Info : [stm32f1x.cpu] starting gdb server on 50000
Info : Listening on port 50000 for gdb connections
Info : accepting 'gdb' connection on tcp/50000
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x81000000 pc: 0x08000210 msp: 0x20004fe0
Info : device id = 0x20036410
Info : flash size = 128 KiB
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001e94 msp: 0x20005000
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001e94 msp: 0x20005000
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001e94 msp: 0x20005000
[stm32f1x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001e94 msp: 0x20005000
xPack Open On-Chip Debugger 0.12.0+dev-01685-gb9224c0c0-dirty (2024-08-02-19:51)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'gdb port', not 'gdb_port'
DEPRECATED! use 'tcl port' not 'tcl_port'
CDRTOSConfigure
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 50008 for tcl connections
Info : Listening on port 50009 for telnet connections
Info : clock speed 1000 kHz
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: open failed


[2025-01-10T15:52:56.288Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

several uploads and disconnection

Share Improve this question edited 3 hours ago Pasha4ur asked 3 hours ago Pasha4urPasha4ur 11 bronze badge New contributor Pasha4ur is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Add a comment  | 

1 Answer 1

Reset to default 0

Looks like I fixed it by selecting Arduino IDE - Sketch - Optimize for debugging.

I checked it on 2 different nucleos stm32.

Unfortunately I can't see variable's value in registers but it's shown in variables section.

本文标签: debuggingCan39t debug stm32 in arduino ide libusbopen() failed with LIBUSBERRORACCESSStack Overflow