Debugging issue - threads not shown in Debug Window

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
NiMc_1688136
Level 5
Level 5
10 sign-ins 50 questions asked 10 solutions authored

For my application I need to port app code that uses FreeRTOS function calls so I want to by bypass the WICED abstraction layer and use FreeRTOS directly.

When I build the project in debug mode and run it,  the GDB session does not show the task in the Debug window. If I pause execution, the GDB session disconnects (and I have to close openocd-all-brcm-libftdi.exe in task manager).

I can run a basic  app with the WICED abstraction layer + freeRTOS and it run in the debugger fine with all the tasks listed in the Debug window (top left of IDE).

Any ideas? Is there something that provides information for GDB to populate the Debug screen that I am missing?

0 Likes
1 Solution
NiMc_1688136
Level 5
Level 5
10 sign-ins 50 questions asked 10 solutions authored

I think I fixed it

I checked the openOCD log and found it said I was missing uxTopUsedPriority which is allows the debugger to find task information.

I forgot to mention that I also pupgraded to FreeRTOS v10.0.1 so uxTopUsedPriority was not defined. Within Tasks.c in the WICED SDK FreeRTOS v9, this is defined near line 358.

/*********/

/* This variable allows OpenOCD to read the thread lists properly */

PRIVILEGED_DATA static unsigned portBASE_TYPE uxTopUsedPriority __attribute__((used)) = configMAX_PRIORITIES;

/*********/

Also in tasks.c, near line 859, uxTopUsedPriority is also used...

/* This is used as an array index so must ensure it's not too large.  First

remove the privilege bit if one is present. */

/* WICED: Changed to uxTopUsedPriority from configMAX_PRIORITIES to ensure the uxTopUsedPriority is always linked - enabling OpenOCD to work properly */

if( uxPriority >= ( UBaseType_t ) uxTopUsedPriority )

{

uxPriority = ( UBaseType_t ) configMAX_PRIORITIES - ( UBaseType_t ) 1U;

}

else

{

mtCOVERAGE_TEST_MARKER();

}

Once I added this code, the debugger shows the tasks and it does not crash!

View solution in original post

1 Reply
NiMc_1688136
Level 5
Level 5
10 sign-ins 50 questions asked 10 solutions authored

I think I fixed it

I checked the openOCD log and found it said I was missing uxTopUsedPriority which is allows the debugger to find task information.

I forgot to mention that I also pupgraded to FreeRTOS v10.0.1 so uxTopUsedPriority was not defined. Within Tasks.c in the WICED SDK FreeRTOS v9, this is defined near line 358.

/*********/

/* This variable allows OpenOCD to read the thread lists properly */

PRIVILEGED_DATA static unsigned portBASE_TYPE uxTopUsedPriority __attribute__((used)) = configMAX_PRIORITIES;

/*********/

Also in tasks.c, near line 859, uxTopUsedPriority is also used...

/* This is used as an array index so must ensure it's not too large.  First

remove the privilege bit if one is present. */

/* WICED: Changed to uxTopUsedPriority from configMAX_PRIORITIES to ensure the uxTopUsedPriority is always linked - enabling OpenOCD to work properly */

if( uxPriority >= ( UBaseType_t ) uxTopUsedPriority )

{

uxPriority = ( UBaseType_t ) configMAX_PRIORITIES - ( UBaseType_t ) 1U;

}

else

{

mtCOVERAGE_TEST_MARKER();

}

Once I added this code, the debugger shows the tasks and it does not crash!