You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I encountered a hardfault error caused after executing strtok() from gsm_msg_read() function. strtok() is not thread-safe and since I'm using FreeRTOS this could be a problem. I was able to fix this by using strtok_r() instead of strtok(). And later, I used the custom function strtok() and it didn't cause any problems either. I also thought that this could be due to the lack of heap allocated for the task, but it seems that increasing the heap did not help me.
I don't fully understand the cause of the problem, so my solution was to use the self-written strtok() function.
It would be interesting to know if someone has come across this, or maybe my solution will help someone.
My setup: stm32F401, FreeRTOS, task heap 512 (also tried 1024).
The text was updated successfully, but these errors were encountered:
Hello,
I encountered a hardfault error caused after executing strtok() from gsm_msg_read() function. strtok() is not thread-safe and since I'm using FreeRTOS this could be a problem. I was able to fix this by using strtok_r() instead of strtok(). And later, I used the custom function strtok() and it didn't cause any problems either. I also thought that this could be due to the lack of heap allocated for the task, but it seems that increasing the heap did not help me.
I don't fully understand the cause of the problem, so my solution was to use the self-written strtok() function.
It would be interesting to know if someone has come across this, or maybe my solution will help someone.
My setup: stm32F401, FreeRTOS, task heap 512 (also tried 1024).
The text was updated successfully, but these errors were encountered: