@cagz, yes, that’s possible. You need to add a specific symbol and make sure it doesn’t optimized out and then add --rtos auto in the appropriate ocd file. More info here How to make the STM32 debugger aware of FreeRTOS tasks? - #2 by maxgerhardt . maxgerhardt is the expert for this as well.
It works great for me.
I wish platformio would make the debugger thread aware out of the box.