2014-03-05 05:42 AM
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 #filter2014-03-05 07:00 AM
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);
2014-03-05 07:29 AM
Thanks for your respond. I also found out how it works by
CAN example.I notice that filter must be enabled, select mask list and ID set to 0.2014-07-31 11:06 PM
2014-08-01 07:40 AM
Sorry for this interrupt.i am new in this forum.i don't know how to post my doubts.pls help me.