nikhilkalige / bikepov

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cortex-m-quickstart

A template for building applications for ARM Cortex-M microcontrollers

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Instructions

  • Disable incremental compilation. It doesn't work for embedded development. You'll hit nonsensical linker errors if you use it.
$ unset CARGO_INCREMENTAL
  • Build the application
# NOTE this command requires `arm-none-eabi-ld` to be in $PATH
$ xargo build --release
  • Flash the program
# Launch OpenOCD on a terminal
$ openocd -f interface/stlink-v2-1.cfg -f target/stm32f4x.cfg
# Start a debug session in another terminal
$ arm-none-eabi-gdb target/..

NOTE As of nightly-2017-05-14 or so and cortex-m-quickstart v0.1.6 you can simply run cargo run or cargo run --example $example to build the program, and immediately start a debug session. IOW, it lets you omit the arm-none-eabi-gdb command.

$ cargo run --example hello
> # drops you into a GDB session

About

License:MIT License


Languages

Language:Rust 86.3%Language:Python 9.3%Language:GDB 4.4%