Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User10538
Level 3
Level 3
Hi,

I found a bug in xmc_can.c.

Initialy the MOIPR was modified with the "set" value, by a = operation. This clears the Interrupt Node Pointers, and so Interrupts no longer trigger.
Below the fixed code.

Is it even necessary to modify the MPN in this function? By my understanding the value is tied to the MO-Nr, which stays constant.


/* Initialization of XMC_CAN MO Object */
void XMC_CAN_MO_Config(const XMC_CAN_MO_t *const can_mo)
{
uint32_t reg;
/* Configure MPN */ // ***MODIFIED: mask MPN and OR newly calculated MPN to MOIPR or else you overwrite Interrupt Node Pointers


uint32_t num = ((uint32_t)(can_mo->can_mo_ptr) - CAN_BASE - 0x1000U)/0x0020U;
uint32_t set = (((uint32_t)(num/32) << (CAN_MO_MOIPR_MPN_Pos + 5U)) | ((uint32_t)(num%32) << CAN_MO_MOIPR_MPN_Pos));
can_mo->can_mo_ptr->MOIPR &= ~(511 << CAN_MO_MOIPR_MPN_Pos); // clear MPN
can_mo->can_mo_ptr->MOIPR |= set; // set MPN

...
}
0 Likes
1 Reply
Not applicable
Hi,

Thank you for your feedback. I have confirmed this with the developer and this will be updated as suggested in the next DAVE update in July.

In the meanwhile, an eTicket(#223383427 ) has been filed for this issue. It can be viewed from the link below.
https://www.infineonforums.com/support/dave3/index.php?option=com_maqmahelpdesk&Itemid=0&id_workgrou...

Regards,
Daryl
0 Likes