Skip to content

Add Cortex-M33 emulation CI target via m33emu #24

@aidangarske

Description

@aidangarske

Background

Current CI builds and runs the test suite on Linux (x86-64) and macOS. This
catches logic bugs but misses issues that only surface on the actual target
architecture: unaligned memory access, stack size violations at configured
limits, ABI differences, and anything that depends on ARM's 32-bit integer
width or endianness behavior.

m33emu (github.com/danielinux/m33mu) is a Cortex-M33 / ARMv8-M emulator with
TrustZone awareness. The STM32H5 is a Cortex-M33, so this is a direct match.
Running the existing make test suite under m33emu would give meaningful
embedded target coverage in CI without requiring physical hardware.

What this validates that x86 CI misses

  • Stack usage at the limits set by WOLFCOSE_MAX_SCRATCH_SZ and friends
  • Behavior under the ARM Cortex-M calling convention (AAPCS)
  • Unaligned access patterns in the CBOR decoder (zero-copy pointer arithmetic)
  • 32-bit int / size_t behavior vs x86-64 64-bit widths
  • TrustZone separation if the secure/non-secure split is exercised

Tasks

  • Build wolfCOSE test binary with arm-none-eabi-gcc targeting Cortex-M33
  • Get m33emu running in the CI environment (Ubuntu latest)
  • Run tests/test_main under m33emu, assert zero failures
  • Add as a CI job in .github/workflows/ alongside existing Linux/macOS jobs
  • Document the cross-compile + emulator invocation in the README

Notes

This is only a testing target, not a port — no wolfCOSE source changes are
needed. The H5 hardware build is already documented in the README
cross-compilation section; this just adds an automated check for it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions