I try to set several CAN filters in my application. For some reason only the first one is taken into account. My code:
ROM **rom = (ROM **)0x1fff1ff8;
void set_filter( uint8_t can_msg_obj, uint32_t msg_filter_id, uint32_t msg_filter_mask)
{
CAN_MSG_OBJ can_filter;
can_filter.msgobj = can_msg_obj;
can_filter.mode_id = msg_filter_id;
can_filter.mask = msg_filter_mask;
(*rom)->pCAND->config_rxmsgobj(&can_msg_filer);
}
(*rom)->pCAND->init_can(&ClkInitTable[0], 1);
(*rom)->pCAND->config_calb(&callbacks);
NVIC_EnableIRQ(CAN_IRQn);
set_filter(1, 0x100, 0x700);
set_filter(2, 0x200, 0x700);
So when I send a CAN message with ID:100 I can see that CAN_rx has called. when I send a CAN message with ID:200 nothing happens.
Sure, I can set filter 0x0 with mask 0x0 and so receive all the messages but I still look for the right solution with filters.