[SOLVED] Rust missing sources

  • I'm trying out Rust with Ozone v3.38 on Windows 10 and STM32F103C8

    Download works fine, but straight after

    Code
    #[entry]
    fn main() -> ! {

    It complains about

    Code
    File not found:
    /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/intrinsics/mod.rs
    Please use the source files window to locate the file manually

    Also when stepping into
    panic!("msg") gives

    Code
    File not found:
    
    
    /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/fmt/mod.rs
    
    
    Please use the source files window to locate the file manually


    but it does find/steps correctly into other library sources at
    .cargo/registry/src/index.crates.io-hash/panic-rtt-target/src/lib.rs

    So it seems partially broken/working, maybe not working for core libs?

  • Hi balance3164,
    Per default `rustup` will install libraries only in pre-built form. I assume that this is why you see only a part of the sources. So you need to make available the sources for the libs as well.
    For that you may try the following command:`rustup component add rust-src`
    With the following command you may find the path of your rust toolchain:`rustc --print sysroot`
    There under `\lib\rustlib\src\rust` you may be able to find the source then.
    To reference the sources to your Ozone debug project you can simply use the `Project.AddPathSubstitute()` command.
    Please note that we do not support the rust build tool chain. It might well be that the commands above do not work for you.
    Best regards
    -- AlexD

    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

  • That works, thank you!


    I see variables with zero len, e.g. dp

    Code
    // Get access to the device specific peripherals from the peripheral access crate
        let dp = pac::Peripherals::take().unwrap();

    is that normal? I'm still learning Rust.


    There would be nice to see some tutorial, or better a blinking LED from start to finish with Ozone debugging as a blog post,
    since you already invested the time to add Rust support.

    In Ozone Manual there is one line mentioning that Rust was added and nothing more.

  • Hi balance3164,
    good to hear you are up and running again.
    Concerning your 2nd inquiry: Ozone does not (yet) support the full scale of Rust features. What would be the type of `dp`?
    Best regards
    -- AlexD

    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!