S32K144 Flexcan interrupt MB

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

S32K144 Flexcan interrupt MB

跳至解决方案
2,166 次查看
HYJ
Contributor I

@nxp 

Hello, I have a question for you

platform: s32k144 + s32ds-3.5 +s32k1-RTD_1.0.1

At present, I am using the can function of S32K144, using the official demo (loopback mode), the data reception is normal, and the reception interrupt can be entered.

When I changed to normal mode and followed the function interface in the routine, I found that it could not send and receive, the interrupt function could not enter, and the return value was different for different mailboxes. For example, if you use mailboxes below 10, you will return 2(busy) and 4(MB overflow), and if you use mailboxes above 10, you will always report 2(busy).

Thank you very much for your reply

0 项奖励
回复
1 解答
2,135 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

as I wrote, if 16Mbs are enabled with RXFIFO using 8filter elements then MB8-15 can be used for TX/RX operation. MB0-7 are used by RXFIFO.
Then, do you have other node 
connected to your MCU via CAN bus? So that other node can send message so MCU can receive it. Also when MCU is sending other node is ACKing it?

If not then no TX MB interrupt will be called upon MCU is sending message, due to ACK error detected.
Also no RX MB interrupt will be called as device is disconnected from bus.
In loopback mode FlexCAN behaves as it normally does when transmitting and treats its own
transmitted message as a message received from a remote node. To ensure proper reception of its own message, FlexCAN ignores the bit sent during the ACK slot in the CAN frame acknowledge field. Both transmit and receive interrupts are generated. 

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
3 回复数
2,152 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you have configured FlexCAN to use 16MBs, but with RXFIFO enabled with 8 filter elements. Thus MB0 to MB5 are used for RXFIFO engine and MB6-7 to define filter elements. MB8-15 can be used for TX/RX operation. 

You can repeatedly call Send/Receive function after previous TX/RX is done, FlexCAN_Ip_GetTransferStatus can be used to know MB status, or use Callback for that.

If you changed to normal mode, what is your connection to other mode? Do you have CAN pin initialized and have CAN transceiver active?

BR, Petr

0 项奖励
回复
2,148 次查看
HYJ
Contributor I
i also have configured FlexCAN to use 16MBs, and the RXFIFO enabled with 8 filter elements. i have initialized CAN pin and the CAN transceiver also actived.

I have tried using 0-16 MB for receiving or sending, but the interrupt never go in and the callback is also not fired.

i want to know I wonder why the interrupt function doesn't get in, but the loop test does. In other words, how should I configure to receive and send normal.

BR
0 项奖励
回复
2,136 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

as I wrote, if 16Mbs are enabled with RXFIFO using 8filter elements then MB8-15 can be used for TX/RX operation. MB0-7 are used by RXFIFO.
Then, do you have other node 
connected to your MCU via CAN bus? So that other node can send message so MCU can receive it. Also when MCU is sending other node is ACKing it?

If not then no TX MB interrupt will be called upon MCU is sending message, due to ACK error detected.
Also no RX MB interrupt will be called as device is disconnected from bus.
In loopback mode FlexCAN behaves as it normally does when transmitting and treats its own
transmitted message as a message received from a remote node. To ensure proper reception of its own message, FlexCAN ignores the bit sent during the ACK slot in the CAN frame acknowledge field. Both transmit and receive interrupts are generated. 

BR, Petr

0 项奖励
回复