Demo of the usage USBDevice library with Blue Pill STM32F103C8T6 board.

Dependencies:   USBDevice

STM32F103C8T6 USBSerial Demo

This project contains demo of the USB serial usage for a cheap developer board Blue Pill with STM32F103C8T6 mcu.


The USB serial port provides a good communication channel between PC and microcontroller. Especially it can be useful for a debug purposes.


  • by the specifications this board has only 64KB of the flash, but actually it can have 128KB, that will be useful for a debug builds as it requires about 100KB of the flash for this demo.
  • the board can have some problems with an USB because it has wrong value of the pull-up resistor
  • for steady reading of data from a serial port, the project contains python script (it requires PySerial and six python libraries), that is steady to the board reloading
  • the project depends on the fork of the USBDevice library. This fork contains some fixes and support of the BLUE_PILL_STM32F103C8 target.
  • the mbed-os now contains correct code for a clock initialization of the BLUE_PILL_STM32F103C8 target, so you don't need to adjust the board clocks separately


Konstantin Kochin

File content as of revision 0:24604e97c40c:

 * mbed SDK
 * Copyright (c) 2017 ARM Limited
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.

// Automatically generated configuration file.
// DO NOT EDIT, content will be overwritten.

#ifndef __MBED_CONFIG_DATA__
#define __MBED_CONFIG_DATA__

// Configuration parameters
#define MBED_CONF_DRIVERS_UART_SERIAL_RXBUF_SIZE       256    // set by library:drivers
#define MBED_CONF_DRIVERS_UART_SERIAL_TXBUF_SIZE       256    // set by library:drivers
#define MBED_CONF_NSAPI_PRESENT                        1      // set by library:nsapi
#define MBED_CONF_FILESYSTEM_PRESENT                   1      // set by library:filesystem
#define MBED_CONF_PPP_CELL_IFACE_BAUD_RATE             115200 // set by library:ppp-cell-iface
#define MBED_CONF_PLATFORM_STDIO_CONVERT_NEWLINES      0      // set by library:platform
#define MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP            0      // set by library:ppp-cell-iface
#define MBED_CONF_EVENTS_PRESENT                       1      // set by library:events
#define MBED_CONF_RTOS_PRESENT                         1      // set by library:rtos
#define MBED_CONF_PPP_CELL_IFACE_AT_PARSER_BUFFER_SIZE 256    // set by library:ppp-cell-iface
#define MBED_CONF_PLATFORM_STDIO_BAUD_RATE             9600   // set by library:platform
#define MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE    9600   // set by library:platform
#define MBED_CONF_PPP_CELL_IFACE_AT_PARSER_TIMEOUT     8000   // set by library:ppp-cell-iface
#define MBED_CONF_PLATFORM_STDIO_FLUSH_AT_EXIT         1      // set by library:platform
// Macros
#define UNITY_INCLUDE_CONFIG_H                                // defined by library:utest