Other Parts Discussed in Thread: C2000WARE
Hi,
In my setup a lot of messages with different message IDs are send back and forth on both CAN busses (500.000kbit/s).
I use:
#define TX_MSG_OBJ_ID 1
#define RX_MSG_OBJ_ID 2
and when I send on CAN I use (taken from lib):
CANMessageSet(CANA_BASE, TX_MSG_OBJ_ID, &sTXCANMessage, MSG_OBJ_TYPE_TX);
But when i run the code unfortunately messages are missing (not send) and bus errors are popping up on my PC-app Busmaster.
For reading messages I use (taken from lib):
CANMessageGet(CANA_BASE, RX_MSG_OBJ_ID, &sRXCANMessage_Int, true);
I know that CANA and CANB both have 32 message objects (“message objects” are also referred to as “mailboxes” in the documentation)
How do I implement mailboxes into my system? Code example?
In the libs I found
CAN_sendMessage(uint32_t base, uint32_t objID, uint16_t msgLen,
const uint16_t *msgData)
and
CAN_readMessage(uint32_t base, uint32_t objID,
uint16_t *msgData)
Will it be better to use them? It looks almost the same to me.
I really need to see the connection between the mailboxes (the 32 message objects) and the different messages send (rx/tx) - do I have to handle the mailboxes and how?
Now tx is in mailbox 1 (TX_MSG_OBJ_ID= 1) and rx is in mailbox 2 (RX_MSG_OBJ_ID = 2) .... is that right?
Thanks!
Best regards,
Carsten