I am trying to get the examples at: stm32f103c8t6/rtos/blinky2 at master · ve3wwg/stm32f103c8t6 · GitHub to compile from within platformIO and let me use the debugger.
Board: stm32f103c8t6
Using the author’s makefile I can compile, and the uploaded binaries run, but when I compile and run it from within platformio, it just does nothing - the PC13 LED turns on and does not blink. The blackmagic gdb debugger shows the device refusing to enter the task function, but it does pause on main, and then pause on a line in the RTOS code. I am trying to use openlibcm3.
Can anyone provide any advice on moving forward? There is a linker .ld provided with the rtos example code above. It does not seem to make any difference, and when I compile other projects with it, they continue to work, so it seems like the linker config in platformio.ini is good.
The examples above seem to rely on a series of make files and a specific directory structure, but I have made both freeRTOS and openlibcm3 available, and the code compiles and skips around in the debugger, it just never enters the task.
The .elf files produced are slightly different sizes. Both are bigger than 128kb, but seem to program in ok. Produced with shell make command: 271kb(!), made with platformio build: 137kb
Here is my current platformio.ini, and below that is the output from compiling my current blinky project.
[env:genericSTM32F103CB]
platform = ststm32
board = genericSTM32F103CB
framework = libopencm3
;debug_tool = stlink
;build_flags = -ggdb, -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1
build_flags =-Wl,-T'"$PROJECT_DIR/src/stm32f103c8t6.ld"',-v
; set CKS mcu ID for knock off of STM chip
;https://community.platformio.org/t/cannot-upload-to-stm32-bluepill-board-over-stlink-v2/3492/19
;upload_flags = -c set CPUTAPID 0x2ba01477
monitor_speed = 115200
;monitor_port = \\.\COM36
debug_tool = blackmagic
debug_port = \\.\COM37
upload_port = \\.\COM37
; SWD interface
upload_protocol = blackmagic
; JTAG interface
;upload_protocol = blackmagic-jtag
The compiler output from the non-working platformio configuration.
> Executing task in folder freeRTOS1: C:\Users\Robert.platformio\penv\Scripts\platformio.exe run --verbose <
Processing genericSTM32F103CB (platform: ststm32; board: genericSTM32F103CB; framework: libopencm3; build_flags: -Wl,-T'"$PROJECT_DIR/src/stm32f103c8t6.ld"',-v; monitor_speed: 115200; debug_tool: blackmagic; debug_port: \\.\COM37; upload_port: \\.\COM37; upload_protocol: blackmagic)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/genericSTM32F103CB.html
PLATFORM: ST STM32 5.7.0 > STM32F103CB (20k RAM. 128k Flash)
HARDWARE: STM32F103CBT6 72MHz, 20KB RAM, 128KB Flash
DEBUG: Current (blackmagic) External (blackmagic, jlink, stlink)
PACKAGES: toolchain-gccarmnoneeabi 1.70201.0 (7.2.1), framework-libopencm3 1.1.0
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Framework incompatible library C:\Users\Robert\.platformio\lib\Adafruit GFX Library_ID13
Framework incompatible library C:\Users\Robert\.platformio\lib\Adafruit SSD1306_ID135
Framework incompatible library C:\Users\Robert\.platformio\lib\Adafruit ST7735 and ST7789 Library_ID12
Framework incompatible library C:\Users\Robert\.platformio\lib\ArduinoMenu library_ID1468
Framework incompatible library C:\Users\Robert\.platformio\lib\FreeRTOS_ID507
Framework incompatible library C:\Users\Robert\.platformio\lib\HID-Project_ID523
Framework incompatible library C:\Users\Robert\.platformio\lib\Joystick_ID6628
Framework incompatible library C:\Users\Robert\.platformio\lib\Keypad_ID165
Framework incompatible library C:\Users\Robert\.platformio\lib\LCDWIKI GUI Library
Framework incompatible library C:\Users\Robert\.platformio\lib\LibPrintf_ID6768
Framework incompatible library C:\Users\Robert\.platformio\lib\SSD1283A
Framework incompatible library C:\Users\Robert\.platformio\lib\Tasker_ID1423
Framework incompatible library C:\Users\Robert\.platformio\lib\USBComposite for STM32F1
Framework incompatible library C:\Users\Robert\.platformio\lib\Yet Another Arduino PcInt Library_ID795
Framework incompatible library C:\Users\Robert\.platformio\lib\arduino-menusystem_ID163
Framework incompatible library C:\Users\Robert\.platformio\lib\lv_arduino_ID6228
Found 4 compatible libraries
More details about "Library Compatibility Mode": https://docs.platformio.org/page/librarymanager/ldf.html#ldf-compat-mode
Scanning dependencies...
Dependency Graph
|-- <freeRTOS> (C:\Users\Robert\Documents\PlatformIO\Projects\freeRTOS1\lib\freeRTOS)
Building in release mode
MethodWrapper(["checkprogsize"], [".pio\build\genericSTM32F103CB\firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
DATA: [========= ] 86.2% (used 17648 bytes from 20480 bytes)
PROGRAM: [ ] 2.2% (used 2940 bytes from 131072 bytes)
.pio\build\genericSTM32F103CB\firmware.elf :
section size addr
.text 2924 134217728
.preinit_array 0 134220652
.init_array 0 134220652
.fini_array 0 134220652
.data 16 536871148
.bss 17632 536871164
.comment 126 0
.ARM.attributes 51 0
Total 20749