Missing semihosting printouts after upgrade from v0.3.3 to v0.5.0
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- rust
- Ambito
- embedded-iot
Direzione di ricerca
Inizia con examples/binds.rs e con l’aggiornamento a cortex-m-semihosting v0.5.0 descritto in PR#680. Riproduci la build di release con cargo run per il target thumbv7m-none-eabi sotto QEMU, quindi confronta gli objdumps usando il comando nel report. Il lavoro è completato quando viene ricevuto il secondo output previsto prima che QEMU termini, senza fare affidamento sullo spostamento di debug::exit all’interno del ciclo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
In cortex-m-rtic CI cortex-m-semihosting is used for printouts and QEMU control.
As part of this PR#680 semihosting got bumped to latest v0.5.0, and after adopting code to match the removed error handling, CI still failed with the following:
👟 cargo run --example binds --target thumbv7m-none-eabi --features test-critical-section --release
Compiling cortex-m-rtic v1.1.3 (/home/henrik/dev/rust/rtic/cortex-m-rtic)
Finished release [optimized] target(s) in 0.17s
Running `qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel target/thumbv7m-none-eabi/release/examples/binds`
Timer with period zero, disabling
init
foo called 1 time
idle
Error: Differing output in files.
Expected:
init
foo called 1 time
idle
foo called 2 times
Got:
init
foo called 1 time
idle
which given that the idle task in examples/binds.rs consists of:
#[idle]
fn idle(_: idle::Context) -> ! {
hprintln!("idle");
rtic::pend(Interrupt::UART0);
debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
loop {
cortex_m::asm::nop();
}
}
suggests that the rtic::pend(...) in the idle task did not get to run.
Modifying the code by placing the debug::exit(...) after the NOP inside the loop,
then all expected printouts gets received by the host.
Which modifies the hypothesis to "printout did not reach host before QEMU exited"
See this commit for the "fix" to the CI failures: 9764121c
Focusing on the binds example, this is an objdump diff together with the diff, however, not built with --release:

Another more complete picture, all built with release, the splits starting from the left:
- cortex-m-semihosting v0.3.3 idle task
- v0.5 without the "fix" idle task
- v0.5 with the "fix" idle task

Generating the objdumps with
cargo objdump --example binds --target thumbv7m-none-eabi --release -- -d --no-show-raw-insn --print-imm-hex
Curious to hear if this is something seen before, or if a possible fix would be to always throw in a NOP as part of the syscall when debug::exit-iting.
All tests were run with latest stable rustc 1.66.1 (90743e729 2023-01-10)
I have not tried different versions of QEMU, but it could be something on that end too...
- Lingua principale
- Rust
- Stelle
- 1k
- Fork
- 201
- Merge medio
- 1h 8m
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-embedded/cortex-m
-
Deprecation of `bare-metal`Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
rust-embedded/cortex-m#651 · 5 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
rust-embedded/cortex-m#637 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
rust-embedded/cortex-m#511 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rust-embedded/cortex-m#695 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
rust-embedded/cortex-m#694 · 1 commento ·
Tutte le issue di rust-embedded/cortex-m
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
swc-project/swc#12516 ·
I maintainer di solito rispondono entro 1 giorno
-
app bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
mls-rs-crypto-awslc: exact aws-lc-rs =1.16.3 pin blocks rustls security updateForse già presa @muscariello l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
[work-item] adam-adae-worsening-emergence: conform spec.yaml to the specification style contract (REQ-1280)Forse già presa @muse-yamaa-bot l’ha presa oggi. Apertawork-item
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno