Crates.io | proton-c |
lib.rs | proton-c |
version | 0.1.0 |
source | src |
created_at | 2019-07-02 04:01:05.455981 |
updated_at | 2019-07-02 04:01:05.455981 |
description | Board Support Crate for the Proton C |
homepage | |
repository | https://github.com/dfrankland/proton-c |
max_upload_size | |
id | 145330 |
size | 28,800 |
Board Support Crate for the Proton C.
Beyond the Proton C itself, it is highly recommended to setup a an ST-Link hardware debugger. It is also recommend to solder on header pins to hook up the ST-Link via a bread board. A soldering iron and solder may be needed to attach the header pins.
USB-C to USB-Whatever-Connects-to-the-Computer cable (one capable of data transfer, required)
ST-Link Debugger (recommended)
Female to female breadboard jumper cable wires (usually comes with the ST-Link itself, recommended)
Breadboard (recommended)
2.54mm straight single row pin header strips (recommended)
Male to male breadboard jumper cable wires (recommended)
After the header pins are soldered up and the Proton C is attached to a breadboard, the ST-Link needs to be connected to the relevant debugging ports. Connect the following ports on the ST-Link to the ports on the Proton C:
Connect the USB from the ST-Link and the cable connected to the USB-C port of the Proton C to the computer—both are needed.
It should go without saying that Rust Nightly and Cargo are needed. To build, flash, and run a few other things need to be installed.
To build for the Pronton C, the thumbv7em-none-eabihf
target is needed. You
can install it running the following:
rustup target add thumbv7em-none-eabihf
To flash and debug through the ST-Link, the following are needed:
openocd
gdb-multiarch
For operating systems other than Ubuntu / Debian-based distros, these may be installed under different names.
The setup to build, flash, debug, and reset needs 3 different terminals:
To run the server with correct configuration change directory to where this repo is located, then run:
openocd
This server will be used by the other terminals to interact and send commands to the Proton C.
Cargo is configured to build, flash, and start debugging in this repo, simply run:
cargo run
...and everything will get started. Once this is completed you will need to
reset the Proton C, see instructions on resetting below. To stop debugging,
enter the command: quit
.
After a program has been flashed to the Proton C, it needs to be reset. This can normally be done by unplugging any power sources and power cycling the Proton C, but to make life easier you can use the ST-Link and OpenOCD to instruct the Proton C to reset.
Connect to the OpenOCD server:
telnet localhost 4444
Reset whenever needed:
reset run