Skip to content

Conversation

kaspar030
Copy link
Contributor

Add fifo-handler feature for injecting a custom handler of FIFO messages.
Also enable FIFO queue in core1->core0 direction.

In Ariel OS, we need a way to trigger the scheduler on the other core. The FIFO peripheral is made for this, but also claimed by embassy-rp, for stopping the second core from the first. Inside embassy, I think this is used to stop execution from flash while messing with it.

This PR (optionally, based on fifo-handler feature) makes this a bit more flexible:

  1. It is now also possible to stop the first core from the second
  2. With fifo-handler enabled, an fn handle_fifo(u32) -> bool is called for each FIFO message arriving from the other core that is not used for stopping or resuming.

Signed-off-by: Kaspar Schleiser [email protected]

@kaspar030 kaspar030 force-pushed the rp-fifo-custom-handler branch from ca306e1 to f5b8165 Compare September 12, 2025 12:01
@CBJamo
Copy link
Contributor

CBJamo commented Sep 12, 2025

I like this change.

Separately, on the 2350, pausing/resuming the cores should probably be switched to use a pair of doorbells rather than the fifo. Possibly that would work for your scheduler case as well. Then the fifos could be left free for users.

Add `fifo-handler` feature for injecting a custom handler of FIFO
messages.
Also enable FIFO queue in core1->core0 direction.

Signed-off-by: Kaspar Schleiser <[email protected]>

embassy_rp: fix unsafe call to extern fn
@kaspar030 kaspar030 force-pushed the rp-fifo-custom-handler branch from f5b8165 to 7c70788 Compare September 17, 2025 11:33
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.

2 participants