STM32F4 FreeRTOS thread awareness pain in TrueStudio
I have been working with the STM32F427 using CubeMX and TrueStudio for a couple of years now, and getting freertos thread awareness into the debugger has been a constant challenge. Sometimes it works, sometimes it doesn't ...
My current situation, using a J-Link and the latest DLL from Segger, is that clicking pause works just fine, but hitting a breakpoint does not. When I click pause, the tasks are laid out nicely and (so far as I can tell) correctly. When I hit a breakpoint, the task information is not read correctly and the task view is garbled (with heaps of read alignment errors visible in the gdb log).
Yesterday, I stumbled across a post that linked this behaviour to configUSE_PORT_OPTIMISED_TASK_SELECTION .. and if I manually disable this (ie: it's enabled in CubeMX and greyed out), everything works correctly. Unfortunately, this means that there's a performance hit to context switches, so it's not ideal.
Apparently FreeRTOS 10.0.0 introduced freertos_tasks_c_additions.h, which helps in dealing with this, but I'm stuck at 9.0.0 unless I unhook from the Cube environment.
I've looked at CubeIDE and it looks like it has the same problems ..
Thoughts/comments?
Edit: apparently FreeRTOS 10 should be supported for my MCU ... I'll have a dig and see if I can work out why I'm still on v9.0.0!
