Watchdog Feeding Issues with FreeRTOS
Hello All,
Working with an STM32F4 processor and having issues with feeding the independent watchdog. Code is CubeMX generated. FreeRTOS v10.2.1 and CMSIS-RTOS V1.02. Watchdog resets if not fed every 512ms. Watchdog is fed in its own task and the priority is set to osPriorityRealTime. All the other tasks are osPriorityNormal. configTICK_RATE_HZ is set to a 1000 and configUSE_PREEMPTION is set to 1. The SYS timebase source was also changed from Systick to TIM7 as per a warning popup on CubeMX.
So the issue I'm facing is that the watchdog resets the processor consistently every half a second or so even though I'm feeding it in the RealTime Task. I can confirm that it is the independent watchdog resetting the processor from the RCC->CSR register. I can also confirm that it is not an issue with the feeding process, as if I create an infinite loop right before the osKernalStart() and feed the dog in there the microcontroller runs perfectly fine and if I don't feed the dog in there it resets every half a second like it should. I've also included __disable_irq();__enable_irq(); during the feeding process and it does not help. Also the code stops at breakpoints set on the line feeding the dog and steps through fine. I've tried setting up variables that increment (x++) before and after the watchdog feed line, and just letting it run (till it resets) shows both the counters increment evenly, I couldn't quite get SystemView to work and also don't want to fork out $2.5k for Tracelyzer either so do let me know if there are any other alternate methods to debug FreeRTOS other than the traditional debug window and setting breakpoints like I'm doing right now. I've tried both IWDG->KR = 0xAAAA; and HAL_IWDG_Refresh(&hiwdg); both do not work with FreeRTOS but works fine otherwise. Any and all help appreciated.
Thanks
