Flashing a build with USB (NXP Bootloader)

Flashing a build via USB (all platforms)


1. Download the MCU Bootloader ( NXP_Kinetis_Bootloader_2.0.0 package ) from the NXP website here - Please note, you will need to click the 'More' link at the foot of the 'Development Software - miscellaneous' listing to see the NXP_Kinetis_Bootloader_2.0.0 package listed.

2. The downloaded SDK file for the module already contains a pre built version of the Tracker project which can be flashed without any need to engage with NXP's MCUXpresso environment, if this is your preference, then proceed to step 6.

    • The required file can be found in ~/thingstream-client-devkit-module-<version>/tracker/out

3. If you have modified the Tracker project in some way to better suit your needs, you should follow the initial getting started steps on this page to set up your hardware, get the SDKs and configure the MCUXpresso environment.

4. In MCUXpresso, open the 'tracker-<version>' project. In the project explorer view, right click on the 'tracker-<version>' project to open the popup-menu, then select Build configurations > Set active > Release

5. From the main MCUXpresso menu select Project > Clean. Make sure that 'Clean all projects' is selected and then click OK. Once complete, from the main menu select Project > Build All. This will generate tracker-<version>.axf and tracker-<version>.srec in the folder:

thingstream-client-devkit-module-<version>/tracker/Release

6. If you arrive at this point having received a board from a marketing event then proceed to 7a. if you have previously flashed code to your module or if you are replacing an existing Thingstream build then proceed to 7b.

7a.

    • Place module in bootloader mode by power cycling the board and then press and release button SW1 (circled below):

    • power off the module and base board by removing the USB cable or switching the USB power to the base board off

    • power up the module and base board by re-inserting the USB cable or turning the USB power back on

    • press and then release button SW1 button on the module shown circled in red, below. (NOT the one on the base board)

    • the led will transition from flashing green, blue, red to not flashing at all


7b.

    • Place module in bootloader mode by holding SW1 down while you power cycle the boards:

    • power off the module and base board by removing the USB cable or switching the USB power to the base board off

    • hold down button SW1 button on the module (NOT the one on the base board) shown circled in red, below.

    • power up the module and base board by re-inserting the USB cable or turning the USB power back on

    • release the button SW1

    • You may see the led cycle through green, blue, red, when you release the button, you should see the LED D1 flash white once to indicate that the module bootloader has been activated


In this section

Getting Started


Still need help?

If you need more help or have any questions, please send an email to support@thingstream.io.

Now follow the platform-specific instructions below for Windows, Mac or Ubuntu.


Windows

  1. Navigate to the KinetisFlashTool folder in the downloaded bootloader file path (e.g. C:\dev\NXP_Kinetis_Bootloader_2_0_0\bin\Tools\win\KinetisFlashTool) and run KinetisFlashTool

  2. Select USB option which should have settings VID:0x15a2 and PID: 0x0073

  3. In the right Pane, Update / Image File, select the .srec file to be flashed. Look in:

    • thingstream-client-devkit-module-<version>/tracker/out for the default release build

    • thingstream-client-devkit-module-<version>/tracker/Release or Logging or Debug for any customised build

  4. Click Update.

  5. Example successful logging...

    • Start update progress......

    • No device is connected!

    • Try to connect device......

    • Connected to device successfully!

    • Get device security state successfully(UNSECURE).

    • Updating image......

    • Update image successfully!

    • Reset device successfully!

    • Update process is completed.

  6. It is recommended that when the board is power cycled after flashing it should be plugged via USB into the mains or a power source greater than that offered by a laptop / desktop PC USB port.

  7. When the board is re-powered it will power up in application mode and not bootloader mode and the tracker app will run.


Mac

  1. To flash the .srec file to the board requires a USB setting (0x15a2,0x0073) this needs to be confirmed before flashing in order to ensure success

  2. On a Mac, click on the Apple () Menu in the corner of your screen, choose About this Mac then click the System report button.

  3. Select USB under Hardware menu for a list of USB devices and their addresses

  4. Kinetis Bootloader: should display in the list as per screenshot. If this is not the case then unplug the board and repeat step 3.

  5. Select the .srec file to be flashed. Look in:

    • thingstream-client-devkit-module-<version>/tracker/out for the default release build

    • thingstream-client-devkit-module-<version>/tracker/Release or Logging or Debug for any customised build

  6. In terminal Navigate to NXP_Kinetis_Bootloader_2_0_0/bin/Tools/blhost/mac

  7. Issue command ./blhost -u 0x15a2,0x0073 flash-image <path to tracker-<version>.srec> erase

  8. Example successful logging...

    • Inject command 'flash-image'

    • Successful generic response to command 'flash-erase-region'

    • Wrote 36144 bytes to address 0

    • Successful generic response to command 'write-memory'

    • (1/1)100% Completed!

    • Successful generic response to command 'write-memory'

    • Response status = 0 (0x0) Success.

  9. It is recommended that when the board is power cycled after flashing it should be plugged via USB into the mains or a power source greater than that offered by a laptop / desktop PC USB port.

  10. When the board is re-powered it will power up in application mode and not bootloader mode and the tracker app will run.


Ubuntu

  1. To flash the .srec file to the board requires a USB setting (0x15a2,0x0073) this needs to be confirmed before flashing in order to ensure success.

  2. On your ubuntu instance type lsusb

    • this will list the USB devices and will include an entry for 'Freescale Semiconductor, Inc.'

    • (e.g. Bus 003 Device 003: ID 15a2:0073 Freescale Semiconductor, Inc.)

  3. Select USB under Hardware menu for a list of USB devices and their addresses

  4. Select the .srec file to be flashed. Look in:

    • thingstream-client-devkit-module-<version>/tracker/out for the default release build

    • thingstream-client-devkit-module-<version>/tracker/Release or Logging or Debug for any customised build

  5. In terminal Navigate to NXP_Kinetis_Bootloader_2_0_0/bin/Tools/blhost/linux/amd64 or i386 depending on your hardware.

  6. Ensure that the file blhost contained within the folder is executable, if not 'chmod +x blhost'.

    • You may well need to be logged in as su.

  7. Issue command ./blhost -u 0x15a2,0x0073 flash-image <path to tracker-<version>.srec> erase

  8. Example successful logging...

    • Inject command 'flash-image'

    • Successful generic response to command 'flash-erase-region'

    • Wrote 36144 bytes to address 0

    • Successful generic response to command 'write-memory'

    • (1/1)100% Completed!

    • Successful generic response to command 'write-memory'

    • Response status = 0 (0x0) Success.

  9. It is recommended that when the board is power cycled after flashing it should be plugged via USB into the mains or a power source greater than that offered by a laptop / desktop PC USB port.

  10. When the board is re-powered it will power up in application mode and not bootloader mode and the tracker app will run.