-
Notifications
You must be signed in to change notification settings - Fork 137
Add new emulator 'm33mu' update tests #664
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
Open
danielinux
wants to merge
19
commits into
wolfSSL:master
Choose a base branch
from
danielinux:m33mu-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
09a6292
Added 'emu-test-apps' + test.sh script for m33mu
danielinux 7f2ce98
Minor log message rewords in emu-test
danielinux 8d16d9f
Fixed test to work in trustzone
danielinux 26f942a
Improved test, added scenario separation
danielinux 077e2fc
Added github workflow for m33mu-based tests
danielinux 85a3cda
Fix path in workflow
danielinux df2cdcc
Added submodule init in new workflow
danielinux 2330e16
updated wolfPSA module url
danielinux 6299356
Added safe.directory for workspace
danielinux 97b6f3b
Fixes for stm32u5, added workflow test
danielinux 1ac1b60
Fixed stm32u5 WOLFBOOT_SECTOR_SIZE
danielinux 9583344
(stm32u5) fixed other instance of wrong SECTOR_SIZE
danielinux 15ea436
Fixed trustzone emulation test for stm32l552
danielinux 9a5b314
Changed CI emulator container version
danielinux d0ea72f
Added test for L5, up to container 1.1
danielinux fca80c9
stm32l5 hal: removed debug printf
danielinux 403f5ad
Up emulator container version m33mu-ci:1.2
danielinux 35f83be
Update copyright in emu-test-apps files
danielinux 9b24a65
Cosmetic fix test-update-server
danielinux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: trustzone-emulator-tests | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| trustzone-emulator-tests: | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ghcr.io/danielinux/m33mu-ci:1.2 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Init submodules | ||
| run: | | ||
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
| git submodule update --init --single-branch | ||
|
|
||
| - name: Configure stm32h5 (TZ) and build wolfboot | ||
| run: | | ||
| cp config/examples/stm32h5-tz.config .config | ||
| make wolfboot.bin | ||
|
|
||
| - name: Run emu test (stm32h5) | ||
| working-directory: test-app/emu-test-apps | ||
| run: | | ||
| ./test.sh | ||
|
|
||
| - name: Clean and build stm32u5 (TZ + wolfcrypt) | ||
| run: | | ||
| make clean distclean | ||
| cp config/examples/stm32u5-wolfcrypt-tz.config .config | ||
| make wolfboot.bin | ||
|
|
||
| - name: Run emu test (stm32u5) | ||
| working-directory: test-app/emu-test-apps | ||
| run: | | ||
| TARGET=stm32u5 ./test.sh | ||
|
|
||
| - name: Clean and build stm32l5 (TZ + wolfcrypt) | ||
| run: | | ||
| make clean distclean | ||
| cp config/examples/stm32l5-wolfcrypt-tz.config .config | ||
| make wolfboot.bin | ||
|
|
||
| - name: Run emu test (stm32u5) | ||
| working-directory: test-app/emu-test-apps | ||
| run: | | ||
| TARGET=stm32l5 ./test.sh |
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| # Makefile | ||
| # | ||
| # Copyright (C) 2026 wolfSSL Inc. | ||
| # | ||
| # This file is part of wolfBoot. | ||
| # | ||
| # wolfBoot is free software; you can redistribute it and/or modify | ||
| # it under the terms of the GNU General Public License as published by | ||
| # the Free Software Foundation; either version 3 of the License, or | ||
| # (at your option) any later version. | ||
| # | ||
| # wolfBoot is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with this program; if not, write to the Free Software | ||
| # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA | ||
|
|
||
| -include ../../.config | ||
| include ../../tools/config.mk | ||
| include ../../options.mk | ||
| include ../../tools/test.mk | ||
|
|
||
| ifneq ($(wildcard $(WOLFBOOT_ROOT)/lib/wolfssl/wolfcrypt/src/asn.c),) | ||
| WOLFBOOT_LIB_WOLFSSL:=$(WOLFBOOT_ROOT)/lib/wolfssl | ||
| else ifneq ($(wildcard $(WOLFBOOT_ROOT)/../wolfssl/wolfcrypt/src/asn.c),) | ||
| WOLFBOOT_LIB_WOLFSSL:=$(WOLFBOOT_ROOT)/../wolfssl | ||
| endif | ||
| export WOLFBOOT_LIB_WOLFSSL | ||
|
|
||
| WOLFBOOT_ROOT?=$(abspath ../..) | ||
|
|
||
| EMU_VERSION?=1 | ||
| EMU_EXPECT_VERSION?=$(EMU_VERSION) | ||
| PRIVATE_KEY?=$(WOLFBOOT_ROOT)/wolfboot_signing_private_key.der | ||
|
|
||
| M33MU?=$(WOLFBOOT_ROOT)/../m33mu/build/m33mu | ||
|
|
||
| ifeq ($(TARGET),stm32h563) | ||
| EMU_DIR=stm32h563 | ||
| EMU_CPU=stm32h563 | ||
| else ifeq ($(TARGET),stm32h5) | ||
| EMU_DIR=stm32h563 | ||
| EMU_CPU=stm32h563 | ||
| else ifeq ($(TARGET),stm32u585) | ||
| EMU_DIR=stm32u585 | ||
| EMU_CPU=stm32u585 | ||
| else ifeq ($(TARGET),stm32u5) | ||
| EMU_DIR=stm32u585 | ||
| EMU_CPU=stm32u585 | ||
| else ifeq ($(TARGET),stm32l552) | ||
| EMU_DIR=stm32l552 | ||
| EMU_CPU=stm32l552 | ||
| else ifeq ($(TARGET),stm32l5) | ||
| EMU_DIR=stm32l552 | ||
| EMU_CPU=stm32l552 | ||
| else ifeq ($(TARGET),nrf5340) | ||
| EMU_DIR=nrf5340 | ||
| EMU_CPU=nrf5340 | ||
| else ifeq ($(TARGET),mcxw) | ||
| EMU_DIR=mcxw71 | ||
| EMU_CPU=mcxw71c | ||
| else ifeq ($(TARGET),mcxw71) | ||
| EMU_DIR=mcxw71 | ||
| EMU_CPU=mcxw71c | ||
| else | ||
| EMU_DIR= | ||
| EMU_CPU= | ||
| endif | ||
|
|
||
| ifeq ($(strip $(EMU_DIR)),) | ||
| $(error Unsupported or unset TARGET=$(TARGET). Use TARGET=stm32h563|stm32h5|stm32u585|stm32u5|stm32l552|stm32l5|nrf5340|mcxw) | ||
| endif | ||
|
|
||
| EMU_PATH=$(WOLFBOOT_ROOT)/test-app/emu-test-apps/$(EMU_DIR) | ||
|
|
||
| .PHONY: all clean test-emu sign-emu run-emu | ||
|
|
||
| all: | ||
| $(MAKE) -C $(EMU_PATH) clean app.bin | ||
|
|
||
| sign-emu: all $(WOLFBOOT_ROOT)/wolfboot_signing_private_key.der | ||
| @cp $(EMU_PATH)/app.bin $(EMU_PATH)/image.bin | ||
| $(SIGN_ENV) $(SIGN_TOOL) $(SIGN_OPTIONS) $(EMU_PATH)/image.bin $(PRIVATE_KEY) $(EMU_VERSION) | ||
|
|
||
| run-emu: sign-emu | ||
| @echo "[EMU] CPU=$(EMU_CPU) VERSION=$(EMU_VERSION)" | ||
| @$(M33MU) --cpu $(EMU_CPU) --uart-stdout --no-tz --boot-offset=$(IMAGE_HEADER_SIZE) \ | ||
| $(EMU_PATH)/image_v$(EMU_VERSION)_signed.bin --timeout 2 \ | ||
| | tee $(EMU_PATH)/emu_uart.log | ||
| @grep -q "get_version=$(EMU_EXPECT_VERSION)" $(EMU_PATH)/emu_uart.log | ||
|
|
||
| # Entry point for top-level make test-emu | ||
| # Builds, signs, runs, and validates UART output. | ||
|
|
||
| test-emu: run-emu | ||
|
|
||
| clean: | ||
| $(MAKE) -C $(EMU_PATH) clean | ||
| @rm -f $(EMU_PATH)/image.bin $(EMU_PATH)/image_v*_signed.bin $(EMU_PATH)/emu_uart.log | ||
|
|
||
| $(WOLFBOOT_ROOT)/wolfboot_signing_private_key.der: | ||
| $(MAKE) -C $(WOLFBOOT_ROOT) WOLFBOOT_LIB_WOLFSSL="$(WOLFBOOT_LIB_WOLFSSL)" wolfboot_signing_private_key.der |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /* emu_app.h | ||
| * | ||
| * Copyright (C) 2026 wolfSSL Inc. | ||
| * | ||
| * This file is part of wolfBoot. | ||
| * | ||
| * wolfBoot is free software; you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation; either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * wolfBoot is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program; if not, write to the Free Software | ||
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA | ||
| */ | ||
|
|
||
| #ifndef EMU_APP_H | ||
| #define EMU_APP_H | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| void emu_uart_init(void); | ||
| int emu_uart_read(uint8_t *c); | ||
| void emu_uart_write(uint8_t c); | ||
|
|
||
| #endif /* EMU_APP_H */ |
Oops, something went wrong.
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.
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.
I think this should be
RCC_APB1ENR1