Skip to content

BlackMagicProbe not working #1175

@Fabien-B

Description

@Fabien-B

Hello,
I have an issue using cortex-debug on VSCode.

If I run theses commands in a terminal, it works has expected, and the program pauses at the start of the main function.

/opt/arm-gcc/bin/arm-none-eabi-gdb

file obj/debug.elf
target extended-remote /dev/bmp-gdb
monitor swdp_scan
attach 1
load
b main
run

However, launching a debug session with this configuration does not works:

{
    "version": "0.2.0",
    "configurations": [
      {
        "name": "AM32 BMP",
        "cwd": "/home/fabien/dev/AM32-bootloader",
        "executable": "/home/fabien/dev/AM32-bootloader/obj/debug.elf",
        "request": "launch",
        "type": "cortex-debug",
        "runToEntryPoint": "main",
        "servertype" : "bmp",
        "BMPGDBSerialPort": "/dev/bmp-gdb",
        "armToolchainPath": "/opt/arm-gcc/bin",
        "showDevDebugOutput": "raw",
      }
    ]
  }

Trying to add other breakpoints does not change the behavior.

toolchain version:

  • Cortex-Debug Version 1.12.1
  • OS: Linux Ubuntu 20.04 LTS
  • GDB / Toolchain Version: GNU Arm Embedded Toolchain 10.3-2021.10
  • BMP version: Black Magic Probe v2.0.0-rc2-40-g5408212b, Hardware Version 3

Here is the full raw output from the debug console:

Cortex-Debug: VSCode debugger extension version 1.12.1 git(652d042). Usage info: https://github.com/Marus/cortex-debug#usage
"configuration": {
    "name": "AM32 BMP",
    "cwd": "/home/fabien/dev/AM32-bootloader",
    "executable": "/home/fabien/dev/AM32-bootloader/obj/debug.elf",
    "request": "launch",
    "type": "cortex-debug",
    "runToEntryPoint": "main",
    "servertype": "bmp",
    "BMPGDBSerialPort": "/dev/bmp-gdb",
    "armToolchainPath": "/opt/arm-gcc/bin",
    "showDevDebugOutput": "raw",
    "__configurationTarget": 6,
    "gdbServerConsolePort": 55878,
    "pvtAvoidPorts": [],
    "chainedConfigurations": {
        "enabled": false
    },
    "debuggerArgs": [],
    "swoConfig": {
        "enabled": false,
        "decoders": [],
        "cpuFrequency": 0,
        "swoFrequency": 0,
        "source": "probe"
    },
    "rttConfig": {
        "enabled": false,
        "decoders": []
    },
    "graphConfig": [],
    "preLaunchCommands": [],
    "postLaunchCommands": [],
    "preAttachCommands": [],
    "postAttachCommands": [],
    "preRestartCommands": [],
    "postRestartCommands": [],
    "preResetCommands": [],
    "postResetCommands": [],
    "powerOverBMP": "lastState",
    "interface": "swd",
    "targetId": 1,
    "toolchainPath": "/opt/arm-gcc/bin",
    "toolchainPrefix": "arm-none-eabi",
    "extensionPath": "/home/fabien/.vscode/extensions/marus25.cortex-debug-1.12.1",
    "registerUseNaturalFormat": true,
    "variableUseNaturalFormat": true,
    "pvtVersion": "1.12.1",
    "__sessionId": "77758c9f-83ef-49fe-9441-eff36c5480b3",
    "pvtShowDevDebugOutput": "raw"
}
Reading symbols from /opt/arm-gcc/bin/arm-none-eabi-objdump --syms -C -h -w /home/fabien/dev/AM32-bootloader/obj/debug.elf
Reading symbols from /opt/arm-gcc/bin/arm-none-eabi-nm --defined-only -S -l -C -p /home/fabien/dev/AM32-bootloader/obj/debug.elf
Launching GDB: /opt/arm-gcc/bin/arm-none-eabi-gdb -q --interpreter=mi2
1-gdb-version
Finished reading symbols from objdump: Time: 12 ms
Finished reading symbols from nm: Time: 16 ms
-> =thread-group-added,id="i1"
-> ~"GNU gdb (GNU Arm Embedded Toolchain 10.3-2021.10) 10.2.90.20210621-git\n"
-> ~"Copyright (C) 2021 Free Software Foundation, Inc.\n"
-> ~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\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"
-> ~"This GDB was configured as \"--host=x86_64-linux-gnu --target=arm-none-eabi\".\n"
-> ~"Type \"show configuration\" for configuration details.\n"
-> ~"For bug reporting instructions, please see:\n"
-> ~"<https://www.gnu.org/software/gdb/bugs/>.\n"
-> ~"Find the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>."
-> ~"\n\n"
-> ~"For help, type \"help\".\n"
-> ~"Type \"apropos word\" to search for commands related to \"word\".\n"
-> 1^done
2-gdb-set mi-async on
-> 2^done
3-interpreter-exec console "set print demangle on"
-> 3^done
4-interpreter-exec console "set print asm-demangle on"
-> =cmd-param-changed,param="print asm-demangle",value="on"
-> 4^done
5-enable-pretty-printing
-> 5^done
6-interpreter-exec console "source /home/fabien/.vscode/extensions/marus25.cortex-debug-1.12.1/support/gdbsupport.init"
-> 6^done
7-interpreter-exec console "source /home/fabien/.vscode/extensions/marus25.cortex-debug-1.12.1/support/gdb-swo.init"
-> =cmd-param-changed,param="language",value="c"
-> =cmd-param-changed,param="language",value="auto"
-> 7^done
8-interpreter-exec console "set output-radix 0xa"
-> ~"Output radix now set to decimal 10, hex a, octal 12.\n"
Output radix now set to decimal 10, hex a, octal 12.
-> 8^done
9-interpreter-exec console "set input-radix 0xa"
-> ~"Input radix now set to decimal 10, hex a, octal 12.\n"
Input radix now set to decimal 10, hex a, octal 12.
-> 9^done
10-file-exec-and-symbols "/home/fabien/dev/AM32-bootloader/obj/debug.elf"
-> 10^done
11-target-select extended-remote /dev/bmp-gdb
-> 11^connected
12-interpreter-exec console "monitor swdp_scan"
-> @"Target voltage: 3.3V\n"
Target voltage: 3.3V
-> @"Available Targets:\n"
Available Targets:
-> @"No. Att Driver\n"
No. Att Driver
-> @" 1      STM32G07/8 M0+\n"
 1      STM32G07/8 M0+
