Skip to content

irq clear prev not working #2338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pauldevine opened this issue Mar 9, 2025 · 3 comments
Open

irq clear prev not working #2338

pauldevine opened this issue Mar 9, 2025 · 3 comments
Assignees
Labels
Milestone

Comments

@pauldevine
Copy link

On the rp2350b I'm synchronizing two state machines on different PIO instances so that they can address different pin ranges. 0-31 with one state machine and 32-47 on the other. I'm able to successfully set an interrupt and have it triggered on the second machine across the PIO boundary. But I'm not able to clear it with irq clear. The compiler won't allow me to reference the previous pio block with:

.wrap_target
    wait 0 irq prev 0      ; Wait for IRQ0
    irq clear prev 0        ; Clear IRQ0
.wrap

that results in a syntax error 15-18: syntax error, unexpected prev, expecting ( or identifier or integer. I get the same syntax error if I try the documented irq clear 0 prev. Since the word prev seems to work for the other statements when it precedes the interrupt number I assumed that syntax should be valid here.

I can get the pio assembly to compile if I use irq prev clear 0 however that doesn't clear the interrupt.

If instead I clear the interrupt immediately with wait 1 irq prev 0 that works as expected. I was hoping to have a few pio commands executed before clearing the interrupt as I'm trying to get a bus to the right state before continuing the other state machine.

@kilograham kilograham added this to the 2.1.2 milestone Mar 9, 2025
@lurch
Copy link
Contributor

lurch commented Mar 10, 2025

Similar issue to raspberrypi/pico-feedback#440 ?

@lurch lurch added the pioasm label Mar 10, 2025
@pauldevine
Copy link
Author

That earlier comment is pointing out a documentation error. I believe I'm experiencing a functional error.

@KewlKris
Copy link

I also had trouble with IRQs between state machines in different blocks (even when synchronizing with CTRL.NEXTPREV_CLKDIV_RESTART).

I eventually used wait JMPPIN + n (to wait for a signal) and jmp PIN (to branch on a signal) to synchronize and communicate between state machines. I wish I could get things working with an internal solution rather than using external pins, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants