Embedded Signal Processing

Apple/Mac OsX Yosemite "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 improvided FRDM-K64F Eclipse/Platformio setup .

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

Improvised FRDM-K64F Eclipse/Platformio Setup and Software Installation

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;

sudo -H pip install Cython
sudo -H 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 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%

 In terminal window 2
run arm-none-eabi-gdb on your compiled elf file for your projectas follows
    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
    Remote debugging using localhost:3333
    0x00000eb2 in wait_us ()
    (gdb) load
    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


 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: