4

I have FreeRTOS project with 4 tasks. In some cases the device stops responding. When Break the MCU (stm32f4), in most cases it is in task switching subroutines (tasks.c) and goes to vApplicationIdleHook. How to find the address of main task at which it is stopeed?

Edit: I have tskTCB structure of interesting task. Is there a chance to find the return address for that task when I break execution in vApplicationIdleHook for example? It seems first member pxTopOfStack may help, but it points to unused memory...

i486
  • 6,491
  • 4
  • 24
  • 41
  • What have you done to debug this? As a minimum have you followed the "[my application does not run, what could be wrong](http://www.freertos.org/FAQHelp.html)" FAQ item? Your post is not clear. You say the device is in the task switching sub-routine and goes to vApplicationIdleHook(), but vApplicationIdleHook() is called by the idle task - which is an executing task - it is not called by the task switching sub-routine. There is another hook function called vApplicationTickHook() that IS called by the task-switching sub-routine - are you sure it is not vApplicationTickHook() that is called? See – Richard Nov 09 '16 at 02:53
  • The application is running. But in some cases the main task seems hanging and I want to find the point of this. `vApplicationTickHook()` is called regularly as well as `vApplicationIdleHook()` (even when main task is hanging). I mentioned task switching subroutine because when I click "Break" in the IDE (Rowley Crossworks) most times it is stopped in such subroutine. Probably all tasks are blocked/waiting and FreeRTOS verifies whether they are still blocked and calls `vApplicationIdleHook`. My question is: when I break execution, what structure to see to find the return address in main task. – i486 Nov 09 '16 at 08:45

0 Answers0