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.
NXP offers a complimentary toolchain called MCUXpresso IDE
Want to use a different toolchain?
No problem! The MCUXpresso USB Power Delivery SDK includes support for IAR Embedded Workbench IDE
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.
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.
Download DriverWith 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:
1. Open a web browser and navigate to the MCUXpresso homepage https://mcuxpresso.nxp.com/
2. Click on “Select Development Board” to download a customized SDK
3. After being redirected to nxp.com login page. Enter your account information or register for a new account.
4. Back on the Select Development Board page, search for the USB PD board name (example: OM13588)
5. Choose any board from the list and provide a name for the configuration. Then, click “Build MCUXpresso SDK”.
6. At the SDK Builder section, select the following Configuration Settings.
7. Select “Download Now” to download the SDK
Note: you may see “Request to Build” instead, so click on that, and after the package gets built, there will
be a new download in the SDK Dashboard section.
8. Inside the SDK Dashboard look for the recently built SDK then click Download icon
9. Download the SDK Archive and SDK Documentation pop-up
10. Agree to Licensing Terms and Conditions
11. Unzip SDK to a folder (i.e., SDK_2.3.0_FRDM-KL28Z_OM13588)
1. Open a web browser and navigate to the MCUXpresso homepage https://mcuxpresso.nxp.com/
2. Click on “Select Development Board” to download a customized SDK
3. After being redirected to nxp.com login page. Enter your account information or register for a new account.
4. Back Select Development Board page, search for the USB PD board name (example: OM13588).
5. Choose any board from the list and provide a name for the configuration. Then, click “Build MCUXpresso SDK.”
6. At the SDK Builder section, select the following Configuration Settings
7. Select “Download Now” to download the SDK
Note: you may see “Request to Build” instead, so click on that, and after the package gets built, there will be a new download in the SDK Dashboard section
8. Inside the SDK Dashboard look for the recently built SDK then click Download icon
9. Download the SDK Archive and SDK Documentation pop-up
10. Agree to Licensing Terms and Conditions
11. Unzip SDK to a folder (i.e., SDK_2.3.0_FRDM-KL28Z_OM13588)
Tera Term is a very popular open source terminal emulation application. This program can be used to display information sent from your Freescale development platform's virtual serial port.
1. Download Tera Term from SourceForge. After the download, run the installer and then return to this webpage to continue.
Download2. Launch Tera Term. The first time it launches, it will show you the following dialog. Select the serial option. Assuming your board is plugged in, there should be a COM port automatically populated in the list.
3. Configure the serial port settings (using the COM port number identified earlier) to 115200 baud rate, 8 data bits, no parity, and 1 stop bit. To do this, go to Setup -> Serial Port and change the settings.
4. Verify that the connection is open. If connected, Tera Term will show something like below in it's title bar.
5. You're ready to go
PuTTY is a popular terminal emulation application. This program can be used to display information sent from your Freescale development platform's virtual serial port.
Download PuTTY using the button below. After the download, run the installer and then return to this webpage to continue.
DownloadLaunch PuTTY by either double-clicking on the *.exe file you downloaded or from the Start menu, depending on the type of download you selected.
3. Configure In the window that launches, select the Serial radio button and enter the COM port number that you determined earlier. Also enter the baud rate, in this case 115200.
4. Click Open to open the serial connection. Assuming the board is connected and you entered the correct COM port, the terminal window will open. If the configuration is not correct, PuTTY will alert you.
5. You're ready to go
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 (
To learn more about specific example code, open the readme.txt file in an example's directory.
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
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.
1. Open up the MCUXpresso IDE
2. Switch to the Installed SDKs view within the MCUXpresso IDE window
3. Open Windows Explorer, drag and drop the FRDM-KL87Z-OM13588 SDK (unzipped) file into the Installed SDKs view.
4. When the following pop-up appears, click OK to continue the import
5. The installed SDK will be displayed in the Installed SDKs view as shown below:
The following steps guide you trough opening the usb-pd example.
6. Find the Quickstart Panel in the lower left-hand corner
7. Then click on import SDK examples(s)...
8. Click on the frdmkl28z_om13588 board image to select that you want to import an example project that can run on that board, then click Next.
9. Use the arrow button to expand the usb_examples category, expand the usb_pd section, then select one of the projects usb_pd_bm bare metal or usb_pd_freertos freertos. To use the UART for printing (instead of the default semihosting), clear the “Enable semihost” under the project options. Then, click Next.
10. On the Advanced Settings wizard, clear the checkbox Redirect SDK “PRINTF” to C library “printf” to use the MCUXpresso SDK console functions for printing instead of generic C library ones. Then click on Finish.
11. Now build the project by clicking on the project name and then click on the Build icon.
12. You can see the status of the build in the Console tab.
13. With the project compiled, you can now flash it to the board and run it.
14. Make sure that the FRDM-KL28Z board is plugged in through the SDA USB port, and click on Debug ‘frdmkl28z_om13588_usb_examples_usb_pd_bm’ [Debug]
15. MCUXpresso IDE probes for connected boards and should find the USB – OpenSDA DAP Link debug probe that is part of the integrated OpenSDA circuit on the FRDM-KL28Z. Uncheck the Remember my selection. Click on OK to continue.
16. The board gets flashed with the firmware, and the debugger starts.
17. Click the Terminate button and disconnect the device
The USB Type-C PD stack needs one provider and one consumer, repeat steps 1 through 6 to program the second board.
1. If not already done, open the desired example application workspace. Most example application workspace files can be located using the following path: install_dir/boards/sdk_board_name/example_type/application_name/rtos/iar/rtos/application_name/example_type/sdk_board_name/install_dir
Using the usb_pd demo as an example, the path is: install_dir/boards/frdmkl28z_om13588/usb_examples/usb_pd/bm/iar/usb_pd_bm.eww/install_dir
2. To build the application, click the Make button, highlighted in red below.
3. Double check at the Build message window that the build complete without errors.
1. The FRDM-KL28Z board comes loaded with the DAPLink debug interface from the factory. If you have changed the debug OpenSDA application on your board, visit www.nxp.com/opensda for information on updating or restoring your board to the factory state.
2. Connect the development platform to your PC via USB cable between the "SDAUSB" USB port on the board and the PC USB connector.
3. Click the "Download and Debug" button to download the application to the target.
4. The application is then downloaded to the target and automatically runs to the main () function.
5. Click the Stop Debugging button and disconnect the USB cable
The USB Type-C PD stack needs one provider and one consumer, repeat steps 1 through 6 to program the second board.
1. Align the pins on the USB Type-C Shield to the headers of the FRDM-KL28Z so that the two boards mate correctly and press them together.
2. Change USB PD Shield jumpers J11 and J12 to the 2-3 position.
3. To monitor VBUS changes, connect a voltmeter between J5 and J8 pin 6 at the USB Type-C Shield.
4. Attach the FRDM-KL28Z OpenSDA USB cable.
5. Power the USB Type-C Shield by connecting the 9V power source to J1 jack.
6. Open a terminal application on the PC (such as PuTTY or TeraTerm) using the debug COM port you determined earlier. Configure the terminal with these settings:
7. Press the Reset button; the following message should appear on the terminal.
8. Repeat steps 1 through 6 for the second FRDM-KL28Z / USB Type-C Shield setup.
9. Connect a USB Type-C cable between the two boars, one works as a sink and the second one becomes the source. To identify which is which go to the terminals.
10. Write ‘0’ at the sink terminal. The following menu will be printed in the debug console.
11. Input ‘c’ to make a 9 V request. After the request is complete, the voltmeter shows approximately 9V.
Clone a USB PD example project from MCUXpresso SDK
Option A: Use the MCUXpresso IDE to clone an example project
1. Open MCUXpresso IDE
2. Click Import SDK Example(s)... from the Quick Start Panel.
3. Select the FRDM-KL28Z-OM13588 board in the Import Wizard. Then, select Next.
4. Use the arrow button to expand the usb_examples category, and then click the checkbox next to usb_pd_sink_battery_bm to choose that project. Select UART as the SDK Debug Console under the project options. Then, click Next.
5. On the Advanced Settings wizard, clear the checkbox Redirect SDK “PRINTF” to C library “printf” to use the MCUXpresso SDK console functions for printing instead of generic C library ones. Then click on Finish.
6. Now build the project by clicking on the project name and then click on the Build icon.
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 on Finish.
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.
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 on Finish.
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.