Skip to content

feat(example): Add RP2040-Zero example with EPD#187

Open
Vaishnav-Sabari-Girish wants to merge 12 commits intoratatui:mainfrom
Vaishnav-Sabari-Girish:feat/rp2040-epd-example
Open

feat(example): Add RP2040-Zero example with EPD#187
Vaishnav-Sabari-Girish wants to merge 12 commits intoratatui:mainfrom
Vaishnav-Sabari-Girish:feat/rp2040-epd-example

Conversation

@Vaishnav-Sabari-Girish
Copy link
Copy Markdown
Contributor

@Vaishnav-Sabari-Girish Vaishnav-Sabari-Girish commented Mar 26, 2026

This PR adds the example using an RP2040-Zero microcontroller by Waveshare with a 1.54in E-Paper Display (EPD) by Waveshare. Closes #186

…ibility

- Fix typo in rp2040 clippy matrix entry: thumbv6em -> thumbv6m
- Add mousefood-thumbv6m clippy matrix entry scoped to -p mousefood
- Add args field to clippy matrix for per-entry cargo flags
- Scope build-no-std thumbv6m target to -p mousefood

kasuari v0.4.12 uses alloc::sync::Arc and AtomicUsize::fetch_add which
are unavailable on thumbv6m-none-eabi without build-std. Building only
the mousefood lib (which does not directly depend on kasuari) avoids
the issue. The rp2040 example is unaffected as it uses build-std via
its own .cargo/config.toml.

Signed-off-by: Vaishnav Sabari Girish <[email protected]>
…pilation

alloc::sync::Arc does not exist on thumbv6m-none-eabi regardless of
build-std, because the module is gated behind target_has_atomic = "ptr"
which Cortex-M0 does not have. No amount of -Zbuild-std flags can work
around this at the workspace level.

The rp2040 example already solves this correctly via its own
.cargo/config.toml (build-std + panic_immediate_abort) combined with
portable-atomic and rp2040-hal's critical-section-impl providing
software atomics. Building from that directory is the only supported
approach for thumbv6m.

- Remove build-thumbv6m job (nightly + -Zbuild-std=core,alloc does not work)
- Add build-rp2040 job building from examples/rp2040-1in54-epd-example
- Add rust-src component to clippy stable toolchain for rp2040 clippy entry

Signed-off-by: Vaishnav Sabari Girish <[email protected]>
Copy link
Copy Markdown

@NustyFrozen NustyFrozen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should remove Cargo.lock
but besides that tested myself works

@Vaishnav-Sabari-Girish
Copy link
Copy Markdown
Contributor Author

should remove Cargo.lock
but besides that tested myself works

I'm glad it worked @NustyFrozen ,
Well actually Cargo.lock should be there. From my previous experiences ignoring Cargo.lock didn't make my program work.

Copy link
Copy Markdown
Member

@orhun orhun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR!

- uses: Swatinem/rust-cache@v2
- run: cargo build --release --target ${{ matrix.target }}

# thumbv6m-none-eabi is validated by building the rp2040 example from its
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have a separate job for this? Isn't this already built and validated by the matrix build above?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thumbv6m-none-eabi is excluded from the matrix above for exactly the reason in the comment — it needs build-std which the matrix doesn't use. This job is the only place that target gets built and validated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

This job can be renamed more generally though, for example build-std and we could make it a matrix, in case we include more targets here.

WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does make sense. Alright I shall look into that.

@Vaishnav-Sabari-Girish
Copy link
Copy Markdown
Contributor Author

Hey @orhun

I apologise not being able to update the PR. I have been swamped with college work lately and it looks like I might be busy for the next few days. Is it alright if I come back to this later ?

@orhun
Copy link
Copy Markdown
Member

orhun commented Mar 31, 2026

Sure :)

@Vaishnav-Sabari-Girish
Copy link
Copy Markdown
Contributor Author

Hey @orhun ,
As requested I have updated the code. Please let me know if there's anything to be improved.

Signed-off-by: Vaishnav Sabari Girish <[email protected]>
Signed-off-by: Vaishnav Sabari Girish <[email protected]>
- uses: Swatinem/rust-cache@v2
- run: cargo build --release --target ${{ matrix.target }}

# thumbv6m-none-eabi is validated by building the rp2040 example from its
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

This job can be renamed more generally though, for example build-std and we could make it a matrix, in case we include more targets here.

WDYT?

- Move HEAP_SIZE and HEAP_MEM to global scope in RP2040 example
- Generalize build-rp2040 CI job into a matrix-driven build-std job
- Move thumbv6m build requirement documentation from CI to README.md

Signed-off-by: Vaishnav Sabari Girish <[email protected]>
Signed-off-by: Vaishnav Sabari Girish <[email protected]>
@Vaishnav-Sabari-Girish
Copy link
Copy Markdown
Contributor Author

Hey @orhun ,
The code, ci and README have been updated. Please let me know if more improvements can be made.

Copy link
Copy Markdown
Member

@orhun orhun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking mostly good!

Updated note about device path for clarity.
@Vaishnav-Sabari-Girish
Copy link
Copy Markdown
Contributor Author

Done @orhun

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.

Examples for RP2040-Zero Microcontroller

3 participants