Enabling System View for Connectivity Software Stack in QN9080CDK

Document created by Edgar Eduardo Lomeli Gonzalez Employee on Oct 17, 2018Last modified by Gerardo Rodríguez on Jan 8, 2019
Version 6Show Document
  • View in full screen mode

Introduction

This document describes the steps needed to enable System View tool emphasizing in connectivity software stack for the QN9080CDK MCU.

 

Software Requirements

  1. QN908XCDK SDK 2.2.0
  2. SystemView Software
  3. J-Link Software and Documentation Pack  

 

Hardware Requirements

  1. QN9080CDK Board with J-Link debug interface

 

Enabling SystemView in IAR Embedded Workbench IDE

 

1. Unzip your QN908XCDK SDK. Open your desired project from:<SDK_install_path>/boards/qn908xcdk/wireless_examples/<Choose_your_project>/freertos/iar/<Your_project.eww>

 

2. Select the project in the workspace, press the right mouse button and select “Add->Add Group...” option

 

 

 

3. Create a new group called “SEGGER”, click on the “OK” button. Repeat the step 1 and create other groups called “Config” and “FreeRTOS_SEGGER”.

 

 

The workspace will be updated as shown below

 

 

 

4. Create folders called “SEGGER”, “Config” and “FreeRTOS_SEGGER” in the Windows directory at the following path:

    <QN9080_SDK_root>/boards/qn908xcdk/wireless_examples/bluetooth/<your_example>/freertos

 

 

 

5. Add the following files in the recently created folders (SEGGER, Config and FreeRTOS_SEGGER) on Windows directory (the default SysView installation path is C:\Program Files (x86)\SEGGER\SystemView_V252c):

 

  • For the SEGGER folder:

       All files located at <SysView_installation_path>\Src\SEGGER

 

  • For the Config folder:

      All files located at <SysView_installation_path>\Src\Config

 

  • For the FreeRTOS_SEGGER folder:

      <SysView_installation_path>\Src\Sample\FreeRTOSV9\SEGGER_SYSVIEW_FreeRTOS.c

      <SysView_installation_path>\Src\Sample\FreeRTOSV9\SEGGER_SYSVIEW_FreeRTOS.h

      <SysView_installation_path>\Src\Sample\FreeRTOSV9\Config\SEGGER_SYSVIEW_Config_FreeRTOS.c

 

 

6. Go to the workspace and click the right mouse button on “SEGGER”, “Config” and “FreeRTOS_SEGGER” groups, then select “Add->Add Files...” option. Add the following files:

 

  • For the SEGGER group: 

       All files in <QN9080_SDK_root>/boards/qn908xcdk/wireless_examples/bluetooth/<your_example>/freertos/SEGGER folder 

 

  • For the Config group:

       All files in <QN9080_SDK_root>/boards/qn908xcdk/wireless_examples/bluetooth/<your_example>/freertos/Config folder

 

  • For the FreeRTOS_SEGGER group:

       All files in <QN9080_SDK_root>/boards/qn908xcdk/wireless_examples/bluetooth/<your_example>/freertos/FreeRTOS_SEGGER folder

 

The workspace will be updated as shown in the picture below

 

 

 

7. Select the project in the workspace and press Alt + F7. Go to “C/C++ Compiler” window and select “Preprocessor”. Include in “Additional include directories” view the following paths:

 

  • $PROJ_DIR$ /../Config
  • $PROJ_DIR$ /../FreeRTOS_SEGGER
  • $PROJ_DIR$ /../SEGGER

 

 

 

8. Go to “Assembler”, click on “Preprocessor”. Include the last paths on “Additional include directories” view as shown below. Click the OK button.

 

 

9. Replace the following files in the workspace with the files attached in this post (IAR files.zip). Make sure that each new file is located on the same path as the respectively last one.

 

  • freertos/FreeRTOS.h
  • freertos/task.h
  • freertos/tasks.c
  • freertos/portable/portasm.s
  • freertos/portable/port.c
  • freertos/portable/portmacro.h

 

