S32K348 CANFD normal communication

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K348 CANFD normal communication

Jump to solution
2,277 Views
youngkin
Contributor III

hello:

Can you provide a can fd sample(s32k344 or s32k3358), thanks!

Tags (1)
0 Kudos
Reply
1 Solution
2,166 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

1) Using IP level driver this is set withing code

If FlexCAN_Ip_Send function is called with tx_info.polling=TRUE, then for each MB used you need to periodically call FlexCAN_Ip_MainFunctionWrite with respective MB selected as parameter. This is to process transmitted Tx MB and update driver status variable.
If tx_info.polling=FALSE, FlexCAN_Ip_MainFunctionWrite calling is not needed, but module interrupt must be properly enabled and handler assigned.
 
For receiving isPolling parameter of Receive function specifies interrupt/polling mode.
Here again if polling is used you need to call FlexCAN_Ip_MainFunctionRead periodically, otherwise module interrupt must be properly enabled and handler assigned.
 
2) correct
 
3) either you can assign/enable interrupt in IntCtrl_Ip component and within code just IntCtrl_Ip_Init(&IntCtrlConfig_0) is called or
leave this empty in IntCtrl_Ip component and assign/enable interrupt within code, like

IntCtrl_Ip_Init(&IntCtrlConfig_0);
IntCtrl_Ip_EnableIrq(FlexCAN0_1_IRQn);
IntCtrl_Ip_InstallHandler(FlexCAN0_1_IRQn, CAN0_ORED_0_31_MB_IRQHandler, NULL_PTR);

BR, Petr

View solution in original post

0 Kudos
Reply
6 Replies
2,252 Views
PetrS
NXP TechSupport
NXP TechSupport
0 Kudos
Reply
2,248 Views
youngkin
Contributor III

Hello:

I have studied this example( https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K358-FlexCAN-TXRX-ISR-S32DS35-RTD400-500...), but I have a question, how do I set up the mailbox and filtering for CAN FD。 Should  I   add the can driver module 

youngkin_2-1761046846492.png

 

youngkin_1-1761046812116.png

 

and i  cannot find  the Mode of  can rx and tx (polling or  interrupt)

youngkin_0-1761046634231.png

Also, I would like to inquire about the examples of CAN. can sample use CAN mcal module(Can_43_FLEXCAN), while Flexcan sample use Drivers module(Flexcan). Can  Flexcan module and  Can_43_FLEXCAN  module appear in the same project at the same time?

Tags (1)
0 Kudos
Reply
2,237 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if using IP level driver then MB and mask is simply configured within code using respective API

PetrS_0-1761051486779.png

If using mcal level driver, ID and mask is defined in configuration, you outlined.

Flexcan_IP and  Can_43_FLEXCAN  modules can be used in the same project at the same time, but not for same FlexCAN instance.

BR, Petr

0 Kudos
Reply
2,217 Views
youngkin
Contributor III

I am sorry, I would like to confirm three questions,

1. i cannot find the Mode of can rx and tx (polling or interrupt)in the sample(Example-S32K358-FlexCAN-TXRX-ISR-S32DS35-RTD400),   how to set  the mode of rx and tx?

youngkin_0-1761095849911.png

2. about the can clock set,This clock value only needs to be written as one value(Any value)。

youngkin_1-1761095936768.png

the can peripheral clock  need not  Choose a reference clock,as  show

youngkin_2-1761096322351.png

3.  the sample use the can interrupt, but i can not find the interrupt set

youngkin_3-1761097001570.png

 

0 Kudos
Reply
2,167 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

1) Using IP level driver this is set withing code

If FlexCAN_Ip_Send function is called with tx_info.polling=TRUE, then for each MB used you need to periodically call FlexCAN_Ip_MainFunctionWrite with respective MB selected as parameter. This is to process transmitted Tx MB and update driver status variable.
If tx_info.polling=FALSE, FlexCAN_Ip_MainFunctionWrite calling is not needed, but module interrupt must be properly enabled and handler assigned.
 
For receiving isPolling parameter of Receive function specifies interrupt/polling mode.
Here again if polling is used you need to call FlexCAN_Ip_MainFunctionRead periodically, otherwise module interrupt must be properly enabled and handler assigned.
 
2) correct
 
3) either you can assign/enable interrupt in IntCtrl_Ip component and within code just IntCtrl_Ip_Init(&IntCtrlConfig_0) is called or
leave this empty in IntCtrl_Ip component and assign/enable interrupt within code, like

IntCtrl_Ip_Init(&IntCtrlConfig_0);
IntCtrl_Ip_EnableIrq(FlexCAN0_1_IRQn);
IntCtrl_Ip_InstallHandler(FlexCAN0_1_IRQn, CAN0_ORED_0_31_MB_IRQHandler, NULL_PTR);

BR, Petr

0 Kudos
Reply
2,149 Views
youngkin
Contributor III
thanks for your help
0 Kudos
Reply