Should I use Rx FIFO or just normal Rx to receive large number of CAN messages?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Should I use Rx FIFO or just normal Rx to receive large number of CAN messages?

1,683 Views
Poley
Contributor V

Hi, I have a CAN bus which receives 85 messages every 100ms. I currently use 18 MB's to split these as I have 16 external modules which send all of the CAN messages and each space their messages out over the 100ms (each module at same time sending 5 messages 10ms apart).

I was wondering if using a Rx FIFO would be better and just as reliable as using the 18 MB method that I currently use? Will changing would allow me to use CAN transmit in non-blocking mode as I will have enough MB's available? I am not sure how many MB's the filtering we occupy.

Thanks in advance! 

0 Kudos
5 Replies

1,648 Views
Poley
Contributor V

Thanks @mariuslucianand 

@paulvlase would Rx_FIFO be the better option for my application of 85 messages every 100ms? And how many MB's will that occupy?

Thank you!

0 Kudos

1,606 Views
Poley
Contributor V

Hi @paulvlase 

In addition to my FIFO questions, do you know if I can detect when a certain message has actually been put onto the bus? I have a message sent at every 100ms that I need to know when it is actually put onto the bus so I can trigger a reading elsewhere in the model, is this possible?

Currently with the 16 receive buffers in the model of mine you have seen before I am finding it impossible to get my CAN transmit to run at 100ms when the bus is fully connected. With all CAN receive blocks active (All 85 messages are being sent to board) then the CAN transmitting changes to 106ms and slows my model down by 6% for some reason 

Thanks!

0 Kudos

1,597 Views
paulvlase
NXP Employee
NXP Employee

Hi @Poley ,

Well the use of Rx FIFO depends on if you can fit your received message IDs into the available Rx FIFO filter elements.

As you can see in the following table, the 4th configuration will allow you to configure 32 filter elements, and having the remaining 18 MBs, 14-31, for Tx. Now the only problem is that only the first 0-13 filter elements have individual ID mask, all the other have a shared global ID mask.

 

paulvlase_0-1628066946713.png

From what I know there isn't a way to detect when a certain message has been put onto the bus, not until it is received by the FlexCAN peripheral. If you use the 4th Rx FIFO configuration, you will have 18 MBs, 17 MBs for Tx, and the remaining 1 MB you could use for normal Rx, non Fifo. This way the Rx Complete event will be triggered as soon as possible once that message is received and in the triggered subsystem you will initiate the receiving of other CAN messages.

 

Regards,

Paul

0 Kudos

1,592 Views
Poley
Contributor V

Hi @paulvlase 

I have 16 nodes sending the same amount of messages to the S32K148 board. Each node is increased by 10 hex. So I have board 1 send 0x301-0x305 and board 2 sends 0x311-0x315 and so on up to 0x3F1-0x3F5. I also have messages 0x521, 0x522 and 0x523 that needs reading. All messages are at 100ms and the 16 boards send their messages out at 12ms apart. so will receive 16 messages every 12ms at the same time. I can change the ID's on the 16 boards. Does this look like RxFIFO would work for my case? 

For the last part, do you mean I transmit 0x3F0 for example but I also use a receive block for 0x3F0 and then I can use that receive to indicate that the message is on the bus?

Lastly do you have any idea why when I send all 85 messages to the main board it slows my model down by 6%? I have the time step to 5ms now as well.

Thanks for the help! This has definitely been tricky to try and get around  

0 Kudos

1,672 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @Poley,

I've found this thread here https://community.nxp.com/t5/S32K/What-is-the-difference-between-RX-FIFO-and-message-box/m-p/727026 WHich can be interesting for you. The MBDT generates code on top of the S32SDK and my colleagues here explain how the RX FIFO works for the S32SDK.

@paulvlase , can you comment on this?

Marius

Tags (1)
0 Kudos