Marus / cortex-debug

Visual Studio Code extension for enhancing debug capabilities for Cortex-M Microcontrollers
MIT License
1.01k stars 238 forks source link

support for other ISAs #358

Closed mttbx closed 3 years ago

mttbx commented 3 years ago

Can you extract the same part to support other ISAs? Maybe make a new extension. It would be helpful!

Marus commented 3 years ago

Sorry for the slow response, it's unfortunately been a long time since I've had any time to put into the extension.

I am considering attempting to add support for other targets than ARM Cortex devices - although don't really have a timeline here. I expect my first additional target would be ESP32 devices (mostly because I've been using them in some of my personal projects). Are there particular other platforms you are interested in? Could be something to consider for the future.

mttbx commented 3 years ago

Yeah, I'm interested in gd32vf103 (not gd32f103) chip which is riscv arch.

Marus commented 3 years ago

Well - it's something that may be considered - can you send me links to information about the toolchain, GDB server (is it some OpenOCD variant), etc you are using and stuff - it may even be possible to get the basics running with some clever configuration properties - but no guarantee (and of course some features like SWO output simply wouldn't be applicable).

mttbx commented 3 years ago

I can already debug it using your extension, but more support would be nice!

gdb: use toolchain or gdb-multiarch

gdbserver: riscv-openocd

https://github.com/riscv/riscv-openocd

toolchain:

https://github.com/sifive/freedom-tools/releases or platformio in vscode

If you want to use gd32vf103, you may need its firmware library:

https://github.com/riscv-mcu/GD32VF103_Firmware_Library

I don't think it may need a lot of affort, because most of the jobs were done by openocd.

mttbx commented 3 years ago

A good way to support different gdbserver would be to add interface with gdb. So we can configure it before we start to debug our program. For example add some cmd to load program or select swd/jtag protocol. Some debugger may need that.

I think this extension may need to focus on the gdb remote debugging. This is the part valuable and need flexibility. The implementation of debugging is normally the same. And all of these can be applied to all the ISAs.