Demo of the usage USBDevice library with Blue Pill STM32F103C8T6 board.
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.
Notes
- 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 serial_reader.py (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
mbed_config.h@0:24604e97c40c, 2017-08-04 (annotated)
- Committer:
- Konstantin Kochin
- Date:
- Fri Aug 04 18:41:22 2017 +0300
- Revision:
- 0:24604e97c40c
Initial release
The project contains autogenerated makefile for a debug build,
the program itself (main.cpp) and the helper python script
'serial_reader.py' to read a data from a serial port.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Konstantin Kochin |
0:24604e97c40c | 1 | /* |
Konstantin Kochin |
0:24604e97c40c | 2 | * mbed SDK |
Konstantin Kochin |
0:24604e97c40c | 3 | * Copyright (c) 2017 ARM Limited |
Konstantin Kochin |
0:24604e97c40c | 4 | * |
Konstantin Kochin |
0:24604e97c40c | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Konstantin Kochin |
0:24604e97c40c | 6 | * you may not use this file except in compliance with the License. |
Konstantin Kochin |
0:24604e97c40c | 7 | * You may obtain a copy of the License at |
Konstantin Kochin |
0:24604e97c40c | 8 | * |
Konstantin Kochin |
0:24604e97c40c | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Konstantin Kochin |
0:24604e97c40c | 10 | * |
Konstantin Kochin |
0:24604e97c40c | 11 | * Unless required by applicable law or agreed to in writing, software |
Konstantin Kochin |
0:24604e97c40c | 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
Konstantin Kochin |
0:24604e97c40c | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Konstantin Kochin |
0:24604e97c40c | 14 | * See the License for the specific language governing permissions and |
Konstantin Kochin |
0:24604e97c40c | 15 | * limitations under the License. |
Konstantin Kochin |
0:24604e97c40c | 16 | */ |
Konstantin Kochin |
0:24604e97c40c | 17 | |
Konstantin Kochin |
0:24604e97c40c | 18 | // Automatically generated configuration file. |
Konstantin Kochin |
0:24604e97c40c | 19 | // DO NOT EDIT, content will be overwritten. |
Konstantin Kochin |
0:24604e97c40c | 20 | |
Konstantin Kochin |
0:24604e97c40c | 21 | #ifndef __MBED_CONFIG_DATA__ |
Konstantin Kochin |
0:24604e97c40c | 22 | #define __MBED_CONFIG_DATA__ |
Konstantin Kochin |
0:24604e97c40c | 23 | |
Konstantin Kochin |
0:24604e97c40c | 24 | // Configuration parameters |
Konstantin Kochin |
0:24604e97c40c | 25 | #define MBED_CONF_DRIVERS_UART_SERIAL_RXBUF_SIZE 256 // set by library:drivers |
Konstantin Kochin |
0:24604e97c40c | 26 | #define MBED_CONF_DRIVERS_UART_SERIAL_TXBUF_SIZE 256 // set by library:drivers |
Konstantin Kochin |
0:24604e97c40c | 27 | #define MBED_CONF_NSAPI_PRESENT 1 // set by library:nsapi |
Konstantin Kochin |
0:24604e97c40c | 28 | #define MBED_CONF_FILESYSTEM_PRESENT 1 // set by library:filesystem |
Konstantin Kochin |
0:24604e97c40c | 29 | #define MBED_CONF_PPP_CELL_IFACE_BAUD_RATE 115200 // set by library:ppp-cell-iface |
Konstantin Kochin |
0:24604e97c40c | 30 | #define MBED_CONF_PLATFORM_STDIO_CONVERT_NEWLINES 0 // set by library:platform |
Konstantin Kochin |
0:24604e97c40c | 31 | #define MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP 0 // set by library:ppp-cell-iface |
Konstantin Kochin |
0:24604e97c40c | 32 | #define MBED_CONF_EVENTS_PRESENT 1 // set by library:events |
Konstantin Kochin |
0:24604e97c40c | 33 | #define MBED_CONF_RTOS_PRESENT 1 // set by library:rtos |
Konstantin Kochin |
0:24604e97c40c | 34 | #define MBED_CONF_PPP_CELL_IFACE_AT_PARSER_BUFFER_SIZE 256 // set by library:ppp-cell-iface |
Konstantin Kochin |
0:24604e97c40c | 35 | #define MBED_CONF_PLATFORM_STDIO_BAUD_RATE 9600 // set by library:platform |
Konstantin Kochin |
0:24604e97c40c | 36 | #define MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE 9600 // set by library:platform |
Konstantin Kochin |
0:24604e97c40c | 37 | #define MBED_CONF_PPP_CELL_IFACE_AT_PARSER_TIMEOUT 8000 // set by library:ppp-cell-iface |
Konstantin Kochin |
0:24604e97c40c | 38 | #define MBED_CONF_PLATFORM_STDIO_FLUSH_AT_EXIT 1 // set by library:platform |
Konstantin Kochin |
0:24604e97c40c | 39 | // Macros |
Konstantin Kochin |
0:24604e97c40c | 40 | #define UNITY_INCLUDE_CONFIG_H // defined by library:utest |
Konstantin Kochin |
0:24604e97c40c | 41 | |
Konstantin Kochin |
0:24604e97c40c | 42 | #endif |