Giter VIP home page Giter VIP logo

Comments (3)

politoleo avatar politoleo commented on August 16, 2024

You could try something like this, don't forget to fix debugServerArgs to fit your hardware.
Replace APP.out with your ELF output, download arm-none-eabi and openocd and fix the paths

   {
      "name": "Debug ST-Link",
      "type": "cppdbg",
      "request": "launch",
      "program": "APP.out", 
      "stopAtEntry": true,
      "cwd": "${workspaceRoot}",
      "externalConsole": false,
      "MIMode": "gdb",
      "miDebuggerPath": "arm-none-eabi-gdb.exe",
      "debugServerPath": "openocd/bin/openocd.exe",
      "debugServerArgs": "-s \"openocd\\share\\openocd\\scripts\" -f interface/stlink-v2-1.cfg -c \"transport select hla_swd\" -f target/stm32l4x.cfg -c \"adapter_khz 4000\" -c \"telnet_port disabled\" -c \"tcl_port disabled\"",
      "serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
      "serverLaunchTimeout": 5000,
      "targetArchitecture": "arm",
      "filterStderr": true,
      "filterStdout": true,
      "launchCompleteCommand": "exec-continue",
      "logging": {
        "trace": false,
        "traceResponse": false,
        "engineLogging": true
      },
      "setupCommands": [
        {
          "text": "target remote localhost:3333"
        },
        {
          "text": "monitor reset halt"
        },
        {
          "text": "load APP.out" 
        },
        {
          "text": "monitor reset init"
        }
      ]
    }

from iar.

meteusteler avatar meteusteler commented on August 16, 2024

Hi,
I tried your suggestion and I get error like this:

1: (205) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
1: (222) LaunchOptions ExePath='C:\Users*\EWARM\STM32F051\Exe\Project.out'
1: (222) LaunchOptions WorkingDirectory='C:\Users***'
1: (222) LaunchOptions TargetArchitecture='arm'
1: (222) LaunchOptions ExeArguments=''
1: (222) LaunchOptions MIMode='gdb'
1: (222) LaunchOptions MIDebuggerPath='C:\Program Files (x86)\GNU Tools ARM Embedded\7 2017-q4-major\bin\arm-none-eabi-gdb.exe'
1: (222) LaunchOptions WaitDynamicLibLoad='false'
1: (222) LaunchOptions DebugServer='C:\Users*
\Desktop\OpenOCD-20170821\bin\openocd.exe'
1: (223) LaunchOptions DebugServerArgs='-s "openocd\share\openocd\scripts" -f interface/stlink-v2-1.cfg -c "transport select hla_swd" -f target/stm32F0x.cfg -c "adapter_khz 4000" -c "telnet_port disabled" -c "tcl_port disabled"'
1: (223) LaunchOptions load APP.out
1: (223) LaunchOptions monitor reset init
1: (223) LaunchOptions
1: (223) LaunchOptions exec-continue
1: (223) LaunchOptions
1: (290) Starting: "C:\Users***\Desktop\OpenOCD-20170821\bin\openocd.exe" -s "openocd\share\openocd\scripts" -f interface/stlink-v2-1.cfg -c "transport select hla_swd" -f target/stm32F0x.cfg -c "adapter_khz 4000" -c "telnet_port disabled" -c "tcl_port disabled"
1: (770) "C:\Users**\Desktop\OpenOCD-20170821\bin\openocd.exe" exited with code 1 (0x1).
1: (780) <-logout

and my json file like this,

{
"version": "0.2.1",
"configurations": [

    {
        "name": "Debug ST-Link",
        "type": "cppdbg",
        "request": "launch",
        "program": "C:\\Users\\**\\EWARM\\STM32F051\\Exe\\Project.out",
        "stopAtEntry": true,
        "cwd": "${workspaceRoot}",
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "C:\\Program Files (x86)\\GNU Tools ARM Embedded\\7 2017-q4-major\\bin\\arm-none-eabi-gdb.exe",
        "debugServerPath": "C:\\Users\\**\\Desktop\\OpenOCD-20170821\\bin\\openocd.exe",
        "debugServerArgs": "-s \"openocd\\share\\openocd\\scripts\" -f interface/stlink-v2-1.cfg -c \"transport select hla_swd\" -f target/stm32F0x.cfg -c \"adapter_khz 4000\" -c \"telnet_port disabled\" -c \"tcl_port disabled\"",
        "serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
        "serverLaunchTimeout": 5000,
        "targetArchitecture": "arm",
        "filterStderr": true,
        "filterStdout": true,
        "launchCompleteCommand": "exec-continue",
        "logging": {
            "trace": false,
            "traceResponse": false,
            "engineLogging": true
        },
        "setupCommands": [
            {
                "text": "target remote localhost:3333"
            },
            {
                "text": "monitor reset halt"
            },
            {
                "text": "load APP.out"
            },
            {
                "text": "monitor reset init"
            }
        ]
    }
]

}

from iar.

politoleo avatar politoleo commented on August 16, 2024

Hi, it seems to be an OpenOCD problem, try to run it manually with cmd.exe and look for errors on the output:

"C:\Users\*\Desktop\OpenOCD-20170821\bin\openocd.exe" -s "openocd\share\openocd\scripts" -f interface/stlink-v2-1.cfg -c "transport select hla_swd" -f target/stm32F0x.cfg -c "adapter_khz 4000" -c "telnet_port disabled" -c "tcl_port disabled"

Anyhow I just tried out with openocd and ST-Link and it's working, this is my configuration:

 {
  "version": "0.2.1",
  "configurations": [
    {
      "name": "Debug ST-Link",
      "type": "cppdbg",
      "request": "launch",
      "program": "${workspaceRoot}/project/build/debug/EBUI.out",
      "stopAtEntry": true,
      "cwd": "${workspaceRoot}",
      "externalConsole": false,
      "MIMode": "gdb",
      "miDebuggerPath": "C:\\GCC\\arm\\bin\\arm-none-eabi-gdb.exe",
      "debugServerPath": "C:\\GCC\\debug\\openocd\\bin\\openocd.exe",
      "debugServerArgs": "-s \"C:\\GCC\\debug\\openocd\\share\\openocd\\scripts\" -f interface/stlink-v2-1.cfg -c \"transport select hla_swd\" -f target/stm32l4x.cfg -c \"adapter_khz 1000\" -c \"telnet_port disabled\" -c \"tcl_port disabled\"",
      "serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
      "serverLaunchTimeout": 10000,
      "targetArchitecture": "arm",
      "filterStderr": true,
      "filterStdout": true,
      "logging": {
        "trace": false,
        "traceResponse": false,
        "engineLogging": false
      },
      "setupCommands": [
        {
          "text": "target remote localhost:3333"
        },
        {
          "text": "monitor reset init"
        },
        {
          "text": "load C:/Users/Leonardo/Desktop/EBUI/project/build/debug/EBUI.out"
        },
        {
          "text": "monitor reset init"
        }
      ]
    }
  ]
}

from iar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.