Arm Mbed OS support forum

USBSerial example - "Unknown device"

Hello!

I try USBSerial example with “blue pill” stm32 board.

I am import this code to Mbed online compiler, compiling and programming via st-link v2
But only “Unknown device” appear in device manager with ID USB\UNKNOWN

Whats whong with it?
Thank you!

/*
 * Copyright (c) 2006-2020 Arm Limited and affiliates.
 * SPDX-License-Identifier: Apache-2.0
 */
#include "mbed.h"
#include "USBSerial.h"

//Virtual serial port over USB
USBSerial serial;

int main(void)
{
    while (1) {
        serial.printf("I am a virtual serial port\r\n");
        ThisThread::sleep_for(1000);
    }
}

Hi Dmitry,

it may well be that the board you are using is not yet Mbed Enabled (ie it has not been ported to Mbed). You can check supported boards here :
https://os.mbed.com/platforms/

Regards
Anna

Hello,
Some information can be found here

Br,Jan