Getting Started with the MPC5748G Secure Ethernet Gateway reference design

最終更新日時: 2019-09-16 09:36:11サポート MPC5748G Secure Ethernet Gateway Reference Design

1. Out of the Box

1.1 Get to Know Your MPC5748G Reference Design Board

MPC5748G-GW-RDB_GS-1.1

MPC5748G-GW-RDB_GS-1.1

1.2 Understanding the Connector Signals

Connector Description
MATEnet
Part No. 9-2305390-9
5-port 100BASE-T1 Ethernet connector.
The RDB uses 4 ports as 100BASE-T1 Ethernet port
Part No. 2311621-1 DoIP Port, 100BASE-TX with 4 PINs used for TX/RX
Part No. 2311622-1 8 x CAN/CAN FD channels: CAN0-CAN7
8 x 2 PINs
Part No. 2329531-1 Used for power supply, LIN, UART, ADC, PWM, IO etc.
10 x 2 PINs

2. Get Software

2.1 Download the MPC5748G-GW-RDB Reference Design – Software Package

You will use the example projects from this reference design.

DOWNLOAD MPC5748G-GW-RDB QSP

2.2 Get Your Integrated Development Environment (IDE)

MPC5748G-GW-RDBperforms better when using S32 Design Studio for Power Architecture®.

DOWNLOAD S32 DESIGN STUDIO IDE

2.3 Get Your Software Development Kit (SDK)

MPC5748G-GW-RDBperforms better when using S32 Software Development Kit for Power Architecture.

DOWNLOAD S32 SDK

3. Plug It In

To set up your reference design board, watch the video or use the step-by-step guide, below.

Let’s take it for a test drive.

3.1 Set Up Jumpers in the S32K144EVB Evaluation Board

Jumper Setting Description
J3 Leave open. Power SBC configuration.
J4 1-2 Put the jumper on to enable SBC to reset MPC5748G. Refer to the schematics for more details.
J5 1-2 Put the jumper on to set SBC into DEBUG mode.
In this mode, SBC will work as a common power supplier.
Check Power Management Integrated Circuits and System Basis Chips for more details.
J12 1-2 Put the jumper on to enable User Switch to reset MPC5748G
J13 Leave open. This jumper can enable User Switch to reset S32K. Keep it open and do not use this Jumper.

3.2 Plug in the Cables and Debugger

Connect the MPC5748G-GW-CBL to the MPC5748G-GW-RDB.

Also connect your debugger (such as PE Multilink) to the JTAG port onboard and the computer.

3.3 Plug In the 12 V Power Supply

Connect power supply wires to the DC power supplier. Set the voltage at 12 V, current limit > 600 mA.

  • Board BATT+ pins connects to DC power supplier 12 V+
  • Board GND pins connects to DC power supplier GND

4. Build and Load

4.1 Create a New Project in IDE

Watch the video to create a new project in S32 Design Studio IDE and load a code example or, use the step-by-step guide, below.

Launch the S32 Design for Power Architecture and select a default workspace or specify a new one. Then click "OK".

Create a new project by selecting File > New > Project.

Choose a project name and then select a project type, then click "Next". We recommend using Elf S32DS Project for this one.

Select cores and parameter, then click "Finish".

Make selections in FLASH and RAM Size, Language, Library and Debugger

.

We recommend using defaults settings for now.

Three projects will be created for three different cores of MPC5748G.

4.2 Build a New Project in IDE

Follow one of these paths to build a new project:

  1. Project > Build Project
  2. Click the to build the project.
  3. Then click to build all projects.

The following message displays on the console once you have successfully built a project:

4.3 Debug a Project in IDE

Connect the PE micro debugger to both the board and PC.

MPC5748G-GW-RDB_GS-4.3a

MPC5748G-GW-RDB_GS-4.3a

Open the Debug Configuration options at the top menu.

  1. Select Project to debug.
  2. Select the Interface: USB Multilink, USB Multilink FX…
  3. Select the Port: USB1-Multilink Universal Rev C…
  4. Click Debug to start.

4.4 Debug a Project from RAM

Follow one of these paths to configure a project to debug from RAM:

  • Go to Project > Build Configurations > Set Active > Debug_RAM
  • Select Debug_RAM by clicking down the arrow next to the "gear" icon

Finally, select the RAM-related session while debugging.

Learn more about debugging basics at Projects and Tutorials.

4.5 Make Projects from Built-In Examples

Launch S32 Design Studio for Power Architecture and open a new file:

  1. Go to File > New > New S32DS Project from Example.
  2. Select the built-in project of your choice and click Finish.

The selected project will be copied to the active workspace.

4.6 Import Projects into IDE

  1. Go to File > Import, click Existing Projects into Workspace option and then click "Next".
  2. Then "Browse" and select the example folder.

Select the project and click on "Finish" to import into the workspace.

Installing S32 Design Studio IDE (S32DS) for Power Architecture

Download the latest version of our S32 Design Studio IDE for Power Architecture.

  1. Go to the download folder. Run the installation file, the "Preparing to install dialogue box" will appear

  2. When the installer wizard window is displayed, click "Next"

  3. Selecting the "S32 Design Studio" only installs this software. To install more software, select "Additionally install" option.

  4. We recommend you to entirely read the License Agreement

    Once done, select the radio button accepting the agreement terms and click "Next" to continue

  5. Choose either the default or new installation location, then click "Next".

  6. Select a path to generate a shortcut of your choice and click "Next".

  7. Verify all settings in the "Pre-installation Summary" tab

  8. If everything is accurate, click "Install".

    At some point during the installation, you will be prompted for the software activation code

    To get your activation code, go to the "Product Download" page and select the "License Keys" tab.

    Copy and paste the software activation code into the activation window, then select "Online".

    During installation, you need to download the P&E device drivers. Read the license agreement and click "I agree".

    Then select the destination folder and click "Install". When the installation is complete, click "Close".

You will see an "Install Complete - Congratulations" message in the installer wizard window once the S32 Design Studio for Power Architecture installation is complete.

Updating S32DS IDE for Power Architecture with SDK (RTM)

Get the SDK RTM 1.0.0 update from the S32DS IDE for Power Architecture page.

  1. Launch S32DS and go to Help > Install New Software.

  2. Click "Add" in the Install wizard window to find the SDK which has been downloaded.

  3. Click "Local" to add repositories in the "Add Repository" window. Then click "OK".

  4. Check the S32 Design Studio for Power Updates and then click "Next".

  5. Read all the license terms and click "Finish".

    We recommend you to entirely read the License Terms and click "Finish" to continue.

    The SDK (RTM) installation will immediately start.

  6. In "Do you trust these certificates?" check the checkbox and click "OK".

Success

Once the installation is complete, restart your S32DS IDE.

S32SDK Overview

S32 Software Development Kit (SDK)

  • Integrated non-AUTOSAR software production-grade software
  • Automotive grade: SPICE/CMMI compliant, MISRA 2012
  • Graphical-based configuration and layered software architecture
  • Integrated with S32 Design Studio, plus FreeRTOS
  • Compatible with Eclipse and other IDEs
  • Supports MPC574x family, also multiple toolchains
  • Documented source code, including examples and demos

S32 SDK – Architecture

S32 SDK – File Structure

Debug Basics

Step, Run, Suspend, Resume and Terminate

  • Step Into (F5)
  • Step Over (F6)
  • Run
  • Suspend
  • Resume (F8)
  • Terminate (Ctrl + F2)
  • To View Variables:
    • Open the "Variables" tab.
    • Click on a value to allow typing in a different value.
  • To View and Alter Registers:
    • To see CPU registers, select the "Registers" tab.
    • Click on a value to allow typing in a different value.
  • To view peripheral registers in the EmbSysReg tab.
  • To View and Add Memory:
    • To add memory monitor, click the + icon and select Base Address (EXAMPLE: 0x0000fff8)
    • This allows you to view memory.
  • To Add Breakpoints:
    • Select and double click.

Code Examples: Hands-on – CAN

