Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Zephyr Software Requirements

Table of Contents

Hardware Architecture Interface

ZEP-SRS-19-1: Atomic Operations

The Zephyr RTOS shall provide an interface functionality to access memory while ensuring mutual exclusion. Note: Implementation by atomic variables and accessing them by APIs.

ZEP-SRS-19-2: Thread Context Switching

The Zephyr RTOS shall provide a mechanism for context switching between threads.

ZEP-SRS-19-3: Software Exceptions

The Zephyr RTOS shall provide an interface to implement software exceptions.

ZEP-SRS-19-4: Processor Mode Support

The Zephyr RTOS shall provide an interface for managing processor modes.

C Library

ZEP-SRS-18-1: Formatted output

The Zephyr RTOS shall support formatted output.

ZEP-SRS-18-2: Floating Point Math Support

The Zephyr RTOS shall support floating point math libraries for processors where floating point is available.

ZEP-SRS-18-3: Boolean Primitives Support

The Zephyr RTOS shall support boolean primitives.

ZEP-SRS-18-4: Standard Unix time interface

The Zephyr RTOS shall support the standard UNIX time interface.

ZEP-SRS-18-5: Strings support

The Zephyr RTOS shall support an interface to manage strings.

ZEP-SRS-18-6: Moving/copying regions of memory

The Zephyr RTOS shall support an interface to move contents between regions of memory.

ZEP-SRS-18-7: I/O based interface

The Zephyr RTOS shall support a file i/O based interface for driver communication.

ZEP-SRS-18-8: C99 integer types

The Zephyr RTOS shall support standard C99 integer types.

ZEP-SRS-18-9: Standard System Error Numbers (IEEE Std 1003.1-2017)

The Zephyr RTOS shall support standard system error numbers as defined by IEEE Std 1003.1-2017.

ZEP-SRS-18-10: Document set of Zephyr OS required C library functions in Safety Manual

The set of C Library functions required by Zephyr needs to be documented in the Zephyr Safety Manual.

ZEP-SRS-18-11: Support external C libraries documentation in Zephyr Safety Manual

The Zephyr Safety Manual needs to specify how to configure the support of external C Libraries.

Device Driver API

ZEP-SRS-14-1: Device Driver Abstraction

The Zephyr RTOS shall provide abstraction of device drivers with common functionalities as an intermediate interface between applications and device drivers, where such interface is implemented by individual device drivers.

Proposal for replacement: Zephyr shall provide an interface between application and individual device drivers to provide an abstraction of device drivers with common functionalities.

ZEP-SRS-14-2: Expose kernel to hardware interrupts

The Zephyr RTOS shall provide an interface for managing a defined set of hardware exceptions (including interrupts) across all systems.

Exception and Error Handling

ZEP-SRS-16-1: Fatal Exception Error Handler

The Zephyr RTOS shall provide default handlers for exceptions.

ZEP-SRS-16-2: Default handler for fatal errors

The Zephyr RTOS shall provide default handlers for fatal errors that do not have a dedicated handler.

ZEP-SRS-16-3: Assigning a specific handler

The Zephyr RTOS shall provide an interface to assign a specific handler with an exception.

ZEP-SRS-16-4: Assigning a specific handler (2)

The Zephyr RTOS shall provide an interface to assign a specific handler for a fatal error.

File System

ZEP-SRS-17-1: Create file

Zephyr shall provide file create capabilities for files on the file system.

ZEP-SRS-17-2: Open files

Zephyr shall provide file open capabilities for files on the file system.

ZEP-SRS-17-3: Read files

Zephyr shall provide read access to files in the file system.

ZEP-SRS-17-4: Write to files

Zephyr shall provide write access to the files in the file system.

ZEP-SRS-17-5: Close file

Zephyr shall provide file close capabilities for files on the file system.

ZEP-SRS-17-6: Move file

Zephyr shall provide the capability to move files on the file system.

ZEP-SRS-17-7: Delete file

Zephyr shall provide file delete capabilities for files on the file system.

Interrupts

ZEP-SRS-7-1: Installing static IRQ service routines (ISR).

Zephyr RTOS shall provide a mechanism to initialize a static IRQ service routine (ISR), providing all parameters needed to configure the hardware and software.

ZEP-SRS-7-2: Static IRQ initial status.

The static IRQ shall be initially disabled.

ZEP-SRS-7-3 : Installing direct IRQ service routines (ISR).

Zephyr RTOS shall provide a mechanism to initialize a direct IRQ handler, providing all parameters needed to configure the hardware and software.

ZEP-SRS-7-4: Direct IRQ initial status.

The direct IRQ shall be initially disabled.

ZEP-SRS-7-5: Installing dynamic IRQ service routines (ISR).

Zephyr RTOS shall provide a mechanism to initialize a dynamic IRQ service routine, providing all parameters needed to configure the hardware and software.

ZEP-SRS-7-6: Dynamic IRQ initial status.

The dynamic IRQ shall be initially disabled.

ZEP-SRS-7-7: Uninstalling dynamic IRQ service routines (ISR).

Zephyr RTOS shall provide a mechanism to uninstall a dynamic ISR.

ZEP-SRS-7-8: Global IRQ disable

Zephyr RTOS shall provide a mechanism to Disable all IRQs on a CPU, and return the state the IRQ hardware prior to being disabled.

ZEP-SRS-7-9: Global IRQ enable

Zephyr RTOS shall provide a mechanism to Enable all IRQs on a CPU and return them to thier previous state.

ZEP-SRS-7-10: Specific IRQ disable

Zephyr RTOS shall provide a mechanism to Disable a specified IRQ.

ZEP-SRS-7-11 : Specific IRQ enable

Zephyr RTOS shall provide a mechanism to Enable a specified IRQ.

ZEP-SRS-7-12 : IRQ Enabled status

Zephyr RTOS shall provide mechanisms that returns the Enabled status of a specified IRQ, where the status is Enabled or Disabled.

ZEP-SRS-7-13 : ISR Context status

Zephyr RTOS shall provide mechanisms that returns the execution context, where the context is In-ISR or Not In-ISR.

ZEP-SRS-7-14 : Multi-level interrupts

The Zephyr RTOS shall support multi-level preemptive interrupt priorities, when supported by hardware.

Logging

ZEP-SRS-11-1: Dedicated Logging Thread Support

The Zephyr RTOS shall support isolation of logging from other functionality.

ZEP-SRS-11-2: Logs available for post processing

The Zephyr RTOS logging shall produce logs that are capable of being post processed.

ZEP-SRS-11-3: Formatting log messages

The Zephyr RTOS logging shall support formatting of log messages to enable filtering.

ZEP-SRS-11-4: Logging Filtering Support

The Zephyr RTOS logging system shall support filtering based on severity level.

ZEP-SRS-11-5: Multiple Backend Logging Support

The Zephyr RTOS shall support logging messages to multiple system resources.

ZEP-SRS-11-6: Deferred Logging Support

The Zephyr RTOS shall support deferred logging (TODO: need more detail about the constraints and limits on what can be deferred).

Memory Protection

ZEP-SRS-8-1: Memory Protection

The Zephyr RTOS shall support memory protection features to isolate a thread's memory region.

ZEP-SRS-8-2: Granting access to kernel objects

The Zephyr RTOS shall provide a mechanism to grant user threads access to kernel objects.

ZEP-SRS-8-3: Separation between user and kernel threads for memory access

The Zephyr RTOS shall be able to differentiate between user threads and kernel threads for memory access.

ZEP-SRS-8-4: Safely handle unimplemented calls or invalid system calls

The Zephyr RTOS shall have a defined behaviour when an invocation of an unimplemented system call is made.

ZEP-SRS-8-5: Response to invalid system call IDs

The Zephyr RTOS shall have a defined behaviour when an invalid system call ID is used.

ZEP-SRS-8-6: Prevent user threads creating higher priority threads

The Zephyr RTOS shall prevent user threads from creating new threads that are higher priority than the caller.

ZEP-SRS-8-7: Revoking threads permissions on a kernel object

The Zephyr RTOS shall support revoking permission to a kernel object. User mode threads may only revoke their own access to an object.

ZEP-SRS-8-8: Prevent user threads creating supervisor threads

The Zephyr RTOS shall prevent user threads from creating kernel threads.

ZEP-SRS-8-9: Reduced Privilege Level Threads

