s32k148 FlexCAN0 How to enter Stop mode and Pretended Networking mode

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

s32k148 FlexCAN0 How to enter Stop mode and Pretended Networking mode

1,155 Views
liuning_neu
Contributor II

hi  nxp expert:

    I used S32K148, I want to set  flexcan0 to  Pretended Networking mode, when  flexcan0  receive   a message ,  it will  enter  FLEXCAN_WakeUpHandler.  now, when flexcan0  receive   a message  ,it do not enter  FLEXCAN_WakeUpHandler, it  enter  FLEXCAN_IRQHandler,  meanwhile  CAN MCR[LPMACK]  is 0

my codes as following:

 FLEXCAN_DRV_ConfigPN(i, true, &flexcan_pn_config_struct[channel]);  //  set flexcan0 as  Pretended Networking mode

FLEXCAN_EnterFreezeMode(base);  //  enter freeze mode

g_smcBase->STOPCTRL = (g_smcBase->STOPCTRL & SMC_STOPCTRL_STOPO_MASK) | SMC_STOPCTRL_STOPO(2U);  //  global Stop mode request

FLEXCAN_ExitFreezeMode(base); //  exit  freeze mode

my question:

1 , how to  make  CAN MCR[LPMACK]  is 1, that is  enter  low power mode?

2, How do I  make  FlexCAN0 modules entered Stop mode and Pretended Networking mode correctly?

0 Kudos
4 Replies

1,032 Views
liuning_neu
Contributor II

hi  Petr Stancik:

 my questions:

1---- if  S32k148  in LOW POWER  MODE, can_MCR[LPM_ACK] =1, is it right?

2---- S32k148  flexcan0 only  in Pretended Networking mode(system  not in STOP mode), when flexcan0  receive   a message,will it enter FLEXCAN_WakeUpHandler?

3---  S32k148,    system   in STOP mode,  flexcan0 in Pretended Networking mode, when flexcan0  receive   a message,will it enter FLEXCAN_WakeUpHandler?

0 Kudos

1,032 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

1) yes

2) no, FlexCAN stays in normal mode, FLEXCAN_IRQHandler is called. MCR[PNET_EN] just allow to enter PN mode when chip is in stop mode.

3) yes

BR, Petr

0 Kudos

1,032 Views
liuning_neu
Contributor II

thank you very much 

0 Kudos

1,032 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

did you execute the WFI instruction which invokes stop modes for the chip?

BTW you can refer to below example, but it is not using SDK...

https://community.nxp.com/docs/DOC-346305 

BR, Petr

0 Kudos