Arm Mbed and Pelion Device Management support forum

How to upload .bin filegenerated by Mbed online compiler to K64FN custom board

Hello, I am new to Mbed OS. I have created new project in Mbed online compiler for FRDM K64FN development board and also successfully flashed the .bin file generated to the board. It is working fine now.
My problem is that I have to flash the same .bin file to the custom board which has the same K64FN controller. The custom board has Segger J-link connector.

My question is, can we flash the .bin file generated by Mbed compiler to the custom board using J-link lite debugger. If yes then what is the process.

Any help is appreciated.
Thank you.

You need a J-Link debug probe and JLink Commander.
https://shop-us.segger.com/J_Link_p/8.08.00.htm
https://www.segger.com/products/debug-probes/j-link/tools/j-link-commander/

Connect a debug probe to your board and run JLink Commander. Refer to this page:
https://www.segger.com/products/debug-probes/j-link/technology/flash-download/

If you are on Windows PC, there is a GUI app called J-Flash LITE. I am on Mac and use command line tools.

Hi, I have the j-link lite probe and also the j-Flash lite GUI app. I have tried to flash the .bin file using that app .
I got the message as shown in image.

Your device is protected as it says. If you are okay with erasing everything on the chip, you can try unsecuring.

Yes. I tried erasing it and flashed the .bin file but program did not run after power up.

Maybe your clock setting is not correct? Does your custom board have the same external crystal as the dev kit?

Yes, It may be the case. My dev board have 50 MHz external clock source and on custom board , I have used 12 MHz external crystal. How to do the clock setting in Mbed online compiler.

Could you please help me to set the clock using external crystal.

Thank you,

system_MK64F.h has this definition.

#define CPU_XTAL_CLK_HZ                50000000u /* Value of the external crystal or oscillator clock frequency in Hz */

I am not sure if you can modify this with online compiler. (I don’t use online compiler.)

I suggest posting a separate question as this thread is no longer about how to upload .bin with Jlink.

Thanks for the information. I will export the mbed project in KDS or in eclipse and then try to upload the .bin file to the custom board.

Thank you again for the help.

Kirti

Yes , I will post a separate question for setting the clock for custom board