I am using the LPC54608 microcontroller and the SDK for Keil tools IDE.
In my application I need to change the acceptance registers from what was originally set up.
The "MCAN_SetFilterConfig" function to set the registers, but it only ORs the value, so bits already set can't be cleared...
base->GFC |= CAN_GFC_RRFE(config->remFrame) | CAN_GFC_ANFE(config->nmFrame);
base->XIDFC |= CAN_XIDFC_FLESA(config->address >> CAN_XIDFC_FLESA_SHIFT) | CAN_XIDFC_LSE(config->listSize);
Is this a bug, or is there something I'm missing?
Hello Ken,
If you want to change the acceptance registers, yes, you really need your second code (FIXED CODE), because your original code keep original setting.
BR
Alice
BR
Alice
Hello Ken,
About set CAN ID filter, you can have a look at this thread:
BR
Alice
I have no problem setting up multiple filter configurations...
I need to change the configuration later at some point in time and the current driver code does not allow doing that unless I preclear the registers or fix the driver code as shown below to set it equal to the config settings instead of ORing them...
ORIGINAL CODE
// base->GFC |= CAN_GFC_RRFE(config->remFrame) | CAN_GFC_ANFE(config->nmFrame);
// base->XIDFC |= CAN_XIDFC_FLESA(config->address >> CAN_XIDFC_FLESA_SHIFT) | CAN_XIDFC_LSE(config->listSize);
FIXED CODE
base->GFC = CAN_GFC_RRFE(config->remFrame) | CAN_GFC_ANFE(config->nmFrame);
base->XIDFC = CAN_XIDFC_FLESA(config->address >> CAN_XIDFC_FLESA_SHIFT) | CAN_XIDFC_LSE(config->listSize);
Is there something I'm missing that makes this work correctly with supplied drivers?