Test program for USB serial device on STM32F103C8
Dependencies: USBDevice_STM32F103
README.md@3:41ac35e35239, 2018-01-15 (annotated)
- Committer:
- SpotlightKid
- Date:
- Mon Jan 15 18:38:54 2018 +0100
- Revision:
- 3:41ac35e35239
- Parent:
- 1:f709d22a44bc
Update readme
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
SpotlightKid | 0:038a9831a9b4 | 1 | # Getting started with the USB serial test on mbed OS |
SpotlightKid | 0:038a9831a9b4 | 2 | |
SpotlightKid | 0:038a9831a9b4 | 3 | This guide reviews the steps required to get the firmware working on an mbed OS platform. |
SpotlightKid | 0:038a9831a9b4 | 4 | |
SpotlightKid | 0:038a9831a9b4 | 5 | Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli). |
SpotlightKid | 0:038a9831a9b4 | 6 | |
SpotlightKid |
3:41ac35e35239 | 7 | |
SpotlightKid | 0:038a9831a9b4 | 8 | ## Import the example application |
SpotlightKid | 0:038a9831a9b4 | 9 | |
SpotlightKid | 0:038a9831a9b4 | 10 | From the command-line, import the example: |
SpotlightKid | 0:038a9831a9b4 | 11 | |
SpotlightKid | 0:038a9831a9b4 | 12 | ``` |
SpotlightKid | 0:038a9831a9b4 | 13 | mbed import mbed-os-usbserial-test |
SpotlightKid | 0:038a9831a9b4 | 14 | cd mbed-os-usbserial-test |
SpotlightKid | 0:038a9831a9b4 | 15 | ``` |
SpotlightKid | 0:038a9831a9b4 | 16 | |
SpotlightKid |
3:41ac35e35239 | 17 | |
SpotlightKid | 0:038a9831a9b4 | 18 | ### Now compile |
SpotlightKid | 0:038a9831a9b4 | 19 | |
SpotlightKid |
3:41ac35e35239 | 20 | Invoke `mbed compile`, and specify the name of your platform and your favorite |
SpotlightKid | 0:038a9831a9b4 | 21 | toolchain (`GCC_ARM`, `ARM`, `IAR`). For example, for the Bluepill STM32F103C8 |
SpotlightKid | 0:038a9831a9b4 | 22 | and the GNU C compiler : |
SpotlightKid | 0:038a9831a9b4 | 23 | |
SpotlightKid | 0:038a9831a9b4 | 24 | ``` |
SpotlightKid | 1:f709d22a44bc | 25 | mbed compile -m BLUEPILL_F103C8 -t GCC_ARM |
SpotlightKid | 0:038a9831a9b4 | 26 | ``` |
SpotlightKid | 0:038a9831a9b4 | 27 | |
SpotlightKid |
3:41ac35e35239 | 28 | Your PC may take a few minutes to compile your code. At the end, you see the |
SpotlightKid | 0:038a9831a9b4 | 29 | some statistics about the compiled firmware. |
SpotlightKid | 0:038a9831a9b4 | 30 | |
SpotlightKid | 0:038a9831a9b4 | 31 | ``` |
SpotlightKid | 0:038a9831a9b4 | 32 | [TBD] |
SpotlightKid | 0:038a9831a9b4 | 33 | ``` |
SpotlightKid | 0:038a9831a9b4 | 34 | |
SpotlightKid |
3:41ac35e35239 | 35 | |
SpotlightKid | 0:038a9831a9b4 | 36 | ### Program your board |
SpotlightKid | 0:038a9831a9b4 | 37 | |
SpotlightKid | 0:038a9831a9b4 | 38 | Connections: |
SpotlightKid | 0:038a9831a9b4 | 39 | |
SpotlightKid | 0:038a9831a9b4 | 40 | ST-Link V2 STM32F103 (blue pill) SWD connector |
SpotlightKid | 0:038a9831a9b4 | 41 | GND GND |
SpotlightKid | 0:038a9831a9b4 | 42 | SWCLK SWCLK (PA14) |
SpotlightKid | 0:038a9831a9b4 | 43 | SWDIO SWDIO (PA13) |
SpotlightKid | 0:038a9831a9b4 | 44 | 3V3 3V3 |
SpotlightKid | 0:038a9831a9b4 | 45 | |
SpotlightKid | 0:038a9831a9b4 | 46 | Flash firmware: |
SpotlightKid | 0:038a9831a9b4 | 47 | |
SpotlightKid | 0:038a9831a9b4 | 48 | st-flash --reset write ./BUILD/NUCLEO_F103RB/GCC_ARM/*.bin 0x8000000 |
SpotlightKid | 0:038a9831a9b4 | 49 | |
SpotlightKid |
3:41ac35e35239 | 50 | |
SpotlightKid |
3:41ac35e35239 | 51 | ## Connect |
SpotlightKid |
3:41ac35e35239 | 52 | |
SpotlightKid |
3:41ac35e35239 | 53 | Connect your board via USB and start a serial terminal application: |
SpotlightKid |
3:41ac35e35239 | 54 | |
SpotlightKid |
3:41ac35e35239 | 55 | miniterm /dev/ttyACM0 115200 |
SpotlightKid |
3:41ac35e35239 | 56 | |
SpotlightKid |
3:41ac35e35239 | 57 | |
SpotlightKid | 0:038a9831a9b4 | 58 | ## References |
SpotlightKid | 0:038a9831a9b4 | 59 | |
SpotlightKid | 0:038a9831a9b4 | 60 | If you have problems, please review the [documentation](https://os.mbed.com/docs). |
SpotlightKid | 0:038a9831a9b4 | 61 | |
SpotlightKid | 0:038a9831a9b4 | 62 | * https://os.mbed.com/users/hudakz/code/USBDevice_STM32F103/ |
SpotlightKid | 0:038a9831a9b4 | 63 | * https://os.mbed.com/users/hudakz/code/STM32F103C8T6_USBSerial/ |
SpotlightKid | 0:038a9831a9b4 | 64 | * http://wiki.stm32duino.com/index.php?title=Blue_Pill |