Other Parts Discussed in Thread: SYSBIOS
Hi,
Im using multiple UARTs on an AM335x, SYSBIOS based project and UART4 appears to be unable to read the incoming data.
The following code is executed in a loop to poll and test the UARTs.
while(1)
{
// text printing test
UART4PutText("Text printing: ");
//
// //char printing text
UART4PutChar('B');
UART4PutChar('B');
UART4PutChar('B');
UART4PutChar('\n');
if( UARTCharsAvail(SOC_UART_4_REGS) > 0){
System_printf("Uart4: ");
while( UARTCharsAvail(SOC_UART_4_REGS) > 0){
System_printf("%d ", UARTCharGet(SOC_UART_4_REGS));
}
System_printf("\n");
System_flush();
}
if( UARTCharsAvail(SOC_UART_2_REGS) > 0){
System_printf("Uart2: ");
while( UARTCharsAvail(SOC_UART_2_REGS) > 0){
System_printf("%02x ", UARTCharGet(SOC_UART_2_REGS));
}
System_printf("\n");
System_flush();
}
Task_sleep(250);
}
This code refers to functions:
void UART4PutChar(Char txChar) {
UARTCharPut(SOC_UART_4_REGS, txChar);
}
void UART4PutText(Char *text)
{
while(*text)
UART4PutChar(*(text++));
}
signed char UART4GetChar() {
if(UARTCharsAvail(SOC_UART_4_REGS) > 0){
return (UARTCharGet(SOC_UART_4_REGS));
} else {
return NULL;
}
}
The UART2 works great, it sends and receives data correctly.
The UART4, however, is only able to send the data.
The register values responsible for pinmuxing are as follows (MODE1) :
conf_gpmc_wait0 0x0000002E
conf_gpmc_wpn 0x0000000E