You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Peter Marx <pe...@mnet-mail.de> on 2021/12/26 17:31:18 UTC

SocketCAN for STM32 ?

Hi,
I have seen Peter Van Der Per's great port of SocketCAN to NXP MCUs. On Zephyr there is a SocketCAN for STM32 implementation.  I am not deep enough in C business to judge how difficult it would be to port that to Nuttx. 
Is some insider here around who could comment or maybe works on it already?

BR,
Peter 

Re: SocketCAN for STM32 ?

Posted by Matthew Trescott <ma...@gmail.com>.
Hi Peter,

I haven't worked with NuttX's SocketCAN implementation or STM32, but I
did write a "classic" char-device CAN driver for the Tiva MCUs. The
reason I wrote a char-device driver is because the char-device CAN
subsystem has ioctls for things like hardware message filtering and
the interface supports (IIRC) hardware transmit FIFOs if desired. It's
possible those features aren't relevant with 100+ MHz MCUs, but I
imagine there are use-cases where it is. I also found that on the Tiva
hardware it is difficult to make use of the hardware FIFO capability
because you still need to get an IRQ for each message to handle bus
errors, lost arbitration, etc that an application might be interested
in.

It's not that the SocketCAN implementation _couldn't_ support those
hardware features. It just doesn't yet.

Without looking at the Zephyr code, my guess is that it's probably not
complicated enough to be worth trying to outright port. It would
probably be just as easy if not easier to write an STM32 SocketCAN
driver for NuttX and just use the Zephyr one as a reference. Just my
(somewhat uninformed) 2¢ though.

Kind regards,
Matt

On Sun, Dec 26, 2021 at 12:39 PM Peter Marx <pe...@mnet-mail.de> wrote:
>
> Hi,
> I have seen Peter Van Der Per's great port of SocketCAN to NXP MCUs. On Zephyr there is a SocketCAN for STM32 implementation.  I am not deep enough in C business to judge how difficult it would be to port that to Nuttx.
> Is some insider here around who could comment or maybe works on it already?
>
> BR,
> Peter