Monday, October 23rd 2017, 8:43pm UTC+2

You are not logged in.

  • Login
  • Register



Date of registration: Dec 2nd 2016

Posts: 10


Tuesday, July 11th 2017, 9:10pm

[SOLVED] FreeRTOS task missing or incorrectly shows stack overflow

Hi Guys - I'm not sure if this is a Segger problem, but maybe you've seen this before...
I'm using MCUXpresso from NXP on a Kinetis K64 (Cortex-M4F).
FreeRTOS 9.0.0 and ARM GCC tools of 1Q2017.
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 // Note: 1 causes FreeRTOS Eclipse plug-in to crash...
#define configTASK_RETURN_ADDRESS 0 // place 0 task return address on stack to help FreeRTOS-aware debugger (GDB unwind thread stack)
#define configCHECK_FOR_STACK_OVERFLOW 2 // FreeRTOS vTaskSwitchContext checks for stack overflow => void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName );
FreeRTOS Task Aware Debugger for GDB version 1.0.2 (201702241004)
J-Link V6.14

When I pause the application in the debugger, sometimes the MainLoop task is missing.
When visible MainLoop always erroneously shows stack overflow (verified all OK using uxTaskGetStackHighWaterMark, after I nearly had a heart attack).

Any ideas?
Best Regards, Dave

PS: I checked that no optimization was used (Arne pointed out this caused trouble in past).



Date of registration: Dec 2nd 2016

Posts: 10


Sunday, July 16th 2017, 2:30am

OK, problem is solved by adjusting FreeRTOS configuration; no idea why this is required:
#define configUSE_TRACE_FACILITY 1 // without this, FreeRTOS-aware debug task list can miss tasks and show bogus stack overflows


Super Moderator

Date of registration: Oct 16th 2015

Posts: 81


Monday, July 17th 2017, 2:14pm

Hello Dave,

the "Task List" in your screen shot has nothing to do with our task awareness feature.

Our feature only helps the Eclipse IDE to build up its pretty tree view of tasks. The task list results from a different plugin.
Probably this plugin gets confused if the structure of the task control block, which depends on various configuration settings, is different from what it expects.

Best regards

Similar threads