S32K358 FlexCAN Receive Standard and Extended IDs

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

S32K358 FlexCAN Receive Standard and Extended IDs

709 Views
Erik_etelligent
Contributor I

Hello,

I've been trying to configure the the FlexCAN to be able to receive CAN Frames with extended and standard IDs.

I used the CAN Example for the S32K358 as it is.

So I set the CAN ID Message Type of the Receive CanHardwareObject to MIXED.

Erik_etelligent_0-1721130747602.png

After generating the source code and compiling I noticed, that I don't get an RX Indication for CAN Frames with Standard ID but it works for Extended IDs.

After some investigation, I noticed that the Hardware Filter has a value

/**
*   @brief  Hardware Filter of CanHardwareObject_0
*/
static const Can_43_FLEXCAN_HwFilterType Can_aHwFilter_Object0=
{
    (uint32)0x0U,
    (uint32)0xc0000000U
};

So I played a little bit around and noticed, that when I set the value to  0x80000000, I can receive Messages for both ID types.

I was unable to figure out, where exactly this value is used or whether it's written directly into a register.

I somebody able to explain to me what is happening?

0 Kudos
Reply
3 Replies

675 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

value 0xC0000000U is written into respective mask acceptance register. The
two most significant bits affect the fields RTR and IDE, which are located in the Control and Status word of the MB.

PetrS_0-1721207489633.png

If CTRL2[EACEN]=1 then both bits is compared. That's why you can only receive extended ID, as MBs configured as MIXED and RECEIVE type will be treated as EXTENDED.  

BR, Petr

 

0 Kudos
Reply

615 Views
Erik_etelligent
Contributor I

But this is not the desired behavior right?

It's unclear to me why there is the option MIXED if it behaves the same way as EXTENDED.

0 Kudos
Reply

585 Views
PetrS
NXP TechSupport
NXP TechSupport