AnsweredAssumed Answered

CAN RECEIVE FILTER CONFIGURATION

Question asked by MK.ShaSha on Mar 4, 2016
Latest reply on Mar 8, 2016 by MK.ShaSha
Hello!
I am using a custom made STM32F302RE board.

I want configure the filter such that I would be able to receive all messages.
I have coded it as follows:
            int i;
      for ( i=0 ; i<=14 ; i++ ){
        
        /* Allow all messages to be received */
            CAN_FilterConfTypeDef sFilterConfig;
            sFilterConfig.BankNumber = 0;
            sFilterConfig.FilterActivation = ENABLE; 
            sFilterConfig.FilterNumber = i; 
            sFilterConfig.FilterFIFOAssignment = 0;
            sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
            sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
            sFilterConfig.FilterMaskIdLow = 0;
            sFilterConfig.FilterMaskIdHigh = 0;
            sFilterConfig.FilterIdLow = 0;
            sFilterConfig.FilterIdHigh = 0;
  
    
        HAL_CAN_ConfigFilter(&hcan, &sFilterConfig);
}
      
    HAL_CAN_Receive_IT(&hcan, CAN_FIFO0);

However, I do not receive all messages as I wanted. is there anything wrong in the filter configuration?? Any suggestions? Thanks!

Outcomes