diff options
author | xengineering <mail2xengineering@protonmail.com> | 2020-10-31 21:15:52 +0100 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2020-10-31 21:15:52 +0100 |
commit | 7d0035a6940394c01398a7c2f061093319c328f7 (patch) | |
tree | e8e9e9fb69baf6354fdd30e9921251c7a90b5ddd | |
parent | 0314c77fd9fd9372bdef8c190cef7e78dc2ae5b2 (diff) | |
download | stm32f103c8-examples-7d0035a6940394c01398a7c2f061093319c328f7.tar stm32f103c8-examples-7d0035a6940394c01398a7c2f061093319c328f7.tar.zst stm32f103c8-examples-7d0035a6940394c01398a7c2f061093319c328f7.zip |
Update Documentation
-rw-r--r-- | README.md | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -16,3 +16,40 @@ The STM32 Blue Pill board is based on the STM32F103C8 microcontroller. Because o ### The Debugger/Programmer: Black Magic Probe To program the target microcontroller you have to use a suitable programmer. A good choice could be the [Black Magic Probe](https://1bitsquared.com/products/black-magic-probe) (BMP). It has a built-in GDB server and serial debugger. + +I built my own Black Magic Probe with this [tutorial](https://medium.com/@paramaggarwal/converting-an-stm32f103-board-to-a-black-magic-probe-c013cf2cc38c) only using a Blue Pill Board for a few bucks and a FTDI USB to serial converter. + +### The Programmer Software: The GNU Debugger (GDB) + +To upload and debug the software I recommend the GNU Debugger (GDB). You have to use the arm-none-eabi-gdb version of it. Your favourite Linux Distribution has probably a package for it. Install it under Arch Linux like this: + +```sudo pacman -S arm-none-eabi-gdb``` + +### The Compiler: GCC + +To compile the software you have to use a suitable compiler. I recommend the GNU Compiler Collection (GCC). Also at this point you have to use a ARM-specific version. Install it under Arch Linux like this: + +```sudo pacman -S arm-none-eabi-gcc``` + +### The 'IDE': Your favourite Text Editor + +To modify the software in this repository or write your own code you can use any text editor. Please only use a complete IDE (Integrated Development Environment) if you know **why**. + + +## Usage + +To download, compile , upload and run the GPIO blink example you just have to connect your target to the Black Magic Probe and the BMP to your computer. After that just type this in your terminal: + +``` +git clone --recurse-submodules https://github.com/xengineering/stm32f103c8-examples.git +cd stm32f103c8-examples +make -C libopencm3 all # compile libopencm3 (takes some time ...) +make -C gpio_blink all # compile the blink example +make -C gpio_blink bmp # open GDB via the Black Magic Probe +load # load the program to the microcontroller +run # run the program with GDB's debugging features (you could also call other GDB commands) +CTRL + c # press CTRL c to stop execution of the program +CTRL + d # press CTRL d to quit GDB - your microcontroller will run the program automatically +``` + +You can easily adapt this to any example of this repository. Just substitute gpio_blink with the other examples (like 'usart'). |