VS Arduino
Visual Micro >> Usb/Serial/WiFi Debugging >> Unable to start debugger, miDebuggerPath invalid for STM32
https://www.visualmicro.com/forums/YaBB.pl?num=1611664368

Message started by Bambo on Jan 26th, 2021 at 12:32pm

Title: Unable to start debugger, miDebuggerPath invalid for STM32
Post by Bambo on Jan 26th, 2021 at 12:32pm
I'm trying to debug an STM32 but when i try to launch the debugger, it comes up with the error in the image attached.

The following results are attempts with no local board.txt defined.

Here is the output when uploading using the STLink External 2.1 with OpenOCD method

Code (]
Uploading 'SAIN' to 'Nucleo-64' using 'COM3'
Uploader started for board Nucleo-64
Upload method will be: bootloader
Uploading via Bootloader
C:\ProgramData\vmicro\tools\openocd-0.10.0.20200213\bin\openocd.exe -d2 -s "C:\ProgramData\vmicro\tools\openocd-0.10.0.20200213/scripts/" -f "interface/stlink.cfg" -f "board/st_nucleo_l4.cfg" -c "echo -n {****[vMicro):

**** Uploading ELF :}" -c "reset_config; telnet_port disabled; program {C:\Users\Richa\AppData\Local\Temp\VMBuilds\SAIN\STM32_~1\Debug/SAIN.ino.elf} reset;reset_config;shutdown"
Open On-Chip Debugger 0.10.0+dev-01058-g853a05287 (2020-02-13-16:41)
Licensed under GNU GPL v2
For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Warn : Interface already configured, ignoring
Error: already specified hl_layout stlink
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
****[vMicro]**** Uploading ELF :Info : clock speed 500 kHz
Info : STLINK V2J35M26 (API v2) VID:PID 0483:374B
Info : Target voltage: 6.087302
Info : stm32l4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x1fff3f3a msp: 0x20002c68
** Programming Started **
Info : device idcode = 0x20016462 (STM32L45/L46xx - Rev: Y)
Info : flash size = 256kbytes
Info : flash mode : single-bank
Warn : no flash bank found for address 0x08040000
Warn : no flash bank found for address 0x0804fe60
** Programming Finished **
** Resetting Target **
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
shutdown command invoked
     The upload process has finished.
# Copy build result to 'Project>Property Pages>Intermediate Directory'
# Destination: file:///C:/Users/Richa/Documents/Github/Remote-Train-Sensor/Software/SAIN/Debug/


# MI Debugger Properties
{
  "serverLaunchTimeout": 5000,
  "filterStdout": false,
  "filterStderr": true,
  "targetArchitecture": "arm",
  "stopAtEntry": false,
  "externalConsole": false,
  "MIMode": "gdb",
  "MIDebuggerServerAddress": "localhost:3333",
  "cwd": "C:\\Users\\Richa\\AppData\\Local\\Temp\\VMBuilds\\SAIN\\STM32_Nucleo_64\\Debug",
  "MIDebuggerPath": "{runtime.tools.arm-none-eabi-gcc.path}/bin\\arm-none-eabi-gdb.exe",
  "MIDebuggerArgs": "",
  "debugServerPath": "C:\\ProgramData\\vmicro\\tools\\openocd-0.10.0.20200213\\bin/openocd.exe",
  "debugServerArgs": "-d2 -l \"{C:\\Users\\Richa\\AppData\\Local\\Temp\\VMBuilds\\SAIN\\STM32_Nucleo_64\\Debug/SAIN.ino_DebugOpenOCD.log}\" -s \"C:\\ProgramData\\vmicro\\tools\\openocd-0.10.0.20200213/scripts/\" -f \"interface/stlink.cfg\" -f \"board/st_nucleo_l4.cfg\" -c \"init; reset halt\"",
  "program": "C:/Users/Richa/AppData/Local/Temp/VMBuilds/SAIN/STM32_Nucleo_64/Debug/SAIN.ino.elf",
  "logging": {
    "moduleLoad": false,
    "trace": false,
    "engineLogging": false,
    "programOutput": false,
    "exceptions": false,
    "traceResponse": false
  },
  "visualizerFile": "C:\\Users\\Richa\\AppData\\Local\\Temp\\VMBuilds\\SAIN\\STM32_Nucleo_64\\Debug\\debugger_tmp.natvis",
  "showDisplayString": true
}


