Reprogramming a KW36 device using the FSCI bootloader

Document created by Edgar Eduardo Lomeli Gonzalez Employee on Mar 29, 2019Last modified by Edgar Eduardo Lomeli Gonzalez Employee on May 3, 2019
Version 6Show Document
  • View in full screen mode

Introduction

This document is a quick start guide to load a new software image in a KW36 device through FSCI (Freescale Serial Communication Interface) bootloader software. Also, it contains all the steps needed to install the software required in a Windows host to handle the FSCI communication protocol.

 

Software Requirements

  1. IAR Embedded Workbench IDE or MCUXpresso IDE.
  2. FRDM-KW36 SDK.

 

Hardware Requirements

  1. FRDM-KW36 board.

 

Downloading the SDK

When downloading the SDK, select your specific IDE or simply choose all toolchains as shown below.

 

In the option "Add software component", ensure to select all middleware components as depicted below.

 

Deploying an FSCI Host in Windows OS

The host software for the Windows OS was designed to work in a Python environment, so the following steps are to download and install the Python package and other firmware needed.

  1. Visit the Python web site and download the latest Python 2.7.x MSI installer package for Windows OS.
  2. Open the MSI installer package. When customizing the installation options, check "Add python.exe to Path" as shown below.
  3. Complete the rest of the steps for the Python installation process.
  4. Unzip the FRDM-KW36 SDK. Depending on your Python environment architecture, copy the HSDK.dll from <SDK_root>\tools\wireless\host_sdk\sdk-python\lib\<x86_or_x64> to <Python_directory>\DLLs (default in C:\Python27\DLLs).
  5. Download and install Visual C++ Redistributable Packages for Microsoft Visual Studio 2013 depending on the Windows architecture (vcredist_x86.exe or vcredist_x64.exe) from the Microsoft web site.
  6. Download and install the Microsoft Visual C++ Compiler for Python 2.7 from the following web site.
  7. To run Python scripts from the Command Prompt of Windows, we must create a system variable named PYTHONPATH. Search “System” in the Windows browser. Go to Advanced system settings -> Environment Variables… -> System variables. Click on the “New…” button and create the PYTHONPATH variable with the following value: <SDK_root>\tools\wireless\host_sdk\hsdk-python\src.

Programming the FSCI bootloader on FRDM-KW36 board

  1. Attach the FRDM-KW36 board to your PC.
  2. Drag and drop the “bootloader_fsci_frdmkw36.bin” from the previously unzipped SDK file, you can find this file in: <SDK_root>\tools\wireless\binaries to your board. Like a common USB device.

Creating a binary image to reprogram the device

IAR Embedded Workbench

  1. Open the connectivity project that you want to program through the FSCI bootloader from your SDK. This example will make use of the heart rate sensor project, located at the following path: <SDK_root>\boards\frdmkw36\wireless_examples\bluetooth\hrs\freertos\iar\hrs_freertos.eww.
  2. Open the project options window (Alt+F7). In Linker -> Config window, edit the “Configuration file symbol definitions” add the “gUseBootloaderLink_d=1” linker flag as shown below.
  3. Go to the “Output Converter” window and ensure that the output file is in binary format (.bin), otherwise, deselect the “Override default” checkbox, expand the “Output format” combo box and select “Raw binary. Click the OK button.
  4. Rebuild the project. The binary will be saved at: <SDK_root>\boards\frdmkw36\wireless_examples\bluetooth\hrs\freertos\iar\debug

 

MCUXpresso IDE

  1. Import your FRDM-KW36 SDK to MCUXpresso. Drag and drop your SDK on the "installed SDK's" toolbar. (In this step, it is not necessary to unzip the package).
  2. Open any connectivity project that you want to program through the FSCI bootloader from your SDK. This example will make use of the heart rate sensor project.
  3. Go to Project -> Properties, a new window will appear. Then, open the C/C++ Build -> Settings -> Linker -> Miscellaneous. Press the icon below, a new window will be deployed. Add “--defsym=gUseBootloaderLink_d=1”. Click on “Apply and Close”.
  4. Build the project.
  5. Deploy the “Binaries” icon in the workspace. Click the right mouse button on the “.axf” file. Select “Binary Utilities -> Create binary” option. The binary file will be saved at “Debug” folder in the workspace with “.bin” extension.

Reprogramming an FRDM-KW36 board using the FSCI bootloader

The following steps are to test the FSCI bootloader in a Windows OS.

  1. Search "Command Prompt" in the Windows browser.
  2. Run the "fsci_bootloader.py" Python script.
  1. Type the “python.exe” path in the console (default C:\Python27\python.exe).
  2. Drag and drop the “fsci_bootloader.py” from: <SDK_root>\tools\wireless\host_sdk\hsdk-python\src\com\nxp\wireless_connectivity\test\bootloader on the command prompt screen.
  3. Search the COM Port of your FRDM-KW36 board and type in the console. You can find it typing ‘Device manager’ from windows home and then search it in Ports (COM & LPT) toolbar. As you can see in this example the port may change depending on each case.
  4. Search the binary image file (created in the last section). Drag and drop on the screen.
  5. Press “Enter” to start the firmware update trough FSCI bootloader. Automatically the KW36 device will trigger to run the new software.
  6. To see all your process running, you can download the ‘IoT Toolbox’ from the app store to your smartphone and connect your device with the board to verify the random data that the heart rate sensor example generates.

Attachments

    Outcomes