Skip to main content
Graduate II
June 25, 2024
Solved

CAN initializing issue

  • June 25, 2024
  • 1 reply
  • 828 views

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;
			}
		}
	}

 

 

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello,

    To go from Normal mode to init mode or vice versa you need to check this figure in the reference manual:

    SofLit_1-1719315163826.png

    Your node needs to detect 11 consecutive recessive bits on the bus otherwise it keeps blocked mainly if the bus is overloaded.

     

    1 reply

    mƎALLEmAnswer
    Technical Moderator
    June 25, 2024

    Hello,

    To go from Normal mode to init mode or vice versa you need to check this figure in the reference manual:

    SofLit_1-1719315163826.png

    Your node needs to detect 11 consecutive recessive bits on the bus otherwise it keeps blocked mainly if the bus is overloaded.