Reason for disable of clock gate before setting the module clock

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

Reason for disable of clock gate before setting the module clock

Jump to solution
454 Views
MCW
Contributor III

Hi all,

 

I noticed that void BOARD_BootClockRUN(void) disables clock gates before configuring the module clocks in the SDK. Could someone explain the reason?

For example, uart module

MCW_0-1743427134097.png

Best regards,

Doris

 

Tags (2)
0 Kudos
Reply
1 Solution
421 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @MCW 

Thank you for your interest and my apologies for the delayed respose!

The main reason is to safely change the  clock mux settings for a clock. Take for example the LPUART clock figure you attached: Yes, LPUART clocks  are shut down, but after that the mux settings for LPUART clocks are changed. This is my interpretation according to section 14.6.1.7 Clock Switching Multiplexers of the RT1060 RM, there are some asynchronous muxes, that could cause undersired clock glitches. 

diego_charles_0-1744233665417.png

Also the BOARD_BootClockRUN(void) is auto generated by the Config Tool's Clock Tool,  if a clock is disabled in the Clocks tool diagram, it is expected that will be disabled on the generated code. 

I hope this could help you!

Diego

 

 

View solution in original post

1 Reply
422 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @MCW 

Thank you for your interest and my apologies for the delayed respose!

The main reason is to safely change the  clock mux settings for a clock. Take for example the LPUART clock figure you attached: Yes, LPUART clocks  are shut down, but after that the mux settings for LPUART clocks are changed. This is my interpretation according to section 14.6.1.7 Clock Switching Multiplexers of the RT1060 RM, there are some asynchronous muxes, that could cause undersired clock glitches. 

diego_charles_0-1744233665417.png

Also the BOARD_BootClockRUN(void) is auto generated by the Config Tool's Clock Tool,  if a clock is disabled in the Clocks tool diagram, it is expected that will be disabled on the generated code. 

I hope this could help you!

Diego