Missing semihosting printouts after upgrade from v0.3.3 to v0.5.0
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- rust
- 领域
- embedded-iot
调研方向
从 examples/binds.rs 以及 PR#680 中描述的 cortex-m-semihosting v0.5.0 升级开始。然后在 QEMU 下使用 cargo run 为 thumbv7m-none-eabi 目标复现 release 构建,并使用报告中的命令比较 objdumps。完成的标准是在 QEMU 退出前收到预期的第二次输出,且不依赖于将 debug::exit 移入循环中。
由索引模型根据 Issue 内容生成。
描述
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...
- 主要语言
- Rust
- 星标
- 1k
- 派生
- 201
- 平均合并
- 5 小时 8 分钟
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rust-embedded/cortex-m 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 69/100
rust-embedded/cortex-m#702 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
rust-embedded/cortex-m#651 · 5 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
rust-embedded/cortex-m#637 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 76/100
rust-embedded/cortex-m#511 · 2 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 55/100
rust-embedded/cortex-m#700 · 1 条评论 ·
查看 rust-embedded/cortex-m 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 67/100
rust-bitcoin/rust-bitcoin#7089 · 1 条评论 · 1 个 reaction ·
维护者通常 2 天内回复
-
area/tools bug session-analysis
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
[Bug]: Python OpenTelemetrySectionConfig has no file_sinks可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
NVIDIA/NeMo-Relay#1514 ·
维护者通常 1 天内回复
-
prompting proposal tool triaged
难度 2/5 1-3 小时 新手友好度 78/100
can1357/oh-my-pi#17041 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 84/100
nix-community/fenix#262 ·