MCUXpresso SDK Documentation

Wireless ranging demo application setup#

This chapter provides information about hardware and software setup.

Hardware set up with single antenna configuration#

Prerequisites

  • Two boards (ranging service client and ranging service server)

  • PC

The first board (ranging service client) should be connected to the PC running the host application (see Python host application setup) using a USB cable. Once flashed, the second board (ranging service server), may be connected to a USB battery to facilitate movement.

Start the evaluation of this ranging system with a cabled configuration. Once the system operation is properly understood, the evaluation can be pursued in more challenging environments (with multi-path and interference).

To perform cabled measurements with KW47 boards, a small hardware modification must be done on the PCB. Rotate a capacitor to bypass the printed antenna and connect the RF path to an external SMA connector.

For further details, refer to the documentation corresponding to your board of choice. To perform radiated testing, connect an SMA-mounted antenna on each board instead of a cable.

Figure: Typical wireless ranging setup using KW47-EVK boards

Parent topic:Wireless ranging demo application setup

Hardware set up with antenna diversity#

To enable antenna diversity on KW47-EVK boards, antenna diversity boards (X-FR-ANTDV-IFA or X-FR-ANTDV-MPIFA) must be plugged to the EVKs using a similar setup as described in Hardware set up with single antenna configuration. The X-FR-ANTDV-IFA is a preferred option. Currently, only the X-FR-ANTDV-IFA is being distributed to the customers.

For a detailed setup description, see Antenna Diversity Board User’s Guide (document ADBUG). Figure: Antenna diversity board mounted on KW45 EVK board

From antenna diversity boards, you must choose the pair of antennas, either the two SMA connectors or the two printed antennas, to be used.

Another convenient way to enable antenna diversity testing is to use KW47-LOC board which embeds two printed antennas on the same PCB. For a detailed description of this board and how to set it up, refer to KW47-LOC Board User Manual.

To configure antenna diversity properly in the firmware, it is required to configure the following:

  • Antenna diversity board type and antennas used (SMA connectors or printed antennas)

  • Antenna configuration index

  • Antenna switching time (T_SW)

Note: All platforms support only 1x1 or 2x2 antenna configurations, leading to either one or four antenna paths being used.

Parent topic:Wireless ranging demo application setup

Firmware setup#

To install the firmware on the boards, perform the steps below:

Note: The firmware must be installed on the two boards following those two steps.

  1. Update your NBU image with the provided binaries in the following folder of the SDK: ../middleware/wireless/ble_controller/bin (*_hadm_* for KW45 family).

  2. Compile the application wireless_ranging_bluetooth_bm by referring to the quick start guide specific to your platform. The application can be found in the directory:

    \\boards\<board>\wireless_examples\bluetooth\wireless_ranging

  3. Flash the binary on both devices. Flash the application using your preferred IDE.

Parent topic:Wireless ranging demo application setup

Serial console setup#

Wireless ranging application can be used either by using a console or by using a Python script environment. To use the console, connect to each device COM port with Tera Term using the setup (putty is not supported), as shown in the figure below.

Figure: Tera Term configuration for operating with wireless ranging

Parent topic:Wireless ranging demo application setup

Python host application setup#

To use the Python host application, go to tools\wireless\wireless_ranging_host. This folder is referred later in the document as <app_folder>.

This application is a Python application which requires several packages and a specific version of Python, namely 3.6. The supported OS is Windows. It has not been tested on other Python-capable OS.

The recommended and documented approach is to use pipenv** to ease installation of mandatory packages.

If you do not want to use pipenv, you can install Python packages one by one. You can find the list of mandatory packages in <app_folder>\python\Pipfile.

Note: The wireless ranging host application only works with Python 3.6. Any attempt to use another version causes issues.

To use the Python host application using pipenv, follow the steps below:

Note: The following installation procedure is provided for Windows. Use Windows command prompt to execute commands below.

  1. Install Python 3.6 for 64-bit platform.

  2. Install pipenv package version 2021.5.29. Note that newer version of pipenv might not be compatible with Python 3.6.

    pip install 'pipenv==2021.5.29'
    

    Note:

    • “python” executable must point to Python 3.6 (use python -V to check the version).

    • If using py command to manage several Python versions installed on your system, replace “python” with py -3.6 everywhere in the sections below.

    • Use python -m pipenv instead of pipenv if you did not choose to update your PATH to pipenv executable.

  3. Generate a virtual environment in <app_folder>/python folder using Pipfile located there.

    cd <app_folder>/python
            pipenv --python 3.6 install (or py -3.6 -m pipenv --python 3.6 install)
    

    Expected output (for windows):

    Creating a virtualenv for this project…
    Pipfile: <app_folder>\python\Pipfile
    Using <yourPythonPath>/Python36/python.exe (3.6.6) to create virtualenv…
    [=   ] Creating virtual environment...
    [...]
    

    Be sure that in the output above, python.exe is version 3.6.

This command may take several minutes (~10 mins). If pipenv fails (timeout) to update packages, adding --skip-lock option might work around the problem.

Parent topic:Wireless ranging demo application setup