Skip to content
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

Uart buffer data loss leading to hang on MKRNB1500 #644

Closed
joshbober opened this issue Sep 10, 2021 · 2 comments
Closed

Uart buffer data loss leading to hang on MKRNB1500 #644

joshbober opened this issue Sep 10, 2021 · 2 comments

Comments

@joshbober
Copy link

Hello. We have been looking into this issue on the MKRNB repo, but I believe we have traced it down to the SAMD core being the root cause.

In the Modem.cpp file of the MKRNB library, part of the code waits for an AT response from the cellular modem that communicates through a uart interface. Once the uart buffer has data (uart->available() returns nonzero), each character gets stored in a local variable _buffer. This buffer eventually gets checked for an expected result code that ends every AT response. The issue is, for responses longer than 63 characters, the buffer only stores the first 63 and drops the rest. This means it also drops the result code, and the function assumes that it is still waiting for the end of the response.

This behavior occurs in versions 1.8.10 and 1.8.11 of the SAMD core. Reverting to version 1.8.9 resolves the issue. Please let me know what points need clarification, as I'm sure I haven't explained everything thoroughly. More details can be found in the link to the issue at the top of this comment.

I am happy to help with testing to resolve this if needed. Thank you!

@CptHolzschnauz
Copy link

CptHolzschnauz commented Sep 12, 2021

I think this is a serious tricky bug to track down!
Due to it's nature i guess the bug affects a lot of modem / AT console operations and can be a explanation for a LOT of puzzling errors (as described by many in the forum) on the mkr1500 & 1400.
The "Receive SMS" example sketch is a secure way to reproduce the issue.

@joshbober
Copy link
Author

I believe this is now fixed by #651. I have tested the ReceiveSMS example sketch on the MKR NB1500 with version 1.8.12 of the SAMD core. The device no longer hangs, multiple messages can be received consecutively.

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

2 participants