We have an application that makes use of CMUX mode on UART1. We have been stress testing the application by using a python script to send a large number of commands on UART1 DLC1 using the Windows CMUX driver. During the test I found that our application was resetting.
While debugging the cause of the reset I tried running the same test script first with no application running on the modem - no reset or timeouts, then with a modified version of the hello world sample - and the modem reset - always at about the same line in the log captured by the test script. Using the TMT I could see that the error back-trace string was ADL Get memory error…
The test script sends three commands - AT+WIND? and two custom commands. Each command is sent 30 times and the sequence of all three commands is repeated 100 times for a total of 9000. After sending a command, the script waits for a response for up to 2.5 seconds, checks anything received and sends the next command. Once a response to a command is received, there is no delay before sending the next command.
I tried inserting a delay of 10ms, then 50ms between commands with no improvement.
I also tried increasing the application stack size from 3kB in increments up to just under 64kB. With a larger stack - and correspondingly smaller heap - the reset and associated timeouts actually occurred earlier. With a smaller stack - 1kB, the reset happened a bit later and the error back-trace string was RTK Except 161 180ff748 30.
The last test I tried was to repeat the test on UART1 directly rather than using the CMUX protocol. I found that I got the same reset and timeouts at about the same point in the log.
This seems to suggest that heap is being corrupted within the ADL layer, but this seems pretty hard to believe - as surely these types of test have been run many times before successfully? I would appreciate any suggestions for further things to check as I am still hoping that I am doing something stupid!