Indeed it fails in mbed-os internals for the thread_sleep_for
. When initializing the OS timer (triggered by thread_sleep_for
) it sees that it wasn’t properly configured to either use “tickless from µS ticker” with a µS ticker peripheral or not tickless from µS ticker but a low-power ticker. The bluepill has no LPTIM but it has several TIMs, so low-power ticker is not possible and the normal µS ticker should be used.
Can be fixed by overriding tickless-from-us-ticker
for the bluepill target in the target.json
file (found in C:\Users\<user>\.platformio\packages\framework-mbed\targets\target.json
) via the overrides
directive.
"BLUEPILL_F103C8": {
"inherits": ["FAMILY_STM32"],
"core": "Cortex-M3",
"default_toolchain": "GCC_ARM",
"extra_labels_add": ["STM32F1", "STM32F103C8"],
"supported_toolchains": ["GCC_ARM"],
"device_has_add": [
"CAN",
"SERIAL_ASYNCH",
"FLASH"
],
"device_has_remove": ["STDIO_MESSAGES", "LPTICKER"],
"overrides": {
"tickless-from-us-ticker": true
}
},
Also note that the LED is logically inverted so writing 1
to it will make it turn off.
I’ll check why this isn’t the default anymore…