Linux Serial Driver in Ubuntu

Mehran Memarnejad memarnejadm74 at gmail.com
Mon Jul 6 13:22:41 UTC 2020


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20200706/b11c5e0b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output.png
Type: image/png
Size: 157237 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20200706/b11c5e0b/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amfdDriver.c
Type: text/x-csrc
Size: 6831 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20200706/b11c5e0b/attachment-0001.c>


More information about the kernel-team mailing list