Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
3 years, 2 months ago.
Programming bare bones MK64 with mbed binary ...
Has anyone out there managed to program their own custom PCB (with K64 processor) using an mbed .bin file created for a FRDMK64F? We are having no end of issues with this ...
I have a custom board with a bare NXP MK64 processor on it. To test it, I took blinky code from Keil, compiled it as a .hex, and loaded it using JTAG. Which worked a treat on the PCB.
I then tried an Adafruit CMSIS-DAP JTAG/SWD debug adapter kit. This was pretty old and although I could flash the MK64 with .hex files using it, it didn't work with the mbed binary. I think this is due to needing some sort of flash algorithm specifically for the MK64 which, since the board is old and no longer supported, I couldn't find. Oh well ...
What I then tried was using the bootloader on a FRDMK64F board to try to program the bare processor using the SWD connections in the FRDMK64F schematic. I've seen people do this for other FRDM boards in the forums. I broke the track as other people have done to isolate the MCU from the MK20 bootloader, did that on two boards, then managed to get the bootloader on one board to program the MCU on another. Which worked for both mbed .bin and .hex files. But making the same connections to the bare bones processor failed to program it. The only explanation I have is that some supporting lines (power, reset, or the UART?) which are connected on the FRDM boards (even after isolation of the SWD clock) aren't on my board so I'm checking that.
A friend gave me the loan of a Segger flasher, which seemingly supports the MK64 family of processors and binary files. After some issues with security bits and having to wipe the processor, I could happily transfer .hex files. But, try as I might, it won't flash with the mbed binary. I'm experimenting with the offset (seems to be either 0x0 or 0x5000 on most processors) but still can't get the darned thing to wake up. At this point I'm trying now to convert the .bin to a .hex file using bin2hex or hexplorer, but so far, no luck. And sending off a PCB with a copy of the MK20 bootloader from the FRDMK64F schematics as another solution.
Can anyone out there offer some tips? This shouldn't be this complicated ...
3 years, 2 months ago.
A .hex file will have some header on it so that the flash algorithm can check and flash it. However, for a binary file, the flash algorithm will look for a correct vector table. If it does not detect a correct vector table, it will throw an error. So can you double check that your binary file has the correct vector table and make sure that you have the latest flash algorithm for the K64F? You can check and find the latest flash driver here: https://armmbed.github.io/DAPLink/
Please let me know if you have any questions!
- Peter, team Mbed
If this solved your question, please make sure to click the "Thanks" link below!