I am trying to work around some CAN issues.
I have not been able to recover the CAN issue using
Code: Select all
can_initiate_recovery(void)
Instead I am trying to disable the CAN device whilst the problem conditions occurs and then reenable. I hope that the CAN issue will then be avoided.
I could try
Code: Select all
can_driver_uninstall(void)
I have tried removing the device from the bus:
Code: Select all
int can_set_reset(int reset)
{
if(reset)
can_ll_enter_reset_mode(can_context.dev);
else
can_ll_exit_reset_mode(can_context.dev);
return 0;
}
Dumping registers before I reset/enable:
Code: Select all
I (31438) CAN: mode: 0x0008
I (31438) CAN: status: 0x001c, interrupt: 0x0000, error_capture: 0x0000
Code: Select all
I (122018) CAN: mode: 0x0008
I (122018) CAN: status: 0x001c, interrupt: 0x0000, error_capture: 0x007b
What am I doing wrong?
How may I perform a hard device reset without creating a new driver context?