2024-06-25 04:17 AM
Hi ST-Community
I am working on CAN Communication in F103
When I am de-initializing properly , But when , I am reinitializing it is not working
Please tell me how to reinitialize CAN Communication
if (0 == HAL_GPIO_ReadPin(BRAKE_GPIO_Port, BRAKE_Pin)) {
Display.out.brake = 0x20;
ControlVals.brakeStatus = 1;
if (Communication.CAN_D_I == 0) {
if (HAL_CAN_DeInit(&hcan) != HAL_OK) {
Error_Handler();
}
Communication.CAN_D_I = 1;
}
else {
Display.out.brake = 0x00;
ControlVals.brakeStatus = 0;
if (Communication.CAN_D_I == 1) {
if (HAL_CAN_Init(&hcan) != HAL_OK) {
Error_Handler();
}
Communication.CAN_D_I = 0;
}
}
}
Solved! Go to Solution.
2024-06-25 04:36 AM
Hello,
To go from Normal mode to init mode or vice versa you need to check this figure in the reference manual:
Your node needs to detect 11 consecutive recessive bits on the bus otherwise it keeps blocked mainly if the bus is overloaded.
2024-06-25 04:36 AM
Hello,
To go from Normal mode to init mode or vice versa you need to check this figure in the reference manual:
Your node needs to detect 11 consecutive recessive bits on the bus otherwise it keeps blocked mainly if the bus is overloaded.