S32 SDK
Examples and Demos

Applications that show the user how to initialize the peripherals for the basic use cases

Introduction

S32 SDK examples structure:

  • Demo applications (SDK/examples/<CPU>/demo_apps), are demo applications for various IDEs and compilers. Also this examples are using more advanced use-cases - FreeRTOS integration, LIN Stack, FlexCAN usage and Clock Setup.
  • Driver Examples (SDK/examples/<CPU>/driver_examples), are simple applications which exemplify a basic use-case for a specific driver.

Examples are available for:

Usage

How to build

For makefile project

There are makefile projects in all compilers supported. In order to used them:

  • Make utility (eg. GNU Make)
  • Toolchain (eg. GCC Toolchain)
  • Make sure the make and compiler are in Path (for Microsoft Windows : System -> Environmental Variables)
  • From command line execute the makefile: make all

The makefiles generate binary files for both RAM and FLASH configurations.

For IAR Embedded Workbench

From IAR Workbench for ARM use File > Open > Workspace and browse to the desired project. After the project was opened you can see the files in "Workspace Files". Finally, the project can be executed from Project > Download and Debug. Make sure that the debug probe you are using is selected and configured in Project options > Debugger > Driver.

For S32 Design Studio

From S32 Design Studio (See Release notes for the S32 Design Studio version), go to File -> New -> New Project from Example and select the example you wish to import. This will copy the example project into workspace. Next steps:

  • Use Processor Expert to configure the components used in the example
  • Use Project > Generate Processor Expert for generating the configuration
  • Use Project > Build to build the project
  • Use Project > Debug and launch your preferred debug configuration

How to debug

This section explains how to upload and debug the binary files generated after build. This assumes that you have a debug probe(see release notes for supported debug probes) and a debug software installed on the machine.

Generic steps:

  1. Launch the debug software
  2. Load the binary file into the MCU
  3. Execute the application

Loading with Segger JLink:

  • Download and install the latest drivers and GDB server, named Software and documentation pack, from their site
  • Download your favorite GDB client (eg. arm-none-eabi-gdb)
  • Browse to JLink installation folder and launch JLinkGDBServer
  • Select the appropriate part from the device list and click on OK
  • Open the GDB client and connect to the configured port - by default localhost:2331
  • Upload the file and execute (see GDB client user manual for details regarding the commands used)

The following table is a small list of commands used in GNU ARM GDB with JLinkGDBServer to connect and run the application:

Command Description
target remote:PortNumber Connect to the remote target at a specified port. Please replace PortNumber with the port configured in the GDB server.
monitor resetReset the target MCU
monitor haltHalt the target MCU
file ApplicationName.elf Load the file and symbols. Please change ApplicationName with your application name
loadDownload the executable to the target MCU
continueBegin executing the application

Loading with PEmicro OpenSDA/MultiLink:

  • Download and install the latest drivers and GDB server, named P&E GDB Server for Kinetis with Windows GUI, from their site
  • Download your favorite GDB client (eg. arm-none-eabi-gdb)
  • Browse to PEmicro GDB Server installation folder and launch P&E GDB Server for Kinetis
  • Select the appropriate part from the device list and click on Connect
  • Open the GDB client and connect to the configured port - by default localhost:7224
  • Upload the file and execute (see GDB client user manual for details regarding the commands used)

The following table is a small list of commands used in GNU ARM GDB with PEmicro GDB server to connect and run the application:

Command Description
target remote:PortNumber Connect to the remote target at a specified port. Please replace PortNumber with the port configured in the GDB server.
monitor reset Reset the target MCU
file ApplicationName.elf Load the file and symbols. Please change ApplicationName with your application name
load Download the executable to the target MCU
continue Begin executing the application

Using terminal emulator

To run the examples that use LPUART to help you visualize data you must download a terminal emulator (eg. Putty, Termite, TeraTerm) and configure it.

Unless otherwise noted the standard communication parameters are:

  • 115200 baud
  • One stop bit
  • No parity
  • No flow control

Example configuration for Termite using OpenSDA

1) Download Termite from their site
2) Run the installer. Wait for the installation to be completed
3) Go to Start -> All Programs -> Termite and launch the program. The window from Fig.1 will appear ...

termite-1.png
Fig.1 - Termite window

4) Click on Settings
5) As seen in Fig.2, configure the following communication parameters:

  • Port(1) : COMx - where x must be replaced with the COM port number
  • Baud Rate(2) : 115200
  • Data Bits(3) : 8
  • Stop Bits(4) : 1
  • Parity(5) : None
  • Flow Control(6) : None
  • Forward(7) : None
    termite-2.png
    Fig.2 - Settings window

6) Click OK. Now the terminal should be configured

Note
For further help consult the terminal's documentation