MCUXpresso SDK Documentation

Building the binaries#

This section describes the necessary steps for obtaining the binary files for usage with the boards.

Prerequisites#

To build any of the demo applications, you need the following toolchain:

  • IAR Embedded Workbench for Arm (details in release note)

  • MCUXpresso IDE (details in release note)

  • Visual Studio Code with “MCUXpresso for Visual Studio Code” extension (details in release note)

  • Teraterm (version 4.105 or higher)

The Connectivity Software Package does not include support for any other toolchains. The packages must be built with the debug configuration to enable debugging information. This package includes various sample applications that can be used as a starting point.

Conventions for building the wireless_UART application.#

The following sections present the steps required for building the wireless_UART application. All applications can be found using the following placeholders for text:

  • <connectivity_path>: represents the root path for the SDK.

  • <board>: represents the target board for the demo app, “kw47evk” in this case.

  • <RTOS>: represents the scheduler or RTOS used by the app; it can be either “bm” or “freertos”.

  • <demo_app>: represents the demo application name.

  • <IDE>: represents the integrated development environment used to build projects; “iar” in this case.

  • <core_id>: represents the target CPU on which the application will run, “cm33_core0” in this case (applicable only on KW47-EVK, KW47-LOC, MCX-W72-EVK and FRDM-MCXW72 boards).

  • The general folder structure of the demo applications is the following:

    <connectivity_path>\boars\<board>\wireless_examples\bluetooth\<demo_app>\<core_id>\<RTOS>\<IDE>

Selected application: w_uart

Board: One of the following boards:

  • kw45b41zevk (for this guide)

  • kw45b41zloc

  • frdmmcxw71

  • kw47evk

  • kw47loc

  • mcxw72evk

  • frdmmcxw72

RTOS: FreeRTOS

Resulting location:

<connectivity_path>\boards\<kw45b41zevk / kw45b41zloc / frdmmcxw71 / kw47evk / kw47loc / mcxw72evk / frdmmcxw72>\wireless_examples\bluetooth\w_uart\freertos\<IDE>

Building and flashing the BLE software demo applications using IAR Embedded Workbench#

Use the following steps in order to build and flash the BLE software demo applications using the IAR Embedded Workbench:

  1. First unpack the contents of the archive to a folder on the local disk. Then, navigate to the resulting location starting from the SDK root directory.

  2. Open the IAR workspace file (*.eww file format) highlighted file in the figure below.

    Wireless UART IAR demo project location Wireless UART IAR demo project location

  3. Choose between Debug and Release configurations in the drop-down selector above the project tree in the workspace.

    Select the desired configuration (Debug or Release) Select the desired configuration (Debug or Release)

    The figure below shows the Wireless UART - IAR workspace.

    Wireless UART - IAR workspace
    Wireless UART - IAR workspace

  4. Build the Wireless UART project using the options shown in the figure.

    Build Wireless UART application Build Wireless UART application

  5. Make the appropriate debugger settings in the project options window, as seen in the next figure.

    Go to: Project > Options (Alt+F7) > Debugger > Setup (tab) > Driver > J-Link/J-Trace

    Debugger Settings for the Wireless UART project Debugger Settings for the Wireless UART project

  6. Click the “Download and Debug” button (or CTRL+D) to flash the executable onto the board.

    Download and Debug the Wireless UART application Download and Debug the Wireless UART application

  7. Press Go (F5). At this moment, the board starts running the application.

    Running the code on IAR Running the code on IAR

Parent topic:Building the binaries

Building and flashing the BLE Software Demo applications using MCUXpresso IDE#

