Getting Started with the S32K148-Q176 Evaluation Board | NXP Semiconductors

Getting Started with the S32K148-Q176 Evaluation Board

Last Modified: 2019-03-19 17:10:00Supports S32K148-Q176 Evaluation Board for Automotive General Purpose

1. Out of the Box

1.1 Get to Know the Evaluation Board

Get Started with the S32K148EVB - 1.1

Get Started with the S32K148EVB - 1.1

1.2 Understanding the Header/Pinout

Get Started with the S32K148EVB - 1.2A

Get Started with the S32K148EVB - 1.2A

Get Started with the S32K148EVB - 1.2B

Get Started with the S32K148EVB - 1.2B

Get Started with the S32K148EVB - 1.2C

Get Started with the S32K148EVB - 1.2C

1.3 Understanding the CAN/LIN Connectors

Get Started with the S32K148EVB - 1.3

Get Started with the S32K148EVB - 1.3

1.4 Understanding the USB/OpenSDA

OpenSDA is a serial and debug adapter that is built into several NXP® evaluation boards. It provides a bridge between your computer (or other USB host) and the embedded target processor, which can be used for debugging, flash programming and serial communication, all over a simple USB cable.

The OpenSDA hardware consists of a circuit featuring a Kinetis® K2x microcontroller with an integrated USB controller. On the software side, it implements a mass storage device bootloader, which offers a quick and easy way to load OpenSDA applications such as flash programmers, run-control debug interfaces, serial to USB converters and more.

Jumper Setting Description
J22 1-2 RESET switch is routed RST MCU

PTA29/FTM5_CH4/LPUART2_TX/LPSPI1_SIN_LS and PTA27/FTM5_CH2/LPSPI1_SOUT/LPUART0_TX_LS by external wires

Get Started with the S32K148EVB - 1.4

Get Started with the S32K148EVB - 1.4

1.5 Understanding the JTAG Debug Connector

Get Started with the S32K148EVB - 1.5

Get Started with the S32K148EVB - 1.5

1.6 Understanding the HMI Mapping

Component S32K148
Red LED PTE21
Blue LED PTE23
Green LED PTE22
Potentiometer PTC28
SW3 PTC12
SW4 PTC13
OpenSDA UART TX PTC7 (LPUART1_TX)
OpenSDA UART RX PTC6 (LPUART1_RX)
CAN TX PTE5 (CAN0_TX)
CAN RX PTE4 (CAN0_RX)
LIN1 TX PTA3 (LPUART0_TX)
LIN1 RX PTA2 (LPUART0_RX)
LIN2 TX PTA9 (LPUART2_TX)
LIN2 RX PTA8 (LPUART2_RX)
SBC_SCK PTA28 (LPSPI1_SCK)
SBC_MISO PTA29 (LPSPI1_SIN)
SBC_MOSI PTA27 (LPSPI1_SOUT)
SBC_CS PTA26 (LPSPI1_PCS0)

2. Get Software

2.1 Download the Quick Start Package

Download S32K148EVB QSP

2.2 Download the JumpStart Firmware

Download S32K148EVB JumpStart

2.3 Get the Integrated Development Environment (IDE)

S32K144EVB performs better when using S32 Design Studio for Arm v1.3.

Download S32 DESIGN STUDIO IDE

2.4 Get the Run-Time Debugging Tool

S32K144EVB evaluation board performs better when using the FreeMASTER tool for run-time debugging.
You can also download and install the FreeMASTER Communication Driver (source code already included in example project).

FREEMASTER Tool

3. Plug It In

3.1 Set Up Jumpers

Jumper Setting Description
J7 1-2 MCU VDD domain is connected to 3.3 V
2-3 (Default) MCU VDD domain is connected to 5 V
J8 1-2 (Default) 5 V domain powered by 12 V power source
2-3 5 V domain powered by USB micro connector
J12 1-2 (Default) LIN leader option enabled for LIN1
J18 1-2 (Default) VBAT(+12 V) is routed to the input of the 3V3 switching power supply
2-3 USB power (+5 V) is routed to the input of the 3V3 switching power supply
J19 1-2 (Default) VDD is routed to VDD_MCU domain (remove in order to measure the MCU current)
J21 1-2 (Default) LIN leader option enabled for LIN2
J22 1-2 (Default) Reset switch is routed to MCU reset line
2-3 Reset switch is routed to openSDA reset line

3.2 Plug In the Power Supply

