-
Notifications
You must be signed in to change notification settings - Fork 32
feat(baremetal): Add m33-an521 platform support for bare-metal building and testing #861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
jricardini
commented
Jan 7, 2026
- 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]>
|
|
||
| #### Testing on QEMU | ||
|
|
||
| A complete testing platform is available for m33-an521 |
There was a problem hiding this comment.
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.
| * Copyright (c) The mldsa-native project authors | ||
| * SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT |
There was a problem hiding this comment.
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.
| /* | ||
| * 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 | ||
| */ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
hanno-becker
left a comment
There was a problem hiding this 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)