USB-KW24D512 MSD Bootloader

Showing results for 
Search instead for 
Did you mean: 

USB-KW24D512 MSD Bootloader

No ratings

USB-KW24D512 MSD Bootloader

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.
Labels (4)

Hello! Nice work on the bootloader! Could you post a patch with the changes you did on the original bootloader? I'm trying to port the official Kinetis Bootloader but keep running in issues with the USB stack...

This code and document are based on the AN4379 Freescale USB Mass Storage Device Bootloader and are not based on the Kinetis Bootloader which manages the files and board different.

hello, how i can download ‘USB_KW24D512_MSD_Bootloader.srec’ to the flash memory of the KW24D512???Is there any tool for this?


You'll need a JTAG programmer, like the Bus Blaster or the Universal Multilink.

ok i have a JTAG programmer, but what software can i use for download firmware to KW24D512? because with IAR i don`t know and Test Tool 12 i have a problem for download firmware to board, i get the following error : Error: Could not communicate with J-Link.Closing connection

and I don`t know how solve it.


IAR can be used to flash a SREC. Just perform a debug with "Attach to running target" option. Once the debug session is active and the target is stopped, select "Debug->Memory->Restore...". In the next dialog, just select the .SREC file to flash it into memory.

Why I can't open the document USB MSC device bootloader revision for FRDM-KL25Z (IAR)?

Can you share its source code? I want to used it to K22F25612 and K22F51212. And I also want to get the peripheral memory map for MK22F25612 and MK22F51212. I have saw them in KSDK.  But I don't think I can use them in this application.

I have downloaded the project USB MSD device bootloader revision for FRDM-K64F (IAR).

The condition is the state of the SW1 button (PTA4). If the button is pressed (PTA4 grounded) during reset, the bootloader sequence will start

In the USB-KW2X Hardware reference manual, the SW1 is connected to the PTC4 Pin. It is an error or do i have to make a custom design?

I have already downloaded the file "USB_KW24D512_MSD_Bootloader.srec" and i see the Bootloader drive on my computer, but when i try to copy the 802.15.4SnifferOnUSB.srec file, the device reboots itself and i cannot copy the srec, even pressing the SW1 at reset.

Thank you.

Where is link to download "USB_KW24D512_MSD_Bootloader.bin"?  I only see link to download three files on this page:, and

whether could supply source code?

Version history
Revision #:
1 of 1
Last update:
‎10-10-2014 04:58 AM
Updated by: