Getting Started with the FRDM-KW38 | NXP Semiconductors

Getting Started with the FRDM-KW38

Last Modified: 2020-04-16 14:24:43Supports FRDM Development Kit for KW39/38/37 MCUs

1. Plug It In

Let's take your FRDM-KW38 for a test drive! You have the choice of watching the sequence in a short video or following the detailed actions list below.

1.1 Get Started with the FRDM-KW38 Development Board

Video Player is loading.
Current Time 0:00
Duration 1:24
Loaded: 0.00%
Stream Type LIVE
Remaining Time 1:24
 
1x
  • Chapters
  • descriptions off, selected
  • captions off, selected
  • en (Main), selected

1.2 Attach the USB Cable

1.3 Run the Out-of-Box Demo

Your FRDM-KW38 comes loaded with a demo that flashes the multi-colored LEDs when you connect the board.

Bluetooth Low Energy (LE) Beacon

The Bluetooth LE Beacon application demonstrates the beacon functionality. The beacons are non-connectable advertising packets that are sent on the three advertising channels. The latter contains the following fields.

  • Company Identifier (2 bytes): 0x0025 (NXP ID as defined by the Bluetooth SIG)
  • Beacon Identifier (1 byte): 0xBC (Allows identifying an NXP Beacon alongside with the Company Identifier)
  • UUID (16 bytes): Beacon sensor unique identifier
  • A (2 bytes): Beacon application data
  • B (2 bytes): Beacon application data
  • C (2 bytes): Beacon application data
  • RSSI at 1 m (1 byte): Allows distance-based applications

By default, the UUID value is a random value based on the unique identifier of the board.

Application Usage

In order to see the beacons, please, download and install the NXP IoT Toolbox mobile application on a smartphone supporting Bluetooth LE.

Get it on Google Play

Once the NXP IoT Toolbox is installed. Open the application. Then, open the "Beacons" demo and the FRDM-KW38 Beacon will be displayed.

The IoT Toolbox can also perform actions once the beacon is identified, as an example, with this demo the IoT Toolbox can show a message when the beacon is detected. You can enable the action by performing the next steps:

  1. Click in the beacon shown by the IoT Toolbox
  2. In the "Action" panel change the None option to Message
  3. Select the message to display when beacon is found. By default, it shows "Thank you for choosing NXP BLE solutions"
  4. Click on the check mark located in the top right corner
  5. Now, once the beacon is found, it will also display the preconfigured message

Finally, user can also turn off or deactivate the beacons by holding the SW2 button for about 2-3 seconds in the FRDM-KW38. If the user wants to activate the beacons again, just press SW2 button.

2. Get Software

2.1 Installing Software for the FRDM-KW38

Video Player is loading.
Current Time 0:00
Duration 3:47
Loaded: 4.39%
Stream Type LIVE
Remaining Time 3:47
 
1x
  • Chapters
  • descriptions off, selected
  • captions off, selected
  • en (Main), selected

2.2 Download MCUXpresso SDK with Connectivity Software

MCUXpresso SDK for the FRDM-KW38 includes all the wireless connectivity stacks required to develop your solution using Generic FSK, and Bluetooth Low Energy.

Click below to download a preconfigured SDK release for the FRDM-KW38 that includes all the wireless connectivity stacks for the KW38.

Get MCUXpresso SDK

You can also use the online SDK Builder  to create a custom SDK package for the FRDM-KW38.

2.3 Install Your Toolchain

NXP offers a complimentary toolchain called MCUXpresso IDE.

Get MCUXpresso IDE

Want to use a different toolchain?

No problem! MCUXpresso SDK connectivity stack software also supports IAR .

2.4 MCUXpresso Config Tools

The MCUXpresso Config Tool is an integrated suite of configuration tools that guides users in creating new MCUXpresso SDK projects and also provides pin and clock tools to generate initialization C code for custom board support.

Get MCUXpresso Config Tools

To learn more about the basic interactions between the tools while working with either an imported MCUXpresso SDK example project or creating a new project within the IDE, watch this three-part video series: Basic Application Development Using MCUXpresso IDE and MCUXpresso Config Tools.

2.5 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 in to your PC.

Download Driver

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 115,200 baud rate, 8 data bits, no parity and 1 stop bit. To determine the port number of the FRDM-KW38's 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: Tera Term Tutorial, PuTTY Tutorial.

3. Build, Run

The FRDM-KW38 Wireless Connectivity software comes with a list of demo applications and driver examples ready to be compiled and run for each connectivity stack.