The S32K148-EVB evaluation board powers from a USB or external 12 V power supply.
USB power can be enabled with J8 (2-3) and J18 (2-3).

  1. Connect the USB cable to a PC using supplied USB cable.
  2. Connect other end of USB cable (microUSB) to micro-B port on S32K148EVB at J24.
  3. Allow the PC to automatically configure the USB drivers if needed.

Debug is done using OpenSDA through J24.

When powered using the USB, LED D10 should light green and LEDs DS2 and DS3 light orange.

4. Build, Load

4.1 Communicate with Debugger

  1. Launch the FreeMASTER application

    S32K144EVB_GS-4.1a-LAUNCH-FREEMASTER

    S32K144EVB_GS-4.1a-LAUNCH-FREEMASTER
  2. Configure the communication port through OpenSDA with a 115200 b/s speed rate:
    • To do this manually, go to Project → Options → Comm
    • To do this automatically, go to Tools → Connection Wizard

4.2 JumpStart Project Download

The FreeMASTER JumpStart project will be automatically downloaded from NXP Semiconductors once the FreeMASTER application detects the web address stored as a TSA active content in the flash.

S32K144EVB_GS-4.2-JUMPSTART-DOWNLOAD

S32K144EVB_GS-4.2-JUMPSTART-DOWNLOAD

4.3 JumpStart Project Loaded

Get Started with the S32K148EVB - 4.3A

Get Started with the S32K148EVB - 4.3A

The FreeMASTER JumpStart project description:

Get Started with the S32K148EVB - 4.3B

Get Started with the S32K148EVB - 4.3B

4.4 Import and Debug the Project to IDE

  1. Launch the S32 Design Studio for Arm® and select a default workspace or specify a new one. Then click OK

    S32K144EVB_GS-4.4a-PROJECT-IDE

    S32K144EVB_GS-4.4a-PROJECT-IDE
  2. Create a new project by selecting File → New → Project.

    Get Started with the S32K148EVB - 4.4B

    Get Started with the S32K148EVB - 4.4B
  3. Create a project name. Select the project type in the executable or library folder. Then click Next.

    You can select for project type from inside executable or library folder.

    Get Started with the S32K148EVB - 4.4C

    Get Started with the S32K148EVB - 4.4C

  4. Select Debugger Support and Library Support. Then click Finish

    Get Started with the S32K148EVB - 4.4D

    Get Started with the S32K148EVB - 4.4D

4.5 Set Up Debug Configuration

To debug your project with OpenSDA, your must first select OpenSDA.

  1. Select your project, and click Debug Configuration

    Get Started with the S32K148EVB - 4.5A

    Get Started with the S32K148EVB - 4.5A
  2. Under GDB PEMicro Interface Debugging, select the debug configuration. Then click the Debugger tab

    Get Started with the S32K148EVB - 4.5B

    Get Started with the S32K148EVB - 4.5B
  3. In Interface, select OpenSDA. If your board is plugged in, it should appear in Port. To finish, click Apply then Debug

    Get Started with the S32K148EVB - 4.5C

    Get Started with the S32K148EVB - 4.5C

4.6 Optional Debugging With P&E

  1. Click Debug Configurations

    S32K144EVB_GS-5.2a-DEBUG

    S32K144EVB_GS-5.2a-DEBUG
  2. To create a new P&E launch configuration, click the icon shown in the upper right. Then click the Debugger tab

    S32K144EVB_GS-5.2b-DEBUG

    S32K144EVB_GS-5.2b-DEBUG
  3. Click Select Device and choose a S32K148 device. Then click Apply and debug your application

    Get Started with the S32K148EVB - 4.6D

    Get Started with the S32K148EVB - 4.6D

FreeMASTER JumpStart Oscilloscope Feature

FreeMASTER JumpStart Oscilloscope Feature

  1. To display the main project panel, go to: Project → View → Project Tree
  2. Display real-time oscilloscope graph examples such as Potentiometer or Touch Sense Electrodes:
    • Analog values from potentiometer:

      S32K144EVB_GS-PT1b-JUMPSTART

      S32K144EVB_GS-PT1b-JUMPSTART
    • Responses from touch sense electrodes:

      S32K144EVB_GS-PT1c-JUMPSTART

      S32K144EVB_GS-PT1c-JUMPSTART

Create an Example from the SDK

Create an Example from the SDK

The S32 Design Studio IDE includes a software development kit (SDK) for quickly developing applications on S32K1xx devices.

  1. To get started, go to File → New → S32DS Project from Example

    Get Started with the S32K148EVB - PT1A

    Get Started with the S32K148EVB - PT1A
  2. Go to the S32K14x EAR SDK v0.8.6 Example Projects section and select the example you want to use. (in this case, the “hello_world” example is selected). Then click Finish

    Get Started with the S32K148EVB - PT1B

    Get Started with the S32K148EVB - PT1B
  3. The new project is created in the workspace. Click the generate code icon and then click the debug icon

    Get Started with the S32K148EVB - PT1C

    Get Started with the S32K148EVB - PT1C

