NXP MCUXpresso IDE FreeRTOS User Manual

MCUXpresso IDE FreeRTOS Debug Guide
Rev. 11.3.0 — 2 April, 2021 User guide

NXP Semiconductors MCUXpresso IDE FreeRTOS Debug Guide

MCUXpresso IDE FreeRTOS Debug Guide -
2 April, 2021
Copyright © 2021 NXP Semiconductors
All rights reserved.
All information provided in this document is subject to legal disclaimers
Rev. 11.3.0 — 2 April, 2021
© 2021 NXP Semiconductors. All rights reserved.
ii
NXP Semiconductors MCUXpresso IDE FreeRTOS Debug Guide
1. Introduction .................................................................................................................. 1
2. LinkServer FreeRTOS Thread Aware Debugging ........................................................... 2
2.1. Behavior when thread aware debugging ............................................................. 4
2.2. Required Source Code Changes ........................................................................ 5
2.2.1. Modify – File tasks.c ................................................................................ 5
2.2.2. Modify – File FreeRTOSConfig.h ................................................................... 6
2.2.3. Create – New File freertos_tasks_c_additions.h ........................................... 6
2.3. Detection and placement of FreeRTOS Debug Config block ................................. 6
2.3.1. Debugger Messages ............................................................................... 6
2.3.2. Placement of Config block ....................................................................... 7
2.4. Switching between all-stop and non-stop debug modes ....................................... 8
3. FreeRTOS Task Aware Debug Views ........................................................................... 9
3.1. Showing the FreeRTOS TAD Views ................................................................... 9
3.2. Task List View ................................................................................................... 9
3.3. Queue List View .............................................................................................. 10
3.4. Timer List View ................................................................................................ 11
3.5. Heap Usage View ............................................................................................ 12
3.5.1. Memory Scheme in Use ........................................................................ 12
3.5.2. Heap Usage View Functionality ............................................................. 12
3.6. Timeouts ......................................................................................................... 13
4. Thread Aware Debugging with Other Debug Probes ..................................................... 14
4.1. PEmicro Probes ............................................................................................... 14
4.2. SEGGER J-Link Probes ................................................................................... 14
MCUXpresso IDE FreeRTOS Debug Guide -
All information provided in this document is subject to legal disclaimers
Rev. 11.3.0 — 2 April, 2021
© 2021 NXP Semiconductors. All rights reserved.
iii
NXP Semiconductors MCUXpresso IDE FreeRTOS Debug Guide

1. Introduction

Many of the examples provided as part of MCUXpresso SDK and LPCOpen packages are built around the FreeRTOS real time operating system. FreeRTOS is also a popular choice when developing MCU software applications for real products.
For more information on FreeRTOS please visit http://www.freertos.org This guide examines some of the functionality included in MCUXpresso IDE to assist you
in debugging applications built around FreeRTOS. It does not provide any information on FreeRTOS itself or on developing applications that use FreeRTOS.
MCUXpresso IDE FreeRTOS Debug Guide -
All information provided in this document is subject to legal disclaimers
Rev. 11.3.0 — 2 April, 2021
© 2021 NXP Semiconductors. All rights reserved.
1
NXP Semiconductors MCUXpresso IDE FreeRTOS Debug Guide

2. LinkServer FreeRTOS Thread Aware Debugging

When debugging via LinkServer debug probes, the MCUXpresso IDE debugger can provide FreeRTOS thread aware debug if :
1. Minor modifications are made to the application, so that configuration information required by the debugger is present in the image file.
2. Debugging is carried out in All-Stop mode (rather than the default Non-Stop mode). This selection is made when first making a debug connection for a particular project (or after deleting an existing launch configuration). For more details, please see the MCUXpresso IDE User Guide.
The source code modifications required are described in Required Source Code
Changes [5].
Note: Example projects supplied as part of MCUXpresso IDE compatible SDK packages should already have had these changes made to them.
Without these changes, or if Non-Stop debug mode is used, only the current thread will be seen in the Debug View, as shown in the below screenshot:
MCUXpresso IDE FreeRTOS Debug Guide -
All information provided in this document is subject to legal disclaimers
Rev. 11.3.0 — 2 April, 2021
© 2021 NXP Semiconductors. All rights reserved.
2
NXP Semiconductors MCUXpresso IDE FreeRTOS Debug Guide
However, once the necessary changes are made to the application source, and All-Stop debug mode is used, the Debug View will display each thread separately, as shown in the next screenshot:
MCUXpresso IDE FreeRTOS Debug Guide -
All information provided in this document is subject to legal disclaimers
Rev. 11.3.0 — 2 April, 2021
© 2021 NXP Semiconductors. All rights reserved.
3
Loading...
+ 12 hidden pages