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.
- IAR Embedded Workbench IDE or MCUXpresso IDE.
- FRDM-KW36 SDK.
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.
- Visit the Python web site and download the latest Python 2.7.x MSI installer package for Windows OS.
- Open the MSI installer package. When customizing the installation options, check "Add python.exe to Path" as shown below.
- Complete the rest of the steps for the Python installation process.
- 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).
- 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.
- Download and install the Microsoft Visual C++ Compiler for Python 2.7 from the following web site.
- 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
- Attach the FRDM-KW36 board to your PC.
- 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
- 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.
- 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.
- 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.
- Rebuild the project. The binary will be saved at: <SDK_root>\boards\frdmkw36\wireless_examples\bluetooth\hrs\freertos\iar\debug
- 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).
- 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.
- 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”.
- Build the project.
- 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.
- Search "Command Prompt" in the Windows browser.
- Run the "fsci_bootloader.py" Python script.
- Type the “python.exe” path in the console (default C:\Python27\python.exe).
- 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.
- 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.
- Search the binary image file (created in the last section). Drag and drop on the screen.
- Press “Enter” to start the firmware update trough FSCI bootloader. Automatically the KW36 device will trigger to run the new software.
- 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.