MCXA153 SystemCoreClock default value

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

MCXA153 SystemCoreClock default value

703 Views
HugoArends
Contributor I

Intro

After a reset, he MCXA153 microcontroller runs ate 48MHz, because:

  • After reset, SCS bits in SCG->CSR = [011] : FIRC
  • After reset, FIRC (fro_hf) = 48 MHz, as stated in Reference Manual paragraph 21.2 (Rev. 7, 2024-10-22)
  • After reset, DIV bits in AHBCLKDIV = [00000000] : prescaler = 1

Problem

In the MCUXpresso SDK (26_03_00_pvw1), the SystemCoreClock global variable is configured in the function SystemCoreClockUpdate() in the file system_MCXA153.c. This is correct if the fsl_clock driver is used. If this driver is not used, the SystemCoreClock variable is set to 12MHz, which is not correct.

As a suggestion, update the following

In the file system_MCXA153.h, update the define:

#define DEFAULT_SYSTEM_CLOCK           12000000u           /* Default System clock value */
#define DEFAULT_SYSTEM_CLOCK           48000000u           /* Default System clock value */
 

In the file system_MCXA153.c, update the function SystemCoreClockUpdate() so it does not depend on the fsl_clock driver anymore and uses direct register access.

Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

661 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @HugoArends 

 

Thanks for your suggestion. I will report it to your internal team.
Thank you.
 
BR
Alice
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2333110%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMCXA153%20SystemCoreClock%20default%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2333110%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSTRONG%3EIntro%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EAfter%20a%20reset%2C%20he%20MCXA153%20microcontroller%20runs%20ate%2048MHz%2C%20because%3A%3C%2FP%3E%3CUL%3E%3CLI%3EAfter%20reset%2C%20SCS%20bits%20in%20SCG-%26gt%3BCSR%20%3D%20%5B011%5D%20%3A%20FIRC%3C%2FLI%3E%3CLI%3EAfter%20reset%2C%20FIRC%20(fro_hf)%20%3D%2048%20MHz%2C%20as%20stated%20in%20Reference%20Manual%20paragraph%2021.2%20(Rev.%207%2C%202024-10-22)%3C%2FLI%3E%3CLI%3EAfter%20reset%2C%20DIV%20bits%20in%20AHBCLKDIV%20%3D%20%5B00000000%5D%20%3A%20prescaler%20%3D%201%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSTRONG%3EProblem%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EIn%20the%20MCUXpresso%20SDK%20(26_03_00_pvw1)%2C%20the%20SystemCoreClock%20global%20variable%20is%20configured%20in%20the%20function%26nbsp%3B%3CSPAN%3ESystemCoreClockUpdate()%20in%20the%20file%20%3CEM%3Esystem_MCXA153.c%3C%2FEM%3E.%20This%20is%20correct%20if%20the%20fsl_clock%20driver%20is%20used.%20If%20this%20driver%20is%20not%20used%2C%20the%20SystemCoreClock%20variable%20is%20set%20to%2012MHz%2C%20which%20is%20not%20correct.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CSPAN%3EAs%20a%20suggestion%2C%20update%20the%20following%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%3EIn%20the%20file%26nbsp%3B%3CSPAN%3E%3CEM%3Esystem_MCXA153.h%3C%2FEM%3E%2C%20update%20the%20define%3A%3CEM%3E%3CBR%20%2F%3E%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CFONT%20face%3D%22andale%20mono%2Ctimes%22%3E%3CSPAN%3E%23define%3C%2FSPAN%3E%20%3CSPAN%3EDEFAULT_SYSTEM_CLOCK%3C%2FSPAN%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3E12000000u%3C%2FSPAN%3E%3CSPAN%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3CFONT%20color%3D%22%23339966%22%3E%2F*%20Default%20System%20clock%20value%20*%2F%3C%2FFONT%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3CDIV%3E%3CDIV%3E%3CFONT%20face%3D%22andale%20mono%2Ctimes%22%3E%3CSPAN%3E%23define%3C%2FSPAN%3E%20%3CSPAN%3EDEFAULT_SYSTEM_CLOCK%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3CFONT%20color%3D%22%23FF0000%22%3E48%3C%2FFONT%3E%3C%2FSPAN%3E%3CSPAN%3E%3CFONT%20color%3D%22%23FF0000%22%3E000000%3C%2FFONT%3Eu%3C%2FSPAN%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3CFONT%20color%3D%22%23339966%22%3E%2F*%20Default%20System%20clock%20value%20*%2F%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CP%3E%3CSPAN%3EIn%20the%20file%26nbsp%3B%3CEM%3Esystem_MCXA153.c%3C%2FEM%3E%2C%20update%20the%20function%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3ESystemCoreClockUpdate()%20so%20it%20does%20not%20depend%20on%20the%20fsl_clock%20driver%20anymore%20and%20uses%20direct%20register%20access.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2333110%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EMCXA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2333462%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MCXA153%20SystemCoreClock%20default%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2333462%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F231700%22%20target%3D%22_blank%22%3E%40HugoArends%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CDIV%3EThanks%20for%20your%20suggestion.%20I%20will%20report%20it%20to%20your%20internal%20team.%3C%2FDIV%3E%0A%3CDIV%3EThank%20you.%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EBR%3C%2FDIV%3E%0A%3CDIV%3EAlice%3C%2FDIV%3E%3C%2FLINGO-BODY%3E