Search code examples
visual-studio-codestm32elfcortex-mopenocd

What is the .elf file used in the launch.json of VSCode


I am trying to use VSCode, an ST Link v2, OpenOCD, and Cortex-Debug to code an stm32 ARM Microcontroller. I am running Ubuntu 16.04.4 LTS. I am having trouble in my launch.json file in vscode. Here is what's in the file:

 {
    "version": "2.0.0",
    "configurations": [
        {
            "type": "cortex-debug",
            "request": "launch",
            "servertype": "openocd",
            "cwd": "${workspaceRoot}",
            "executable": "./firmware.elf",
            "name": "Debug (OpenOCD)",
            "device": "stlink",
            "configFiles": [
                "interface/stlink-v2.cfg"
            ]
        }
    ]
}

I'm confused as to what the firmware.elf file is referring to. I have an idea of what a .elf file is, but I don't know if I am supposed to create this file or if I have to download a specific .elf file online.


Solution

  • The ELF file is an archive containing your binaries, info about compiler, processor, symbol table, arch etc. Your compiler should output this after it compiled your code. It contains the actual binary you want to run on the microcontroller.

    So yes, you should provide it.