10. Add #include "SEGGER_SYSVIEW_FreeRTOS.h" at the end of the FreeRTOSConfig.h file located at source/FreeRTOSConfig.h in the workspace.

 

 

 

11. Search the “SEGGER_SYSVIEW_Config_FreeRTOS.c” file at FreeRTOS_SEGGER folder in the workspace. Modify the SYSVIEW_RAM_BASE value to the lowest RAM address (default 0x20000000 in QN9080) and add an extern declaration to the SystemCoreClock variable:

extern uint32_t SystemCoreClock;

 

 

 

12. Search the “fsl_os_abstraction_free_rtos.c” file at framework/OSAbstraction folder in the workspace. Add #include "SEGGER_SYSVIEW.h" at the top of the file. Search the main function and add the following call to function inside:

 

SEGGER_SYSVIEW_Conf();
SEGGER_SYSVIEW_Start();

 

 

 

 13. Build and run your example. Run SystemView in your PC.

 

 

Enabling SystemView in MCUXpresso IDE

1. Install your QN908XCDK SDK in MCUXpresso IDE and import any freertos example from "wireless_examples" folder. 

2. Select the project in the workspace, press the right mouse button and select "New->Source Folder" option

 

 

3. Create a new folder called “SEGGER”, click on the “Finish” button. Repeat the step 1 and create other folders called “Config” and “FreeRTOS_SEGGER”.

 

 

The workspace will be updated as shown below

 

 

4. Add the following files in the SEGGER, Config and FreeRTOS_SEGGER folders on the workspace dragging and dropping (the default SysView installation path is C:\Program Files (x86)\SEGGER\SystemView_V252c):

 

  • For the SEGGER folder:

       All files located at <SysView_installation_path>\Src\SEGGER

 

  • For the Config folder:

      All files located at <SysView_installation_path>\Src\Config

 

  • For the FreeRTOS_SEGGER folder:

      <SysView_installation_path>\Src\Sample\FreeRTOSV9\SEGGER_SYSVIEW_FreeRTOS.c

      <SysView_installation_path>\Src\Sample\FreeRTOSV9\SEGGER_SYSVIEW_FreeRTOS.h

      <SysView_installation_path>\Src\Sample\FreeRTOSV9\Config\SEGGER_SYSVIEW_Config_FreeRTOS.c

 

When dragging and dropping, a new window will appear. Select "Copy files" in the button group and click "OK".

 

 

 

5. Select the project in the workspace, then go to "Project->Properties". The project properties window will be deployed.

 

 

 

6. Go to "C/C++ Build->Settings->Tool Settings->MCU C Compiler->Includes" view. Click on the "Green plus icon" in the "Include paths" view. A new window will appear, click on "Workspace..." button.

 

 

 

7. Select SEGGER, Config and FreeRTOS_SEGGER folders and click "OK", then click "Apply and Close" in the Project Properties window.

 

.

 

8. Replace the following files in the workspace with the files attached in this post (MCUXpresso files.zip).

 

  • freertos/FreeRTOS.h
  • freertos/task.h
  • freertos/tasks.c
  • freertos/port.c
  • freertos/portmacro.h

 

9. Add #include "SEGGER_SYSVIEW_FreeRTOS.h" at the end of the FreeRTOSConfig.h file located at source/FreeRTOSConfig.h in the workspace.

 

 

10. Search the “SEGGER_SYSVIEW_Config_FreeRTOS.c” file at FreeRTOS_SEGGER folder in the workspace. Modify the SYSVIEW_RAM_BASE value to the lowest RAM address (default 0x20000000 in QN9080) and add an extern declaration to the SystemCoreClock variable:

extern uint32_t SystemCoreClock;

 

11. Search the “fsl_os_abstraction_free_rtos.c” file at framework/OSAbstraction/Source folder in the workspace. Add #include "SEGGER_SYSVIEW.h" at the top of the file. Search the main function and add the following call to function inside:

SEGGER_SYSVIEW_Conf();
SEGGER_SYSVIEW_Start();

 

12. Build and run your example. Run SystemView in your PC.

Attachments

Outcomes