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:
Requirements:  Installed GHS Multi IDE  Installed S32 Design Studio   Procedure:  Start S32 Design Studio. On main menu bar click on Help -> Install New Software, click on Add button and local:    Navigate to your GHS installation and select Compiler, Eclipse folder and click on OK button:     Select target MCU family and click on Next button:    When installation is done, you should be able select GHS compiler in New Project Wizard.   
View full article
Included in the Radar Software Development Kit (RSDK) is an example project ‘RSDK_S32DS_template’. This example shows an example radar application which uses the Arm Cortex-A53 and accelerators SPT, LAX and BBE32 DSP. The A53 core is used to execute the Linux application and launches the SPT, LAX, and BBE32 DSP cores. In this HOWTO, we will show how to load the project into the S32 Design Studio workspace and build. Debugging instructions, using the S32 Debugger and S32 Debug Probe are provided in separate documents for each accelerator. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32R4xx development package, the Radar extension package for s32R4xx, and the BBE32 DSP Add-On Package for S32R45.   Install the ‘S32R45_RSDK_0.9.4_D2112’ last. It contains the ‘RSDK_S32DS_template’ example project. This package must be downloaded from the NXP website. If the .exe version is used, then the RSDK installer will install an XML file containing the install path of the RSDK into the S32 Design Studio installation directory. A prompt during the installation process will request the user to locate the S32DS installation directory. If the S32DS installation folder doesn’t exist, then it can’t be selected and the file will be missed. So, it is important to install this after installing S32 Design Studio and to use the .exe version. Once installed, S32 Design Studio will be able to locate the project from the New Project from Example wizard. If the .zip version is used, then the XML file must be updated manually and then placed in the S32DS installation folder. For example, with the 0.9.4 version of the RSDK: Locate the XML file in the RSDK installation folder. It is located in the base installation folder: "C:\NXP\S32R45_RSDK__0.9.4\swm.rsdk.s32r45.0.9.4.xml" Edit the following line by inserting the path to the RSDK: <variable name="RSDK_S32R45_0_9_4_DIR" value="${{RSDK_INSTALL_DIR}}" /> change to: <variable name="RSDK_S32R45_0_9_4_DIR" value="C:/NXP/S32R45_RSDK__0.9.4" /> Copy file to S32DS install folder. For example, if S32 Design Studio v3.4 installed: “C:\NXP\S32DS.3.4\S32DS\integration” Procedure Create the Project. Launch S32 Design Studio for S32 Platform and execute the following command: File -> New -> New S32DS Project from Example OR from the Dashboard Enter search text ‘rsdk’. The RSDK_S32DS_template project will be shown. Select it and click Finish. Examine the project Notice there are separate projects for each core. This project structure is due to the separate compilers, linkers, and assemblers required for each core type. When the A53 project is built, it will automatically build the other projects and then include the executable outputs into the A53 executable output. This way the code for all cores is loaded at one time and each core can be launched by the A53 core.
View full article
Installation & Activation HOWTO: Activate S32 Design Studio   HOWTO: S32 Design Studio - Offline Install of Extensions and Updates  S32DS Extensions & Updates: Explanation and How To Use  HOWTO: Install Lauterbach TRACE32 debugger plug-in into S32 Design Studio HOWTO: Install GHS Compiler Plugin    Getting Started HOWTO: S32 Design Studio - Create a New S32DS Project from Example  HOWTO: S32 Design Studio - Create a New Application Project  HOWTO: Create a Blinking LED example project using S32K1xx RTD with AUTOSAR HOWTO: Create a Blinking LED example project using S32K1xx RTD without AUTOSAR HOWTO: Create a Blinking LED application project for S32G using S32 RTD No AUTOSAR HOWTO: Create a Blinking LED application project for S32G using S32 RTD with AUTOSAR HOWTO: Create a Blinking LED application project for S32R45 using S32 RTD No AUTOSAR HOWTO: Create a Blinking LED application project for S32R45 using S32 RTD with AUTOSAR HOWTO: Create a Blinking LED application project for S32R41 using S32 RTD No AUTOSAR  HOWTO: Create a Blinking LED application project for S32R41 using S32 RTD AUTOSAR HOWTO: Create a simple blinking LED project using S32 Config Tool (S32V2xx)  HOWTO: Create APEX2 Project From Example in S32DS for S32 Platform  HOWTO: Create An ISP Project From Example in S32DS for S32 Platform HOWTO: Create New Project from Example ‘RSDK_S32DS_template’    Build tools & Standard libraries  HOWTO: Build a Project and Setup a Debug Configuration for debugging in S32 Design Studio  HOWTO: Add a static library file into S32 Design Studio GCC project HOWTO: Link a binary file(s) into the application project using GNU build tools   HOWTO: Display Percentage Of Memory Usage At End Of Build    Debug  & Flash Programming HOWTO: Setup S32V234 EVB for debugging with S32DS for Vision and Linux BSP  Using GDB Server Monitor Commands from Eclipse GDB Console HOWTO: Setup static IP address for S32 debug probe  HOWTO: Build a Project and Setup a Debug Configuration for debugging in S32 Design Studio  HOWTO: Start S32 Debugger from S32 Design Studio on S32G274A EVB HOWTO: Start S32 Debugger from S32 Design Studio on S32R45 EVB  HOWTO: Start S32 Debugger from S32 Design Studio on S32R41 EVB HOWTO: Command Line GDB Debugging with S32 Debug Probe for S32G2xx HOWTO: Command Line GDB Debugging with S32 Debug Probe for S32R45  HOWTO: Command Line GDB Debugging with S32 Debug Probe for S32R41 HOWTO: JTAG Flash Programming with S32 Debugger and S32 Debug Probe for S32G274A EVB HOWTO: JTAG Flash Programming with S32 Debugger and S32 Debug Probe for S32R45 EVB  HOWTO: JTAG Flash Programming with S32 Debugger and S32 Debug Probe for S32R41 EVB  HOWTO: Secure Debugging from S32DS IDE with S32 Debugger and S32 Debug Probe on S32G274A HOWTO: Secure Debugging from S32DS IDE with S32 Debugger and S32 Debug Probe on S32R45  HOWTO: Start Trace with S32 Debugger and S32 Debug Probe on S32G2xx HOWTO: Start Trace with S32 Debugger and S32 Debug Probe on S32R45  HOWTO: Start Trace with S32 Debugger and S32 Debug Probe on S32V2xx  Sharing Debug Configuration with Eclipse Debugging the Startup Code with Eclipse and GDB | MCU on Eclipse  HOWTO: Add a new debugger configuration to an existing project  HOWTO: Command Line JTAG flash programming with S32 Debug Probe on S32G274A EVB HOWTO: Command Line JTAG flash programming with S32 Debug Probe on S32R45 EVB  HOWTO: Command Line JTAG flash programming with S32 Debug Probe on S32R41 EVB HOWTO: Use FlashSDK to add support for QuadSPI flash memory devices for S32 Flash Tool  HOWTO: Program Serial RCON using S32 Debug Probe S32G2xx  HOWTO: Program Serial RCON using S32 Debug Probe S32R4xx on S32R45 EVB  Secure Debug Support on S32K3 | PEmicro  HOWTO: Debugging LAX on S32R45 Using S32 Debugger HOWTO: Debugging SPT on S32R45 Using S32 Debugger HOWTO: Debugging BBE32 DSP on S32R45 Using S32 Debugger HOWTO: Debugging SPT on S32R41 Using S32 Debugger   S32 Configuration Tools HOWTO: Use DCD Tool To Create A Device Configuration Data Image  HOWTO: Use IVT Tool To Create A Blob Image HOWTO: Use IVT Tool To Create A Blob Image S32G274A HOWTO: Use IVT Tool To Create A Blob Image S32R45    Real-Time Drivers (RTD), S32 SDK & Other SDKs HOWTO: Working with AMMCLib SDKs  HOWTO: Add custom SDK into existing project  HOWTO: Migrate S32K1xx SDK project from SDK v4.0.1 to v4.0.2  Implementing FreeRTOS Performance Counters on ARM Cortex-M | MCU on Eclipse  HOWTO: Move FreeRTOS Heap into DTCM memory - S32K3xx + RTD   General Usage HOWTO: S32 Design Studio Command Line Interface  HOWTO: Generate S-Record/Intel HEX/Binary file  HOWTO: Migrate Application Projects from S32DS for Vision 2018.R1 to S32DS 3.x  HOWTO: Add user example into S32DS   Troubleshooting Troubleshooting: Incompatible JVM Error When Launching S32 Flash Tool v2.1 Troubleshooting: PEmicro Debug Connection: Target Communication Speed  Troubleshooting: Indexer errors on header file  Troubleshooting: PEMicro Debugging: PIT and STM modules cannot count when Debug Mode is entered  Troubleshooting: PEMicro Debugging: Problems resuming from breakpoint in vTaskDelay  Troubleshooting: Quick Fix Option in Problems View  Troubleshooting: S32 Design Studio exits unexpectedly or Installer rolls back immediately following activation code entry  Troubleshooting: Activation fails with error message FNP ERROR 0  Troubleshooting: Can't See AMMCLib for S32K3 in S32DS Extensions and Updates Troubleshooting: Java Error When Config Tools Used From Command Line  
View full article
When a new application project is created using the New Project Wizard, it is possible to select the debugger to be used. This results in the associated debugger configurations being created within the new project. But what if support for multiple debuggers is required or it is desired to switch to a different debugger? There are easy ways to resolve this. One is as simple as creating a new debug configuration. Another method is by creating new application project, selecting the new debugger to be supported. Then either repurposing the associated debug configuration or duplicating then modifying the debug configuration to support instead the previously existing project. This minimizes the effort by benefiting from the automation of the New Project Wizard.   Detailed below are the steps to add a new debug configuration.  Create A New S32 Debugger Configuration Load the existing project. For this demonstration, the SDK project ‘hello_world_s32v234’ will be used. Select the project so it appears highlighted in blue. Notice that the other project, ‘New_App_Project’, is bold text. This is because the main.c file open in the editor window to the right is the currently selected source file and is from this project. This has no effect on the process detailed in this document. Check that the existing project has been build and the executable is present. If the executable is not present, then an error will be displayed within the Debug Configurations menu and the executable file will need to be selected in a later additional step after it has been created. Open the Debug Configurations menu. Run -> Debug Configurations   Now select the Debugger Group for which you wish to create the new configuration. In this case, we will select ‘S32 Debugger’. Next, click ‘New Launch Configuration’ Now a new Debug Configuration has been created for your project and for the S32 Debugger. Most of the fields are already completed for you. Select the Debugger tab to see the source of the error message. The error message indicates ‘Specify Device and Core’. So click on ‘Select device and core’. Now expand the lists until the Device and Core are visible. Select the correct core for your project. In the demonstration example, the correct Device and Core are ‘S32V234’ and ‘M4’, respectively. Click OK, when done. If you have a debug probe connected, it may have been detected. If not, the Debug Probe Connection section will need to be completed. Now select the ‘Common’ tab to setup the storage location for this new Debug Configuration. Select ‘Shared file’ and then ‘Browse…’ Expand the lists until ‘Project_Settings/Debugger’ is open. Select ‘Debugger’, then click OK. Now the basic debug configuration settings are complete. It is now ready to be used and the Debug button could be clicked to start debug. Otherwise, you may have more customizations to make, such as for Attach Mode. Repurpose S32 Debugger Configuration From A New Project Create new project New -> S32DS Application Project New Project Wizard, processor and toolchain page Enter a project name Select the device and core to match the existing project If necessary, select the toolchain to match the existing project Click Next New Project Wizard, cores and parameters page Select the number of cores to match the existing project Select the debugger, S32 Debugger If necessary, select other parameters to match the existing project Click Finish   Open existing project which does not already have the S32 Debugger debug configurations (for this demonstration, we will use the hello_world_s32v234 example project from the S32 SDK) Copy debug configurations and modify settings to adapt to existing project Run -> Debug Configurations... Debug Configurations window Within the S32 Debugger grouping, select the debug configuration for the new project which corresponds to the build configuration and core of the existing project Change the name of the debug configuration. Change the portion of the name containing the project name to match the name of the existing project. Main tab Project field Click Browse... Select existing project C/C++ Application Click Search Project... Select the Elf file Common tab Save as field Click Browse... Select {existing_project_name}\Project_Settings\Debugger Debugger tab, Debug Probe Connection Setup connection parameters Click Apply Repeat as needed for all core/build config options The existing project now has the S32 Debugger configurations and is ready for debug with the S32 Debug Probe.
View full article
The S32 Debugger included within the S32 Design Studio for S32 Platform IDE provides the ability to access the flash programming and debugging of the S32 Debug Probe via GDB command line. This document provides only the necessary commands specific to launching a debug session on NXP devices. It does not cover general GDB command line operations, these are covered in detail in the GNU communities and other public websites which are not associated with NXP.   Preparation Setup the software tools Install S32 Design Studio for S32 Platform  Install the Development Package for the device you are debugging. In this case, the S32G2xx development package. This package is important as the S32 Debugger support component contains the device-specific Python scripts required for initialization of the cores. Setup the hardware Confirm the setup of the S32G274A evaluation board.  Configure the JTAG. The S32G274A evaluation board supports both 10- and 20- pin JTAG connections. The default board configuration is set to 20-pin, change the position of the jumper J59 from 2-3(default)  to 1-2, if you are using the 10 Pin JTAG interface. Both are supported by the S32 Debugger and S32 Debug Probe. Connect the power supply cable Setup the S32 Debug Probe Connect the S32 Debug Probe to the evaluation board via JTAG cable. Refer to the S32 Debug Probe User Manual for installation instructions. Use the JTAG connection as was confirmed in the previous step. Connect the S32 Debug Probe to the host PC via USB OR via Ethernet (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 Create new or open existing 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 As separate debug threads need to be started for each core to be debugged, and the method for launching a debug thread differs depending upon whether it is a primary core or secondary core and if the executable image will be loaded or if the executable is already running and the debugger just needs to be attached. These scenarios will be covered by the following 3 sections: Primary Core Load Image and Run: The application image will be loaded directly to memory by the debugger and then initialized and started. The primary core will launch any secondary cores used by the application. Secondary Cores: The primary core has launched a secondary core, it is now running and the debugger will connect through the attach method. Primary Core Image Already In Memory and Running: The primary core has already been initialized and launched by other means, such as via a Linux OS on the target, so the debugger will connect through the attach method without initializing or loading the image to memory.   Please proceed with the section which applies to the core for which you are starting a debug thread.   Primary Core Load Image and Run Prepare the initialization script for the core(s) to be debugged. Open the core initialization Python script: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\scripts\s32g2xx\s32g2xx_generic_bareboard_all_cores.py Uncomment the following lines: #_JTAG_SPEED = 16000 #_PROBE_IP = "10.112.101.91" #_GDB_SERVER_PORT = 45000 #_CORE_NAME = 'M7_0' #_RESET_TYPE = "default" #_RESET_DELAY = 1 #_REMOTE_TIMEOUT = 60 #_IS_LOGGING_ENABLED = True This file is used by the S32 Debugger within the S32 Design Studio IDE where the settings are provided from the GUI, so these lines are commented out in order to allow the GUI settings to have control. The commented lines are provided so the script could more easily be run by the command line method. Update the IP address line (_PROBE_IP) to match the IP address of the S32 Debug Probe which is connected to your PC. See the user guide for the S32 Debug Probe for details on how to obtain the IP address.  Update the core name (_CORE_NAME), if necessary. See s32g2xx_context.py for complete list of supported cores. Save the file with a new name to preserve the original. For example, s32g2xx_gen_bb_all_c_my_probe.py. This ensures the S32 Debugger will still function correctly. Launch GTA server. From command prompt or Windows File Explorer run the command: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\Server\gta\gta.exe  Should see a window appear like this: Ensure Environment Variable for Python is set. From command prompt, run the command:  set PYTHONPATH={S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7;{S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages Start GDB. In a command window, run the command: Windows OS: {S32DS Install Path}\S32DS\tools\gdb-arm\arm32-eabi\bin\arm-none-eabi-gdb-py.exe (for arm32) OR {S32DS Install Path}\S32DS\tools\gdb-arm\arm64-eabi\bin\aarch64-none-elf-gdb-py.exe (for arm64) Linux OS: arm-none-eabi-gdb-py A (gdb) prompt should now be displayed in the command window: From (gdb) prompt, enter the following commands(in this order): source {S32DS Install Path}\\S32DS\\tools\\S32Debugger\\Debugger\\scripts\\s32g2xx\\s32g2xx_gen_bb_all_c_my_probe.py This specifies the script for initialization. py board_init() This initializes the board. It should only be called for the initial core. In a multicore debugging workflow, the debugger launch for additional cores would omit this step. py core_init() This initializes the core specified in the initialization script in step 1. Now standard GDB commands may be used. For example, you may wish to load an ELF file: file {S32DS Workspace Path}\\New_S32G_Project\\New_S32G_Project_M7_0\\Debug_RAM\\New_S32G_Project_M7_0.elf load   Secondary Cores After completing the launch of debug for the primary core, it is possible to perform multicore debug by launching GDB debugging on the secondary cores. Some additional steps will need to be performed from within the primary core GDB session, enter the following commands: set *0x34100000 = 0x34200000  set *0x34100004 = 0x34100025 set *0x34100024 = 0xFFFEF7FF set *0x34200000 = 0x34300000 set *0x34200004 = 0x34200025 set *0x34200024 = 0xFFFEF7FF b main c These lines prepare the environment for launching debugging on secondary cores. This will allow for multicore debugging in the case of separate ELF files for each core. These can be found in the Run Commands field of the Startup tab on the Debug Configuration for the primary core within S32 Design Studio IDE, of any multicore project created from the New Application Project Wizard. Note: If there is just one ELF file for all cores, then these 'set *0x... = 0x...' commands should be skipped. In general, it will be correct to set the break-point at main, as shown, but this might need to be changed depending on when the secondary cores are started within the project. Prepare the initialization script for the secondary core to be debugged. Open the core initialization Python script: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\scripts\s32g2xx\s32g2xx_attach.py This is a different script than the one used for the primary core. It is designed to launch a debug session on a core which is already initialized and running. Edit the script for the secondary core to be debugged. Since this script is setup for the primary core, some adjustments need to be made to setup for a secondary core Uncomment the following lines: #_JTAG_SPEED = 14000 #_GDB_SERVER_PORT = "127.0.0.1:45000" #_RESET_TYPE = "default" #_PROBE_IP = "s32dbg:10.222.24.64" #_CORE_NAME = 'M7' #_RESET_DELAY = 1 #_CMD_TIMEOUT = 7200 #_REMOTE_TIMEOUT = 60 #_IS_LOGGING_ENABLED = True #_SOC_NAME = "S32G274A" Make the following changes to the lines: _JTAG_SPEED = 14000 ->  None _GDB_SERVER_PORT = "127.0.0.1:45000" -> 45000 _RESET_TYPE = "default" _PROBE_IP = "s32dbg:10.222.24.64" -> None _CORE_NAME = 'M7' -> 'M7_1' (this should be set to match the name of the core to be debugged, see s32g2xx_context.py for complete list) _RESET_DELAY = 1 _CMD_TIMEOUT = 7200 _REMOTE_TIMEOUT = 60 _IS_LOGGING_ENABLED = True _SOC_NAME = "S32G274A" Save the file with a new name to preserve the original. For example, s32g2xx_attach_my_probe_core1.py. This ensures the S32 Debugger will still function correctly. The existing GTA server is used, so do not launch a new one. Open an new command window and follow similar steps as done for the primary core. Setup the Python environment variable, if not done globally set PYTHONPATH={S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7;{S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages Start GDB Windows OS: {S32DS Install Path}\S32DS\tools\gdb-arm\arm32-eabi\bin\arm-none-eabi-gdb-py.exe (for arm32) OR {S32DS Install Path}\S32DS\tools\gdb-arm\arm64-eabi\bin\aarch64-none-elf-gdb-py.exe (for arm64) Linux OS: arm-none-eabi-gdb-py A (gdb) prompt should now be displayed in the command window: From (gdb) prompt, enter the following commands(in this order): source {S32DS Install Path}\\S32DS\\tools\\S32Debugger\\Debugger\\scripts\\s32g2xx\\s32g2xx_attach_my_probe_core1.py This specifies the script for initialization. We will not execute the py board_init() as this was already done for the primary core. py core_init() This initializes the core specified in the initialization script in step 2. Now standard GDB commands may be used. For example, you may wish to load an ELF file: file {S32DS Workspace Path}\\S32G_MultiCore\\S32G_MultiCore_M7_1\\Debug_RAM\\S32G_MultiCore_M7_1.elf load Repeat 3-6 for each additional core. Primary Core Image Already in Memory and Running The core is running and does not need to be initialized. Prepare the initialization script for the core to be debugged. Open the core initialization Python script: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\scripts\s32g2xx\s32g2xx_attach.py This is a different script than the one used for the primary core. It is designed to launch a debug session on a core which is already initialized and running. Edit the script for the secondary core to be debugged. Since this script is setup for the primary core, some adjustments need to be made to setup for a secondary core Uncomment the following lines: #_JTAG_SPEED = 14000 #_GDB_SERVER_PORT = "127.0.0.1:45000" #_RESET_TYPE = "default" #_PROBE_IP = "s32dbg:10.222.24.64" #_CORE_NAME = 'M7' #_RESET_DELAY = 1 #_CMD_TIMEOUT = 7200 #_REMOTE_TIMEOUT = 60 #_IS_LOGGING_ENABLED = True #_SOC_NAME = "S32G274A" Make the following changes to the lines: _JTAG_SPEED = 14000 _GDB_SERVER_PORT = "127.0.0.1:45000" -> 45000 _RESET_TYPE = "default" _PROBE_IP = "s32dbg:10.222.24.64" -> (enter the IP address of your probe) _CORE_NAME = 'M7' -> 'M7_0' (this should be set to match the name of the core to be debugged, see s32g2xx_context.py for complete list) _RESET_DELAY = 1 _CMD_TIMEOUT = 7200 _REMOTE_TIMEOUT = 60 _IS_LOGGING_ENABLED = True _SOC_NAME = "S32G274A" Save the file with a new name to preserve the original. For example, s32g2xx_attach_my_probe_core0.py. This ensures the S32 Debugger will still function correctly. Launch GTA server. From command prompt or Windows File Explorer run the command: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\Server\gta\gta.exe Should see a window appear like this: Ensure Environment Variable for Python is set. From command prompt, run the command: set PYTHONPATH={S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7;{S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages Start GDB. In a command window, run the command: Windows OS: {S32DS Install Path}\S32DS\tools\gdb-arm\arm32-eabi\bin\arm-none-eabi-gdb-py.exe (for arm32) OR {S32DS Install Path}\S32DS\tools\gdb-arm\arm64-eabi\bin\aarch64-none-elf-gdb-py.exe (for arm64) Linux OS: arm-none-eabi-gdb-py A (gdb) prompt should now be displayed in the command window: From (gdb) prompt, enter the following commands(in this order): source {S32DS Install Path}\\S32DS\\tools\\S32Debugger\\Debugger\\scripts\\s32g2xx\\s32g2xx_attach_my_probe_core0.py This specifies the script for debugger initialization. Do not execute the py board_init() as this will initialize the board, and reset the currently executing application, which is not desired for this case. py core_init() This initializes the debugger connection to the core specified in the initialization script in step 1. Now standard GDB commands may be used. For example, you may wish to load an ELF file: file {S32DS Workspace Path}\\S32G_Multicore\\S32G_Multicore_M7_0\ \Debug_RAM\\S32G_Multicore_M7_0.elf load After completing the launch of debug for the primary core, it is possible to perform multicore debug by launching GDB debugging on the secondary cores. See section ‘Secondary Cores’ for each additional core to be debugged.
View full article
Trace functionality is supported in the S32 Debugger for A53 cores on the S32G, RAM-target builds. With Trace, you can record some execution data on an application project and then review it to determine the actions and data surrounding an event of interest.   This document outlines the method to begin using Trace on the S32G2xx device. We start by creating a project on which to execute the trace, however, you may start at step 2, if you are starting with an existing project. Please note, you will need to have debug configurations for the S32 Debugger setup for each core which you intend to capture trace. If you do not already have such configurations, you may copy them from another project and adapt them to the new project as shown in HOWTO: Add a new debugger configuration to an existing project.   Create a new application project, selecting the 'S32G274A_Rev2 Cortex-A53' processor and 'S32 Debugger' options.    There should now be 4 new application projects in your workspace. One for each A53 core. The first core of the S32G274A, A53_0_0, is also a possible boot core, so this project will have build configurations for RAM and FLASH. The other A53 cores (0_1, 1_0, 1_1) will not. Build all projects for Debug_RAM and check that they build clean before proceeding. Building the A53_0_0 project will build all projects and the resulting ELF file will contain the output of all 4. Open 'Debug Configurations...' and select the 'Debug_RAM' configuration for the first core (A53_0_0_Debug_RAM_S32Debug). Select the 'Debugger' tab. Enter the Debug Probe Connection settings as appropriate for your hardware setup. Click Apply. Now select the Launch Group configuration for 'Debug_RAM'. It is important to use the launch group to start the debug for each core, not just because it makes it easier, but also because it is necessary to allow for some delay after the first A53 core is started before bringing the other A53 cores from reset to debug state. Press Debug Once the code is loaded to the target and the debugger has started each core and executed to the first line within main(), then it is ready to perform any of the standard debug functions including Trace. Trace does not start automatically, it must be turned on before it will start logging data. To do this, it is necessary to add the view 'Trace Commander'. It can be found by either Window -> Show View -> Other, then search for 'Trace Commander' or enter 'Trace Commander' in the Quick Access field of the toolbar and select Trace Commander from the list. The Trace Commander view will show in the panel with the Console, Problems, etc. Double-click on the tab to enlarge it. Click on the configure button to change settings. Click on the Advanced Trace Generators configuration button For each core to be logged, set the associated ELF file. Select the core, click Add, then '...', and select the elf file for that core. Select Data Streams. Now it is possible to change how the data is captured. Since the buffers have finite memory, they can be set to collect data until full, or to overwrite. If set to One buffer, the data will be collected until the buffer is full, then data collection stops. It is useful to gather data when starting logging from a breakpoint to gather data during execution of a specific section of code. If set to Overwrite, the data collection continues and starts overwriting itself once the buffer is full. This is useful when trying to gather data prior to a breakpoint triggered by a condition.  To turn on the Trace logging, click on the 'Close this trace stream' button. The Trace is now enabled. To collect trace data, the cores must be executing. First double-click the Trace Commander tab to return to the normal Debug Perspective view. Then, one by one, select the main() thread on each core and press Resume to start them all. If collecting from a breakpoint, start the code first with Trace disabled, wait for the breakpoint to be reached, then enable the Trace. Allow the cores to run for a period of time to gather the data, then press Suspend on each one until they are all suspended. Look to the Trace Commander tab to see that the data icon is no longer shaded and click on it to upload the trace data. A new tab, Analysis Results, has appeared. Double-click this tab to see it better. Click on the arrow next to ETF 0 to show the data collected in the trace buffer. Notice there are 5 separate views on the captured data: Trace (raw data), Timeline, Code Coverage, Performance, and Call Tree. Trace - this is the fully decoded trace data log Timeline - displays the functions that are executed in the application and the number of cycles each function takes, separate tabs for each core Code Coverage - displays the summarized data of a function in a tabular form, separate tabs for each core Performance - displays the function performance data in the upper summary table and the call pair data for the selected function and it's calling function Call Tree - shows the call tree for identification of the depth of stack utilization See the S32DS Software Analysis Documentation for more details on settings, ways to store the logged data, etc.
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
This document shows the step-by-step process to create a simple blinking LED application for the S32G family using the S32 RTD non-AUTOSAR drivers. For 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_No_AUTOSAR'. The name must be entered with no space characters. Expand Family S32G2, Select S32G274A_Rev2 Cortex-M7 Click Next Now, uncheck the selection mark for other two cores.    Click '…' button next to SDKs   Check box next to PlatformSDK_S32XX_2022_07_S32G274A_Rev2_M7_0. (or whichever latest SDK for the S32G 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. By default, the Pins tool is then presented. For the Blinking LED example, one pin must be configured as output. The S32G-VNP-RDB2 EVB has an RGB LED for which each color is connect to a separate pin on the S32G-VNP-RDB2 EVB. For the blue LED the desired pin is PA_06. 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,6 PA_06” option as per shown in the following image. We are using PA_06 for the GPIO usage, so we are routing the SIUL2_0 GPIO signal to this pin. (This pin is also available for other modules like -FR, FTM, SPI_1) . 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 0 pin. Code Preview Go to Peripherals tool and add Siul2_Dio to enable LED blinking, it adjacent to the Blue LED on S32G-VNP-RDB2 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_1 tab and select the check mark 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 will blink the LED 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 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
The S32 Debugger included within the S32 Design Studio for S32 Platform IDE provides the ability to access the flash programming and debugging of the S32 Debug Probe via GDB command line. This document provides only the necessary commands specific to launching a debug session on NXP devices. It does not cover general GDB command line operations, these are covered in detail in the GNU communities and other public websites which are not associated with NXP.   Preparation Setup the software tools Install S32 Design Studio for S32 Platform  Install the Development Package for the device you are debugging. In this case, the S32R4xx development package. This package is important as the S32 Debugger support component contains the device-specific Python scripts required for initialization of the cores. Setup the hardware Confirm the setup of the S32R45 evaluation board.  Connect the power supply cable Setup the S32 Debug Probe. Refer to the S32 Debug Probe User Manual for installation instructions. Connect the S32 Debug Probe to the evaluation board via JTAG cable.   Connect the S32 Debug Probe to the host PC via USB OR via Ethernet (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 Create new or open existing 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 As separate debug threads need to be started for each core to be debugged, and the method for launching a debug thread differs depending upon whether it is a primary core or secondary core and if the executable image will be loaded or if the executable is already running and the debugger just needs to be attached. These scenarios will be covered by the following 3 sections: Primary Core Load Image and Run: The application image will be loaded directly to memory by the debugger and then initialized and started. The primary core will launch any secondary cores used by the application. Secondary Cores: The primary core has launched a secondary core, it is now running and the debugger will connect through the attach method. Primary Core Image Already In Memory and Running: The primary core has already been initialized and launched by other means, such as via a Linux OS on the target, so the debugger will connect through the attach method without initializing or loading the image to memory.   Please proceed with the section which applies to the core for which you are starting a debug thread.   Primary Core Load Image and Run Prepare the initialization script for the core(s) to be debugged. Open the core initialization Python script: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\scripts\s32r45\s32r45_generic_bareboard_all_cores.py Uncomment the following lines: # _JTAG_SPEED = 50 # _PROBE_IP = "10.81.18.242" # _GDB_SERVER_HOST = 'localhost' # _GDB_SERVER_PORT = 45000 # _CORE_NAME = 'A53_0' # _RESET_TYPE = "default" # _RESET_DELAY = 1 # _REMOTE_TIMEOUT = 100 # _IS_LOGGING_ENABLED = True This file is used by the S32 Debugger within the S32 Design Studio IDE where the settings are provided from the GUI, so these lines are commented out in order to allow the GUI settings to have control. The commented lines are provided so the script could more easily be run by the command line method. Update the IP address line (_PROBE_IP) to match the IP address of the S32 Debug Probe which is connected to your PC. See the user guide for the S32 Debug Probe for details on how to obtain the IP address. Update the core name (_CORE_NAME), if necessary. See s32r45_context.py for complete list of supported cores. Save the file with a new name to preserve the original. For example, s32r45_gen_bb_all_c_my_probe.py. This ensures the S32 Debugger will still function correctly. Launch GTA server. From command prompt or Windows File Explorer run the command: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\Server\gta\gta.exe  Should see a window appear like this: Ensure Environment Variable for Python is set. From command prompt, run the command:  set PYTHONPATH={S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7;{S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages Start GDB. In a command window, run the command: Windows OS: {S32DS Install Path}\S32DS\tools\gdb-arm\arm32-eabi\bin\arm-none-eabi-gdb-py.exe (for arm32)  OR {S32DS Install Path}\S32DS\tools\gdb-arm\arm64-eabi\bin\aarch64-none-elf-gdb-py.exe (for arm64) Linux OS: arm-none-eabi-gdb-py A (gdb) prompt should now be displayed in the command window: From (gdb) prompt, enter the following commands(in this order): source {S32DS Install Path}\\S32DS\\tools\\S32Debugger\\Debugger\\scripts\\s32r45\\s32r45_gen_bb_all_c_my_probe.py This specifies the script for initialization. py board_init() This initializes the board. It should only be called for the initial core. In a multicore debugging workflow, the debugger launch for additional cores would omit this step. py core_init() This initializes the core specified in the initialization script in step 1. Now standard GDB commands may be used. For example, you may wish to load an ELF file: file {S32DS Workspace Path}\\ New_S32R_Project_M7_0\\Debug_RAM\\ New_S32R_Project_M7_0.elf load   Secondary Cores After completing the launch of debug for the primary core, it is possible to perform multicore debug by launching GDB debugging on the secondary cores. Some additional steps will need to be performed from within the primary core GDB session, enter the following commands: set *0x34100000 = 0x34200000  set *0x34100004 = 0x34100025 set *0x34100024 = 0xFFFEF7FF set *0x34200000 = 0x34300000 set *0x34200004 = 0x34200025 set *0x34200024 = 0xFFFEF7FF b main c These lines prepare the environment for launching debugging on secondary cores. This will allow for multicore debugging in the case of separate ELF files for each core. These can be found in the Run Commands field of the Startup tab on the Debug Configuration for the primary core within S32 Design Studio IDE, of any multicore project created from the New Application Project Wizard. Note: If there is just one ELF file for all cores, then these 'set *0x... = 0x...' commands should be skipped. In general, it will be correct to set the break-point at main, as shown, but this might need to be changed depending on when the secondary cores are started within the project. Prepare the initialization script for the secondary core to be debugged. Open the core initialization Python script: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\scripts\s32r45\s32r45_attach.py This is a different script than the one used for the primary core. It is designed to launch a debug session on a core which is already initialized and running. Edit the script for the secondary core to be debugged. Since this script is setup for the primary core, some adjustments need to be made to setup for a secondary core Uncomment the following lines: #_JTAG_SPEED = 14000 #_GDB_SERVER_PORT = "127.0.0.1:45000" #_RESET_TYPE = "default" #_PROBE_IP = "s32dbg:10.222.24.64" #_CORE_NAME = 'M7' #_RESET_DELAY = 1 #_CMD_TIMEOUT = 7200 Make the following changes to the lines: _JTAG_SPEED = 14000 ->  None _GDB_SERVER_PORT = "127.0.0.1:45000" -> 45000 _RESET_TYPE = "default" _PROBE_IP = "s32dbg:10.222.24.64" -> None _CORE_NAME = 'M7' -> 'M7_1' (this should be set to match the name of the core to be debugged, see s32r45_context.py for complete list) _RESET_DELAY = 1 -> _REMOTE_TIMEOUT = 60 (add this line) _CMD_TIMEOUT = 7200 -> _IS_LOGGING_ENABLED = True (add this line) Save the file with a new name to preserve the original. For example, s32r45_attach_my_probe_core1.py. This ensures the S32 Debugger will still function correctly. The existing GTA server is used, so do not launch a new one. Open an new command window and follow similar steps as done for the primary core. Setup the Python environment variable, if not done globally set PYTHONPATH={S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7;{S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages Start GDB {S32DS Install Path}\S32DS\tools\gdb-arm\arm32-eabi\bin\arm-none-eabi-gdb-py.exe (for arm32) OR {S32DS Install Path}\S32DS\tools\gdb-arm\arm64-eabi\bin\aarch64-none-elf-gdb-py.exe (for arm64) A (gdb) prompt should now be displayed in the command window: From (gdb) prompt, enter the following commands(in this order): source {S32DS Install Path}\\S32DS\\tools\\S32Debugger\\Debugger\\scripts\\s32r45\\s32r45_attach_my_probe_core1.py This specifies the script for initialization. We will not execute the py board_init() as this was already done for the primary core. py core_init() This initializes the core specified in the initialization script in step 2. Now standard GDB commands may be used. For example, you may wish to load an ELF file: file {S32DS Workspace Path}\\S32R45_Multicore\\S32R45_Multicore_M7_1\\Debug_RAM\\S32R45_Multicore_M7_1.elf load Repeat 3-6 for each additional core.   Primary Core Image Already in Memory and Running The core is running and does not need to be initialized. Prepare the initialization script for the core to be debugged. Open the core initialization Python script: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\scripts\s32r45\s32r45_attach.py This is a different script than the one used for the primary core. It is designed to launch a debug session on a core which is already initialized and running. Edit the script for the secondary core to be debugged. Since this script is setup for the primary core, some adjustments need to be made to setup for a secondary core Uncomment the following lines: #_JTAG_SPEED = 14000 #_GDB_SERVER_PORT = "127.0.0.1:45000" #_RESET_TYPE = "default" #_PROBE_IP = "s32dbg:10.222.24.64" #_CORE_NAME = 'M7' #_RESET_DELAY = 1 #_CMD_TIMEOUT = 7200 Make the following changes to the lines: _JTAG_SPEED = 14000  _GDB_SERVER_PORT = "127.0.0.1:45000" -> 45000 _RESET_TYPE = "default" _PROBE_IP = "s32dbg:10.222.24.64" -> (enter the IP address of your probe) _CORE_NAME = 'M7' -> 'M7_0' (this should be set to match the name of the core to be debugged, see s32r45_context.py for complete list) _RESET_DELAY = 1 -> _REMOTE_TIMEOUT = 60 (add this line) _CMD_TIMEOUT = 7200 -> _IS_LOGGING_ENABLED = True (add this line) Save the file with a new name to preserve the original. For example, s32r45_attach_my_probe_core0.py. This ensures the S32 Debugger will still function correctly. Launch GTA server. From command prompt or Windows File Explorer run the command: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\Server\gta\gta.exe Should see a window appear like this: Ensure Environment Variable for Python is set. From command prompt, run the command: set PYTHONPATH={S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7;{S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages Start GDB. In a command window, run the command: Windows OS: {S32DS Install Path}\S32DS\tools\gdb-arm\arm32-eabi\bin\arm-none-eabi-gdb-py.exe (for arm32) OR {S32DS Install Path}\S32DS\tools\gdb-arm\arm64-eabi\bin\aarch64-none-elf-gdb-py.exe (for arm64) Linux OS: arm-none-eabi-gdb-py A (gdb) prompt should now be displayed in the command window: From (gdb) prompt, enter the following commands(in this order): source {S32DS Install Path}\\S32DS\\tools\\S32Debugger\\Debugger\\scripts\\s32r45\\s32r45_attach_my_probe_core0.py This specifies the script for debugger initialization. Do not execute the py board_init() as this will initialize the board, and reset the currently executing application, which is not desired for this case. py core_init() This initializes the debugger connection to the core specified in the initialization script in step 1. Now standard GDB commands may be used. For example, you may wish to load an ELF file: file {S32DS Workspace Path}\\S32R_Multicore\\S32R_Multicore_M7_0\\Debug_RAM\\S32R_Multicore_M7_0.elf load After completing the launch of debug for the primary core, it is possible to perform multicore debug by launching GDB debugging on the secondary cores. See section ‘Secondary Cores’ for each additional core to be debugged.
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
The S32 Debugger included within the S32 Design Studio for S32 Platform IDE provides the ability to access the flash programming and debugging of the S32 Debug Probe via GDB command line. This document provides only the necessary commands specific to launching a debug session on NXP devices. It does not cover general GDB command line operations, these are covered in detail in the GNU communities and other public websites which are not associated with NXP. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the Development Package for the device you are debugging. In this case, the S32R41 development package. This package is important as the S32 Debugger support component contains the device-specific Python scripts required for initialization of the cores. Setup the hardware Confirm the setup of the S32R41 evaluation board. Connect the power supply cable Setup the S32 Debug Probe. Refer to the S32 Debug Probe User Manual for installation instructions. Connect the S32 Debug Probe to the evaluation board via JTAG cable. Connect the S32 Debug Probe to the host PC via USB OR via Ethernet (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 Create new or open existing 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 As separate debug threads need to be started for each core to be debugged, and the method for launching a debug thread differs depending upon whether it is a primary core or secondary core and if the executable image will be loaded or if the executable is already running and the debugger just needs to be attached. These scenarios will be covered by the following 3 sections: Primary Core Load Image and Run: The application image will be loaded directly to memory by the debugger and then initialized and started. The primary core will launch any secondary cores used by the application. Secondary Cores: The primary core has launched a secondary core, it is now running and the debugger will connect through the attach method. Primary Core Image Already In Memory and Running: The primary core has already been initialized and launched by other means, such as via a Linux OS on the target, so the debugger will connect through the attach method without initializing or loading the image to memory. Please proceed with the section which applies to the core for which you are starting a debug thread. Primary Core Load Image and Run Prepare the initialization script for the core(s) to be debugged. Open the core initialization Python script: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\scripts\s32r41\s32r41_generic_bareboard_all_cores.py Uncomment the following lines: # _JTAG_SPEED = 16000 # _GDB_SERVER_PORT = 45000# _RESET_TYPE = "default" # _PROBE_IP = "s32dbg" # _CORE_NAME = 'M7_0' # _RESET_DELAY = 1 # _REMOTE_TIMEOUT = 110 # _IS_LOGGING_ENABLED = False # _SOC_NAME = "S32R41" This file is used by the S32 Debugger within the S32 Design Studio IDE where the settings are provided from the GUI, so these lines are commented out in order to allow the GUI settings to have control. The commented lines are provided so the script could more easily be run by the command line method. Update the IP address line (_PROBE_IP) to match the IP address of the S32 Debug Probe which is connected to your PC. See the user guide for the S32 Debug Probe for details on how to obtain the IP address. Update the core name (_CORE_NAME), if necessary. See s32r41_context.py for complete list of supported cores. Save the file with a new name to preserve the original. For example, s32r41_gen_bb_all_c_my_probe.py. This ensures the S32 Debugger will still function correctly. Launch GTA server. From command prompt or Windows File Explorer run the command: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\Server\gta\gta.exe Should see a window appear like this: Ensure Environment Variable for Python is set. From command prompt, run the command: set PYTHONPATH={S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7;{S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages Start GDB. In a command window, run the command: Windows OS: {S32DS Install Path}\S32DS\tools\gdb-arm\arm32-eabi\bin\arm-none-eabi-gdb-py.exe (for arm32) OR {S32DS Install Path}\S32DS\tools\gdb-arm\arm64-eabi\bin\aarch64-none-elf-gdb-py.exe (for arm64) Linux OS: arm-none-eabi-gdb-py A (gdb) prompt should now be displayed in the command window: From (gdb) prompt, enter the following commands(in this order): source {S32DS Install Path}\\S32DS\\tools\\S32Debugger\\Debugger\\scripts\\s32r41\\s32r41_gen_bb_all_c_my_probe.py This specifies the script for initialization. py board_init() This initializes the board. It should only be called for the initial core. In a multicore debugging workflow, the debugger launch for additional cores would omit this step. py core_init() This initializes the core specified in the initialization script in step 1. Now standard GDB commands may be used. For example, you may wish to load an ELF file: file {S32DS Workspace Path}\\New_S32R_Project_M7_0\\Debug_RAM\\New_S32R_Project_M7_0.elf load Secondary Cores After completing the launch of debug for the primary core, it is possible to perform multicore debug by launching GDB debugging on the secondary cores. Some additional steps will need to be performed from within the primary core GDB session, enter the following commands: set *0x34100000 = 0x34200000 set *0x34100004 = 0x34100025 set *0x34100024 = 0xFFFEF7FF b main c These lines prepare the environment for launching debugging on secondary cores. This will allow for multicore debugging in the case of separate ELF files for each core. These can be found in the Run Commands field of the Startup tab on the Debug Configuration for the primary core within S32 Design Studio IDE, of any multicore project created from the New Application Project Wizard. Note: If there is just one ELF file for all cores, then these 'set *0x... = 0x...' commands should be skipped. In general, it will be correct to set the break-point at main, as shown, but this might need to be changed depending on when the secondary cores are started within the project. Prepare the initialization script for the secondary core to be debugged. Open the core initialization Python script: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\scripts\s32r41\s32r41_attach.py This is a different script than the one used for the primary core. It is designed to launch a debug session on a core which is already initialized and running. Edit the script for the secondary core to be debugged. Since this script is setup for the primary core, some adjustments need to be made to setup for a secondary core Uncomment the following lines: # _JTAG_SPEED = 16000 # _GDB_SERVER_PORT = 45000 # _RESET_TYPE = "default" # _PROBE_IP = "s32dbg" # _CORE_NAME = 'M7_0' # _RESET_DELAY = 1 # _REMOTE_TIMEOUT = 110 # _IS_LOGGING_ENABLED = False # _SOC_NAME = "S32R41" Make the following changes to the lines: _JTAG_SPEED = 16000 ->  None _GDB_SERVER_PORT = 45000 _RESET_TYPE = "default" _PROBE_IP = "s32dbg" -> None _CORE_NAME = 'M7_0' -> 'M7_1' (this should be set to match the name of the core to be debugged, see s32r41_context.py for complete list) _RESET_DELAY = 1 _REMOTE_TIMEOUT = 110 _IS_LOGGING_ENABLED = False -> ‘True’ _SOC_NAME = "S32R41" Save the file with a new name to preserve the original. For example, s32r41_attach_my_probe_core1.py. This ensures the S32 Debugger will still function correctly. The existing GTA server is used, so do not launch a new one. Open an new command window and follow similar steps as done for the primary core. Setup the Python environment variable, if not done globally set PYTHONPATH={S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7;{S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages Start GDB Windows OS: {S32DS Install Path}\S32DS\tools\gdb-arm\arm32-eabi\bin\arm-none-eabi-gdb-py.exe (for arm32) OR {S32DS Install Path}\S32DS\tools\gdb-arm\arm64-eabi\bin\aarch64-none-elf-gdb-py.exe (for arm64) Linux OS: arm-none-eabi-gdb-py A (gdb) prompt should now be displayed in the command window: From (gdb) prompt, enter the following commands (in this order): source {S32DS Install Path}\\S32DS\\tools\\S32Debugger\\Debugger\\scripts\\s32r41\\s32r41_attach_my_probe_core1.py This specifies the script for initialization. We will not execute the py board_init() as this was already done for the primary core. py core_init() This initializes the core specified in the initialization script in step 2. Now standard GDB commands may be used. For example, you may wish to load an ELF file: file {S32DS Workspace Path}\\S32R_Multicore\\S32R_Multicore_M7_1\ \Debug_RAM\\S32R_Multicore_M7_1.elf load Primary Core Image Already in Memory and Running The core is running and does not need to be initialized. Prepare the initialization script for the core to be debugged. Open the core initialization Python script: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\scripts\s32r41\s32r41_attach.py This is a different script than the one used for the primary core. It is designed to launch a debug session on a core which is already initialized and running. Edit the script for the secondary core to be debugged. Since this script is setup for the primary core, some adjustments need to be made to setup for a secondary core Uncomment the following lines: # _JTAG_SPEED = 16000 # _GDB_SERVER_PORT = 45000 # _RESET_TYPE = "default" # _PROBE_IP = "s32dbg" # _CORE_NAME = 'M7_0' # _RESET_DELAY = 1 # _REMOTE_TIMEOUT = 110 # _IS_LOGGING_ENABLED = False # _SOC_NAME = "S32R41" Make the following changes to the lines: _JTAG_SPEED = 16000 _GDB_SERVER_PORT = 45000 _RESET_TYPE = "default" _PROBE_IP = "s32dbg" -> (enter the IP address of your probe) _CORE_NAME = 'M7_0' (this should be set to match the name of the core to be debugged, see s32r41_context.py for complete list) _RESET_DELAY = 1 _REMOTE_TIMEOUT = 110 _IS_LOGGING_ENABLED = False -> ‘True’ _SOC_NAME = "S32R41" Save the file with a new name to preserve the original. For example, s32r41_attach_my_probe_core0.py. This ensures the S32 Debugger will still function correctly. Launch GTA server. From command prompt or Windows File Explorer run the command: {S32DS Install Path}\S32DS\tools\S32Debugger\Debugger\Server\gta\gta.exe Should see a window appear like this: Ensure Environment Variable for Python is set. From command prompt, run the command: set PYTHONPATH={S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7;{S32DS Install Path}\S32DS\build_tools\msys32\mingw32\lib\python2.7\site-packages Start GDB. In a command window, run the command: Windows OS: {S32DS Install Path}\S32DS\tools\gdb-arm\arm32-eabi\bin\arm-none-eabi-gdb-py.exe (for arm32) OR {S32DS Install Path}\S32DS\tools\gdb-arm\arm64-eabi\bin\aarch64-none-elf-gdb-py.exe (for arm64) Linux OS: arm-none-eabi-gdb-py A (gdb) prompt should now be displayed in the command window: From (gdb) prompt, enter the following commands(in this order): source {S32DS Install Path}\\S32DS\\tools\\S32Debugger\\Debugger\\scripts\\s32r41\\s32r41_attach_my_probe_core0.py This specifies the script for debugger initialization. Do not execute the py board_init() as this will initialize the board, and reset the currently executing application, which is not desired for this case. py core_init() This initializes the debugger connection to the core specified in the initialization script in step 1. Now standard GDB commands may be used. For example, you may wish to load an ELF file: file {S32DS Workspace Path}\\ New_S32R41_Project\\New_S32R41_Project_M7_0\\Debug_RAM\\New_S32R41_Project_M7_0.elf load After completing the launch of debug for the primary core, it is possible to perform multicore debug by launching GDB debugging on the secondary cores. See section ‘Secondary Cores’ for each additional core to be debugged.
View full article
The NXP device S32R41 has accelerators that can be programmed. The S32 Debugger included within the S32 Design Studio for S32 Platform IDE with the S32 Debug Probe provides the ability to debug these accelerators. The accelerator covered in this document: Signal Processing Toolbox (SPT).   Section map: Preparation             Setup the software tools             Setup the hardware Procedure             Create A New Debug Configuration                                Start A Debug Session                         Multi-Core Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32R41 development package and the Radar extension package for S32R41. Both of these are required for the SPT3.5 accelerator. Setup the hardware Confirm the setup of the S32R41 evaluation board. Connect the power supply cable Setup the S32 Debug Probe. Refer to the S32 Debug Probe User Guide for installation instructions. Connect the S32 Debug Probe to the evaluation board via JTAG cable. 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 The procedure for starting a debug session and accessing the associated accelerator-specific registers is detailed here. Debugging SPT is only conducted through the multi-core method. The SPT executable is included within A53 executable, the A53 application loads the SPT executable to the SPT core and both A53 and SPT core are available for debugging. The debug connection is made to the two cores through the Baremetal/Bareboard method. The debugger connects to both the A53 and SPT cores using the probe over JTAG. Before a debug session can be started a debug configuration must exist.   Create A New Debug Configuration If the New Project Wizard was used to create the project using the S32DS Application Project option, then there was an opportunity to select the desired debugger from within the wizard. If the desired debugger option was selected at this time, then the needed configuration already exists and will only require adjustments to the hardware connection settings.   If the New Project Wizard was not used to create the project OR the currently desired debugger was not the one selected at the time of project creation, a new debug configuration must be created. With the existing project selected in Project Explorer, open the Debug Configurations Menu: Run -> Debug Configurations Having the existing project selected in the Project Explorer view will make the creation of a new launch configuration easier as many settings will be imported from the selected project. To select a project, click on it so it becomes highlighted. Next, select the debugger for which the new debug configuration will be created. To create the new configuration, either click on the ‘New launch configuration’ button from the toolbar at the top and to the left, or right-click on the ‘S32 Debugger’ and select ‘New Configuration’ from the menu. Once the configuration is created it will be displayed and any errors with the configuration will be shown. If the project was selected in the Project Explorer, then the Name of the debug configuration will contain the project’s name and the Project and C/C++ Application fields may be populated as well. The C/C++ Application field will only be populated if the build output executable exists. Confirm these values are correct before moving on. If the C/C++ Application field is empty, just click ‘Browse..’ button (The ‘Search Project…’ button is setup to identify standard executable file types, not the SPT’s ‘aspt’ file type) and navigate to the folder containing the build output <project name>.aspt. If you like, the tool already knows the project directory path, so you could shorten the path to start with from the ‘Debug’ folder, as shown here. There is an error showing that the Device core ID is not specified on the Debugger tab. Switch to the Debugger tab and click on the button ‘Select device and core’. From the Select Target Device and Core window, expand the listing until all cores are listed. Notice that all supported cores on the S32R41 are listed. Select the SPT35 core and click OK. Now that the device and core are selected, the attach script is selected automatically. The attach script will allow to start debugging on a core that is already initialized. This is correct for the SPT core as it is always launched in multicore scenario. Refer to the document 'README.txt' located in the same folder as these script files for details on all of the provided scripts. Confirm the setting of the ‘Initial core’ checkbox. This box should be checked within the debug configuration that establishes the first connection to the target device via S32 Debug Probe. When this box is checked, the Debug Probe Connection interface and GDB Server settings become available. The probe connection only needs to be configured once and only one GDB Server needs to be running for each debug session. When debugging the SPT3.5 core, the A53 core will always launch first, so this box should be checked for the A53 debug configuration and should not be checked for the SPT debug configuration. Check that the GDB Client section has the correct path to the SPT GDB executable. It should point to the variable ‘S32DS_R41_GDB_SPT_PATH’. Startup tab check the following settings Load image is NOT checked for multicore debugging. Basically, if it is loaded by A53 core (SPT executable is contained within A53 ELF file), then it does not need to be loaded. Load symbols is NOT checked. The SPT source file is assembly code, so there are no symbols to load. Set breakpoint at main and Resume are NOT checked for multicore debugging. After saving the new configuration with the ‘Apply’ button, SPT debugging can be performed. Start A Debug Session For convenience, the S32DS Application Project wizard was used to create a new project for demonstrating multi-core A53/SPT debugging. The SPT core does not support standalone debugging. For instructions on loading this example project to your workspace, see ‘HOWTO: S32 Design Studio - Create New Application Project’, selecting instead the Processor option Family S32R41 -> S32R41xxx Cortex-A53 SPT3 from the wizard menu. A53 / SPT Multi-Core For multi-core debugging, the A53 core is running an executable which also contains the SPT code. The A53 code will make a call into the SPT to load the SPT code to memory and to start the SPT execution. So the A53 must be started first. The EVB settings are irrelevant as the debugger will take control of the target via the JTAG connection. Before beginning the debug sessions, be sure each project is built clean. Start A53 debug. From the menu at the top, select Run -> Debug Configurations… In the Debug Configurations menu, from the configuration list, look for the ‘S32 Debugger’ group and select the A53 Debug_RAM configuration for the project to be debugged. In the case of our example, the ‘New_S32R41_SPT_Project_A53_Debug_RAM_S32Debug’ configuration. On the Debugger tab, check that the Debug Probe Connection settings match with the current hardware connection configuration for the S32 Debug Probe. Use the ‘Test connection’ button to confirm. Click Debug to start debugging on the A53 core. The debugger will launch and execute until the first executable line in main(). See Debugger tab in Debug Configurations menu to adjust this setting. Once the A53 debug session is running, advance the program counter to a line after the desired SPT kernel is loaded to memory but before the SPT kernel is launched. In the example here, this would be in ‘main.c’, line 57, where ‘StartSptProgram()’ function is called. This can be done by setting a breakpoint on the line and clicking Resume.  After the breakpoint is reached, the SPT debug session can be started. Return to the Debug Configurations menu, select the SPT debug configuration. In the case of this example, ‘New_S32R41_SPT_Project_SPT35_Debug_S32Debug’, and click Debug. Wait for the SPT debug session to launch and stop in the disassembly. Use the Step Over command one time in the A53 debug thread to complete the SPT launch. Select the SPT debug thread to change the context of the Disassembly, Registers and etc.views. Notice the SPT code is not loaded yet. Enable Instruction Stepping Mode and step one time. Notice the SPT code is now loaded. Now you can step through the assembly code, access registers, etc.
View full article
Sometimes you need an output file other than the standard ELF, like a FLASH image. This instruction shows how to setup the selected build type to generate an additional output from the supported file types.   Go to Project Properties Right click on the Project name in Project Explorer -> Properties, OR Select the Project name in Project Explorer, select from pulldown menu Project -> Properties Navigate to C/C++ Build -> Settings -> Cross Settings, check the box for ‘Create flash image’. Be sure to take note that the build configuration set in the Configuration field is correct one. The change you make here will only apply to the selected configuration. Scroll the window down until you can see the ‘Apply’ button, then click on it. You can specify output in newly appeared option Standard S32DS Create flash image Build the project. The new output file is generated.
View full article
The NXP device S32R45 has accelerators that can be programmed. The S32 Debugger included within the S32 Design Studio for S32 Platform IDE with the S32 Debug Probe provides the ability to debug these accelerators. The accelerator covered in this document: Linear Algebra Accelerator (LAX). Section map: Preparation Setup the software tools Setup the hardware Procedure Create A New Debug Configuration Simulator Physical Hardware Start A Debug Session Standalone Multi-Core Debugging LAX Once Debug Session is Started Multi-thread LAX Debugging: IPPU & VCPU Multi-LAX-core Debugging   Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32R4xx development package and the Radar extension package for S32R4xx. Both of these are required for the LAX accelerator. Setup the hardware Confirm the setup of the S32R45 evaluation board. Connect the power supply cable Setup the S32 Debug Probe. Refer to the S32 Debug Probe User Manual for installation instructions. Connect the S32 Debug Probe to the evaluation board via JTAG cable. 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 The procedure for starting a debug session and accessing the associated accelerator-specific registers is detailed here. Application code executing on the LAX accelerator can be debugged using a simulation as well as on physical hardware. Debugging using simulation occurs entirely on the PC and no physical hardware is required. When debugging LAX on physical hardware, this is primarily conducted through one of two methods: Standalone: the LAX executable is loaded by a debugger over JTAG using a probe and only the LAX core is executed and available for debugging. Multi-core: the LAX executable is included within A53 executable, the A53 application loads the LAX executable to the LAX core and both A53 and LAX core are available for debugging. The debug connection is made to the two cores through one of two methods: Baremetal/Bareboard: the debugger connects to both the A53 and LAX cores using the probe over JTAG. Linux BSP: the debugger connects to the A53 core, which is running Linux BSP, using a remote Linux connection over Ethernet and then connects to the LAX core using the debug probe over JTAG. Before a debug session can be started a debug configuration must exist. Create A New Debug Configuration If the New Project Wizard was used to create the project using the S32DS Application Project option, then there was an opportunity to select the desired debugger from within the wizard. If the desired debugger option was selected at this time, then the needed configuration already exists and will only require adjustments to the hardware connection settings (no hardware settings for LAX Simulator).   If the New Project Wizard was not used to create the project OR the currently desired debugger was not the one selected at the time of project creation, a new debug configuration must be created. With the existing project selected in Project Explorer, open the Debug Configurations Menu: Run -> Debug Configurations Having the existing project selected in the Project Explorer view will make the creation of a new launch configuration easier as many settings will be imported from the selected project. To select a project, click on it so it becomes highlighted. Next, select the debugger for which the new debug configuration will be created. Simulator To create the new configuration, either click on the ‘New launch configuration’ button from the toolbar at the top and to the left, or right-click on the ‘LAX Simulator’ and select ‘New Configuration’ from the menu. Once the configuration is created it will be displayed and any errors with the configuration will be shown. If the project was selected in the Project Explorer, then the Name of the debug configuration will contain the project’s name and the Project and C/C++ Application fields will be populated as well. The C/C++ Application field will only be populated if the build output executable exists. Confirm these values are correct before moving on. There is an error showing that the Device core ID is not specified on the Debugger tab. Switch to the Debugger tab and click on the button ‘Select device and core’. From the Select Target Device and Core window, expand the listing until all cores are listed. Since the LAX Simulator only supports LAX cores on the S32R45, that is all which is listed. Select the desired LAX core and click OK. Now that the device and core are selected, the only correct initialization script associated with the LAX is selected automatically. No further changes are required. Click Apply to save the changes or if you are ready to debug with the LAX Simulator, then click Debug and the changes will be saved and the debug session will launch. Physical Hardware To create the new configuration, either click on the ‘New launch configuration’ button from the toolbar at the top and to the left, or right-click on the ‘S32 Debugger’ and select ‘New Configuration’ from the menu. Once the configuration is created it will be displayed and any errors with the configuration will be shown. If the project was selected in the Project Explorer, then the Name of the debug configuration will contain the project’s name and the Project and C/C++ Application fields will be populated as well. The C/C++ Application field will only be populated if the build output executable exists. Confirm these values are correct before moving on. There is an error showing that the Device core ID is not specified on the Debugger tab. Switch to the Debugger tab and click on the button ‘Select device and core’. From the Select Target Device and Core window, expand the listing until all cores are listed. Notice that all supported cores on the S32R45 are listed. Select the desired LAX core and click OK. Now that the device and core are selected, a generic initialization script associated with the LAX is selected automatically, however, this may not be the correct one. If debugging Standalone, meaning only LAX core will be debugged, then the automatic selection ‘s32r45_generic_bareboard_all_cores.py’ is correct. This script will initialize all of the cores so the LAX can execute properly. If debugging Multicore, meaning both A53 and LAX will be debugged, then the A53 and LAX cores will already be initialized by the time the debugging on LAX begins. So a different script that doesn't initialize all of the cores is needed. Click ‘Browse’ and navigate to ‘{install_dir}\S32DS.3.4\S32DS\tools\S32Debugger\Debugger\scripts\s32r45’ and select the script ‘s32r45_attach.py’. The attach script will allow to start debugging on a core that is already initialized. Refer to the S32 Debugger User Guide, or the document 'README.txt' located in the same folder as these script files for details on all of the provided scripts. Confirm the setting of the ‘Initial core’ checkbox. This box should be checked within the debug configuration that establishes the first connection to the target device via S32 Debug Probe. When this box is checked, the Debug Probe Connection interface and GDB Server settings become available. The probe connection only needs to be configured once and only one GDB Server needs to be running for each debug session. Therefore, this box should be checked for standalone debugging or for multicore debugging where A53 core is debugged via Remote Linux. If the A53 and LAX cores are debugged via the S32 Debug Probe, then this box should be checked for the A53 debug configuration and should not be checked for the LAX debug configuration. If this is a standalone debugging of only the LAX core, setup the Debug Probe Connection. 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. It is highly recommended to press the ‘Test connection’ button to confirm the hardware connection is correctly configured. See the included ‘S32_Debug_Probe_User_Guide.pdf’ for more details on the setup of the S32 Debug Probe. Check that the GDB Client section has the correct path to the LAX GDB executable. It should point to the variable ‘S32DS_R45_GDB_LAX_PATH’. Startup tab check the following settings Load image is checked for standalone debugging, NOT checked for multicore debugging. Basically, if it is loaded by A53 core (contained in A53 ELF file), then it does not need to be loaded. Load symbols is checked. The only time you would not check this box is if there is no project binary containing symbols available. Set breakpoint at main and Resume are checked for standalone debugging, NOT checked for multicore debugging. Now you are ready to start debugging. If debugging Standalone, click ‘Debug’. If debugging Multicore, switch to the A53 debug configuration (either C/C++ Remote Application or S32 Debugger) and start the A53 debug session first. Once the A53 debug session is running, advance the program counter to the line just after LAX is initialized. Start A Debug Session Starting a LAX debug session are different depending upon whether Standalone or Multi-core debugging is required. The steps for each method are detailed in separate sections below. For convenience, the example project for S32 Design Studio from the RSDK, ‘RSDK_S32DS_template’, will be used to demonstrate multi-core A53/LAX debugging. Note: Unfortunately, this example project is not setup for standalone debugging because there is no main() executing on LAX to call the LaxVectorAddGraph(). So the standalone debugging steps will be presented only to highlight the different setup required. For instructions on loading this example project to your workspace, see ‘HOWTO: Create New Project from Example RSDK_S32DS_template from Radar SDK’. Standalone If the standalone bareboard debugging of only LAX core was supported by the RSDK_S32DS_template example, here are the steps which would be required. Click on the LAX project so it is highlighted, then build it to ensure it builds clean and that the executable exists. From the menu at the top, select Run -> Debug Configurations… Select the standalone debug configuration for LAX core. In the case of the RSDK_S32DS_template example project, only the multi-core debug configuration is supported. In this case, the standalone configuration will need to be created. Right click on the multi-core configuration and select Duplicate. This will create an identical configuration. Change the name as desired and then select the Debugger tab. Click Browse next to Initialization script and navigate to the directory ‘{install_dir}\S32DS.3.4\S32DS\tools\S32Debugger\Debugger\scripts\s32r45’. Select the script ‘s32r45_generic_bareboard_all_cores.py’. Adjust the Debug Probe Connection settings to match your HW setup. Use the Test connection button to confirm. Select the Startup tab. For standalone debugging the image file will not be loaded by the A53 core, so it must be loaded by the S32 Debugger. Check the boxes for Load image, Set breakpoint at: and Resume. Click Debug to start the debug session. All of the settings made will be applied and the debug session will be launched. A53 / LAX Multi-Core For multi-core debugging, the A53 core is executing an application on the Linux BSP. The EVB should be setup to boot from a flash device which has been loaded with the S32R45 Linux BSP. Before beginning the debug sessions, be sure to load the driver dependencies (oal_driver, rsdk_spt_driver, and rsdk_lax_driver) as described in the RSDK User Manual, RSDK Offline Example section ‘Running the application’. Start A53 debug. From the menu at the top, select Run -> Debug Configurations… In the Debug Configurations menu, from the configuration list, expand the ‘C/C++ Remote Application’ group and select the ‘RSDK_S32DS_template_A53_Debug’ configuration. On the Main tab, create a new connection for using the IP address of the EVB. The IP address could be determined either by issuing a Linux command over the serial connection, such as ‘ifconfig’, by accessing the local network connected device list, or perhaps the EVB was setup with a static IP address and it is already known. Click New… in the Connection section. Select ‘SSH’ for connection type. Enter the IP address in Host: field, use ‘root’ in User: field, and leave password field empty. Click Debug to start debugging on the A53 core. The debugger will launch and execute until the first executable line in main(). See Debugger tab in Debug Configurations menu to adjust this setting. Now that the A53 is launched, it is necessary to execute the A53 code until just after the LAX core is initialized and buffers are allocated. Open ‘lax_processing.c’ from the ‘src’ folder in the A53 project and set a breakpoint on line 100. One way is by double-click in the space on the left side of source code editor. This is the executable line just after ‘RsdkLaxInit()’ is called. Now press ‘Resume’ from the toolbar to advance the program counter to the breakpoint. Wait for the breakpoint to occur. Return to the Debug Configurations menu, select the ‘RSDK_S32DS_template_LAX_0_attach’ debug configuration and select the Debugger tab. Adjust the Debug Probe Connection settings to match your HW setup. Use the Test connection button to confirm. Click Debug to start the LAX debug session. Wait for the LAX debug session to launch and stop in the disassembly. Set a breakpoint in the source code. For our example, place one in ‘lax_custom_graph.c’ on line 97, where the kernel ‘ Rsdk_LA_add_VV’ is called. Select the LAX debug thread and press Resume so it will be ready to run to the breakpoint which was just setup. Select the A53 debug thread and press Resume to allow execution to resume and then wait for the breakpoint to be reached in the LAX code. The breakpoint in the LAX code has been reached. Now it is possible to perform some debugging activities on the LAX core. Debugging LAX Once Debug Session is Started Once the LAX debug session is started, it will be stopped and only disassembly can be viewed. Select the LAX debug thread to see. Open the C code source file and set a breakpoint within the kernel of interest. Press Resume on the LAX debug thread. Now switch back to the A53 debug thread and press Resume. The breakpoint you set in LAX will be reached and you can now start stepping through and looking at registers, etc. Multi-thread LAX Debugging: IPPU & VCPU Load a project which uses both IPPU and VCPU and start the debug session on LAX using one of the methods provided. Once the debug session is started on LAX, set a breakpoint on the line containing RSDK function ‘Rsdk_AU_sync_i()’ Press Resume to advance the program counter to the breakpoint. When the breakpoint is reached, the second thread appears. The first thread contains the VCPU and the second thread contains the IPPU. Select the second thread to see the IPPU disassembly. Now instruction stepping can be performed on the IPPU. Registers can be viewed as well. To see the opcodes, do not use the codes shown in the disassembly view. The disassembly view does not handle cases where many opcodes are packed into a single address. Instead, use the Memory Spaces view. If the memory spaces view is not already present, then add it from the menu Window -> Show View -> Memory Spaces. To add a memory space, right click in the panel on the left or click on the + button at the upper right. Multi-LAX-core Debugging The S32R45 device contains 2 LAX cores: LAX_0 and LAX_1. To debug the additional LAX core, simply add a new debug configuration and setup for LAX_1. Create a new debug configuration for LAX_1 by first duplicating the existing debug configuration for LAX_0. Rename the configuration to reference LAX_1, but the project name and application file (ELD) will remain the same. On the Debugger tab, use ‘Select device and core’ button to change the core to LAX_1, change the initialization script to ‘<device>_attach.py’, and uncheck the box next to Initial core. Depending on how you started the debug session for LAX_0, you may need to adjust the Startup tab. The settings on Startup tab should be set to match the LAX_0 debug configuration. Start the LAX_0 debug session first, then the LAX_1 debug session. Stepping within each can be conducted independently.
View full article
  In some cases FreeRTOS heap can consume huge portion of RAM memory - especially on small devices like S32K312 and for example DTCM memory is unused. FreeRTOS allows user defined heap which can be moved in any section in RAM.  First step - make sure, that in FreeRTOS config is application allocated heap is disabled:   Second step - open linker script file and create new section which points into DTCM memory:     Third step - define ucHeap variable with section attribute:     We are done - FreeRTOS Heap is moved into DTCM memory:    In case, that DTCM memory is used - typically there can be Interrupt Vector Table, stack and so on, you can skip creating new section in linker script file and simply add *(my_head) at the end of existing section mapped into dtcm:    FreeRTOS heap will be placet at the end of used DTCM memory:     
View full article
There are 2 errors which produce the FNP error 0 message for which we have identified solutions:   1) That activation request yields no right to a license If you receive the following error message following an attempt to activate S32 Design Studio, this is a known issue and we have a solution.     This issue is due to a recent event. On October 1st, 2019, Flexera made this change. Since NXP uses Flexera for product activations, we were affected.   The solution to the issue is to enable support for TLS 1.2 within your Internet Properties.   2) com.acresso.activation.handler.ServerException If you receive the following error message following an attempt to activate S32 Design Studio, this is a known issue and we have a solution. This issue is known to occur on older releases of S32 Design Studio.     The version of FlexNet Publisher (FNP) used to activate the S32 Design Studio on your PC has an issue on some users machines. While we don't fully understand what change is happening to cause this issue, we have determined that an update to the version of FNP will resolve it. We have incorporated a newer version in the 3.5 release of S32 Design Studio.   Attached is a package of files (Activation.7z) which will allow you to update the version of FNP on your machine.   Enter the following command replacing the paths as noted. It should be possible to execute from CMD window located at any path. Make sure to use the ‘/’ instead of ‘\’ and if you have any paths with spaces, then enclose the full path with “.   For 64-bit OS: C:/NXP/S32DS.3.5/jre/bin/java  -Djava.library.path="{path to where you extracted the activation.zip}/Activation/cll/x64"  -jar "{path to where you extracted the activation.zip}/Activation/license.jar" activateUI   For 32-bit OS: C:/NXP/S32DS.3.5/jre/bin/java -Djava.library.path="{path to where you extracted the activation.zip}/Activation/cll/i86" -jar "{path to where you extracted the activation.zip}/Activation/license.jar" activateUI   If you have no existing S32DS installation from which to use Java, then please use the attached package (CLL_FNP.11.18.0.2.zip) and follow the instructions in the included .txt file. This package only works on Windows OS 64-bit.
View full article
To install updates and additional packages to S32 Design Studio: 1) Download the Update from the S32 Design Studio page at NXP.com. 2) From S32 Design Studio, got to Help – S32DS Extensions and Updates. 3) Click on ‘Manage Sites’ link. 4) Select 'Add...' 5) Select 'Archive...', locate the downloaded update: 6) Click OK. 7) Click Apply and Close on the Preferences menu 😎 Notice the S32DS Extensions and Updates menu displays the new content. 9) Check the box next to the new package and click Install/Update. 10) Accept license terms and click Finish. 11) After the installation is complete, restart S32 Design Studio.
View full article