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

Conversation

jdharuman
Copy link

@jdharuman jdharuman commented Feb 23, 2025

Overview

Why do we need this change?
The FreeRTOS Rust Linux machine setup instructions in the README were outdated or unclear. Updating them ensures accurate and up-to-date guidance for setting up and running the project.

What has changed?

  • Updated the README with revised FreeRTOS Rust Linux machine setup instructions.
  • Included additional details and clarifications where necessary.
  • Changed the signature of set_on_assert() from taking a mutable reference (&mut self) to an immutable reference (&self)
11 |     unsafe {
   |     ^^^^^^ unnecessary `unsafe` block
   |
   = note: `#[warn(unused_unsafe)]` on by default

error[E0596]: cannot borrow immutable static item `FREERTOS_HOOKS` as mutable
  --> freertos-rust-examples/examples/linux/main.rs:12:9
   |
12 |         FREERTOS_HOOKS.set_on_assert(|| { println!("Assert hook called") });
   |         ^^^^^^^^^^^^^^ cannot borrow as mutable

For more information about this error, try `rustc --explain E0596`.
warning: `freertos-rust-examples` (example "linux") generated 1 warning

image

  • Ensured that the callback functionality remains intact, with the hook being callable through the do_on_assert() method when an assertion occurs.

Testing

  • Linux
    Linux console output:
~/git/FreeRTOS-rust user/jdharum..p-doc-update !1 > cargo run --example linux                                                         py platform

warning: freertos-rust-examples@0.1.1: /home/jayachandran/git/FreeRTOS-rust/freertos-rust/src/freertos/shim.c: In function 'freertos_rs_isr_yield':
warning: freertos-rust-examples@0.1.1: /home/jayachandran/git/FreeRTOS-rust/freertos-rust/src/freertos/shim.c:282:9: warning: implicit declaration of function 'portYIELD_FROM_ISR' [-Wimplicit-function-declaration]
warning: freertos-rust-examples@0.1.1:   282 |         portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
warning: freertos-rust-examples@0.1.1:       |         ^~~~~~~~~~~~~~~~~~
   Compiling freertos-rust-examples v0.1.1 (/home/jayachandran/git/FreeRTOS-rust/freertos-rust-examples)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.09s
     Running `target/debug/examples/linux`
Boxed int '15' (allocator test)
Starting FreeRTOS app ...
Task registered
Starting scheduler
Timer Resolution for Run TimeStats is 100 ticks per second.
Hello from Task! 0
Hello from Task! 1
Hello from Task! 2
Hello from Task! 3
Hello from Task! 4
Hello from Task! 5
Hello from Task! 6
^C

@jdharuman
Copy link
Author

@niondir @apullin @CaseySanchez @reitermarkus Could you please review the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant