I’m trying to configure VSCode and PlatformIO to code on a STM8s003f3 micro-controller. I managed to make it build and upload the code (even though I had to manually indicate in platformio.ini where to find STM8S_StdPeriph_Driver for it to compile).
But now I have problems debugging.
When I go to the debug section and run PIO Debug, I don’t have any error but the debug does not occur. The little window with the start/stop/restart/… buttons is even appearing to disappear just afterwards.
In parallel, I managed to make it work with cosmic compiler and STVD IDE but I would really love to be able to make it work with VSCode and PlatformIO.
You are setting core_dir to… inside the ststm8spl package? That’s very weird and does not do what you want. It will move / reinstall the Arduino core in that folder Please remove that line.
Yes it sounded weird to me too and it took me a lot of time and frustration to go through it ^^
Here is the git repo of the code : GitHub - frmarc/Blink_PIO_STM8
When it comes to the Dwarf error thanks for the information.
I guess I’ll wait for it to be fixed then and use STVD in the mean time.
When I don’t set core_dir, the terminal output this, and nothing is outputted in the “Output” window
> Executing task: C:\Users\marc\.platformio\penv\Scripts\platformio.exe run <
legacy Click
Processing debug (platform: ststm8; board: stm8s003f3; framework: spl)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm8/stm8s003f3.html
PLATFORM: ST STM8 (2.0.0) > ST STM8S003F3 chip
HARDWARE: STM8S003F3P6 16MHz, 1KB RAM, 8KB Flash
DEBUG: Current (stlink) External (stlink)
PACKAGES:
- framework-ststm8spl 0.20301.181217 (2.3.1)
- tool-stm8binutils 0.230.0 (2.30)
- toolchain-sdcc 1.40100.12072 (4.1.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
Linking .pio\build\debug\firmware.elf
?ASlink-Warning-Undefined Global '_GPIO_Init' referenced by module 'main'
?ASlink-Warning-Undefined Global '_GPIO_WriteReverse' referenced by module 'main'
*** [.pio\build\debug\firmware.elf] Error 1
=================================================================================== [FAILED] Took 1.36 seconds ===================================================================================
The terminal process "C:\Users\marc\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
Also I don’t know if it is linked but when I start VSCode in output it says [14/10/2021, 12:06:44] Unable to resolve configuration with compilerPath "C:/Users/marc/.platformio/packages/toolchain-sdcc/bin/sdcc.exe". Using "cl.exe" instead.
The thing is that the file is there so I don’t really know what happens here …
Probably a partly corrupted package download for SPL, not sure. But this is how it’s supposed to work normally – no setting core_dir inside a package.
As for the SDCC bug, I’ve notified the developers again and hopefully this can get resolved for Windows. You might want to try a Linux VM and pass through the STLink adapter to get it work in the meantime.