FreeRTOS Task Aware Debug issue for lwip_httpssrv_mbedTLS_freertos example code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

FreeRTOS Task Aware Debug issue for lwip_httpssrv_mbedTLS_freertos example code

5,840 次查看
Bhaskar_Thakker
Contributor II

I have been trying for using FreeRTOS Task Aware Debug features for the example project "lwip_httpssrv_mbedTLS_freertos" in SDK. During debugging of this code while trying to examine the Task List, Queue List, Timer List and Heap Usage from FreeRTOS menu option, none of these items is visible! The Information message "FreeRTOS has not been detected." is displayed in the FreeRTOS TAD Views section.

IDE Debug mode is All-stop and other care has been taken as described in MCUXpresso_IDE_FreeRTOS_Debug_Guide.pdf.

For other SDK examples for FreeRTOS, there are no issues for FreeRTOS Task Aware Debug.

I would like to know is there any specific settings missing for "lwip_httpssrv_mbedTLS_freertos" project example in achieving FreeRTOS Task Aware Debug views?

0 项奖励
回复
11 回复数

5,220 次查看
albert1337
Contributor I

Hi all,

 

I have the same problem, what could be cause of the problem?

 

0 项奖励
回复

5,819 次查看
ErichStyger
Specialist I

No, other modules should not affect it. Most common cause is the removal of the struct in freertos_tasks_c_additions.h.

Can you check your linker map file if the array FreeRTOSDebugConfig[] is still present and linked with the application and not removed?

0 项奖励
回复

5,809 次查看
Bhaskar_Thakker
Contributor II

I have verified for FreeRTOSDebugConfig[] in the linker map file. 

 .rodata 0x0004f4a4 0x1c ./freertos/freertos_kernel/tasks.o
0x0004f4a4 portArch_Name
0x0004f4a8 FreeRTOSDebugConfig 

0 项奖励
回复

5,804 次查看
ErichStyger
Specialist I

can you check what the console output for TAD is?

ErichS_0-1628598906694.png

 

0 项奖励
回复

5,797 次查看
Bhaskar_Thakker
Contributor II

Debug console for TAD shows error as following. 

18:14:55.220 ERROR: [VariableReader] Could not read variable expression: "sizeof(pxReadyTasksLists)".

 

5,791 次查看
ErichStyger
Specialist I

Have you turned on LTO in the linker?

Check if pxReadyTaskList is present in your linker map file to be sure.

What I have is this in tasks.c (around line 360):

/* Lists for ready and blocked tasks. --------------------
 * xDelayedTaskList1 and xDelayedTaskList2 could be move to function scople but
 * doing so breaks some kernel aware debuggers and debuggers that rely on removing
 * the static qualifier. */
#if configLTO_HELPER /* << EST */
  /* If using -lto (Link Time Optimization), the linker might replace/remove the names of the following variables.
   * If using a FreeRTOS Kernel aware debugger (e.g. Segger FreeRTOS task aware plugin), then the debugger won't be able to see the symbols and will fail.
   * Therefore (more as of a hack) the symbols are defined with external linkage, even if not used from other modules.
   * See https://mcuoneclipse.com/2017/07/27/troubleshooting-tips-for-freertos-thread-aware-debugging-in-eclipse/
   */
  PRIVILEGED_DATA /*static*/ List_t pxReadyTasksLists[ configMAX_PRIORITIES ];/*< Prioritised ready tasks. */
  PRIVILEGED_DATA /*static*/ List_t xDelayedTaskList1;            /*< Delayed tasks. */
  PRIVILEGED_DATA /*static*/ List_t xDelayedTaskList2;            /*< Delayed tasks (two lists are used - one for delays that have overflowed the current tick count. */
  PRIVILEGED_DATA /*static*/ List_t * volatile pxDelayedTaskList;       /*< Points to the delayed task list currently being used. */
  PRIVILEGED_DATA /*static*/ List_t * volatile pxOverflowDelayedTaskList;   /*< Points to the delayed task list currently being used to hold tasks that have overflowed the current tick count. */
  PRIVILEGED_DATA /*static*/ List_t xPendingReadyList;            /*< Tasks that have been readied while the scheduler was suspended.  They will be moved to the ready list when the scheduler is resumed. */
#else
 PRIVILEGED_DATA static List_t pxReadyTasksLists[ configMAX_PRIORITIES ];/*< Prioritised ready tasks. */
  PRIVILEGED_DATA static List_t xDelayedTaskList1;            /*< Delayed tasks. */
  PRIVILEGED_DATA static List_t xDelayedTaskList2;            /*< Delayed tasks (two lists are used - one for delays that have overflowed the current tick count. */
  PRIVILEGED_DATA static List_t * volatile pxDelayedTaskList;       /*< Points to the delayed task list currently being used. */
  PRIVILEGED_DATA static List_t * volatile pxOverflowDelayedTaskList;   /*< Points to the delayed task list currently being used to hold tasks that have overflowed the current tick count. */
  PRIVILEGED_DATA static List_t xPendingReadyList;            /*< Tasks that have been readied while the scheduler was suspended.  They will be moved to the ready list when the scheduler is resumed. */
#endif

Basically as noted in the comment and if I want to use LTO or other aggressive optimizations, I use external linkage declarations and not static ones.

I hope this helps,

Erich

0 项奖励
回复

5,781 次查看
Bhaskar_Thakker
Contributor II

I have checked for pxReadyTaskList in linker map file. It is not present.

LTO is not turned ON in linker settings.

If I turn it ON, I am getting errors during compilation.

Bhaskar_Thakker_0-1628658220713.png

 

0 项奖励
回复

5,831 次查看
ErichStyger
Specialist I

What debug connection/probe are you using?

https://mcuoneclipse.com/2017/07/27/troubleshooting-tips-for-freertos-thread-aware-debugging-in-ecli... provides some check points.

I hope this helps,

Erich

0 项奖励
回复

5,830 次查看
Bhaskar_Thakker
Contributor II

Thanks for your notice to the question.

I am using CMSIS-DAP probe on LPC-Link2.

5,826 次查看
ErichStyger
Specialist I

The 'all-stop' mode is relevant to the thread-awareness in the 'Debug' view only.

If it cannot show things in the other views, then most likely the IDE does not find the necessary symbols in the application. There could be several reasons for this, including the compiler removing some unused symbols.

0 项奖励
回复

5,818 次查看
Bhaskar_Thakker
Contributor II

That may be the case.

I have taken care for the guidelines in the following link. 

Troubleshooting Tips for FreeRTOS Thread Aware Debugging in Eclipse - DZone IoT

The optimization level is None in my project setting.

Are there any chances that since the project is configured for mbedTLS in SDK, it may be affecting for TAD?