mpc5748g canfd receive

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

mpc5748g canfd receive

2,972 次查看
chenxiubo
Contributor III

Hi,

     I'm  using   mpc5748g  canfd module to receive lots of  messages. But canfd module can't use  Receive FIFO function.

Now I  am using one  buf  such as  buf[3]  to receive these messages(not rx interrupt), I found some messages  that missing.   

      My project need to receive can2.0b messages and canfd messages from car's controllers through  can bus.   If there are not canfd messages, I can using RX FIFO interrupt function to receive messages in case of losing messages. But there are canfd messages(canfd cannot use FIFO function).

     Here are my questions: Should I use Rx Interrupt function  without  FIFO? How can I configure registers?

Or if I don't need Rx Interrupt function to receive meesges,how can I configure registers?

      Thank you!

       Best Regards!

         Tom_Chen

      

      

4 回复数

2,310 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi Chen,

Yes, the Rx FIFO must not be enabled when CAN FD feature is enabled.

However using the RX interrupt is simple, each one of the Message buffers can be an interrupt source, if its corresponding IMASK bit is set. Assuming Interrupt controller is properly configured too.

So for your used MB3 set for RX, the interrupt is enabled when IMASK1 = 0x00000008;

BR, Petr

2,310 次查看
chenxiubo
Contributor III

Hi,Petr Stancik

     

        I  followed  your advice  and write two mpc5748g demos for canfd module using S32 IDE: one is no interrupt and it works OK(CAN0 MB0 transmit and CAN1 MB0 receive. I checked the CAN1 MB0's buffer( or array for RxDATA[j] )  and it's right). The other  demos I used CAN1 MB0 receive interrupt, but it's failed, it cannot enter into receive interrupt(1. I  set interrupt core and priority ,2.enabled  interrupt for CAN1 MB3( IMASK1 = 0x00000008;)

       I cannot find the reason why  it cannot be enter into receive interrupt.

       Please see the attachment.

       Best  Regards,

       Tom_Chen

  


,

0 项奖励
回复

2,310 次查看
PetrS
NXP TechSupport
NXP TechSupport

Seems you do not configure INTC at all in your code. The xcptn_xmpl() should be called.

Look at this demo example https://community.nxp.com/docs/DOC-332504 

BR, Petr

2,310 次查看
chenxiubo
Contributor III

Hi,

       I follwed your advice and added xcptn_xmpl(),  But it cannot enter can receive interrupt.

First, I used CAN0 BUF[0]  transmit message, CAN[1]  BUF[0]  receive interrupt,  it could enter can receive interrupt.

Second,I used CAN0 BUF[0]  transmit message, CAN[1]  BUF[3]  receive interrupt,  it could not enter can receive interrupt.

I checked again and not find any problem,could you please help me?

0 项奖励
回复