Hello!
Could someone please help me with sprintf on bluepill?
If i compile with mapel core sprintf works but not with st-core.
Searching on the internet suggests to put “-u _printf_float” into linker flags but it did not compile…
Robert
Here’s my configuration:
main.cpp:
#include <Arduino.h>
char displayString[10];
void setup()
{
Serial.begin(115200);
}
void loop()
{
sprintf(displayString, "%f", 123.4);
Serial.print(displayString);
delay(200);
}
platformio.ini:
[env]
platform = ststm32build_flags =
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
-D USBCON
-D USBD_VID=0x0483
-D USB_MANUFACTURER=“Unknown”
-D USB_PRODUCT="“BLUEPILL_F103C8"”
-D HAL_PCD_MODULE_ENABLEDframework = arduino
board_build.core = st[env:bluepill]
board = genericSTM32F103CB