3.1 Gen FSK

Build and Run Connectivity Demos on the FRDM-KW38

Video Player is loading.
Current Time 0:00
Duration 6:59
Loaded: 2.38%
Stream Type LIVE
Remaining Time 6:59
 
1x
  • Chapters
  • descriptions off, selected
  • captions off, selected
  • en (Main), selected

3.2 Explore the Connectivity Example Code

Generic FSK

The KW38 Wireless Connectivity Software package comes with the Connectivity Test demo application for Generic FSK protocol. To see what's available, browse to the 'examples' folder: \boards\frdmkw38\wireless_examples\genfsk.

3.3 Build, Run and Debug Wireless Connectivity Examples

You probably want to build and debug a demo by yourself. Use the guide below to learn how to build and debug an example application from the Wireless Connectivity Stacks in the MCUXpresso IDE or IAR Embedded Workbench IDE.

3.4 Bluetooth LE

Build and Run Connectivity Demos on the FRDM-KW38

Video Player is loading.
Current Time 0:00
Duration 5:35
Loaded: 2.98%
Stream Type LIVE
Remaining Time 5:35
 
1x
  • Chapters
  • descriptions off, selected
  • captions off, selected
  • en (Main), selected

3.5 Explore the Connectivity Example Codes

Bluetooth Low Energy

The KW38 Wireless Connectivity Software package comes with a long list of demo applications for Bluetooth Low Energy protocol. To see what's available, browse to the 'examples' folder: \boards\frdmkw38\wireless_examples\bluetooth.

3.6 Download the NXP IoT Toolbox for your Smartphone

In order to use the Bluetooth Low Energy and Hybrid examples, the NXP IoT Toolbox needs to be installed on a smartphone. This application provides several examples that can be used in conjunction with the connectivity stack to connect your phone to the development board over Bluetooth LE.

Get it on Google Play

3.7 Build, Run and Debug Wireless Connectivity Examples

You probably want to build and debug a demo by yourself. Use the guide below to learn how to build and debug an example application from the Wireless Connectivity Stacks in the MCUXpresso IDE or IAR Embedded Workbench IDE.

3.8 Hybrid (Gen FSK + Bluetooth LE)

Build and Run Connectivity Demos on the FRDM-KW38

Video Player is loading.
Current Time 0:00
Duration 6:55
Loaded: 0.00%
Stream Type LIVE
Remaining Time 6:55
 
1x
  • Chapters
  • descriptions off, selected
  • captions off, selected
  • en (Main), selected

3.9 Explore the Connectivity Example Codes

Hybrid (Gen FSK + Bluetooth LE)

The KW38 Wireless Connectivity Software package comes with a hybrid demo application (Gen FSK + Bluetooth LE). To see the hybrid demo application, browse to the 'examples' folder: \boards\frdmkw38\wireless_examples\hybrid.

3.10 Download the NXP IoT Toolbox for your Smartphone

In order to use the Bluetooth Low Energy and Hybrid examples, the NXP IoT Toolbox needs to be installed on a smartphone. This application provides several examples that can be used in conjunction with the connectivity stack to connect your phone to the development board over BLE.

Get it on Google Play

3.11 Build, Run and Debug Wireless Connectivity Examples

You probably want to build and debug a demo by yourself. Use the guide below to learn how to build and debug an example application from the Wireless Connectivity Stacks in the MCUXpresso IDE or IAR Embedded Workbench IDE.

4. Create an Application for the FRDM-KW38

4.1 Clone an example project from MCUXpresso SDK

Video Player is loading.
Current Time 0:00
Duration 9:02
Loaded: 1.84%
Stream Type LIVE
Remaining Time 9:02
 
1x
  • Chapters
  • descriptions off, selected
  • captions off, selected
  • en (Main), selected

Option A: Use the MCUXpresso IDE to clone an example project.

Option B: Use the MCUXpresso Config Tool to clone an existing MCUXpresso SDK example for use with third party IDEs.

4.2 Use the Pins Tool

Now, let's use the Pins tool that is part of the MCUXpresso Config Tool to show how to add a new GPIO pin to your project to blink an LED.

4.3 Use the Clocks Tool

Next use the Clocks tool that is part of the MCUXpresso Config Tools to change the clock settings and change the rate that the LED blinks.

4.4 Success

With the application modified, you will see the FRDM-KW38's blue LED slowly blinking. You can also view terminal output using the terminal program.