Could anybody please kindly help me investigate the issue with hard fault exception at marked code line.
I know that the exception had place at this line by the pc register which were saved in the HardFault_Handler routine before watchdog rebooted MCU.
I got tens of devices that are randomly reporting about the issue couple times a day.
This whole thing started when I added the periodically deletion (and then creation) flow of the task, which stack I periodically measure with uxTaskGetStackHighWaterMark function call (it is prvTaskCheckFreeStackSpace wrapper).
Adding the condition statement:
if(eTaskGetState(taskHandle) == eDeleted) (1)
before calling the uxTaskGetStackHighWaterMark didn’t help.
So I guess there could be race condition of the task that I’m periodically deleting and the other task that is measuring the all tasks’ stacks. But where it leads? To uxTaskGetStackHighWaterMark call with deleted task as the argumet? I did it and nothing happens there just random value of the bytes not equal to the tskSTACK_FILL_BYTE.
Anyway, does anyone see what goes wrong?