Getting Started with the K32W148 Development Platform | NXP Semiconductors

Getting Started with the K32W148 Development Platform

Last Modified: Mar 15, 2023Supports K32W148 Evaluation Kit with Multiprotocol Radio

Contents of this document

  • 1

    Plug it In
  • 2

    Get Software
  • 3

    Build, Run
  • 4

    Modify an SDK example

1. Plug it In

Let's take your K32W148 board for a test drive! You have the choice of watching the sequence in a short video or following the detailed actions listed below.

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

    1.1 Get Familiar with the Board

    The K32W148 board is pre-programmed with a diagnostic demo, which tests various features of the board. This program utilizes the MCU-LINK VCOM output, which is connected to the debug probe(J14), which acts a serial to USB bridge to a host computer, as well as providing the CMSIS-DAP debug interface.

    1.2 Serial Terminal

    Most of the MCUXpresso SDK examples and this out-of-box demo set up for MCUXpresso IDE, IAR and Keil tools use the MCU UART for print output. If you are not sure how to use a terminal application try one of these below.

    Mcuxpresso Terminal, Tera Term Tutorial, PuTTY Tutorial.

    1.3 Plug in the Board

    Connect a micro USB cable from connector J14 to a host computer or power supply to power up the board and run the demo program. The demo can be tested with any Bluetooth® Smart Ready products available on the market. The IoT Toolbox can also be used to showcase the profile functionality. For the out-of-the box experience please download the IoT Toolbox on your smartphone from your device's APP store.

    1.4 Run the Out of the Box Demo

    Get familiar with the beacons by selecting the 'Beacons' icon once you have opened the IoT Toolbox App. 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 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 1m (1 byte): Allows distance-based applications

    2. Get Software

    2.1 Install Your Toolchain

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

      NXP offers a complimentary toolchain called MCUXpresso IDE. Please download MCUXpresso v11.6.0 or above.

      Get MCUXpresso IDE

      Want to use a different toolchain?

      Need help choosing?

      No problem! The MCUXpresso SDK includes support for other tools such as IAR .

      2.2 Jump Start Your Design with the MCUXpresso SDK

      Want to learn about SDK?

      The MCUXpresso SDK is complimentary and includes full source code under a permissive open-source license for all hardware abstraction and peripheral driver software.

      You may install the MCUXpresso SDK directly form the MCUXpresso SDK website at mcuxpresso.nxp.com. Click on “Select Development Board” to search for the evaluation board.

      In the Search for Hardware search box, type in the selected board “K32W148-EVK”. Click on the board to select it.

      On the right hand side you will see the option to build the SDK for the K32W148-EVK. Click on this button to add the middleware needed.

      To build the SDK, let’s “Select All” for the middleware available. Then scroll down and press “Download SDK”. The Software Terms and Conditions will appear, select “I Agree” in order to begin the download.

      Once the SDK package has been downloaded, drag and drop to the “Installed SDKs” window in the MCUXpresso IDE.

      If you are using another toolchain, you can download the SDK release for the K32W148-EVK using the link below.

      Get MCUXpresso SDK

      2.3 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. It is fully integrated as a part of MCUXpresso IDE and also as a separate tool if using a different IDE.

      Click the Get MCUXpresso Config Tools below to get the Config Tools installer.

      Get MCUXpresso Config Tools

      2.4 Install Drivers

      MCU-Link is supported on host computers running on Windows 10, MacOS X, and Ubuntu Linux operating systems (OSs). For each OS, an MCU-Link firmware package is available that includes the host device drivers, MCU-Link firmware and scripts to program CMSIS-DAP and J-Link firmware options.

      To download and install the host device drivers and update the MCU-Link firmware, follow these steps:

      1. Go to the MCU-Link page on the NXP website
      2. Click Design Resources. Then, click the SOFTWARE category. The latest version installation packages are displayed at the top for all three compatible OSs
      3. Download the package for your host OS and install it (Linux/MacOS) or execute the installer program (Windows). The package is installed/unzipped to the MCU-LINK_installer_Vx_xxx directory
      4. Switch MCU-Link to (USB) ISP mode by shorting jumper JP20
      5. Connect the J14 connector on the board to the USB port of the host computer through a USB micro-B cable. MCU-Link gets powered up in (USB) ISP mode. The board gets enumerated as a human interface device (HID) class device
      6. Program the MCU-Link firmware into the MCU-Link internal flash using the instructions provided in the "Firmware Installation Guide" section of the "Readme.txt" file. This file can be found in theMCU-LINK_installer_Vx_xxx_directory. Use the scripts provided to program the CMSIS-DAP or J-Link firmware option
      7. Disconnect the board from the host computer, remove jumper JP20, and reconnect the board

      2.5 Secure Provisioning Command Line Tool (SPSDK)

      Secure Provisioning SDK (SPSDK) is a unified, reliable and easy to use Python SDK library working across the NXP MCU portfolio providing a strong foundation from quick customer prototyping up to production deployment.

      To install the SPSDK, you may follow the instructions below, for more details or if you are using a different OS, please visit the installation guide provided in the Secure Provisioning SDK (SPSDK) .

      Requirements

      Make sure to have Python 3.7+  installed (old version 2.x is not supported).

      For Windows users:

      1. Create a folder in which the SPSDK repository will be located. In this example, I use the C:\spsdk
      2. Clone the repository to this folder
        1. cd C:\spsdk
        2. git clone NXP MCUXpresso GitHub Repository
      3. In the same folder, you may create and activate your virtual environment. Create the python virtual environment
        1. python -m venv venv
        2. Activate the virtual environment
        3. venv\Scripts\activate
        4. When the virtual environment is active you will see the virtual environment's name in parenthesis next to your current working path.

          Anytime you use the SPSDK, it is necessary to activate the virtual environment. You do not need to create a new environment each time. Repeat step 3.b only.

      4. Install dependencies
        1. python -m pip install --upgrade pip
        2. pip install -r requirements-develop.txt
      5. Ensure that you spsdk installation has been successful. You will see the output of the complete menu by running the following command
        1. spsdk –help

      3. Build, Run

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

      A short video is provided to walk you through this process or you can follow along the steps below.

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

        3.1 Explore the MCUXpresso SDK Example Code

        The MCUXpresso SDK comes with a long list of example applications code. To see what's available, browse to the SDK boards folder of your SDK installation and select K32W148 (<SDK_Install_Directory>/boards/K32W148).

        To learn more about specific example code, open the readme.txt file in an example’s directory.

        3.2 Building and Debugging MCUXpresso SDK Examples

        If one or more of the demo applications or driver examples sounds interesting, you're probably wanting 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 an example application using the MCUXpresso IDE.

        3.3 Updating NBU for Wireless Examples

        Important

        It is necessary to work with the matching NBU image for the SDK version of the application you are working with. This means that when you download your SDK, prior to loading any wireless SDK example, update your NBU image with the provided binaries in the following folder of the SDK:

        Depending on the application type select the appropriate NBU file found in the different protocol folders.

        ../middleware/wireless/ble-controller/bin

        ../middleware/wireless/ieee_802_15_4/bin/k32w1

        Here you will find two type of images for the NBU FW:

        1. SB3 File Type
          1. This is for EVK users only. The EVK’s come programmed with set keys for ease of use in development
        2. XIP File Type
          1. This is for samples that are not programmed with any keys. For these devices, you can create your custom keys, then create an SB3 file based on this XIP image

        To update the NBU, you may use the SPSDK command line tool.

        1. Open the path to your SPSDK folder and activate the virtual environment
          1. >> venv\Scripts\activate
        2. Place your device in ISP mode. For this example we will use the UART peripheral by connecting a USB cable to J14. On the EVK you can enter ISP by the following method
          1. Make sure a jumper is placed on JP25
          2. Press and hold SW4, press and release Reset, and then release SW4
        3. Once the device is connected you may check your devices available using SPSDK to find the COM port it is connected to
          1. >> nxpdevscan
        4. Then you may run the ‘receive-sb-file’ command to load the sb3 file
          1. >> blhost -p COM27 receive-sb-file path_to_SDK\k32w1_nbu_ble_hosted_a1.sb3

        4. Modify an SDK example

        A short video is provided to walk you through this process, or you can follow along the steps below.

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

          4.1 Clone an Example Project from MCUXpresso SDK

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

          Option B: Use the MCUXpresso Config Tools 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 Tools to show how to add a new GPIO pin to your project to blink an LED.