c++arduinostm32freertosplatformio

Why USB Serial is not working with STM32FreeRTOS in STM32 black pill?


In my STM32 project i want to use both FreeRTOS and Serial communication . But after include FreeRTOS dependency , the serial connection is not working. I am working in PlatformIO STM32Duino frame work and using library FreeRTOS

See the below is my test code

#include <Arduino.h>
void setup() {

  Serial.begin(9600);
  Serial.println("Serial Started...");
}
void loop() {
  Serial.println("Hello world..");
  delay(1000);
}

And PlatformIO configuration is below

[env:STM32]
platform = ststm32
board = blackpill_f411ce
framework = arduino
upload_protocol = dfu
monitor_speed = 115200
build_flags = 
    -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
    -D USBCON
build_src_filter=+<*> -<.git/> -<.svn/> -<doc/>
lib_deps= https://github.com/stm32duino/STM32FreeRTOS/archive/refs/tags/10.3.2.zip

But I found that COM port is detecting in the windows but serial monitor is not able to connect to the COM port . If i comment out the line 'lib_deps=....' Every thing working fine

Let me know if anybody knows the solution


Solution

  • I defined configMEMMANG_HEAP_NB in ini file and now Serial and FreeRTOS are working. Below is the new configuration

    [env:STM32]
    platform = ststm32
    board = blackpill_f411ce
    framework = arduino
    debug_tool = stlink
    upload_protocol = stlink
    monitor_speed = 115200
    build_flags = 
        -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
        -D USBCON
        -D configMEMMANG_HEAP_NB
    build_src_filter=+<*> -<.git/> -<.svn/> -<doc/>
    lib_deps=https://github.com/stm32duino/STM32FreeRTOS.git