cortex-m-quickstart icon indicating copy to clipboard operation
cortex-m-quickstart copied to clipboard

VSCode GDB Launch Configuration Not Taken From `openocd.gdb`

Open david-boles opened this issue 5 years ago • 6 comments

Would it be possible to configure the VSCode cortex-debug extension to pull its gdb commands from openocd.gdb? I ran into this when trying to use semihosting, openocd.gdb enables it but the cortex-debug launch configuration doesn't. If not (I couldn't see how), should I make a pull request to add "preLaunchCommands": ["monitor arm semihosting enable"] to the launch configurations?

david-boles avatar Mar 06 '20 19:03 david-boles

AFAIK it’s not currently possible to load a gdb script through the cortex-debug extension. I would encourage you to open an issue there as I couldn’t find a related one.

I think it’s reasonable to open a PR that adds semihosting to the QEMU launch config, since the stm32f303 config is set up to use ITM. That way we have an example for both communication mechanisms. QEMU doesn’t support ITM, so it seems reasonable, to me, for it to be the one to be configured for semihosting.

rubberduck203 avatar Mar 10 '20 23:03 rubberduck203

You can add this to your launch.json. Worked nicely with stm32g0.

            "postLaunchCommands": [
                "monitor arm semihosting enable",
            ],

Also cortex-debug supports a lot of parameters that can be tweaked: https://github.com/Marus/cortex-debug/blob/master/package.json#L195

andresv avatar May 07 '20 20:05 andresv

Damn, I should have read OP more carefully. It was all there.

andresv avatar May 07 '20 20:05 andresv

Can this issue be closed?

rubberduck203 avatar Jun 17 '21 11:06 rubberduck203

Is there a way to configure the extension to show hprintln output?

reitermarkus avatar Apr 01 '22 10:04 reitermarkus

Ah, nevermind, hprintln output is in the gdb-server terminal.

reitermarkus avatar Apr 01 '22 10:04 reitermarkus