Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated FreeRTOS-Rust Linux setup instruction information in README doc #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions freertos-rust-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Setup

We need to use nightly toolchain to support all examples.
We need to use nightly toolchain to support all examples.
Even if some might run with the stable toolchain as well.

**GNU Toolchain** is required for debugging some examples (e.g. windows):
Expand Down Expand Up @@ -46,7 +46,7 @@ To see all errors use:

### Run Windows Demo

You need to build with nightly GNU to allow debugging.
You need to build with nightly GNU to allow debugging.
The target must be `x86_64-pc-windows-msvc` for the FreeRTOS `MSVC-MingW` port.

Prepare the build with:
Expand All @@ -60,14 +60,22 @@ Run the build

### Run Linux Demo


Prepare the build with:

rustup default x86_64-unknown-linux-gnu
rustup default nightly
rustup toolchain install nightly
rustup target add x86_64-unknown-linux-gnu

rustup component add llvm-tools-preview
cargo install cargo-binutils

sudo apt install gcc g++ make

Run the build

cargo build --package freertos-rust-examples --example linux --target x86_64-unknown-linux-gnu

Run the example

cargo run --package freertos-rust-examples --example linux --target x86_64-unknown-linux-gnu

### Run STM32 Cortex-M3 Demo
Expand Down Expand Up @@ -126,21 +134,21 @@ Create the Toolchain under: `File | Settings | Build, Execution, Deployment | To
* Name: `arm-none-eabi`
* Debugger: `/path/to/arm-none-eabi-gdb.exe`

Build:
Build:

* Name: `build-nrf9160-example`
* Programm: `cargo`
* Arguments: `build --package freertos-rust-examples --example nrf9160 --target thumbv8m.main-none-eabihf`
* Working directory: `$ProjectFileDir$`

Clean:
Clean:

* Name: `clean`
* Programm: `cargo`
* Arguments: `clean`
* Working directory: `$ProjectFileDir$`

Setup a Run Configuration:
Setup a Run Configuration:

* Executable: `target\thumbv8m.main-none-eabihf\debug\examples\nrf9160` (only selectable after first build!)
* Download executable: `Always`
Expand Down
4 changes: 2 additions & 2 deletions freertos-rust/src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ pub struct FreeRtosHooks {
}

impl FreeRtosHooks {
pub fn set_on_assert(&mut self, c: Callback) -> Result<(), Callback> {
pub fn set_on_assert(&self, c: Callback) -> Result<(), Callback> {
self.on_assert.set(c)
}

fn do_on_assert(&self) {
pub fn do_on_assert(&self) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be pub? I think the idea was that do_on_assert should only be called here by the assert handler so it shouldn't need to be pub.

if let Some (cb) = self.on_assert.get() {
cb()
}
Expand Down