Clock Manager Initialization#

Startup Sequence#

The Clock Manager follows a specific initialization sequence integrated with the SL Main/SL System framework:

  1. Early Boot Phase: SL Main/SL System automatically calls sl_clock_manager_init() early in the startup sequence

  2. Configuration Loading: Board-specific configuration files are processed:

    • sl_clock_manager_oscillator_config.h: Crystal specifications, HFXO sharing, DPLL settings

    • sl_clock_manager_tree_config.h: Clock branch sources, default oscillator selections

  3. Hardware Setup: Device oscillators and clock trees are configured based on configuration files

  4. Runtime Initialization: sl_clock_manager_runtime_init() enables runtime clock management APIs

  5. Integration 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_clocks components (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_hfrco

  • device_init_dpll, device_init_rffpll, device_init_usbpll

  • device_init_lfxo, device_init_lfrco

Note: The main device_init component 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.h and sl_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_clocks or custom initialization