Hi
I have some problems with configuring the can mailboxes properly. I am able to successfully receive CAN messages in general. Some configurations, however, do not seem to work properly.
E.g. if I want to allow all messages of standard ID type (11 bit identifier) - without considering the value of the identifier field.
Simplified example of how i try to configure mailbox 1 to receive ALL messages with a 11 bit identifier:
********************************************************************************************* /* Init CAN */ ROM_CANInit( CAN0_BASE ); /* Set the bit rate */ ROM_CANBitRateSet( CAN0_BASE, ROM_SysCtlClockGet(), 250000 ); /* Enable CAN */ ROM_CANEnable( CAN0_BASE ); /* Configure a CAN mailbox */ tCANMsgObject canMsgObj; /* Clear all flags */ canMsgObj.ui32Flags = MSG_OBJ_NO_FLAGS; /* Enable RX interrupt */ canMsgObj.ui32Flags |= MSG_OBJ_RX_INT_ENABLE; /* Configure mailbox */ ROM_CANMessageSet( CAN0_BASE, 1, &canMsgObj, MSG_OBJ_TYPE_RX ); *********************************************************************************************
With the above code no messages get through to mailbox 1. However, If I enable filtering:
canMsgObj.ui32Flags |= MSG_OBJ_USE_ID_FILTER; canMsgObj.ui32MsgID = 0x1; canMsgObj.ui32MsgIDMask = 0x1;
then it works perfectly fine, and I receive only 11bit messages with ID = 1;
Is it not allowed to configure a mailbox without filtering (without setting MSG_OBJ_USE_ID_FILTER)?
I have also tried to enabled filtering and setting the mask to mask out all bits, like this:
canMsgObj.ui32Flags |= MSG_OBJ_USE_ID_FILTER; canMsgObj.ui32MsgID = 0x00; canMsgObj.ui32MsgIDMask = 0x00;
this, however, enables ALL messages of both standard and extended type - which is not what I want.
I am using a TM4C1233D5PMI on a custom board. As you see, I am using the tivaware in ROM. I have, however, also tried the non-ROM versions from tivaware v. 2.1.0.12573. Additionally I am using CCS v6 with TI C compiler v5.1.6.
I will appreciate any help you can provide.
BR
Christian