cancel
Showing results for 
Search instead for 
Did you mean: 

bxCAN - accept all ID messages

dejanpojbic
Associate II
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
4 REPLIES 4
stm322399
Senior
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 II
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 II
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.

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
Up vote any posts that you find helpful, it shows what's working..