2020-07-12 01:31 AM
I am using STM32F302RBT6 for CAN communication baud rate 10K. the firmware works on lab system. If download the firmware at field, the system dropped into Error_Handler when CAN sends data.
APB1 clock = 8MHz, Pre-scaler = 50, Seg1 = 13, Seg 2 = 2
hcan.Instance = CAN;
hcan.Init.Prescaler = 50;
hcan.Init.Mode = CAN_MODE_NORMAL;
hcan.Init.SyncJumpWidth = CAN_SJW_1TQ;
hcan.Init.TimeSeg1 = CAN_BS1_13TQ;
hcan.Init.TimeSeg2 = CAN_BS2_2TQ;
hcan.Init.TimeTriggeredMode = DISABLE;
hcan.Init.AutoBusOff = DISABLE;
hcan.Init.AutoWakeUp = DISABLE;
hcan.Init.AutoRetransmission = DISABLE;
hcan.Init.ReceiveFifoLocked = DISABLE;
hcan.Init.TransmitFifoPriority = DISABLE;
Using (HAL_CAN_AddTxMessage(&hcan, &TxHeader, TxData, &TxMailbox) to send data out.
what is the reason to cause this issue - HAL_CAN_ERROR_PARAM ? which parameters are wrong?
Thanks & Regards,
Jiannong