Closed tasosxak closed 5 years ago
+1 Getting the same issue.
So I seem to have gotten this working, the problem appears to be this line
pub use alloc::arc::{Arc, Weak};
in the latest versions of rust this has to be
pub use alloc::sync::{Arc, Weak};
replace that and its going to work (or at least it did for me)
Small update: In fact this issue has already been addressed in https://github.com/hashmismatch/freertos.rs/pull/19 (in fact this is the only issue the PR is addressing as of now) so if the maintainer would merge this (and the travis ci tests would magically pass) this issue would be resolved.
But it seems like the changes in #19 was already fixed in f056dcbb357597aa7c8f603b8b7e57c3f7e02a4c
Guess thats why its not passing and not being merged?
@rudib When can we expect to see a new release with the 12 latest commits since 0.2.0?
@hargoniX Do you have a small minimal example on a repository that compiles and runs with freertos_rs?
I can get mine to compile, but the linking process results in a zero sized binary no matter what i try, as soon as i am using xargo (or any other custom sysroot in cargo).
#![no_std]
extern crate freertos_rs;
use freertos_rs::*;
use prelude::v1::*;
#[no_mangle]
#[entry]
pub extern fn main_entry() {
let mut s = Serial::new();
s.tx_string("Hello from Rust!\n");
loop {
let data = s.rx_i32();
s.tx_string("Received: ");
s.tx_i32(data);
s.tx_string("\n");
}
}
error[E0601]: `main` function not found in crate `frtos`
|
= note: consider adding a `main` function to `src/main.rs`
error: `#[panic_handler]` function required, but not found
error: `#[alloc_error_handler]` function required, but not found
error: aborting due to 6 previous errors
@smilykoch I actually just modified the local version of freertos_rs with that small changed, then compiled it and started wondering how this would actually be useful to me (Im developing a HAL for the stm32h7x3 series at the moment) without HAL (yes I never used RTOS before so I didnt really have an idea what i was doing there) so I didnt perform any further work on it.
Long story short I actually have no idea how to use this project and just stumbled upon the fix during a bit of research.
As you've guys probably noticed, this project has found itself at a bit of an impasse. xargo
was deprecated and left unusable with the latest Rust nightly, rendering the current build approach with this library's test suite outdated. I've tried reworking the build to accommodate the new approach using the core
and alloc
downloaded using rustup
, but wasn't able to produce binaries that would pass the test suite (allocation and stack issues with tasks, difficult to debug). Since I'm not actively using this library right now and free time is quite sparse, I plan to pick this up once the alloc
crate is stabilized. There's simply too much work in keeping up with the nightly
Rust changes.
Released and published 0.3.0
which downgrades the required compiler version to beta
, soon to be stable
!
main.rs
Rust version:
.cargo/config