Zephyr Project Requirements
System Initialization

SPDX-License-Identifier: Apache-2.0

ZEP-SRS-12-1
1. Registering initialization functions UID: ZEP-SRS-12-1 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall provide a mechanism to register a function to be invoked automatically during system initialization.

ZEP-SRS-12-11
2. Named registration of initialization functions UID: ZEP-SRS-12-11 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

When registering a function for initialization, the Zephyr RTOS shall associate the registration with the caller-provided distinct name, allowing the same function to be registered for initialization more than once.

ZEP-SRS-12-2
3. Initialization levels UID: ZEP-SRS-12-2 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

When registering a function for initialization, the Zephyr RTOS shall associate the function with the caller-provided initialization level.

ZEP-SRS-12-12
4. Initialization priority UID: ZEP-SRS-12-12 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

When registering a function for initialization, the Zephyr RTOS shall associate the function with the caller-provided priority within its initialization level.

ZEP-SRS-12-13
5. Defined initialization levels UID: ZEP-SRS-12-13 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall organize system initialization into an ordered sequence of initialization levels, comprising early hardware initialization, two pre-kernel levels, a post-kernel level, an application level, and, where symmetric multiprocessing is enabled, a multiprocessor level.

ZEP-SRS-12-14
6. Querying an initialization level ordinal UID: ZEP-SRS-12-14 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall provide a mechanism to obtain the ordinal number of an initialization level.

ZEP-SRS-12-3
7. Initialization order by level UID: ZEP-SRS-12-3 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

During system initialization, the Zephyr RTOS shall invoke registered initialization functions level by level, in the defined order of initialization levels.

ZEP-SRS-12-4
8. Initialization order by priority UID: ZEP-SRS-12-4 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

Within an initialization level, the Zephyr RTOS shall invoke registered initialization functions in ascending order of their registered priority.

ZEP-SRS-12-5
9. Initialization before kernel services UID: ZEP-SRS-12-5 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall execute the early hardware and pre-kernel initialization levels in a single-threaded context with interrupts disabled, before the kernel scheduler is started.

ZEP-SRS-12-6
10. Initialization after kernel services UID: ZEP-SRS-12-6 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall execute the post-kernel and later initialization levels in the context of a kernel thread after the kernel scheduler has started, with kernel services available.

ZEP-SRS-12-7
11. Device initialization UID: ZEP-SRS-12-7 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall initialize devices that are not marked for deferred initialization as part of system initialization, invoking each device's initialization function according to its assigned initialization level and priority.

ZEP-SRS-12-8
12. Application start after initialization UID: ZEP-SRS-12-8 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

The Zephyr RTOS shall complete all initialization levels before invoking the application entry point.

ZEP-SRS-12-9
13. SMP initialization UID: ZEP-SRS-12-9 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

Where symmetric multiprocessing is enabled, the Zephyr RTOS shall bring up the secondary CPUs after the application initialization level completes and before the application entry point is invoked.

ZEP-SRS-12-10
14. Static object construction at startup UID: ZEP-SRS-12-10 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

Where GNU-compatible static initialization is enabled, the Zephyr RTOS shall invoke statically registered object constructors during system initialization, in their configured priority order, before the application entry point runs.

ZEP-SRS-12-15
15. Continuing after a failed initialization function UID: ZEP-SRS-12-15 STATUS: Draft TYPE: Functional COMPONENT: System Initialization RELATIONS (Parent): STATEMENT:

When a registered initialization function returns an error, the Zephyr RTOS shall continue system initialization with the remaining initialization functions.