Hi,
We are trying to send data to a Webserver using TCP Socket Service.
The program crashes when the memory allocated for data to send is released immediately after returning from the ed_SendDataExt() call. Will the stack not copy the data to an internal buffer and send it from there. How long do I need to reserve the memory - when may I release it in this case???
void socket_request( u16 maxlen, TeDHandle ID )
{
ascii *text = (ascii *)NULL;
...
text = (ascii *)adl_memGet( maxlen );
// [<<<filling in data from flash IDs>>>]
...
x = ed_SendDataExt( text, maxlen, FALSE, ED_ID_TCPSOCKET_1+ID );
...
adl_memRelease( text );
}
If we comment out the adl_memRelease call, the program won’t crash…
But then we will have no memory left pretty soon ;-(
Is this the wrong way of communicating data to the stack? We have to send big chunks of data (24-48kBytes), so we really can’t have all of it allocated at the same time…
Any recommendations?
Thanks!!
Best Regards,
Jan
P.S. we are using the ADS compiler, 6.51 Firmware, Open AT 3.02, and the edLib that shipped with OpenAT 3.02. (The RTE program does not(!) crash; gcc does not compile the project (see other post))