Embedded Signal Processing

targeted to PC systems "Improvised" FRDM-K64F Eclipse/Platformio Setup 


Note: the preferred setup is FRDM-K64F KDS (Kinetis Design Studio) , rather than the homebrew setup described below.

This page describes setup of  setting up an improvised FRDM-K64F Eclipse/Platformio setup .

The following instructions are particularly targeted to PC systems, and may need to be adjusted for other machines/platforms.

Thanks to Ben R. for editing/adapting these PC instructions from the Mac instructions!

Improvised FRDM-K64F Eclipse/Platformio Setup and Software Installation (Changes from MAC to PC are shown in Green )

platform = freescalekinetis
framework = mbed
board = frdm_k64f
targets = upload
src_build_flags = -Wall -g -no-integrated-cpp -save-temps -fverbose-asm   -Wa,-aghlmns=assembly.s 

#include "mbed.h"
DigitalOut myled(LED1);
int main() {
    while(1) {
        myled = 1;
        myled = 0;

                Website explaining procedure of building and importing PlatformIO projects into eclipse...

Windows commands
pip install Cython
pip install --pre -U pyocd

  pyocd-gdbserver --help
  pyocd-gdbserver -l

tpwmac12:local tpw$ pyocd-gdbserver  -l
INFO:root:new board id detected: 02400221AA524E54578CB3EC
0 => MBED MBED CMSIS-DAP (0xd28, 0x204) [k64f] boardId => 02400221AA

In terminal window 1
    run the command "pyocd-gdbserver" to obtain this session
    tpwmac12:~ tpw$ pyocd-gdbserver
    INFO:root:new board id detected: 02400221AA524E54578CB3EC
    INFO:root:board allows 5 concurrent packets
    INFO:root:DAP SWD MODE initialised
    INFO:root:IDCODE: 0x2BA01477
    INFO:root:K64F not in secure state
    INFO:root:6 hardware breakpoints, 4 literal comparators
    INFO:root:CPU core is Cortex-M4
    INFO:root:FPU present
    INFO:root:4 hardware watchpoints
    INFO:root:GDB server started at port:3333
    INFO:root:One client connected!
    [====================] 100%
  <--*NOTE* You will not see the lines denoted in RED when you first run the command it will say "none" and wait for the other terminal...

 In terminal window 2
run arm-none-eabi-gdb on your compiled elf file for your project as follows

Windows user will need to recall or search for where the ".platformio" directory is stored on their PC and use the following command (sometimes it happens to be in a directory called "SPB_Data" but your directory location may be different).

C:\SPB_Data\.platformio\packages\toolchain-gccarmnoneeabi\bin\arm-none-eabi-gdb "C:\Users\USERNAME\Desktop\blink_pe\.pioenvs\frdm_k64f\firmware.elf"

If you cannot find the directory for the “arm-none-eabi-gdb” simply download and extract it from here:


This is the command as it would appear on a MAC:    tpwmac12:~ tpw$ ~/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gdb /Users/tpwece/Documents/00_platformioEclipseProjects/blink_pe/.pioenvs/frdm_k64f/firmware.elf
    GNU gdb (GNU Tools for ARM Embedded Processors)
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
    For bug reporting instructions, please see:
    Reading symbols from /Users/tpw/tp_frdm_blink_3.elf...done.
    (gdb) target remote localhost:3333 <-- This is the command that you will run
    Remote debugging using localhost:3333
    0x00000eb2 in wait_us ()
    (gdb) load <-- This is the command that you will run
    Loading section .isr_vector, size 0x1f0 lma 0x0
    Loading section .flash_protect, size 0x10 lma 0x400
    Loading section .text, size 0x8548 lma 0x410
    Loading section .ARM.exidx, size 0x8 lma 0x8958
    Loading section .data, size 0x8b4 lma 0x8960
    Start address 0x198, load size 36868
    Transfer rate: 14 KB/sec, 1602 bytes/write.
       (gdb) quit <-- This is the command that you will run


 If you received this message: “Error: Program “platformio” not found in PATH”, then you need to update Eclipse $PATH variable. In Eclipse IDE make right click on the created project (“Project Explorer“) : “Properties → C/C++ Build → Environment → PATH → Edit” and set to /usr/local/bin:/bin:/usr/bin:/usr/sbin:/sbin .

If all goes well, you should see a successful IDE debug environment like the following: