cancel
Showing results for 
Search instead for 
Did you mean: 

bxCAN Identifier list mode

RMyer.1
Associate III

Hi All,

I've looked around trying to find an example (with no luck) of how someone might set up the bxCAN module message filters to operate in ID list mode and how to assign the ID's to the various message filters - eg (CAN_FiRx) (i = 0..13, x = 1, 2).

So assuming the CAN config is all done up to this point for 32-bit filter mode, how would I do something like this:

CAN_F0R1 - CAN_F0R2 Filter to accept from ID 0x129

CAN_F1R1 - CAN_F1R2 Filter to accept from ID 0x290

CAN_F2R1 - CAN_F2R2 Filter to accept from ID 0x436

.....

And so on for as many ID's as I'd like to add.

Then once that is done what is the best way to offload them out of FIFO0 to another buffer when the message data from each accepted ID can be accessed as needed.

Thank you.

2 REPLIES 2
Bouraoui Chemli
ST Employee

Hi @RMyer.1​ 

Which MCU did you use ?

"Then once that is done what is the best way to offload them out of FIFO0 to another buffer when the message data from each accepted ID can be accessed as needed"

==> I suggest you to use reception in interrupt mode, Indeed the HAL functions: HAL_CAN_ActivateNotification(), HAL_CAN_RxFifo0MsgPendingCallback() and HAL_CAN_GetRxMessage. When you provide the MCU part number, I will point you to the right firmware CAN example.

Bouraoui

RMyer.1
Associate III

Thanks Bouraoui,

I got the ID filter set up sorted out thanks.

The MCU I am using is the STM32F303K8, I would certainly appreciate an example on how to use those HAL functions you mentioned.

Regards.