Open
Description
Upon first flash of a brand new board, you get this error, related to #127 :
Running probe-rs run --chip nrf5340_xxAA ../../build/bin/nrf5340dk/hello-world/cargo/thumbv8m.main-none-eabi/release/hello-world
WARN probe_rs::config::sequences::nrf: Core 0 is locked. Erase procedure will be started to unlock it.
Error: Connecting to the chip was unsuccessful.
Caused by:
0: An ARM specific error occurred.
1: An operation could not be performed because it lacked the permission to do so: erase_all
Running with the target flash-erase-all as specified in #128 fixes it but you still get a bunch of warnings (see below). What's to do about this?
warning: use of inline assembly is unsafe and requires unsafe block (error E0133)
--> src/riot-rs-threads/src/arch/cortex_m.rs:82:5
|
82 | / asm!(
83 | | "
84 | | movw LR, #0xFFFd
85 | | movt LR, #0xFFFF
... |
88 | | options(noreturn)
89 | | );
| |_____^ use of inline assembly
|
= note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668>
= note: inline assembly is entirely unchecked and can cause undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
--> src/riot-rs-threads/src/arch/cortex_m.rs:81:1
|
81 | unsafe extern "C" fn SVCall() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: requested on the command line with `-W unsafe-op-in-unsafe-fn`
warning: use of inline assembly is unsafe and requires unsafe block (error E0133)
--> src/riot-rs-threads/src/arch/cortex_m.rs:122:5
|
122 | / asm!(
123 | | "
124 | | mrs r0, psp
125 | | cpsid i
... |
145 | | options(noreturn)
146 | | );
| |_____^ use of inline assembly
|
= note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668>
= note: inline assembly is entirely unchecked and can cause undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
--> src/riot-rs-threads/src/arch/cortex_m.rs:121:1
|
121 | unsafe extern "C" fn PendSV() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: call to unsafe function `critical_section::CriticalSection::<'cs>::new` is unsafe and requires unsafe block (error E0133)
--> src/riot-rs-threads/src/arch/cortex_m.rs:220:14
|
220 | let cs = CriticalSection::new();
| ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
= note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668>
= note: consult the function's documentation for information on how to avoid undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
--> src/riot-rs-threads/src/arch/cortex_m.rs:219:1
|
219 | unsafe fn sched(old_sp: usize) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
--> src/riot-rs-threads/src/arch/cortex_m.rs:225:34
|
225 | if let Some(pid) = (&*THREADS.as_ptr(cs)).runqueue.get_next() {
| ^^^^^^^^^^^^^^^^^^^ dereference of raw pointer
|
= note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668>
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
warning: call to unsafe function `cortex_m::interrupt::enable` is unsafe and requires unsafe block (error E0133)
--> src/riot-rs-threads/src/arch/cortex_m.rs:232:9
|
232 | cortex_m::interrupt::enable();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
= note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668>
= note: consult the function's documentation for information on how to avoid undefined behavior
warning: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
--> src/riot-rs-threads/src/arch/cortex_m.rs:238:24
|
238 | let threads = &mut *THREADS.as_ptr(cs);
| ^^^^^^^^^^^^^^^^^^^ dereference of raw pointer
|
= note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668>
= note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
warning: use of inline assembly is unsafe and requires unsafe block (error E0133)
--> src/riot-rs-threads/src/arch/cortex_m.rs:265:5
|
265 | asm!("", in("r1") current_high_regs, in("r2") next_high_regs);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of inline assembly
|
= note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668>
= note: inline assembly is entirely unchecked and can cause undefined behavior
warning: call to unsafe function `critical_section::CriticalSection::<'cs>::new` is unsafe and requires unsafe block (error E0133)
--> src/riot-rs-threads/src/lib.rs:178:14
|
178 | let cs = CriticalSection::new();
| ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
= note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668>
= note: consult the function's documentation for information on how to avoid undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
--> src/riot-rs-threads/src/lib.rs:176:1
|
176 | pub unsafe fn start_threading() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: `riot-rs-threads` (lib) generated 8 warnings (run `cargo fix --lib -p riot-rs-threads` to apply 4 suggestions)
Finished `release` profile [optimized + debuginfo] target(s) in 0.50s
Running `probe-rs run --chip nrf5340_xxAA ../../build/bin/nrf5340dk/hello-world/cargo/thumbv8m.main-none-eabi/release/hello-world`
WARN probe_rs::architecture::arm::core::armv8m: The core is in locked up status as a result of an unrecoverable exception
WARN probe_rs::architecture::arm::core::armv8m: The core is in locked up status as a result of an unrecoverable exception
Erasing ✔ [00:00:00] [############################################################################################################################################] 8.00 KiB/8.00 KiB @ 29.56 KiB/s (eta 0s )
Programming ✔ [00:00:00] [############################################################################################################################################] 8.00 KiB/8.00 KiB @ 24.12 KiB/s (eta 0s ) Finished in 0.681s
riot_rs_rt::startup()
nrf5340dk::init()
nrf5340::init()
riot-rs-embassy::init()
riot-rs-embassy::init_task()
riot-rs-embassy::init_task() done
Hello from main()! Running on a nrf5340dk board.
WARN probe_rs::session: Could not clear all hardware breakpoints: An ARM specific error occurred.
Caused by:
Timeout occurred during operation.