probe-rs / flash-algorithm-template

A template for writing CMSIS-Pack flash algorithms in Rust
Apache License 2.0
10 stars 7 forks source link

Does it still need nightly Rust? #8

Closed elfmimi closed 1 year ago

elfmimi commented 1 year ago

Is this true? I think I'm building with a stable version of Rust and it seems to be going all alright. https://github.com/probe-rs/flash-algorithm-template/blob/8ee461aa1a977c9b3c34135fb202c0332ffe992b/README.md?plain=1#L40

Yatekii commented 1 year ago

Hmm I remember vaguely that it was required but if it works without nightly, I am good to remove the comment :) I think there was something about nighly traits/async?

elfmimi commented 1 year ago

looking around, I found this. https://github.com/probe-rs/flash-algorithm-template/blob/8ee461aa1a977c9b3c34135fb202c0332ffe992b/.cargo/config.toml#L9-L12

I guess that the fact that it is commented out means that there was an intention to switch from nightly to stable at some point in the past.

elfmimi commented 1 year ago

Probably this is the reason. https://github.com/probe-rs/flash-algorithm/blob/dcf3f7195cdfe7b8dd90ed6bf5d72e7e655cfbf0/src/lib.rs#L15-L22

#[cfg(all(not(test), feature = "panic-handler"))]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
    unsafe {
        core::arch::asm!("udf #0");
        core::hint::unreachable_unchecked();
    }
}

Inline assembly (asm!) has been stabilized at Rust 1.59 , Feb. 2022 .

edited: noticed that both creates are way younger than that.

Tiwalun commented 1 year ago

looking around, I found this.

https://github.com/probe-rs/flash-algorithm-template/blob/8ee461aa1a977c9b3c34135fb202c0332ffe992b/.cargo/config.toml#L9-L12

I guess that the fact that it is commented out means that there was an intention to switch from nightly to stable at some point in the past.

I think this was the reason, in the initial commit this was not commented out, so it actually required nightly.

elfmimi commented 1 year ago

It's an awfully trivial change but I created a PR anyway.