Resources

MPC5748G-GW-RDB_PT5b

MPC5748G-GW-RDB_PT5b

MPC5748G-GW-RDB_PT5c

MPC5748G-GW-RDB_PT5c
  • Full implementation of the CAN FD and CAN 2.0 B: data field bitrate up to 8 Mbps
  • Flexible mailboxes (0/8/16/32/64 bytes data length)
  • Listen-Only mode capability
  • Programmable loop-back mode supporting self-test operation
  • Programmable transmission priority scheme
  • Programmable clock source to the CAN protocol interface, either bus clock or crystal oscillator
  • Independence from the transmission medium
  • CRC status for transmitted message
  • Full featured Rx FIFO with storage capacity for 6 frames
  • DMA request for Rx FIFO
  • 100% backward compatibility with previous FlexCAN version
  • 8 FlexCAN instances

CAN: Import Existing Project

Go to File > New > New S32DS Project from Example to create a new S32 Design Studio project.

Then select the flexcan_mpc5748g file from the MPC57xxRTM SDK v1.0.0 Example Projects folder.

MPC5748G-GW-RDB_PT5d

MPC5748G-GW-RDB_PT5d

CAN: Modify

The flexcan_mpc5748g example project is suited to DEVKIT.

MPC5748G-GW-RDB_PT5e

MPC5748G-GW-RDB_PT5e

To modify the peripheral power supply: enable the peripheral power supply

Open pin_mux component in "Component Inspector" to configure pin routing:

SIUL2 tab > GPIO 60 and GPIO 61 and then select the pin (one option) + direction output.

MPC5748G-GW-RDB_PT5f

MPC5748G-GW-RDB_PT5f

To modify the CAN Phy enablement: configure the CAN4~7 Phy (TJA1043T) GPIO

MPC5748G-GW-RDB_PT5g

MPC5748G-GW-RDB_PT5g

MPC5748G-GW-RDB_PT5h

MPC5748G-GW-RDB_PT5h

To modify the CAN ports, go to "Routing" (collapsed) in in pin_mux component, then select "CAN". Configure the ports according to the schematic.

PC5748G-GW-RDB_PT5i

MPC5748G-GW-RDB_PT5i

To modify the CAN configuration

Under the Components Library tab view, double-click flexcan component to add it the project.

MPC5748G-GW-RDB_PT5j

MPC5748G-GW-RDB_PT5j

There is no need to change default configuration for CAN: standard CAN (no FD), minimum payload, 500 kbps

MPC5748G-GW-RDB_PT5k

MPC5748G-GW-RDB_PT5k

Once all CAN configurations are complete, click "Generate code".

MPC5748G-GW-RDB_PT5l

MPC5748G-GW-RDB_PT5l

CAN: Application Code

Open the main.c file in text editor view.

The sending and receiving function of this project is realized separately, which needs to be controlled by macros.

MPC5748G-GW-RDB_PT5m

MPC5748G-GW-RDB_PT5m

Peripheral Power Supply

MPC5748G-GW-RDB_PT5n

MPC5748G-GW-RDB_PT5n

CAN4~CAN7'S Phy (TJA1043T) Enable

MPC5748G-GW-RDB_PT5o

MPC5748G-GW-RDB_PT5

Sending data via CAN

MPC5748G-GW-RDB_PT5p

MPC5748G-GW-RDB_PT5p

Receiving data via CAN

MPC5748G-GW-RDB_PT5q

MPC5748G-GW-RDB_PT5q

CAN: Build and Debug

Make sure that there are no compilation errors, then click build project.

MPC5748G-GW-RDB_PT5r

MPC5748G-GW-RDB_PT5r

Select the correct debug configuration and interface to debug the application.

MPC5748G-GW-RDB_PT5s

MPC5748G-GW-RDB_PT5s

TEST: Sending data via CAN

  • Open the macro of CAN_SEND, commented out CAN_RECEIVE
  • Connect the sending port with PEAK (the test tools we use) through the wire.
  • Debug the application.

MPC5748G-GW-RDB_PT5t

