UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
1,103 Views
Registered: ‎02-04-2016

CANFD IP :Linux driver support for Acceptance Filters

Hi everyone,

 

I have been working with AXI CANFD soft IP of Xilinx in Zynq 7000 (ZYBO board). Standalone works great. But when I tried the same using Linux, I am not able to receive messages in the rx fifo even though rx fifo status register (FSR) identifies data coming to it. Basically I think the data is not getting stored in rx fifo buffer , even though I have configured acceptance filter ID and mask properly.  Then I noticed that xilinx linux driver page of CAN says Frame work won't support Acceptance filters. How is the CAN protocol expected to work if driver does not support basic acceptance filter? I am sorry if I am wrong. My understanding of CAN protocol is limited.

Goutham

0 Kudos
4 Replies
Scholar rfs613
Scholar
1,061 Views
Registered: ‎05-28-2013

Re: CANFD IP :Linux driver support for Acceptance Filters

There are essentially two kinds of acceptance filters:

  • hardware filtering in the CAN controller (or the equivalent soft IP)
  • software filtering in the kernel

The hardware filtering is usually very limited. For example the old SJA1000 controller from Phillips could operate in either single or dual mode, basically it could match one or two addresses.

 

In contrast, the socketcan driver in linux kernel employs a hash table and allows something like 2048 addresses to be matched.

 

I suspect that the Xilinx soft IP does not implement hardware filtering. However software filtering is part of socketcan and should work. Caveat: I have not actually tried this on Zynq, I am just making some guesses based on experience with other similar designs.

0 Kudos
Adventurer
Adventurer
1,049 Views
Registered: ‎02-04-2016

Re: CANFD IP :Linux driver support for Acceptance Filters

Hi @rfs613 ,

 

Apparently, I think the opposite way about Xilinx CANFD IP, as its datasheet clearly mention about Acceptance Filter pair registers, Acceptance filter Mask Registers (AFMR) and Accpetance Filter ID Registers (AFIR). But SocketCan is something I have never explored.

While the driver I mentioned says it wont support Acceptance Filter Framework, Does it mean software level acceptance filter or as i suspected, I cant even do acceptance filter in the soft IP I am using?


Problem I see is , CANFD IP datasheet says, if you do not use acceptance filter, none of the messages will be stored in RXFIFO ( Thisis what I am seeing now).


While AXI CAN or Zynq's hard IP CAN datasheets say, if you do not use acceptance filter, all the messages will be stored in RXFIFO.  If this is the case, I would rather try AXI CAN or zynq's hard IP CAN since it allows to save all messages even if acceptance filters are disabled. 

I am basically trying to get a CAN protocol up and running between two ZYBO boards (Zynq). I am using this transeiver .

Goutham

0 Kudos
Scholar rfs613
Scholar
1,038 Views
Registered: ‎05-28-2013

Re: CANFD IP :Linux driver support for Acceptance Filters

I haven't read the datasheet for the Xilinx CANFD IP... perhaps the registers exist in the IP, but the XIlinx driver does not support writing to them? Am just guessing here, sorry.

In all CAN controllers I have worked with, the default behaviour is to place all packets into RXFIFO. You have to enable filters explicitly in order to limit what gets stored. This then leads to fewer interrupts since only packets of interest are going into the RXFIFO.

Software filtering in the kernel (via socketcan) is an option regardless of hardware filtering. This is a standard feature in socketcan, described in the kernel/Documentation/networking/can.txt. Obviously without hardware filtering, there will be more software overhead. The Zynq however is fast enough that you may not care about this.

The transceiver you mentioned appears to have several variants, some of them with a "SHUTDOWN" input, others with "STANDBY" pin. I would suggest checking if these are being driven properly, so the transceiver is actually enabled. It is common for them to default to off, so as not to jam the whole CAN bus, until controller and software are ready.
0 Kudos
Highlighted
Adventurer
Adventurer
1,018 Views
Registered: ‎02-04-2016

Re: CANFD IP :Linux driver support for Acceptance Filters

Thanks for the input @rfs613.


For the time being, moved into Hard CAN IP inside PS side of Zynq, until CANFD IP of Xilinx gets mature. Transeiver is working fine with CAN peripheral at address 0xe0008000 inside zynq. Linux side: Using the same Xilinx driver only. Have not actually tested with different acceptance filters. Now, only tested rx of everything of what is sent from tx. Will try using accpetance filters with the same driver, and will update here.

 

Goutham.

0 Kudos