Hello all -
I am working on a OMAP4460 system based on the Blaze tablet, and I am attempting to utilize one of the UARTs to do some basic data transfer. We are able to transmit data out of the UART without any issues.
The problem that I am having is that the data received on the UART's RX line does not show up on a Linux file read() until the next time the UART does a transmit. In other words, I can received som data on this UART, but it won't return from the file read until after I transmit another character. I'm assuming this has something to do with the configuration not copying the data out of the FIFO, but I'm very much a n00b in this area and am not sure where to start looking.
Another very strange occurrence is that, if we jumper together the RX and TX pins on this UART, all the data is sent and received perfectly and timely. Something about having an active transmit is allowing data in the receive FIFO to be read.
We are actually reading/writing from the file in an Android application through the Linux kernel, but I posted this here because I believe the issue to be related to the board-level configuration of the UART.
Below is some of the code I think is relevant, but if you need to see something else from the kernel, u-boot, x-loader, I'd be happy to post that as well.
Application code to open TTY:
int fd = open("/dev/ttyO0", O_RDWR | O_SYNC);
I did try to open the file handle with other flags like O_DIRECT, but it was unable to open the file at all in those cases.
Definition in arch/arm/mach-omap2/board-44xx-serial.c:
static struct omap_device_pad tablet_uart1_pads[] __initdata = {
{
.name = "uart1_cts.uart1_cts",
.enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
},
{
.name = "uart1_rts.uart1_rts",
.enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
},
{
.name = "uart1_tx.uart1_tx",
.enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
},
{
.name = "uart1_rx.uart1_rx",
.flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
.enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
.idle = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
},
};
Pinmux definition in arch/arm/mach-omap2/board-xxxx.c:
static struct omap_board_mux board_mux[] __initdata = {
OMAP4_MUX(I2C2_SDA, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT), /* UART1 TX */
OMAP4_MUX(I2C2_SCL, OMAP_MUX_MODE1 | OMAP_PIN_INPUT), /* UART1 RX */
OMAP4_MUX(MCSPI1_CS2, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),/* UART1 CTS */
OMAP4_MUX(MCSPI1_CS3, OMAP_MUX_MODE1 | OMAP_PIN_INPUT), /* UART1 RTS */
}
Please let me know if there is any other information from the device that would be helpful. For those who know better, I'm sure the answer is a simple flag somewhere, so I apologize for my lack of knowledge in the basic setup :)
Thanks in advance!