set MPC5748G LINFlexD0 in Identifier mask mode

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

set MPC5748G LINFlexD0 in Identifier mask mode

441 次查看
haiyang
Contributor III

board:DEVKIT-MPC5748G

IDE:S32DS PA 2.1

 

now ,i use the MPC5748G LIN0 interface ,i need to receive all message in the bus ;

so i nned set it to Identifier mask mode ,if there has some demo code?

the "MPC5748G-LINFlex-LIN-Master-Slave-test-GHS616" code is in Identifier list mode , not fit me

can you help me? 

 

0 项奖励
回复
5 回复数

434 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you should be able to modify a code for your need. Check chapter 45.4.2.6 Identifier filtering of the device RM and change IFER, IFMR, and IFCRn accordingly.

BR, Petr

0 项奖励
回复

409 次查看
haiyang
Contributor III

HI,

i use Lin0 in slave mode and i set filter as follow:

LINFlexD_0->IFER = 0x03;//
LINFlexD_0->IFMR = 0x01;//
 
 
LINFlexD_0->IFCR[0] = 0x15;//
LINFlexD_0->IFCR[0] |= 0x07<<LINFlexD_IFCR_DFL_SHIFT;
if (g_Lin0Cfg.checksumMode==CLASSIC_MODE)
{
  LINFlexD_0->IFCR[0] |= LINFlexD_IFCR_CCS(1); 
}
 
the Lin0 can receive all id , but it only can receive the message which lenth = 7 ;
i want receive all lenth message , how to config?
 
0 项奖励
回复

396 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

this is proper behavior. It is described in the RM
Screenshot 2024-05-23 134557.png

if there is match with filter then DFL, CCS, DIR is given by value set in IFCR. 
In case of no filter match and BF is set then you get RXI interrupt upon header reception and you can specify BIDR.

BR, Petr

0 项奖励
回复

393 次查看
haiyang
Contributor III

thank  reply

but ,when get into RXI ,i still  don't know how many bytes data will come in,may be 1 byte ,maybe 2 ,maybe 6...

so when into RXI ,what should write to BIDR?

0 项奖励
回复

391 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

on LIN systems this must be know in advance, during system specification, thus the ID specify payload, direction, CCS.
You cannot receive unknown payload using LINflexD.

BR, Petr

0 项奖励
回复