Closed Admsher closed 3 months ago
It looks like the critical-section implementation in cortex-m
isn't getting linked in properly. Is your program pretty minimal, i.e. does it only log something and not do much anything else?
You could try adding this in your program, it's been a while so I'm not entirely sure anymore but this might be enough to convince the compiler to link it in:
use cortex_m as _;
Yes you are right about the fact that the code is minimal just for logging function, i already have the line that you suggest and I also tried cargo clean as well, is there a problem with small code for rtt that I am unaware of?
It's not a problem "with small code", it's a problem with the critical-section implementation in cortex-m
not being enabled properly or being dropped by the compiler. I can't immediately say why though - would you be able to publish the code as a repo?
It's the code I used in from the probe-rs tutorial to print hello world, as I said nothing complex , you can find it here: https://probe.rs/docs/tools/cargo-embed/
What I'm specifically looking for is all your config files such as .cargo/config.toml
and such which you likely have modified yourself.
HI sorry for the delay, here i s the config.toml file
[build]
target="thumbv7em-none-eabihf"
rustflags=[ "-C","link-arg=-Tlink.x",]
I tried reproducing the problem and adding use cortex_m as _;
fixed it. Please share the entirety of your code as a repository because otherwise I can only guess.
You are mp right as i was suggested to fo the same on the rust forum as well , here is my code.
#![no_main]
#![no_std]
use panic_halt as _;
use cortex_m_rt::entry;
use cortex_m_semihosting::{debug, hprintln};
use MXP1064 as _;
use rtt_target::{rprintln, rtt_init_print};
#[cortex_m_rt::entry]
fn main() -> ! {
rtt_init_print!();
loop {
rprintln!("Hello, world!");
}
}
But that code does not have the line use cortex_m as _;
...
You are right , i might have missed it as it was not added in the tutorial page ,I will do this and see if anything changes. Sorry for the overlook
But I told you two times to add it right here!
But I told you two times to add it right here!
Yep sorry for that I actually don't have access to my laptop where the code is i will close the issue as soon as I test it
Adding th euse cortexm as ; helped thanks a lot :)
I am not sure how to describe the problem but i get this erro wheneve ri try to use rtt_target for printing statements:
this is my Cargo.toml
any help is appreciated