I am new to Open AT platform and I am on Q2501B. I have a strange problem. Briefly, this is what I have in side the application
One Timer that timeout every 20 seconds
One Timer that timeout every 3 minutes
I have subscribed to Flash (Chances for a flash write is once in every 30 mins) and writing is very occasional.
I have Subscribed to 3 GPIOs and state change in the GPIOs are also very occasional.
I have subscribed to SMS.
The problem I have is that randomly the modules resets (OpenAT application crash) when the SMS callback handler is called. Usually it happens on the reception second long SMS. When small SMS are sent, it still happens, but may be on the 3rd SMS.
Hi,
I can’t see any hint in the documentation about the necessity to release the pointer ‘SmsText’. Try without releasing. This pointer is owned by OpenAt , it will care for this pointer by itself.
If you need to keep the content, copy it, it will become invalid after the call.
how do you use the variables result and dataext in your program? You defined an array of pointers, and I guess that’s not what you intended to do… If you use them as unsigned character arrays on the stack, you do not need to do a memget and certainaly you should not release them with adl_memRelease(result); and
adl_memRelease(dataext);
Here is what I do. I use the array of pointers to split the string based on a delimiter. This is basically used to send a command to the unit to perform an operation.
OK, so you really use an array of pointers… In that case you must get memory for each of the pointers of course before you can use them, and you should release the memory of each of them again… (I don’t know the split function, but you certainly can not release memory with adl_memRelease(result); I guess that should rather be adl_memRelease(result[0]); adl_memRelease(result[1]); adl_memRelease(result[2]); …)
If you are using OS 6.55 or greater you should get an ADL_ERR_MEM_RELEASE error, if the memory release failed.
You can use the Errors managment api to handle these events. Or at least you can put a trace, so you can see what caused the exception.
See the section 3.9 in the ADL guide.
These “known bugs” i know about SMS related resets:
OS older 6.55 may reset if an sms with empty string received if ADL sms api is used.
OS 6.60 may reset if external appli sends AT commands during the phase of receiving SMS
In your case these problems are probably not the cause. (especially the 2. )
Getting rid of some pointer arrays have solved the problem to a greater extend, though not fully. Memory management is little bit complicated and also bit hard to understand.