MPC5748G-GW-RDB_PT5t

TEST: Receiving data via CAN

  • Open the macro of CAN_RECEIVE, commented out CAN_SEND
  • Connect the receiving port with PEAK (the test tools we use) through the wire.
  • Debug the application

MPC5748G-GW-RDB_PT5u

MPC5748G-GW-RDB_PT5u

Code Examples: Hands-on – CAN FD

CAN FD is configured similarly to CAN.

Check the Projects and Tutorials > Hands-on – CAN to learn how to modify the CAN configurations and the application code of main.c

CAN FD: Modify Configuration

To change default configuration for CAN FD:

standard CAN_FD, maxmum payload, Arbitration Phase: 500 kbps, Data Phase: 2000 kbps

MPC5748G-GW-RDB_PT6a

MPC5748G-GW-RDB_PT6a

CAN FD: Modify - Application Code

Sending data via CAN:

PC5748G-GW-RDB_PT6b

MPC5748G-GW-RDB_PT6b

Receiving data via CAN:

MPC5748G-GW-RDB_PT6c

MPC5748G-GW-RDB_PT6c

CAN FD: Build and Debug

TEST: Sending data via CAN FD

  • Open the macro of CAN_SEND, commented out CAN_RECEIVE
  • Connect the sending port with PEAK (the test tools we use) through the wire
  • Debug the application

MPC5748G-GW-RDB_PT6d

MPC5748G-GW-RDB_PT6d

TEST: Receiving data via CAN

  • Open the macro of CAN_RECEIVE, commented out CAN_SEND
  • Connect the receiving port with PEAK (the test tools we use) through the wire
  • Debug the application

MPC5748G-GW-RDB_PT6e

MPC5748G-GW-RDB_PT6e

Code Examples: Hands-On – ENET0+SPI

Resources

MPC5748G-GW-RDB_PT7a

MPC5748G-GW-RDB_PT7a
  • The core implements a dual-speed 10/100 Mbit/s Ethernet MAC compliant with the IEEE802.3-2002 standard. The MAC layer provides compatibility with half- or full-duplex 10/100 Mbit/s Ethernet LANs.
  • The MAC operation is fully programmable and can be used in network interface card (NIC), bridging or switching applications. The core implements the remote network monitoring (RMON) counters according to IETF RFC 2819.
  • The programmable Ethernet MAC with IEEE 1588 integrates a standard IEEE 802.3 Ethernet MAC with a time-stamping module. The IEEE 1588 standard provides accurate clock synchronization for distributed control nodes for industrial automation applications.

MPC5748G-GW-RDB_PT7b

MPC5748G-GW-RDB_PT7b
  • Full-duplex, three-wire synchronous transfers
  • Leader mode
  • Follower mode
  • Data streaming operation in follower mode with continuous follower selection
  • Buffered transmit operation using the transmit first in first out (TX FIFO) with depth of 4 entries
  • Support for 8/16-bit accesses to the PUSH TX FIFO register data field
  • Buffered receive operation using the receive FIFO (RX FIFO) with depth of 4 entries
  • Asynchronous clocking scheme for register and protocol interfaces
  • TX and RX FIFOs can be disabled individually for low-latency updates to SPI queues
  • Visibility into TX and RX FIFOs for ease of debugging
  • 6 peripheral chip selects (PCSes), expandable to 64 with external demultiplexer
  • Deglitching support for up to 32 peripheral chip selects (PCSes) with external demultiplexer

ENET0: Lab Preview

MPC5748G-GW-RDB_PT7c

MPC5748G-GW-RDB_PT7

ENET0: Import Existing Project

Go to File > New > New S32DS Project from Example to create a new S32 Design Studio project.

Then select the lwip_mpc5748g file from the "MPC57xxRTM SDK v1.0.0 Example Projects" folder.

MPC5748G-GW-RDB_PT7de

MPC5748G-GW-RDB_PT7de

ENET0: Modify

The flexcan_mpc5748g example project is suited to DEVKIT.

MPC5748G-GW-RDB_PT7e

