‎2022-06-06 02:10 AM
I have to projects based on FreeRTOS. One is st example and one is generated by me from example .ioc file. All of the files in projects are the same (including FreeRTOS middleware directory). In the projects there is a task called periodically which set flag for the other task using osThreadFlagsSet function. While debugging I've noticed that osThreadFlagsSet function returnes different values. In one project rflags variable has value equal to 1:
In the other rflags has some random value:
and because of that I think that there might be the problem with setting flag for the task. Not setting the flag causes project work unstable. What might be the issue?
Solved! Go to Solution.
‎2022-06-08 02:55 AM
Update:
@Walid ZRELLI​ The issue is solved. Increasing stack size of the send thread by 512 solved it. Thanks for the help one again!
‎2022-06-06 03:26 AM
Hello @Community member​ ,
In order to allow a better analysis of this issue, could you provide the project that contains the flags problem?
As well, are you sure you are pointing to the same line code when debugging both projects?
Otherwise, try to remove the initialization of this variable (uint32_t rflags 😉 and leave me your feedback.
BeST Regards,
Walid
‎2022-06-06 05:12 AM
Hi @Walid ZRELLI​,
I'm sure that I was poiting to the same line when debugging. I was checking rflags value after execution of xTaskNotifyAndQueryFromISR function. Initialization of variable was for debugging purposes only and program was acting the same with as well as without it.
Attached you will find invalid project. I was using STM32CubeIDE in version 1.9.0 and STM32Cube_FW_WL_V1.2.0 packet. Program was run on the Nucleo-WL55JC2. In the last anwser to this question:
I've described when exactly this issue occurs.
‎2022-06-07 08:42 AM
Hello @Community member​ ,
I have tested your example and it works well for me. The rflags variable has a value equal to 1.
Thanks for double check from your side.
BeST Regards,
Walid
‎2022-06-08 01:00 AM
@Walid ZRELLI​ Thank you for your help so far. Have you tested the example right away after flashing or in the any other case? When I'm running my example issue occures after succesful joining device to the network and sending one data packet. I do not know where should I look for source of the issue.
‎2022-06-08 02:55 AM
Update:
@Walid ZRELLI​ The issue is solved. Increasing stack size of the send thread by 512 solved it. Thanks for the help one again!
‎2022-06-08 03:02 AM
Great news! Thanks for sharing the solution 😊