How to flash code freedom board (FRDM KL25Z) on linux platform

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to flash code freedom board (FRDM KL25Z) on linux platform

5,152 Views
manish2789
Contributor I

Hello all,

                  I am Manish .I have been working on open-source Embedded technologies on Linux platform since 2 years.Now  I have just started to learn about free scale freedom board .But I'm not able to flash (Load) same code take from this community using OpenSDA. Fllowing thing I have done successfully

1.I have installed Drivers of OpenSDA and verified for ttyACM0 port .

2.Went through Boot-loader mode of OpenSDA and found  "/media/BOOTLOADER" directory on Linux platform .

3.Compiled sample code given on this community and tried to copy main.srec to  "/media/BOOTLOADER"

  But expected output not got.

 

so please guide me

1.How to flash code freedom board (FRDM KL25Z) .

2.How to set  Debug Environment and how to debug

3.Is any utilities for flashing and Debugging available..?

 

Regards

Manish

Original Attachment has been moved to: link.ld.zip

Tags (3)
0 Kudos
3 Replies

2,150 Views
stejfish
Contributor I

I have not been able to flash my new FRDM-K64F freedom board using the flash command within the Eclipse-based KDS IDE, but I am able to download a .bin executable by dragging the file into the MBED folder which automatically appears when the freedom board is connected.

In the KDS IDE, the application is originally compiled to a .elf, but it is possible to convert it to a .bin using the following command:

arm-none-eabi-objcopy -S -O binary HelloWorld.elf HelloWorld.bin

I am using Fedora 20. When the freedom board is connected, a directory appears at the following location:

/run/media/stephen/MBED

In the project settings, under C/C++ Build, Settings, Build Steps, Post-build steps, I add to the Command field found here the command above, along with a command to copy the .bin file to the freedom board:

arm-none-eabi-objcopy -S -O binary HelloWorld.elf HelloWorld.bin; cp HelloWorld.bin /run/media/stephen/MBED

Now when I compile the project, the .elf is automatically converted to a .bin, and copied to the freedom board. I have noticed that each time there is a download, it causes the MBED connection to disconnect, and then reconnect a few seconds later. Once reconnected, I can push the reset button on the freedom board, and my application runs. My simple application is able to communicate over the virtual serial port /dev/ttyACM0 that is created when the freedom board is connected, so I know this also works. On the linux PC side, I use CuteCom as the terminal emulator to send commands and data to the Kinetis K64 MCU.

I have found that it is not possible to start OpenOCD locally within the IDE to debug the application. I must start the openocd executable from the command line outside of the IDE with su privileges to get it to start. Also, when I ran openocd from the command line the first time, there was an error message that the library libudev.so.0 could not be found since this library does not exist on my linux installation. I had to create a symbolic link to libudev.so.1 with the following:

su -c'ln -s libudev.so.1 libudev.so.0'

This may be necessary only on Fedora linux.

Although I can get opencd to start from the command line, when I go back to the KDS IDE and try to start a debug session, I am still seeing errors, so there are still some issues I have to figure out to debug the application.

Hope this helps,

Stephen

One other thing - see this link below before programming your board using the .bin files. Apparently, it is possible to brick the freedom board using this type of file.

Binary Files for the mbed Bootloader with Eclipse and GNU ARM Eclipse Plugins | MCU on Eclipse

0 Kudos

2,150 Views
manish2789
Contributor I

Thanks to all, your responses really helpful But I have few doubts.

1.I have copied  MSD-FRDM-KL26Z_Pemicro_v112.SDA file to "/media/BOOTLOADER" and then again repower device but till me not getting MBED folder which automatically appears when the freedom board is connected.

2.I have checked /run/media but nothing was there.

3.so how should i load code on freedoboard FRDM KL25Z..?

    please guide me related to that.

0 Kudos

2,150 Views
Wlodek_D_
Senior Contributor II

Hello,

Thank you for your post, however please consider moving it to the right community place (e.g. Kinetis Microcontrollers ) to get it visible for active members.

For details please see general advice Where to post a Discussion?

Thank you for using Freescale Community.

0 Kudos