-
Notifications
You must be signed in to change notification settings - Fork 1.3k
RP2040 - SPI failure after soft Reboot - with displayio -- every other time #4642
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
Comments
I've encountered this bug after building the touch deck from John Park's tutorial: https://learn.adafruit.com/touch-deck-diy-tft-customized-control-pad. Power cycling is my workaround. Adafruit CircuitPython 6.2.0 on 2021-04-0 8000 5; Adafruit Feather RP2040 with rp2040 Traceback (most recent call last): |
The power cycling is a real buzzkill. I've got the TFTFeatherWing35 and a Feather RP2040, running HX8357 drives the 3.5" TFT display Anything that interrupts the busy loop (filesystem update or Ctrl-C) can trigger the failure state. |
I have just built and I'm seeing this also. |
Could you all try 7.0.0-alpha.5 with this bug? I removed the ability to interrupt an SPI transaction with ctrl-C in #4974, which should be in alpha.5. |
I can now enter the REPL and reload without encountering the STMPE610 error. I can also trigger a reload via filesystem write without error. The display correctly initializes in both cases. |
|
this issue was initially opened against the STMPE610 library adafruit/Adafruit_CircuitPython_STMPE610#16
but subsequent testing has shown that it is not related to that specific library.
I was able to reproduce the same behavior with another SPI device (FRAM breakout)
First -- here is a recap of the initial issue followed by more recent findings taht hopefully help narrow down the root cause.
Issue recap:
on a feather rp2040 connected to a 2.4inch TFT featherwing (ILI9341 display) the following code has been my test program:
All code run on up to date version of CP from the latest tip of main and updated libraries
loaded as code.py
On initial power-on or hard reset the code runs normally. If the code is stopped via a Control-C at the REPL then a soft reboot (Control-D) is issued, the code will fail to properly detect the SPI device (STMPE610)
If another contol-D is issued, it will run normally and continue to alternate running and failing with each control-D issued...
I also found that if after the Control-C, I execute
it will run normally on the next control-D
Also note that - if displayio is not initialized on the board, then the issue does not occur.
It only happens if the display is in use.
As noted above, I substituted an SPI FRAM breakout for the STMPE610 in the code above and reproduced the same issue.
This seems to exonerate the STMPE610 library (which does have it's quirks) and points to some other issue with CircuitPython.
I also verified that the issue does not occur with a feather_m4_express or feather_stm31f405 - it appears to be unique to the rp2040.
I also verified that the issue does occur with the feather_rp2040 and keyboard_featherewing.
Latest findings:
I have also found that the issue only occurs if a "control-c" is used to break out of the "while True" loop.
If it replace the "while True" with "for x in ramge(10000)"
f the code runs is allowed to run until completion it will restart normally with a Control-D at the REPL.
However, if I interrupt the execution with a Control-C, then it fails as above on the next Control-D and alternates with subsequent Control-Ds as above. If allowed to complete, it always restarts on a Control-D
So, the issue appears to be related to how the system is left after a control-C interrupts the executing code.py.
I have looked at the SPI transaction with a logic analyzer but have yet to find a "smoking gun". I'll be doing more and will update with any findings.
The text was updated successfully, but these errors were encountered: