Skip to content

Update qemu.md project-creation section to reference app-template - #418

Open
mehmethekim wants to merge 1 commit into
rust-embedded:masterfrom
mehmethekim:fix/qemu-app-template-refs
Open

Update qemu.md project-creation section to reference app-template#418
mehmethekim wants to merge 1 commit into
rust-embedded:masterfrom
mehmethekim:fix/qemu-app-template-refs

Conversation

@mehmethekim

Copy link
Copy Markdown

cortex-m-quickstart was deprecated and emptied by its author (see #396).
The repo's git history was wiped down to a README pointing users at
app-template instead.

#403 already updated the "Running" section of this chapter to use
app-template's defmt/qemu-run workflow, and the cargo-generate
command in "Creating a non standard Rust program" already pointed at
app-template. But the surrounding prose and the two alternative
install methods were never updated:

  • The intro paragraph still said "We'll use the cortex-m-quickstart
    project template..." and referred to an examples directory (app-template
    uses src/bin).
  • "Using git" cloned rust-embedded/cortex-m-quickstart, which now
    contains only a README.
  • "Using neither" downloaded a zip snapshot of the same now-emptied repo.

This is a partial fix for #396.

cortex-m-quickstart was deprecated and emptied by its author (see rust-embedded#396).
The cargo-generate command in this section already pointed at app-template,
but the surrounding prose and the git-clone/zip-download alternatives still
referenced the now-archived cortex-m-quickstart repo, whose git history was
wiped down to a README.
@mehmethekim
mehmethekim requested a review from a team as a code owner August 17, 2026 10:54
@mehmethekim
mehmethekim force-pushed the fix/qemu-app-template-refs branch from f31d86a to 1d5df48 Compare August 17, 2026 11:19
webbgamers added a commit to webbgamers/book that referenced this pull request Sep 1, 2026
The `cargo-generate` command in this chapter switched to knurling's
`app-template` (and rust-embedded#418 updates the surrounding project-creation prose to
match), but everything downstream of project creation still describes
`cortex-m-quickstart` and the pre-`defmt` `hprintln!` workflow. Following the
chapter as written does not currently produce a running program.

Program Overview: show `src/bin/hello.rs` rather than a `src/main.rs` that the
template does not have, and explain `use app as _;` instead of `panic_halt`.

Cross compiling: the template defaults to `thumbv6m-none-eabi`, so add the
missing step of switching TODO(3) to `thumbv7m-none-eabi`. The listing shown
before was quickstart's, which had the Cortex-M3 target already selected.

Inspecting: the template builds no binary named after the project, so
`cargo readobj --bin app` fails; use `--bin hello`. Refresh the captured output
and document the `.defmt` and `.uninit` sections and flip-link's inverted RAM
layout, which is what readers will actually see.

Running: plain `qemu-system-arm` cannot decode `defmt`, as the chapter itself
says two paragraphs earlier, so it can't be the runner and doesn't print
"Hello, world!" -- it prints four bytes of binary frame. Set `qemu-run` as the
runner instead, under the cfg() table the template actually uses. Install
`qemu-run` from crates.io rather than cloning the `defmt` repo; the clone
snippet also used an SSH URL and a `../qemu-rs/` path that does not exist.
Fix `--example hello` to `--bin hello`.

Debugging: pass the GDB flags through `qemu-run` so the log output is still
decoded, correct the `examples/hello` paths, and replace the `hprintln!` /
`debug::exit` listing with the program the template ships. `cortex-m-rt` writes
Reset in assembly now, so GDB stops at a bare address with a misattributed
symbol rather than at `cortex-m-rt-0.6.1/src/lib.rs:473`.

install/tooling: add `flip-link`, which the template sets as its linker and
without which the build fails, and `qemu-run`. Neither was mentioned anywhere.

All commands and output were re-run against a fresh `app-template` project.

Semihosting, Panicking and Exceptions still print with `hprintln!`, and
`qemu-run` swallows that plain text silently rather than erroring, so the
chapter now tells readers to switch the runner back to plain `qemu-system-arm`
before those chapters. Migrating them to `defmt` would remove the caveat and is
probably worth doing, but is left out of this change.
webbgamers added a commit to webbgamers/book that referenced this pull request Sep 1, 2026
The `cargo-generate` command in this chapter switched to knurling's
`app-template` (and rust-embedded#418 updates the surrounding project-creation prose to
match), but everything downstream of project creation still describes
`cortex-m-quickstart` and the pre-`defmt` `hprintln!` workflow. Following the
chapter as written does not currently produce a running program.

Program Overview: show `src/bin/hello.rs` rather than a `src/main.rs` that the
template does not have, and explain `use app as _;` instead of `panic_halt`.

Cross compiling: the template defaults to `thumbv6m-none-eabi`, so add the
missing step of switching TODO(3) to `thumbv7m-none-eabi`. The listing shown
before was quickstart's, which had the Cortex-M3 target already selected.

Inspecting: the template builds no binary named after the project, so
`cargo readobj --bin app` fails; use `--bin hello`. Refresh the captured output
and document the `.defmt` and `.uninit` sections and flip-link's inverted RAM
layout, which is what readers will actually see.

Running: plain `qemu-system-arm` cannot decode `defmt`, as the chapter itself
says two paragraphs earlier, so it can't be the runner and doesn't print
"Hello, world!" -- it prints four bytes of binary frame. Set `qemu-run` as the
runner instead, under the cfg() table the template actually uses. Install
`qemu-run` from crates.io rather than cloning the `defmt` repo; the clone
snippet also used an SSH URL and a `../qemu-rs/` path that does not exist.
Fix `--example hello` to `--bin hello`.

Debugging: pass the GDB flags through `qemu-run` so the log output is still
decoded, correct the `examples/hello` paths, and replace the `hprintln!` /
`debug::exit` listing with the program the template ships. `cortex-m-rt` writes
Reset in assembly now, so GDB stops at a bare address with a misattributed
symbol rather than at `cortex-m-rt-0.6.1/src/lib.rs:473`.

install/tooling: add `flip-link`, which the template sets as its linker and
without which the build fails, and `qemu-run`. Neither was mentioned anywhere.

All commands and output were re-run against a fresh `app-template` project.

Semihosting, Panicking and Exceptions still print with `hprintln!`, and
`qemu-run` swallows that plain text silently rather than erroring, so the
chapter now tells readers to switch the runner back to plain `qemu-system-arm`
before those chapters. Migrating them to `defmt` would remove the caveat and is
probably worth doing, but is left out of this change.

The `entry` link also now points at `cortex-m-rt`'s re-export rather than the
`cortex-m-rt-macros` page, which carries no documentation of its own.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant