- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
I use the Evaluation Board KIT_A2G_TC366_5V_TRB_S and want to use 14 CAN dedicated Rx Buffers with interrupt.
My problem is that only buffers 0-7 get an interrupt.
For the buffers 0 -13 the data is written into the CAN message RAM and the flags for new data ND0 - ND13 are also set, but as I said, an interrupt is only triggered for buffers 0-7.
I hope someone has an idea and can help me with this problem.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Olsch,
It looks like you hit the root cause! Could you please try to use below instead
if(node->NDAT1.U&mask)
return True;
Expect to receive your good news.
dw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Olsch,
M_CAN supports 64 dedicated Rx Buffers. IRi.DRX is set when a msg is stored into the Rx Buffer.
NDAT1i NDAT2i is set after last word of a matching received msg written.
Please check if filter masked data? or buffer full? Attached related register for your reference.
dw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi dw,
thanks for your reply.
I found my issue in the iLLD library ifxCan.c in function boolean IfxCan_Node_isRxBufferNewDataUpdated(Ifx_CAN_N *node, IfxCan_RxBufferId rxBufferId).
If a buffer greater than 7 is used, tempVar never evaluates to TRUE. For example if buffer number 8 is used node->NDAT1.U & mask evaluates to 0b 0001 0000 0000 and after the boolean (unsigned char) cast it evaluates to 0b 0000 0000.
boolean IfxCan_Node_isRxBufferNewDataUpdated(Ifx_CAN_N *node, IfxCan_RxBufferId rxBufferId)
{
uint32 mask;
boolean tempVar;
if (rxBufferId < IfxCan_RxBufferId_32)
{
mask = (1U << rxBufferId);
tempVar = (boolean)(node->NDAT1.U & mask);
return tempVar;
}
else
{
mask = (1U << (rxBufferId - 32));
tempVar = (boolean)(node->NDAT2.U & mask);
return tempVar;
}
})
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Olsch,
It looks like you hit the root cause! Could you please try to use below instead
if(node->NDAT1.U&mask)
return True;
Expect to receive your good news.
dw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi dw,
Yes, this works as well as the following.
tempVar = (boolean)((node->NDAT1.U >> rxBufferId) & 0x01);
return tempVar;