Boot Flow

Startup Sequence

  1. Reset_Handler (assembly, startup.s)

    • Copies .data from flash to SRAM
    • Zeros .bss
    • Calls secure_boot() in Rust
  2. secure_boot() (Rust, main.rs)

    StepWhatWhy
    GPIO + LEDConfigure board LEDVisual boot indicator
    UARTInit LPUART1/USART1 at 9600 baudDebug output
    SAUConfigure Secure Attribution Unit regionsDefine S/NS/NSC memory boundaries
    GTZCConfigure MPCBB for SRAM block security256-byte granularity SRAM protection
    MPUEnable Memory Protection UnitIsolate kernel from enclaves
    Fault enablesMEMFAULT, BUSFAULT, USGFAULT, SECUREFAULTFault isolation for ESS recovery
    DMAEnable DMA1/DMA2 + NVIC interruptsBlock loading from flash to SRAM
    CryptoInit HASH (SHA-256) + AES (HW or SW)Integrity verification + decryption
    KernelCreate Kernel instance, derive session keysCentral state for enclave management
    OCTOSPI (L562)Memory-mapped external flash + OTFDECTransparent enclave decryption
    SysTickDisable (enabled per-enclave by SVC handler)Preemptive scheduling
    VTOR_NSSet NS vector table to 0x08040000Host exception handling
    trampoline_to_ns()Set MSP_NS, BLXNS to host entryTransfer to Non-Secure World

After Boot

The host application runs in Non-Secure World. It discovers enclaves in flash, creates them via umbra_tee_create(), and schedules them via umbra_enclave_enter(). Each enter triggers an SVC into Secure World where the kernel restores enclave context and enables SysTick for preemption.