UART freeze RP2040 ?! #1917
Replies: 2 comments 8 replies
-
If someone thinks that the zero might send so quickly that the RP2040 can no longer get out of the read (which is a reasonable assumption):
This error is definitely in the top 3 of the most annoying errors I've ever had^^ |
Beta Was this translation helpful? Give feedback.
-
Converted to a discussion because without special hardware and your code, condensed to an MCVE, there's not much we can do here. FWIW, the UART should happily overflow and throw away characters without crashing. You can make a simple sketch to verify this, just start the UART and If you overflow and drop chars, does your code gracefully handle this? Or would it always be out of sync and, say, interpret a data byte as a command byte? I also remember doing up to 1MHZ loopback testing (don't quote me on this, but way above 115.2k) when I added the lockless SW FIFO used here. I would suggest hooking up a picoprobe and running GDB to find out exactly what the core is/was doing. You can get stack traces of both cores this way and see what's up even w/o having to share or minimize your code. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hallo Earle,
I have a flight controller based on the RP2040 that speaks to the Raspberry PI Zero 2 W via UART (Serial1).
The distance between them is less than one centimeter and the amount of data is so small that even a 9600 baud rate would be enough (its just some telemetry data). I've been flying with this config for a long time now without any problems!
However, since I have connected a modem (SIM7600) to the zero, the R2040 often gets stuck. This is a pretty big problem and I'm lucky that I always do a lot of testing on the ground. The Zero and the modem continue to run without problems, including the video stream.
With a lot of effort I managed to narrow down the cause and can cause the error at any time. The quickest way to do this is to hold my hand in front of the Zero camera and then quickly pull it away. Then the RP2040 program often simply stops. After a reset it works again. There are other weird ways to trigger the freeze.
I suspect that the Zero simply needs more computing power elsewhere with the connected modem, which is why it can no longer maintain the 115200 baud rate. But the error also occurs with a lower baud rates.
I've read that if I use the internal PL011 controller for the Uart on the Zero, the baud rate should stay the same, but I haven't tested it yet.
You could say that the fault is not with the RP2040, but ultimately it shouldn't just stop!
I would really appreciate it if you or someone else could help me to solve this error reliably.
My hardware setup should stay as it is.
To be on the safe side, I set up a second setup and the same error occurs here.
Beta Was this translation helpful? Give feedback.
All reactions