CAN FD Interrupts on MPC5748G

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

CAN FD Interrupts on MPC5748G

跳至解决方案
1,331 次查看
OwenH
Contributor II

Hello,

I'm implementing CAN FD on the MPC5748G and I don't seem to be getting an interrupt when a message is sent or received. I can successfully send messages as well as receive them from checking the memory and CANAlyser and I can see that the corresponding bits are set in the IFLAG registers. Whether I set or clear the corresponding bits in the IMASK registers for that buffer however the ISR doesn't seem to fire.

I'm calling xcptn_xmpl() so the ISRs should be enabled and have my routines in the vector table for the buffers on that CAN port. Is there anything else I should check as to why the interrupts might not be happening? Other interrupts are working so it seems to just be something with my CAN FD code.

Many thanks,

Owen

标记 (3)
0 项奖励
1 解答
1,310 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

set also interrupt core and priority for each vector using INTC PSR register e.g.

INTC.PSR[604].R = 0x8001; 

BR, Petr

在原帖中查看解决方案

0 项奖励
5 回复数
1,311 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

set also interrupt core and priority for each vector using INTC PSR register e.g.

INTC.PSR[604].R = 0x8001; 

BR, Petr

0 项奖励
1,301 次查看
OwenH
Contributor II

That was it! Thank you for your help!

Owen

0 项奖励
1,325 次查看
BenMW
Contributor I

Do you enable the interrupts and assign the callback function?

void FLEXCAN_DRV_InstallEventCallback(uint8_t instance, flexcan_callback_t callback, void *callbackParam)

and (if needed)

void FLEXCAN_DRV_InstallErrorCallback(uint8_t instance, flexcan_error_callback_t callback, void *callbackParam)

0 项奖励
1,322 次查看
OwenH
Contributor II

I enable the interrupts by setting the bits in the IMASK registers for the CAN Port and I've referenced the callback directly in the vector table. Do I also need to set them up using those function calls? If so where is that function defined?

0 项奖励
1,318 次查看
BenMW
Contributor I

You can find the functions in flexcan_driver.c/.h files. I'm new to NXP so I cannot give you information if your vector table is correct. But you can compare your settings with the implementation of the driver functions.

0 项奖励