Accelerate NXP S32K3 MCU-based Automotive Software Development with NXP S32DS and IAR Embedded Workbench for Arm

04/02/2022

A case study of how to fully combine the advantages of the original MCU development environment and industry-leading software tools to accelerate the development of mission-critical applications


With the market demand and the continuous advancement of the "new four modernizations" such as electrification, networking, intelligence and sharing in the automotive industry, engineers will face more and more software development projects, using high-performance, high-quality vehicles Regulatory-grade and functional safety-certified MCU development related applications. Combining the MCU development environment provided by the MCU supplier with the industry-leading development tools will bring developers a significant improvement in development efficiency and performance. This article takes the S32K series 32-bit Arm Cortex automotive MCU widely used in the automotive industry as an example to introduce the rapid development of high-performance by integrating its S32DS development environment and the IAR Embedded Workbench for Arm tool chain that has been widely used in the industry Automotive MCU applications.


Since its launch in 2017, the NXP S32K1 MCU has been widely used in the automotive electronics market. On this basis, NXP will launch the S32K3 MCU in 2020, further expanding the S32K1 MCU series based on Arm Cortex-M0+/M4F. The new S32K3 MCUs are based on Arm Cortex-M7 and offer multi-core and lockstep options to support functional safety ISO 26262 ASIL B/D. S32K3 MCUs are primarily used in automotive body electronics systems, battery management, and emerging domain controllers.




To address increasing software complexity, NXP has introduced a real-time driver (RTD) that supports real-time software on AUTOSAR and non-AUTOSAR applications, mainly for Arm Cortex-M cores, making all software layers ISO 26262 compliant. In this way, applications that meet the relevant certification requirements can be quickly completed.



NXP S32K3 MCU has a wide range of partners to help customers develop. As an important partner of NXP, IAR Systems provides professional embedded software development tools.


The latest release of IAR Embedded Workbench for Arm V9.20.1 has officially supported NXP S32K3 MCUs (see Reference 1). IAR Embedded Workbench for Arm V8.50.10 functional safety version can be used for application development based on S32K3 real-time driver (RTD).


IAR Embedded Workbench for Arm is widely used in automotive electronics software development. Its highly optimized compiler can generate executable code with extremely high running efficiency and small size, which maximizes the release of MCU performance and reduces the occupancy of FLASH and RAM. At the same time, IAR Embedded Workbench for Arm has powerful debuggers and code analysis tools to help developers improve development efficiency, improve code quality, and ensure product reliability.


In order to facilitate the customer's application development, IAR Embedded Workbench for Arm has been integrated with the NXP S32DS tool, which is convenient for customers to quickly initialize the project on the IAR Embedded Workbench for Arm tool.


The S32 Configuration Tools (Configuration Tools) in NXP's S32 Design Studio can quickly configure pins, clocks and peripherals, which greatly simplifies the configuration of the S32K3 MCU and can speed up the pre-development preparations. Initializing the project through S32DS and then importing it into IAR Embedded Workbench for Arm for project development can bring great convenience to S32K3 series chip users.


The following will specifically introduce how to use NXP S32DS to build a project and import it into IAR Embedded Workbench for Arm to speed up the development of automotive software based on NXP S32K3 MCU.


Install IAR Eclipse Plugin in NXP S32DS


NXP S32DS supports the IAR Eclipse plug-in, but the IAR Eclipse plug-in is not included in the S32DS installation package and needs to be installed separately. For details, please refer to Reference 2. In practice, this applies to S32 Design Studio for ARM as well as S32 Design Studio for S32 Platform.


Building a project in NXP S32DS


Create a project in NXP S32DS and select IAR Toolchain for Arm as the corresponding toolchain:



Then configure the corresponding pins, clocks and peripherals through Configuration Tools and automatically generate the corresponding code:



Export S32DS project to IAR Embedded Workbench for Arm


When creating a project in S32DS, if IAR Toolchain for Arm is selected as the toolchain, the corresponding project can be exported and imported into IAR Embedded Workbench for Arm. For specific steps, please refer to Reference Material 3. The operation of exporting a project applies to S32 Design Studio for ARM and S32K1, as well as to S32 Design Studio for S32 Platform and S32K3.


But after following the operations in the link, the IAR Embedded Workbench for Arm project folder directory is inconsistent with the original project folder directory in NXP S32DS:



For this purpose, IAR provides a plug-in called EWPtool, which can import the corresponding source file directory into the project. For details, please refer to Reference Material 4.


Here's what to do after importing Workbench for Arm from NXP S32DS:


1. Delete the corresponding Freescale Processor Expert folder (the corresponding project folder directory will be deleted):



2. Add a new source file directory and select the corresponding project directory (point to the directory where NXP S32DS created the project):



3. The project folder directory corresponding to IAR Embedded Workbench for Arm is the same as the original project folder directory in NXP S32DS:



4. Since the program entry function and interrupt vector table in the startup code in NXP S32DS are different from the program entry function and interrupt vector table used by default in IAR Embedded Workbench for Arm, the following configuration is required (specify the corresponding program in the Linker option). Entry function, specify the corresponding interrupt vector table address in the Debugger option: "--drv_vector_table_base=_ENTRY_VTABLE"):



5. Then you can compile, download and debug related operations in IAR Embedded Workbench for Arm:



Summarize


This article takes NXP's latest S32K3 MCU and related software development resources as an example, by showing how to use NXP's original S32DS tool to build a project based on S32K3 MCU, and select the industry's popular IAR Toolchain for Arm as the tool chain to Improve the development efficiency of projects that require high code quality. Configure the corresponding pins, clocks and peripherals through the Configuration Tools in NXP S32DS, and automatically generate the corresponding code, and then export the NXP S32DS project to IAR Embedded Workbench for Arm for subsequent development. Accelerate NXP S32K3 MCU-based automotive software development with the flexible configuration of NXP S32DS and the efficient compilation efficiency of IAR Embedded Workbench for Arm.


Of course, as more and more Chinese technology companies work in industrial applications, medical equipment and other critical applications that require high reliability and performance, there are also questions about how to combine MCU original development tools and Opportunities for application development with the respective advantages of high-performance tool chains provided by third-party vendors such as IAR Systems