HI,
Excuse me, how to set the mask bit (eg: 0x400~0x41f) of a certain segment of the received message ID.
Thank you!
Haoming20220427
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
HI,
Excuse me, how to set the mask bit (eg: 0x400~0x41f) of a certain segment of the received message ID.
Thank you!
Haoming20220427
请看下面工程师的回复。
So essentially you are looking to add a range filter for all IDs from 0x400 to 0x47F?
Currently the MCAL CAN driver has the configuration where if for standard CAN IDs you set CanHandleType == CAN_FULL (in Can_Cfg.c) will in turn the SFT to 0x0 (Range Filter from SFID1 to SFID2) and SFID2 to 0x7FF (Max for standard IDs).
If you modify the Can_Cfg.c to update the CanHwFilterCode = 0x400 then this will modify the SFID1 to 0x400 and hence you should be able to setup a range filter from 0x400 to 0x7FF.
Now in case this doesn't work for you and leads to unintended message reception, then we need to make a driver modification to make SFID2 as 0x47F.
Hi,
Following your suggestion, I modified the code as follows:

But still unable to receive any ID in the 0x400~0x47F network segment.
The MCANSS_RX_BUFFER_ELEM_ID_MASK received at the bottom layer in Mcan.c is 0x1FFFF480U, and it still cannot be received
Cherry_hm 20220507