RTOS doing nothing

Hi,
I’m debugging a TCP connection with Amazon IoT and for some reason, my main loop is not running as it should. I have set up debugging via OpenOCD/GDB with Eclipse and if I pause the running application as it hangs, I can see that it’s busy executing a method called “prvIdleTask()” (see picture).

This is taking so long that the connection to Particle cloud drops and subsequently the TCP connection drops so it has to reconnect. To me, it looks like “prvIdleTask” is something that is running when there is nothing to do (the device is idle) but I would expect the Particle to maintain it’s own Network if it had nothing to do? Also - why would it not execute the main loop? Puzzled…

So - it turns out that when waiting for data on the TCP connection, the MCU is pretty much doing nothing. The odds of pressing pause just as something actually happens is next to none.