Using PlatformIO with STM32L431 for debugging only

Hi,

I work for a company that develops their own custom boards, and one of the product uses a STM32L431 connected to various peripherals.

Right now I’m writing code with VS Code, building it with CMake, and using Ozone with a J-Link probe to debug. I was wondering if it would be possible to use PlatformIO to do debugging only with the generated elf/bin from CMake? And if so, could anyone point me in the right direction?

P.S: I’m pretty new to the embedded/firmware SW ecosystems.

I don’t think that’s possible without some severe hacking. When you use PlatformIO’s debug launch task, it at least expects a platformio.ini for configuration, will look for possible changes in source files to rebuild it (with the PlatformIO build system) and expect the .elf etc file in special locations.

What you want is to just install the cortex-debug extension and configure it properly in the launch.json. Easy and direct, no PlatformIO involved.

1 Like