LPC54616J512 CAN filter options

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC54616J512 CAN filter options

529 Views
paulnorström
Contributor I

Hello,

I'm trying to setup filters for the CAN fifo.

But I'm not having much luck, setting the globalmask for the fifo seems to work just fine, both reject and accept all but I'm having no luck at all when I try to set the individual masks. I have tried both fifos (FIFO0,FIFO1) but all messages get rejected. According to "LPC546xx CAN Driver API.pdf" those 2 lines setting the individual mask should work.

So whats wrong? 

CAN_Init(CAN0, &configCAN0.config, SystemCoreClock);
configCAN0.isInit = true;

   if(configCAN0.useFifo)
   {
      configCAN0.fifo_config.idFilterNum = 64;

      CAN_SetRxFifoConfig(CAN0, 0, &configCAN0.fifo_config, true);
      CAN_SetRxFifoConfig(CAN0, 1, &configCAN0.fifo_config, true);
      // CAN_SetRxGlobalMask(CAN0, kCAN_GlobalFilter_Standard_FIFO0 | kCAN_GlobalFilter_Extended_FIFO0);
      

      CAN_SetRxIndividualMask(CAN0, 0, CAN_RX_FIFO1_STD_MASK(0x100, 0x7FF));
      CAN_SetRxIndividualMask(CAN0, 1, CAN_RX_FIFO1_STD_MASK(0x101, 0x7FF));

   }

   CAN_Enable(CAN0, true);

#LPC54616J512 can filter‌ #CAN_SetRxIndividualMask

Labels (1)
0 Kudos
2 Replies

328 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Paul Norström,

Thank you for your interest in NXP Semiconductor products and the opportunity to serve you.
To provide the fastest possible support, I'd highly recommend you to refer to the mcan demos for details in SDK, and you can download the SDK library via the following link.
https://mcuxpresso.nxp.com/en/welcome
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

328 Views
paulnorström
Contributor I

Thank you for the link, but I have written alot of code for the LPC5461X CAN-FD driver so I'm not really interested in changing to mcan at this point.

0 Kudos