Linux Serial Driver in Ubuntu
AceLan Kao
acelan.kao at canonical.com
Tue Jul 7 04:52:55 UTC 2020
Hi Mehran,
You are implementing a soft uart driver, so I think you should provide
your own serial_in/serial_out functions in uart_port.
You can reference drivers/tty/serial/sh-sci.c
Mehran Memarnejad <memarnejadm74 at gmail.com> 於 2020年7月6日 週一 下午9:27寫道:
>
> Hi,
>
> I want to develop a serial driver in Linux which is somehow like PRU software uart (suart Linux driver) for am335x to represent a virtual TTY device under /dev...
>
> Inspecting the pru_suart.c code in TI Linux SDK, I developed a simple serial driver...
>
> The attached code (amfdDriver.c) emulate Rx interrupt by a timer and upon its trigger, It adds a character to Rx FIFO as if a new character received...
>
> Testing the code on my PC (ubuntu 16.04 with kernel 4.15.0-106-generic), I don't get the correct output.
>
> What I expect: is that if I run "$sudo cat /dev/ttyAMFD0", I should see the "t" character every second added to receive FIFO by timer, i.e. printing "t" every second on terminal .... But that is not the case ...
>
> What happens: is that before running "$sudo cat /dev/ttyAMFD0", the timer just printk the statement in it, and after I run "$sudo cat /dev/ttyAMFD0" It calls start_tx without printing anything on terminal (dmesg output is in attachment)... as I tested, start_tx is called because of calling tty_flip_buffer_push in code after inserting the character
>
> I tried many things but none of them works... What could be the problem?
>
> Thanks in advance
>
> --
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
More information about the kernel-team
mailing list