S32k312 Eval board - Get frequency API issue

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

S32k312 Eval board - Get frequency API issue

230 Views
Thalapushpam1
Contributor I

Dear Sir/Madam,

Using S32k312 Mini Eval board for our application.  SW32K3_S32M27x_RTD_R21-11_5.0.0 RTD version used.

Wnen get clock frequency called getting hard fault error,  

Mcu_GetClockFrequency(SCS_CLK); - hard fault error

Mcu_GetClockFrequency(AIPS_PLAT_CLK); - hard fault error

Mcu_GetClockFrequency(CORE_CLK); - hard fault error

Mcu_GetClockFrequency(CLKOUT_RUN_CLK);  - working fine

Thalapushpam1_0-1779452196078.png

This is the sequence I used for clock init,

Thalapushpam1_1-1779452432930.png

 

Added some delay after Mcu_SetMode(McuModeSettingConf_0); & tried still got the same issue. Is it PLL stabilization take time? if yes how long?

I want to set the systick based on the core clock frequency using 

OsIf_Timer_System_Internal_Init() API. can you support. 
 
Thanks.

 

0 Kudos
Reply
1 Reply

119 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @Thalapushpam1 

Could you please compare your configuration with the attached .mex file? I have created a simple test on my side, calling Mcu_GetClockFrequency for some of the clocks you mentioned, and I did not encounter any issues. For your reference, I am also attaching my main file.

Regarding the OsIf TimerClockRef, I believe the following thread could be a helpful reference:

Delay function using OSIF

 

BR, VaneB

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2370200%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32k312%20Eval%20board%20-%20Get%20frequency%20API%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2370200%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDear%20Sir%2FMadam%2C%3C%2FP%3E%3CP%3EUsing%20S32k312%20Mini%20Eval%20board%20for%20our%20application.%26nbsp%3B%26nbsp%3BSW32K3_S32M27x_RTD_R21-11_5.0.0%20RTD%20version%20used.%3C%2FP%3E%3CP%3EWnen%20get%20clock%20frequency%20called%20getting%20hard%20fault%20error%2C%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3EMcu_GetClockFrequency(SCS_CLK)%3B%20-%20hard%20fault%20error%3C%2FP%3E%3CP%3EMcu_GetClockFrequency(AIPS_PLAT_CLK)%3B%20-%20hard%20fault%20error%3C%2FP%3E%3CP%3EMcu_GetClockFrequency(CORE_CLK)%3B%20-%20hard%20fault%20error%3C%2FP%3E%3CP%3EMcu_GetClockFrequency%3CSTRONG%3E(CLKOUT_RUN_CLK)%3B%26nbsp%3B%20-%20working%20fine%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Thalapushpam1_0-1779452196078.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Thalapushpam1_0-1779452196078.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F386531iE7950CBFC77F2037%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Thalapushpam1_0-1779452196078.png%22%20alt%3D%22Thalapushpam1_0-1779452196078.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThis%20is%20the%20sequence%20I%20used%20for%20clock%20init%2C%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Thalapushpam1_1-1779452432930.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Thalapushpam1_1-1779452432930.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F386532i35B63881C36FBC77%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Thalapushpam1_1-1779452432930.png%22%20alt%3D%22Thalapushpam1_1-1779452432930.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAdded%20some%20delay%20after%20Mcu_SetMode(McuModeSettingConf_0)%3B%20%26amp%3B%20tried%20still%20got%20the%20same%20issue.%20Is%20it%20PLL%20stabilization%20take%20time%3F%20if%20yes%20how%20long%3F%3C%2FP%3E%3CP%3EI%20want%20to%20set%20the%20systick%20based%20on%20the%20core%20clock%20frequency%20using%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EOsIf_Timer_System_Internal_Init()%20API.%20can%20you%20support.%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EThanks.%3C%2FDIV%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2371410%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32k312%20Eval%20board%20-%20Get%20frequency%20API%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2371410%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F262976%22%20target%3D%22_blank%22%3E%40Thalapushpam1%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECould%20you%20please%20compare%20your%20configuration%20with%20the%20attached%20.mex%20file%3F%20I%20have%20created%20a%20simple%20test%20on%20my%20side%2C%20calling%20Mcu_GetClockFrequency%20for%20some%20of%20the%20clocks%20you%20mentioned%2C%20and%20I%20did%20not%20encounter%20any%20issues.%20For%20your%20reference%2C%20I%20am%20also%20attaching%20my%20main%20file.%3C%2FP%3E%0A%3CP%3ERegarding%20the%20OsIf%20TimerClockRef%2C%20I%20believe%20the%20following%20thread%20could%20be%20a%20helpful%20reference%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FDelay-function-using-OSIF%2Fm-p%2F1946299%22%20target%3D%22_blank%22%3EDelay%20function%20using%20OSIF%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%2C%20VaneB%3C%2FP%3E%3C%2FLINGO-BODY%3E