Skip to content

beattie/cortex-m-stm32f3disc-quickstart

Repository files navigation

cortex-m-quickstart

A template for building applications for the stm32f3-Discovery board

This project was started from the cortex-m-quickstart project from Cortex-M team. Included is a project to demonstrate RTIC (Real-Time Interrupt-driven Concurrency) an RTOS-like framework.

There are two ways to run under gdb:

  1. In the root directory run openocd, In a different terminal run cargo run

    or

  2. In the root directory run cargo embed. In a different terminal run gdb-multiarch -x gdb.run target/thumbv7em-none-eabihf/debug/stm32f3disc-quickstart

examples RTIC

examples/rtic is a project to demonstrate RTIC, it includes a task to rotate the LEDs and tasks to transmit "Hello World" and echo characters. To run, change to examples/rtic and run cargo enbed.

Dependencies

To build embedded programs using this template you'll need:

  • Rust 1.31, 1.30-beta, nightly-2018-09-13 or a newer toolchain. e.g. rustup default beta

  • The cargo generate subcommand. Installation instructions.

  • rust-std components (pre-compiled core crate) for the ARM Cortex-M targets. Run:

$ rustup target add thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabi thumbv7em-none-eabihf

Using this template

You can find this information in the data sheet or the reference manual of your device.

In this example we'll be using the STM32F3DISCOVERY. This board contains an STM32F303VCT6 microcontroller. This microcontroller has:

  • A Cortex-M4F core that includes a single precision FPU

  • 256 KiB of Flash located at address 0x0800_0000.

  • 40 KiB of RAM located at address 0x2000_0000. (There's another RAM region but for simplicity we'll ignore it).

  1. Instantiate the template.
$ cargo generate --git https://github.com/rust-embedded/cortex-m-stm32f3disc-quickstart
 Project Name: app
 Creating project called `app`...
 Done! New project created /tmp/app

$ cd app
$ cargo build

VS Code

This template includes launch configurations for debugging CortexM programs with Visual Studio Code located in the .vscode/ directory.
See .vscode/README.md for more information.
If you're not using VS Code, you can safely delete the directory from the generated project.

License

This template is 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.

Code of Conduct

Contribution to this crate is organized under the terms of the Rust Code of Conduct, the maintainer of this crate, the Cortex-M team, promises to intervene to uphold that code of conduct.

About

Template to develop bare metal applications for stm32f3-discovery eval boards

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published