USB-KW24D512 MSD Bootloader

Document created by Andrei Kovacs Employee on Oct 10, 2014Last modified by Adrian Puga Candelario on Jan 21, 2020
Version 12Show Document
  • View in full screen mode

This document and the attached files are maintained up to date in collaboration with Dragos Musoiu.


This document is a supplement for USB MSC device bootloader revision for FRDM-KL25Z (IAR) written by Kai Liu and describes the bootloader support for USB-KW24D512.


How to use

1) Connect the USB-KW24D512 to the PC USB port;

2) Download the attached file ‘USB_KW24D512_MSD_Bootloader.bin’ to the flash memory of the MKW24D512 SiP following the next steps:

    • Connect a J-Link programmer to the PC USB port (other than the one used for the USB-KW24D512 dongle);
    • Navigate to your J-Link driver folder using a command console and type ‘jlink.exe’ followed by enter;
    • After the apparition of the J-Link prompter, type ‘unlock kinetis’ followed by enter;
    • Wait for the unlock command confirmation and after, type ‘device mkw24d512xxx5’ followed by enter;
    • After the J-Link prompter appears type ‘loadbin USB_KW24D512_MSD_Bootloader.bin 0’ followed by enter; (Be sure you copied the ‘USB_KW24D512_MSD_Bootloader.bin’ file in the same directory with jlink.exe otherwise, type the command specifying the full path of the binary file);
    • After the flashing process successfully finished type ‘exit’ followed by enter.

3) Reset or reconnect the USB-KW24D512;

4) The OS will prompt MSD device connecting and then BOOTLOADER drive will appear. The bootloader software was tested on Microsoft Windows 10, Microsoft Windows 8.1, Microsoft Windows 7, Ubuntu 14.04 and MAC operating systems.

5) Copy and paste any user application .SREC or .bin file into BOOTLOADER drive;

6) If a valid .SREC or .bin file was given, the board restarts and starts to run the user application. Please refer to the Notes section in order to create valid .SREC or .bin files.




           The bootloader has conditional jump to user application. The condition is the state of the SW1 button (PTC4). If the button is pressed (PTC4 grounded) during reset, the bootloader sequence will start, installing BOOTLOADER drive, as described before. Else if the button is released during reset, the SP and PC will be updated from address 0xC000. This means, the user application has to use a linker file which forces the application start address to 0xC000. If a valid SP and PC value is found at address 0xC000, the user application is launched.

  • The bootloader application is located in the flash memory of the MKW24D512 SiP, from address 0x0000 to 0xBFFF, so the user application should not put any code in this memory region. Avoid using .SREC or .bin files having program bytes or fill patterns in the bootloader section.


Attached files:

  • USB_KW24D512_MSD_Bootloader.bin – bootloader binary file for USB-KW24D512;
  • Pflash_512KB_0xC000.icf – IAR linker file for user application development;
  • 802.15.4SnifferOnUSB.bin – user application demo binary file for KW24D512-USB. Be aware that the file ‘802.15.4SnifferOnUSB.srec’ is linked according to the above memory restrictions and is working only with the bootloader presented in this document.
1 person found this helpful