The execution enter prvTaskExitError method

Hi all. The target run on STM32F439NI, in IAR environment Something happened to the code (earlier it worked). So, I create several tasks in the main function and after this call to vTaskStartScheduler(), there call to xPortStartScheduler() and there call to vPortStartFirstTask() in file portasm.s. After this, code try to jump to first task’s Run method, but I already can see in call stack that execution start from prvTaskExitError method. I read previous discussions, and checked that I set HALNVICSetPriorityGrouping(NVICPRIORITYGROUP4); Put attention that it is happen before the first task start run. The execution continue run properly, but call stack start from prvTaskExitError function. Please, help me understand what happen ? Thanks a lot Valerie

The execution enter prvTaskExitError method

prvTaskExitError() should only ever be entered if an application task attempts to return or exit. Do any of the tasks you created return from their implementing function, ether by executing to the end of the function or by calling return? If you want an application task to terminate then call vTaskDelete( NULL ).

The execution enter prvTaskExitError method

Hi In order to understand the problem clearly I leave the only one task that do nothing and have delay 50 miliseconds inside. So, In IAR tasks plugin I see IDLE task, TmrSvc task and empty task that I created. Now I am sure that there is no task that attempts to return or exit. Do you know another reason of entering prvTaskExitError() ?

The execution enter prvTaskExitError method

Hi In order to understand the problem clearly I leave the only one task that do nothing and have delay 50 miliseconds inside. So, In IAR tasks plugin I see IDLE task, TmrSvc task and empty task that I created. Now I am sure that there is no task that attempts to return or exit. Do you know another reason of entering prvTaskExitError() ?

The execution enter prvTaskExitError method

Hi I think I understand now. The execution doesn’t enter the function prvTaskExitError. I only see in call stack that execution starts from it. And now I think that it is right situation, It is kind of protection in case task will return from the it’s implementing function. So, Is it OK, that call stack begin from prvTaskExitError method ? Thanks a lot for your time and consideration. Valerie

The execution enter prvTaskExitError method

Yes, it is expected that that is at the top of the stack frame as that is the function the task will return to if it attempts to return from it’s implementing function.


The execution enter prvTaskExitError method

Thank you