S32K358 FlexCAN Receive Standard and Extended IDs

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K358 FlexCAN Receive Standard and Extended IDs

715件の閲覧回数
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 件の賞賛
返信
3 返答(返信)

681件の閲覧回数
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 件の賞賛
返信

621件の閲覧回数
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 件の賞賛
返信

591件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport