Part V: Kernel Configuration

This chapter details the available configuration options, covering system parameters, scheduling settings, memory protection, interrupt handling, and enabled services. QuantumRT settings are defined at compile-time and must be adjusted before building the kernel. Developers can:

  • Enable or disable kernel features (e.g., scheduling policies, synchronization mechanisms).

  • Adjust system parameters (e.g., system timer frequency, thread limits, stack sizes).

  • Define memory protection settings (e.g., MPU regions).

  • Optimize real-time performance (e.g., priority inheritance, round-robin scheduling).

Configuration Options

Configuration options for SAME54.

Allows configuring processor core, MPU, FPU, System Timer, scheduler, interrupt handling, IPC and kernel.

Defines

QRT_CFG_CPU_CORE

Selected CPU core:

  • QRT_CPU_CORTEX_M0P

  • QRT_CPU_CORTEX_M3

  • QRT_CPU_CORTEX_M4

  • QRT_CPU_CORTEX_M7

  • QRT_CPU_CORTEX_M23

  • QRT_CPU_CORTEX_M33

  • QRT_CPU_CORTEX_M35P

  • QRT_CPU_CORTEX_M52

  • QRT_CPU_CORTEX_M55

  • QRT_CPU_CORTEX_M85

QRT_CFG_ICACHE_ENABLE (0)

Enable instruction cache (if supported by CPU core)

Options:

  • 0: Instruction cache disabled

  • 1: Instruction cache enabled

QRT_CFG_DCACHE_ENABLE (0)

Enable data cache (if supported by CPU core)

Options:

  • 0: Data cache disabled

  • 1: Data cache enabled

QRT_CFG_SYSTIMER_PERIOD_MAX (0xFFFFFFu)

Maximum timer period.

QRT_CFG_SYSTIMER_FREQUENCY (120000000u)

System Timer frequency in Hz.

QRT_CFG_BASETIMER_ENABLE (0)

Enable Base Timer support.

Options:

  • 0: Base Timer disabled

  • 1: Base Timer enabled

QRT_CFG_THREAD_LIMIT (16u)

Maximum number of threads.

QRT_CFG_CLEANUP_LIMIT (4u)

Maximum cleanup handlers per thread.

QRT_CFG_STACK_POOL_SIZE (8192u)

Total stack pool size in bytes.

QRT_CFG_THREAD_STACK_DEFAULT (2048u)

Default thread stack size in bytes.

QRT_CFG_THREAD_STACK_LIMIT_CHECK (0)

Enable stack limit checking for threads (ARMv8-M only)

Options:

  • 0: Stack limit checking disabled

  • 1: Stack limit checking enabled

QRT_CFG_THREAD_NAME_ENABLE (1)

Enable thread naming support.

Options:

  • 0: Thread naming disabled

  • 1: Thread naming enabled

QRT_CFG_SCHED_RR_ENABLE (1)

Enable round-robin scheduling for equal priority threads.

Options:

  • 0: Round-robin scheduling disabled (strict priority only)

  • 1: Round-robin scheduling enabled (time-slicing for equal priorities)

QRT_CFG_SCHED_RR_QUANTUM (10u)

Default time slice in milliseconds.

QRT_CFG_IDLE_STACK_SIZE (128u)

Idle thread stack size in bytes.

QRT_CFG_IDLE_DEEP_SLEEP_ENABLE (0)

Enable deep sleep in idle thread.

Options:

  • 0: Deep sleep disabled (CPU stays active in idle)

  • 1: Deep sleep enabled (CPU enters low-power mode when idle)

QRT_CFG_MPU_ENTRIES (8u)

Enable Memory Protection Unit support.

Options:

  • 0: MPU disabled (all memory accessible)

  • 1: MPU enabled (enforces memory access restrictions)

Number of MPU regions to configure

QRT_CFG_SEMAPHORE_ENABLE (1)

TrustZone configuration (ARMv8-M only)

Options:

  • 0: Running in Non-Secure World

  • 1: Running in Secure World

Enable semaphore support

Options:

  • 0: Semaphores disabled

  • 1: Semaphores enabled

QRT_CFG_MUTEX_ENABLE (1)

Enable mutex support.

Options:

  • 0: Mutexes disabled

  • 1: Mutexes enabled (allows mutex operations)

QRT_CFG_MUTEX_LIST_SIZE (4u)

Maximum mutexes a thread can hold simultaneously.

QRT_CFG_MESSAGE_QUEUE_ENABLE (1)

Enable message queue support.

Options:

  • 0: Message queues disabled

  • 1: Message queues enabled

QRT_CFG_MESSAGE_QUEUE_LIMIT (8u)

Maximum number of message queues.

QRT_CFG_MESSAGE_QUEUE_NAME_LIMIT (16u)

Maximum message queue name length.

QRT_CFG_TIMER_ENABLE (1)

Enable software timer support.

Options:

  • 0: Software timers disabled

  • 1: Software timers enabled

QRT_CFG_TIMER_LIMIT (8u)

Maximum number of software timers.

QRT_CFG_ERRNO_ENABLE (1)

Enable errno support.

Options:

  • 0: errno disabled (no error reporting via errno)

  • 1: errno enabled (POSIX-style error reporting)

QRT_CFG_DEFER_LIMIT (8u)

Maximum number of deferred interrupt calls.

QRT_CFG_KERNEL_HEAP_SIZE (1024u)

Enable System Call Extension support (requires MPU)

Options:

  • 0: System Call Extensions disabled

  • 1: System Call Extensions enabled

Maximum number of registered System Call Extensions

Kernel heap and memory allocation settings

Kernel heap size in bytes