prvSelectHighestPriorityTask function have problem

when i running for a while (about 2 hours),run in “prvSelectHighestPriorityTask”,the pxTaskItem->pvOwner = NULL and in an infinite loop,I have no idea for this problem。anyone can help me?

It would be nice if you mentioned which chip you were using, and where you got the code from. If you were using the single core FreeRTOS version and a Cortex-M3, then nine times out of ten it is an interrupt priority setting that would be caught (on recent versions of FreeRTOS) if configASSERT() is defined. More info here:, and especially here: It looks like you are using the SMP version, so it could be the same or similar issue, depending on the port you are using, but could also be pointing you in the wrong direction.

I‘m use cortex-r5 with gic, and SMP version, have validate interrupt prioity.

Are you porting FreeRTOS SMP to R5 or did you get this code from somewhere? If later, can you share where did you get this code from?

I porting the FreeRtos SMP to R5 by myself。
portable.7z (12.3 KB)

this code running after 28 hours, something went wrong。

As you are trying to port FreeRTOS, likely there is an issue in the port itself. I would suggest to try to isolate the issue by disabling all the functionality from the app and then adding one by one. If you have any ISRs, disabling those first might be a good idea. If you are able to pin point a variable that is getting corrupted, you can put a data breakpoint on that variable (or at a new one placed right next it) to break as soon as the corruption happens.