My custom board has a Lin/K-Line interface using a TJA1021 transceiver, but 
software support is low on the priority/roadmap at this time.

Nevertheless, I would be happy to be involved in testing (I have a CAN/LIN 
analyzer/stream generator) if it helps.

-----Original Message-----
From: Pavel Pisa <ppisa4li...@pikron.com>
    Hello Simon and others,

    On Friday 13 of August 2021 18:50:23 Frank-Christian Kruegel wrote:
    > Am 13.08.2021 um 16:50 schrieb Simon Filgis:
    > > has anybody implemented a LIN driver for SAME70 USART? The SAME70 USART
    > > peripheral is capable of. A SW implementation (sllin.c - Pavel Pisa)
    > > would also be interesting!
    > >
    > > Would you extend sma_lowputc.c and sam_serial.c or would you grep USARTx
    > > in a separate file?
    >
    > Do you need LIN Master or LIN Slave?
    >
    > LIN Master is easy. It's standard serial.
    ...
    > LIN slave is much more complex, especially if you want to do autobauding
    > by measuring the SYNC byte after the break. You might end up with a
    > custom serial driver then. If a fixed bitrate is enough the only problem
    > is detecting the BREAK signal. A received break signal is basically a 0
    > byte with a framing error added. You only need to detect and clear the
    > framing error.

    I am on the way to vacations now but I am interest in LIN interfacing
    discussion when I return. I do not have actual need for LIN support
    but getting some reasonable code upstream to NuttX and Linux.

    There is my latest version from 2019

      https://github.com/ppisa/linux-lin

    and some docs

      https://github.com/ppisa/linux-lin/wiki

    Finite state machines and some other ideas from Linux kernel
    implementation can be reused on NuttX. As for the API,
    I think that to keep size of the applications low
    on the targets which do not use TCP or SocketCAN,
    NuttX API should be implemented through read, write
    (enough for the master) and IOCTLs to maintain slave
    responses cache.

    As for bitrate autodetection, there are special
    HW support in many UARTs for autodetect of the LIN
    bitrate. It would worth to add mechanism to setup
    it o NuttX. On GNU/Linux where sllin attempts to
    be compatible with all UARTs through generic API
    it is problematic. On NuttX we can define API,
    which can allow to implement LIN specific
    low level drivers for chips with special support
    ad for other map the API to generic UART low
    level part. Or we can conditionally extend  low
    level API.

    By the way
    I return on Sunday August 22. It would be great
    if prof. Roberto Bucher's and followup Michal Lenc's
    presentation about PySimCoder on NuttX Workshop
    can be scheduled on Sunday that I can attend them.

    Best wishes
                    Pavel
    -- 
                    Pavel Pisa
        phone:      +420 603531357
        e-mail:     p...@cmp.felk.cvut.cz
        Department of Control Engineering FEE CVUT
        Karlovo namesti 13, 121 35, Prague 2
        university: http://dce.fel.cvut.cz/
        personal:   http://cmp.felk.cvut.cz/~pisa
        projects:   https://www.openhub.net/accounts/ppisa
        CAN related:http://canbus.pages.fel.cvut.cz/
        company:    https://www.pikron.com/



  • Lin Simon Filgis

Reply via email to