1.1 Download MCUXpresso SDK with USB PD
The MCUXpresso SDK is complimentary and includes full source code under a permissive open source license for all hardware abstraction and peripheral driver software.
The MCUXpresso SDK contains USB Type-C Power Delivery middleware to support rapid development.
Click below for instructions on how to use the SDK Builder to create a custom SDK package with USB Power Delivery support.
1.2 Install Your Toolchain
NXP offers a complimentary toolchain called MCUXpresso IDE
Get MCUXpresso IDE
Want to use a different toolchain?
No problem! The MCUXpresso USB Power Delivery SDK includes support for IAR Embedded Workbench IDE
1.3 MCUXpresso Config Tools
The MCUXpresso Config Tool is an integrated suite of configuration tools that guide users in creating new MCUXpresso SDK projects, and also provides pin and clock tools to generate
initialization C code for custom board support.
1.4 PC Configuration
Many of the example applications output data over the MCU UART so you'll want to make sure that the driver for the board's virtual COM port is installed. Before you run the driver installer,
you MUST have the board plugged into your PC.
With the serial port driver installed, run your favorite terminal application to view the serial output from the MCU's UART. Configure the terminal to 115200 baud rate, 8 data bits, no parity,
and one stop bit. To determine the port number of the FRDM-KL28Z virtual COM port, open the device manager and look under the "Ports" group.
Not sure how to use a terminal application? Try one of these tutorials:
2.1 Attach the USB Cable
2.2 Explore the USB PD MCUXpresso SDK Example Code
The MCUXpresso SDK comes with an extensive list of example applications code.
The USB Power Delivery SDK middleware provides several example codes compatible with the USB Type-C PD Shield Board located at (/boards/frdmkl28z_om13588/usb_examples).
To learn more about specific example code, open the readme.txt file in an example's directory.
2.3 Build, Download USB PD SDK Example
If one or more of the demo applications or driver examples sounds interesting, you probably want to know how you can build and debug yourself. The Getting Started with MCUXpresso SDK guide
provides easy, step-by-step instructions on how to configure, build, and debug demos for all toolchains supported by the SDK.
Use the guide below to learn how to open, build, and debug a USB PD example application using the MCUXpresso IDE.
Using a different toolchain
2.4 Disconnect the USB Cable
2.5 Run usb_pd software example
Use the guide below for a step-by-step guide on how to assemble the hardware and running the usb_pd DRP example application.
For extra information, please use the "MCUXpresso SDK USB Type-C PD Stack User's Guide" located at the document folder.
Clone a USB PD example project from MCUXpresso SDK
Option A: Use the MCUXpresso IDE to clone an example project
1. Open the MCUXpresso Config Tool.
2. In the wizard that comes up, browse to the place where the MCUXpresso SDK previously unzipped, and then select the “Clone an example project” radio button and click Next.
3. Choose one of the USB PD sample projects to clone. For this example, the following instructions show how to clone the usb_pd_battery project. Write battery in the filter box and then select
the usb_pd_battery/freertos project. Then click Next.
4. Then select the directory you want to place the cloned project, give it a name, and choose the IDE to use. Note that the toolchains listed are the same used in the SDK builder. Then click
5. After cloning go to the select directory, and open the project for your IDE. Import, compile, and run the project as done in previous sections.