10 years ago.

Custom board based on K22F does not work with mbed created .bin

I made a custom PCB based on FRDM-K22F platform. It has a JTAG/SWO interface. I programmed a simple program with KDS and use Segger to program the board and it worked fine. But when I want to use the .bin created by mbed to program my board, it does not function. The Segger verify programming to be done correctly. But even I cannot turn on and off a LED.

Has anybody encounter such problem? Any answer would be appreciated.

how do you flash that binary? Using jlink command line?

posted by Martin Kojtal 01 Dec 2014

What clock source are you using?

posted by Erik - 01 Dec 2014

I use J-flash with the setting for the proper MCU. For both cases (custom board and FRDM-K22F) I use internal clock. Custom board works fine with Processor expert-based code but not with the bin file from mbed. I even exported the mbed project as GNU and compiled it with GNU toolchain. The flashing was done correct but it is not working.

posted by Kasra Haghighi 01 Dec 2014

I even cut the J7 jumper on FRDM-K22F and flashed the custom board by connecting the J11 to the custom board JTAG port. And I verified it with the J-flash if it is flashed correctly. It still does not work. The program is super simple:

  1. include "mbed.h"

DigitalOut myled(PTC11);PTC11

int main() { while(1) { myled = 1; wait(0.5); myled = 0; wait(0.5); } }

posted by Kasra Haghighi 01 Dec 2014

When you say you use internal clock: Are you using a modified mbed-src?

posted by Erik - 01 Dec 2014

I really didn't do anything about changing the clock source. However, I added the external crystal in case needed. I used standard mbed libraries not the mbed-src. Does it matter?

posted by Kasra Haghighi 01 Dec 2014

The mbed lib uses an external crystal, in mbed-src you can modify it, but if it hasn't the correct crystal it won't run.

posted by Erik - 01 Dec 2014

I have done this for other K's with no problem (not tried this one yet), are you sure your hardware is correct? Check ALL the power supply pins are connected and you decouple these with capacitors around the chip.

posted by Paul Staron 01 Dec 2014

Could you please let me know how to change the clock source to internal in mbed-src library. My PCB is working fine. I tried it with the KDS and ProcessorExpert libraries.

posted by Kasra Haghighi 01 Dec 2014

I changed the mbed libraries to use internal clock source. This change works fine on FRDM board but not my custom board. Any comments on it is appreciated.

In my custom board I don't have the second small MCU used for openSDA since I am doing the programming through JTAG. Does that MCU have any other functions beside programming main MCU?

posted by Kasra Haghighi 03 Dec 2014

This bootloading library might help: http://developer.mbed.org/users/Sissors/code/Bootloader_K64F/

posted by -deleted- 15 Apr 2015

2 Answers

9 years, 8 months ago.

Paul I have the same problem. I am using a MK22FN512VLH12 with and external oscillator and it does not run. Since I had no luck with mbed I tried tried with processor expert and KDS2.0.0 and if I use internal clock it works OK. but if I use external crystal no luck :-(

I have used a 8Mhz cristal .as well as the 32kHz for the RTC with the capacitors and resistors specified in the user guide. (FRDMK22UG.pdf)

Can you share your design and component used to make it work ?

Thanks for your help.

10 years ago.

Which MCU do you have on your custom board? If its not a MK22FN512VLH12 it may not work. The MK22FN1M0VLH12 for instance has extra memory but also has extra embedded parts so the interrupt vectors will probably be different and will not flash the LED if you try your above code.

I assembled my custom board with both 1M0 and 512. Neither works. I am aware of major differences between 1M0 and 512.

posted by Kasra Haghighi 01 Dec 2014

Have you got this working yet? I have made two custom boards that are working with standard 8MHz crystal set up programmed via the FRDM board.

posted by Paul Staron 02 Feb 2015

Any results? I'm doing the exact same thing, except with the MK22FN512VLL12.

posted by George Chen 18 Feb 2016

The mbed FRDM board will only program the MK22FN512VLH12 chip. If you try a different variant of the same chip, the interface MCU will check if it is the same, if different it will not program your chip. I have used the FRDM board to program my own design boards using the same MCU and works fine.

posted by Paul Staron 18 Feb 2016