Skip to main content
dejanpojbic
Associate
March 5, 2014
Question

bxCAN - accept all ID messages

Posted on March 05, 2014 at 14:42

Hi all,

I have STM32F2 processor and I would like to receive all CAN messages with the valid frame and different IDs. Datasheet says a lot about configuring Identifier filtering, but nothing about how to configure it to accept all messages, that they are not discarded by HW.

Could you please tell me how to do that (Code sample)?

Thanks,

BR, Dejan

#stm32f2 #bxcan #filter
This topic has been closed for replies.

4 replies

stm322399
Senior
March 5, 2014
Posted on March 05, 2014 at 16:00

I simply configured a single filter (id 0 or 14) that matches any identifers: value and mask set to zero. Every packet goes to the FIFO0 of the target controler (filter 0 goes to bxcan0 and filter 14 goes to bxcan1).

// Use a single catch-all filter
filter.CAN_FilterIdHigh = 0;
filter.CAN_FilterIdLow = 0;
filter.CAN_FilterMaskIdHigh = 0;
filter.CAN_FilterMaskIdLow = 0;
filter.CAN_FilterFIFOAssignment = CAN_Filter_FIFO0;
filter.CAN_FilterNumber = (port==can_port) ? 0 : 14;
filter.CAN_FilterMode = CAN_FilterMode_IdMask;
filter.CAN_FilterScale = CAN_FilterScale_32bit;
filter.CAN_FilterActivation = ENABLE;
CAN_FilterInit(&filter);
CAN_SlaveStartBank(14);

dejanpojbic
Associate
March 5, 2014
Posted on March 05, 2014 at 16:29

Thanks for your respond. I also found out how it works by

http://www.st.com/web/en/catalog/tools/PF257898#

CAN example.

I notice that filter must be enabled, select mask list and ID set to 0.

karthigkin
Associate
August 1, 2014
Posted on August 01, 2014 at 08:06

sorry for this interrupt.i am new in this forum.i don't know how to post my doubts.pls help me.

Tesla DeLorean
Guru
August 1, 2014
Posted on August 01, 2014 at 16:40

Sorry for this interrupt.i am new in this forum.i don't know how to post my doubts.pls help me.

0690X000006059RQAQ.png
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..