The Zephyr RTOS shall allow the creation of threads that run in reduced privilege level.

ZEP-SRS-8-10: User Mode Threads Performing Privileged Operations

The Zephyr RTOS shall provide system calls to allow user mode threads to perform privileged operations.

ZEP-SRS-8-11: User mode handling of detected stack overflow

The Zephyr RTOS shall support a defined mechanism for user mode handling a of detected stack overflow.

ZEP-SRS-8-12: Stack Overflow Detection

The Zephyr RTOS shall support detection of stack overflows.

ZEP-SRS-8-13: Boot Time Memory Access Policy

The Zephyr RTOS shall support configurable access to memory during boot time.

ZEP-SRS-8-14: System Call Handler Functions

The Zephyr RTOS shall provide helper functions for system call handler functions to validate the inputs passed in from user mode before invoking the implementation function to protect the kernel.

ZEP-SRS-8-15: System Call C strings in user mode

The Zephyr RTOS shall support system calls to be able to safely accept C strings passed in from user mode.

ZEP-SRS-8-16: Tracking kernel objects in used by user mode threads

The Zephyr RTOS shall track kernel objects that are used by user mode threads.

Note: this means Zephyr shall track the resources used by the user mode thread (associate this with a user story).

ZEP-SRS-8-17: Granting threads access to specific memory

The Zephyr RTOS shall have an interface to request access to specific memory after initial allocation.

ZEP-SRS-8-18: Assigning memory pools to act as a thread resource pool

The Zephyr RTOS shall support assigning a memory pool to act as that thread's resource pool.

Memory Objects

ZEP-SRS-9-1: Dynamic Memory Allocation

The Zephyr RTOS shall allow threads to dynamically allocate variable-sized memory regions from a specified range of memory.

ZEP-SRS-9-2: Memory Slab Object

The Zephyr RTOS shall allow threads to dynamically allocate fixed-sized memory regions from a specified range of memory.

Data Passing

ZEP-SRS-15-1: Traditional FIFO Queue

The Zephyr RTOS shall provide a kernel object that implements a traditional first in, first out (FIFO) queue, allowing threads and ISRs to add and remove a limited number of 32-bit data values.

ZEP-SRS-15-2: Traditional LIFO queue

The Zephyr RTOS shall provide a kernel object that implements a traditional last in, first out (LIFO) queue, allowing threads and ISRs to add and remove a limited number of 32-bit data values.

Mutex

ZEP-SRS-6-1: Mutex Kernel Object

The Zephyr RTOS shall support resource synchronization. (Note synchronization can be for memory access, and mutex may be one implementation, but not the only one).

Semaphore

ZEP-SRS-5-1: Counting Semaphore Definition At Compile Time

The Zephyr RTOS shall provide a mechanism to define and initialize a semaphore at compile time.

ZEP-SRS-5-2: Counting Semaphore Definition At Run Time

The Zephyr RTOS shall provide a mechanism to define and initialize a semaphore at runtime.

ZEP-SRS-5-3: Maximum limit of a semaphore

The Zephyr RTOS shall define the maximum limit of a semaphore when the semaphore is used for counting purposes and does not have an explicit limit.

ZEP-SRS-5-4: Initialialization with maximum count value

When initializing a counting semaphore, the maximum permitted count a semaphore can have shall be set.

ZEP-SRS-5-5: Initial semaphore value

When initializing a counting semaphore, the initial semaphore value shall be set.

ZEP-SRS-5-6: Semaphore acquisition mechanism

The Zephyr RTOS shall provide a mechanism allowing threads to acquire a semaphore.

ZEP-SRS-5-7: Semaphore acquisition with count greater than zero

While the semaphore's count is greater than zero, the requesting thread shall acquire the semaphore and decrement its count.

ZEP-SRS-5-8: Semaphore acquisition with zero count

While the semaphore's count is zero, the requesting thread shall be blocked until the semaphore is released by another thread.

ZEP-SRS-5-9: Semaphore acquisition timeout

When attempting to acquire a semaphore, the Zephyr RTOS shall accept options that specify timeout periods, allowing threads to set a maximum wait time for semaphore acquisition.

ZEP-SRS-5-10: Semaphore acquisition timeout error handling

