Arm Mbed OS support forum

Programming KL25Z from USB Host

Hello to all,

I have done some research on the forum but I haven’t found an appropriate answer!
I am working on the FRDM-KL25Z platform, and for my future project, I will only work with the MKL25Z128VLK4 chip. I saw that with a KL25Z platform you can program (debug) an external chip from the SWD connector. I’m going to prepare a PCB that will act as a programming board.

My problem is the following: On my future board which will include the MKL25Z128VLK4 chip, an 8 Mhz quartz, decoupling and a usb connector. I would like to update the program from the USB connector connected directly to the chip (like the current usb host). I don’t want to go through the open SDA! The goal is to put the binary file via the usb and have the chip pick it up at boot time. I saw searching on the forum that on other platform it was possible here: Programming the lpc11u24 directly (no mbed) | Mbed
But I can’t find any info on my platform…

Is there anyone who has already done this?
Is there anyone who can help me to do this kind of manipulation?

Thank you in advance for your help, Sincerely Antoine.


I am not experienced with it, so I share only a very basic theory.
Mbed provides USBMSD with few BlockDevice APIs and Flash IAP, you can try to use them with a custom bootloader. I think that can help you to achieve what do you want, but those all APIs must be supported under Mbed on your target platform.

BR, Jan

1 Like


Thanks for the answer, and how do you create a new bootloader?

Thanks You

I did only a test program because I was interested how it works.
If I remember correctly I did it with Mbed Studio and I followed documentation what I shared above and also example below (are obsolete for now).

Bootloader - example
Appliaction with bootloader - example

If I will have a time I will check my test program if it still working and I will share it, later.
I did it on Nucleo-F429ZI, so how I already wrote, It depends if all these features are available for your target.

BR, Jan