MPC5748G-GW-RDB_PT7e

To modify and enable the peripheral power supply:

Open pin_mux component in "Component Inspector" to configure pin routing:

SIUL2 tab > GPIO 60 and GPIO 61 and then select the pin (one option) + direction output.

MPC5748G-GW-RDB_PT7f

MPC5748G-GW-RDB_PT7f

ENET0: SWITCH configuration

Add spi_pal component in the "Components Library" tab, then double click the component to add it the project.

MPC5748G-GW-RDB_PT7g

MPC5748G-GW-RDB_PT7g

For the SPI configuration port, go to, "Routing" (Collapsed) in pin_mux component, then select SPI.

Configure the ports according to the schematic.

MPC5748G-GW-RDB_PT7h

MPC5748G-GW-RDB_PT7h

SPI component configuration:

MPC5748G-GW-RDB_PT7i

MPC5748G-GW-RDB_PT7i

The tool for configuring SWITCH data structure is: sja1105_tools

Check the sample demo (the ENET0_MPC5748G project) and copy the SwitchConfigure.c file to your project without any modification.

MPC5748G-GW-RDB_PT7j

MPC5748G-GW-RDB_PT7j

ENET0: ENET configuration

Go toRouting (Collapsed) in pin_mux component, then select "ENET".

Configure the ports according to the schematic.

MPC5748G-GW-RDB_PT7k

MPC5748G-GW-RDB_PT7k

ENET0: lwip middleware configuration

MPC5748G-GW-RDB_PT7l

MPC5748G-GW-RDB_PT7l

ENET0: Application Code

Peripheral power supply: [Project Name] > Source > main.c

MPC5748G-GW-RDB_PT7m

MPC5748G-GW-RDB_PT7m

To Modify the configuration of SPI to adaptation SJA1105 go to: [Project Name] > SDK > platform > pal > spi > src > spi_pal.c

The default configuration of SPI`s CS pin cannot be maintained until the delivery is completed when the send function ( SPI_MasterTransferBlocking() ) is called.

In order to match the SWITCH, configure the dspiConfig.continuousPCS = true

MPC5748G-GW-RDB_PT7n

MPC5748G-GW-RDB_PT7n

To add the initialization of the SWITCH, go to: [Project Name] > SDK > middleware > tcpip > tcpip_stack > demo > test.c.

MPC5748G-GW-RDB_PT7o

MPC5748G-GW-RDB_PT7o

Add client application for lwip_tcp.

Check the sample demo (the ENET0_MPC5748G project) and copy the tcpiptest.c file to your project without any modification.

Add client application call function under [Project Name] > SDK > middleware > tcpip > tcpip_stack > demo >test.c

MPC5748G-GW-RDB_PT7p

MPC5748G-GW-RDB_PT7p

ENET0: Build and Debug

Click the "build project" button, but make sure that there are no compilation errors.

MPC5748G-GW-RDB_PT7q

MPC5748G-GW-RDB_PT7q

Select the correct debug configuration and interface to debug the application.

MPC5748G-GW-RDB_PT7r

MPC5748G-GW-RDB_PT7r.

TEST: Ping the board from PC:

MPC5748G-GW-RDB_PT7s

MPC5748G-GW-RDB_PT7s

TEST: LWIP_tcp Client:

MPC5748G-GW-RDB_PT7t

MPC5748G-GW-RDB_PT7t

Code Examples: Hands-On – ENET1

ENET1 is configured similarly to ENET0.

Unlike the previous section, the Phy (DP83848) for MCA1 is directly connected.

Check the Projects and Tutorials > Hands-on – ENET0+SPI.

Resources:

MPC5748G-GW-RDB_PT8a

MPC5748G-GW-RDB_PT8a

ENET1: Modify

To enable and modify the peripheral power supply:

Open pin_mux component in "Component Inspector" to configure pin routing:

SIUL2 tab > GPIO 60 and GPIO 61 and then select the pin (one option) + direction output.

MPC5748G-GW-RDB_PT8b

MPC5748G-GW-RDB_PT8b

ENET1: DP83848 Configuration

Initialize the DoIP-Reset pin - Initialize to high level:

MPC5748G-GW-RDB_PT8c

MPC5748G-GW-RDB_PT8c

Enable the DoIP Phy`s power.

