S32K144 Use MCAL PLL configuration

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

S32K144 Use MCAL PLL configuration

Jump to solution
5,780 Views
Embedded_novice
Contributor III

When I was using MCAL to configure the MCU clock, calling the Mcu_GetPLlStatus () function did not return the PLL_LOCKED signal. I found that the register was not set correctly in this MCU_initClock() function, only PLLEN was set to 1, but PLLSEL and PLLVLD were not set, resulting in the inability to achieve PLL locking.

The MCAL version I am using is SW32K1_S32M24xRTD_R21-11_2.0.0uP04, EB version 29.0.0. I would like to know how to solve this problem, whether it is caused by my configuration or other issues?(At the same time, I would like to know the meaning of the P04 suffix in SW32K1_S32M24xRtD_R21-11_2.0.0uP04).clock_cfg.png

Thanks for help!

0 Kudos
Reply
1 Solution
5,704 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Embedded_novice

P->PACTH

View solution in original post

0 Kudos
Reply
14 Replies
5,768 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Embedded_novice

The clock switching to PLL is not completed by "Mcu_InitClock".

Please try use the api "Mcu_DistributePllClock".

0 Kudos
Reply
5,765 Views
Embedded_novice
Contributor III

clock.png

This is the order of my API calls,I cannot escape from the while loop because the PLL_LOCKED signal is not set.

Tags (1)
0 Kudos
Reply
5,761 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Embedded_novice

I can't see any problem with this code. Make sure your current hardware has an external crystal clock.

0 Kudos
Reply
5,758 Views
Embedded_novice
Contributor III
The 8MHz clock of the external SOSC is normal.If there are any other suggestions that can be tried, please let me know. Thank you.
0 Kudos
Reply
5,754 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Embedded_novice

Could you provide me your project's elf file so I can help you test it.

0 Kudos
Reply
5,750 Views
Embedded_novice
Contributor III

Thanks for help!

Tags (1)
0 Kudos
Reply
5,726 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Embedded_novice

Could you please check your McuSystemPll configuration, make sure System PLL is enabled.

Senlent_0-1739344902451.png

 

0 Kudos
Reply
5,716 Views
Embedded_novice
Contributor III

Yes, that's how I did it.Can I send you the EB configuration project to check if there are any configuration errors.EB_CFG.png

0 Kudos
Reply
5,711 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Embedded_novice

You can refer to the routines we provide.

Senlent_1-1739347782755.png

 

 

0 Kudos
Reply
5,708 Views
Embedded_novice
Contributor III
Okay, I will first go to the reference configuration items of the routine. Thank you for your help. Also, may I ask what the meaning of P04 after the MACL name is?
0 Kudos
Reply
5,705 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Embedded_novice

P->PACTH

0 Kudos
Reply
5,696 Views
Embedded_novice
Contributor III
I have found the reason. Thank you for your help
0 Kudos
Reply
5,692 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Embedded_novice

Could you please share the reason why?