Output when using STM32CubeProgrammer upload method.

Code (]
Uploading 'SAIN' to 'Nucleo-64' using 'COM3'
Uploader started for board Nucleo-64
Upload method will be: bootloader
Uploading via Bootloader
C:\Users\Richa\AppData\Local\arduino15\packages\STM32\tools\STM32Tools\1.4.0\tools\win\stm32CubeProg.bat 0 "C:\Users\Richa\AppData\Local\Temp\VMBuilds\SAIN\STM32_~1\Debug/SAIN.ino.bin" -g
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.6.0                  
      -------------------------------------------------------------------
ST-LINK SN  : 0663FF525750877267234013
ST-LINK FW  : V2J35M26
Board       : NUCLEO-L452RE-P
Voltage     : 6.07V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x462
Revision ID : Rev Y
Device name : STM32L45x/L46x
Flash size  : 256 KBytes
Device type : MCU
Device CPU  : Cortex-M4
Memory Programming ...
Opening and parsing file: SAIN.ino.bin
  File          : SAIN.ino.bin
  Size          : 327832 Bytes
  Address       : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 160):


Download in Progress:
File download complete
Time elapsed during download operation: 00:00:10.062
     The upload process has finished.
# Copy build result to 'Project>Property Pages>Intermediate Directory'
# Destination: file:///C:/Users/Richa/Documents/Github/Remote-Train-Sensor/Software/SAIN/Debug/
RUNNING Program ...
  Address:      : 0x8000000
Application is running
Start operation achieved successfully


# MI Debugger Properties
{
  "serverLaunchTimeout": 5000,
  "filterStdout": false,
  "filterStderr": true,
  "targetArchitecture": "arm",
  "stopAtEntry": false,
  "externalConsole": false,
  "MIMode": "gdb",
  "MIDebuggerServerAddress": "localhost:3333",
  "cwd": "C:\\Users\\Richa\\AppData\\Local\\Temp\\VMBuilds\\SAIN\\STM32_Nucleo_64\\Debug",
  "MIDebuggerPath": "{runtime.tools.arm-none-eabi-gcc.path}/bin\\arm-none-eabi-gdb.exe",
  "MIDebuggerArgs": "",
  "debugServerPath": "C:\\ProgramData\\vmicro\\tools\\openocd-0.10.0.20200213\\bin/openocd.exe",
  "debugServerArgs": "-d2 -l \"{C:\\Users\\Richa\\AppData\\Local\\Temp\\VMBuilds\\SAIN\\STM32_Nucleo_64\\Debug/SAIN.ino_DebugOpenOCD.log}\" -s \"C:\\ProgramData\\vmicro\\tools\\openocd-0.10.0.20200213/scripts/\" -f \"interface/stlink.cfg\" -f \"board/st_nucleo_l4.cfg\" -c \"init; reset halt\"",
  "program": "C:/Users/Richa/AppData/Local/Temp/VMBuilds/SAIN/STM32_Nucleo_64/Debug/SAIN.ino.elf",
  "logging": {
    "moduleLoad": false,
    "trace": false,
    "engineLogging": false,
    "programOutput": false,
    "exceptions": false,
    "traceResponse": false
  },
  "visualizerFile": "C:\\Users\\Richa\\AppData\\Local\\Temp\\VMBuilds\\SAIN\\STM32_Nucleo_64\\Debug\\debugger_tmp.natvis",
  "showDisplayString": true
}


