How do I debug FreeRTOS multithreaded application with Vitis?

Hi everyone,

I’ve seen this question before but couldn’t find any solution to the problem.

I’m using Xilinx ZYNQ Ultrascale+ (R5 processor) zcu104 board. I opened a UDP server example from LwIP with FreeRTOS.

When I started debugging, a strange problem occurred, both suspend and resume debug buttons are active and I couldn’t step in, step out or step over (view the attached pictured).

Sometimes I am able to click on the suspend button and I found out that the code is stuck in an infinity loop inside “Xil_PrefetchAbortHandler()”.

When I don’t debug my code or not using any breakpoints, the system is working fine and my code runs.

I found out that most of the time when the problem occurred is when I step over but if I step in then I won’t happen.

Do you have an idea why is it happening? I’ve seen articles saying debugging FreeRTOS using Vitis is impossible. Hope it’s not true.

Thank You!



Is it possible that when you are paused on the debugger the processor clocks keep running, and potentially generating interrupts? I’m not familiar with Vitis yet, but in the XSDK (prior to Vitis) I had to use the “System Debugger” option, not GDB, and there were quite a lot of options to set. Is that the same in Vitis?

Hi Richard, thanks for the replay.
It sounds possible, I checked that out and opened the debug configurations. I am currently debugging using Single Application Debug (not GDB) and it still doesn’t work.

I found out something that looks like it’s going in the right direction:

I’m not sure this is the reason why my code crashes but after I read the article above I made some changes in the LwIP function and I started writing my code as a task outside the LwIP function and it works better.
I also found out that the code crashes when it steps out of a function.
It is an unexpected behavior.