MPC5748G-GW-RDB_PT8d

MPC5748G-GW-RDB_PT8d

ENET1: ENET Configuration

Go to Routing (Collapsed) in pin_mux component, then select "ENET".

Configure the ports according to the schematic:

MPC5748G-GW-RDB_PT8e

MPC5748G-GW-RDB_PT8e

ENET1: lwip middleware configuration:

MPC5748G-GW-RDB_PT8f

MPC5748G-GW-RDB_PT8f

ENET1: Application Code

For the peripheral power supply, go to: [Project Name] > Source > main.c

MPC5748G-GW-RDB_PT8g

MPC5748G-GW-RDB_PT8g

To fix a problem in the SDK, go to: [Project Name] > SDK > middleware > tcpip > tcpip_stack > ports > netif > enetif > enetif.h

The SDK only implements the configuration for MAC0, and the code shown needs to be added to support MAC1.

MPC5748G-GW-RDB_PT8h

MPC5748G-GW-RDB_PT8h

If there is an issue with the code generated for the ENET1 GPIO configuration:

Check the sample demo (the project of ENET1_MPC5748G project) and copy the Enet1IOConfigure.c file to your project without any modification.

MPC5748G-GW-RDB_PT8i

MPC5748G-GW-RDB_PT8i

To add the client application for lwip_tcp.

Check the sample demo (the project of ENET0_MPC5748G project) and copy the tcpiptest.c file to your project without any modification.

Add client application call function under [Project Name] > SDK > middleware > tcpip > tcpip_stack > demo > test.c.

MPC5748G-GW-RDB_PT8j

MPC5748G-GW-RDB_PT8j

ENET1: Build and Debug

Click the "build project" button, but make sure there are no compilation errors.

MPC5748G-GW-RDB_PT8k

MPC5748G-GW-RDB_PT8k

Select the correct debug configuration and interface to debug the application.

MPC5748G-GW-RDB_PT8l

MPC5748G-GW-RDB_PT8l

Test: Ping the board from PC:

MPC5748G-GW-RDB_PT8m

MPC5748G-GW-RDB_PT8m

Test: LWIP_tcp Client:

MPC5748G-GW-RDB_PT8n

MPC5748G-GW-RDB_PT8n

Code Examples: Hands-On – UART

  • Full-duplex communication
  • Separate clock for baud rate calculation
  • The relationship “(2/3)* LIN_CLK > PBRIDGEx_CLK > 1/3*LIN_CLK” should be maintained.
  • 15/16/7/8 bits data, parity
  • 1/2/3 stop bits
  • 12-bit + parity reception, 12-bit counter for timeout management
  • 4-byte buffer for reception, 4-byte buffer for transmission
  • The maximum baud rate achievable is LIN_CLK/4 Mbit/s.
  • For bit rate ≤ LIN_CLK/16 Mbit/s
  • Sixteen times oversampling
  • 3:1 majority voting for LIN_CLK/16 Mbit/s < bit rate < LIN_CLK/8 Mbit/s
  • Reduced over sampling programmable by the user

UART: Import Example Project

Go to File > New > New S32DS Project from Example to create a new S32 Design Studio project.

Then select the uart_pal_mpc5748g file from the "MPC57xxRTM SDK v1.0.0 Example Projects" folder.

MPC5748G-GW-RDB_PT9a

MPC5748G-GW-RDB_PT9a

UART: Modify

To enable and modify the peripheral power supply:

Open pin_mux component in "Component Inspector" to configure pin routing:

SIUL2 tab > GPIO 60 and GPIO 61 and then select the pin (one option) + direction output.

MPC5748G-GW-RDB_PT9b

MPC5748G-GW-RDB_PT9b

UART: Configuration

Configure the UART port:

MPC5748G-GW-RDB_PT9c

