Add STM32F407 Renode blink Rust firmware and Jumpstarter example#574
Add STM32F407 Renode blink Rust firmware and Jumpstarter example#574
Conversation
Create the embedded Rust project (USART2 ON/OFF lines, PD12 LED) with stm32f4xx-hal, plus README, linker script, and rust-toolchain for thumbv7em-none-eabihf. Include Cargo.lock and a prebuilt ELF for flashing. Made-with: Cursor
📝 WalkthroughWalkthroughThis PR adds a complete STM32F407 Rust bare-metal firmware example for Renode simulation, including build configuration, toolchain setup, linker scripts, device initialization code, and comprehensive documentation for the jumpstarter-driver-renode package. Changes
Suggested reviewers
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
python/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/README.md (3)
21-29: Consider adding a build verification step.The instructions show how to build and copy the ELF, but don't mention how to verify the build succeeded. Adding a simple check could improve user experience.
💡 Suggested addition
After the build command, add a verification step:
The ELF is `target/thumbv7em-none-eabihf/release/stm32f407-rust-blink`. Verify it exists: ```bash ls -lh target/thumbv7em-none-eabihf/release/stm32f407-rust-blinkCopy it if you want a stable name for Jumpstarter:
</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@python/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/README.md
around lines 21 - 29, Add a post-build verification step to the README after the
cargo build command to confirm the ELF was produced and is non-empty; for
example, instruct users to check the artifact at
target/thumbv7em-none-eabihf/release/stm32f407-rust-blink (or use test -f/ls
-lh) before the cp step so the build in stm32f407-rust-blink/README.md reliably
reports success.</details> --- `72-75`: **Consider adding installation links.** The requirements list what's needed but don't guide users on how to install them. Adding links to installation documentation would improve the user experience, especially for first-time users. <details> <summary>📚 Suggested addition</summary> ```diff ## Requirements -- **Renode** installed and on `PATH` (the driver spawns it for power/simulation). -- Jumpstarter CLI (`jmp`) and the **Renode driver** available to the exporter. +- **Renode** installed and on `PATH` (the driver spawns it for power/simulation). [Download Renode](https://renode.io/) +- Jumpstarter CLI (`jmp`) and the **Renode driver** available to the exporter. See the [Jumpstarter documentation](../../README.md) for installation.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@python/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/README.md` around lines 72 - 75, Update the "Requirements" section in README.md to include installation links so users can install dependencies: add a link for Renode's installation/docs (e.g., Renode website or GitHub docs) next to "Renode installed and on PATH", add a link for the Jumpstarter CLI (`jmp`) installation or README next to "Jumpstarter CLI (`jmp`)", and add a link to the Renode driver installation or exporter integration docs next to "Renode driver available to the exporter"; keep the wording concise and user-focused so each requirement is followed by a short parenthetical or inline link to the appropriate installation or setup guide.
22-22: Consider removing or explaining the PATH modification.If
rustupis installed correctly,cargoshould already be onPATH. The explicitPATH="$HOME/.cargo/bin:$PATH"prepend may confuse users who havecargoinstalled elsewhere or via system packages.📝 Suggested alternatives
Option 1: Remove the PATH modification and rely on standard rustup installation:
-PATH="$HOME/.cargo/bin:$PATH" cargo build --release +cargo build --releaseOption 2: Add a note explaining when this is needed:
+# If cargo is not on PATH, prepend the default rustup location: PATH="$HOME/.cargo/bin:$PATH" cargo build --release🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@python/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/README.md` at line 22, The README currently prepends PATH with PATH="$HOME/.cargo/bin:$PATH" before running cargo build --release which can be unnecessary or misleading for users with cargo installed via rustup or system packages; remove the PATH modification and just use "cargo build --release", or if you keep it, add a brief note explaining it's only needed when Cargo is installed in $HOME/.cargo/bin (e.g., installed via rustup without adding to PATH) so readers know when to apply the PATH prepend.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@python/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/exporter-stm32f4.yaml`:
- Around line 7-9: Update the stale header comment that currently reads
"STM32F407 Discovery (opensomeip FreeRTOS/ThreadX)" to accurately describe this
file as the Rust blink example (e.g., "STM32F407 Discovery (Rust blink
example)"); remove or replace the "opensomeip FreeRTOS/ThreadX" text in the top
comment block while keeping other accurate details (like "Uses Renode's built-in
platform, USART2 for console output.") intact so the header reflects the actual
scenario.
In
`@python/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/README.md`:
- Line 59: Step 5 in the README.md currently instructs "press Ctrl+B three
times" to leave the console; update that line to instruct the correct
Renode/telnet escape sequence by telling users to press "Ctrl+]" once to enter
the telnet command mode and then type "quit" (or equivalent) to exit the
console, replacing the incorrect Ctrl+B instruction.
---
Nitpick comments:
In
`@python/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/README.md`:
- Around line 21-29: Add a post-build verification step to the README after the
cargo build command to confirm the ELF was produced and is non-empty; for
example, instruct users to check the artifact at
target/thumbv7em-none-eabihf/release/stm32f407-rust-blink (or use test -f/ls
-lh) before the cp step so the build in stm32f407-rust-blink/README.md reliably
reports success.
- Around line 72-75: Update the "Requirements" section in README.md to include
installation links so users can install dependencies: add a link for Renode's
installation/docs (e.g., Renode website or GitHub docs) next to "Renode
installed and on PATH", add a link for the Jumpstarter CLI (`jmp`) installation
or README next to "Jumpstarter CLI (`jmp`)", and add a link to the Renode driver
installation or exporter integration docs next to "Renode driver available to
the exporter"; keep the wording concise and user-focused so each requirement is
followed by a short parenthetical or inline link to the appropriate installation
or setup guide.
- Line 22: The README currently prepends PATH with PATH="$HOME/.cargo/bin:$PATH"
before running cargo build --release which can be unnecessary or misleading for
users with cargo installed via rustup or system packages; remove the PATH
modification and just use "cargo build --release", or if you keep it, add a
brief note explaining it's only needed when Cargo is installed in
$HOME/.cargo/bin (e.g., installed via rustup without adding to PATH) so readers
know when to apply the PATH prepend.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4d8f7afa-91fe-4a2c-80c2-ad095fbce32c
⛔ Files ignored due to path filters (1)
python/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (10)
python/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/.cargo/config.tomlpython/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/.gitignorepython/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/Cargo.tomlpython/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/README.mdpython/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/build.rspython/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/exporter-stm32f4.yamlpython/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/memory.xpython/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/rust-toolchain.tomlpython/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/src/main.rspython/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/stm32f407-rust-blink.elf
| # --- STM32F407 Discovery (opensomeip FreeRTOS/ThreadX) --- | ||
| # Uses Renode's built-in platform, USART2 for console output. | ||
| # |
There was a problem hiding this comment.
Update stale scenario label in header comments.
The section title/description still mentions opensomeip FreeRTOS/ThreadX, which doesn’t match this Rust blink example and can mislead users.
Suggested doc-only fix
-# --- STM32F407 Discovery (opensomeip FreeRTOS/ThreadX) ---
-# Uses Renode's built-in platform, USART2 for console output.
+# --- STM32F407 Discovery (Rust blink example) ---
+# Uses Renode's built-in platform, USART2 for console output.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # --- STM32F407 Discovery (opensomeip FreeRTOS/ThreadX) --- | |
| # Uses Renode's built-in platform, USART2 for console output. | |
| # | |
| # --- STM32F407 Discovery (Rust blink example) --- | |
| # Uses Renode's built-in platform, USART2 for console output. | |
| # |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@python/packages/jumpstarter-driver-renode/examples/stm32f407-rust-blink/exporter-stm32f4.yaml`
around lines 7 - 9, Update the stale header comment that currently reads
"STM32F407 Discovery (opensomeip FreeRTOS/ThreadX)" to accurately describe this
file as the Rust blink example (e.g., "STM32F407 Discovery (Rust blink
example)"); remove or replace the "opensomeip FreeRTOS/ThreadX" text in the top
comment block while keeping other accurate details (like "Uses Renode's built-in
platform, USART2 for console output.") intact so the header reflects the actual
scenario.
Create the embedded Rust project (USART2 ON/OFF lines, PD12 LED) with stm32f4xx-hal, plus README, linker script, and rust-toolchain for thumbv7em-none-eabihf. Include Cargo.lock and a prebuilt ELF for flashing.
Made-with: Cursor