To build and flash the BLE software demo applications using MCUXpresso IDE, follow the steps listed below:

  1. Open MCUXpresso IDE and open an existing or new workspace location.

    Select MCUXpresso IDE workspace Select MCUXpresso IDE workspace

  2. Drag and drop the package archive into the MCUXpresso Installed SDKs area in the lower right of the main window.

    Installed SDKs in MCUXpresso IDE workspace Installed SDKs in MCUXpresso IDE workspace

  3. After the SDK is loaded successfully, select the “Import the SDK examples(s)…” to add examples to your workspace.

    Importing SDK example(s) Importing SDK example(s)

  4. To select the desired example(s), select the kw45b41zevk / kw45b41zloc / kw47evk / frdmmcxw71 / frdmmcxw72 / mcxw72evk / kw47loc board and then click the “Next” button:

    Selecting the KW47-EVK board Selecting the KW47-EVK board

    Select Wireless UART FreeRTOS project Select Wireless UART FreeRTOS project

  5. Build the wireless_uart_freertos project.

    Build the Wireless UART FreeRTOS project Build the Wireless UART FreeRTOS project

  6. Click the “Debug” button to download the executable onto the board. Make sure you select the appropriate device to flash.

    Download and debug the Wireless UART FreeRTOS project Download and debug the Wireless UART FreeRTOS project

  7. Pressing the Run button makes the board run the application.

    Running the code on MCUXpresso IDE Running the code on MCUXpresso IDE

Parent topic:Building the binaries

Building and flashing the BLE software demo applications using Visual Studio Code#

To build and flash the BLE software demo applications using Visual Studio Code, follow the steps listed below:

  1. Open Visual Studio Code and open the MCUXpresso for Visual Studio Code extension as shown in the figure below.

    MCUXpresso for Visual Studio Code extension MCUXpresso for Visual Studio Code extension

  2. Import the SDK package: click “Import Repository”. Then, choose the “Local” option (if the SDK is archived use “Local archive”), browse to the path of the SDK you want, and click “Import”.

    Steps to import the SDK Steps to import the SDK

  3. After the SDK is loaded successfully, select the “Import Example from Repository” to add an application to your workspace. Choose the repository, toolchain (Arm GNU), board, example you want to add, and the location where the VS Code project would be created. Then click “Create”.

    Steps to import the example application Steps to import the example application

  4. The application now appears in the “Projects” tab on the left. Build the application by pressing the “Build selected” button.

    Building the Wireless UART FreeRTOS application Building the Wireless UART FreeRTOS application

  5. After the build is completed successfully, debug the application by clicking the “Debug” button.

    Debug the Wireless UART FreeRTOS application Debug the Wireless UART FreeRTOS application

  6. Press the run (“Continue”) button twice to run the application on the board.

    Running the Wireless UART FreeRTOS application Running the Wireless UART FreeRTOS application

Parent topic:Building the binaries

Building and flashing the BLE Extended NBU software demo applications using IAR Embedded Workbench#

