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:
        Product Release Announcement Automotive Microcontrollers and Processors S32 Design Studio for ARM 2018.R1         February 6, 2017 NXP Semiconductors is pleased to announce the release of the S32 Design Studio for ARM 2018.R1 for Automotive and Ultra-Reliable MCUs. The S32 Design Studio is based on the Eclipse open development platform and integrates the Eclipse IDE, GNU Compiler Collection (GCC), GNU Debugger (GDB), and other open-source software to offer designers a straightforward development tool with no code-size limitations. Red highlighted items below are new/updated features in comparison to previous releases/updates. Release content (What is new?) Eclipse Neon 4.6 Framework GNU Tools for ARM® Embedded Processors (Launchpad) build (4.9.3 20150529) ARM64: Linaro GCC 4.9-2015.05 GNU Tools for ARM® Embedded Processors build (6.3.1 20170824) - supported by New Project Wizard for S32K1xx device. See the complete GNU ARM 6.3.1 release notes attached below. GCC Source code package is available here. Libraries included: newlib, newlib-nano and ewl2 (ewl and ewlnano). GDB 7.12.1 with Python P&E Multilink/Cyclone/OpenSDA (with P&E GDB Server) - updated (v3.3.5.201801101746) SEGGER J-Link (with SEGGER GDB Server) - updated (V6.22e_B180108) New Project wizard to create application and library projects for supported devices Fully integrated S32 SDK for S32K14x EAR release v.0.8.6. For the details on the feature set of SDK please refer to SDK Release notes and Reference Manuals. S32 SDK Release notes attached.Please note that S32K SDK has Early Access Release status, that means that there could be some limitations and issues. The S32K SDK is available for Windows host only. There is limitation on the supported GreenHills compiler version – the SDK released with GreenHills v2014.4, but due to GreenHills plugin limitation support for GreenHills compiler v2017.1 integrated, so new project wizard would not provide possibility to create SDK project with GreenHills compiler. SDK management included Sample Drivers for KEA family (Evaluation grade) FreeMASTER Serial Communication driver for KEA and S32K families Automotive Math and Motor Control Libraries for KEA,S32K and S32V234 devices supporting the ARM Cortex-M4 core v1.1.11 (the particular version availability for a device could be limited by supported compiler versions) Import projects from CodeWarrior for MCU v.10.6 and Kinetis Design Studio for respective supported processors IAR v7.x and v8.11.2 compiler support by new project wizard GreenHills v2017.1.4 compiler support by new project wizard iSystem, Lauterbach and IAR debuggers support by new project wizard. Kernel Aware debugging for FreeRTOS, OSEK. MQX 4.2 for MAC57D54H with possibility to create project from example Devices supported SKEAZN8, SKEAZN16, SKEAZN32, SKEAZN64, SKEAZ128, SKEAZ64 S32K144 v2.0, S32K142, S32K146, S32K148 S32V234 MAC57D54 Getting started page to allow the centralized access to documentation and additional materials Bug Fixes Updated header and register description files to fix issues and synchronize with latest Ref Manual versions [S32DS-4629] Clean rule doesn't work after particular user actions in "C/C++ Build -> Behavior" [S32DS-301] After some debugging work (using BP, Stepping, Resume...) Disassembly view content disappears. [S32DS-1093] Debugging session hangs when "c" step over is done on a loop statement that has its entire block in a single line. [S32DS-273] Can not suspend after set condition of breakpoint = 0 and resume [S32DS-61] Breakpoint properties disappeared after right-click into breakpoint [S32DS-6072] Unable to export S32K144 SDK project into ProjectInfo.xml The complete S32 Design Studio for ARM 2018.R1 release notes are attached below. Installation Notes Please visit the S32DS for ARM product page - download section to download the installer. The installer requires the NEW Activation ID to be entered during the installation. You should receive an email that includes your Activation ID after starting the download. Technical Support S32 Design Studio issues are tracked through the S32DS Public NXP Community space: https://community.nxp.com/community/s32/s32ds    
