AnsweredAssumed Answered

STM32 F103 - How to configure CAN filters in ID List mode?

Question asked by Ki_dy_.Jerzy.001 on Feb 23, 2017
Latest reply on Feb 23, 2017 by Imen D

Hello,

I can configure can filters using filter mask mode, but I have problem with configuring them in ID List mode.

There is a code for ID mask mode i used:

      sFilterConfig.BankNumber = 0;
      sFilterConfig.FilterNumber = 0;
      sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
      sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
      sFilterConfig.FilterIdHigh = 0x10<<5;
      sFilterConfig.FilterIdLow = 0;
      sFilterConfig.FilterMaskIdHigh = 0xff<<5;
      sFilterConfig.FilterMaskIdLow = 0;
      sFilterConfig.FilterFIFOAssignment = 0;
      sFilterConfig.FilterActivation = ENABLE;
      HAL_CAN_ConfigFilter(&hcan, &sFilterConfig);

And it works fine. I tried to write analogous code for ID List mode:

    sFilterConfig.FilterMode = CAN_FILTERMODE_IDLIST;
    sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
    sFilterConfig.BankNumber = 1
    sFilterConfig.FilterNumber = 0
    sFilterConfig.FilterIdHigh  = 0x10<<5;
    sFilterConfig.FilterIdLow = 0;
    sFilterConfig.FilterMaskIdHigh = 0;
    sFilterConfig.FilterMaskIdLow = 0;
    sFilterConfig.FilterFIFOAssignment = 0;
    sFilterConfig.FilterActivation = ENABLE;
    HAL_CAN_ConfigFilter(&hcan, &sFilterConfig);

With that code I can't receive any frames via CAN. 

Where am I wrong? 

Outcomes