Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Preparing for Hardware Targets

While QEMU-based builds are ideal for development and testing, most real-world use cases require deployment to actual hardware platforms. Here we will point out some of the key steps, challenges, and considerations when preparing an ODP-based firmware system for hardware targets.

Changes when targeting real hardware

AspectQEMUHardware
PeripheralsVirtualized and genericMust match actual hardware
Flash LayoutLoosely definedMust adhere to board specifications
Console / Logsstdout or debug.logUART/serial or memory-mapped output
Bootloaderstuart_build wrappercoreboot, U-Boot, ROM Bootloader
EC-HALFully mockedMust be implemented for real I/O

Firmware Packaging

  • For Patina:

    • The .efi binary must be embedded into the platform firmware image
    • Secure boot considerations apply (keys, signatures)
    • On some platforms (coreboot, U-Boot), a custom payload loader may be required
  • For EC:

    • The final .elf or .bin must target your microcontroller's flash layout.
    • Build system should include appropriate memory map
    • External flash programming may be needed (e.g. SWD/JTAG, USB DFU)

HAL Transition Checklist

Replacing mocks with real hardware access requires caution and hardware validation.

☐ Is your HAL for I2C, GPIO, ADC, etc. implemented for your board?

☐ Are your EC services updated to use the correct HAL instance?

☐ Have you validated pin mappings and timing constraints?

☐ Is your async runtime configured correctly for interrupts, clocks, and wake/sleep behavior?

☐ Are all non-implemented traits hidden behind feature flags or marked unimplemented!()?

Secure Services and Platform Constraints

  • FF-A support (used by EC secure services) is not available on x86 platforms — fallback mechanisms are needed

  • Memory buffers for FF-A (on ARM) must be in reserved and trusted memory regions

  • BIOS/UEFI loaders on some x86 platforms may block or filter EC messages

  • Ensure your platform’s firmware is not intercepting ACPI or EC I/O, unless explicitly intended