-
Notifications
You must be signed in to change notification settings - Fork 17
Getting started
In order to contribute to most the repositories in this project, you
will need a Text Editor of your choice --- which we assume to be
installed already ---, git
, a rust toolchain, and an RT685
EVK
board.
The easiest way to install rust is through the rustup
toolchain
installer. Please visit the official rustup.rs
website and follow the on-screen instructions to get it installed on
your OS of choice.
This will install:
-
rustc
: the rust compiler -
cargo
: build system and package manager -
rust-analyzer
: language server protocol implementation -
clippy
: static analyzer -
rustfmt
: code formatter
Most likely git
is available from the various package systems of
different operating systems, here are a few possibilities:
$ winget install -i Git.Git
$ brew install git
$ sudo apt install git
$ sudo pacman -Sy git
$ sudo emerge --ask dev-vcs/git
$ sudo dnf install git-all
Most of the examples here rely on flip-link
as a linker wrapper. The
goal of flip-link
is the add zero-cost stack overflow protection by
flipping the order in which the binary is crated. Traditionally, the
stack is placed at the top of RAM, growing in the direction of .bss
section (placed at the bottom of RAM) as shown in the figure below:
With flip-link
this order is reversed, with .bss
placed at the top
of RAM and the stack following it, as shown below.
We can install flip-link
with a simple cargo
command:
$ cargo install flip-link
We use probe-rs
for flashing and debugging binaries on the target
MCU. Currently, we need to use the latest HEAD
from probe-rs
repository.
We can install it with the following cargo
command:
$ cargo install probe-rs-tools --git https://github.com/probe-rs/probe-rs --locked --force
The main Embassy HAL repository is located
here. You can use
git
to grab a copy for your local development:
$ git clone https://github.com/pop-project/embassy-imxrt.git
Once it's cloned, make sure to read our Programming RT685EVK guide for details of how to setup the board either with the embedded LINK2 probe or an external JLink.
Once that's done, you should be able to run e.g. the gpio-blinky
example which will blink the blue LED on the EVK:
$ cd embassy-imxrt/examples/rt685s-evk
$ cargo run --bin gpio-blinky
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.21s
Running `probe-rs run --chip MIMXRT685SFVKB target\thumbv8m.main-none-eabihf\debug\gpio-blinky`
Erasing ✔ 100% [####################] 72.00 KiB @ 49.86 KiB/s (took 1s)
Programming ✔ 100% [####################] 69.00 KiB @ 9.80 KiB/s (took 7s)
Finished in 7.09s
60728.340000 TRACE SysOsc was already enabled
└─ embassy_imxrt::clocks::{impl#27}::enable_and_reset @ D:\workspace\pop-project\embassy-imxrt\src\clocks.rs:1241
60728.350000 INFO Toggling LED
└─ gpio_blinky::____embassy_main_task::{async_fn#0} @ src\bin\gpio-blinky.rs:27
60729.350000 INFO Toggling LED
└─ gpio_blinky::____embassy_main_task::{async_fn#0} @ src\bin\gpio-blinky.rs:27
60730.350000 INFO Toggling LED
└─ gpio_blinky::____embassy_main_task::{async_fn#0} @ src\bin\gpio-blinky.rs:27
60731.350000 INFO Toggling LED
└─ gpio_blinky::____embassy_main_task::{async_fn#0} @ src\bin\gpio-blinky.rs:27
60732.350000 INFO Toggling LED
└─ gpio_blinky::____embassy_main_task::{async_fn#0} @ src\bin\gpio-blinky.rs:27
60733.350000 INFO Toggling LED
└─ gpio_blinky::____embassy_main_task::{async_fn#0} @ src\bin\gpio-blinky.rs:27
60734.350000 INFO Toggling LED
└─ gpio_blinky::____embassy_main_task::{async_fn#0} @ src\bin\gpio-blinky.rs:27
60735.350000 INFO Toggling LED
└─ gpio_blinky::____embassy_main_task::{async_fn#0} @ src\bin\gpio-blinky.rs:27
A few important Wiki pages to reada;
Connect probe to host pc
Run c:\program files\segger\jlink[version]\jlinkconfig.exe
Change driver mode of probe to Winusb
Install Zadig - USB driver installation made easy (akeo.ie)
Change Jlink driver from Jlink to winusb
Close any active debug session
Run:
c:\program files\segger\jlink[version]\Jlink.exe -device MIMXRT685S_M33 -if SWD -Speed 4000
connect
Q or ctrl+c to close jlink.exe
Then try debugging again