8 years ago.

Using SDA with GCC compiled program

I am trying to use the SDA interface to load a program I compiled in code warrior using GCC. Is there any special settings I need? Should I expect this to just work? I don't see it loading my code. I drop the .bin to the MBED drive on my computer and the device resets itself with node code loaded. I checked it with my JLink and the device is not programmed. This code works just fine when I load it with my JLink.

Any suggestions?

Question relating to:

The Freedom-K64F is an ultra-low-cost development platform for Kinetis K64, K63, and K24 MCUs.

What's the question? If you are using codewarrior, you can flash it via IDE. You don't need to drop a bin. How did you figure it's not programmed? did you compare flash regions?

posted by Martin Kojtal 19 Apr 2016

For your convenience I notated all questions with a '?'

I wasn't using objcopy correctly. I thought I was building a bin but I was actually building an s19. Too much copy paste. It works now.

posted by Ryan Lush 19 Apr 2016

2 Answers

8 years ago.

Have you hit the Reset button after flashing? K64F is notorious for needing that every now and then. Other than flashing via SDA port should work fine, I'm doing it all the time.

8 years ago.

Hi Ryan

As asked by Martin, what are you trying to achieve exactly?

OPTION 1: Use the OpenSDA Adapter in MSD Flash programming mode to program the K64F flash with a precompiled *.bin file? ANSWER 1: Just drag'n drop the precompiled binary into the mbed drive from your file explorer, as explained by Jan, then hit the reset/SW1 button to restart your board to run the new program. It works pretty well on my board using original *.bin file format (not Intel *.hex or Motorola *.srec).

OPTION 2: Use the OpenSDA Adapter in Debugger mode to debug a program from an ARM IDE toolchain (Keil, IAR, CodeWarrior, KDS...)? ANSWER 2: Before launching the debug session, go to your Project Options/Parameters and select the debug interface CMSIS-DAP, then hit the debug button and the Compiler will program the flash of the K64F device.

You can find additional applications for your board, especially Debugger Applications, following this link: www.nxp.com/openSDA.

1. Start your board in Bootloader mode keeping reset button pressed, while connecting the USB cable to the SDA USB port and release it after 1s. 2. If you have not installed already an ARM IDE toolchain, download and Install the corresponding drivers for the Application that you have selected:

[Pemicro Multilink drivers ] http://www.pemicro.com/opensda/ [Segger JLink drivers] https://www.segger.com/opensda.html [ARM CMSIS-DAP serial drivers] https://developer.mbed.org/handbook/Windows-serial-configuration

3. Drag'n drop or copy and paste the OpenSDA Application binary file into the BOOTLOADER drive from your computer file explorer 4. Un-plug and re-plug the USB cable from the SDA USB port WITHOUT keeping reset button pressed. 5. Let your system detect the new OpenSDA interface (check the category COM_Port, USB_Controller and Jungo from your computer Device Manager to ensure that new devices have been properly detected and their driver correctly installed by your computer OS)

NOW Select the right debug adapter (Pemicro OpenSDA, Segger JLink or CMSIS-DAP) in your project parameters

Please let us know if it works for you Greg

I was trying to used the MSD programming mode to load firmware into the K64 Freedom board.

As I stated above, I was not using objcopy correctly. I was compiling an s19 instead of a bin so the process described above did nothing.

posted by Ryan Lush 19 Apr 2016