Skip to content

Instantly share code, notes, and snippets.

@lonesometraveler
Last active April 16, 2020 13:36
Show Gist options
  • Save lonesometraveler/ff21f8f483877a69931684c75a4983a9 to your computer and use it in GitHub Desktop.
Save lonesometraveler/ff21f8f483877a69931684c75a4983a9 to your computer and use it in GitHub Desktop.
[Mbed] How to solve a conflict between Ethernet and UART3 on K64

Mbed EthernetInterface and UART3 conflict on K64F

Due to a clock config conflict, the default config does not allow Ethernet and UART3 to be used at the same. See this thread.

A workaround for Mbed projects is to disable PORTC clock in mbed-os/features/netsocket/emac-drivers/TARGET_Freescale_EMAC/TARGET_K64F/hardware_init_MK64F12.c.

// CLOCK_EnableClock(kCLOCK_PortC);             // commented
CLOCK_EnableClock(kCLOCK_PortB);
/* Affects PORTC_PCR16 register */
// PORT_SetPinMux(PORTC, 16u, kPORT_MuxAlt4);   // commented
/* Affects PORTC_PCR17 register */
// PORT_SetPinMux(PORTC, 17u, kPORT_MuxAlt4);   // commented
/* Affects PORTC_PCR18 register */
// PORT_SetPinMux(PORTC, 18u, kPORT_MuxAlt4);   // commented
/* Affects PORTC_PCR19 register */
// PORT_SetPinMux(PORTC, 19u, kPORT_MuxAlt4);   // commented
/* Affects PORTB_PCR1 register */
PORT_SetPinMux(PORTB, 1u, kPORT_MuxAlt4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment