Open coratron opened 6 months ago
Leaving this here until someone has a look:
I have solved the issue and recommend modifying the otaThread function in the example to:
void* otaThread(void* pParam)
{
/* Calling OTA agent task. */
OTA_EventProcessingTask(pParam);
LogInfo(("OTA Agent stopped."));
pthread_detach(pthread_self());
pthread_exit(NULL);
return NULL;
}
Otherwise the resources allocated to the thread will not be released.
Restarting OTA is the next issue after releasing the resources : the system gets caught here on the second start up pass:
else
{
/* Drop all events that created after OTA_Shutdown. */
resetEventQueue();
}
in OTA_Init
@coratron Thanks for the bug report. Would you mind opening a Pull Request with your suggested fix?
Hi @coratron, Could you help take a look on #1923 to check if this is the patch you want?
Thank you.
I am using the following:
The problem:
The OTA task consumes about 10kB of RAM. Calling OTA_Shutdown() should release the resources but it is not.
Confirmed with logs by checking the RAM before and after, as well as verbose logging which ends in
I (100117) AWS_OTA: OTA Agent stopped.
I am basing my code on the OTA example. In other words, the result should be reproducible by measuring the RAM watermark before aws_iot_ota() and at the end of it.