While i was trying to get function the GainSpain Wifi Module using UART connection, I've discovered a bug in the TWRK60 BSP.
The problem is in the function _bsp_serial_io_init ( in source code file : mqx\source\bsp\twrk60n512\init_gpio.c ) .
At line 136, you can find the UART 4 pin mux initializing :
pctl = (PORT_MemMapPtr)PORTC_BASE_PTR;
/* PTC14 as RX function (Alt.3) + drive strength */
pctl->PCR[14] = 0 | PORT_PCR_MUX(3) | PORT_PCR_DSE_MASK;
/* PTC15 as TX function (Alt.3) + drive strength */
pctl->PCR[15] = 0 | PORT_PCR_MUX(3) | PORT_PCR_DSE_MASK;
The problem is UART4 is not mapped on PTC14 - PTC15 I/O pin but instead on PTE24 - PTE25 .
So the RIGHT code is the following :
pctl = (PORT_MemMapPtr)PORTE_BASE_PTR;
/* PTE24 as TX function (Alt.3) + drive strength */
pctl->PCR[24] = 0 | PORT_PCR_MUX(3) | PORT_PCR_DSE_MASK;
/* PTE25 as RX function (Alt.3) + drive strength */
pctl->PCR[25] = 0 | PORT_PCR_MUX(3) | PORT_PCR_DSE_MASK;
Solved! Go to Solution.
Thanks Luca,
we have already discovered this bug and it will be fixed in MQX 3.8
Thank you for identifiying this bug. I had been wondering why UART4 Tx is not giving any output on PTE24 pin. Well is there any kind of documenation on how to tweek or modify these mqx internal settings to make it work with custom boards too.
Thanks for this heads up
Only took me 2 days of goofing around trying to enable use of UART4 on my TWRK60N512 for an FTDI USB to 3.3v cable before I happened to shake the correct Google rune-stones to find this
Thanks Luca,
we have already discovered this bug and it will be fixed in MQX 3.8