Announcements

Equip yourself to optimize AURIX™ MCUs for Evs at the EV Webinar. Click here to register.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

AURIX™ Forum Discussions

_Julien_
Level 1
Level 1
10 sign-ins First reply posted First question asked

Hi,

I would like to have advice on the following application.

The application needs to filter incoming messages through 3 filters (Filter 0, Filter 1, Filter 2).

The filtered messages should be stored in a FIFO, consisting of Message Objects, and very important in their arrival order.

A FIFO Overflow interrupt must be generated when CUR == SEL. Or simply when a message is received in the FIFO.

The whole thing must run on a single CAN node.

The programming of the filters, the FIFO, the interrupt works. But how to come up with a design that respects the constraints listed above?

Possible solutions:

Solution 1

3 FIFOs so the basic object message is set up with a filter. The receive interrupt is activated. In the interrupt routine I use the IfxMultican_Can_MsgObj_readMessage example function:

irq()
{
IfxMultican_Can_MsgObj_readMessage( FIFO_Filter0 )
IfxMultican_Can_MsgObj_readMessage( FIFO_Filter1 )
IfxMultican_Can_MsgObj_readMessage( FIFO_Filter2 )
...
}

In cases where:
2 or 3 messages (whose IDs correspond to the respective filters) arrive and the 3 FIFOs almost simultaneously
during the execution of IfxMultican_Can_MsgObj_readMessage( FIFO_Filter0 ) two messages arrive, one in FIFO_Filter1 and the other in FIFO_Filter2. The one in FIFO_Filter2 arrives before the one in FIFO_Filter1.

Problem: When executing the IfxMultican_Can_MsgObj_readMessage I would not be able to know the order of arrival of the messages.

Solution 2

In the TC27x datasheet it is stated that the gateway is based on the objects messages. I guess it can be used for a message object to message object transfer on the same node.


Filter1 and Filter2 are simple message object not FIFOs. Filter1 and Filter2 are configured as gateways and point to FIFO_Filter0 (a FIFO).
The filtered messages from Filter1 and Filter2 should be added to the FIFO of FIFO_Filter0 and read only by IfxMultican_Can_MsgObj_readMessage( FIFO_Filter0 ) for the moment this solution does not seem to work as expected.

Solution 3

It works well but uses 3 nodes with a gateway and loopback. But it is quite complex and would not want to implement it in the final design

Ideally the design should work as a demultiplier. The filters are the sources and the FIFO the destination.

Some help or advice would be very much appreciated.

Julien



0 Likes
3 Replies
dw
Moderator
Moderator
Moderator
100 likes received 750 replies posted 10 likes given

Thanks for question, I will reply if any info.

0 Likes
_Julien_
Level 1
Level 1
10 sign-ins First reply posted First question asked

Thanks. 

If I have 3 object messages configured with a separate filter and as a source gateway pointing to a FIFO. Is it possible to create a "neutral" FIFO that will only receive data from the gateways and not all data received on the CAN bus? Maybe by putting it in the list 0, or playing with RTSEL? On the other hand it should be able to generate an interrupt when cur == sel or simply when the gateways have copied a message to it.

0 Likes
_Julien_
Level 1
Level 1
10 sign-ins First reply posted First question asked

I thought Santa was going to make suggestions...

0 Likes