USB Stall when using printf #1939
Replies: 1 comment
-
The USB serial TX buffer can't overrun, but it can block if the computer doesn't eat the USB packets faster than the Pico produces them. You can see this with the 22khz x 16bit x 2channel If you can make a small MCVE that reproduces the hang w/o any special hardware others can look at it, but if not then you're pretty much on your own since nobody else will have your specific HW combo and 3rd party library. Your best bet then is to hook up a PicoProbe and dump the stack to see where the core is when it "hangs" (also I'm not sure what you mean by hang, specifically...). |
Beta Was this translation helpful? Give feedback.
-
I have a custom RP2040 board in the Arduino UNO Rev3 form factor. I have written an example sketch to read a 4-Channel SPI ADC (MAX11635) on the board. This sketch freezes up when the printf() statements are uncommented. When the printf() statement commented out the sketch runs fine with no freezing up. I have confirmed that the MAX11365 library is working and not the cause of this problem.
Here is the sketch I am using.
The max11635 library can be found here (https://github.com/UofTPhyEssSW/MAX11635-ADC).
Device Settings
From what I can tell this looks like a USB TX buffer overrun issue and I am pushing to much data to the USB buffer. Other tests that I have done have only counted number of samples taken and only output the count every 400 samples (~10sec). Those tests have run over night with no issues.
Any Insight to this issue would be helpful.
Thanks
Rob Morley.
Beta Was this translation helpful? Give feedback.
All reactions