cancel
Showing results for 
Search instead for 
Did you mean: 

CAN initializing issue

snehadakhare01
Associate III

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

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.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
SofLit
ST Employee

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.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.