Skip to content

Conversation

@jricardini
Copy link

  • Add comprehensive bare-metal testing platform for Cortex-M33 on MPS2-AN521
  • Include platform-specific linker script (m33-an521.ld) for memory layout
  • Add startup code (startup.c) for ARM Cortex-M33 initialization
  • Implement functional test suite (comprehensive_func_test.c) for all ML-DSA parameter sets
  • Implement performance benchmark suite (bench_baseline.c) with cycle counting
  • Add Python execution wrapper (exec_wrapper.py) for QEMU integration
  • Include platform makefile (platform.mk) for cross-compilation configuration
  • Add comprehensive documentation (CROSS-BUILDING-AND-TESTING.md) with setup and troubleshooting
  • Support testing all three security levels (ML-DSA-44, ML-DSA-65, ML-DSA-87)
  • Enable automated testing via QEMU with semihosting support

- Add comprehensive bare-metal testing platform for Cortex-M33 on MPS2-AN521
- Include platform-specific linker script (m33-an521.ld) for memory layout
- Add startup code (startup.c) for ARM Cortex-M33 initialization
- Implement functional test suite (comprehensive_func_test.c) for all ML-DSA parameter sets
- Implement performance benchmark suite (bench_baseline.c) with cycle counting
- Add Python execution wrapper (exec_wrapper.py) for QEMU integration
- Include platform makefile (platform.mk) for cross-compilation configuration
- Add comprehensive documentation (CROSS-BUILDING-AND-TESTING.md) with setup and troubleshooting
- Support testing all three security levels (ML-DSA-44, ML-DSA-65, ML-DSA-87)
- Enable automated testing via QEMU with semihosting support

Signed-off-by: Jefferson Ricardini <[email protected]>
@jricardini jricardini requested a review from a team as a code owner January 7, 2026 18:12

#### Testing on QEMU

A complete testing platform is available for m33-an521
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jricardini It would be helpful to use AN524 instead as this targets the MPS3 FPGA prototyping board which @mkannwischer has available. This way, one could a) validate the setup on real HW, b) ad-hoc obtain performance numbers (without permission we cannot automatically publish them here).

AN524 appears to be supported by QEMU (https://www.qemu.org/docs/master/system/arm/mps2.html) as well.

Comment on lines +2 to +3
* Copyright (c) The mldsa-native project authors
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How was the startup code obtained? If it is derived / copied from somewhere, we need to adhere to and retain the license.

Generally, I'd prefer if we could stick to official CMSIS code as much as possible. See here for how it was done in pqmx for AN547.

Comment on lines +1 to +9
/*
* Copyright (c) The mldsa-native project authors
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
*
* ML-DSA Comprehensive Functional Test for Cortex-M33
*
* Tests: sign/verify, unaligned access, invalid inputs, external mu,
* pre-hash, and public key derivation
*/
Copy link
Contributor

@hanno-becker hanno-becker Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jricardini Can we work with the existing tests rather than introducing new ones? I assume the primary reason to have a separate file here is the custom printf, but can that not be supplied at link-time through an additional source file, rather than adjusting the test?

cf how this is done for the existing AN547 baremetal environment: If you go into the arm-embedded shell, ls $M55_AN547_PATH will show you the various startup files, including semihosting and uart setup.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I'll do it. It as in my plans to check how all the startup files are setup for AN547 in nix and do the same for m33 anyway!

Copy link
Contributor

@hanno-becker hanno-becker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jricardini, I support the addition of a baremetal environment for Cortex-M33.

The primary areas of work, for me (@mkannwischer please chime in), are:

  • Switching to AN524 so we can ensure that this works both on QEMU and on real HW (@mkannwischer has an MPS3, and we could even hook it into CI)
  • Generalizing and reusing the existing test files rather than copy-adjusting them.

Probably optional, but strongly desired:

  • Add CI job exercising this baremetal environment.
  • Consider using CMSIS code as in pqmx (ideally, the environment moves into pqmx as for AN547, but I think this could be done in a follow-up)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants