MPC5746C FlexCAN can't trigger the reception interrupt and can't receive data with SDK 3.0

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

MPC5746C FlexCAN can't trigger the reception interrupt and can't receive data with SDK 3.0

517 次查看
huaqingren
Contributor I

I have configured the FlexCAN in the GUI with SDK 3.0, the details as the attachment. And when I initial the flexcan channle0, use the follow code: 

flexcan_data_info_t dataInfo =
{
.msg_id_type = FLEXCAN_MSG_ID_STD,
.fd_padding = 0x00,
.data_length = 8,
.fd_enable = false,
.enable_brs = false,
.is_remote = false
};
 
FLEXCAN_DRV_ConfigRxMb(0U, 0U, &dataInfo, 0x300);
INT_SYS_EnableIRQ(CAN0_ORed_00_03_MB_IRQn);
FLEXCAN_DRV_Receive(0U,0U,&getdata);
FLEXCAN_DRV_Init(0U,&canCom0_State,&canCom0_InitConfig0);
 
And the test result is that the 'CAN0_ORed_00_03_MB_IRQn' interrupt can't be triggered. Would you help to check the issue, is there any incorrect code?
0 项奖励
3 回复数

504 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

first init driver then prepare RXMB and start reception. Interrupt need not to be enabled, it is done within driver.
You can refer to below example, it adds RXFIFO and DMA as well but you can see how interrupt callback is installed and used.
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5748G-FlexCAN-RXFIFO-DMA-SDK303-S32DS...

BR, Petr

0 项奖励

501 次查看
huaqingren
Contributor I

Thank you for your reply. I have fixed this issue. But I have meet another question, how to just disable transimit interrupt and reserve reception interrupt. Could you support me?

0 项奖励

493 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

TX MB/RX MB interrupts are enabled/disabled by driver. So you should not to manage this along with the flexcan driver. Upon successful message transmission the MB interrupt is called, callback (if installed) is called within interrupt with FLEXCAN_EVENT_TX_COMPLETE event. 

BR, Petr

0 项奖励