STM32F779I - Eval board CAN Communication
Hi All,
Currently I am working with STM32F779I - Eval Board for one of our projects. I am using the BSP and Drivers provided by STM and using STM32 Workbench as development platform. As the part of bringing-up the CAN module and validate the CAN driver for our requirements I have used the example taken from ‘STM32Cube_FW_F7_V1.8.0/Projects/STM32F769I_EVAL/Examples/CAN_Networking’. I have built the code and flashed into Eval board and I used Vector CAN tool VN1600 for testing the same. Here CAN message transmission is working as expected but reception is not happening though it is configured for all message ID’s. I have used the below configuration from the example.
/*##-1- Configure the CAN peripheral #######################################*/
CanHandle.Instance = CANx;
CanHandle.pTxMsg = &TxMessage;
CanHandle.pRxMsg = &RxMessage;
CanHandle.Init.TTCM = DISABLE;
CanHandle.Init.ABOM = DISABLE;
CanHandle.Init.AWUM = DISABLE;
CanHandle.Init.NART = DISABLE;
CanHandle.Init.RFLM = DISABLE;
CanHandle.Init.TXFP = DISABLE;
CanHandle.Init.Mode = CAN_MODE_NORMAL;
CanHandle.Init.SJW = CAN_SJW_1TQ;
CanHandle.Init.BS1 = CAN_BS1_6TQ;
CanHandle.Init.BS2 = CAN_BS2_7TQ;
CanHandle.Init.Prescaler = 4;
if(HAL_CAN_Init(&CanHandle) != HAL_OK)
{
/* Initialization Error */
Error_Handler();
}
/*##-2- Configure the CAN Filter ###########################################*/
sFilterConfig.FilterNumber = 0;
sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
sFilterConfig.FilterIdHigh = 0x0000;
sFilterConfig.FilterIdLow = 0x0000;
sFilterConfig.FilterMaskIdHigh = 0x0000;
sFilterConfig.FilterMaskIdLow = 0x0000;
sFilterConfig.FilterFIFOAssignment = 0;
sFilterConfig.FilterActivation = ENABLE;
sFilterConfig.BankNumber = 14;
if(HAL_CAN_ConfigFilter(&CanHandle, &sFilterConfig) != HAL_OK)
{
/* Filter configuration Error */
Error_Handler();
}
/*##-3- Start the Transmission process #####################################*/
CanHandle.pTxMsg->StdId = 0x123;
CanHandle.pTxMsg->RTR = CAN_RTR_DATA;
CanHandle.pTxMsg->IDE = CAN_ID_STD;
CanHandle.pTxMsg->DLC = 8;
I have used the below API for CAN Reception. Configuration also done in MSPiInit();
/*##-2- Start the Reception process and enable reception interrupt #########*/
if (HAL_CAN_Receive_IT(&CanHandle, CAN_FIFO0) != HAL_OK)
{
/* Reception Error */
Error_Handler();
}
Also I have taken care the Jumper settings for the evaluation board mentioned as per the STM32F77XX user manual.
1. JP19 - 1-2 fitted ( High speed mode)
2. JP18 - Fitted ( CAN termination resistor)
3. JP14 - Fitted (PA11 connected with CAN Rx signal)
Can anyone help me to identifying the issue and sort out the problem. Please feel ask for more clarification.
Thanks
Vipin Das B