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.

/media/uploads/vznncv/stm32f103c8_usbserial.jpg

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
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?

UserRevisionLine numberNew contents of line
Konstantin Kochin 0:24604e97c40c 1 """
Konstantin Kochin 0:24604e97c40c 2 mbed SDK
Konstantin Kochin 0:24604e97c40c 3 Copyright (c) 2016 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 from os.path import join, abspath, dirname
Konstantin Kochin 0:24604e97c40c 19
Konstantin Kochin 0:24604e97c40c 20 #ROOT = abspath(join(dirname(__file__), "."))
Konstantin Kochin 0:24604e97c40c 21
Konstantin Kochin 0:24604e97c40c 22 ##############################################################################
Konstantin Kochin 0:24604e97c40c 23 # Build System Settings
Konstantin Kochin 0:24604e97c40c 24 ##############################################################################
Konstantin Kochin 0:24604e97c40c 25 #BUILD_DIR = abspath(join(ROOT, "build"))
Konstantin Kochin 0:24604e97c40c 26
Konstantin Kochin 0:24604e97c40c 27 # ARM
Konstantin Kochin 0:24604e97c40c 28 #ARM_PATH = "C:/Program Files/ARM"
Konstantin Kochin 0:24604e97c40c 29
Konstantin Kochin 0:24604e97c40c 30 # GCC ARM
Konstantin Kochin 0:24604e97c40c 31 #GCC_ARM_PATH = ""
Konstantin Kochin 0:24604e97c40c 32
Konstantin Kochin 0:24604e97c40c 33 # GCC CodeRed
Konstantin Kochin 0:24604e97c40c 34 #GCC_CR_PATH = "C:/code_red/RedSuite_4.2.0_349/redsuite/Tools/bin"
Konstantin Kochin 0:24604e97c40c 35
Konstantin Kochin 0:24604e97c40c 36 # IAR
Konstantin Kochin 0:24604e97c40c 37 #IAR_PATH = "C:/Program Files (x86)/IAR Systems/Embedded Workbench 7.0/arm"
Konstantin Kochin 0:24604e97c40c 38
Konstantin Kochin 0:24604e97c40c 39 # Goanna static analyser. Please overload it in private_settings.py
Konstantin Kochin 0:24604e97c40c 40 #GOANNA_PATH = "c:/Program Files (x86)/RedLizards/Goanna Central 3.2.3/bin"
Konstantin Kochin 0:24604e97c40c 41
Konstantin Kochin 0:24604e97c40c 42 #BUILD_OPTIONS = []
Konstantin Kochin 0:24604e97c40c 43
Konstantin Kochin 0:24604e97c40c 44 # mbed.org username
Konstantin Kochin 0:24604e97c40c 45 #MBED_ORG_USER = ""