I’ve been getting up on MbedOS 6 on my STM32WB55 development board. I am trying to get USBSerial working on the USB_USER connector but am having some issues.
The default constructor for USBSerial blocks forever, no matter if the cable is plugged in at boot or plugged in after boot.
I have tried using the non blocking parameter in the constructor, i.e :
#include "mbed.h"
#include "USBSerial.h"
USBSerial serial(false);
int main(void)
{
wait(10.0);
serial.init();
wait(5.0);
serial.connect();
while(1)
{
serial.printf("I am a virtual serial port\r\n");
wait(1.0);
}
}
This makes the board show up in Windows as another COM port, which is what I expected, but the printf calls from the board are not picked up in Windows. Curiously, serial.scanf(…) returns immediately in mbed.
Not sure if I am doing something wrong, or if I misunderstanding the capabilities of the board.