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

cross mob
WeiF
Level 3
Level 3
10 replies posted 10 questions asked 5 questions asked

Hi folks,

As the title said, I am developing with XMC4400 board in DAVE IDE. Adatped from sample CAN transmit/receive codes, I now have multiple TX/RX message object being set up. the CAN node configuration is done through the app instance configuration, which looks like:

WeiF_0-1697500700339.png

WeiF_1-1697500718563.png

As can be seen, I have more than 1 Rx message objects. while when I debug on the board, setting breakpoint inside the 

ISR receive interrupt, I found that, only the LMO_02 object activates the interrupt (will stop at the breakpoint when send a message of its ID from external), but for other RX MOs, e.g. the LMO_07, it is not going into the interrupt. 

My main() functions looks like

int main(void)
{
  DAVE_STATUS_t status;

  status = DAVE_Init();           /* Initialization of DAVE APPs  */
  XMC_CAN_MO_SetStatus(&Request_Node_LMO_01_Config.mo_ptr[0], XMC_CAN_MO_SET_STATUS_RX_ENABLE);
  XMC_CAN_MO_SetStatus(&Request_Node_LMO_04_Config.mo_ptr[0], XMC_CAN_MO_SET_STATUS_RX_ENABLE);



  if (status != DAVE_STATUS_SUCCESS)
  {
    /* Placeholder for error handler code. The while loop below can be replaced with an user error handler. */
    XMC_DEBUG("DAVE APPs initialization failed\n");

//    while(1U)
//    {
//
//    }
  }

  SysTick_Config(SystemCoreClock / TICKS_PER_SECOND);

}

And the my receive interrupt is like

void Request_Node_Interrupt()
{
  /* Check for Node error */
  if(CAN_NODE_GetStatus(&Request_Node) & XMC_CAN_NODE_STATUS_LAST_ERROR_CODE)
  {
//	  DIGITAL_IO_ToggleOutput(&LED_Indicator);
  }
  else if(CAN_NODE_MO_GetStatus(&Request_Node_LMO_02_Config) & XMC_CAN_MO_STATUS_RX_PENDING)
  {
     /* Read the received Message object and stores in Request_Node_LMO_02_Config*/
	  CAN_NODE_MO_ClearStatus(&Request_Node_LMO_02_Config, XMC_CAN_MO_STATUS_RX_PENDING);
	  CAN_NODE_MO_Receive(&Request_Node_LMO_02_Config);

     /* Switch on LED Pin 3.9  to indicate that the requested message is received*/
     DIGITAL_IO_ToggleOutput(&LED_RX);
  }
  else if (CAN_NODE_MO_GetStatus(&Request_Node_LMO_07_Config) & XMC_CAN_MO_STATUS_RX_PENDING)
  {
		  CAN_NODE_MO_ClearStatus(&Request_Node_LMO_07_Config, XMC_CAN_MO_STATUS_RX_PENDING);
		  CAN_NODE_MO_Receive(&Request_Node_LMO_07_Config);

	     /* Switch on LED Pin 3.9  to indicate that the requested message is received*/
	     DIGITAL_IO_ToggleOutput(&LED_RX);
  }

One thing I suspect is that the LMO_02 exists in the original sample project, and the LMO_07 is what I added. (I added in the app instance configuration, then auto-generated the relevent codes) 

I doubt if things is like the new message objects are not hooked up with interrupt, but didn't found clue when I get to the generated files like xmc_can.h, xmc_can_conf alike.

Can someone share some advice on this? Thanks in advance. 

Regards,

Wei

0 Likes
1 Solution
WeiF
Level 3
Level 3
10 replies posted 10 questions asked 5 questions asked

Hi Aashita,

Thanks for your reply. I figured out that I didn't do the Hardware signal connectivity well. After connect each of the RX message objects to isr, it is good to go.

Regards,

Wei

View solution in original post

0 Likes
2 Replies
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @WeiF ,

From your provided description above, it seems like it could be some configuration issue. In a way, there are few parameters which are not being set properly for message object 7. Just adding message object 7 code will not create any issue. For this, let me try to re-create this issue at my end.

Meanwhile, can you please share your project with us here so that I can go through it once and also check at my end?

Best Regards,

Aashita

0 Likes
WeiF
Level 3
Level 3
10 replies posted 10 questions asked 5 questions asked

Hi Aashita,

Thanks for your reply. I figured out that I didn't do the Hardware signal connectivity well. After connect each of the RX message objects to isr, it is good to go.

Regards,

Wei

0 Likes