S32 Design Studio Knowledge Base

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32 Design Studio Knowledge Base

Discussions

Sort by:
Suppose you created an application project for one MCU (S32K144, for example), but your requirements changed, or perhaps you are reusing a previous project to start a new project on a different MCU (derivative from same family). If you are working with the S32 SDK, there is a way to do it. We have detailed the steps in this document. 1) Open the project to be modified and select the C/C++ perspective, ensure that the Processor Expert views are shown 2) From the Components Library, Processors tab, select the new MCU derivative 3) Either double-click OR right-click and select 'Add to project', to add the new processor to your components list for your project. Be sure to select just one of the pin packages, whichever is appropriate for you application. 4) From the Component Inspector*, you will see a message in red text asking if you would like to switch into the configuration for the new processor. Click on the button 'Switch Configuration'. *may have to select pin_mux:PinSettings in the Components view for the project to see the message 5) Open the Project Properties, either select from File menu or right-click on project name and select from the menu. Then go to C/C++ Build -> Settings -> Standard S32DS C Compiler -> Includes and delete all include paths starting with $(S32K1**_SDK_VER_PATH). Repeat this step for the Standard S32DS Assembler -> General include paths. Note: For all changes in C/C++ Build -> Settings, make sure to repeat for all build configurations (RAM, FLASH, Debug, Release, etc.). 6) The paths to the SDK should now be gone. The result should look similar to this: 7) In Standard S32DS C Compiler -> Preprocessor settings, change the defined symbol to the one which is appropriate for the new MCU and click OK. (e.g. CPU_S32K142 for S32K142, CPU_S32K148 for S32K148, etc.) If you are not sure what should be here, then create a new empty project for the new MCU and refer to the settings there. 😎 The Preprocessor setting after the change 9) Click on the 'Generate Processor Expert Code' button in the Components view for your project 10) From Project Explorer, remove the startup and linker files from Project Settings folder 11) Copy startup and linker files for the new MCU from <SDK_PATH>/platform/devices/<CPU>/startup/<Compiler> and <SDK_PATH>/platform/devices/<CPU>/linker/<Compiler> 12) Open the Project Properties, then C/C++ Build -> Settings -> Standard S32DS C Linker -> General and update the linker file path to reflect the new filename and click OK. (in this case: S32K144_64_flash.id to S32K142_32_flash.id) 13) After the change 14) Perform a Clean and a Build operations of the project. 15) Update the device in the debug configurations Now you can change your MCU derivatives!
View full article
Getting started with APEX2 S32DS: Getting Started - APEX2 Graph Tool Tutorial  Getting started with ISP S32DS: Getting Started - ISP Graph Tool Tutorial 
View full article
This short video demonstrates how you can get the RTD version 5.0.0 from your NXP User Account and then install it on top of S32 Design Studio 3.6.0 Afterwords, a simple IO example is shown to exercise the Headers and Source Code configuration & generation & build
View full article
This document shows the step-by-step process for creating a simple blinking LED application for the S32Z27x family using the S32 RTD non-AUTOSAR drivers. This example used for the S32Z27x-DC EVB, which is connected via an Ethernet connection through the S32 Debugger.   Preparation  Setup the software tools  Install S32 Design Studio for S32 Platform   Install the S32Z2/E2 development package and the S32ZE RTD AUTOSAR R21-11 Version 0.9.0 P01 Both of these are required for the S32 Configuration Tools.    Launch S32 Design Studio for S32 Platform  Procedure    New S32DS Project    OR                    Provide a name for the project, for example 'Blinking_LED_RTD_No_AUTOSAR'. The name must be entered with no space characters.     Expand the Family ‘S32Z27x’, and Select ‘S32Z270 (Boot core_ R52_0_0)’      Click '…' button next to SDKs    Check box next to PlatformSDK_S32ZE_2022_10_S32Z270_R52_0_0_LS (or whichever latest SDK for the S32M27x is installed). Click OK     Click "Finish" and wait for the project generation wizard to complete. Then, expand the project within the "Project Explorer" view to show its contents.      To control the LED on the board, some configuration needs to be performed within the Pins Tool. There are several ways to do this. One simple way is to double-click on the .MEX file.    By default, the Pins Tool will be presented. The S32Z27x DC EVB has user D12 LED connected to the PA_01 pin on the S32Z270 device.    To configure this pin, select the "Peripheral Signals" tab to the left of the Pins Tool perspective layout. Locate and open the SIUL2_0 from the peripheral signals tab, and from the drop-down menu, select the "gpio,1 PA_01" option as shown in the following image.  We are using Siul2_0 for GPIO usage, so we are routing the gpio,1 –> PA_01 GPIO signal to this pin.       The Direction required! menu will appear. Select Output then OK.    In Routing Details view, notice a new line has been added and highlighted in yellow.    Add ‘LED’ to the Label and Identifier columns for the Siul2_0, gpio-1 pin.    Code Preview    Go to Peripherals tool and add Gpio_Dio to enable LED blinking, it adjacent to the user LED on S32Z270 EVB.    Click on the Peripherals Tool icon in the Eclipse Perspective navigation bar.  In the Components view, click on the ‘Add a new configuration component…' button in the Drivers category. This will bring up a list of all configuration components.    Locate and select the 'Siul2_Dio' component from the list and click OK. Don't worry about the warning message – it's only indicating that the driver isn't already part of the current project. The associated driver package will be added automatically.   Note: it may be necessary to change the selection at the top from 'Present in the toolchain project' to 'All'.  The Siul2_Dio driver provides services for reading and writing to/from DIO Channels.     Now, form the toolbar selection menu at the top, select and double click on the symbol as shown as below:     Then, from the global settings window, for ComponentGenerationMethod from the drop down menu select “FunctionalGroups” from the drop down menu as shown below:     The Siul2_Dio driver requires no further configuration. Click Save to store all changes to the .MEX file.       Now. click ‘Update Code’ from the menu bar.  Now the device configurations are complete and the RTD configuration code can be generated. Click ‘Update Code’ from the menu bar.     To control the output pin which was just configured, some application code will need to be written. Return to the ‘C/C++’ perspective.    If the 'src' folder is not already open in the project window, click the '>' symbol next to it to show its contents. Then, double-click the 'main.c' file to open it. This is where you will add the application code.    To control the pin, it needs to be 'initialized' using the configuration information generated from the S32 Configuration tools. To do this, add the following line to the 'main' function after the comment 'Write your code here':         /* Initialize all pins using the Port driver */       Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);        Now, add logic to turn the LED on and off with some delays in between to make it visible blinking. Make sure the delays are long enough to be perceptible.     Add line to initialize variable uint8 i = 0;  Add line to declare variable level: volatile uint8 level;  Change the code within the provided for loop, and add the following lines:     /*logic for blinking LED 10 times*/     for (; i<10; i++)       {           Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 1U);         level = Siul2_Dio_Ip_ReadPin(LED_PORT, LED_PIN);           TestDelay(480000);           Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 0U);         level = Siul2_Dio_Ip_ReadPin(LED_PORT, LED_PIN);           TestDelay(480000);       }     Before the 'main' function, add a delay function as follows:  void TestDelay (uint32 delay);   void TestDelay (uint32 delay)   {     static volatile uint32 DelayTimer = 0;    while (DelayTimer<delay)      {          DelayTimer++;      }      DelayTimer=0;   }     Update the includes lines at the top of the main.c file to include the headers for the drivers used in the application:    Remove   #include "Mcal.h"  Add   #include "Siul2_Port_Ip.h"   #include "Siul2_Dio_Ip.h"         Build 'Blinking_LED_RTD_No_AUTOSAR'. Select the project name in 'C/C++ Projects' view and then press 'Build'.    After the build completes, check that there are no errors.       Open Debug Configurations and select 'Blinking_LED_RTD_No_AUTOSAR_Debug_RAM'. Make sure to select the configuration which matches the build type performed, otherwise it may report an error if the build output doesn’t exist.       Now, you need to Select the Interface (Ethernet or USB) by which the S32 Debug Probe is connected.     If connected via USB and this option is selected for interface, then the COM port will be detected automatically (in the rare event where 2 or more S32 Debug Probes are connected via USB to the host PC, then it may be necessary to select which COM port is correct for the probe which is connected to the EVB)    If connected via Ethernet, enter the IP address of the probe. See the S32 Debug Probe User Manual for ways to determine the IP address.    Click apply and Debug  To see the LED blink, click ‘Resume'.     This code as it is will blink the LED 10 times, you can make changes in for loop condition to blink it infinitely.     
View full article
This document details the steps to program external EEPROM with the 32 reset configuration bits in support of the 'Boot from serial RCON' method detailed in the device reference manual. The Python scripts used for this task are designed and tested to work on the EVBs, where EEPROM hardware is connected via I2C.(Serial EEPROM is not implemented on all boards).   The RCON can be set by the following:    Fuses (internal to the device)  Parallel (GPIO pins/DIP Switches on EVB)  Serial (EEPROM connected via I2C)    The Serial option can be programmed using a debug probe connected via JTAG. This enables the RCON to be controlled remotely, assuming the debug probe is setup to allow remote connections.  The images shown throughout this document are of the S32G274A device implementation and are provided for illustration purposes.               Preparation    Install S32 Design Studio IDE  Use the S32DS Extensions and Updates menu to install the Development Package for the device subject to debugging. This is important as the Development Packages add the S32 Debugger support which provides access to the EEPROM programming capabilities via I2C of the S32 Debug Probe.  Connect the S32 Debug Probe to the EVB and the host PC containing S32 Design Studio installation.  Set BOOTMOD pins to boot from RCON    Set BOOT_CFG[8]=1 on the EVB, for serial RCON mode   Procedure    Depending on the way the device used and how the {device name}_i2c_RCON.py is edited, user must use the old procedure on the new one. Both detailed below. To choose between the Old procedure and the new procedure, you must check in the {device_name}_i2c_RCON.py if variables like “INTERACTIVE_MODE” and “RCON_DATA” exist. The {device_name}_i2c_RCON.py can be found in: {INSTALL_DIR}…S32DS/tools/S32Debugger/Debugger/scripts/{device_name}/ {device_name_part_name}_i2c_RCON.py If the variables exist, please use the old procedure. If the variables were removed, please use the new procedure. I.  Old procedure ( If “INTERACTIVE_MODE” variable still exists)   Open cmd window to the S32 Debugger folder where the device-specific scripts are located. ../S32Debugger/Debugger/Scripts/{device_name/part_number} Set Python path so correct version is used (if not already set in env vars)   set PYTHONPATH=C:\NXP\S32DS.3.5\S32DS\build_tools\msys32\mingw32\lib\python2.7;C:\N XP\S32DS.3.5\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages   Edit the python script to adjust the value to be programmed to RCON, {device_name}_i2c_RCON.py. Note: The listed examples show only the minimum values required to configure each of the external memory types. Additional settings may be required for your specific application.   Adjust RCON_DATA for the configuration you wish to program. Do not adjust RCON_ADDR. Adjust S32DBG_IP for the IP address of your S32 Debug Probe. Adjust INTERACTIVE_MODE i. Set True, if desired to be prompted in the command window to enter RCON_DATA      ii. Set False, if desried to have script automatically enter RCON_DATA, based on the value set     within the file. Adjust _SOC_NAME as appropriate for the specific device you are using. The valid options are defined in {device_name}_context.py Enter the command to start GDB, passing in the RCON Python script:   Windows OS: ../ S32DS\tools\gdb-arm\arm32-eabi\bin/arm-none-eabi-gdb-py.exe -x {device_name}_i2c_RCON.py OR ../ S32DS\tools\gdb-arm\arm64-eabi\bin/arm-none-eabi-gdb-py.exe -x {device_name}_i2c_RCON.py Linux OS: arm-none-eabi-gdb-py -x {device_name}_i2c_RCON.py   If everything worked properly, then the value you programmed will be displated to the screen.   To exit GDB, enter ‘quit’. II.  New Procedure ( If “INTERACTIVE_MODE” variable was deleted)   Set Python path so correct version is used (if not already set in env vars)  set PYTHONPATH=C:\NXP\S32DS.3.5\S32DS\build_tools\msys32\mingw32\lib\python2.7;C:\N XP\S32DS.3.5\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages  Start GDB Server. (…\S32Debugger\Debugger\Server\gta\gta.exe)   Start Command Prompt and enter the command to start GDB with python: Example:   C:\NXP\S32DS.3.5_230912_devpck\S32DS\tools\gdb-arm\arm32eabi\bin\arm-none-eabi-gdb-py.exe Linux OS: arm-none-eabi-gdb-py     In s32rcon.py ( C:\NXP\S32DS.3.5_230912_devpck\S32DS\tools\S32Debugger\Deb ugger\scripts\gdb_extensions\rcon\s32rcon.py😞 Edit connection parameters (Probe IP, GDB server port, JTAG speed, etc.) Edit _RCON_SCRIPT parameter with absolute path to the desired I2C RCON script for the desired board: Example: _RCON_SCRIPT = " C:/NXP/S32DS.3.5_230912_devpck/S32DS/tools/S32Debugger/Deb ugger/scripts/s32g2xx/ s32g274a_i2c_RCON.py"      c. Source s32rcon.py in GDB. Example: source C:/NXP/S32DS.3.5_230912_devpck/S32DS/tools/S32Debugger/Deb ugger/scripts/gdb_extensions/rcon/s32rcon.py     d. Run command py rcon() in GDB. OBS:  Steps a, b can be done after c directly from GDB, using GDB py commands: Examples:  py _GDB_SERVER_PORT=45000  py _RCON_SCRIPT="C:/NXP/S32DS.3.5_230912_devpck/S32DS/tools/S32Debugger/Debu gger/scripts/s32g2xx/ s32g274a_i2c_RCON.py"   User can now use the available commands, like rcon_help, rcon_read, rcon_write to interact with the EEPROM.   User can write [command] -h for more information and mandatory parameters of the command.   User can write ‘quit’ to exit the S32 RCON services.
View full article
NXP devices can be secured either with password or challenge and response authentication scheme. The S32 Debugger included within the S32 Design Studio for S32 Platform IDE with the S32 Debug Probe provides the ability to debug a secured device. This document provides only the necessary commands specific to launching a debug session on secured NXP devices.. Once the device is unsecured, it will remain so until a power-on-reset or destructive reset occurs. The images shown throughout this document are of the S32R45 device implementation and are provided for illustration purposes. Preparation Setup the software tools Install S32 Design Studio for S32 Platform  Install the Development Package for the device you are debugging. This package is important as it contains the S32 Debugger support component           Setup the hardware Confirm the setup of the evaluation board.  i     Connect the power supply cable Setup the S32 Debug Probe. Refer to the S32 Debug Probe User Manual for installation instructions. i      Connect the S32 Debug Probe to the evaluation board via JTAG cable.  ii     Connect the S32 Debug Probe to the host PC via USB cable OR via Ethernet cable (via LAN or directly connected and configured for static IP address) and power supply connected to USB port. Launch S32 Design Studio for S32 Platform Open existing project or create a new project and check that it successfully builds. If creating a new project, be sure the S32 Debugger is selected in the New Project Wizard. Procedure Before starting a secure debug session, first confirm that the device is indeed secure. Once one core is unlocked, all cores are unlocked and will remain so until a power-on-reset or destructive reset occurs. After confirming the device is secured, then select the procedure which applies to the lifecycle of the SoC to be debugged.    Check the state of the SoC   Open a command window from the installation directory containing the GTA server:              {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\Server\gta\ Execute the following command:              gta.exe -t s32dbg   This will invoke a utility that launces a new GTA server instance and then communicates with the target via the S32 Debug Probe and will request a set of properties of the SoC. These properties are available to be read regardless of security state. The GTA server will close once the information is returned.   As is shown above, the Debug state is ‘Locked’. This means it is secured and the secure debug steps outlined within this document must be used. There is no way to determine the security enabled on the SoC, so this should be known by the user in order to select the correct authentication scheme. Proceed from here using the method (Password or Challenge & Response) which applies for your SoC security configuration.    Password   From S32DS, open the Debug Configurations menu, select the configuration for the project you wish to debug, select the ‘Debugger’ tab and scroll down until the ‘Secure debugging’ section is visible.   Check the box for ‘Enable secure debugging’ and then select the Debugging type ‘Password’.   Click Debug. When the debug session initialization reaches the stage where the password must be entered to unsecure the SoC, the following menu will appear.   Enter the password. This is a 16-byte value entered as a hexadecimal without the leading ‘0x’. If you choose to check the box for ‘Store keyword in secure storage’, the value entered will be stored within the Eclipse secure storage and will remain available for the duration of the current S32DS instance. This saves the user from having to enter the password again, should the security state of the SoC becomes once again secured.   Now the debug session initialization will complete and debug activities may be executed as with any SoC which is not secured. After terminating the debug session, the GTA utility can be used again to see the new state of the SoC.   This utility cannot be executed while the debug session is running. It launches a new instance of the GTA server, which would be blocked by the already running debug session.   Challenge & Response   For the Challenge & Response security scheme, the included Secure Keys Registry must be used. From the S32DS menu bar, select Window -> Show View -> Other -> ‘Secure Keys Registry’.   The Secure Keys Registry will now appear in the current perspective.   Since there is no current key stored in the Secure Keys local storage, a new key must be registered. Click on ‘Register Key’. This will bring up the Secure Keys Registry command dialog.   Now enter the ADKP value (Application Debug Key/Password) which is correct for the SoC to be debugged.                  The Secure Keys Registry utility uses the same functionality as the command-line GTA utility shown earlier to check the state of the SoC. This will read the UID from the Soc. Click Connect to load the UID (Device Unique ID) from the SoC. The UID is associated with the ADKP when it is registered within the Secure Keys local storage for easier access in the future.   Click OK to complete the registration of the new key.   Now the key is registered, the debug session can be setup and started.   Open the Debug Configurations menu, select the configuration for the project you wish to debug, select the ‘Debugger’ tab and scroll down until the ‘Secure debugging’ section is visible.   Check the box for ‘Enable secure debugging’ and then select the Debugging type ‘Challenge & Response’.   Click Debug. Now the debug session initialization will complete and debug activities may be executed as with any SoC which is not secured. During debug session initialization, the key that was registered will be used to unsecure the SoC. After terminating the debug session, the GTA utility used earlier can be used again to see the new state of the SoC.   This utility cannot be executed while the debug session is running. It launches a new instance of the GTA server, which would be blocked by the already running debug session.   Smart Card Authentication   When using a smart card, the user will need to authenticate with it. IDE has a mechanism to provide the user password for this purpose.    This mechanism is available from any S32 Debug Configuration, as well as Secure Key Registry views, and will be triggered anytime the IDE will call a command that requires authentication on the connected smart card (e.g.: registering a key, fetching the registered keys and trying to perform secure debug with challenge & response.)   Troubleshooting There are some messages displayed when things go wrong that can help to identify the cause of the issue. Due to the sensitive nature of the Secure Debug, the error indications detailed below are inherently general and are provided as a guide for interpreting them to determine the likely cause.   Debug session started when SoC is still secured There is an error message reported in the S32 Debugger Console to indicate the SoC is still secure. To see this message the GDB Server log must be enabled in Debug Configurations -> Debugger tab, GDB Server section:   When this error is incurred, first indication is popup error message for Error code 102:              Next, the following text will be displayed in the S32 Debugger console window:   If needed, select this view from the menu:   In addition, if GDB Traces log is enabled, the following error message can be found in the gdb traces console view:   Enable the GDB Traces log in Window->Preferences, then search on GDB:   To select the view from console:                 Incorrect Challenge/Response Or Password If the SoC is setup for Challenge & Response security scheme, but Password security scheme is selected in Debug Configuration, or Challenge & Response is correctly selected but the wrong ADKP value is provided, below are the expected error messages. The result is same if the SoC is setup for Password and either Challenge & Response or wrong password is used.   First error message is Error code 601:   Next, the gdb traces console displays the following error:   There is no error displayed in the S32 Debugger console. Make sure you have selected the appropriate authentication scheme and provided the correct value for the security asset corresponding to that authentication scheme. E.g. For password - provide the correct password.   For challenge & response, have the correct debug key registered on the smart card.   Note: you may be required to power cycle the board before attempting to debug again after failing to authenticate properly.   Configuration Settings     SDAF (Secure Debug Authorization Framework) – the framework for which the Secure Keys Registry view serves as a graphical interface, is configurable in various aspects and the UI can be used to update the configuration. From the Secure Key Registry interface, click on Settings:   The configuration parameters that can be updated with this view are the following: Working mode: This configuration parameter is used for selecting the working mode regarding the smart card connection. There are two possible values for this:   Managed: volkano.dll (SDAF component) iterates through all the PC/SC readers locally connected to the PC where volkano is running and identifies if a smart card with the volkano applet installed is present. If such a smart card is identified, volkano will connect and interact with it accordingly.      Client: volkano will try to connect to another instance of volkano running in server mode (be it remotely or on the same PC where S32DS is running). Note: Due to the fact that all the commands sent by volkano to the smart card will go through the network via TCP, some latency is expected.       Host: Specifies the hostname/IP address of the PC on which a volkano instance is running in server mode.   Port: Determines the port of the remote volkano instance (running in server mode) that the client will try to connect to. Logging_Verbosity: This config parameter controls the level of detail in the program’s log output. The available verbosity levels are: ERROR: Provides messages that indicate exceptions that have occurred during the execution and data transmission errors. This is the default value of the config parameter.       INFO: Provides informational messages that contains details about the normal execution flow.   DEBUG: Provides detailed debugging information.   
View full article
When you use the New Project Wizard within S32 Design Studio to create a project, starting a debugging session is easy since the wizard creates the debug configuration for you. In this document, the case for NXP devices supported by the GDB PEMicro Debugging Interface is detailed.    Prerequisites The project to be debugged should be loaded to the workspace and open                 Procedure Build the project. Select the build configuration. (optional) If you already know which build configuration is desired, you can preselect it. If not, one is already selected for you by default. It will be noted with a check mark. Typical options contain choices between RAM and FLASH memory builds and for each a choice between Debug and Release. For debugging purposes the Debug option should be selected.                 Click on Build. Clicking this button will start the build using the preset build type.     Or, select the build type from the pick list. This will start the build for the build type selected, regardless of which one is marked with a check mark.       Check there are no compiler errors.                     Configure the debug configuration to start a debug session. Click ‘Run’ pulldown menu. Select 'Debug Configurations…'     Select the debug configuration associated with your current build configuration.     Select whether to rebuild code each time debug session start is requested.   Click on Debugger tab.     Verify proper interface and port.     Click Debug      
View full article
The Quick Start describes how to use the S32 Design Studio to create, build, and debug a project. Starting S32DS Design Studio for S32 Platform 3.5 To start S32 Design Studio and begin to work with it: Launch S32 Design Studio : locate the shortcut depending on your selection during the installation, and double-click the product icon. The Eclipse Launcher dialog box appears to let you define the location of your workspace.   Note: A workspace is the folder where S32 Design Studio stores projects that you create or import. Select a folder for your workspace. It is recommended to create a new workspace for each product instance. To choose the default location, click OK. To use a different location, click Browse. In the Select Workspace Directory dialog box, select the preferred folder or click Make New Folder to create a new folder for storing your projects. Click OK. S32 Design Studio is launched. Browse through the Getting Started tab and close it. The workbench appears:   Creating and building a project   To create and build a project: Click File > New > S32DS Application Project or S32DS Library Project on the menu bar. The first page of the wizard appears. Specify the name of the new project in the Project name text box. Note: The Location field shows the default project location. If you want to change this location, clear the Use default location check box, click Browse and specify a different location. Click OK. Select the target processor from the Processors panel. Click Next. The second page of the wizard appears. Check the project settings, select the cores and parameters. Click Finish. The new project appears in the Project Explorer view. Note: The wizard creates one or multiple projects, depending on the number of selected cores. To build your project, do any of the following: Right-click the project in the Project Explorer view and click Build Project Select the project in the Project Explorer view, then click Project > Build Project on the menu Select the project in the Project Explorer view and click on the tool icon on the toolbar.        The build process starts.   If a build generates any errors or warnings, you can see them in the Problems view. Read through the build messages in the Console view to make sure that the project is built successfully.   Debugging a project   To debug a project: Set the debug configuration for your project. Select the project in the Project Explorer view. Open the debug configuration in any of these ways: Right-click the project and select Debug as > Debug Configurations… from the context menu. Choose Run > Debug Configurations… from the menu bar. Click an arrow next to Debug picture on the toolbar and select DebugConfigurations…. In the Debug Configurations dialog box, select the required debug configuration. The name of the debug configuration is composed of the project name, debugging interface and build configuration. The configuration settings appear on the tabs.   Modify the configuration settings where required and click Apply to save the changes. Click Debug. The debugger downloads the program to the memory of the target processor. The Debug perspective is displayed. The execution halts at the first statement of the main() function. The program counter icon on the marker bar points the next statement to be executed.   To set and run to a breakpoint: Double-click on the marker bar next to a statement. The breakpoint indicator (blue dot) appears next to the statement. From the Debug view, select Run > Resume on the menu bar. The debugger executes all statements up to (but not including) the breakpoint statement. To control the program: From the Debug view, select Run > Step Over from the menu bar. The debugger executes the breakpoint statement and halts at the next statement. From the Debug view, select Run > Resume from the menu bar. The debugger resumes the program execution. From the Debug view, select Run > Terminate. The debug session ends.
View full article
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 OSEK Kernel awareness.   Abbreviations Abbreviation Description OSEK Open Systems and their Interfaces for Automotive Electronics is a standard developed in the automotive industry to define a common architecture for embedded Real-Time Operating Systems (RTOS). NXP RTOS NXP Real Time Operating System compliant with OSEK specification  ORTI OSEK Run Time Interface.  ORTI file is generated based on NXP RTOS configuration *.ort / *.orti OSEK system builder ORTI file extension MSI Microsoft Software Installer   Background OSEK Kernel awareness within S32 Design Studio allows you to debug your application from the operating system perspective. ORTI is a specification that enables OS awareness for external debuggers (e.g NXP S32 Debugger, Lauterbach T32, PEmicro's debug probe).  Most OSEK system builders are able to extract all necessary information of the OS component into a text file, called “ORTI file”. NXP RTOS generates an *.ort file based on the user configuration. Debuggers can load this ORTI file to add support for the operating system. S32Design Studio can load such an ORTI file and adds some special views that will allow the user to inspect the configured OS objects: Tasks, Alarms, Counters, Scheduletable.   Document structure The basic workflow for setting up and managing OSEK OS Awareness projects in S32 Design Studio remains consistent across both single-core and multi-core projects, irrespective of the debug probe used. The focus will be on the universal steps that are described in single-core projects case. For OSEK OS Awareness multi-core projects and for projects utilizing PE Micro debug probes, only the specific considerations will be highlighted.                 Hardware Support OSEK OS Awareness support in S32 Design Studio is available for: S32G27x, S32G39x S32E/Z  S32K396 S32R41 SAF85xx   OS Support OSEK OS Awareness support is available only on Windows.   How to use OSEK OS Awareness with S32 Design Studio and S32Debugger probe   Single core projects   Prerequisites Note: This HOWTo Guide describes the required steps for using OSEK Run Time Interface on a single-core example project for S32R418AA 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 RTOS imported in S32 Design Studio Workspace S32R41 Development Package S32R41 Real-Time Drivers Version 1.0.0 SW32R41 RTOS 4.7.0 version 0.9.0 BETA   !Note: For this example project, NXP RTOS SysGen requires Java Runtime Environment OpenJDK-JRE 11.0.11 installed on your computer. The OpenJDK-JRE can be downloaded from the following URL (please search with exact keyword "jre-11.0.11-x64 MSI" or “jdk-11.0.11-x64 MSI” for correct version): https://developers.redhat.com/products/openjdk/download Using the installer (MSI) is recommended because it creates the HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK registry entry. JAVA_HOME environment variable must be set to point to location of Java Runtime Environment. For example: JAVA_HOME=C:\Program Files\RedHat\java-11-openjdk-jre-11.0.11-1 (Please choose correct path for your machine). Error or unexpected behavior may occur if the version of Java is different than 11.0.11 when NXP RTOS SysGen is executed (steps that are described Chapter III – “Generating Configuration”). If Java version is not found in the HKEY_LOCAL_MACHINE (HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft) a warning is reported.    Hardware environment Silicon: - Chip P/S32R418AAU(K1)MUFT (rev 1.1) Board: - X-S32R41-EVB PCB 48194 RevD SCH RevD Debug Probe: S32 Debug Probe       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 RTOS or import your own S32 Design Studio project.   Select the desired project from the list of examples and click finish       Generating configuration Before running the example, a configuration needs to be generated. First, go to Project Explorer View in S32 Design Studio and select the current project.   Right click and select the "S32 Configuration Tool" menu then click "Open Peripherals".  Click on the "Update Code" button.   Click on Select directory under "Generate" field to select the directory which contains example project (E.g.: D:\WorkspaceS32DS\RTOS_example_S32R418AA_SC1_M7) then click on Generate Configuration.  Click "Update Code" again.   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   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.      Loading the ORTI file and starting debug From the OS Awareness tab select “OSEK” from the OS dropdown list. Browse and select from local system or Workspace the required *.ort file Click the Debug button.     OS Details Browser view Navigate to go to Window -> Show View -> Other…  and select the OS Details Browser view     Using the OS Details Browser view, Design Studio can display information about the tasks status on the target.   Tasks tab In the “Tasks”  tab from the OS Details Browser view you can see information about the operating system (the number of tasks, current task states, system objects):   Implementation tab Switch to the “Implementation” tab to see more detailed information gathered from the .ort file:   OS – current state Tasks – priority, state and assigned stack Stacks – usage and attributes Other OS resources defined and declared through ORTI Detailed info about ORTI data object Customize data presentation (HEX format, re-arrange the table columns) Colored presentation of data: -   White fields are static Blue fields are non-static Yellow fields are fields that changed their values from the last time they were inspected/checked.   OS information: Tasks information:   Stacks information:   Multi-core projects Prerequisites Note: This HOWTo Guide describes the required steps for using OSEK Run Time Interface on a multi-core example project for S32Z270 Cortex-R52 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 RTOS imported in S32 Design Studio Workspace S32Z2/E2 Development Package S32Z/E Real Time Drivers Version 0.9.0 S32ZE RTOS R21-11 version 0.9.0   !Note: For this multi-core example project, NXP RTOS SysGen requires Java Runtime Environment OpenJDK-JRE 1.8 installed on your computer. The OpenJDK-JRE can be downloaded from the following URL (please search with exact keyword "jdk-8u372-x86 MSI" for correct version): https://developers.redhat.com/products/openjdk/download - Using the JDK 1.8 installer (MSI) is recommended. JAVA_HOME environment variable must be set to point to location of Java Runtime Environment. For example: JAVA_HOME= C:\Program Files (x86)\Java\java-1.8.0-openjdk-1.8.0.372-1 (Please choose correct path for your machine). Error or unexpected behavior may occur if the version of Java is different than 1.8 when NXP RTOS SysGen is executed (steps that are described in Chapter III – “Generating Configuration”).   Please notice that SysGen is not stable in JRE 1.8 64 bit. Using SG with JRE 1.8 32 bit is recommended.     Hardware environment:             Boards: S32Z27X-DC PCB 50588 RevA1 SCH RevB (DC2)             Silicon chip: P32Z270ADCK0MJFT P65C ATTJ2151A (E2). (21x21, 594 BGA) Debug Probe: S32 Debug Probe               Boards: S32Z270-DC PCB 50912 RevA SCH RevA (DC1)             Silicon chip: S32Z270ADCK0MJET (17x17, 400 BGA) Debug Probe: S32 Debug Probe   Project setup Go to File -> New -> S32DS Project From Example  and select one of the existing multi-core S32 Design Studio Sample applications delivered with the NXP RTOS or import your own S32 Design Studio project.      Generating configuration The steps for generating configuration must be performed for all projects: RTOS_example_S32Z270_SC1_multi_instance_R52_0_0, RTOS_example_S32Z270_SC1_multi_instance_R52_0_1, RTOS_example_S32Z270_SC1_multi_instance_R52_0_2, RTOS_example_S32Z270_SC1_multi_instance_R52_0_3.   Building the projects Before running, you must build all projects: RTOS_example_S32Z270_SC1_multi_instance_R52_0_0, RTOS_example_S32Z270_SC1_multi_instance_R52_0_1, RTOS_example_S32Z270_SC1_multi_instance_R52_0_2, RTOS_example_S32Z270_SC1_multi_instance_R52_0_3.     Debug configuration Click on Debug Configurations. Click the initial core under S32 Debugger in Debug configurations menu.  Setup the Debug Probe Connection.    Loading the ORTI file   Loading the ORTI file must be done for all the project configurations:  RTOS_example_S32Z270_SC1_multi_instance_R52_0_0 RTOS_example_S32Z270_SC1_multi_instance_R52_0_1 RTOS_example_S32Z270_SC1_multi_instance_R52_0_2 RTOS_example_S32Z270_SC1_multi_instance_R52_0_3   Starting debug on multi core project From the Debug Configuration menu, click on Launch Group for S32 Debugger. Check all the cores that you want to debug. Click the Debug button.   OS Details Browser view Compared with single core projects, when debugging multi core projects you can switch between the debugging sessions and information from all debugged cores   Tasks tab     Implementation tab The information displayed in Implementation tab is the same as in single-core projects case, but you can switch between the debugged cores       How to use OSEK OS Awareness with S32 Design Studio and PE Micro Debug probe Prerequisites Note: This HOWTo Guide describes the required steps for using OSEK Run Time Interface 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 RTOS imported in S32 Design Studio Workspace S32 Design Studio 3.5.6 development package with support for S32K396 devices S32K3 Real-Time Drivers Version 3.0.0 P01 SW32K396 RTOS version 0.9.0 BETA   !Note: check the note from S32 Debugger – multi-core projects and install requires Java Runtime Environment OpenJDK-JRE 1.8   Hardware environment: Board:             Mini-module: XS32K396-BGA-DC PCB 54614 RevX1 SCH RevA              Silicon: Chip P32K396EHMJBS OP40E QAD2222F  Debug Probe: PE Micro Debug Probe     Project setup 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 For this How To Guide, RTOS_example_S32K396_SC1_M7_0_0 was used   Generating configuration     Building the projects Select the project in the S32 Design Studio Workspace and click on Build.    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.   Loading the ORTI file and starting debug From the OS Awareness tab select “OSEK” from the OS dropdown list. Browse and select from local system or Workspace the required *.ort file Click the Debug button.   OS Details Browser view Go to Window -> Show View -> Other…  and select the OS Details Browser view   Tasks tab In the “Tasks”  tab from the OS Details Browser view you can see information about the operating system (the number of tasks, current task states, system objects):   Implementation tab  “Implementation” tab displays more detailed information gathered from the .ort file:   Revision history: Revision no. Revision date Description 01 Nov 2023 Created document about how to use OSEK OS Awareness in S32 Design Studio on single and multi core projects with PE Micro and S32 Debug probes    
View full article
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.       Select the desired project from the list of examples and click finish     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.     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     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.      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. Heap usage view     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.   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       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   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.     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    
View full article
This document shows the step-by-step process to create a simple blinking LED application for the S32M2xx family using the S32 RTD AUTOSAR drivers. This example used for the S32M244 EVB, connected to a PC through P&E Debugger.  Preparation  Setup the software tools  Install S32 Design Studio for S32 Platform   Install the S32M2xx development package and the S32M24 RTD AUTOSAR 1.9.0 Both of these are required for the S32 Configuration Tools.  Launch S32 Design Studio for S32 Platform  Procedure  New S32DS Project    OR     Provide a name for the project, for example 'Blinking_LED_RTD_With_AUTOSAR'. The name must be entered with no space characters.     Expand Family S32M2xx, Select S32M244  Click Next   Click '…' button next to SDKs      Check box next to PlatformSDK_S32K1_S32M24_2_0_0_S32M244_M4F (or whichever latest SDK for the S32M2xxx is installed). Click OK       Click Finish. Wait for project generation wizard to complete, then expand the project within the Project Explorer view to show the contents.    To control the LED on the board, some configuration needs to be performed within the Pins Tool. There are several ways to do this. One simple way by double-click on the MEX file.     Select the overview tab and disable Pins tool. Make sure to overview tab windows shows settings shown as below.  Here, we are disabling pin tools and using MCAL driver from peripheral tools for using AUTOSAR drivers.     Now from Overview menu, select peripheral tools and double click to open it.     In the driver sections, “Port_Ip_1 driver” is the non-AUTOSAR version driver and so it must be replaced. Right click on ‘Port_Ip_1’ and remove it. Keep the BaseNXP driver as it is.     Click on the ‘+’ next to the MCAL box.   Locate and then select the ‘MCU’ component from the list and click OK.        Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Dio’ component from the list and click OK.     Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Port’ component from the list and click OK.        Now components tab should show like below :    Ignore the error for Port component for now.     Now we required to configure the different MCAL drivers that we added. Starting with Dio configuration, open the Dio configuration.     Now, open the ”DioConfig” tab. From that change Dio Port Id to 4 instead of 0    In that, select  “+” sign adjacent to Dio Channel.     Then edit Name to “DioChannel_0”and “Dio Channel Id”  to ‘6’ instead of ‘0’.       From the schematic for S32M244 EVB, we can select signal line for user LED from the schematic, channel 6 is connected to user LED signal, so we use channel 6 signal line to the chip on the user LED.            Now Select Port tab for Port configuration.   And select and open Port Configuration tab, and from that open “PortConfigSet” tab.  Edit PortPin Pcr to “134” instead of “0”.           Also, change Portpin Direction to “PORT_PIN_OUT” And PortPin Level Value to “PORT_PIN_LEVEL_LOW”.  After change it should be as below.        At the bottom you will find the “UnTouchedPortPin ’’ . Click on “+’’ and add PortPins.         Now add 6 port pins as per below configuration. Pins 0, 1,2,3, 4,5, and 6 should be setup.    Now the device configurations are complete and the RTD configuration code can be generated. Click ‘Update Code’ from the menu bar.     To control the output pin which was just configured, some application code will need to be written. Return to the ‘C/C++’ perspective.        If not already open, in the project window click the ‘>’ next to the ‘src’ folder to show the contents, then double click ‘main.c’ file to open it. This is where the application code will be added.       Before anything else is done, Initialize the clock tree and apply PLL as system clock, Apply a mode configuration, Initialize all pins using the Port driver by adding – editing code before write code here comment in main function.          /* Initialize the Mcu driver */          Mcu_Init(&Mcu_Config_BOARD_InitPeripherals);          /* Initialize the clock tree and apply PLL as system clock */          Mcu_InitClock(McuClockSettingConfig_0);          while ( MCU_PLL_LOCKED != Mcu_GetPllStatus() )          {                 /* Busy wait until the System PLL is locked */          }          Mcu_DistributePllClock();          Mcu_SetMode(McuModeSettingConf_0);       /* Initialize all pins using the Port driver */   Port_Init(NULL_PTR);       Now replace the logic of for loop as shown below code section, which will enable the LED blinking for 10 times:    You also need to declare and initialize the loop variable uint8 count = 0U       Then replace the code as below:                                     /* Logic for blinking LED 10 times */        while (count++ < 10)       {           /* Get input level of channels */           Dio_WriteChannel(DioConf_DioChannel_DioChannel_0, STD_HIGH);           TestDelay(2000000);           Dio_WriteChannel(DioConf_DioChannel_DioChannel_0, STD_LOW);           TestDelay(2000000);        }         Before the 'main' function, add a delay function as follows:  void TestDelay(uint32 delay); void TestDelay(uint32 delay)   {       static volatile uint32 DelayTimer = 0;      while(DelayTimer<delay)       {           DelayTimer++;      }       DelayTimer=0;  }    Update the includes lines at the top of the main.c file to include the headers for the drivers used in the application:    Add   #include "Mcu.h"   #include "Port.h"   #include "Dio.h"     Now, select and open max file again. Then, select and open peripheral tools.      Now, from the toolbar selection menu at the top, select and double click on the symbol as shown as below:     Now, from the global settings, for ComponentGenerationMethod from that select  “FunctionalGroups” from the drop down menu as shown below:          Now. click ‘Update Code’ from the menu bar.    Build 'Blinking_LED_RTD_AUTOSAR'. Select the project name in 'C/C++ Projects' view and then press 'Build'.    After the build completes, check that there are no errors.    Open Debug Configurations and select 'Blinking_LED_RTD_with_AUTOSAR_Debug_RAM'. Make sure to select the configuration which matches the build type performed, otherwise it may report an error if the build output doesn’t exist.    Now, you need configuration for P&E MULTILINK Debug Probe.   Connect PE Micro debugger to EVB using USB, and to make sure that debugger is connected via USB interface, then the COM port will be detected automatically (in the rare event where 2 or more debug Probes are connected via USB to the host PC, then it may be necessary to select which COM port is correct for the probe which is connected to the EVB).  Now, Select PEMicro Multilink debugger, select “Run”, and select debug configuration tab, then select GDB PE Micro Interface Debugging, and from the option available under it, select option with Debug_FLASH_PNE.   Now, in the debug configuration window, select the tab PEmicro Debugger, and in the PEMicro Interface settings, select the interface USB Multilink.   Clink apply and debug     Click Debug    To see the LED blink, click ‘Resume'     This code as it is will blink the LED 10 times, you can make changes in for loop condition to blink it infinitely.      
View full article
Purpose This document holds information about how the Design Studio and S32Debugger probe can be used to debug Zephyr OS (Operating System) applications running on NXP’ S32 family processors.    Scope    This document is addressed to the software developer or tester (referred below as user) looking to debug or verify its software using the S32Debugger probe.    The document assumes the user has basic knowledge about Zephyr OS and he can rebuild the image with debug configuration.    The information about the building of the Zephyr application using NXP’s Zephyr distribution is not in the scope of this document. This is part of the user manual delivered with the Zephyr NXP release.    Hardware support    This support is available for Cortex-A53 and Cortex-R52 cores only.    It has been confirmed on S32R41, S32R45 and S32Z/E SoCs (System on Chip).    Software support    This feature is available starting with Design Studio 3.5.3.    It is confirmed with Zephyr OS versions 2.7.2 (S32R41), 3.2.0 (S32Z/E), 3.3.0 (S32R41).    Background    Zephyr is a lightweight RTOS (Real Time Operating System) that supplies support for multiple architectures (aarch64, arm, riscv, x86).    The thread awareness support stands for the capability of the debugger to supply low-level information about OS threads (referred below as standard support) or system-level OS information (referred below as extended support).      Standard support    Design Studio can supply low-level information about Zephyr threads:    Name    State    CPU registers - including FPU (Floating Point Unit)    Call stack    Priority    User options    Core number    Prerequisites    S32Debugger automatically detects the Zephyr OS image using the specific debug symbols.    The Zephyr application image should include the following configuration options:    CONFIG_DEBUG_THREAD_INFO    Mandatory    If this choice is not set, the debugger is not able to parse the kernel internal data.    In debug view, the user will see one thread only and no extra information about this.                                         Debug window    The Zephyr threads are listed in the Debug window when the CPU is stopped.      This is an example about how to follow thread entry can be read:      The Thread with index #15 and thread ID 868402064 (TCB (Thread Control Block) address in decimal format) is running on the CPU core 0 and it is in the Stopped state.    It has running priority 15, the user options 0x01 and its name is “idle 00”.    This is suspended in a breakpoint set in function arch_cpu_idle();    Thread states    The thread states names reported by debugger are accordingly with the output of the kernel function k_thread_state_str() excluding Stopped, that is the active Zephyr thread suspended by debugger.    Thread’s state values:    Stopped    Dummy    Pending    Prestart    Dead    Suspended    Aborting    Queued      CPU registers    The CPU registers of the thread selected in the Debug window can be read from the Registers window. This window is updated automatically when other thread is selected.    Known limitations    The warning message “ccs: Invalid parameter” is printed twice into the Design Studio IDE console (for S32Z/E only).    These can be ignored because the functionality is not affected.      Breakpoint per thread is not supported    Write thread registers is not supported (excluding the thread in state Stopped)    Performance may be affected by high number of Zephyr threads    FPU registers read support requires patch of Zephyr OS to save the offset in the table for ARM64 build. This is the snippet code that must be added in the initialization of _kernel_thread_info_offsets  into file thread_info.c😞    #elif defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING) && defined(CONFIG_ARM64)     [THREAD_INFO_OFFSET_T_PREEMPT_FLOAT] = offsetof(struct _thread_arch,                          saved_fp_context),        [THREAD_INFO_OFFSET_T_COOP_FLOAT] = THREAD_INFO_UNIMPLEMENTED,        Extended support    Design Studio can supply system-level information about Zephyr OS resources like:    Timer    Semaphore    Mutex    Stack    Message queue    Mailboxes    Pipes    Queues    Threads    This implementation is not CPU architecture specific like standard support.    Prerequisites    The Zephyr application image should include the following configuration options:      CONFIG_DEBUG_THREAD_INFO    Mandatory    If this choice is not set, the debugger is not able to parse kernel internal data and to supply information about resource owners or waiting lists.    CONFIG_TRACING    CONFIG_TRACING_OBJECT_TRACKING    CONFIG_TRACING_NONE    Mandatory    Enable the kernel object tracking. If this is not set, the debugger can show system information about Threads only. Note: This configuration is working on Zephyr version 3.0.0 or higher.    CONFIG_INIT_STACKS    Optional    Enable the fill of stack with a marker that can be used by debugger to report the peak stack usage.    This information might be useful for stack size tunning.    CONFIG_THREAD_STACK_INFO    Recommended    The debugger supplies information about the stack (address, size or usage).        GDB (GNU Debugger)    This support is available through extended GDB commands.    Command name    Description    thread-aware-list-supported-os    List the supported OS types and the detected OS    thread-aware-list-supported-objs    List the supported kernel objects by the detected or specified OS. This is based on types used by the current image only.    thread-aware-read-objs    Read the specified or all objects supported by current image.        These commands can be configured to supply the output in JSON (JavaScript Object Notation) or table format.    Use the help command to get more information about these thread awareness commands.      Figure 2 GDB - Get Thread, Mutex & Semaphore info    Common attributes    Most of the object's attributes are type specific with 2 exceptions:    Attribute name    Description    Format               S32Debugger Zephyr Thread Awareness                                                                       User Manual v1.3                                                                        address    Object data address                     integer                                 name    ELF Symbol name                          string                                    Thread attributes    Attribute name    Description    Format    user_options    User options    integer    state    Thread state – see Thread states    string    prio    Thread priority    integer    stack_addr        integer    stack_delta        integer    stack_size        integer    stack_usage_max    Largest stack usage    float    stack_usage    Current stack usage    float    MemSlab attributes    Attribute name    Description    Format    num_blocks        integer    block_size        integer    buffer        integer    free_list        integer    num_used        integer    locked    Locked by this thread (name)    string    waiting    Threads (name) waiting for this object    string list    Queue attributes    Attribute name    Description    Format    locked    Locked by this thread (name)    string      waiting    Threads (name) waiting for this object    string list    Pipe attributes    Attribute name    Description    Format    buffer        integer    size        integer    bytes_used        integer    read_index        integer    write_index        integer    flags        integer    locked    Locked by this thread (name)    string    waiting_tx    Threads (name) waiting for this object on write    string list    waiting_rx    Threads (name) waiting for this object on read    string list    MBox attributes    Attribute name    Description    Format    locked    Locked by this thread (name)    string    waiting_tx    Threads (name) waiting for this object on write    string list    waiting_rx    Threads (name) waiting for this object on read    string list    Attribute name    Description    Format    timeout        integer      period        integer    MsgQ Attribute name    Description    Format    attributes    Attribute name    Description    Format    msg_size        integer    max_msgs        integer    buffer_start        integer    buffer_end        integer    read_ptr        integer    write_ptr        integer    used_msgs        integer    flags        integer    locked    Locked by this thread (name)    string    waiting    Threads (name) waiting for this object    string list    Stack attributes    Attribute name    Description    Format    base        integer    next        integer    top        integer    flags        integer    locked    Locked by this thread (name)    string    waiting    Threads (name) waiting for this object on write    string list    Timer attributes    status        integer    waiting    Threads (name) waiting for this object on write    string list    Mutex attributes      owner    Own by this thread (name)    string    lock_count        integer    owner_orig_prio        integer    waiting    Threads (name) waiting for this object on write    string list    Semaphore attributes    Attribute name    Description    Format    limit        integer    count        integer    waiting    Threads (name) waiting for this object on write    string list        DS (Design Studio)    The DS version 3.5.3 or higher offers the possibility to display the Thread information only into a dedicated view.    The extended support is still available in DS by running the extended GDB commands directly from the Debugger Console window.            Figure 3 DS - Execute thread awareness GDB commands    Thread view    This window can be accessed from the menu RTOS/Zephyr RTOS/Threads.                  Figure 4 DS IDE - Thread view    Some information can be missing from the view depending on the build configuration used. For example, in the above figure, the Peak stack usage is not available because the CONFIG_INIT_STACKS is not set.    Note the Thread’s field names into DS IDE Thread view can be different than GDB Thread attributes.    Stack    The thread view holds more information about the stack.    The Stack usage stands for the current stack usage, and it is based on SP (Stack Pointer) register while the Peak stack usage stands for the maximum usage of the stack.    Known limitations    Performance may be affected by number of OS resources    Limited configurations tested       
View full article
The release notes of S32K RTD usually mention which dependent software packages need to be installed. Taking SW32K1_S32M24x_RTD_R21-11_2.0.0_P04_D2404_ReleaseNotes.pdf as an example, we can see that the following software packages need to be installed: You must be logged into your account on NXP.com to gain access to the download link. 1. Download and install S32Design Studio 3.5: Click S32 Design Studio 3.5 – Windows/Linux -> 3.5 S32 Design Studio for S32 Platform v.3.5 -> S32DS.3.5_b220726_win32.x86_64.exe Note: For Windows OS, the user account designated for installing S32 Design Studio for the S32 Platform must be a member of the local Administrators security group. 2. Download and Install S32 Design Studio 3.5 Update 4 D2307: SW32_S32DS_3.5.4_D2307.zip (com.nxp.s32ds.update_3.5.4.20230707034206.zip) Since the SW32K1_S32DS_3.5.4_D2307.zip downloaded in step3 already contains the files of the SW32_S32DS_3.5.4_D2307.zip in the step2, we will skip this step here. 3. Download and Install S32 Design Studio 3.5 development packages for offline use, support for S32K1 (3.5.4_D2307): SW32K1_S32DS_3.5.4_D2307.zip  (com.nxp.s32ds.s32k1.dev.repository_1.0.0.202307062245.zip) Unchecking Contact all update sites during install to find required software can complete offline installation faster. 4. Click Real-Time Drivers for S32K1 -> Automotive SW - EB tresos Studio / AUTOSAR Configuration Tool Select and install one of the following updatesite.zip for S32K1 RTD 2.0.0: The latest S32K1 RTD version is usually recommended. However, if you need to use Reference Software or Premium Software (such as FreeRTOS, LIN Stack, TCP/IP Stack Structural , Core Self-Test (SCST), Automotive Math and Motor Control Library (AMMCLib), S32K ISELED), it is recommended to install the specific version of S32K1 RTD according to their release notes. 4.a) Download and install S32K1_S32M24X Real Time Drivers AUTOSAR 4.4 & R21-11 Version 2.0.0: SW32K1_S32M24x_RTD_4.4_R21-11_2.0.0_D2308_DS_Updatesite.zip 4.b) Download and install S32K1_S32M24X Real Time Drivers AUTOSAR 4.4 Version 2.0.0 P01: SW32K1_S32M24x_RTD_4.4_R21-11_2.0.0_P01_D2308_DS_Updatesite.zip 4.c) Download and install S32K1_S32M24X Real Time Drivers AUTOSAR R21-11 Version 2.0.0 P04: SW32K1_S32M24x_RTD_R21-11_2.0.0_P04_D2404_DS_updatesite.zip
View full article
In order to improve user experience with S32 Design Studio, in this article you can find some tips and tricks.   Use-Case #1: S32 Design Studio takes to much time to perform some of UI update operations Workaround: Manually update the Eclipse configuration parameters in the s32ds.ini file Use-Case #2: S32 Design Studio takes a lot of time to open waiting for updates checking to finish Solution: Update your environment to use at least Update12 or newer or disable the checking at startup Use-Case #3: Control of package dependencies between RTD and S32DS during install/update flow Solution: Transition to Package Manager as the main/single delivery solution for SW and Tools installation. The concept of “Bundles & Use Cases” guarantee interoperability and come with customer support.    
View full article
For S32 Design Studio v3.5 and earlier, there is a known issue when the S32 Configuration Tools are invoked from command line from a location outside of the S32DS installation directory. The following error is reported: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source) at com.nxp.swtools.common.utils.runtime.SingletonProvider.getSingletonInstance(SingletonProvider.java:46) at com.nxp.swtools.common.ui.utils.swt.internal.SWTFactory.getSingletonInstance(SWTFactory.java:421) at com.nxp.swtools.common.ui.utils.swt.SWTFactoryProxy.getSingletonInstance(SWTFactoryProxy.java:448) at com.nxp.swtools.dcd.controller.DCDController.getInstance(DCDController.java:84) at com.nxp.swtools.dcd.DCDStartup.earlyStartup(DCDStartup.java:23) at com.nxp.swtools.provider.SWToolsPlatform.initializeAllTools(SWToolsPlatform.java:702) at com.nxp.swtools.framework.Application.start(Application.java:475) at com.nxp.swtools.framework.Application.start(Application.java:445) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:654) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) at org.eclipse.equinox.launcher.Main.run(Main.java:1462) Caused by: java.lang.NoClassDefFoundError: javafx/beans/property/SimpleBooleanProperty at com.nxp.swtools.bootimage.controller.ABootController.<init>(ABootController.java:37) at com.nxp.swtools.dcd.dcf.common.DCDCommonController.<init>(DCDCommonController.java:90) at com.nxp.swtools.dcd.controller.DCDController.<init>(DCDController.java:43) ... 24 more Caused by: java.lang.ClassNotFoundException: javafx.beans.property.SimpleBooleanProperty cannot be found by com.nxp.swtools.bootimage_1.0.0.202207251223 at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:519) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:170) at java.base/java.lang.ClassLoader.loadClass(Unknown Source)   Resolution: To resolve the issue: Invoke the command from within the installation directory, for example, from 'C:\NXP\S32DS.3.5\eclipse' OR Change "{S32DS Installation Folder}\eclipse\s32ds.ini" by setting the javafx path from relative to absolute. So, if default installation is used, then: Change -Defxclipse.java-modules.dir=jre/javafx-sdk-11.0.2/lib To -Defxclipse.java-modules.dir=C:/NXP/S32DS.3.5/eclipse/jre/javafx-sdk-11.0.2/lib   In addition, if it is desired to suppress unimportant warning messages: go to {S32DS installation folder}\eclipse\configuration, open logging.properties file and change com.nxp.swtools.level = SEVERE
View full article
This document shows the step-by-step process to create a simple blinking LED application for the S32R41 family using the S32 RTD AUTOSAR drivers. This example used for the S32R41 EVB, connected via ethernet connection through S32 Debugger. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32R41 development package and the S32R41 RTD AUTOSAR 4.4. Both of these are required for the S32 Configuration Tools. Launch S32 Design Studio for S32 Platform Procedure New S32DS Project OR Provide a name for the project, for example 'Blinking_LED_RTD_With_AUTOSAR'. The name must be entered with no space characters. Expand Family S32R41, Select S32R418AB Cortex-M7  Click Next Click '…' button next to SDKs   Check box next to PlatformSDK_SAF85_S32R41_2022_08_S32R418AB _M7_0. Click OK And also, uncheck the other core Cortex_M7_1 Click Finish. Wait for project generation wizard to complete, then expand the project within the Project Explorer view to show the contents. To control the LED on the board, some configuration needs to be performed within the Pins Tool. There are several ways to do this. One simple way by double-click on the MEX file. Select the overview tab and disable Pins tool. Make sure to overview tab windows shows settings shown as below.  Here, we are disabling pin tools and using MCAL driver from peripheral tools for using AUTOSAR drivers. Now from Overview menu, select peripheral tools and double click to open it. In the driver sections, “Siul2_Port_1 driver” is the non-AUTOSAR version driver and so it must be replaced. Right click on ‘Siul2_Port_1’ and remove it. Keep BaseNXP driver as it is. Click on the ‘+’ next to the MCAL box. Locate and then select the ‘Dem’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Dio’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Mcu’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Port’ component from the list and click OK. Now components tab should show like below : Now we required to configure the different MCAL drivers that we added. Starting with Dio configuration, open the Dio configuration. No change is required for Dem configuration. Now, open the ‘DioGeneral’ tab, and select checkmark as per shown below: Now, open the ”DioConfig” tab. In that Select  “+” sign adjacent to Dio Channel. Then Edit Name to “Digital_Output_LED_0” and Dio Channel Id to ‘4’ instead of ‘0’. From the schematic for S32R41 EVB, checking for signal line for the user LED, channel 4 is connected to user LED signal, so we use channel 4 for signal line for user LED on the chip. So, we select the signal line for Dio channel Id 4 for the LED connected on the S32R41 EVB. Now Select Port tab for Port configuration. And open the Port Configuration tab, and from that open “PortConfigSet” tab. Change the PortPin Mscr to 36 , PortPin Direction to PORT_PIN_INOUT as shown below: Now, at the bottom you will find the “UnTouchedPortPin ’’ . Click on “+’’ and add PortPins. Now add port pins 0, 1, 2, 3,4 as per below configuration Now configure MCU component. Select Mcu component in MCAL, and then open the Mcu configuration. In Mcu configuration click MCUModuleConfiguration and then select  “McuModesettingConf” from the dropdown menu as shown below. From McuModeSettingConf select McuPartitionConfiguration Now open “McuPartition0Config” tab. And under the McuCore0Configuration for “McuCoreClockEnable” select checkbox and for “McuCoreResetEnable” uncheck  the checkbox. Similarly, And under the McuCore1Configuration for “McuCoreClockEnable” select checkbox and for “McuCoreResetEnable” uncheck  the checkbox. After modification it should be as shown below: Now open the “McuPartition1Config” tab. for "McuPartitionClockEnable" select checkmark to true and for "McuPartitionResetEnable" uncheck  the checkmark   And under McuCore0Configuration for "McuCoreClockEnable"  select checkmark to true and for "McuCoreResetEnable" uncheck  the checkmark After modification it should be as shown below: Now, click on global setting icon as shown below: And, Confirm that ComponentGenerationMethod is set to “FunctionalGroups” Now the device configurations are complete and the RTD configuration code can be generated. Click ‘Update Code’ from the menu bar. To control the output pin which was just configured, some application code will need to be written. Return to the ‘C/C++’ perspective. If not already open, in the project window click the ‘>’ next to the ‘src’ folder to show the contents, then double click ‘main.c’ file to open it. This is where the application code will be added. Before anything else is done, Initialize the clock tree and apply PLL as system clock, Apply a mode configuration, Initialize all pins using the Port driver by adding – editing code before write code here comment in main function.        /* Initialize the Mcu driver */        Mcu_Init(&Mcu_Config_BOARD_InitPeripherals);        /* Initialize the clock tree and apply PLL as system clock */        Mcu_InitClock(McuClockSettingConfig_0);        /* Apply a mode configuration */        Mcu_SetMode(McuModeSettingConf_0);        /* Initialize all pins using the Port driver */        Port_Init(NULL_PTR); Now replace the logic of for loop as shown below code section, which will enable the LED blinking for 10 times: You also need to declare and initialize the loop variable: uint8 i = 0U; Then replace the code as below after write your code comment: /*Logic for blinking LED 10 times*/ while (i++ < 10) {       /* Get input level of channels */       Dio_WriteChannel(DioConf_DioChannel_Digital_Output_LED_0, STD_HIGH);       TestDelay(3000000);       Dio_WriteChannel(DioConf_DioChannel_Digital_Output_LED_0, STD_LOW);       TestDelay(3000000); } Before the 'main' function, add a delay function as follows: void TestDelay(uint32 delay); void TestDelay(uint32 delay) {     static volatile uint32 DelayTimer = 0;     while(DelayTimer<delay)     {         DelayTimer++;     }     DelayTimer=0; } Update the includes lines at the top of the main.c file to include the headers for the drivers used in the application: Add #include "Mcu.h" #include "Port.h" #include "Dio.h" Now, in open peripheral tools again by clicking on icon as shown below. And then click on global setting icon as shown below: And, Confirm that ComponentGenerationMethod is set to “FunctionalGroups” Build 'Blinking_LED_RTD_AUTOSAR'. Select the project name in 'C/C++ Projects' view and then press 'Build'. After the build completes, check that there are no errors. Open Debug Configurations and select 'Blinking_LED_RTD_with_AUTOSAR_Debug_RAM'. Make sure to select the configuration which matches the build type performed, otherwise it may report an error if the build output doesn’t exist. And make selection as shown in screenshot below. You need to select the ethernet connection for S32 debugger and provide its IP address Click Debug To see the LED blink, click ‘Resume' This code as it will blink the LED 10 times, you can make changes in for loop condition to blink it infinitely.
View full article
This document shows the step-by-step process to create a simple blinking LED application for the S32R41 device using the S32 RTD non-AUTOSAR drivers. For this example used for the S32R41 EVB, connected via ethernet connection through S32 Debugger. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32R41 development package and the S32R41 RTD AUTOSAR 4.4. Both of these are required for the S32 Configuration Tools. Launch S32 Design Studio for S32 Platform Procedure New S32DS Project OR Provide a name for the project, for example 'Blinking_LED_RTD_No_AUTOSAR'. The name must be entered with no space characters. Expand Family S32R41, Select S32R418AB Cortex-M7 Click Next Now, uncheck the selection mark for other core, i.e. for Cortex-M7-1   And Click '…' button next to SDKs   Check box next to PlatformSDK_SAF85_S32R41_2022_08_S32R418AB _M7_0. (or whichever latest SDK for the S32R41 is installed). Click OK Click Finish. Wait for project generation wizard to complete, then expand the project within the Project Explorer view to show the contents. To control the LED on the board, some configuration needs to be performed within the Pins Tool. There are several ways to do this. One simple way by double-click on the MEX file. The schematic for S32R41 EVB, checking for signal line for the user LED, channel 4 is connected to user LED signal, so we use channel 4 for signal line for user LED on the chip. So, we select the signal line for Dio channel Id 4 for the LED connected on the S32R41 EVB. From the Peripheral Signals tab left to the Pins tool perspective layout, locate Open the Siul2_0 from the peripheral signals tab. And from the drop down menu select “gpio,36 PC_04” option as per shown in the following image. We are using PC_04 for the GPIO usage, so we are routing SIUL2_0 GPIO signal to this pin. The Direction required! menu will appear. Select Output then OK. In Routing Details view, notice a new line has been added and highlighted in yellow. Add ‘LED’ to the Label and Identifier columns for the PC_04 pin. Code Preview Go to Peripherals tool and add Siul2_Dio to enable LED blinking, it adjacent to the Blue LED on S32R41  EVB. Click on the Peripherals Tool icon from the Eclipse Perspective navigation bar. From the Components view, click on ‘Add a new configuration component…’ button from the Drivers category. This will bring up a list of all configuration components. Locate and then select the ‘Siul2_Dio’ component from the list and click OK. Do not worry about the warning message. It is only indicating that the driver is not already part of the current project. The associated driver package will be added automatically. Note: It may be necessary to change the selection at the top from ‘Present in the tool-chain project’ to ‘All’. The DIO driver provides services for reading and writing to/from DIO Channels. Also, select the Siul2_Port tab and uncheck the checkmark against ‘Siul2 IP Port Development Error Detect’ option as below. The Gpio_Dio driver requires no further configuration. Click Save to store all changes to the .MEX file. Now the device configurations are complete and the RTD configuration code can be generated. Click ‘Update Code’ from the menu bar. To control the output pin which was just configured, some application code will need to be written. Return to the ‘C/C++’ perspective. If not already open, in the project window click the ‘>’ next to the ‘src’ folder to show the contents, then double click ‘main.c’ file to open it. This is where the application code will be added. Before the pin can be controlled, it needs to be initialized using the configuration information that was generated from the S32 Configuration tools. Initialize all pins using the Port driver by adding the following line: Insert the following line into main, after the comment 'Write your code here': /* Initialize all pins using the Port driver */ Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0); Now, add logic for the LED turn and off. To turn the pin on and off with some delays in-between to cause the LED to blink. Make the delays long enough to be perceptible. Add line to initialize variable uint8 i = 0; Change the code within the provided for loop, and add the following lines: /* logic for blinking LED 10 times for (i=0; i<10; i++) {       Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 1U);       level = Siul2_Dio_Ip_ReadPin(LED_PORT, LED_PIN);       TestDelay(2000000);       Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 0U);       level = Siul2_Dio_Ip_ReadPin(LED_PORT, LED_PIN);       TestDelay(2000000); } return (0U); And add this line above the main() function to initialize the variable volatile uint8 level; Before the 'main' function, add a delay function as follows: void TestDelay(uint32 delay); void TestDelay(uint32 delay) {    static volatile uint32 DelayTimer = 0;    while (DelayTimer<delay)    {        DelayTimer++;    }    DelayTimer=0; } Update the includes lines at the top of the main.c file to include the headers for the drivers used in the application: Remove #include "Mcal.h" Add #include "Siul2_Port_Ip.h" #include "Siul2_Dio_Ip.h" Build 'Blinking_LED_RTD_No_AUTOSAR'. Select the project name in 'C/C++ Projects' view and then press 'Build'. After the build completes, check that there are no errors. Open Debug Configurations and select 'Blinking_LED_RTD_No_AUTOSAR_Debug_RAM'. Make sure to select the configuration which matches the build type performed, otherwise it may report an error if the build output doesn’t exist. Now, you need to Select the Interface (Ethernet or USB) by which the S32 Debug Probe is connected. If connected via USB and this option is selected for interface, then the COM port will be detected automatically (in the rare event where 2 or more S32 Debug Probes are connected via USB to the host PC, then it may be necessary to select which COM port is correct for the probe which is connected to the EVB) If connected via Ethernet, enter the IP address of the probe. See the S32 Debug Probe User Manual for ways to determine the IP address. Click Debug To see the LED blink, click ‘Resume'. This code, as it is, will blink the LED 10 times, you can make changes in for loop condition to blink it infinitely.
View full article
This document shows the step-by-step process to create a simple blinking LED application for the S32R45 family using the S32 RTD AUTOSAR drivers. This example used for the S32R45 EVB, connected via ethernet connection through S32 Debugger. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32R45 development package and the S32R45 RTD AUTOSAR 4.4. Both of these are required for the S32 Configuration Tools. Launch S32 Design Studio for S32 Platform Procedure New S32DS Project OR Provide a name for the project, for example 'Blinking_LED_RTD_With_AUTOSAR'. The name must be entered with no space characters. Expand Family S32R45, Select S32R45 Cortex-M7 Click Next Click '…' button next to SDKs   Check box next to PlatformSDK_S32RXX_4_0_0_S32R45_M7_0. (or whichever latest SDK for the S32R45 is installed). Click OK And also, uncheck the other cores Cortex_M7_1 ,  Cortex_M7_2.   Click Finish. Wait for project generation wizard to complete, then expand the project within the Project Explorer view to show the contents. To control the LED on the board, some configuration needs to be performed within the Pins Tool. There are several ways to do this. One simple way by double-click on the MEX file. Select the overview tab and disable Pins tool. Make sure to overview tab windows shows settings shown as below.  Here, we are disabling pin tools and using MCAL driver from peripheral tools for using AUTOSAR drivers. Now from Overview menu, select peripheral tools and double click to open it. In the driver sections, “Siul2_Port_1 driver” is the non-AUTOSAR version driver and so it must be replaced. Right click on ‘Siul2_Port_1’ and remove it. Keep osif_1 driver as it is. Click on the ‘+’ next to the MCAL box. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Dio’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Mcu’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Port’ component from the list and click OK. Now components tab should show like below : Now we required to configure the different MCAL drivers that we added. Starting with Dio configuration, open the Dio configuration. Now, open the ‘DioConfig’ tab, and Edit Dio Port id to 3 as shown below: Now, in “Dio Configuration” window only, Select  “+” sign adjacent to DioChannel. Then Edit Name to “Digital_Output_LED” and Dio Channel Id to ‘5’ instead of ‘0’. From the schematic for S32GR45 EVB, checking for user LED from the schematic, channel 5 is connected to user LED signal, so we use channel 5 signal line to the chip for the user LED. So, we select the singal line for Dio channel Id 5 for the user LED connected on the S32R45 EVB. Now Select Port tab for Port configuration. And open the Port Configuration tab, and from that open “PortConfigSet” tab. Change the PortPin Mscr to ‘53’ and slew rate to ‘SRE_208MHZ_1_8V_166MHZ_3_3V’ and, PortPin Direction to PORT_PIN_INOUT as shown below: Now, at the bottom you will find the “UnTouchedPortPin ’’ . Click on “+’’ and add PortPins. Now add port pins 0, 1, 2, 3 as per below configuration Now configure MCU component. Select Mcu component in MCAL, and then open the Mcu configuration. In Mcu configuration click on MCUModuleConfiguration and then select “McuModesettingConf” from the dropdown menu as shown below. From McuModeSettingConf, select McuPartitionConfiguration tab. Then open the “McuPartition0Config” tab. And under the McuCore0Configuration or “McuCoreClockEnable” select checkbox and for “McuCoreResetEnable” uncheck the checkbox. Similarly, And under the McuCore1Configuration for “McuCoreClockEnable” select checkbox  and for “McuCoreResetEnable” uncheck the checkbox. Similarly, And under the McuCore2Configuration for “McuCoreClockEnable” select checkbox and for “McuCoreResetEnable” uncheck  the checkbox. After modification it should be as shown below: Now open the “McuPartition1Config” tab. for " Partition1 Clock Enable" select checkmark to true and for " Partition1 Clock Reset Enable" uncheck the checkmark for " CA53 CORE 0 cluster0 Core Clock Enable" select checkmark to true and for " Cortex-A53 Core 0 cluster 0 Clock Reset Enable" uncheck  the checkmark In the McuCore1Configuration, and for " Cortex-A53 Core 1 cluster 0 Clock Reset Enable" uncheck the checkmark In the McuCore2Configuration, for " Cortex-A53 CORE 0 cluster 1 Core Clock Enable" select checkmark to true and for " Cortex-A53 CORE 0 cluster 1 Clock Reset Enable" uncheck the checkmark In the McuCore3Configuration, for " Cortex-A53 CORE 0 cluster 1 Clock Reset Enable" uncheck the checkmark After modification it should be as shown below: Now open the “McuPartition2Config” tab. for " Partition2 Clock Enable" select checkmark to true and for " Partition2 Clock Reset Enable" uncheck the checkmark Now open the “McuPartition3Config” tab. for " Partition3 Clock Enable" select checkmark to true and for " Partition3 Clock Reset Enable" uncheck the checkmark Now the device configurations are complete and the RTD configuration code can be generated. Click ‘Update Code’ from the menu bar. To control the output pin which was just configured, some application code will need to be written. Return to the ‘C/C++’ perspective. If not already open, in the project window click the ‘>’ next to the ‘src’ folder to show the contents, then double click ‘main.c’ file to open it. This is where the application code will be added. Before anything else is done, Initialize the clock tree and apply PLL as system clock, Apply a mode configuration, Initialize all pins using the Port driver by adding – editing code before write code here comment in main function.        /* Initialize the Mcu driver */        Mcu_Init(&Mcu_Config_BOARD_InitPeripherals);        /* Initialize the clock tree and apply PLL as system clock */        Mcu_InitClock(McuClockSettingConfig_0);        /* Apply a mode configuration */        Mcu_SetMode(McuModeSettingConf_0);        /* Initialize all pins using the Port driver */        Port_Init(NULL_PTR); Now replace the logic of for loop as shown below code section in the main function, which will enable the LED blinking for 10 times: You also need to declare and initialize the loop variable uint8 i = 0U; . Then replace the code as below after write your code comment: /*Logic for blinking LED 10 times*/ while (i++ < 10) {           /* Get input level of channels */           Dio_WriteChannel(DioConf_DioChannel_Digital_Output_LED, STD_HIGH);           TestDelay(3000000);           Dio_WriteChannel(DioConf_DioChannel_Digital_Output_LED, STD_LOW);           TestDelay(3000000); } Before the 'main' function, add a delay function as follows: void TestDelay(uint32 delay); void TestDelay(uint32 delay) {      static volatile uint32 DelayTimer = 0;      while(DelayTimer<delay)      {             DelayTimer++;      }      DelayTimer=0; } Update the includes lines at the top of the main.c file to include the headers for the drivers used in the application: Add #include "Mcu.h" #include "Port.h" #include "Dio.h" Build 'Blinking_LED_RTD_AUTOSAR'. Select the project name in 'C/C++ Projects' view and then press 'Build'. After the build completes, check that there are no errors. Open Debug Configurations and select 'Blinking_LED_RTD_with_AUTOSAR_Debug_RAM'. Make sure to select the configuration which matches the build type performed, otherwise it may report an error if the build output doesn’t exist. And make selection as shown in screenshot below. You need to select the ethernet connection for S32 debugger and provide its IP address Click Debug To see the LED blink, click ‘Resume' This code as it will blink the LED 10 times, you can make changes in for loop condition to blink it infinitely.
View full article
This document shows the step-by-step process to create a simple blinking LED application for the S32R45 device using the S32 RTD non-AUTOSAR drivers. For this example used for the S32R45 EVB, connected via ethernet connection through S32 Debugger. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32R45 development package and the S32R45 RTD AUTOSAR 4.4. Both of these are required for the S32 Configuration Tools. Launch S32 Design Studio for S32 Platform Procedure New S32DS Project OR Provide a name for the project, for example 'Blinking_LED_RTD_No_AUTOSAR'. The name must be entered with no space characters. Expand Family S32R45, Select S32R45 Cortex-M7 Click Next And Click '…' button next to SDKs   Check box next to PlatformSDK_S32RXX_4_0_0_S32R45_M7_0. (or whichever latest SDK for the S32R45 is installed). Click OK Now, uncheck the selection mark for other core, i.e. for Cortex-M7-1 , Cortex-M7-2   Click Finish. Wait for project generation wizard to complete, then expand the project within the Project Explorer view to show the contents. To control the LED on the board, some configuration needs to be performed within the Pins Tool. There are several ways to do this. One simple way by double-click on the MEX file. By default, the Pins tool is then presented. For the Blinking LED example, one pin must be configured as output. The S32R45 EVB has an user LED connected pin is PD_05. From the Peripheral Signals tab left to the Pins tool perspective layout, locate Open the Siul2_0 from the peripheral signals tab. And from the drop down menu select “gpio,53 PD_05” option as per shown in the following image. We are using PD_05 for the GPIO usage, so we are routing SIUL2_0 GPIO signal to this pin. Select gpio53 -> PD_05 as shown below : The Direction required! menu will appear. Select Output then OK. In Routing Details view, notice a new line has been added and highlighted in yellow. Add ‘LED’ to the Label and Identifier columns for the PORTD 5 pin. Code Preview Go to Peripherals tool and add Siul2_Dio to enable LED blinking, it adjacent to the user LED on S32R45 EVB. Click on the Peripherals Tool icon from the Eclipse Perspective navigation bar. From the Components view, click on ‘Add a new configuration component…’ button from the Drivers category. This will bring up a list of all configuration components. Locate and then select the ‘Siul2_Dio’ component from the list and click OK. Do not worry about the warning message. It is only indicating that the driver is not already part of the current project. The associated driver package will be added automatically. Note: It may be necessary to change the selection at the top from ‘Present in the tool-chain project’ to ‘All’. The DIO driver provides services for reading and writing to/from DIO Channels. The Gpio_Dio driver requires no further configuration. Click Save to store all changes to the .MEX file. Now the device configurations are complete and the RTD configuration code can be generated. Click ‘Update Code’ from the menu bar. To control the output pin which was just configured, some application code will need to be written. Return to the ‘C/C++’ perspective. If not already open, in the project window click the ‘>’ next to the ‘src’ folder to show the contents, then double click ‘main.c’ file to open it. This is where the application code will be added. Before the pin can be controlled, it needs to be initialized using the configuration information that was generated from the S32 Configuration tools. Initialize all pins using the Port driver by adding the following line: Insert the following line into main, after the comment 'Write your code here': /* Initialize all pins using the Port driver */ Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0); Now, add logic for the LED turn and off. To turn the pin on and off with some delays in-between to cause the LED to blink. Make the delays long enough to be perceptible. Add line to initialize variable uint8 i = 0; Change the code within the provided for loop, and add the following lines: //logic for blinking LED 10 times while (i++ < 10) {        Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 1U);        TestDelay(4000000);        Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 0U);        TestDelay(4000000); } Before the 'main' function, add a delay function as follows: void TestDelay(uint32 delay); void TestDelay(uint32 delay) {    static volatile uint32 DelayTimer = 0;    while (DelayTimer<delay)    {        DelayTimer++;    }    DelayTimer=0; } Update the includes lines at the top of the main.c file to include the headers for the drivers used in the application: Remove #include "Mcal.h" Add #include "Siul2_Port_Ip.h" #include "Siul2_Dio_Ip.h" Build 'Blinking_LED_RTD_No_AUTOSAR'. Select the project name in 'C/C++ Projects' view and then press 'Build'. After the build completes, check that there are no errors. Open Debug Configurations and select 'Blinking_LED_RTD_No_AUTOSAR_Debug_RAM'. Make sure to select the configuration which matches the build type performed, otherwise it may report an error if the build output doesn’t exist. Now, you need to Select the Interface (Ethernet or USB) by which the S32 Debug Probe is connected. If connected via USB and this option is selected for interface, then the COM port will be detected automatically (in the rare event where 2 or more S32 Debug Probes are connected via USB to the host PC, then it may be necessary to select which COM port is correct for the probe which is connected to the EVB) If connected via Ethernet, enter the IP address of the probe. See the S32 Debug Probe User Manual for ways to determine the IP address. Click Debug To see the LED blink, click ‘Resume'. This code as it will blink the LED 10 times, you can make changes in for loop condition to blink it infinitely.
View full article
This document shows the step-by-step process to create a simple blinking LED application for the S32G family using the S32 RTD AUTOSAR drivers. This example used for the S32G-VNP-RDB2 EVB, connected via ethernet connection through S32 Debugger. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32G development package and the S32 RTD AUTOSAR 4.4. Both of these are required for the S32 Configuration Tools. Launch S32 Design Studio for S32 Platform Procedure New S32DS Project OR Provide a name for the project, for example 'Blinking_LED_RTD_With_AUTOSAR'. The name must be entered with no space characters. Expand Family S32G2, Select S3G274A_Rev2 Cortex-M7 Click Next Click '…' button next to SDKs   Check box next to PlatformSDK_S32XX_2022_07_S32G274A_Rev2_M7_0. Click OK And also, uncheck the other cores Cortex_M7_1 ,  Cortex_M7_2.   Click Finish. Wait for project generation wizard to complete, then expand the project within the Project Explorer view to show the contents. To control the LED on the board, some configuration needs to be performed within the Pins Tool. There are several ways to do this. One simple way by double-click on the MEX file. Select the overview tab and disable Pins tool. Make sure to overview tab windows shows settings shown as below.  Here, we are disabling pin tools and using MCAL driver from peripheral tools for using AUTOSAR drivers. Now from Overview menu, select peripheral tools and double click to open it. In the driver sections, “Siul2_Port_1 driver” is the non-AUTOSAR version driver and so it must be replaced. Right click on ‘Siul2_Port_1’ and remove it. Keep the osif_1 driver as it is. Click on the ‘+’ next to the MCAL box. Locate and then select the ‘MCU’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Dio’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Port’ component from the list and click OK. Now components tab should show like below : Now we required to configure the different MCAL drivers that we added. Starting with Dio configuration, open the Dio configuration. Now, open the ‘DioGeneral’ tab, and select checkmark as per shown below: Now, open the ”DioConfig” tab. In that, select  “+” sign adjacent to Dio Channel. Then edit Name to Digital_Output_LED and “Dio Channel Id”  to ‘6’ instead of ‘0’. From the schematic for S32G-VNP-RDB2 EVB, we can select signal line based on your choice for the LED color for the multicolor RGB LED. Now, checking for blue user LED from the schematic, channel 6 is connected to blue LED signal, so we use channel 6 signal line to the chip on the blue LED. Similarly, so you can select signal line based on LED color you select. Now Select Port tab for Port configuration. And open the Port Configuration tab, and from that open “PortConfigSet” tab. Change the PortPin Mscr to 6 , PortPin Direction to PORT_PIN_INOUT. After change it should be as below. At the bottom you will find the “UnTouchedPortPin ’’ . Click on “+’’ and add PortPins. Now add 4 port pins as per below configuration. Pins 0, 1, 4, and 5 should be setup. Now configure MCU component. Select Mcu component in MCAL, and then open the Mcu configuration. In Mcu configuration select “McuModesettingConf” from the dropdown menu as shown below. Select ‘McuPartition0Config’ and deselect checkbox for CM7_0 Under MCU Control, CM7_1 Under MCU Control, CM7_2 Under MCU Control as marked below. And it should show as below Now select the Mcupartition1Config and uncheck checkmarks from the selection boxes as shown below Now the device configurations are complete and the RTD configuration code can be generated. Click ‘Update Code’ from the menu bar. To control the output pin which was just configured, some application code will need to be written. Return to the ‘C/C++’ perspective. If not already open, in the project window click the ‘>’ next to the ‘src’ folder to show the contents, then double click ‘main.c’ file to open it. This is where the application code will be added. Before anything else is done, Initialize the clock tree and apply PLL as system clock, Apply a mode configuration, Initialize all pins using the Port driver by adding – editing code before write code here comment in main function.          Mcu_Init(&Mcu_Config_BOARD_InitPeripherals);     /* Initialize the clock tree and apply PLL as system clock */     Mcu_InitClock(McuClockSettingConfig_0);     /* Apply a mode configuration */     Mcu_SetMode(McuModeSettingConf_0);     /* Initialize all pins using the Port driver */     Port_Init(NULL_PTR); Now replace the logic of for loop as shown below code section, which will enable the LED blinking for 10 times: First define the variable volatile uint8 level; globally above the main function. You also need to declare and initialize the loop variable uint8 i = 0U. Then replace the code as below: while (i++ < 10) {       Dio_WriteChannel(DioConf_DioChannel_Digital_Output_LED, STD_HIGH);       level = Dio_ReadChannel(DioConf_DioChannel_Digital_Output_LED);       TestDelay(2000000);       Dio_WriteChannel(DioConf_DioChannel_Digital_Output_LED, STD_LOW);       level = Dio_ReadChannel(DioConf_DioChannel_Digital_Output_LED);       TestDelay(2000000); } Before the 'main' function, add a delay function as follows: void TestDelay(uint32 delay); void TestDelay(uint32 delay) {     static volatile uint32 DelayTimer = 0;     while(DelayTimer<delay)     {         DelayTimer++;     }     DelayTimer=0; } Update the includes lines at the top of the main.c file to include the headers for the drivers used in the application: Add #include "Mcu.h" #include "Port.h" #include "Dio.h" Build 'Blinking_LED_RTD_AUTOSAR'. Select the project name in 'C/C++ Projects' view and then press 'Build'. After the build completes, check that there are no errors. Open Debug Configurations and select 'Blinking_LED_RTD_with_AUTOSAR_Debug_RAM'. Make sure to select the configuration which matches the build type performed, otherwise it may report an error if the build output doesn’t exist. And make selection as shown in screenshot below. You need to select the ethernet connection for S32 debugger and provide its IP address Click Debug To see the LED blink, click ‘Resume' This code as it is will blink the LED 10 times, you can make changes in for loop condition to blink it infinitely.
View full article