Clock Manager Initialization#
Startup Sequence#
The Clock Manager follows a specific initialization sequence integrated with the SL Main/SL System framework:
Early Boot Phase: SL Main/SL System automatically calls
sl_clock_manager_init()early in the startup sequenceConfiguration Loading: Board-specific configuration files are processed:
sl_clock_manager_oscillator_config.h: Crystal specifications, HFXO sharing, DPLL settingssl_clock_manager_tree_config.h: Clock branch sources, default oscillator selections
Hardware Setup: Device oscillators and clock trees are configured based on configuration files
Runtime Initialization:
sl_clock_manager_runtime_init()enables runtime clock management APIsIntegration Verification: Clock Manager registers with Power Manager for low-power coordination
Key Integration Points:
Must be initialized before other services that depend on accurate timing
Incompatible with legacy
device_init_clockscomponents (mutually exclusive)Automatically handled by SL Main/SL System - no manual initialization required in most cases
Runtime component can be initialized independently for custom initialization sequences
Power Consumption Consideration: Using multiple oscillators for different clock branches increases overall power consumption. For battery-powered applications, minimize the number of active oscillators by configuring multiple clock branches to derive from the same oscillator source when possible.
Incompatible Components: The Clock Manager initialization is incompatible with these legacy components:
device_init_clocks,device_init_hfxo,device_init_hfrcodevice_init_dpll,device_init_rffpll,device_init_usbplldevice_init_lfxo,device_init_lfrco
Note: The main
device_initcomponent remains compatible as it handles non-clock initialization (EMU, DCDC). SLC automatically selects only the needed sub-components.
For advanced configuration options and customization, refer to Configuration.
Initialization API#
The Clock Manager provides initialization APIs that are typically called automatically by the platform:
sl_status_t sl_clock_manager_init(void);
sl_status_t sl_clock_manager_runtime_init(void);sl_clock_manager_init()
Description: Initializes device oscillators and clock tree based on configuration files
Integration: Automatically called by SL Main/SL System during early boot
Requirements: Must be called before any clock-dependent operations
Configuration: Uses
sl_clock_manager_oscillator_config.handsl_clock_manager_tree_config.h
sl_clock_manager_runtime_init()
Description: Initializes runtime clock management APIs
Independence: Can be called standalone without the initialization component
Use Cases: Applications using legacy
device_init_clocksor custom initialization