S32K142 - CAN not works in VLPR mode

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

S32K142 - CAN not works in VLPR mode

Jump to solution
1,023 Views
EddieChen
Contributor I

Hi,

In order to reduce power consumption, we have to set power mode as VLPR and make sure CAN is work for application.

In the datesheet "S32K-RM", it describes that CAN function is FF in VLPR Mode(as bleow). But in the test, CAN is not work when power mode is VLPR. We trace the source and find that code is stuck in FLEXCAN_Enable(). Then we check the register, MCR.NOTRDY = 1 and MCR.LPMACK = 1 that means CAN is in disable mode or stop mode. 

We try to set power mode as RUN mode and CAN is work.

Do you have any suggestion or eample code for us to solve this state? thank you!

0 Kudos
Reply
1 Solution
1,012 Views
EddieChen
Contributor I

Hi PetrS,

Thank you for your response.

CAN protocol clock is active but bit time is not 250kbps(now is 500kbps). We check data sheet(S32K-RM) and it describes that Maximum achievable baud rate (Mbps) is 0.667 in S32K1xx (VLPR). So do you have any idea about the difference? And we will do test according to you suggestion. thank you!

[9/7] Even though we change bit rate to 250kpbs, result is the same(stuck in FLEXCAN_Enable()) and CAN not works.

[9/8] We follow the example code to run in RUN mode first and change to VLPR mode and then use 

FLEXCAN_DRV_SetBitrate() to change bit time. But CAN still not works and system is stuck in 
FLEXCAN_EnterFreezeMode() because it can not enter freeze mode.
 
[9/8][Fixed] Now CAN works in VLPR mode and baud rate is 500kpbs. And there are modification as below
1.Set PE clock source as Peripheral clock
2.Use API CAN_SetBitrate() to update baud rate for 500kpbs in 4MHz in VLPR mode

View solution in original post

0 Kudos
Reply
3 Replies
1,018 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

be sure CAN protocol clock is active, i.e system clock is selected (CLKSRC is set) and CAN bit timing is set to be max 250kbit based on system clock in VLPR (4MHz).
You can refer to some example in https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K116-FlexCAN-VLPR-test-S32DS-ARM-2-2/ta-...

BR, Petr

0 Kudos
Reply
1,013 Views
EddieChen
Contributor I

Hi PetrS,

Thank you for your response.

CAN protocol clock is active but bit time is not 250kbps(now is 500kbps). We check data sheet(S32K-RM) and it describes that Maximum achievable baud rate (Mbps) is 0.667 in S32K1xx (VLPR). So do you have any idea about the difference? And we will do test according to you suggestion. thank you!

[9/7] Even though we change bit rate to 250kpbs, result is the same(stuck in FLEXCAN_Enable()) and CAN not works.

[9/8] We follow the example code to run in RUN mode first and change to VLPR mode and then use 

FLEXCAN_DRV_SetBitrate() to change bit time. But CAN still not works and system is stuck in 
FLEXCAN_EnterFreezeMode() because it can not enter freeze mode.
 
[9/8][Fixed] Now CAN works in VLPR mode and baud rate is 500kpbs. And there are modification as below
1.Set PE clock source as Peripheral clock
2.Use API CAN_SetBitrate() to update baud rate for 500kpbs in 4MHz in VLPR mode
0 Kudos
Reply
516 Views
john24
Contributor III

Hi EddieChen,

I have read your post, which is very helpful. I also like to check with you: When you "Use API CAN_SetBitrate() to update baud rate for 500kpbs in 4MHz in VLPR mode", what are the values that you are setting this struct with:

typedef struct {
    uint32_t propSeg;         /*!< Propagation segment*/
    uint32_t phaseSeg1;       /*!< Phase segment 1*/
    uint32_t phaseSeg2;       /*!< Phase segment 2*/
    uint32_t preDivider;      /*!< Clock prescaler division factor*/
    uint32_t rJumpwidth;      /*!< Resync jump width*/
} flexcan_time_segment_t;
 
Please advise. Thank you!
0 Kudos
Reply