using freeRTOS + TCP stack, we are able to test a network but stressing with a flood ping, after a while, the system goes in exception abort on Cortex R52. This looks to be related on context switch, pxTCB is NULL and it occurs in different parts of the system and happens randomically (after 5 minutes as well as 1 h). Adding extra checks like below, the SW is a bit more stable but the issue occurs soon or later.
The recommended priority levels of the tasks when using FreeRTOS+TCP are:
Highest : the Network Interface driver (niEMAC_HANDLER_TASK_PRIORITY)
Medium : the IP-task (ipconfigIP_TASK_PRIORITY)
Lower : the tasks that make use of FreeRTOS+TCP
Is that the case?
Also, please make sure that there aren’t any ISRs that are run with logical priority above configMAX_SYSCALL_INTERRUPT_PRIORITY if they are using any FreeRTOS APIs.
Beside checking the task priorities, I would also look at the logging from the function vPrintResourceStats(). It will be difficult to catch the last logging lines if the CPU is about to get an exception. vPrintResourceStats() should be called from the network interface, normally from the network interface in a function like prvEMACHandlerTask().