‎2022-06-05 09:01 PM
I've just started to learn FreeRTOS on CMSIS and im trying to make an interactive menu on a task and I also have another task with an HAL_GPIO_TogglePin just to coexist and see that both tasks are working. The menu text itself is sent to the terminal with no issues, then I send a character thar corresponds to one of the options available. The character is identified correctly and I've setted an informative message to confirm the option and give more instructions, but only the 2 or 3 first characters of the message are sent, then HardFault_Handler is activated.
I've tried some solutions like changing the TIM6 to Systick for the Timebase Source, because some people say that Youtube Tutorials are wrong about changing it to TIM6.
On the image below you can see my Transmit_Callback that I've been using in all my programs before starting to use FreeRtos.
These are the functions that I call on the tasks to send the messages
This is the Menu task:
This is the new_Message function and the option function
The set_rx funtion is to make the Rx flag to 1, in order to let the rx_callback recieve the characters from the user.
Ask if you need more information!
Solved! Go to Solution.
‎2022-06-06 01:47 AM
Hello @Andrés Motta​ ,
How do you configure the priority of interrupts? Make sure you have configured the priority correctly.
As well, try to perform a stack overflow check. If the main task in the environment or another task exceeds the available stack space, unpredictable behavior will occur.
Otherwise, you can refer to the FreeRTOS examples provided under the F7 Firmware Package.
I hope this helps.
BeST Regards,
Walid
‎2022-06-06 01:47 AM
Hello @Andrés Motta​ ,
How do you configure the priority of interrupts? Make sure you have configured the priority correctly.
As well, try to perform a stack overflow check. If the main task in the environment or another task exceeds the available stack space, unpredictable behavior will occur.
Otherwise, you can refer to the FreeRTOS examples provided under the F7 Firmware Package.
I hope this helps.
BeST Regards,
Walid
‎2022-06-06 06:24 AM
Hello @Walid ZRELLI​ ,
Bellow you can see my interrups priority, I haven't changed them:
About the stack overflow, I dont really know how to verify that on the STM32CubeIDE.
Thank you for the examples, I'll be checking them out too!
I appreciate the fast answer!
Best Regards,
Andrés
[EDIT]: I've removed the workedMessage() function from the option() switch case, to see if the tasks would still be interrupted and they do, so maybe isn't an issue caused by the UART (?), because when I tried to call the workedMessage function in the menuTask() condition without any option verification it worked and printed all the characters and didn't stop the tasks
[EDIT2]: I was wondering if the problem came from the Recieve, but I tried to echo my messages and it worked just fine, is something in the option() function that I can't have?
‎2022-06-06 10:24 AM
@Walid ZRELLI​ It was a stack overflow, I incremented the available stack space for the menu task and solved the issue, thank you very much!
‎2022-06-07 01:40 AM
Great news! glad to help you :smiling_face_with_smiling_eyes: