-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Clear out PIOs and State Machines on RP2040 soft reset #4265
Conversation
Update from adafruit main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this in board? This code should already reset everything: https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/common-hal/rp2pio/StateMachine.c#L94
Calling reset_rp2pio_statemachine() did not seem to clear the interrupt or
the
state machine program. When I used that and did the CTRL-C,CTRL-D sequence
I could see that the interrupt handler was still getting called.
…On Thu, Feb 25, 2021 at 4:18 PM Scott Shawcroft ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Why is this in board? This code should already reset everything:
https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/common-hal/rp2pio/StateMachine.c#L94
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4265 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNJKETGNKPNXNB3UPIELTLTA3ECNANCNFSM4YHA2RJQ>
.
|
Ok, I totally believe that. It seems to me that reset_rp2pio_statemachine should turn off interrupts as well instead of having a separate way to reset things. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Dave! One more request.
shared-module/board/__init__.c
Outdated
@@ -179,4 +183,7 @@ void reset_board_busses(void) { | |||
#if BOARD_UART | |||
MP_STATE_VM(shared_uart_bus) = NULL; | |||
#endif | |||
#if CIRCUITPY_RP2PIO | |||
reset_rp2pio_statemachine(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this anymore because port_reset
should call reset_rp2pio_statemachine
. rp2pio
is meant to be port-specific so it shouldn't influence any code outside of ports/raspberrypi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it and still tested OK. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Code to make sure PIOs and state machines are cleared out on a soft reset.