Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

CAN bus - Clearing CAN_IF1MCTL_MSGLST flag

$
0
0

Hi all,

While playing around with stellaris CAN capabilities, I've noticed that MSG_OBJ_DATA_LOST flag is not cleared in message object. And indeed - datasheet tells that it's up to user to clear it, but I can't do that - I've tried adding a line        

CANRegWrite(ulBase + CAN_O_IF2MCTL, CANRegRead(ulBase + CAN_O_IF2MCTL) & ~CAN_IF1MCTL_MSGLST);

inside CANMessageGet function and it stays that way untill the function exits, but it is set again nex time CANMessageGet is called.

I'm sure I don't loose messages after some point - if I start receiver first and transmitter later, I get no lost messages, but if I start transmitter first and the receiver last, I'm getting "lost message" and can't clear the flag.

What am I doing wrong? Should I "commit" the CAN_O_IF2MCTL register somehow after clearing the flag?



Viewing all articles
Browse latest Browse all 262198

Trending Articles