The complete documentation of the SDK can be found in:

1C:\NXP\S32DS_ARM_v2018.R1\S32DS\S32SDK_S32K14x_EAR_0.8.6\doc\Start_here.html

Check Enabling Technologies: Hands-On Workshop: S32 SDK for S32K  for more information about the use of the SDK.

Debug Basics

Debug Basics

Debug configuration is only required once. Subsequent starting of debugger does not require these steps.

There are three options for starting the debugger:

  • If the debug configuration is still open, click Debug on the bottom right.
  • Select Run → Debug
  • Press (F11)

Recommended: Cpck the down arrow on the bug icon and select _debug.elf target

Step, Run, Suspend and Resume

  • Step Into (F5)

  • Step Over (F6)

  • Step Return (F7)

  • Run

  • Suspend

  • Resume (F8)

View Variables

Click the Variables tab.

To enter different values, click in the Value field.

View and Alter Registers

To see CPU registers, click the Registers tab. To enter different values, click in the Value field.

"Click on a value to allow typing in a different value."

To see peripheral registers, click the EmbSys Registers tab.

S32K144EVB_GS-PT2i-DEBUG-BASICS

S32K144EVB_GS-PT2i-DEBUG-BASICS

View and Alter Memory

Click the plus icon + for Add Memory Monitor then select the base address to start at 40000000

Click the Memory tab.

Breakpoints

Add Breakpoint by pointing and clicking.

Get Started with the S32K148EVB - PT2C

Get Started with the S32K148EVB - PT2C

Reset and Terminate Debug Session

To reset the program counter, click the red icon for Terminate (Ctrl+F2).

Introduction to OpenSDA

Introduction to OpenSDA

OpenSDA is an open-standard serial and debug adapter. It bridges serial and debug communications between a USB host and an embedded target processor. OpenSDA software includes a flash-resident USB mass-storage device (MSD) bootloader and a collection of OpenSDA applications.

S32K148 EVB comes with the MSD Flash Programmer + Debug OpenSDA application preinstalled.

Follow these instructions to run the OpenSDA Bootloader and update or change the installed OpenSDA application.

Enter OpenSDA Bootloader Mode Load an OpenSDA Application
  1. Unplug the USB cable if attached
  2. Set J22 on position 2-3
  3. Press and hold Reset (SW5)
  4. Plug in a USB cable (not included) between a USB host and the OpenSDA USB connector (labeled “SDA”)
  5. Release Reset

A removable drive should now be visible in the host file system with a volume label of BOOTLOADER.

You are now in OpenSDA bootloader mode.

  1. While in OpenSDA bootloader mode, double click SDA_INFO.HTML in the BOOTLOADER drive. A web browser will open the OpenSDA homepage containing the name and version of the installed application. This information can also be read as text directly from SDA_INFO.HTML
  2. Locate the OpenSDA Applications.
  3. Copy and Paste or drag and drop the MSD Flash Programmer Application to the BOOTLOADER drive
  4. Unplug the USB cable and plug it in again. The new OpenSDA application should now be running and a S32K148 EVB drive should be visible in the host file system

You are now running the latest version of the MSD flash programmer. Use this same procedure to load other OpenSDA applications.

The MSD flash programmer + Debug is a composite USB application that provides a virtual serial port, a debug interface and an easy and convenient way to program applications into the S32K MCU. It emulates a FAT16 file system, appearing as a removable drive in the host file system with a volume label of S32K148EVB.

Raw binary and Motorola S-record files that are copied to the drive are programmed directly into the flash of the S32K148 and executed automatically. The virtual serial port enumerates as a standard serial port device that can be opened with standard serial terminal applications.

Using the MSD Flash Programmer Using the Virtual Serial Port
  1. In the Debug folder of the S32DS project, locate the .srec file for your project
  2. Copy and Paste or drag and drop one of the .srec files to the S32K148EVB drive

The new application should now be running on the S32K148EVB. Starting with v1.03 of the MSD Flash Programmer, you can program repeatedly without the need to unplug and reattach the USB cable before reprogramming.

