Hi,
The flexCan demo use polling to recieve data, i want to use flexCan interrupt.
I have made flexCan0 IRQ enable, and defined callback function.
According to (https://community.nxp.com/t5/S32K/Flexcan-interrupt-mode/m-p/785362), define callback function formit (See attachment).
But, it is not working normally. The first time can enter this function, second and others not enter IRQ function.
On debug:
TX mailbox is MB0, RX mailbox is MB1.
The first time, execute FlexCAN_Ip_Send(), Register IFLAG1 BIT0 and BIT1 is '1', transmit interrupt and reciver interrupt trigger(transmit interrupt not enable); after recieve interrupt callback, BIT1 clear.
then with debug tools, force to clear BIT0.
Second time, execute FlexCAN_Ip_Send(), Register IFLAG1 BIT0 and BIT1 no change. It seem abnormal.
Solved! Go to Solution.
Hi,
if selecting polling mode for sending message you should call FlexCAN_Ip_MainFunctionWrite to process transmitted Tx MessageBuffer, or do not select polling mode and it will be done within message interrupt.
Do not have code for S32R45 but attached is the code for S32K3xx, which should be similar. It shows usage of callback.
Hope it helps.
BR, Petr
Hi,
if selecting polling mode for sending message you should call FlexCAN_Ip_MainFunctionWrite to process transmitted Tx MessageBuffer, or do not select polling mode and it will be done within message interrupt.
Do not have code for S32R45 but attached is the code for S32K3xx, which should be similar. It shows usage of callback.
Hope it helps.
BR, Petr
The chip I am using is S32K314, I have the same problem, can cannot enter the interrupt, I refer to the MAIN.c file you sent, still can not enter the interrupt. How can I fix it? Thank you!
Thank you for your help, it's very useful.