0 Kudos
Reply
5,688 Views
Embedded_novice
Contributor III
In MCU ->McuLockSettingConfig ->McuSOSCClockConfig, there is an option called "select external reference clock". When I uncheck this option, it will run normally. I personally understand whether this is related to the crystal oscillator I am using. Currently, I am using an external crystal oscillator, and the external clock source requires an internal OSC oscillator to drive my crystal oscillator to start oscillating. When I use an active crystal oscillator, it can start oscillating directly through external voltage without the need for an internal oscillator to provide a source.
%3CLINGO-SUB%20id%3D%22lingo-sub-2042162%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042162%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWhen%20I%20was%20using%20MCAL%20to%20configure%20the%20MCU%20clock%2C%20calling%20the%20Mcu_GetPLlStatus%20()%20function%20did%20not%20return%20the%20PLL_LOCKED%20signal.%20I%20found%20that%20the%20register%20was%20not%20set%20correctly%20in%20this%20MCU_initClock()%20function%2C%20only%20PLLEN%20was%20set%20to%201%2C%20but%20PLLSEL%20and%20PLLVLD%20were%20not%20set%2C%20resulting%20in%20the%20inability%20to%20achieve%20PLL%20locking.%3C%2FP%3E%3CP%3EThe%20MCAL%20version%20I%20am%20using%20is%20SW32K1_S32M24xRTD_R21-11_2.0.0uP04%2C%20EB%20version%2029.0.0.%20I%20would%20like%20to%20know%20how%20to%20solve%20this%20problem%2C%20whether%20it%20is%20caused%20by%20my%20configuration%20or%20other%20issues%3F%EF%BC%88At%20the%20same%20time%2C%20I%20would%20like%20to%20know%20the%20meaning%20of%20the%20P04%20suffix%20in%20SW32K1_S32M24xRtD_R21-11_2.0.0uP04%EF%BC%89.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22clock_cfg.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22clock_cfg.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F323521iEB0601720F925442%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22clock_cfg.png%22%20alt%3D%22clock_cfg.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThanks%20for%20help%EF%BC%81%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042472%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042472%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EIn%20MCU%20-%26gt%3BMcuLockSettingConfig%20-%26gt%3BMcuSOSCClockConfig%2C%20there%20is%20an%20option%20called%20%22select%20external%20reference%20clock%22.%20When%20I%20uncheck%20this%20option%2C%20it%20will%20run%20normally.%20I%20personally%20understand%20whether%20this%20is%20related%20to%20the%20crystal%20oscillator%20I%20am%20using.%20Currently%2C%20I%20am%20using%20an%20external%20crystal%20oscillator%2C%20and%20the%20external%20clock%20source%20requires%20an%20internal%20OSC%20oscillator%20to%20drive%20my%20crystal%20oscillator%20to%20start%20oscillating.%20When%20I%20use%20an%20active%20crystal%20oscillator%2C%20it%20can%20start%20oscillating%20directly%20through%20external%20voltage%20without%20the%20need%20for%20an%20internal%20oscillator%20to%20provide%20a%20source.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042459%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042459%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EEmbedded_novice%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ECould%20you%20please%20share%20the%20reason%20why%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042455%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042455%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EI%20have%20found%20the%20reason.%20Thank%20you%20for%20your%20help%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042403%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042403%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EEmbedded_novice%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EP-%26gt%3BPACTH%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042396%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042396%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EOkay%2C%20I%20will%20first%20go%20to%20the%20reference%20configuration%20items%20of%20the%20routine.%20Thank%20you%20for%20your%20help.%20Also%2C%20may%20I%20ask%20what%20the%20meaning%20of%20P04%20after%20the%20MACL%20name%20is%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042390%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042390%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EEmbedded_novice%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EYou%20can%20refer%20to%20the%20routines%20we%20provide.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_1-1739347782755.png%22%20style%3D%22width%3A%20726px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_1-1739347782755.png%22%20style%3D%22width%3A%20726px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F323587i19FAB9310CEFA632%2Fimage-dimensions%2F726x147%3Fv%3Dv2%22%20width%3D%22726%22%20height%3D%22147%22%20role%3D%22button%22%20title%3D%22Senlent_1-1739347782755.png%22%20alt%3D%22Senlent_1-1739347782755.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042383%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042383%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EYes%2C%20that's%20how%20I%20did%20it.Can%20I%20send%20you%20the%20EB%20configuration%20project%20to%20check%20if%20there%20are%20any%20configuration%20errors.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22EB_CFG.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22EB_CFG.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F323584i95EC66A9A42B6678%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22EB_CFG.png%22%20alt%3D%22EB_CFG.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042328%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042328%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EEmbedded_novice%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ECould%20you%20please%20check%20your%20McuSystemPll%20configuration%2C%20make%20sure%20System%20PLL%20is%20enabled.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_0-1739344902451.png%22%20style%3D%22width%3A%20631px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_0-1739344902451.png%22%20style%3D%22width%3A%20631px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F323563i5A67B84C492FEBE6%2Fimage-dimensions%2F631x374%3Fv%3Dv2%22%20width%3D%22631%22%20height%3D%22374%22%20role%3D%22button%22%20title%3D%22Senlent_0-1739344902451.png%22%20alt%3D%22Senlent_0-1739344902451.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042264%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042264%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThanks%20for%20help!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042256%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042256%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EEmbedded_novice%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ECould%20you%20provide%20me%20your%20project's%20elf%20file%20so%20I%20can%20help%20you%20test%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042246%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042246%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EThe%208MHz%20clock%20of%20the%20external%20SOSC%20is%20normal.If%20there%20are%20any%20other%20suggestions%20that%20can%20be%20tried%2C%20please%20let%20me%20know.%20Thank%20you.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042243%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042243%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EEmbedded_novice%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EI%20can't%20see%20any%20problem%20with%20this%20code.%20Make%20sure%20your%20current%20hardware%20has%20an%20external%20crystal%20clock.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042240%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042240%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22clock.png%22%20style%3D%22width%3A%20523px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22clock.png%22%20style%3D%22width%3A%20523px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F323538iB44AC08B1085233F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22clock.png%22%20alt%3D%22clock.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThis%20is%20the%20order%20of%20my%20API%20calls%EF%BC%8CI%20cannot%20escape%20from%20the%20while%20loop%20because%20the%20PLL_LOCKED%20signal%20is%20not%20set.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2042221%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Use%20MCAL%20PLL%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2042221%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EEmbedded_novice%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20clock%20switching%20to%20PLL%20is%20not%20completed%20by%20%22Mcu_InitClock%22.%3C%2FP%3E%0A%3CP%3EPlease%20try%20use%20the%20api%20%22Mcu_DistributePllClock%22.%3C%2FP%3E%3C%2FLINGO-BODY%3E