AnsweredAssumed Answered

How to proprely remap peripherals in MQX4.1 BSP for K60?

Question asked by Angelo Quattrociocchi on Sep 27, 2014
Latest reply on Oct 3, 2014 by David E Seymour

I am trying to remap a UART port to different pins on a K60 custom board running MQX4.1 and the TWRK60F120M BSP. The BSP uses UART0 RX/TX on pins PTA1 and PTA2, but I have pins PTA15 and PTA14 wired for UART0. The UART is enabled in the user_config.h file and I modified the _bsp_serial_io_init function in the init_gpio.c file, changing these lines for the UART0 case (changing only the bit numbers to 15 and 14):

  pctl->PCR[15] = 0 | PORT_PCR_MUX(2) | PORT_PCR_DSE_MASK;

  pctl->PCR[14] = 0 | PORT_PCR_MUX(2) | PORT_PCR_DSE_MASK;

 

...but this doesn't work. If I leave the original PCR settings and wire the RX input to PTA1, it works OK, so I'm not sure why changing to the other pins is not working. When I use the above PCR settings it doesn't read the UART on either RX pin (PTA1 or PTA15). I was testing only RX so far.

 

Since PTA14 and PTA15 are also used by the ENET, I disabled all the ENET options, setting RTCSCFG_ENABLE_IP4, RTCSCFG_ENABLE_UDP, RTCSCFG_ENABLE_TCP, RTCSCFG_ENABLE_STATS, RTCSCFG_ENABLE_GATEWAYS, RTCSCFG_ENABLE_LWDNS, and RTCSCFG_ENABLE_ICMP to 0 in user_config.h. This didn't help.  (BTW, is there a better/easier way to simply disable all RTCS features?)

 

I also have it printing out the state of the PCR registers for both pins to confirm it was set correctly by _bsp_serial_io_init and wasn't subsequently changed.  The PCR registers for both PTA14 and PTA15 read 0x240, as I believe they should be.

 

I tried the same things on an actual tower board and had the same results so I don't think there is a hardware issue.

 

Is there some other step I'm missing to remap that UART port?

Outcomes