View full article
The document describes the steps that need to be done in order to place and execute a library function from a custom memory section - typically RAM using GNU Build tools. The instructions are applicable to any GNU tool-chain. It is demonstrated on a New S32DS Project created in S32 Design Studio for ARM. Lets assume that we'd like to execute memcpy() function from the standard library (NewLib). 1) The first step is to exclude specific library object file(s) from the input section (using EXCLUDE_FILE) so they will not be linked into the standard .text* flash section.  The input section associated with EXCLUDE_FILE shall not interfere with the same input section used later in section list (e.g. with *(.text*) input section deleted from the list below). EXCLUDE_FILE in behaves the same was as *.(text*) rule - it only exclude selected file(s) but places all the remaining (non-excluded) input data. /* The program code and other data goes into internal flash */ .text : { . = ALIGN(4); *(.text) /* .text sections (code) */ /* Exclude file(s) from NewLib libc.a from .text.* section */ *(EXCLUDE_FILE (*libc.a:lib_a-memcpy-stub.o) .text*) *(.rodata) /* .rodata sections (constants, strings, etc.) */ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ *(.glue_7) /* glue arm to thumb code */ *(.glue_7t) /* glue thumb to arm code */ *(.eh_frame) KEEP (*(.init)) KEEP (*(.fini)) . = ALIGN(4); } > m_text‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ 2) Now let's place the memcpy object into a code_ram section which is already defined in the project .ld file. This section is dedicated to a code that shall be executed from RAM (startup routine initializes this section). For more details see HOWTO: Run a routine from RAM in S32 Design Studio  . The following line places the code (.text* section) from the object file (lib_a-memcpy-stub.o) from the standard NewLib (libc.a)  *libc.a:lib_a-memcpy-stub.o (.text*)‍ into .code section: .code : AT(__CODE_ROM) { . = ALIGN(4); __CODE_RAM = .; __code_start__ = .; /* Create a global symbol at code start. */ __code_ram_start__ = .; *(.code_ram) /* Custom section for storing code in RAM */ *libc.a:lib_a-memcpy-stub.o (.text*) /* add memcpy from the NewLib library here*/ . = ALIGN(4); __code_end__ = .; /* Define a global symbol at code end. */ __code_ram_end__ = .; } > m_data‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ After building the project you can check the map file to confirm memcpy is indeed placed into .code section in RAM memory: .code 0x1fff881c 0x18 load address 0x00000d90 0x1fff881c . = ALIGN (0x4) 0x1fff881c __CODE_RAM = . 0x1fff881c __code_start__ = . 0x1fff881c __code_ram_start__ = . *(.code_ram) *libc.a:lib_a-memcpy-stub.o(.text*) .text.memcpy 0x1fff881c 0x16 C:/NXP/S32DS_ARM_v2018.R1/Cross_Tools/gcc-6.3-arm32-eabi/arm-none-eabi/newlib/lib/thumb/v7e-m\libc.a(lib_a-memcpy-stub.o) 0x1fff881c memcpy 0x1fff8834 . = ALIGN (0x4) *fill* 0x1fff8832 0x2 0x1fff8834 __code_end__ = . 0x1fff8834 __code_ram_end__ = . 0x00000da8 __CODE_END = (__CODE_ROM + (__code_end__ - __code_start__)) 0x00000da8 __CUSTOM_ROM = __CODE_END‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ Note If you are placing a function into RAM always consider to add sub-functions called by that function (typically located in a different object file).
View full article
On reset, all module registers have default values. These settings are typically not ideal for achieving optimal system performance. Also, some peripherals must be configured before they can be used. DCD is the configuration information contained in the DCD image that BootROM uses to configure peripherals on the device. BootROM determines the location of the DCD table from the associated pointer in the IVT.   The main functionality of the DCD Tool is to generate the Device Configuration Data (DCD) image using the format and constraints as specified in the Boot ROM reference manual.   In the steps below, an example process for creating the DCD binary for initializing SRAM is shown. To initialize the SRAM, a logic '1' must be written to the INITREQ bit within the PRAMCR register of the SRAMC and SRAMC_1 peripherals.   Procedure With a project open in project explorer (C/C++ perspective), switch to DCD perspective. Click on the arrow next to the 'Open S32 Configuration' button and select 'Open DCD'. Check that correct project is selected  In DCD Commands panel, select Command Type 'Write', then click 'Set' Click 'Add Register', then set the following settings. Can start typing the names to filter the list for faster setting selection.   For Peripheral setting, select 'SRAMC'. You can search for it by typing the name. Register setting, select 'PRAMCR'. The list is short, so it is not necessary to type the name. In Bitfields, select 'INITREQ' Now click on the highlighted bit to set it. Again using 'New Command' box, repeat settings of steps 3 & 4, however, this time select Peripheral 'SRAMC_1'. If everything was done correctly, in the DCD Binary panel to the right, should appear as shown. If so, click 'Export'. The generated DCD file will be displayed. By default, C format is selected. Select Binary format and click OK. Select a location to save the file (such as the project folder in the workspace directory) and give it a meaningful name. Click Save. You are done! DCD image file is created in binary format and ready to be imported to IVT Tool.  
View full article
**************************************************************************************** IDE: S32 Design Studio for ARM Version 2.2 Workspace: C:\Projects\S32DS_ARM_22 Project name: S32K142_08_CommandLine Project location: C:\Projects\S32DS_ARM_22\S32K142_08_CommandLine **************************************************************************************** 1. After you finish the edit on your codes, please close S32DS 2. Input the command(as below) at your command_line.bat  3. Run command prompt with Administrator right. 4. Run command_line.bat at command prompt   You will get the *.elf under the folder of C:\Projects\S32DS_ARM_22\S32K142_08_CommandLine\Debug_FLASH   Cheers! Oliver
View full article
Suppose you created an application project for one MCU (S32K144, for example), but your requirements changed, or perhaps you are reusing a previous project to start a new project on a different MCU (derivative from same family). If you are working with the S32 SDK, there is a way to do it. We have detailed the steps in this document. 1) Open the project to be modified and select the C/C++ perspective, ensure that the Processor Expert views are shown 2) From the Components Library, Processors tab, select the new MCU derivative 3) Either double-click OR right-click and select 'Add to project', to add the new processor to your components list for your project. Be sure to select just one of the pin packages, whichever is appropriate for you application. 4) From the Component Inspector*, you will see a message in red text asking if you would like to switch into the configuration for the new processor. Click on the button 'Switch Configuration'. *may have to select pin_mux:PinSettings in the Components view for the project to see the message 5) Open the Project Properties, either select from File menu or right-click on project name and select from the menu. Then go to C/C++ Build -> Settings -> Standard S32DS C Compiler -> Includes and delete all include paths starting with $(S32K1**_SDK_VER_PATH). Repeat this step for the Standard S32DS Assembler -> General include paths. Note: For all changes in C/C++ Build -> Settings, make sure to repeat for all build configurations (RAM, FLASH, Debug, Release, etc.). 6) The paths to the SDK should now be gone. The result should look similar to this: 7) In Standard S32DS C Compiler -> Preprocessor settings, change the defined symbol to the one which is appropriate for the new MCU and click OK. (e.g. CPU_S32K142 for S32K142, CPU_S32K148 for S32K148, etc.) If you are not sure what should be here, then create a new empty project for the new MCU and refer to the settings there. 😎 The Preprocessor setting after the change 9) Click on the 'Generate Processor Expert Code' button in the Components view for your project 10) From Project Explorer, remove the startup and linker files from Project Settings folder 11) Copy startup and linker files for the new MCU from <SDK_PATH>/platform/devices/<CPU>/startup/<Compiler> and <SDK_PATH>/platform/devices/<CPU>/linker/<Compiler> 12) Open the Project Properties, then C/C++ Build -> Settings -> Standard S32DS C Linker -> General and update the linker file path to reflect the new filename and click OK. (in this case: S32K144_64_flash.id to S32K142_32_flash.id) 13) After the change 14) Perform a Clean and a Build operations of the project. 15) Update the device in the debug configurations Now you can change your MCU derivatives!
View full article
1. Install S32Design Studio 3.5: S32DS.3.5_b220726_win32.x86_64.exe 2. Download and Install S32 Design Studio 3.5 Update 2 D2302: SW32_S32DS_3.5.2_D2302.zip  (com.nxp.s32ds.update_3.5.2.20230227110156)   3. Download and Install S32 Design Studio 3.5.0 Development Package with support for S32K3xx devices(3.5.0_D2303): SW32K3xx_S32DS_3.5.0_D2303.zip  (com.nxp.s32ds.sp1.s32k3xx.update_3.5.0.20230405175452)   4. For users who need to install S32K396 RTD for development, please download and install S32 Design Studio Service Pack 1 RTM with support for S32K39x devices(3.5.0_D2303): SW32K39x_S32DS_3.5.0_D2303.zip (com.nxp.s32ds.sp1.s32k396.update_3.5.0.20230330)   5.a) For users who need to install S32M276 RTD in S32K3 RTD 3.0.0\P01\P01 HF01\P01 HF02 for development, please download and install S32 Design Studio Service Pack 2 CD with support for S32M2xx devices (3.5.0_D2302😞 SW32M2xx_S32DS_3.5.0_D2302.zip(com.nxp.s32ds.s32m2.update_3.5.0.20230222151347)  Note: Please contact your local FAE to enable for you download the S32M276 development package. 5.b) For users who need to install S32M276 RTD in S32K3 RTD 3.0.0 P07 for development, , please download and install S32 Design Studio Service Pack 2 EAR2 with support for S32M2xx devices(3.5.0_D2303😞 SW32M2xx_S32DS_3.5.0_D2303.zip(com.nxp.s32ds.s32m2.update_3.5.0.20230328160305)   6. Select and install one of the following updatesite for S32K3 RTD 3.0.0: 6.a) Download and install S32K3 Real-Time Drivers Version 3.0.0: SW32K3_RTD_4.4_R21-11_3.0.0_D2303_DS_updatesite.zip   6.b) Download and install S32K3 Real-Time Drivers Version 3.0.0 P01 : SW32K3_RTD_4.4_3.0.0_P01_D2303_DS_updatesite.zip   6.c) Download and install S32K3 Real-Time Drivers Version 3.0.0 P01 HotFix 02 (3.0.0_P01_HF02😞 SW32K3_RTD_4.4_3.0.0_P01_HF02_DS_updatesite_D2305.zip   6.d) Download and install S32K3_M27X Real-Time Drivers Version 3.0.0 P07: SW32K3_RTD_R21-11_3.0.0 _P07_D2307.zip  
View full article
     This summary records my process of using J-LINK Plus in S32 Design Studio for S32 Platform, hoping to help people who use the same tool.   1.Download the latest package: https://www.segger.com/downloads/jlink/   2.Install the downloaded package and some note will show like this.   3.Open J-Link GDB Server V7.8 , if you current firmware version is too low, you will be prompted to upgrade to the latest firmware version.       At this point ,if you use the default configuration to debug the application, the following error will appear.   Modified the "Debug configurations" for S32 Design Studio platform V3.4   Change the highlighted part to the path below. C:\Program Files (x86)\SEGGER\JLink\JLinkGDBServerCL.exe C:\NXP\S32DS.3.4\S32DS\tools\gdb-arm\arm32-eabi\bin\arm-none-eabi-gdb.exe   Modified the "Debug configurations" for S32 Design Studio platform V3.5 Change the highlight part to the path below. C:\Program Files (x86)\SEGGER\JLink\JLinkGDBServerCL.exe C:\NXP\S32DS.3.5\S32DS\tools\gdb-arm\arm32-eabi\bin\arm-none-eabi-gdb.exe   For now, you may debug your project with SEGGER J-Link Plus Tools. Hope it works for you!
View full article
For S32 Design Studio v3.5 and earlier, there is a known issue when the S32 Configuration Tools are invoked from command line from a location outside of the S32DS installation directory. The following error is reported: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source) at com.nxp.swtools.common.utils.runtime.SingletonProvider.getSingletonInstance(SingletonProvider.java:46) at com.nxp.swtools.common.ui.utils.swt.internal.SWTFactory.getSingletonInstance(SWTFactory.java:421) at com.nxp.swtools.common.ui.utils.swt.SWTFactoryProxy.getSingletonInstance(SWTFactoryProxy.java:448) at com.nxp.swtools.dcd.controller.DCDController.getInstance(DCDController.java:84) at com.nxp.swtools.dcd.DCDStartup.earlyStartup(DCDStartup.java:23) at com.nxp.swtools.provider.SWToolsPlatform.initializeAllTools(SWToolsPlatform.java:702) at com.nxp.swtools.framework.Application.start(Application.java:475) at com.nxp.swtools.framework.Application.start(Application.java:445) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:654) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) at org.eclipse.equinox.launcher.Main.run(Main.java:1462) Caused by: java.lang.NoClassDefFoundError: javafx/beans/property/SimpleBooleanProperty at com.nxp.swtools.bootimage.controller.ABootController.<init>(ABootController.java:37) at com.nxp.swtools.dcd.dcf.common.DCDCommonController.<init>(DCDCommonController.java:90) at com.nxp.swtools.dcd.controller.DCDController.<init>(DCDController.java:43) ... 24 more Caused by: java.lang.ClassNotFoundException: javafx.beans.property.SimpleBooleanProperty cannot be found by com.nxp.swtools.bootimage_1.0.0.202207251223 at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:519) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:170) at java.base/java.lang.ClassLoader.loadClass(Unknown Source)   Resolution: To resolve the issue: Invoke the command from within the installation directory, for example, from 'C:\NXP\S32DS.3.5\eclipse' OR Change "{S32DS Installation Folder}\eclipse\s32ds.ini" by setting the javafx path from relative to absolute. So, if default installation is used, then: Change -Defxclipse.java-modules.dir=jre/javafx-sdk-11.0.2/lib To -Defxclipse.java-modules.dir=C:/NXP/S32DS.3.5/eclipse/jre/javafx-sdk-11.0.2/lib   In addition, if it is desired to suppress unimportant warning messages: go to {S32DS installation folder}\eclipse\configuration, open logging.properties file and change com.nxp.swtools.level = SEVERE
View full article
This document shows the step-by-step process to create a simple blinking LED application for the S32R41 family using the S32 RTD AUTOSAR drivers. This example used for the S32R41 EVB, connected via ethernet connection through S32 Debugger. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32R41 development package and the S32R41 RTD AUTOSAR 4.4. Both of these are required for the S32 Configuration Tools. Launch S32 Design Studio for S32 Platform Procedure New S32DS Project OR Provide a name for the project, for example 'Blinking_LED_RTD_With_AUTOSAR'. The name must be entered with no space characters. Expand Family S32R41, Select S32R418AB Cortex-M7  Click Next Click '…' button next to SDKs Check box next to PlatformSDK_SAF85_S32R41_2022_08_S32R418AB _M7_0. Click OK And also, uncheck the other core Cortex_M7_1 Click Finish. Wait for project generation wizard to complete, then expand the project within the Project Explorer view to show the contents. To control the LED on the board, some configuration needs to be performed within the Pins Tool. There are several ways to do this. One simple way by double-click on the MEX file. Select the overview tab and disable Pins tool. Make sure to overview tab windows shows settings shown as below.  Here, we are disabling pin tools and using MCAL driver from peripheral tools for using AUTOSAR drivers. Now from Overview menu, select peripheral tools and double click to open it. In the driver sections, “Siul2_Port_1 driver” is the non-AUTOSAR version driver and so it must be replaced. Right click on ‘Siul2_Port_1’ and remove it. Keep BaseNXP driver as it is. Click on the ‘+’ next to the MCAL box. Locate and then select the ‘Dem’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Dio’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Mcu’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Port’ component from the list and click OK. Now components tab should show like below : Now we required to configure the different MCAL drivers that we added. Starting with Dio configuration, open the Dio configuration. No change is required for Dem configuration. Now, open the ‘DioGeneral’ tab, and select checkmark as per shown below: Now, open the ”DioConfig” tab. In that Select  “+” sign adjacent to Dio Channel. Then Edit Name to “Digital_Output_LED_0” and Dio Channel Id to ‘4’ instead of ‘0’. From the schematic for S32R41 EVB, checking for signal line for the user LED, channel 4 is connected to user LED signal, so we use channel 4 for signal line for user LED on the chip. So, we select the signal line for Dio channel Id 4 for the LED connected on the S32R41 EVB. Now Select Port tab for Port configuration. And open the Port Configuration tab, and from that open “PortConfigSet” tab. Change the PortPin Mscr to 36 , PortPin Direction to PORT_PIN_INOUT as shown below: Now, at the bottom you will find the “UnTouchedPortPin ’’ . Click on “+’’ and add PortPins. Now add port pins 0, 1, 2, 3,4 as per below configuration Now configure MCU component. Select Mcu component in MCAL, and then open the Mcu configuration. In Mcu configuration click MCUModuleConfiguration and then select  “McuModesettingConf” from the dropdown menu as shown below. From McuModeSettingConf select McuPartitionConfiguration Now open “McuPartition0Config” tab. And under the McuCore0Configuration for “McuCoreClockEnable” select checkbox and for “McuCoreResetEnable” uncheck  the checkbox. Similarly, And under the McuCore1Configuration for “McuCoreClockEnable” select checkbox and for “McuCoreResetEnable” uncheck  the checkbox. After modification it should be as shown below: Now open the “McuPartition1Config” tab. for "McuPartitionClockEnable" select checkmark to true and for "McuPartitionResetEnable" uncheck  the checkmark   And under McuCore0Configuration for "McuCoreClockEnable"  select checkmark to true and for "McuCoreResetEnable" uncheck  the checkmark After modification it should be as shown below: Now, click on global setting icon as shown below: And, Confirm that ComponentGenerationMethod is set to “FunctionalGroups” Now the device configurations are complete and the RTD configuration code can be generated. Click ‘Update Code’ from the menu bar. To control the output pin which was just configured, some application code will need to be written. Return to the ‘C/C++’ perspective. If not already open, in the project window click the ‘>’ next to the ‘src’ folder to show the contents, then double click ‘main.c’ file to open it. This is where the application code will be added. Before anything else is done, Initialize the clock tree and apply PLL as system clock, Apply a mode configuration, Initialize all pins using the Port driver by adding – editing code before write code here comment in main function.        /* Initialize the Mcu driver */        Mcu_Init(&Mcu_Config_BOARD_InitPeripherals);        /* Initialize the clock tree and apply PLL as system clock */        Mcu_InitClock(McuClockSettingConfig_0);        /* Apply a mode configuration */        Mcu_SetMode(McuModeSettingConf_0);        /* Initialize all pins using the Port driver */        Port_Init(NULL_PTR); Now replace the logic of for loop as shown below code section, which will enable the LED blinking for 10 times: You also need to declare and initialize the loop variable: uint8 i = 0U; Then replace the code as below after write your code comment: /*Logic for blinking LED 10 times*/ while (i++ < 10) {       /* Get input level of channels */       Dio_WriteChannel(DioConf_DioChannel_Digital_Output_LED_0, STD_HIGH);       TestDelay(3000000);       Dio_WriteChannel(DioConf_DioChannel_Digital_Output_LED_0, STD_LOW);       TestDelay(3000000); } Before the 'main' function, add a delay function as follows: void TestDelay(uint32 delay); void TestDelay(uint32 delay) {     static volatile uint32 DelayTimer = 0;     while(DelayTimer<delay)     {         DelayTimer++;     }     DelayTimer=0; } Update the includes lines at the top of the main.c file to include the headers for the drivers used in the application: Add #include "Mcu.h" #include "Port.h" #include "Dio.h" Now, in open peripheral tools again by clicking on icon as shown below. And then click on global setting icon as shown below: And, Confirm that ComponentGenerationMethod is set to “FunctionalGroups” Build 'Blinking_LED_RTD_AUTOSAR'. Select the project name in 'C/C++ Projects' view and then press 'Build'. After the build completes, check that there are no errors. Open Debug Configurations and select 'Blinking_LED_RTD_with_AUTOSAR_Debug_RAM'. Make sure to select the configuration which matches the build type performed, otherwise it may report an error if the build output doesn’t exist. And make selection as shown in screenshot below. You need to select the ethernet connection for S32 debugger and provide its IP address Click Debug To see the LED blink, click ‘Resume' This code as it will blink the LED 10 times, you can make changes in for loop condition to blink it infinitely.
View full article
This document shows the step-by-step process to create a simple blinking LED application for the S32R41 device using the S32 RTD non-AUTOSAR drivers. For this example used for the S32R41 EVB, connected via ethernet connection through S32 Debugger. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32R41 development package and the S32R41 RTD AUTOSAR 4.4. Both of these are required for the S32 Configuration Tools. Launch S32 Design Studio for S32 Platform Procedure New S32DS Project OR Provide a name for the project, for example 'Blinking_LED_RTD_No_AUTOSAR'. The name must be entered with no space characters. Expand Family S32R41, Select S32R418AB Cortex-M7 Click Next Now, uncheck the selection mark for other core, i.e. for Cortex-M7-1 And Click '…' button next to SDKs Check box next to PlatformSDK_SAF85_S32R41_2022_08_S32R418AB _M7_0. (or whichever latest SDK for the S32R41 is installed). Click OK Click Finish. Wait for project generation wizard to complete, then expand the project within the Project Explorer view to show the contents. To control the LED on the board, some configuration needs to be performed within the Pins Tool. There are several ways to do this. One simple way by double-click on the MEX file. The schematic for S32R41 EVB, checking for signal line for the user LED, channel 4 is connected to user LED signal, so we use channel 4 for signal line for user LED on the chip. So, we select the signal line for Dio channel Id 4 for the LED connected on the S32R41 EVB. From the Peripheral Signals tab left to the Pins tool perspective layout, locate Open the Siul2_0 from the peripheral signals tab. And from the drop down menu select “gpio,36 PC_04” option as per shown in the following image. We are using PC_04 for the GPIO usage, so we are routing SIUL2_0 GPIO signal to this pin. The Direction required! menu will appear. Select Output then OK. In Routing Details view, notice a new line has been added and highlighted in yellow. Add ‘LED’ to the Label and Identifier columns for the PC_04 pin. Code Preview Go to Peripherals tool and add Siul2_Dio to enable LED blinking, it adjacent to the Blue LED on S32R41  EVB. Click on the Peripherals Tool icon from the Eclipse Perspective navigation bar. From the Components view, click on ‘Add a new configuration component…’ button from the Drivers category. This will bring up a list of all configuration components. Locate and then select the ‘Siul2_Dio’ component from the list and click OK. Do not worry about the warning message. It is only indicating that the driver is not already part of the current project. The associated driver package will be added automatically. Note: It may be necessary to change the selection at the top from ‘Present in the tool-chain project’ to ‘All’. The DIO driver provides services for reading and writing to/from DIO Channels. Also, select the Siul2_Port tab and uncheck the checkmark against ‘Siul2 IP Port Development Error Detect’ option as below. The Gpio_Dio driver requires no further configuration. Click Save to store all changes to the .MEX file. Now the device configurations are complete and the RTD configuration code can be generated. Click ‘Update Code’ from the menu bar. To control the output pin which was just configured, some application code will need to be written. Return to the ‘C/C++’ perspective. If not already open, in the project window click the ‘>’ next to the ‘src’ folder to show the contents, then double click ‘main.c’ file to open it. This is where the application code will be added. Before the pin can be controlled, it needs to be initialized using the configuration information that was generated from the S32 Configuration tools. Initialize all pins using the Port driver by adding the following line: Insert the following line into main, after the comment 'Write your code here': /* Initialize all pins using the Port driver */ Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0); Now, add logic for the LED turn and off. To turn the pin on and off with some delays in-between to cause the LED to blink. Make the delays long enough to be perceptible. Add line to initialize variable uint8 i = 0; Change the code within the provided for loop, and add the following lines: /* logic for blinking LED 10 times for (i=0; i<10; i++) {       Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 1U);       level = Siul2_Dio_Ip_ReadPin(LED_PORT, LED_PIN);       TestDelay(2000000);       Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 0U);       level = Siul2_Dio_Ip_ReadPin(LED_PORT, LED_PIN);       TestDelay(2000000); } return (0U); And add this line above the main() function to initialize the variable volatile uint8 level; Before the 'main' function, add a delay function as follows: void TestDelay(uint32 delay); void TestDelay(uint32 delay) {    static volatile uint32 DelayTimer = 0;    while (DelayTimer<delay)    {        DelayTimer++;    }    DelayTimer=0; } Update the includes lines at the top of the main.c file to include the headers for the drivers used in the application: Remove #include "Mcal.h" Add #include "Siul2_Port_Ip.h" #include "Siul2_Dio_Ip.h" Build 'Blinking_LED_RTD_No_AUTOSAR'. Select the project name in 'C/C++ Projects' view and then press 'Build'. After the build completes, check that there are no errors. Open Debug Configurations and select 'Blinking_LED_RTD_No_AUTOSAR_Debug_RAM'. Make sure to select the configuration which matches the build type performed, otherwise it may report an error if the build output doesn’t exist. Now, you need to Select the Interface (Ethernet or USB) by which the S32 Debug Probe is connected. If connected via USB and this option is selected for interface, then the COM port will be detected automatically (in the rare event where 2 or more S32 Debug Probes are connected via USB to the host PC, then it may be necessary to select which COM port is correct for the probe which is connected to the EVB) If connected via Ethernet, enter the IP address of the probe. See the S32 Debug Probe User Manual for ways to determine the IP address. Click Debug To see the LED blink, click ‘Resume'. This code as is will blink the LED 10 times, you can make changes in for loop condition to blink it infinitely.
View full article
This document shows the step-by-step process to create a simple blinking LED application for the S32R45 family using the S32 RTD AUTOSAR drivers. This example used for the S32R45 EVB, connected via ethernet connection through S32 Debugger. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32R45 development package and the S32R45 RTD AUTOSAR 4.4. Both of these are required for the S32 Configuration Tools. Launch S32 Design Studio for S32 Platform Procedure New S32DS Project OR Provide a name for the project, for example 'Blinking_LED_RTD_With_AUTOSAR'. The name must be entered with no space characters. Expand Family S32R45, Select S32R45 Cortex-M7 Click Next Click '…' button next to SDKs Check box next to PlatformSDK_S32RXX_4_0_0_S32R45_M7_0. (or whichever latest SDK for the S32R45 is installed). Click OK And also, uncheck the other cores Cortex_M7_1 ,  Cortex_M7_2. Click Finish. Wait for project generation wizard to complete, then expand the project within the Project Explorer view to show the contents. To control the LED on the board, some configuration needs to be performed within the Pins Tool. There are several ways to do this. One simple way by double-click on the MEX file. Select the overview tab and disable Pins tool. Make sure to overview tab windows shows settings shown as below.  Here, we are disabling pin tools and using MCAL driver from peripheral tools for using AUTOSAR drivers. Now from Overview menu, select peripheral tools and double click to open it. In the driver sections, “Siul2_Port_1 driver” is the non-AUTOSAR version driver and so it must be replaced. Right click on ‘Siul2_Port_1’ and remove it. Keep osif_1 driver as it is. Click on the ‘+’ next to the MCAL box. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Dio’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Mcu’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Port’ component from the list and click OK. Now components tab should show like below : Now we required to configure the different MCAL drivers that we added. Starting with Dio configuration, open the Dio configuration. Now, open the ‘DioConfig’ tab, and Edit Dio Port id to 3 as shown below: Now, in “Dio Configuration” window only, Select  “+” sign adjacent to DioChannel. Then Edit Name to “Digital_Output_LED” and Dio Channel Id to ‘5’ instead of ‘0’. From the schematic for S32GR45 EVB, checking for user LED from the schematic, channel 5 is connected to user LED signal, so we use channel 5 signal line to the chip for the user LED. So, we select the singal line for Dio channel Id 5 for the user LED connected on the S32R45 EVB. Now Select Port tab for Port configuration. And open the Port Configuration tab, and from that open “PortConfigSet” tab. Change the PortPin Mscr to ‘53’ and slew rate to ‘SRE_208MHZ_1_8V_166MHZ_3_3V’ and, PortPin Direction to PORT_PIN_INOUT as shown below: Now, at the bottom you will find the “UnTouchedPortPin ’’ . Click on “+’’ and add PortPins. Now add port pins 0, 1, 2, 3 as per below configuration Now configure MCU component. Select Mcu component in MCAL, and then open the Mcu configuration. In Mcu configuration click on MCUModuleConfiguration and then select “McuModesettingConf” from the dropdown menu as shown below. From McuModeSettingConf, select McuPartitionConfiguration tab. Then open the “McuPartition0Config” tab. And under the McuCore0Configuration or “McuCoreClockEnable” select checkbox and for “McuCoreResetEnable” uncheck the checkbox. Similarly, And under the McuCore1Configuration for “McuCoreClockEnable” select checkbox  and for “McuCoreResetEnable” uncheck the checkbox. Similarly, And under the McuCore2Configuration for “McuCoreClockEnable” select checkbox and for “McuCoreResetEnable” uncheck  the checkbox. After modification it should be as shown below: Now open the “McuPartition1Config” tab. for " Partition1 Clock Enable" select checkmark to true and for " Partition1 Clock Reset Enable" uncheck the checkmark for " CA53 CORE 0 cluster0 Core Clock Enable" select checkmark to true and for " Cortex-A53 Core 0 cluster 0 Clock Reset Enable" uncheck  the checkmark In the McuCore1Configuration, and for " Cortex-A53 Core 1 cluster 0 Clock Reset Enable" uncheck the checkmark In the McuCore2Configuration, for " Cortex-A53 CORE 0 cluster 1 Core Clock Enable" select checkmark to true and for " Cortex-A53 CORE 0 cluster 1 Clock Reset Enable" uncheck the checkmark In the McuCore3Configuration, for " Cortex-A53 CORE 0 cluster 1 Clock Reset Enable" uncheck the checkmark After modification it should be as shown below: Now open the “McuPartition2Config” tab. for " Partition2 Clock Enable" select checkmark to true and for " Partition2 Clock Reset Enable" uncheck the checkmark Now open the “McuPartition3Config” tab. for " Partition3 Clock Enable" select checkmark to true and for " Partition3 Clock Reset Enable" uncheck the checkmark Now the device configurations are complete and the RTD configuration code can be generated. Click ‘Update Code’ from the menu bar. To control the output pin which was just configured, some application code will need to be written. Return to the ‘C/C++’ perspective. If not already open, in the project window click the ‘>’ next to the ‘src’ folder to show the contents, then double click ‘main.c’ file to open it. This is where the application code will be added. Before anything else is done, Initialize the clock tree and apply PLL as system clock, Apply a mode configuration, Initialize all pins using the Port driver by adding – editing code before write code here comment in main function.        /* Initialize the Mcu driver */        Mcu_Init(&Mcu_Config_BOARD_InitPeripherals);        /* Initialize the clock tree and apply PLL as system clock */        Mcu_InitClock(McuClockSettingConfig_0);        /* Apply a mode configuration */        Mcu_SetMode(McuModeSettingConf_0);        /* Initialize all pins using the Port driver */        Port_Init(NULL_PTR); Now replace the logic of for loop as shown below code section in the main function, which will enable the LED blinking for 10 times: You also need to declare and initialize the loop variable uint8 i = 0U; . Then replace the code as below after write your code comment: /*Logic for blinking LED 10 times*/ while (i++ < 10) {           /* Get input level of channels */           Dio_WriteChannel(DioConf_DioChannel_Digital_Output_LED, STD_HIGH);           TestDelay(3000000);           Dio_WriteChannel(DioConf_DioChannel_Digital_Output_LED, STD_LOW);           TestDelay(3000000); } Before the 'main' function, add a delay function as follows: void TestDelay(uint32 delay); void TestDelay(uint32 delay) {      static volatile uint32 DelayTimer = 0;      while(DelayTimer<delay)      {             DelayTimer++;      }      DelayTimer=0; } Update the includes lines at the top of the main.c file to include the headers for the drivers used in the application: Add #include "Mcu.h" #include "Port.h" #include "Dio.h" Build 'Blinking_LED_RTD_AUTOSAR'. Select the project name in 'C/C++ Projects' view and then press 'Build'. After the build completes, check that there are no errors. Open Debug Configurations and select 'Blinking_LED_RTD_with_AUTOSAR_Debug_RAM'. Make sure to select the configuration which matches the build type performed, otherwise it may report an error if the build output doesn’t exist. And make selection as shown in screenshot below. You need to select the ethernet connection for S32 debugger and provide its IP address Click Debug To see the LED blink, click ‘Resume' This code as it will blink the LED 10 times, you can make changes in for loop condition to blink it infinitely.
View full article
This document shows the step-by-step process to create a simple blinking LED application for the S32R45 device using the S32 RTD non-AUTOSAR drivers. For this example used for the S32R45 EVB, connected via ethernet connection through S32 Debugger. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32R45 development package and the S32R45 RTD AUTOSAR 4.4. Both of these are required for the S32 Configuration Tools. Launch S32 Design Studio for S32 Platform Procedure New S32DS Project OR Provide a name for the project, for example 'Blinking_LED_RTD_No_AUTOSAR'. The name must be entered with no space characters. Expand Family S32R45, Select S32R45 Cortex-M7 Click Next And Click '…' button next to SDKs Check box next to PlatformSDK_S32RXX_4_0_0_S32R45_M7_0. (or whichever latest SDK for the S32R45 is installed). Click OK Now, uncheck the selection mark for other core, i.e. for Cortex-M7-1 , Cortex-M7-2 Click Finish. Wait for project generation wizard to complete, then expand the project within the Project Explorer view to show the contents. To control the LED on the board, some configuration needs to be performed within the Pins Tool. There are several ways to do this. One simple way by double-click on the MEX file. By default, the Pins tool is then presented. For the Blinking LED example, one pin must be configured as output. The S32R45 EVB has an user LED connected pin is PD_05. From the Peripheral Signals tab left to the Pins tool perspective layout, locate Open the Siul2_0 from the peripheral signals tab. And from the drop down menu select “gpio,53 PD_05” option as per shown in the following image. We are using PD_05 for the GPIO usage, so we are routing SIUL2_0 GPIO signal to this pin. Select gpio53 -> PD_05 as shown below : The Direction required! menu will appear. Select Output then OK. In Routing Details view, notice a new line has been added and highlighted in yellow. Add ‘LED’ to the Label and Identifier columns for the PORTD 5 pin. Code Preview Go to Peripherals tool and add Siul2_Dio to enable LED blinking, it adjacent to the user LED on S32R45 EVB. Click on the Peripherals Tool icon from the Eclipse Perspective navigation bar. From the Components view, click on ‘Add a new configuration component…’ button from the Drivers category. This will bring up a list of all configuration components. Locate and then select the ‘Siul2_Dio’ component from the list and click OK. Do not worry about the warning message. It is only indicating that the driver is not already part of the current project. The associated driver package will be added automatically. Note: It may be necessary to change the selection at the top from ‘Present in the tool-chain project’ to ‘All’. The DIO driver provides services for reading and writing to/from DIO Channels. The Gpio_Dio driver requires no further configuration. Click Save to store all changes to the .MEX file. Now the device configurations are complete and the RTD configuration code can be generated. Click ‘Update Code’ from the menu bar. To control the output pin which was just configured, some application code will need to be written. Return to the ‘C/C++’ perspective. If not already open, in the project window click the ‘>’ next to the ‘src’ folder to show the contents, then double click ‘main.c’ file to open it. This is where the application code will be added. Before the pin can be controlled, it needs to be initialized using the configuration information that was generated from the S32 Configuration tools. Initialize all pins using the Port driver by adding the following line: Insert the following line into main, after the comment 'Write your code here': /* Initialize all pins using the Port driver */ Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0); Now, add logic for the LED turn and off. To turn the pin on and off with some delays in-between to cause the LED to blink. Make the delays long enough to be perceptible. Add line to initialize variable uint8 i = 0; Change the code within the provided for loop, and add the following lines: //logic for blinking LED 10 times while (i++ < 10) {        Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 1U);        TestDelay(4000000);        Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 0U);        TestDelay(4000000); } Before the 'main' function, add a delay function as follows: void TestDelay(uint32 delay); void TestDelay(uint32 delay) {    static volatile uint32 DelayTimer = 0;    while (DelayTimer<delay)    {        DelayTimer++;    }    DelayTimer=0; } Update the includes lines at the top of the main.c file to include the headers for the drivers used in the application: Remove #include "Mcal.h" Add #include "Siul2_Port_Ip.h" #include "Siul2_Dio_Ip.h" Build 'Blinking_LED_RTD_No_AUTOSAR'. Select the project name in 'C/C++ Projects' view and then press 'Build'. After the build completes, check that there are no errors. Open Debug Configurations and select 'Blinking_LED_RTD_No_AUTOSAR_Debug_RAM'. Make sure to select the configuration which matches the build type performed, otherwise it may report an error if the build output doesn’t exist. Now, you need to Select the Interface (Ethernet or USB) by which the S32 Debug Probe is connected. If connected via USB and this option is selected for interface, then the COM port will be detected automatically (in the rare event where 2 or more S32 Debug Probes are connected via USB to the host PC, then it may be necessary to select which COM port is correct for the probe which is connected to the EVB) If connected via Ethernet, enter the IP address of the probe. See the S32 Debug Probe User Manual for ways to determine the IP address. Click Debug To see the LED blink, click ‘Resume'. This code as it will blink the LED 10 times, you can make changes in for loop condition to blink it infinitely.
View full article
This document shows the step-by-step process to create a simple blinking LED application for the S32G family using the S32 RTD AUTOSAR drivers. This example used for the S32G-VNP-RDB2 EVB, connected via ethernet connection through S32 Debugger. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32G development package and the S32 RTD AUTOSAR 4.4. Both of these are required for the S32 Configuration Tools. Launch S32 Design Studio for S32 Platform Procedure New S32DS Project OR Provide a name for the project, for example 'Blinking_LED_RTD_With_AUTOSAR'. The name must be entered with no space characters. Expand Family S32G2, Select S3G274A_Rev2 Cortex-M7 Click Next Click '…' button next to SDKs Check box next to PlatformSDK_S32XX_2022_07_S32G274A_Rev2_M7_0. Click OK And also, uncheck the other cores Cortex_M7_1 ,  Cortex_M7_2. Click Finish. Wait for project generation wizard to complete, then expand the project within the Project Explorer view to show the contents. To control the LED on the board, some configuration needs to be performed within the Pins Tool. There are several ways to do this. One simple way by double-click on the MEX file. Select the overview tab and disable Pins tool. Make sure to overview tab windows shows settings shown as below.  Here, we are disabling pin tools and using MCAL driver from peripheral tools for using AUTOSAR drivers. Now from Overview menu, select peripheral tools and double click to open it. In the driver sections, “Siul2_Port_1 driver” is the non-AUTOSAR version driver and so it must be replaced. Right click on ‘Siul2_Port_1’ and remove it. Keep the osif_1 driver as it is. Click on the ‘+’ next to the MCAL box. Locate and then select the ‘MCU’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Dio’ component from the list and click OK. Click on the ‘+’ next to the MCAL box again, and Locate and then select the ‘Port’ component from the list and click OK. Now components tab should show like below : Now we required to configure the different MCAL drivers that we added. Starting with Dio configuration, open the Dio configuration. Now, open the ‘DioGeneral’ tab, and select checkmark as per shown below: Now, open the ”DioConfig” tab. In that, select  “+” sign adjacent to Dio Channel. Then edit Name to Digital_Output_LED and “Dio Channel Id”  to ‘6’ instead of ‘0’. From the schematic for S32G-VNP-RDB2 EVB, we can select signal line based on your choice for the LED color for the multicolor RGB LED. Now, checking for blue user LED from the schematic, channel 6 is connected to blue LED signal, so we use channel 6 signal line to the chip on the blue LED. Similarly, so you can select signal line based on LED color you select. Now Select Port tab for Port configuration. And open the Port Configuration tab, and from that open “PortConfigSet” tab. Change the PortPin Mscr to 6 , PortPin Direction to PORT_PIN_INOUT. After change it should be as below. At the bottom you will find the “UnTouchedPortPin ’’ . Click on “+’’ and add PortPins. Now add 4 port pins as per below configuration. Pins 0, 1, 4, and 5 should be setup. Now configure MCU component. Select Mcu component in MCAL, and then open the Mcu configuration. In Mcu configuration select “McuModesettingConf” from the dropdown menu as shown below. Select ‘McuPartition0Config’ and deselect checkbox for CM7_0 Under MCU Control, CM7_1 Under MCU Control, CM7_2 Under MCU Control as marked below. And it should show as below Now select the Mcupartition1Config and uncheck checkmarks from the selection boxes as shown below Now the device configurations are complete and the RTD configuration code can be generated. Click ‘Update Code’ from the menu bar. To control the output pin which was just configured, some application code will need to be written. Return to the ‘C/C++’ perspective. If not already open, in the project window click the ‘>’ next to the ‘src’ folder to show the contents, then double click ‘main.c’ file to open it. This is where the application code will be added. Before anything else is done, Initialize the clock tree and apply PLL as system clock, Apply a mode configuration, Initialize all pins using the Port driver by adding – editing code before write code here comment in main function.          Mcu_Init(&Mcu_Config_BOARD_InitPeripherals);     /* Initialize the clock tree and apply PLL as system clock */     Mcu_InitClock(McuClockSettingConfig_0);     /* Apply a mode configuration */     Mcu_SetMode(McuModeSettingConf_0);     /* Initialize all pins using the Port driver */     Port_Init(NULL_PTR); Now replace the logic of for loop as shown below code section, which will enable the LED blinking for 10 times: First define the variable volatile uint8 level; globally above the main function. You also need to declare and initialize the loop variable uint8 i = 0U. Then replace the code as below: while (i++ < 10) {       Dio_WriteChannel(DioConf_DioChannel_Digital_Output_LED, STD_HIGH);       level = Dio_ReadChannel(DioConf_DioChannel_Digital_Output_LED);       TestDelay(2000000);       Dio_WriteChannel(DioConf_DioChannel_Digital_Output_LED, STD_LOW);       level = Dio_ReadChannel(DioConf_DioChannel_Digital_Output_LED);       TestDelay(2000000); } Before the 'main' function, add a delay function as follows: void TestDelay(uint32 delay); void TestDelay(uint32 delay) {     static volatile uint32 DelayTimer = 0;     while(DelayTimer<delay)     {         DelayTimer++;     }     DelayTimer=0; } Update the includes lines at the top of the main.c file to include the headers for the drivers used in the application: Add #include "Mcu.h" #include "Port.h" #include "Dio.h" Build 'Blinking_LED_RTD_AUTOSAR'. Select the project name in 'C/C++ Projects' view and then press 'Build'. After the build completes, check that there are no errors. Open Debug Configurations and select 'Blinking_LED_RTD_with_AUTOSAR_Debug_RAM'. Make sure to select the configuration which matches the build type performed, otherwise it may report an error if the build output doesn’t exist. And make selection as shown in screenshot below. You need to select the ethernet connection for S32 debugger and provide its IP address Click Debug To see the LED blink, click ‘Resume' This code as it is will blink the LED 10 times, you can make changes in for loop condition to blink it infinitely.
View full article
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
S32 Design Studio (S32DS) supports IAR Eclipse plug-in that enables users to build and debug a S32DS project with IAR toolchain for ARM. This document describes how to install this plugin and how to enable IAR in the new project wizard. Current version of S32DS 3.4 supports IAR compilers v9.x. After the IAR eclipse plugin installation is finished you should be able to create, build and debug a new S32DS project (including SDKs) using IAR compiler/debugger interface directly under S32DS Eclipse environment.   Installation instructions First of all make sure you have IAR Embedded Workbench installed with a valid license from IAR. Now let's proceed to eclipse plug-in installation. 1. Install IAR Plugin manager  Go to menu "Help" -> "Install New Software"         Click on "Add..." button to add a new IAR repository located here: http://eclipse-update.iar.com/plugin-manager/1.0                   Tick "I Accept the terms of the license agreement" and click "Finish" to accept unsigned content software Finally you proceed to the installation. When the plugin is installed you will be asked to restart S32DS Again, go to menu "Help" -> "Install New Software" and  click on "Add..." button to add a new IAR repository located here: http://eclipse-update.iar.com/arm/9.10/                   Tick "I Accept the terms of the license agreement" and click "Finish" to accept unsigned content software Finally you proceed to the installation. When the plugin is installed you will be asked to restart S32DS Anytime you create a new workspace you will be asked to enter path to IAR Embedded Workbench IDE. Go to menu "Window" -> "Preferences", click on "IAR Embedded Workbench" menu, select “IAR Toolchain for Arm – (9.x)” in the “Installed IAR Toolchains”, and then input the IAR Embedded Workbench IDE installation path.            2. Configure IAR plugins in IAR Embedded Workbench plugin manager Start the IAR plugin manager (Menu "Help" -> "IAR Embedded Workbench plugin manager")          Select the ARM version (9.10-) and click "Install" button.           Select all the IAR components displayed and proceed to installation by clicking "Next" button.   3. New IAR project in the project wizard You can now create a new project in S32DS and select IAR toolchain for ARM instead of default GCC compiler.          There should appear a new item it the Debugger selection - "IAR plugin Debugger". Please choose this option if you intend to debug using IAR supported probes (e.g. I-jet)          IAR specific panels and settings are now displayed in the project properties for a new S32DS project with the IAR options enabled (see below).          There is a new category "IAR C-SPY Application" in the debug configurations panel that contains all the debug configurations for projects with IAR debug plugin option selected.          The Debugger perspective now offers several IAR specific Views and features.   Enjoy building and debugging with IAR Eclipse plug-in in S32DS!
View full article
The Port_Ci_Port_Ip_Example in S32K1 RTD 1.0.1 lacks GPIO interrupt function. Port_Ci is part of Icu(Input Capture Unit), the main function of the example should have been: use the Icu and Dio drivers to toggle a LED on a push button. But it doesn't. So this document will show the step-by-step process to add 'GPIO interrupt' function in Port_Ci_Port_Ip_Example using the S32K1xx RTD and the S32 Configuration Tools. This example is for the S32K144EVB-Q100 EVB, connected to a PC through USB (OpenSDA) connection. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32K1xx development package and the S32K1 RTD AUTOSAR 4.4. Both of these are required for the S32 Configuration Tools.   Launch S32 Design Studio for S32 Platform   Procedure 1. Import Port_Ci_Port_Ip_Example_S32K144 example File->New->S32DS Project from Example Although the main function mentions the example use the Icu and Dio drivers to toggle a LED on a push button, it actually just waits in a loop for a delay to blink the LED. Not sure why the implementation of GPIO interrupts(Port_Ci_Icu) is missing.   2. Add push button and LED in Pins tool Add the pins for user buttons (SW2 PTC12 and SW3 PTC13) and LEDRGB_RED (RGB_RED PTD15) according to the S32K144EVB schematic RB1.   3. Add IntCtrl_Ip component Go to Peripherals tool. Here we can see that the ‘Gpio_Dio’ and ‘Port’ components are already added. From the Components view, click on ‘Add a new configuration component…’ button from the Drivers category. This will bring up a list of non-AUTOSAR components. Locate and then select the ‘IntCtrl_Ip’ component from the list and click OK. Keep the default setting after add ‘IntCtrl_Ip’ component, we will call IntCtrl_Ip_InstallHandler and IntCtrl_Ip_EnableIrq those two APIs to install and enable the PORTC IRQ separately. (Here we didn't change the settings of ‘IntCtrl_Ip’, nor use IntCtrl_Ip_Init and IntCtrl_Ip_ConfigIrqRouting API to enable interrupts and install handlers in IntCtrl_Ip.)   4. Add Port_Ci_Icu component Locate and then select the ‘Port_Ci_Icu’ component from the list and click OK. Follow the steps below to configure it. Selecting PORT_2 for ICU Peripheral ISR Name and select IcuIsrEnable at step 6 actually refers to PORT C used in this example. In order to use the GPIO interrupts of the onboard SW2 (PTC12) and SW3 (PTC13) buttons, you need to add one more channel in step 9, and select Port CI Hardware Module and Hardware channel in steps 8 and 10. The button circuit has a pull-down resistor, and it will be pulled high after being pressed, so the rising edge trigger is selected. In step 14, add IcuSignalNotification for PTC12 and PTC13 respectively, that is, the notification after the corresponding GPIO pin input captures the rising edge (there is no need to clear the interrupt flag here, the RTD driver has already done it).   5. Include the headers for the drivers used in the application   6. Add Port_Ci_Icu drivers Port_Ci_Icu_Ip_Init initialize the rising edge of PTC12 and PTC13 set by the S32 Configuration Tools. Port_Ci_Icu_Ip_EnableNotification enable the Callback of PTC12 and PTC13 respectively, and we toggle the blue and red LEDs in the corresponding Callback.   7. Add IntCtrl drivers IntCtrl_Ip_InstallHandler installs the PORT_CI_ICU_IP_C_EXT_IRQ_ISR interrupt handler generated by the S32 Configuration Tools.
View full article
This release of S32K116 Bootloader was compiled and tested with the following development tools: S32DS Rappid Bootloader  Tested on the hardware: Development Board S32K116EVB – Q048 Processor  PS32K116MLF- Q048   Supported communication: UART0 (Pin PTB0-PTB1) CAN0 (Pin PTE4-PTE5)
View full article
This release of S32K144W Bootloader was compiled and tested with the following development tools: S32DS Rappid Bootloader  Tested on the hardware: Development Board S32K14XCVD – 0064 Processor  PS32K144WAWLH 0P64A – CTZW2009B   Supported communication: UART1 (Speed:115200b/s): J16 on the S32K-MB Motherboard. CAN_A (Speed: 500Kb/s): J72 on the S32K-MB Motherboard.
View full article
Users can now get the AMMCLib for S32K3 in S32DS 3.4 if they manually add the following URL to the list of “Available S32DS Software Sites”: http://www.nxp.com/lgfiles/updates/Eclipse/AMMCLIB/S32DS_3.5 (the URL will be auto-added with the upcoming S32DS 3.5 release). From within S32 Design Studio for S32 Platform 3.4, launch S32DS Extensions and Updates menu (Help -> S32DS Extensions and Updates), then select 'Add Update Sites'. Please note that the S32K3XXMCLUG.pdf User’s Guide incorrectly indicates that the library is available as a standalone SDK, which is incorrect. AMMCLib for S32K3 is part of the “PlatformSDK” system which means that users must use the RTD for S32K3 in their S32DS project to gain access to AMMCLib:   Then they must activate the „S32 Configuration Tool“ (CT):   Within the CT, they must click on the „Peripherals“, then „Libraries“, and select „AMMCLib“ from the list:   Then they must click on „Update code“, to update the paths in the project:    
View full article
After installation of S32 Flash Tool 2.1, try to start the GUI and get below error : We noticed this behavior on some PCs – either OS setup or security rules do not allow the installer to create a link to the JRE (Java 11) that is installed with Flash Tool. A quick fix is to set the path manually by adding the following lines to “S32FlashTool_2.1\GUI\ s32ft.ini”
View full article