AnsweredAssumed Answered

FreeRTOS TAD Runtime stat not working if optimization is used

Question asked by Martin Hollenweger on Apr 3, 2019
Latest reply on Apr 11, 2019 by Erich Styger

I have the following configuration:

MCPXpresso V10.3.1

LPC1519 CPU

FreeRTOS is configured to generate Runtime statistics

 

The Task List (FreeRTOS) is working ok when the Project is compiled with -O0.

But when i change to any other Optimization level the TAD plugin is not capabel to show the Runtime statistics

 

The TAD log for working case is:

 

"FreeRTOS Task Aware Debugger for GDB" version 1.0.8 (201810241449)
(c) 2016-2018 NXP Semiconductors, Inc.
==================================
09:32:35.762 INFO: [TadModel] DSF session ID 12 has started.
09:32:49.91 INFO: [TadState] TAD state changed: DEBUG_STARTED -> DEBUG_INIT_0 (RESUMED, USER_REQUEST)
09:32:49.321 INFO: [TadState] TAD state changed: DEBUG_INIT_0 -> DEBUG_INIT_1 (SUSPENDED, SIGNAL)
09:32:51.320 INFO: [TadState] TAD state changed: DEBUG_INIT_1 -> DEBUG_SUSPENDED (RESUMED, USER_REQUEST)
09:32:51.444 INFO: [TadState] TAD state changed: DEBUG_SUSPENDED -> DEBUG_SUSPENDED (SUSPENDED, BREAKPOINT)
09:32:59.513 INFO: [TadState] TAD state changed: DEBUG_SUSPENDED -> DEBUG_RESUMED (RESUMED, USER_REQUEST)
09:33:02.826 INFO: [TadState] TAD state changed: DEBUG_RESUMED -> READY (SUSPENDED, SIGNAL)
09:33:04.960 INFO: [Benchmark] Loading data for "Determine FreeRTOS version" has started.
09:33:04.967 ERROR: [VariableReader] Could not read variable expression: "&(FreeRTOSDebugConfig)".
09:33:04.973 ERROR: [VariableReader] Could not read variable expression: "sizeof(struct TaskControlBlock_t)".
09:33:04.984 ERROR: [VariableReader] Could not read variable expression: "&(((struct QueueDefinition *) 0)->pcTail)".
09:33:04.984 INFO: [TadModel] FreeRTOS version has been identified from available FreeRTOS symbols as 10,11.
09:33:04.984 INFO: [Benchmark] Loading data for "Determine FreeRTOS version" took 24 ms.
09:33:04.984 INFO: [Benchmark] Loading data for "Task List" has started.
09:33:04.991 ERROR: [VariableReader] Could not read variable expression: "sizeof(xQueueRegistry)".
09:33:04.991 ERROR: [QueueFactory] Queue registry size is zero! Each queue must be registered with vQueueAddToRegistry() and configQUEUE_REGISTRY_SIZE macro
must be greater than zero (found in FreeRTOSConfig.h)
09:33:06.888 INFO: [Benchmark] Loading data for "Task List" took 1903 ms.
09:33:16.511 INFO: [TadModel] DSF session ID 12 has ended.

 

while the error case is:

 

"FreeRTOS Task Aware Debugger for GDB" version 1.0.8 (201810241449)
(c) 2016-2018 NXP Semiconductors, Inc.
==================================
09:33:40.26 INFO: [TadModel] DSF session ID 13 has started.
09:33:53.624 INFO: [TadState] TAD state changed: DEBUG_STARTED -> DEBUG_INIT_0 (RESUMED, USER_REQUEST)
09:33:53.848 INFO: [TadState] TAD state changed: DEBUG_INIT_0 -> DEBUG_INIT_1 (SUSPENDED, SIGNAL)
09:33:55.424 INFO: [TadState] TAD state changed: DEBUG_INIT_1 -> DEBUG_SUSPENDED (RESUMED, USER_REQUEST)
09:33:55.531 INFO: [TadState] TAD state changed: DEBUG_SUSPENDED -> DEBUG_SUSPENDED (SUSPENDED, BREAKPOINT)
09:33:57.940 INFO: [TadState] TAD state changed: DEBUG_SUSPENDED -> DEBUG_RESUMED (RESUMED, USER_REQUEST)
09:33:59.588 INFO: [TadState] TAD state changed: DEBUG_RESUMED -> READY (SUSPENDED, SIGNAL)
09:34:00.894 INFO: [Benchmark] Loading data for "Determine FreeRTOS version" has started.
09:34:00.901 ERROR: [VariableReader] Could not read variable expression: "&(FreeRTOSDebugConfig)".
09:34:00.908 ERROR: [VariableReader] Could not read variable expression: "sizeof(struct TaskControlBlock_t)".
09:34:00.918 ERROR: [VariableReader] Could not read variable expression: "&(((struct QueueDefinition *) 0)->pcTail)".
09:34:00.919 INFO: [TadModel] FreeRTOS version has been identified from available FreeRTOS symbols as 10,11.
09:34:00.919 INFO: [Benchmark] Loading data for "Determine FreeRTOS version" took 25 ms.
09:34:00.919 INFO: [Benchmark] Loading data for "Task List" has started.
09:34:00.927 ERROR: [VariableReader] Could not read variable expression: "sizeof(xQueueRegistry)".
09:34:00.927 ERROR: [QueueFactory] Queue registry size is zero! Each queue must be registered with vQueueAddToRegistry() and configQUEUE_REGISTRY_SIZE macro
must be greater than zero (found in FreeRTOSConfig.h)
09:34:00.942 INFO: [FreeRTOS] FreeRTOS macro "configGENERATE_RUN_TIME_STATS" is disabled.
09:34:02.684 INFO: [Benchmark] Loading data for "Task List" took 1765 ms.
09:34:11.345 INFO: [TadModel] DSF session ID 13 has ended.

 

Some how the Plugin is thinking that configGENERATE_RUN_TIME_STATS is not define if the optimization is used.

Outcomes