stm32f1/README.md

84 lines
2.8 KiB
Markdown
Raw Normal View History

2017-12-23 15:10:30 +01:00
This firmware for the [BusVoodoo](https://wiki.cuvoodoo.info/doku.php?id=busvoodoo).
project
=======
summary
-------
2017-12-23 15:10:30 +01:00
The BusVoodoo is a multi-protocol debugging adapter.
This tool allows to quickly communicate with various other electronic devices.
2016-01-29 12:12:04 +01:00
board
=====
2017-12-23 15:10:30 +01:00
The BusVoodoo uses a [custom board](https://wiki.cuvoodoo.info/doku.php?id=busvoodoo#software_hardware) based on a [STM32F103RC](http://www.st.com/en/microcontrollers/stm32f103rc.html) micro-controller.
2016-01-29 12:12:04 +01:00
connections
===========
2016-01-29 12:12:04 +01:00
2017-12-23 15:10:30 +01:00
The BusVoodoo provides:
2017-12-23 15:11:38 +01:00
2017-12-23 15:10:30 +01:00
- a USB port for a connection to the PC
2017-12-23 15:13:35 +01:00
- an I/O port for the 0-5V protocols
2017-12-23 15:10:30 +01:00
- an I2C port to control an OLED display
- a programming port for debugging usindg SWD and UART
2016-01-29 12:12:04 +01:00
2017-12-23 15:10:30 +01:00
Check the [BusVoodoo hardware](https://git.cuvoodoo.info/busvoodoo_hardware/about/) files for more details.
All pins are configured using `define`s in the corresponding source code.
2016-01-29 12:12:04 +01:00
code
====
2016-01-29 12:12:04 +01:00
dependencies
------------
2016-01-29 12:12:04 +01:00
The source code uses the [libopencm3](http://libopencm3.org/) library.
The projects is already a git submodules.
2017-08-07 23:13:30 +02:00
It will be initialized when compiling the firmware.
Alternatively you can run once: `git submodule init` and `git submodule update`.
2016-01-29 12:12:04 +01:00
firmware
--------
2016-01-29 12:12:04 +01:00
2017-08-07 23:13:30 +02:00
To compile the firmware run `rake`.
2016-01-29 12:12:04 +01:00
documentation
-------------
2017-08-07 23:13:30 +02:00
To generate doxygen documentation run `rake doc`.
2016-01-29 12:12:04 +01:00
flash
-----
2017-04-15 13:58:39 +02:00
There are two firmware images: `bootloader` and `application`.
The `bootloader` image allows to flash the `application` over USB using the DFU protocol.
2017-12-23 15:10:30 +01:00
The `bootloader` is started first and immediately jumps to the `application` if it is valid and the DFU mode is not forced.
2017-08-07 23:13:30 +02:00
The `application` image is the main application and is implemented in `application.c`.
2017-04-15 13:58:39 +02:00
2017-12-23 15:10:30 +01:00
The `bootloader` image will be flashed using SWD (Serial Wire Debug).
For that you need an SWD adapter.
2017-04-03 13:12:18 +02:00
The `Makefile` uses a Black Magic Probe (per default), or a ST-Link V2 along OpenOCD software.
2017-08-07 23:13:30 +02:00
To flash the `booltoader` using SWD run `rake flash_booloader`.
2017-04-15 13:58:39 +02:00
2017-08-07 23:13:30 +02:00
Once the `bootloader` is flashed it is possible to flash the `application` over USB using the DFU protocol by running `rake flash`.
2017-12-23 15:10:30 +01:00
The `application` advertises USB DFU support (along with the USB CDC ACM class).
If the application is broken, force the bootloader to start the DFU mode by shorting the contacts marked as DFU on the board while powering up.
2017-08-07 23:13:30 +02:00
It is also possible to flash the `application` image using SWD by running `rake flash_application`.
2016-01-29 12:12:04 +01:00
debug
2016-01-29 12:12:04 +01:00
-----
SWD also allows to debug the code running on the micro-controller using GDB.
2017-08-07 23:13:30 +02:00
To start the debugging session run `rake debug`.
2016-01-29 12:12:04 +01:00
USB
---
The firmware offers serial communication over USART1 and USB (using the CDC ACM device class).
2016-01-29 12:12:04 +01:00
You can also reset the board by setting the serial width to 5 bits over USB.
2017-08-07 23:13:30 +02:00
To reset the board run `rake reset`.
2017-04-15 13:58:39 +02:00
This only works if provided USB CDC ACM is running correctly and the micro-controller isn't stuck.