Initialization fails after Reset the CAN module.

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

cross mob
Not applicable
Hi Sir/Madam,
i am working on xmc4200. inside main() after clock configuration i am initialising the can module, and i am successfully communicate with can based devices. Now as per Requirement
in my project requirement i need to reset the CAN module, and again need to reinitialise the can module and communicate with device.

for reset can module i was done like below

PRCLR1 |= 0x00000010;
PRSET1 |= 0x00000010;
RSTCLR |= 0x01;

by doing the above procedure i can able to reset the can module i.e., all the CAN register are turned into 0xFFFFFFFF (Observed in Keil).
now if i am trying to reinitialize the CAN then it is not able initialize. should i had missed any thing else in resetting the module?

Thanks and regards,
Harshan.
0 Likes
2 Replies
DRubeša
Employee
Employee
First solution authored First like received
So, I tried to replicate your issue and in my case, I don´t have any problems with re-initialization of the CAN module. After initialization, I added 3 lines of code that you mentioned in your post to reset the CAN module. Immediately after, I called the "XMC_CAN_Enable()" function (I guess you don´t need even to use whole functionality of this function, CAN module is enabled by line "obj->CLC &= ~(uint32_t)CAN_CLC_DISR_Msk;"). Can you please try to re-initialize the CAN module with this function? Or maybe I understood your post wrongly :). Then please, provide me with some additional information.
0 Likes
Not applicable
Hi Drubesa,
Thanks for Reply, The Problem was resolved actually there is one flag which i was not enabled in my code.

Thanks and Regards,
Harshan
0 Likes