Clocks Tool#
The web version of Clocks Tool gives a preview of the system clock (core, system, bus, and peripheral clocks) and configuration structures of the clocking environment.
Features#
The Clocks tool supports the following actions related to clock initialization:
Inspect and modify element configurations on the clock path from the clock source up to the core/peripherals.
Validate clock elements settings and calculate the resulting output clock frequencies.
Modify the settings and provide output using the table view of the clock elements with their parameters.
Navigate, modify, and display important settings and frequencies easily in Diagram view.
Edit detailed settings in Details view.
Find clock elements settings that fulfill given requirements for outputs.
Register values define generation of C.
User interface overview#
The Clocks tool is integrated and runs within the MCUXpresso Config Tools framework.
User interface#
Clock configuration#
Each clock configuration (functional group) lists the settings for the entire clock system and is a part of the global configuration stored in the MEX file. Initially, after the new clock configuration is created, it is set to reflect the default after-reset state of the processor.
The Clocks tool handles one or more clock configurations. The default clock configuration is named “BOARD_BootClockRUN”. Multiple configurations provide multiple options for processor initialization.
Note: All clock settings are stored individually for each clock configuration so that each clock configuration is configured independently.
Clocks configurations (functional groups) are presented at the top of the view. You can switch between them by selecting them from the dropdown menu.
Default clock configuration#
Global settings#
Global settings, such as Run Mode and MCG mode, influence the entire clock system. It is recommended to set them first. Global settings can be modified in Clock Table, Clock Diagram, and Details views, and the Functional group properties dialog.
Note: Global settings can be changed at any time.
Clock sources#
The Clock Sources table is in the Clocks Table view. You can also edit the clock sources directly from the Diagram view or from the Details view.
You can configure the availability of external clock sources (check the checkbox) and set their frequencies. Some sources can have additional settings available when you unfold the node.
If the external crystal or the system oscillator clock is available, check the checkbox in the clock source row and specify the frequency.
External clock source configuration#
Note: Some clock sources remain inactive even though the checkbox is checked. This is because clock source functionality depends on other settings, such as power mode or additional enable/disable options. Hover over the setting to see a tooltip with information on the element and possible limitations/options.
Setting states and markers#
The following states, styles, and markers reflect the information shown in the setting rows in the settings tables (clock sources, output, details, or individual).
State/Style/Marker |
Icon |
Description |
|---|---|---|
Error marker |
|
Indicates that there is an error in the settings or something related to it. See the tooltip of the setting for details. |
Warning marker |
|
Indicates that there is a warning in the settings or something related to it. See the tooltip of the setting for details. |
Lock icon |
|
Indicates that the settings (that may be automatically adjusted by the tool) are locked to prevent any automatic adjustment. If a setting can be locked, it is automatically locked when you change the value. To add or remove the lock manually, use the pop-up menu command Lock/Unlock. Note: Clock element settings that cannot be automatically adjusted by the tool keep their value as-is and do not allow locking. They are: clock sources, clock selectors, and configuration elements. |
Yellow background |
|
Indicates that the field is directly or indirectly changed by the previous user action. |
Gray text |
|
Indicates that the value of a setting does not actively influence the clock. It is disabled or relates to an inactive clock element — for example, on the clock path following an unavailable clock source or disabled element. The frequency signal also shows “inactive” instead of a frequency value. The value is also gray when it is read-only. In such a state, the value cannot be modified. |
Frequency settings#
The Clocks tool instantly recalculates the entire clock system state after each settings change, from the clock source to the clock outputs.
The current state of all clock outputs is listed in the Clock Outputs view on the right side of the clock sources. The displayed value can be:
Frequency – Indicates that a clock signal is active and the output is fed with the shown frequency. The tool automatically chooses the appropriate frequency units. In case the number is too long or has more than three decimal places, it is shortened and only two decimal places are shown, followed by an ellipsis (’…’), indicating that the number is longer.
“Inactive” text – Indicates that no clock signal flows into the clock output or is disabled due to some setting.
If you have a specific requirement for an output clock, click the frequency you would like to set, change it, and press Enter.
Setting the core clock frequency#
When the tool reaches the required frequency, it appears locked and is displayed as follows:
Tool attains the required frequency#
If the tool cannot reach the required frequency or another problem occurs, it is displayed as follows:
Tool encounters problem#
The frequency value in square brackets [ ] indicates the value the tool uses in calculations, not the requested value.
Note: You can edit or set requirements only for the clock source and the output frequencies. The other values can be adjusted only when no error is reported.
Frequency precision#
For locked frequency settings (where the user requests a specific value) the frequency precision value is also displayed. By default, the value is 0.1 % but can be individually adjusted by clicking the value.
Frequency precision#
Dependency arrows#
In the Clocks Table view, the area between the clock sources and the clock output contains arrows directing the clock source to outputs. The arrows lead from the current clock source used for the selected output to all outputs using the signal from the same clock source. They identify dependencies and influences when the clock source or elements on a shared clock path change.
Dependency arrows#
Details view#
The Details view displays clock-element settings and allows you to change them.
The information is also updated in real-time based on any changes in the Clocks Diagram and Clocks Table.
Details view#
In the Details view, you can perform the following actions:
Display clock-element information - Point the mouse cursor at the clock element to display general clock-element information.
View the clock-element in Clocks Diagram or Clocks Table - Left-click on a clock element to highlight it in the Clocks Diagram or Clocks Table views, depending on which is currently active.
View detailed clock-element information - Double-click a clock element to display element details, as well as highlight the element in Clocks Diagram or Clocks Table, depending on which is currently active. You can also view element details by clicking the Open in new window button in the upper right corner of the Details view.
Modify clock-element settings - Left-click in the Value column to change clock element value, such as frequency, or select an option from the dropdown menu.
Lock/unlock clock elements - Right-click on a clock element to lock/unlock the element.
Clocks diagram#
The clocks diagram shows the structure of the entire clock model, including the clock functionality handled by the tool. It visualizes the flow of the clock signal from clock sources to clock output. It is dynamically refreshed after every change and always reflects the current state of the clock model.
At the same time, it allows you to edit the settings of the clock elements.
Clock diagram#
Mouse actions in diagram#
You can perform the following actions in the Clock diagram view.
Position the mouse cursor on the element to see the tooltip with the information on the clock element such as status, description, output frequency, constraints, and enable/disable conditions.
Single-click on output frequency or scale to change output frequency or scale.
Single-click on lock to remove the lock.
Click the element to show its settings in the Details view (force to open the view if closed or not visible).
Single-click on a selected Clock source to display a dropdown menu for enabling or disabling the source.
Single-click on a selected Clock selector to display selector input options.
Clocks mouse actions in diagram#
Right-click on the element, component, or clock output to see a pop-up menu with the following options.
Edit settings of: {element} – Invokes the floating view with the settings for a single element.
Edit all settings – Invokes the floating view with all the settings for an element.
Edit settings on the path to: {clock output} – Invokes the floating view with the settings for all elements on the clock path leading to the selected clock output.
Floating view#
Color and line styles#
Different color and line styles indicate different information for the element and clock signal paths.
The color and line styles can indicate:
Active clock path for selected output
Clock signal path states - used/unused/error/unavailable
Element states – normal/disabled/error
To inspect colors and style appearance, select Help > Show diagram legend from the main menu.
Clock model structure#
The clock model consists of interconnected clock elements. The clock signal flows from the clock sources through various clock elements to the clock outputs. The clock element can have specific enable conditions that can stop the signal from being passed to the successor. The clock element can also have specific constraints and limits that are watched by the Clocks Tool. To inspect these details, position the cursor on the element in the clock diagram to display the tooltip.
The following are the clock model elements.
Clock source – Produces a clock signal of a specified frequency. If it is an external clock source, it can have one or more related pins.
Clock source#
Clocks selector (multiplexer) – Selects one input from multiple inputs and passes the signal to the output.
Clocks selector#
Prescaler – Divides or multiplies the frequency with a selectable or fixed ratio.
Prescaler#
Frequency Locked Loop (FLL) – Multiplies an input frequency with a given factor.
Frequency Locked Loop#
Phase Locked Loop (PLL) – Contains pre-divider and therefore is able to divide/multiply with a given value.
Phase Locked Loop#
Clock gate – Stops the propagation of incoming signal.
Clock gate#
Clock output – Marks the clock signal output that has some name and can be further used by the peripherals or other parts of the processor. You can put a lock and/or frequency request.
Clock output#
Clock component – Group of clock elements surrounded with a border. The clock component can have one or more outputs. The clock component usually corresponds to the processor modules or peripherals. The component output may behave like clock gates, allowing or preventing the signal flow out of the component.
Clock component#
Configuration element – Additional setting of an element. Configuration elements do not have graphical representation in the diagram. They are shown in the setting table for the element or the clock path the element is on.
Troubleshooting problems#
It is possible that problems or conflicts occur while working with the Clocks Tool. Such problems and the overall status are indicated in red on the central status bar of the Clocks Tool. The status bar displays global information on the reported problem.
You may encounter any of the following problems:
Requirements not satisfiable: Indicates that there are one or more locked frequency or frequency constraints for which the tool is not able to find a valid setting and satisfy those requirements.
Invalid settings or requirements: [element list] – Indicates that the value of a setting is not valid. For example, the current state of settings is beyond the acceptable range.
The following are some tips to troubleshoot encountered problems:
Start with only one locked clock output frequency and let the tool find and calculate other ones. After you are successful, you can add more.
Go through the locked outputs (if there are any) and verify the requirements (there can possibly be typos in the required frequency, wrong units, and so on).
If you seek only to enable some clock output, try to use pop-up the menu command Enable that tries to automatically find settings providing any valid frequency on clock output.
If the required clock output value cannot be satisfied try to use the pop-up menu command “Advanced resolver for {clock output}”.
If you are OK to have a near frequency value around of the requested value but would like to keep the clock selectors and clock sources unchanged, right-click and from the pop-up menu select Clock output > Find near value.
If the problems still persist, find the elements and settings with marked errors in the diagram or tables and see the details in the tooltip.
If you cannot reach the values you need, use the diagram view to see the elements on clock path leading to the clock output you want to have set. Try to check and adjust the settings of these elements manually in the Details view.
Try to remove locks by selecting Clocks > Unlock All Settings. In case too many changes are required and conflicting, you can simply reset the model to the default values and start from the beginning. To reset, select Clocks > Reset to processor defaults.
Code generation#
If the settings are correct and no error is reported, the tool’s code generation engine instantly regenerates the source code. The resulting code is found in the Code Preview view.
Working with the code#
The generated code is aligned with the SDK. To use the code with the SDK project, it is necessary to transfer the code into your project structure.
To transfer the code into your project, do one of the following in the Code Preview:
Click Update Code in the toolbar.
Copy the content using the COPY command, either by pressing the CTRL+C keys or the pop-up menu after the whole text is selected.
Use export command.
Click the Export button in Code Preview view.
If you need access to values of registers calculated by the tool, the defines with these values can be generated into new file registers.h. It can be enabled by default (Edit->Configuration Preferences). For more information, see the desktop version of the User Guide, section Configuration preferences.


