Skip to content

Serial.print() - from Interrupt callbacks hangs the processor. #38

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

Closed
KurtE opened this issue Jul 7, 2023 · 1 comment
Closed

Serial.print() - from Interrupt callbacks hangs the processor. #38

KurtE opened this issue Jul 7, 2023 · 1 comment

Comments

@KurtE
Copy link
Contributor

KurtE commented Jul 7, 2023

With the current release (actually current code as well) as has been mentioned on a few threads now including:
https://forum.arduino.cc/t/serial-print-from-isr-will-hang/1145292

If you run a sketch like the unmodified example RTC->Test_RTC
The program will completely hang when it tries to do any Serial.print() statements... Actually would be true as well for Serial1.print()...

I am guessing that the current UART class code has not really been completed but just enough to be able to use the new board.
For example I am assuming that at some point there will be a TX software queue and the like.

But a quick and dirty fix would be to change the Interrupt priority for the UART to a high enough priority such that the NVIC code would allow it to be called from for example a timer interrupt callback.

On my machine I changed cores\arduino\IRQManager.cpp: line 14:
#define UART_SCI_PRIORITY 6 //12
Which allows it to preempt most IRQs except maybe SPI Master.

But again I do not believe this should be the long term fix, but may be sufficient for the short term

Edit: Note I have the Uno R4 Wifi

@KurtE
Copy link
Contributor Author

KurtE commented Jul 21, 2023

removing detritus from my list of open github issues.

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

No branches or pull requests

1 participant