Cheers!
Richard
Capture_027.PNG ( 20 KB | 3 Downloads )

Title: Re: Unable to start debugger, miDebuggerPath invalid for STM32
Post by Simon@Visual Micro on Jan 26th, 2021 at 12:44pm
Thanks for the report.

Can you confirm you are not using any entries in a local board.txt? (as the image shows that there are overrides present)

Please set the additional options as shown at the top of the page, and perform a full clean build and attach the output, so we can understand your environment in full.

Title: Re: Unable to start debugger, miDebuggerPath invalid for STM32
Post by Bambo on Jan 26th, 2021 at 1:02pm

Simon@Visual Micro wrote on Jan 26th, 2021 at 12:44pm:
Thanks for the report.

Can you confirm you are not using any entries in a local board.txt? (as the image shows that there are overrides present)

Please set the additional options as shown at the top of the page, and perform a full clean build and attach the output, so we can understand your environment in full.


Hi, email has been sent, the board.txt has been deleted. It was not present for the 2 compile outputs in the original post too

Cheers!
Richard

Title: Re: Unable to start debugger, miDebuggerPath invalid for STM32
Post by Simon@Visual Micro on Jan 26th, 2021 at 1:45pm
Thanks for the logs, and confirmation.

If you add the below property to the local board.txt file, it should allow the debugging to work as expected for this toolchain:
[code]runtime.tools.arm-none-eabi-gcc.path={runtime.tools.xpack-arm-none-eabi-gcc.path}[/code]

Title: Re: Unable to start debugger, miDebuggerPath invalid for STM32
Post by Bambo on Jan 26th, 2021 at 2:07pm

Simon@Visual Micro wrote on Jan 26th, 2021 at 1:45pm:
Thanks for the logs, and confirmation.

If you add the below property to the local board.txt file, it should allow the debugging to work as expected for this toolchain:

Code (]runtime.tools.arm-none-eabi-gcc.path={runtime.tools.xpack-arm-none-eabi-gcc.path}[/code):


Thank you! It's all working now, but i did have to put this back into the new boards.txt for it to work:
[code]
tools.stlinkv2.server.initCmd=-c "init"

Title: Re: Unable to start debugger, miDebuggerPath invalid for STM32
Post by Bambo on Jan 26th, 2021 at 2:25pm

Simon@Visual Micro wrote on Jan 26th, 2021 at 1:45pm:
Thanks for the logs, and confirmation.

If you add the below property to the local board.txt file, it should allow the debugging to work as expected for this toolchain:
[code]runtime.tools.arm-none-eabi-gcc.path={runtime.tools.xpack-arm-none-eabi-gcc.path}[/code]


Strangely there are now intellisense errors in the IDE, see attached the built in arduino F() and other classes are not being found too.


Capture_029.PNG ( 69 KB | 2 Downloads )

Title: Re: Unable to start debugger, miDebuggerPath invalid for STM32
Post by Bambo on Jan 26th, 2021 at 2:38pm
It seems like it has broken the arduino libraries somehow, see this in the built in delay() function


Capture3_001.PNG ( 27 KB | 4 Downloads )

Title: Re: Unable to start debugger, miDebuggerPath invalid for STM32
Post by Simon@Visual Micro on Jan 26th, 2021 at 4:32pm
Can you try replacing the previous board.txt entry with the below:
[code]
# Comment this out --> runtime.tools.arm-none-eabi-gcc.path={runtime.tools.xpack-arm-none-eabi-gcc.path}
tools.stlinkv2.path={runtime.tools.xpack-arm-none-eabi-gcc.path}/bin
[/code]

This should more accurately override the debug command without affecting intellisense.

The Optimization option may need changing to debug the core functionality more accurately (on the vMicro > Debugger Menu)

Also if you Click vMicro > Show / Hide Hidden Files, this may improve the debugging experience.



VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.