Add STM32MP135 support#8
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds STM32MP135 (Cortex‑A7) support to STM32Sim, including Cortex‑A vs Cortex‑M boot/ELF handling, a new chip wiring/memory map, and HASH peripheral extensions needed to run MP13 SHA3/SHAKE workloads. It also introduces MP135 smoke firmware + a wolfCrypt MP135 firmware/test workflow to validate the new target end-to-end.
Changes:
- Add a new
stm32mp135chip target (Cortex‑A7/ARM mode) with DDR-based memory map and peripheral wiring. - Extend core CPU/ELF loading to be CPU-kind aware (Cortex‑M vector-table boot vs Cortex‑A entry-point boot).
- Add MP13 HASH ALGO decoding (4-bit field) and SHA3/SHAKE support (plus new MP135 smoke + wolfCrypt CI coverage).
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| STM32Sim/stm32-sim/runner-bin/tests/smoke.rs | Adds MP135 smoke test build/run harness and output assertions. |
| STM32Sim/stm32-sim/runner-bin/src/main.rs | Loads ELF and constructs CPU using per-chip cpu_kind. |
| STM32Sim/stm32-sim/peripherals/src/hash/v1.rs | Adds MP13 ALGO decoding + SHA3CFGR register mirror + MP13 KAT tests. |
| STM32Sim/stm32-sim/peripherals/src/hash/mod.rs | Adds SHA3/SHAKE algos and SHAKE wrapper to fit DynDigest engine. |
| STM32Sim/stm32-sim/peripherals/Cargo.toml | Adds sha3 dependency to peripherals crate. |
| STM32Sim/stm32-sim/core/src/lib.rs | Re-exports CpuKind from core. |
| STM32Sim/stm32-sim/core/src/elf.rs | Adds CPU-kind aware ELF parsing (Cortex‑M vectors vs Cortex‑A entry). |
| STM32Sim/stm32-sim/core/src/cpu.rs | Adds CpuKind, Cortex‑A Unicorn mode + Cortex‑A7 model selection. |
| STM32Sim/stm32-sim/chips/src/stm32u575.rs | Sets cpu_kind for U5 chips. |
| STM32Sim/stm32-sim/chips/src/stm32mp135.rs | New MP135 chip definition (DDR/SRAM map, UART4/CRYP1/HASH1/RNG1/PKA). |
| STM32Sim/stm32-sim/chips/src/stm32h753.rs | Sets cpu_kind for H7 chip. |
| STM32Sim/stm32-sim/chips/src/lib.rs | Adds cpu_kind to Chip, registers/list stm32mp135. |
| STM32Sim/scripts/run-wolfcrypt-mp135.sh | New helper script to build/run MP135 wolfCrypt firmware in the Docker image. |
| STM32Sim/README.md | Updates STM32Sim docs for MP135/Cortex‑A7 and HASH SHA3/SHAKE support. |
| STM32Sim/firmware/wolfcrypt-test-mp135/user_settings.h | New wolfSSL user settings enabling MP13 crypto features (SHA3/SHAKE/SHA384/512). |
| STM32Sim/firmware/wolfcrypt-test-mp135/toolchain-arm-none-eabi.cmake | New CMake toolchain for Cortex‑A7 ARM-mode build. |
| STM32Sim/firmware/wolfcrypt-test-mp135/stm32mp13xx_hal_conf.h | New HAL configuration header for MP13 wolfCrypt build. |
| STM32Sim/firmware/wolfcrypt-test-mp135/stm32mp135.ld | New linker script for DDR-only Cortex‑A7 firmware. |
| STM32Sim/firmware/wolfcrypt-test-mp135/startup.S | New Cortex‑A7 reset/startup for wolfCrypt firmware. |
| STM32Sim/firmware/wolfcrypt-test-mp135/mmu.c | New simple 1MiB-section MMU mapping for wolfCrypt firmware. |
| STM32Sim/firmware/wolfcrypt-test-mp135/main.c | New wolfCrypt firmware main (UART, stubs, test_complete/test_result). |
| STM32Sim/firmware/wolfcrypt-test-mp135/CMakeLists.txt | New build for MP13 wolfCrypt firmware using STM32CubeMP13 + wolfSSL. |
| STM32Sim/firmware/smoke-test-mp135/startup.S | New Cortex‑A7 startup for MP135 smoke firmware. |
| STM32Sim/firmware/smoke-test-mp135/smoke.ld | New DDR-only linker script for MP135 smoke firmware. |
| STM32Sim/firmware/smoke-test-mp135/mmu.c | New MMU setup for smoke firmware. |
| STM32Sim/firmware/smoke-test-mp135/Makefile | New Makefile for MP135 smoke firmware build. |
| STM32Sim/firmware/smoke-test-mp135/main.c | New MP135 smoke firmware (UART4/RNG1/CRYP1/HASH1 incl. SHA3-256 KAT). |
| STM32Sim/Dockerfile.wolfcrypt | Adds STM32CubeMP13 + MP135 firmware/script into wolfCrypt Docker image. |
| README.md | Updates top-level README supported target list to include MP135. |
| .github/workflows/stm32-wolfcrypt-test-mp135.yml | New GitHub Actions workflow to run MP135 wolfCrypt test via Docker. |
| .github/workflows/stm32-test-suite.yml | Adds building MP135 smoke firmware in CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dda35fd to
26f2fe9
Compare
Member
Author
|
ATECC608 failure fixed in #7, this will need rebasing once that is merged. |
26f2fe9 to
d507309
Compare
Bare metal Cortex-A using virtual DDR RAM. Also adds SHA3 / SHAKE support to the STM32 simulator for the MP135.
d507309 to
4cd817e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bare metal Cortex-A using virtual DDR RAM. Also adds SHA3 / SHAKE support to the STM32 simulator for the MP135.
Note: wolfSSL doesn't yet support SHAKE hardware acceleration, and software SHAKE is currently broken when compiling hardware SHA3 acceleration.