Drag one of the .srec files for the S32K148 to the S32K148EVB board drive over USB to reprogram the preloaded code example to another example.

  1. Determine the symbolic name assigned to the S32K148EVB virtual serial port. In Windows, open Device Manager and look for the COM port named OpenSDA - CDC Serial Port
  2. Open the serial terminal emulation program of your choice.
    For Windows you can use Tera Term, PuTTY or HyperTerminal
  3. Press and release Reset (SW5) to any time to restart the example application. Resetting the embedded application will not affect the connection of the virtual serial port to the terminal program
  4. It is possible to debug and communicate with the serial port at the same time. There is no need

Using Ethernet

The S32K148 evaluation board is the only member of its family able to use Ethernet and QuadSPI. However, these interfaces are mutually exclusive so only one of them can be used at a time. In order to use either Ethernet or QuadSPI, you must follow a specific resistor configuration. The default configuration of the board is to be used for Ethernet communication.

Using Ethernet on the S32K148EVB

Different from the rest of the devices on the S32K1xx family, the S32K148 has the ENET module, which offers the possibility to use Ethernet communication protocol. This enables this device for applications such as small Gateway (LIN-CAN-ETHERNET) or Audio Amplifier.

The software development kit (SDK) for the S32K1xx devices offers a middleware Ethernet stack (LwIP), that allows the user to develop applications faster.

Default Configuration

Get Started with the S32K148EVB - PT3A

Get Started with the S32K148EVB - PT3A

There is no Ethernet PHY on the board. In order to use ENET, you must get S32K148EVB-KIT, including both S32K148EVB-Q176 with ADTJA1101-RMII Ethernet Adapter in order to use ENET, as there is no Ethernet PHY on the board.

S32K148EVB-Q176 with ADTJA1101-RMII Ethernet Adapter

S32K148EVB with ADTJA1101-RMII

Running ENET

The TCP/IP ENET example is available in the S32K1xx SDK only in version EAR 0.8.6 and higher.

In order to get the example working, you need:

  • S32K148EVB-KIT = S32K148EVB + ADTJA1101-RMII
  • Media converter: automotive Ethernet to 10/100 Base-TX
  • SDK version "S32K_SDK_EAR_0.8.6" or higher
  • Any program able to set up a TCP client, like SocketTest

Before trying the example, change the IP of your computer to a static IP address. To do this, go to the network adapter settings of the computer, right click the local area network and select Properties.

Get Started with the S32K148EVB - PT3B

Get Started with the S32K148EVB - PT3B

Select the option Internet Protocol Version 4 (TCP/IPv4) and click Properties.

The SDK example assigns an IP value of 192.168.0.200 to the S32K148.

The computer must have an IP in the same network. Fill out the values and click OK.

Get Started with the S32K148EVB - PT3D

Get Started with the S32K148EVB - PT3D

Once the PC setup is done, import the SDK example into the S32DS.

Go to File → Create new project from example option:

Get Started with the S32K148EVB - PT3E

Get Started with the S32K148EVB - PT3E

Compile the example and download it to the S32K148 EVB with the ADTJA1101-RMII connected.

The media converter should also be connected between the board and the computer:

Get Started with the S32K148EVB - PT3F

Get Started with the S32K148EVB - PT3F

Once you have everything connected, run the example. It should not have any issue. There are two ways to verify that the example is correctly running:

  • Ping the board. using the windows command of the windows console

    Use the command ping 192.168.0.200 and the board should answer:

Get Started with the S32K148EVB - PT3G

Get Started with the S32K148EVB - PT3G
  • Use the SocketTest program to echo the board at a TCP level

    Open the SocketTest (or the TCP client program you are using), using IP address: 192.168.0.200 and Port: 7.

The connection should be established without any issue.

Once the computer is connected with the S32K148, you can send any message and the S32K148 will make an echo of anything you send.

Get Started with the S32K148EVB - PT3I

Get Started with the S32K148EVB - PT3I

Using SPI

The S32K148 evaluation board is the only member it's family able to use Ethernet and QuadSPI.

However, these interfaces are mutually exclusive so only one of them can be used at a time. In order to use either Ethernet or QuadSPI, you must follow a specific resistor configuration.

The default configuration of the board is for Ethernet.

Using SPI on the S32K148EVB

Different from the rest of the devices on the S32K1xx family, the S32K148 has the QuadSPI module, which offers the possibility to communicate with external devices (mostly memories) that allow QuadSPI protocol.

The S32K148 EVB has a MX25L6433F external memory mounted on the board.

The software development kit (SDK) for the S32K1xx devices offers an example for communicating with the external memory mounted on the board. Just run it and start testing the module.

Get Started with the S32K148EVB - PT4A

Get Started with the S32K148EVB - PT4A