Use the following steps in order to build and flash the BLE software demo applications using the IAR Embedded Workbench:

  1. First unpack the contents of the archive to a folder on the local disk. Then, navigate to the resulting location starting from the SDK root directory.

  2. Open the IAR workspace file (*.eww file format) highlighted file in the figure below.

    NCP FSCI Blackbox IAR demo project location NCP FSCI Blackbox IAR demo project location

  3. Choose between Debug and Release configurations in the drop-down selector above the project tree in the workspace.

    Select the desired configuration (Debug or Release) Select the desired configuration (Debug or Release)

    The figure below shows the NCP FSCI Blackbox - IAR workspace.

    NCP FSCI Blackbox - IAR workspace
    NCP FSCI Blackbox - IAR workspace

  4. Build the NCP FSCI Blackbox project using the options shown in the figure.

    Build NCP FSCI Blackbox application Build NCP FSCI Blackbox application

  5. Make the appropriate debugger settings in the project options window, as seen in the next figure.

    Go to: Project > Options (Alt+F7) > Debugger > Setup (tab) > Driver > J-Link/J-Trace

    Debugger Settings for the NCP FSCI Blackbox project Debugger Settings for the NCP FSCI Blackbox project

  6. Click the “Download and Debug” button (or CTRL+D) to flash the executable onto the board.

    Download and Debug the NCP FSCI Blackbox application Download and Debug the NCP FSCI Blackbox application

  7. Press Go (F5). At this moment, the board starts running the application.

    Running the code on IAR Running the code on IAR

  8. Open the Core0 IAR workspace file (*.eww file format) highlighted file in the figure below.

    Wireless UART Host IAR demo project location Wireless UART Host demo project location

  9. Choose between Debug and Release configurations in the drop-down selector above the project tree in the workspace.

    Select the desired configuration (Debug or Release) Select the desired configuration (Debug or Release)

    The figure below shows the Wireless Uart Host - IAR workspace.

    Wireless Uart Host - IAR workspace
    Wireless Uart Host - IAR workspace

  10. Build the Wireless Uart Host project using the options shown in the figure.

    Build Wireless Uart Host application Build Wireless Uart Host application

  11. Make the appropriate debugger settings in the project options window, as seen in the next figure.

    Go to: Project > Options (Alt+F7) > Debugger > Setup (tab) > Driver > J-Link/J-Trace

    Debugger Settings for the Wireless Uart Host project Debugger Settings for the Wireless Uart Host project

  12. Click the “Download and Debug” button (or CTRL+D) to flash the executable onto the board.

    Download and Debug the Wireless Uart Host application Download and Debug the Wireless Uart Host application

  13. Press Go (F5). At this moment, the board starts running the application.

    Running the code on IAR Running the code on IAR

Parent topic:Building the binaries

Building and flashing the BLE Extended NBU software demo applications using Visual Studio Code#

To build and flash the BLE software demo applications using Visual Studio Code, follow the steps listed below:

  1. Open Visual Studio Code and open the MCUXpresso for Visual Studio Code extension as shown in the figure below.

    MCUXpresso for Visual Studio Code extension MCUXpresso for Visual Studio Code extension

  2. Import the SDK package: click “Import Repository”. Then, choose the “Local” option (if the SDK is archived use “Local archive”), browse to the path of the SDK you want, and click “Import”.

    Steps to import the SDK Steps to import the SDK

  3. Import NCP(Core1) application: After the SDK is loaded successfully, select the “Import Example from Repository” to add an application to your workspace. Choose the repository, toolchain (Arm GNU), board, example you want to add, and the location where the VS Code project would be created. Then click “Import”.

    Steps to import the NCP example application Steps to import the example application

  4. Import Core0 application: After the SDK is loaded successfully, select the “Import Example from Repository” to add an application to your workspace. Choose the repository, toolchain (Arm GNU), board, example you want to add, and the location where the VS Code project would be created. Then click “Import”.

    Steps to import the Core0 example application Steps to import the example application

  5. Both Extended NBU applications now appears in the “Projects” tab on the left. Build both applications by pressing the “Build selected” button on each.

    Building the NCP FSCI Black Box ThreadX application Building the Wireless UART Host FreeRTOS application

    Building the Wireless UART Host Host FreeRTOS application Building the Wireless UART Host FreeRTOS application

  6. After the build is completed successfully, first debug the NBU(Core1) application by clicking the “Debug” button.

    Debug the NCP FSCI Black Box ThreadX application Debug the Wireless UART Host FreeRTOS application

  7. Press the run (“Continue”) button to run the application on the board.

    Running the NCP FSCI Black Box ThreadX application Running the NCP FSCI Black Box ThreadX application

  8. After the build is completed successfully and the NBU application was successfully written, debug the Core0 application by clicking the “Debug” button.

    Debug the Wireless UART Host FreeRTOS application Debug the Wireless UART Host FreeRTOS application

  9. Press the run (“Continue”) button to run the application on the board.

    Running the Wireless UART Host FreeRTOS application Running the Wireless UART Host FreeRTOS application

Parent topic:Building the binaries