vPortEnterCritical() assert fail on xQueueReceive() lwip

Hi,
I’m trying to run the example “echo server” from Xilinx Vitis IDE which actually creates a simple server using lwip that sends back the same messages it receives. Running the example directly on the Xilinx Ultrascale zcu102 it works fine, however when I move the example as VM in a hypervisor it throws an exception at row 577 of port.c

configASSERT(ullPortInterruptNesting == 0);

The call trace is:

-vPortEnterCritical(): port.c, line 557
-xQueueReceive(): queue.c, line 2308
-sys_arch_mbox_fetch(), contrib/ports/xilinx/sys_arch.c, line 688
-tcpip_timeouts_mbox_fetch(): lwip-2.1.1/src/api/tcpip.c, line 104
-tcpip_thread(): lwip-2.1.1/src/api/tcpip.c, line 142

I’m using FreeRTOS 10

Anyone knows how to fix?

Thanks in advance

Does this happen the first time that code executes? Or after some time? If the first time them makes sure the system is being initialied correctly including variables being set to their initial values before main() is called. In this case ullPortInterruptNesting should be cleared to zero - if it isn’t then that assert will get triggered. See https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/portable/GCC/ARM_CA53_64_BIT/port.c#L161

When you mention the hypervisor, is the hypervisor running on the ultrascale? Or are you talking about running the FreeRTOS code in a software model or emulation of the ultrascale? If you are running on the real hardware still you may need to check GUEST is defined. See https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/portable/GCC/ARM_CA53_64_BIT/portASM.S#L72

Separately - grateful if you can provide links to the lines of code, as I have done here, rather than just stating the line numbers. That way we can find the code more easily and ensure we are talking about the same things.

Thank you very much for your kind reply.
This error happens after few some time: first calls to vPortEnterCritical() goes fine, however after some time it crashes.
About the hypervisor, yes it is running on the Ultrascale and I’ve already defined GUEST.

Sorry about the issues with code links, I’ll use links next times.

However, I have solved the issue by reducing the number of priorities available for FreeRTOS since the ones made available by the Hyp were less than expected.

Thank you very much for your help