Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • rtic6
2 results

rtic_f4xx_nucleo

  • Clone with SSH
  • Clone with HTTPS
  • Forked from Per Lindgren / rtic_f4xx_nucleo
    4 commits ahead of the upstream repository.
    user avatar
    Blinningjr authored
    1941bf50
    History

    RTIC on the STM32F4xx Nucleo board

    Rust

    We assume Rust to be installed using rustup.

    Additionally you need to install the thumbv7em-none-eabi target.

    > rustup target add thumbv7em-none-eabi 

    You also need cargo-binutils.

    For RTT tracing

    We assume the following tools are in place:

    For low level gdb based debugging

    Linux tooling:

    • openocd
    • arm-none-eabi-gdb, or
    • gdb-multiarch

    Editor

    You may use any editor of choice. vscode supports Rust using the rust-analyzer plugin.


    Exercises

    • src/main.rs

      Developing embedded applications in Rust is made simle by the RTIC framework. In this exercise you will familiarize yourself with the basics init and idle, and see how you can trace the output to a terminal using cargo-run.

      You will also learn about panics and how they can be traced.

    • examples/rtt_timing.rs

      Here you will learn about cycle accurate timing measurements:

      • Using instrumentation code (which introduces bloat and overhead).

      • Non intrusive measurements using the on-chip debug unit and gdb.

      • Code generation optimization.

      • Code inspection, objdump, debugging and interactive disassemble.

      • Code trimming, RTIC is "A Zero-Cost Abstraction for Memory Safe Concurrency".

    • examples/timing_task.rs

      Here you learn about the Nested Vector Interrupt Controller (NVIC):

      • Tasks are bound to interrupt vectors.

      • Tasks can be pended either by code or by the environment (e.g. on arrival of serial data).

      • The bkpt can be inserted in the code to trigger a breakpoint (useful to timing measurements).

      • RTIC has zero-cost task dispatch overhead (well 2-clock cycles but will be fixed to zero).

    • examples/timing_resource.rs

      Here you will learn about resource handling in RTIC:

      • Implementation of critical sections through priority masking (NVIC-BASEPRI).

      • Direct access to non-preemptable resources.

      • Comparison to threaded counterpart.