Making K64F pin D8 functional in mbed

Freescale has released several versions of FRDM-K64F. All of the revisions have been minor except for Revision E, the most recent version.

In previous revisions of the board, pin D8 on the K64F (J2.2) was routed to pin PTA0 on the K64 processor. Unfortunately, PTA0 is used for JTAG & SWD debugging.

So, if a user tries to write to D8/PTA0 while also debugging over SWD or JTAG on a Rev D board, the processor would hard fault. This has been fixed in Rev E, where PTC12 is now routed to D8, as can be seen in the Revisions & Change Log on the schematic).

However, the mbed framework still has PTA0 routed to D8.

To use D8 with mbed on a Rev E board, mbed must be built locally. I have a brief write up of building mbed locally with a focus on Freescale's Kinetis Design Studio.

Modifying Line 221 of

 libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/TARGET_FRDM/PinNames.h`  

to

D8 = PTC12,

is all that is needed to make D8 functional. This line functionally says route the K64 processor pin PTC12 to the Arduino header pin D8.

Important: Currently the on-line IDE for mbed does not provide access to D8 on Rev E FRDM-K64 boards. See the issue on Github for more information

To figure out what revision of the K64F you have, flip the board over and look for the revision sticker. The schematic revision number is the Rev version in line with 'SCH' - this board is Rev E.


Was this information useful? Consider using my Amazon Affilliate URL as a way of saying thanks. I'll receive a small portion of your purchases made within the next 24 hours.