HOWTO Use FreeRTOS OS Awareness with S32Debugger and PEMicro

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

HOWTO Use FreeRTOS OS Awareness with S32Debugger and PEMicro

HOWTO Use FreeRTOS OS Awareness with S32Debugger and PEMicro

Purpose

 

This document holds information about how S32 Design Studio and S32Debugger probe or PE Micro Debug probe can be used to debug applications running on NXP’s S32 family processors from the operating system perspective using FreeRTOS Kernel awareness.

 

Abbreviations

Abbreviation

Description

RTOS

Real Time Operating System

RTD

Real-Time Drivers

 

Background

FreeRTOS is a market-leading open-source RTOS designed for microcontrollers and small microprocessors. It includes a kernel and a growing set of libraries.

In S32 Design Studio, FreeRTOS Kernel awareness allows you to debug your application from the operating system perspective.

Hardware Support

FreeRTOS OS Awareness support in S32 Design Studio is available for:

  • S32Z
  • S32E
  • S32G (Cortex-M7)

-S32R45 (Cortex-M7)

  • S32K1
  • S32K3 (K3xx and K396)
  • S32M2 (S32M24x)

 

OS Support

OSEK OS Awareness support is available only on Windows.

 

 

OS Information

The FreeRTOS download includes source code for every processor port, and every demo application. Currently, FreeRTOS support is available only for single-core projects.

 

The core RTOS code is contained in three files, which are called tasks.c, queue.c and list.c. These three files are in the FreeRTOS/Source directory. The same directory contains two optional files called timers.c and croutine.c which implement software timer and co-routine functionality respectively. Each supported processor architecture requires a small amount of architecture specific RTOS code. This is the RTOS portable layer, and it is located in the FreeRTOS/Source/Portable/[compiler]/[architecture] sub directories, where [compiler] and [architecture] are the compiler used to create the port, and the architecture on which the port runs, respectively. 

 

Document structure

The basic workflow for setting up and managing FreeRTOS OS Awareness projects in S32 Design Studio remains consistent, irrespective of the debug probe used. The universal steps are described in “How to use FreeRTOS OS Awareness with S32 Design Studio and S32Debugger probe” section. For FreeRTOS OS Awareness projects utilizing PE Micro debug probe, only the specific considerations will be highlighted.

 

How to use FreeRTOS OS Awareness with S32 Design Studio and S32Debugger probe

 

Prerequisites

Note: This HOWTo Guide describes the required steps for using FreeRTOS on a single-core example project for S32G399A Cortex-M7 in S32 Design Studio. Prerequisites might differ depending on the project hardware type.

 

Software environment

  • S32 Design Studio project or example project delivered with FreeRTOS imported in S32 Design Studio Workspace
  • S32G Development Package
  • S32 RTD Autosar 4.4 Version 4.0.0
  • S32G3 RTD Autosar 4.4 Version 4.0.0
  • S32G FreeRTOS 10.4.6 version 4.0

Hardware environment

Supported boards

  • S32G-PROCEVB-S PCB RevX3 SCH RevB1 (Daughter Board)
  • S32GRV-PLATEVB PCB RevA SCH RevB (Mother Board)
  • S32G-VNP-RDB3 PCB 53060 RevC SCH RevF

Connections

  • PB_08 is controlling the LED.

Debugger

  • The debugger (S32 Debugger) must be connected to J64 20-pin JTAG Cortex Debug connector.

 

 

Project setup

While in Design Studio, go to File -> New -> S32DS Project From Example  and select one of the existing single core S32 Design Studio Sample applications delivered with the NXP FreeRTOS or import your own S32 Design Studio project.

DanielBarbu_0-1724661560883.png

 

 

 

Select the desired project from the list of examples and click finish

DanielBarbu_1-1724661615849.png

 

 

Generating configuration

Before running the example a configuration needs to be generated. First go to Project Explorer View in S32 Design Studio and right-click the current project.

        Select the "S32 Configuration Tool" menu then click on the desired configuration tool (Pins, Clocks, Peripherals etc...).

        Clicking on any one of those will generate all the components. Make the desired changes (if any) then click on the "S32 Configuration Tool Update Code" button.

DanielBarbu_2-1724661662087.png

 

 

Building the project

Select the project in the S32 Design Studio Workspace and click on Build. Clicking this button will start the build using the preset build type. 

DanielBarbu_3-1724662059419.png

 

Debug configuration

Click on Debug Configurations

DanielBarbu_4-1724662086602.png

 

 