-> 12^done
13-interpreter-exec console "attach 1"
-> ~"Attaching to program: /home/fabien/dev/AM32-bootloader/obj/debug.elf, Remote target\n"
Attaching to program: /home/fabien/dev/AM32-bootloader/obj/debug.elf, Remote target
-> =thread-group-started,id="i1",pid="1"
-> =thread-created,id="1",group-id="i1"
-> 13^done
-> ~"LL_GPIO_IsInputPinSet (PinMask=16, GPIOx=0x50000400) at Mcu/g071/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_gpio.h:774\n"
LL_GPIO_IsInputPinSet (PinMask=16, GPIOx=0x50000400) at Mcu/g071/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_gpio.h:774
14-interpreter-exec console "set mem inaccessible-by-default off"
-> ~"774\t  return ((READ_BIT(GPIOx->IDR, PinMask) == (PinMask)) ? 1UL : 0UL);\n"
774	  return ((READ_BIT(GPIOx->IDR, PinMask) == (PinMask)) ? 1UL : 0UL);
-> *stopped,frame={addr="0x08000624",func="LL_GPIO_IsInputPinSet",args=[{name="PinMask",value="16"},{name="GPIOx",value="0x50000400"}],file="Mcu/g071/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_gpio.h",fullname="/home/fabien/dev/AM32-bootloader/Mcu/g071/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_gpio.h",line="774",arch="armv6s-m"},thread-id="1",stopped-threads="all"
mi2.status = stopped
Program stopped, probably due to a reset and/or halt issued by debugger
-> =cmd-param-changed,param="mem inaccessible-by-default",value="off"
-> 14^done
15-target-download
-> 15+download,{section=".isr_vector",section-size="188",total-size="519524"}
-> 15+download,{section=".isr_vector",section-sent="188",section-size="188",total-sent="188",total-size="519524"}
-> 15+download,{section=".text",section-size="3444",total-size="519524"}
-> 15+download,{section=".init_array",section-size="4",total-size="519524"}
-> 15+download,{section=".fini_array",section-size="4",total-size="519524"}
-> 15+download,{section=".data",section-size="4",total-size="519524"}
-> 15+download,{section=".devinfo",section-size="20",total-size="519524"}
-> 15^done,address="0x0800021c",load-size="3664",transfer-rate="167496",write-rate="407"
16-interpreter-exec console "SoftwareReset"
-> =cmd-param-changed,param="language",value="c"
-> ~"Warning: the current language does not match this frame.\n"
Warning: the current language does not match this frame.
-> =memory-changed,thread-group="i1",addr="0xe000ed0c",len="0x4"
-> =cmd-param-changed,param="language",value="auto"
-> 16^done
17-break-insert "/home/fabien/dev/AM32-bootloader/bootloader/main.c:948"
-> ~"Note: automatically using hardware breakpoints for read-only addresses.\n"
Note: automatically using hardware breakpoints for read-only addresses.
-> 17^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x08000960",func="checkForSignal",file="bootloader/main.c",fullname="/home/fabien/dev/AM32-bootloader/bootloader/main.c",line="962",thread-groups=["i1"],times="0",original-location="/home/fabien/dev/AM32-bootloader/bootloader/main.c:948"}
Returning dummy thread-id to workaround VSCode issue with pause button not working
Returning dummy stack frame to workaround VSCode issue with pause button not working: {"threadId":1,"startFrame":0,"levels":20}
18-break-insert -t --function main
-> 18^done,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x08000830",func="main",file="Mcu/g071/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_system.h",fullname="/home/fabien/dev/AM32-bootloader/Mcu/g071/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_system.h",line="1732",thread-groups=["i1"],times="0",original-location="-function main"}
19-exec-continue --all
-> 19^running
-> *running,thread-id="all"
mi2.status = running
-> =thread-group-added,id="i2"
-> ~"[New inferior 2]\n"
[New inferior 2]
-> =thread-group-started,id="i2",pid="42000"
-> &"warning: No executable has been specified and target does not support\ndetermining executable automatically.  Try using the \"file\" command."
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
-> &"\n"

-> =thread-created,id="2",group-id="i2"
-> ~"[New Thread 1]\n"
[New Thread 1]
-> &"Truncated register 17 in remote 'g' packet\n"
Truncated register 17 in remote 'g' packet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions