I'm trying to write CAN driver (open/close/get_msg/send_msg) for MCF5213 (M5213EVB). I'm using CodeWarrior 7.1 SE.
I have some questions (cause 5213 RM chapter about FlexCAN IMHO is not perfect.)
1) It doesn't clear what should i do on frame receiving in RX interrupt service routine to safely grab a message. Should I only lock that buffer (read code, grab and read time stamp) or deactivate the buffer (write INACTIVE code, grab, write RX_EMPTY code )?
I'm afraid of frames lost.
2) Is it possible to switch off self-received messages on hw level or I have to do this "manually" by caching sent messages?
3) Is it possible to treat any incoming RTR frame as other incoming frames? This is important cause my driver have to deliver this RTR message to the upper level.
I have to receive RTR frames with any ID and pass them to software RX FIFO buffer.