I am using iMX6Q UART with a RTOS. I started to notice a problem on the RX line and after some investigation I built a test code to be loaded with the JTAG or USB.
The test code initializes the UART1 at pin SD3_DATA6 (E13) as ALT1 and pin SD3_DATA7 (F13) as ALT1
When I transmit some data I can see the electrical signal in the RX pin like the TX and RX line were connected together in a short circuit. I removed the HW peripheral circuit so my reading is at the pad level without anything connected, not even pull-ups or protection diodes. The TX and RX pins are not shorted together, when device is powered off I measure >10Mohms.
Originally the defect when connected to a peripheral was showing collision (I mean the signal is visibly corrupted) on RX pin only, but not on TX pin, so the pin is driven separately by iMX6 on both pins.
I decided to change the RX configuration to GPIO (ALT5) and I still see the signal . So at this point I thought the iMX6 could be damaged and I tried the test on another devices, all of them have the same problem even devices never powered up before and that were never running defective software drivers that could have damaged the HW.
At this point I tried to play a bit with the UART1 and IOMUX. I read the manual and checked all the bits, especially the DTE / DCE modes and loopback modes, but I couldn't make the RX pin to work as input only. I checked on internet and errata sheets and I got no matching problems.
Since it looks like I am the only one having this problem I decided I need help as I am definitely missing something.
Here is the code:
it requires regsiomuxc.h regsccm.h regsgpio.h from the SDK
#define UART1 0x02020000
#define URXD *((volatile uint32_t*)(((uint32_t)UART1) + 0x00)) // Receiver Register
#define UTXD *((volatile uint32_t*)(((uint32_t)UART1) + 0x40)) // Transmitter Register
#define UCR1 *((volatile uint32_t*)(((uint32_t)UART1) + 0x80)) // Control Register 1
#define UCR2 *((volatile uint32_t*)(((uint32_t)UART1) + 0x84)) // Control Register 2
#define UCR3 *((volatile uint32_t*)(((uint32_t)UART1) + 0x88)) // Control Register 3
#define UCR4 *((volatile uint32_t*)(((uint32_t)UART1) + 0x8c)) // Control Register 4
#define UFCR *((volatile uint32_t*)(((uint32_t)UART1) + 0x90)) // FIFO Control Register
#define USR1 *((volatile uint32_t*)(((uint32_t)UART1) + 0x94)) // Status Register 1
#define USR2 *((volatile uint32_t*)(((uint32_t)UART1) + 0x98)) // Status Register 2
#define UESC *((volatile uint32_t*)(((uint32_t)UART1) + 0x9c)) // Escape Character Register
#define UTIM *((volatile uint32_t*)(((uint32_t)UART1) + 0xa0)) // Escape Timer Register
#define UBIR *((volatile uint32_t*)(((uint32_t)UART1) + 0xa4)) // BRM Incremental Register
#define UBMR *((volatile uint32_t*)(((uint32_t)UART1) + 0xa8)) // BRM Modulator Register
#define UBRC *((volatile uint32_t*)(((uint32_t)UART1) + 0xac)) // Baud Rate Count Register
#define ONEMS *((volatile uint32_t*)(((uint32_t)UART1) + 0xb0)) // One Millisecond register
#define UTS *((volatile uint32_t*)(((uint32_t)UART1) + 0xb4)) // UART Test Register on all other i.mx
HW_CCM_CCGR5_WR(0xF0033F0F | 0x0F000000 );
UCR1 = 0x00000000; // power off UART
// Config pad SD3_DATA6(E13)
BF_IOMUXC_SW_MUX_CTL_PAD_SD3_DATA6_SION_V(DISABLED) | //tried both enabled disable, it does not change
BF_IOMUXC_SW_MUX_CTL_PAD_SD3_DATA6_MUX_MODE_V(ALT1)); //if I set to ALT5-input the RX is still being driven by TX driver
// Config pad SD3_DATA7(F13)
BF_IOMUXC_UART1_UART_RX_DATA_SELECT_INPUT_DAISY_V(SD3_DATA6_ALT1)); // tried to change this bit in many ways, but still no luck
// tried to play with uart registers, everything looks right to me
UCR2 = 0x00004027;
UCR3 = 0x00000784;
UCR4 = 0x00008000;
UESC = 0x0000002B;
UTIM = 0x00000000;
UTS = 0x00000000;
UFCR = 0x00000001 | (4<<7);
UBIR = 12 - 1;
UBMR = 625 - 1;
ONEMS = 16000000/(2 * 1000);
UCR1 = 0x00000001;
while (UTS & (1<<4)); UTXD = (0x5A); // here i see the same signal on both TX and RX
Thank you for your help and suggestions!