S32 SDK
SAI Transfer

Example application showing SAI driver usage

Application description


The purpose of this demo application is to show the usage of the SAI driver found on the S32K148 SoC using S32 SDK API.

The application uses SAI driver to make a data transfer of a defined size. SAI 0 instance shall be transmitter and SAI 1 instance shall be receiver. User can see other settings for SAI 0 and SAI 1 in Process Expert components. To check if data is transfered correctly, put break point or let program run for about 2 second, then see if RecvData content is the same as SendData.

Prerequisites


The run the example you will need to have the following items:

  • 1 S32K148 board
  • 1 Power Adapter 12V (if the board can't be powered from the USB)
  • 3 female to female jumper wire.
  • 1 Personal Computer
  • 1 Jlink Debugger

Boards supported


The following boards are supported by this application:

  • S32K14xCVD-Q144

Hardware Wiring


The following connections must be done to for this example application to work:

PIN FUNCTION S32K14xCVD-Q144
SAI_BCLK P24.9 - P24.23
SAI_SYNC P24.10 - P24.25
SAI_DATA0 P24.11 - P24.29

How to run


1. Importing the project into the workspace

After opening S32 Design Studio, go to File -> Import Existing Projects and select Browse sai_transfer_s32k148. Then click on Finish.
The project should now be copied into you current workspace.

2. Generating the Processor Expert configuration

First go to Project Explorer View in S32 DS and select the current project(sai_transfer_s32k148). Then go to Project and click on Generate Processor Expert Code
Wait for the code generation to be completed before continuing to the next step.

3. Building the project

Select the configuration to be built FLASH (Debug_FLASH) or RAM (Debug_RAM) by left clicking on the downward arrow corresponding to the build button(. Wait for the build action to be completed before continuing to the next step.

4. Debugging the project

Go to Run and select Debug Configurations. There will be two debug configurations for this project:

Configuration Name Description
sai_transfer_s32k148 Debug_RAM Jlink Debug the RAM configuration using Segger Jlink debuggers
sai_transfer_s32k148 Debug_FLASH Jlink Debug the FLASH configuration using Segger Jlink debuggers


Select the desired debug configuration and click on Launch. Now the perspective will change to the Debug Perspective.
Use the controls to control the program flow.

Note
For more detailed information related to S32 Design Studio usage please consult the available documentation.