Cannot reset CAN NODE when it detects CAN BUSOFF ERROR

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

cross mob
lock attach
Attachments are accessible only for community members.
Bandarikarthik
Level 3
Level 3
25 replies posted 100 sign-ins First like given

Hello every one

I am using XMC1403 MCU and Microchip  CAN BUS Analyzer  

I  can see the CAN bus went into BUSSOFF state in CAN BUS analyzer  

there is perfect communication between the TWO nodes (XMC1403 CAN peripheral as one Node and CAN bus Analyzer as another node) there is a 120 ohm termination also

 

if(HandlePtr1->node_ptr->NSR & (1<<7)) busoff();   

 as per reference manual xmc1400 I am checking the condition of BUSSOFF error then calling the buss off function 


void busoff(void){


bus_off_count++;

if(bus_off_count == 100){

CAN_NODE_Init(&CAN_NODE_0);
CAN_NODE_Enable(HandlePtr1);
CAN_NODE_ConfigBaudrate(HandlePtr1,canbaudrate, cansample_point, cansjw);
bus_off_count=0;

}


}

then also I cannot see CAN BUS is not coming to normal mode in analyzer  it seems CAN BUS Analyzer is working fine 

but my XMC1403 MCU CAN node is not coming into normal state when goes in to BUSOFF state when BUSSOFF occurs I am again initializing the CAN NODE of XMC1403 MCU 

Please find below Screen shot XMC1403 reference manual BUSSOFF register 

regards,

Bandari Karthik Kumar
0 Likes
2 Replies
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi @Bandarikarthik ,

Can you  put a breakpoint inside the below marked condition and see if it hits?

If yes- then is there any API like "deinit"- can you call that before init?

Alakananda_BG_0-1656480022019.png

 

Regards,

 

Alakananda
0 Likes

Hello @Alakananda_BG !!!

Thankyou for your response 

yeah I'll try with keeping "CAN Deinit" API before "Init Api " .

 

regards,

 

Bandari Karthik Kumar
0 Likes