When attempting to acquire a semaphore, where the semaphore is not acquired within the specified time, the Zephyr RTOS shall return an error indicating a timeout.

ZEP-SRS-5-11: Semaphore acquisition no wait error handling

When attempting to acquire a semaphore, where the current count is zero and no timeout time was provided, the Zephyr RTOS shall return an error indicating the semaphore is busy.

ZEP-SRS-5-12: Semaphore release

The Zephyr RTOS shall provide a mechanism allowing threads to release a semaphore.

ZEP-SRS-5-13: Semaphore release

The Zephyr RTOS shall increment the semaphore's count upon release.

ZEP-SRS-5-14: Semaphore release with priority inheritance

When there are threads waiting on the semaphore, the highest-priority waiting thread shall be unblocked and acquire the semaphore.

ZEP-SRS-5-15: Checking semaphore count

The Zephyr RTOS shall provide a mechanism for threads to check the current count of a semaphore without acquiring it.

ZEP-SRS-5-16: Semaphore reset

The Zephyr RTOS shall provide a mechanism that resets the semaphore count to zero.

ZEP-SRS-5-17: Semaphore acquisitions abort after reset

When a semaphore is reset, the Zephyr RTOS shall abort all existing acquisitions of the semaphore returning a resource contention error code.

ZEP-SRS-5-18: Semaphore Initialization Option Validation

When initializing a counting semaphore, where the maximum permitted count of a semaphore is invalid, then the Zephyr RTOS shall return an error indicating invalid values.

Power Management

ZEP-SRS-13-1: Power State Control

The Zephyr RTOS shall provide control over changes to system power states.

ZEP-SRS-13-2: Power Management

TBD

ZEP-SRS-13-3: Notification of changes to system power states

The Zephyr RTOS shall provide notification of changes to system power states.

Thread Communication

ZEP-SRS-3-1: Exchanging data between threads

The Zephyr RTOS shall provide a mechanism for exchanging data between threads.

ZEP-SRS-3-2: Waiting for results during communication

The Zephyr RTOS shall provide mechanisms to enable waiting for results during communication between threads. (NOTE: waiting for results is really bad and dangerous, want to avoid if at all possible).

ZEP-SRS-3-3: Poll Operation Support

The Zephyr RTOS shall support a poll operation which enables waiting concurrently for any one of multiple conditions to be fulfilled.

ZEP-SRS-3-4: Pipe Communication Primitive

The Zephyr RTOS shall provide a communication primitive that allows a thread to transfer a block of data to another thread.

ZEP-SRS-3-5: Message Queue

The Zephyr RTOS shall provide a a communication primitive that allow threads and ISRs to asynchronously exchange fixed-size data items.

ZEP-SRS-3-6: Mailbox Kernel Primitive

The Zephyr RTOS shall provide a communication primitive that allows threads to exchange messages of varying sizes asynchronously or synchronously.

Multi Core

ZEP-SRS-2-1: Support operation on more than one CPU

The Zephyr RTOS shall support operation on more than one physical CPU sharing the same kernel state.

ZEP-SRS-2-2: Running threads on specific CPUs

The Zephyr RTOS shall provide an interface for running threads on specific sets of CPUs ( default is 1 CPU).

ZEP-SRS-2-3: Exclusion between physical CPUs

The Zephyr RTOS shall provide an interface for mutual exclusion between multiple physical CPUs.

Thread Scheduling

ZEP-SRS-2-4: Scheduling a thread based on an event

The Zephyr RTOS shall provide an interface to schedule a thread based on an event.

ZEP-SRS-2-5: Deadline Scheduling Priorities

The Zephyr RTOS shall organize running threads by earliest deadline first priority.

ZEP-SRS-2-6: Work Queue utility capable of running preemptible work items

The Zephyr RTOS shall provide a thread-pooled work queue utility capable of running preemptible work items with specific scheduler priorities.

ZEP-SRS-2-7: Run user supplied functions in-order in a separate thread(s)

The Zephyr RTOS shall provide an interface for running user-supplied functions.

ZEP-SRS-2-8: Organize running threads into a fixed list

The Zephyr RTOS shall organize running threads into a fixed list of numeric priorities.