Setup the Debug Probe Connection for the project. Select either USB or Ethernet, depending upon your hardware setup. If USB is selected, the COM port for the S32 Debug Probe will automatically be detected (unless not connected or more than one probe is connected). If Ethernet is selected, then enter either the hostname (fsl + last 6 digits of MAC address) or IP address. See

‘S32_Debug_Probe_User_Guide.pdf’

({S32DS_installation_directory}/S32DS/tools/S32Debugger/Debugger/Docs/S32_Debug_Probe_User_Guid e.pdf) for more details on the setup of the S32 Debug Probe. 

DanielBarbu_5-1724662383668.png

 

 

Selecting FreeRTOS OS Awareness and starting debug

From the OS Awareness tab select “FreeRTOS” from the OS dropdown list and click Debug. 

DanielBarbu_6-1724662419542.png

 

 

FreeRTOS views

Navigate to go to Window -> Show View -> Other…  and select the FreeRTOS view

DanielBarbu_7-1724662582004.png

 

 

 

Using the Heap Usage, Queue List, Task List and Timer list views, Design Studio can display information about the tasks status on the target.

Heap usage view

DanielBarbu_8-1724662619380.png

 

 

Queue List view

Queues are the primary form of inter-task communications. They can be used to send messages between tasks, and between interrupts and tasks. In most cases they are used as thread safe FIFO (First In First Out) buffers with new data being sent to the back of the queue, although data can also be sent to the front.

DanielBarbu_9-1724662710143.png

 

Task List view

A real time application that uses an RTOS can be structured as a set of independent tasks. Each task executes within its own context with no coincidental dependency on other tasks within the system or the RTOS scheduler itself

 

 

DanielBarbu_10-1724662725433.png

 

Timer List view

A software timer (or just a 'timer') allows a function to be executed at a set time in the future. The function executed by the timer is called the timer's callback function. The time between a timer being started, and its callback function being executed, is called the timer's period. Put simply, the timer's callback function is executed when the timer's period expires.

Note, a software timer must be explicitly created before it can be used.

How to use FreeRTOS OS Awareness with S32 Design Studio and PE Micro Debug probe

 

Prerequisites

Note: This HOWTo Guide describes the required steps for using FreeRTOS on a single-core example project for S32K396 Cortex-M7 in S32 Design Studio. Prerequisites might differ depending on the project hardware type.

 

Software environment

  • S32 Design Studio project or example project delivered with the NXP FreeRTOS imported in S32 Design Studio Workspace
  • S32 Design Studio 3.5.6 development package with support for S32K396 devices: SW32K39x_S32DS_3.5.6_D2309
  • S32K396 RTD AUTOSAR 4.4 Version 3.0.0 Code Drop 02
  • FreeRTOS for S32K396 version 0.8.0

Hardware environment

  • •    Supported boards
  • X-S32K396-BGA-DCConnections
  • PB_08 is controlling the LED - PTH7 is controlling the LED_BLUE in X-S32K396-BGA-DC board - when HIGH LED is ON or when LOW LED is OFF
  • •     Debugger
  • The debugger (PE Micro Debugger) must be connected to J20 20-pin JTAG Cortex Debug connector

 

Project setup

Go to File -> New -> S32DS Project From Example 

Select the desired project from the list of examples delivered with PE Micro Debug probe support or import your own S32 Design Studio project and click finish

DanielBarbu_11-1724662794818.png

 

Generating configuration

 

Please refer to the steps described in the “Generating configuration” section from “How to use FreeRTOS OS Awareness with S32 Design Studio and S32Debugger probe”.

 

Building the project

Select the project in the S32 Design Studio Workspace and click on Build. Clicking this button will start the build using the preset build type. 

 

Debug configuration

Click on Debug Configurations.

Select the debug configuration associated with your current build configuration and click on the “PEmicro Debugger” tab. Verify proper interface and port and if the device is properly detected.

DanielBarbu_12-1724662836451.png

 

 

Selecting FreeRTOS OS Awareness and starting debug

From the OS Awareness tab select “FreeRTOS” from the OS dropdown list and click Debug

 

 

FreeRTOS views

Navigate to go to Window -> Show View -> Other…  and select the FreeRTOS view

Using the Heap Usage, Queue List, Task List and Timer list views, Design Studio can display information about the tasks status on the target.

 

Further details can be found in the “FreeRTOS views” section from “How to use FreeRTOS OS Awareness with S32 Design Studio and S32Debugger probe”

 

 

 

 

Revision history:

Revision no.

Revision date

Description

01

Nov 2023

Created document about how to use FreeRTOS OS Awareness in S32 Design

Studio with PE Micro and S32 Debug probes

 

 

无评分
版本历史
最后更新:
‎08-26-2024 02:07 AM
更新人: