Closed arnoutdekimo closed 10 months ago
EDIT - the bufferMatch should check only at the START of the buffer. So that shouldn't be the issue. Ok, give me a few mins, I'll narrow it down
So, this is just an issue.. because of debugging.
The details get complicated, but simply said, if I single step over lines in uCellSockRead
, like here:
It is -normal- that when it tries to retrieve thisActualReceiveSize
, it fails.
Why? Because, when you single step, the debugger breaks the entire MCU, including the UART peripheral. Since the modem cannot send everything fast enough before the debugger breaks, data is lost.
I initially tried to increase DMA buffer sizes, but all of that does not matter when the UART peripheral (and DMA) are suspended during debugging.
The only correct way to debug this code, is to let it run until the modem has sent all data out, so practically this means placing breakpoints after the full command read loop. e.g here:
When the debugger breaks there, the underlying code must have (in loop) let the UART do its thing to fill up the buffers without interruption, and retrieve it.
So yea, never mind this issue ..
Hehe, love the GIF.
It is true, of course, that in real time systems one needs a "stream" type log of activity which, for some reason, no [embedded!] platform's toolset ever really gives you. So we do printf()
's, or our own RAM-log type buffered systems, as required (internally for our cellular modem development we have a very complex tool that does tokenised "prints" for real time modem operation).
Anyway, sorry you had to be distracted by this and thanks for posting a resolution.
Hi,
I am debugging a new issue, that seems to be timing related. It's pretty trivial to analyze though.
Situation:
Issue:
If we "slow down the code", causing the entire reply to already be inside of the response buffer, I think what happens is that the code in
processResponse
first sees that there is an OK at the end (stoptag), instead of first checking whether the URC was actually matched, and an OK followed it.The result is that sometimes the parser will miss replies.
Am I correct in this assumption?