ZEP-SRS-2-9: Preemption support

The Zephyr RTOS shall support preemption of a running thread by a higher priority thread.

ZEP-SRS-2-10: Un-preemptible thread priorities

The Zephyr RTOS shall support thread priorities which cannot be preempted by other user threads.

ZEP-SRS-2-11: Time sharing of CPU resources

The Zephyr RTOS shall support time sharing of CPU resources among threads of the same priority.

Threads

ZEP-SRS-1-1: Creating threads

The Zephyr RTOS shall provide an interface to create (start) a thread.

ZEP-SRS-1-2: Setting thread priority

The Zephyr RTOS shall provide an interface to set a thread's priority.

ZEP-SRS-1-3: Suspending a thread

The Zephyr RTOS shall provide an interface to suspend a thread.

ZEP-SRS-1-4: Resuming a suspended thread

The Zephyr RTOS shall provide an interface to resume a suspended thread.

ZEP-SRS-1-5: Resuming a suspended thread after a timeout

The Zephyr RTOS shall provide an interface to resume a suspended thread after a timeout.

ZEP-SRS-1-6: Deleting a thread

The Zephyr RTOS shall provide an interface to delete (end) a thread.

ZEP-SRS-1-7: Thread states

Threads shall have different states to fulfill the Life-cycle of a thread

ZEP-SRS-1-8: Thread stack objects

Every Thread shall have it's own stack.

ZEP-SRS-1-9: Thread privileges

The Zephyr RTOS shall provide an interface to create threads with defined privilege.

ZEP-SRS-1-10: Scheduling multiple threads

The Zephyr RTOS shall provide an interface to schedule multiple threads.

ZEP-SRS-1-11: Thread Options

The Zephyr RTOS shall support a set of thread options.

ZEP-SRS-1-12: Thread Custom Data

Every thread shall have a custom data area.

Timers

ZEP-SRS-4-1: Kernel Clock

The Zephyr RTOS shall provide a interface for checking the current value of the real-time clock.

ZEP-SRS-4-2: Call functions in interrupt context

The Zephyr RTOS shall provide an interface to schedule user mode call back function triggered by a real time clock value.

Tracing

ZEP-SRS-10-1: Initializing a trace

Zephyr shall provide an interface to initialize a trace.

ZEP-SRS-10-2: Triggering a trace

Zephyr shall provide an interface to trigger a trace.

ZEP-SRS-10-3: Dumping trace results

Zephyr shall provide an interface to dump results from a trace.

ZEP-SRS-10-4: Removing trace data

Zephyr shall provide an interface to remove trace data.

ZEP-SRS-10-5: Tracing Object Identification

Zephyr shall provide an interface to identify the objects being traced.

ZEP-SRS-10-6: Tracing Non-Interference

Zepyhr shall prevent the tracing functionality from interfering with normal operations.

Condition Variables

ZEP-SRS-21-1: Dynamic initialization of condition variables

The Zephyr RTOS shall provide a mechanism to define and initialize a condition variable dynamically (at runtime).

ZEP-SRS-21-2: Static initialization of condition variables

The Zephyr RTOS shall provide a mechanism to define and initialize a condition variable statically (at compile time).

ZEP-SRS-21-3: Signal one waiting thread

The Zephyr RTOS shall provide a mechanism to signal the highest priorite waiting thread when a condition is met.

ZEP-SRS-21-4: Signal multiple waiting threads

The Zephyr RTOS shall provide a mechanism to signal all waiting threads when a condition is met.

ZEP-SRS-21-5: Wait on a condition variable

The Zephyr RTOS shall provide a mechanism for a thread to wait on a condition variable.

ZEP-SRS-21-6: Wait timeout on a condition variable

When waiting on a condition variable, the thread shall specify a timeout value.

ZEP-SRS-21-7: Wait timeout occurence

When a timeout occurs while waiting on a condition variable, the thread shall be unblocked and a timeout error shall be returned.

ZEP-SRS-21-8: Release mutex on wait

If a thread is waiting on a condition variable, the thread shall release the current owned mutex independently.

ZEP-SRS-21-9: Unblock a waiting thread

henever some thread signals a condition variable the Zephyr RTOS shall unblock the highest priority thread currently waiting for this condition variable.