MPC5748G-GW-RDB_PT9c

Configure UART properties:

MPC5748G-GW-RDB_PT9d

MPC5748G-GW-RDB_PT9d

Port printf library functions:

Check the UART_MPC5748G project and copy the printf.c file to your project without any modification.

MPC5748G-GW-RDB_PT9e

MPC5748G-GW-RDB_PT9e

UART: Build and Debug

Click the "build project" button, but make sure there are no compilation errors.

MPC5748G-GW-RDB_PT9f

MPC5748G-GW-RDB_PT9f

Select the correct debug configuration and interface to debug the application.

MPC5748G-GW-RDB_PT9g

MPC5748G-GW-RDB_PT9g

Test: UART send and receive.

MPC5748G-GW-RDB_PT9h

MPC5748G-GW-RDB_PT9h

Code Examples: Hands-On – LIN

  • Supports LIN protocol version 1.3, 2.0, 2.1 and 2.2
  • Bit rates up to 20 Kbit/s (LIN protocol)
  • Leader/follower mode
  • Classic and enhanced checksum calculation and check
  • Single 8-byte buffer or FIFO for transmission/reception
  • Timeout management
  • Identifier filters
  • DMA interface
  • Supports a maximum of 16 possible identifiers
  • Leader mode with autonomous message handling
  • Wakeup event on dominant bit detection
  • True LIN field state machine
  • Advanced LIN error detection
  • Header, response and frame timeout
  • Follower mode
  • Autonomous header handling
  • Autonomous transmit/receive data handling
  • Identifier filters for autonomous message handling in follower mode
  • Separate clock for baud rate calculation
  • The relationship “(2/3)* LIN_CLK > PBRIDGEx_CLK > 1/3*LIN_CLK” should be maintained.

Resources: on-board user LIN ports (hardwired to GPIOs)

MPC5748G-GW-RDB_PT10a

MPC5748G-GW-RDB_PT10a

LIN: Import Example Project

Go to File > New > New S32DS Project from Example to create a new S32 Design Studio project.

Then select the LIN_5748g file from the "MPC57xxRTM SDK v1.0.0 Example Projects" folder.

MPC5748G-GW-RDB_PT10b

MPC5748G-GW-RDB_PT10b

Application Code

MPC5748G-GW-RDB_PT10c

MPC5748G-GW-RDB_PT10c

LIN: Build and Debug

MPC5748G-GW-RDB_PT10d

MPC5748G-GW-RDB_PT10d

Code Examples: Hands-On – eMMC+Fatfs

Make sure that your SDK has been upgraded to RTM2.0.0.

eMMC+Fatfs: Import Example Project

Import the example code within the SDK from File > New > New S32DS Project from Example.

Select the sdhc_fatfs_mpc5748g file from the "MPC57xxRTM SDK v2.0.0 Example Projects".

MPC5748G-GW-RDB_PT11a

MPC5748G-GW-RDB_PT11a

eMMC+Fatfs: Modify

To modify the peripheral power supply, first enable it.

Open pin_mux component in "Component Inspector" to configure pin routing:

SIUL2 tab > GPIO 60 and GPIO 61 and then select the pin (one option) + direction output.

MPC5748G-GW-RDB_PT11b

MPC5748G-GW-RDB_PT11b

eMMC+Fatfs: Configuration

To configure the UART port:

MPC5748G-GW-RDB_PT11c

MPC5748G-GW-RDB_PT11c

To configure the uSDHC:

MPC5748G-GW-RDB_PT11d

MPC5748G-GW-RDB_PT11d

eMMC+Fatfs: Application Code

To fix a problem in the SDK, go to: [Project Name] > SDK > middleware > sdhc > sd > sd.c

MPC5748G-GW-RDB_PT11e

MPC5748G-GW-RDB_PT11e

eMMC+Fatfs: Build and Debug

MPC5748G-GW-RDB_PT11f

MPC5748G-GW-RDB_PT11f

Support

Forums

Connect with other engineers and get expert advice on designing with the MPC5748G on one of our community sites.