cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32F405] Missing some RX interrupts on CAN2 when ABOM is enabled

GS.2
Associate

Hi,

I'm running into a very strange issue with the CAN module. When enabling ABOM on CAN2, some but not all of the FIFO1 RX interrupts are missed. As soon as I disable the ABOM setting, everything works as expected. Has anyone seen this behavior before? For reference, here's my configuration code:

void InitializeCAN() {
  CAN_FilterTypeDef  sFilterConfig;
 
  //hcan1
  hcan1.Instance = CAN1;
  hcan1.Init.Prescaler = 6;
  hcan1.Init.Mode = CAN_MODE_NORMAL;
  hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ;
  hcan1.Init.TimeSeg1 = CAN_BS1_11TQ;
  hcan1.Init.TimeSeg2 = CAN_BS2_2TQ;
  hcan1.Init.TimeTriggeredMode = DISABLE;
  hcan1.Init.AutoBusOff = ENABLE;
  hcan1.Init.AutoWakeUp = DISABLE;
  hcan1.Init.AutoRetransmission = ENABLE;
  hcan1.Init.ReceiveFifoLocked = DISABLE;
  hcan1.Init.TransmitFifoPriority = DISABLE;
  HAL_CAN_Init(&hcan1);
 
  sFilterConfig.FilterIdHigh = (0x28A << 5);
  sFilterConfig.FilterIdLow =  (0x28A << 5);
  sFilterConfig.FilterMaskIdHigh = (0x700<< 5);
  sFilterConfig.FilterMaskIdLow = (0x700<< 5);
  sFilterConfig.FilterFIFOAssignment = CAN_RX_FIFO0;
  sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
  sFilterConfig.FilterScale = CAN_FILTERSCALE_16BIT;
  sFilterConfig.FilterActivation = ENABLE;
  sFilterConfig.FilterBank = 0;
  sFilterConfig.SlaveStartFilterBank = 14;
  HAL_CAN_ConfigFilter(&hcan1, &sFilterConfig);
 
  // hcan2
  hcan2.Instance = CAN2;
  hcan2.Init.Prescaler = 12;
  hcan2.Init.Mode = CAN_MODE_NORMAL;
  hcan2.Init.SyncJumpWidth = CAN_SJW_2TQ;
  hcan2.Init.TimeSeg1 = CAN_BS1_11TQ;
  hcan2.Init.TimeSeg2 = CAN_BS2_2TQ;
  hcan2.Init.TimeTriggeredMode = DISABLE;
  hcan2.Init.AutoBusOff = ENABLE;
  hcan2.Init.AutoWakeUp = DISABLE;
  hcan2.Init.AutoRetransmission = ENABLE;
  hcan2.Init.ReceiveFifoLocked = DISABLE;
  hcan2.Init.TransmitFifoPriority = DISABLE;
  HAL_CAN_Init(&hcan2);
 
  sFilterConfig.FilterIdHigh = (0x183 << 5);
  sFilterConfig.FilterIdLow =  (0x183 << 5);
  sFilterConfig.FilterMaskIdHigh = (0xFFF<< 5);
  sFilterConfig.FilterMaskIdLow = (0xFFF << 5);
  sFilterConfig.FilterFIFOAssignment = CAN_RX_FIFO1;
  sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
  sFilterConfig.FilterScale = CAN_FILTERSCALE_16BIT;
  sFilterConfig.FilterActivation = ENABLE;
  sFilterConfig.FilterBank = 14;
  sFilterConfig.SlaveStartFilterBank = 14;
  HAL_CAN_ConfigFilter(&hcan2, &sFilterConfig);
}

0 REPLIES 0