This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I want to receieved 43 can message with tms570LS31xhdk. I dont want to using all message box. how received all dcan message identifier number from one message box or whitout message boxs.
Thanks.
Hello Halil,
I'm not entirely clear on what you are asking as there are different terms used for message storage. In the CAN code generated by Halcogen, the function canGetData() uses a field MessageBox in the struct to retrieve data from a message so I am not certain if this is the storage location you are referencing or if you are referencing Message RAM in the DCAN module.
Assuming you mean the Message RAM which contains all of the CAN "mailboxes" or message objects as they are called in the TRM, you would simply need to program one of the Message Objects with the appopriate mask information to accept all message identifiers. In other words, it would be configured so that UMask is enabled and the value programmed into the Msk[28:0] field of the mask register would be all 0's so that all message objects would be accepted regardless of the MsgID of the object.
For more information about configuring message objects, please review section 24.5 of the TMS570LS3137 TRM located here http://www.ti.com/litv/pdf/spnu499a
Hello Chuck,
Firstly I am not a professional user of tms570LS31xhdk.
I apply mask register zeros(0x000). I get 43 can messages from message box 1. I can take message data with using "cangetdata" function but I didnt take message identifier number(MSGID). I read reference manuel which tell very well. all thing is clear but I didnt reach MSGID from "canreg1 pointer".
How can I get the message identifier number?
thanks..
Hello Halil,
The canGetData function initiates a transfer of the message object into the IF2 register set. The message ID will be in the DCAN IF2ARB register bits 28:0 or 28:18 dependent on the length of the ID used (extended or standard identifier).
The process that the function is going through is described in the reference manual SPNU499a.pdf section 24.6.2. All message object data is copied into the IF2 registers.
Hello Halil,
As Chunck said, the canGetData function initiates the transfer of the message object RAM to the IF2 register, but by default the Access Arbitration bit is not set, so if yuo want to get the arbitration bits to be copied to the IF2ARB register you should set the the 5th bit of IF2CMD to 1.
In addition you can modify the canGetData signature like this:
uint32 canGetData(canBASE_t *node, uint32 messageBox, uint32 *messageId, uint8 * const data)
{
/* USER CODE BEGIN (10) */
node->IF2CMD = 0x37U; // Access Arbitration Enabled
/* USER CODE END */
...
/* USER CODE BEGIN (11) */
*messageId = (node->IF2ARB & 0x1FFC0000U) >> 18U ; //std_id configured
/* USER CODE END */
}
I hope that information helps you!.
Regards!