Hi team,
I am using EC200U-CNAA for one of socket application using LTE01R03A04_C_SDK_U
getting bluescreen resets abruptly after running for 2-3 hours.
checking the Cool host trace but there is not similarity between functions running at the time of bluescreen occours.
how to diagnose, is there any resources to check the exact cause of the reset
Hi @Inventor_TM,
A good place to start is to check for memory leaks.
ql_errcode_dev_e Temp;
ql_memory_heap_state_t Stack_Test;
Temp = ql_dev_memory_size_query(&Stack_Test);
if (Temp == QL_DEV_SUCCESS)
{
QL_UART_DEMO_LOG(" Stack_Test.avail_size: %d", Stack_Test.avail_size);
QL_UART_DEMO_LOG(" Stack_Test.total_size: %d", Stack_Test.total_size);
}
Hey Victor,
I placed the above code in my while (1) loop in one of thread.
observed that stack available keeps decreasing and once it goes below 10,000 Bluescreen event restart the application.
How to address the condition, i have 5 threads in application? how to pinpoint the error and the specific routine of the application which must be decreasing available stacks?
Hi @Inventor_TM,
This could mean there’s un-free’d memory in your code. Do you use memory allocation in your code?
If so, my suggestion is to track those malloc/calloc and see if each of them are properly free’d for each loop.
You can also check for available memory more frequently to narrow down where it’s taking up the space.
Thank you Victor for your guidance, able to locate the memory leakage and address the issue.
after solving the error, I have come across another problem where some of my typedef enum, bool variables value changing abruptly after application run for some time. Trying to find the similarities in the incidence if any.
Hi Victor,
Although i was able to plug the leakage of the memory by implementing above code,
I have further developed the application and its working satisfactorily without any errors.
lately I have observed that suddenly the Cool Watcher started to show the Stack total size in negative.
kindly give your guidance, what can be the cause for error.
You may change %d to %u and see if it fixes the problem.
After changing to %u
is the Stack total value is realistic?
Doesn’t look like it’s realistic. Might be some internal errors.
However it can be easily worked around since stack total don’t really change so you may just get it once at startup and use that value instead.