-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gsm_call_dial() function locks the program #34
Comments
Hello. Please increase FREERTOS heap size and try again. |
Hi @ogulcan90 Why it is happening is very interesting issue to dive in 🙂 First of all it could be because you are trying to free the memory twice. If you are trying to free the memory twice most likely that you are using this already freed memory in other places that would lead to heap memory corruption. Thats why it is very good programming practice to set all the pointers to NULL after they were freed. Also you can try step by step debugging and make yourself sure that memory was allocated well and pointer holds actual value to this memory. If memory was allocated well save the value where the pointer is pointing to. Then at vPortFree call compare saved value with actual value that is passing as a parameter to vPortFree. If they are different most likely you faced with stack memory corruption and the pointer value was overwritten somewhere in the stack. |
I solved the problem by increasing _ATC_SEARCH_CMD_MAX from 5 to 10. The thing is in atc_command() function, there are these line:
in which the memory is allocated but it breaks before freeing. I suggest you to free the memory before this break. Also you might want to find a way to address this lack of number of _ATC_SEARCH_CMD_MAX. Thank you for your interest. Regards, |
Hi,
I tried the library and I can send sms properly, but when I try to make phone call, the program stucks in a way that all tasks stop working.
Here is my FreeRTOS configuration:
Here is my gsmTask:
Here is my GSMRun Task:
It sends the AT command, my phone rings, so when I debug, I see that the PC comes here (line 39 of call.c, inside gsm_call_dial() function):
Then it goes to atc_command() function and spends some time in this loop (located between line 195 & line 198 of atc.c):
Then I press resume to see where it stucks, and I see that it stucks in line 278 of heap_4.c:
configASSERT( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 );
which is in vPortFree function.
This means the FreeRTOS somehow cannot deallocate the memory that it allocated before.
Does anyone has any idea on the solution of this problem?
Thank you.
Cheers,
Ogulcan
The text was updated successfully, but these errors were encountered: