Commit Graph

506 Commits (master)

Author SHA1 Message Date
David Garske 39085635c6
Merge pull request #676 from mattia-moffa/20260128-nxp-sdk-update
Update MCUXpresso SDK to new refactor
2026-01-29 17:49:42 -08:00
Mattia Moffa fed7eec0ad Update MCUXpresso SDK for iMX-RT too 2026-01-30 01:07:13 +01:00
Mattia Moffa 109dbd08d9 Update MCUXpresso SDK to new refactor
Updates targets using the deprecated
https://github.com/nxp-mcuxpresso/legacy-mcux-sdk to use
https://github.com/nxp-mcuxpresso/mcuxsdk-manifests instead.
2026-01-29 17:35:24 +01:00
David Garske 2c67f99507
Merge pull request #675 from mattia-moffa/20260123-wolfboot-cmake-fixes
Support stm32h5 TrustZone build via CMake
2026-01-28 13:02:29 -08:00
Mattia Moffa 4b5a3d1e13 Remove duplicated object, move up WOLFBOOT_DEFS_PUBLIC 2026-01-28 00:41:09 +01:00
Mattia Moffa d3bd8aaab0 test-app keystore.c fix 2026-01-27 19:04:45 +01:00
Mattia Moffa 6dfe2671f5 Support stm32h5 TrustZone build via CMake 2026-01-27 18:36:08 +01:00
David Garske 810be2d576
Merge pull request #671 from mattia-moffa/20260107-mcxn
NXP MCXN non-TrustZone + TrustZone port
2026-01-26 09:28:14 -08:00
David Garske 1e35087ce4 NXP S32K14X improvements from customer testing 2026-01-26 17:46:51 +01:00
David Garske ae63f60efc Fixes for EL2 -> EL1 on boot 2026-01-26 13:08:50 +01:00
David Garske ee3c313a66 Versal port cleanups 2026-01-26 13:08:50 +01:00
David Garske dad2888450 Fixes for getting the "test-app" booting 2026-01-26 13:08:50 +01:00
David Garske ae32d5b6f3 AMD/Xilinx Versal Gen 1 VMK180 wolfBoot support 2026-01-26 13:08:50 +01:00
David Garske e1bef7ac70 PolarFire PQC (ML-DSA) testing 2026-01-26 11:27:39 +01:00
Mattia Moffa d6bd791374 Remove temporary comment 2026-01-22 19:06:19 +01:00
Mattia Moffa 438c250288 MCXN non-TrustZone + TrustZone port 2026-01-22 18:55:46 +01:00
David Garske 4e3e55d53a Add NXP S32K1xx support with full update functionality
- HAL: Flash (FTFC), UART (LPUART1), Clock (FIRC 48MHz), Watchdog
- Requires NVM_FLASH_WRITEONCE=1 and RAM_CODE=1 for proper operation
- Test app with interactive console: status, trigger, success, reboot
- LED indicators: Green (v1), Blue (v2+)
- Flash automation script: tools/scripts/nxp-s32k142-flash.sh
- Tested on S32K142EVB with sector swap update

Supported variants: S32K142 (256KB), S32K144 (512KB), S32K146 (1MB), S32K148 (2MB)
2026-01-19 19:13:01 +01:00
Daniele Lacamera 9e7f6c24ec Fixes after reviewer's comment
- Fix misnamed STM32U585 register
- Remove emu-test-apps linker scripts as they are autogenerated
2026-01-19 12:37:37 +01:00
Daniele Lacamera 35f83be1a7 Update copyright in emu-test-apps files 2026-01-15 14:04:37 +01:00
Daniele Lacamera 15ea436530 Fixed trustzone emulation test for stm32l552 2026-01-15 13:54:10 +01:00
Daniele Lacamera 1ac1b608f2 Fixed stm32u5 WOLFBOOT_SECTOR_SIZE 2026-01-15 13:54:10 +01:00
Daniele Lacamera 97b6f3b63b Fixes for stm32u5, added workflow test 2026-01-15 13:54:10 +01:00
Daniele Lacamera 26f942aff1 Improved test, added scenario separation 2026-01-15 13:54:10 +01:00
Daniele Lacamera 8d16d9fb22 Fixed test to work in trustzone 2026-01-15 13:54:10 +01:00
Daniele Lacamera 7f2ce98d18 Minor log message rewords in emu-test 2026-01-15 13:54:10 +01:00
Daniele Lacamera 09a6292f7e Added 'emu-test-apps' + test.sh script for m33mu 2026-01-15 13:54:10 +01:00
Mattia Moffa b8f70ad57d Various small fixes for nrf5340 TrustZone PKCS11 2025-12-24 18:58:33 +01:00
David Garske 963cdadeaf Peer review fixes 2025-12-24 18:31:55 +01:00
David Garske 5f51e0febc Working Secure boot of PolarFire SoC 2025-12-24 18:31:55 +01:00
David Garske afb9c84cdf Fix for uSD read to handle start that is not block aligned 2025-12-24 18:31:55 +01:00
David Garske e055585942 Support for Microchip PolarFire SoC (MPFS250) 2025-12-24 18:31:55 +01:00
Mattia Moffa 5134eea96a Support WOLFCRYPT_TZ and PKCS11 on nRF5340 2025-12-13 04:05:32 +01:00
Brett Nicholas 57b874be2d Simplify use of user-supplied keys and certificates with test app via
new `USER_ variables`
2025-12-10 07:43:32 +01:00
Mattia Moffa 23ba33140e MCXW TrustZone support 2025-12-05 01:27:58 +01:00
David Garske 95b91b8401
Merge pull request #641 from mattia-moffa/20251125-nrf5340-tz
nRF5340 TrustZone
2025-11-25 10:14:33 -08:00
David Garske b9fd9e0f7c Add init_array's to test-app linker script 2025-11-25 16:26:08 +01:00
Mattia Moffa df49fbf7f5 Fix GPIO pin assignment 2025-11-25 05:22:33 +01:00
Mattia Moffa 5fb5b4b6ea nRF5340 TrustZone port 2025-11-25 03:01:03 +01:00
David Garske 2546ebcaf9 Fixes for unused variables. Also repaired STM32WB55 build with PKA 2025-11-20 18:26:58 +01:00
Mattia Moffa 076eabcc54 Non-TZ nRF5340 fixes 2025-11-20 18:00:55 +01:00
Mattia Moffa d5b2b4728d Various STM32 TrustZone improvements
- New config flags for flash geometry
- New script to automatically set option bytes
- End of stack address fix for the STM32U5 test app
- STM32U5 support for NUCLEO-U575ZI-Q (previously only supported
  discovery board)
2025-11-20 18:00:55 +01:00
David Garske 8cb3d33339 Added STM32H5 SPI Driver and support for TPM
Cleanup STM32H5 HAL port.
Refactor `__ARM_FEATURE_CMSE` to `TZ_SECURE()`
Refactor attribute cmse_nonsecure_entry to use new macro `CSME_NSE_API`
Added TPM Non Secure Callable API's
Added TPM support to STM32H5 test application
2025-11-19 16:29:28 +01:00
David Garske c2ed553da1 Added Vorago VA416x0 wolfBoot support
Added check on image header size and sector size.
Expanded the ML-DSA testing.
2025-11-19 11:11:28 +01:00
Daniele Lacamera 10a0c0bfa0 Add simulator support for DUALBANK, test bank swap 2025-11-03 11:21:22 +01:00
Mattia Moffa 61f1710ba8 Fix STM32H5 dualbank update 2025-10-30 20:27:49 +01:00
Mattia Moffa 18134632a7 Fix non-trustzone configs 2025-10-29 00:41:52 +01:00
Mattia Moffa 177358e88d Update H5 app to use new NSC API
- Make the update and swap partitions secure and inaccessible from the
  app except via NSC API
- Add a couple of necessary new NSC functions
- Update the app to only use NSC API
- Fix hal_flash_erase to account for secure addresses
- Fix some bugs in xmodem implementation
2025-10-29 00:13:01 +01:00
David Garske 68d28fc482
Merge pull request #609 from gojimmypi/pr-copyright
Update Copyright year to 2025
2025-10-16 15:09:03 -07:00
David Garske 301080adc4 Reverted change for H5 heap (not needed). Tracked issue down to a missing malloc fixed here: https://github.com/wolfSSL/wolfssl/pull/9305 2025-10-16 23:02:09 +02:00
David Garske 2df3768cce Fixes to support latest wolfSSL (disable KDF/PRF) 2025-10-16 23:02:09 +02:00
David Garske 4c8bf4069f Fix for "benchmark" command to support float with nano.specs. Increase test-app heap size. 2025-10-16 23:02:09 +02:00
gojimmypi fbd8dcf8a2
Update Copyright year to 2025 2025-10-15 11:33:53 -07:00
David Garske f7d526057a Fixes to resolve STM32H5 TrustZone example. Thank you @danielinux 2025-10-10 19:42:20 +02:00
David Garske 7f193af97d Fixes for STM32H5 TrustZone and PKCS11 store 2025-10-10 19:42:20 +02:00
Brett Nicholas aa21f7c56c add license files 2025-10-08 14:38:24 -06:00
Brett Nicholas 42cf7e9b70 TC3xx: Replace IDE/AURIX project with new HAL module 2025-10-08 11:03:44 -06:00
Brett Nicholas 2e06a5fafe Refactor Makefiles to allow overriding library dependency paths 2025-10-02 15:16:27 +02:00
Daniele Lacamera f3b4b17bdf Fixed build with Cmake on STM32H7 with TEST_APPS.
As reported in #586
2025-08-07 19:38:10 +02:00
Daniele Lacamera 4dd87d766c Fixed missing long_call attribute, hal erase/write
Fix definition of secure/non-secure flash areas

+ other minor fixes
2025-07-31 15:49:20 +02:00
Daniele Lacamera ae97fca60d Updated wolfPKCS11 submodule
+ Fix visibility of clock_gettime for benchmark in test applications
2025-07-30 11:02:24 +02:00
Brett Nicholas c106d92a48 wolfHSM server support with X509 auth 2025-06-25 12:17:39 +02:00
Alex Lanzano 248fd985b3 Update stm32f4 test-app to use config options to setup clock and uart
Allows the pll clock to be configured using the config macros instead of
being hard coded.
2025-06-21 14:54:04 -04:00
Alex Lanzano 72baf96440 Rename CPU_FREQ macro to CLOCK_SPEED. Remove CPU_FREQ from system.h 2025-06-21 14:54:04 -04:00
Marco Oliverio c90c01ac2d pic32c-app: use symbolic name for pins offset 2025-06-09 16:29:31 +02:00
Marco Oliverio 1b9ec09b1a fix reviewer's comments 2025-06-09 16:29:31 +02:00
Marco Oliverio 2d6cf95c20 add support for PIC32CZ and PIC32CK 2025-06-09 16:29:31 +02:00
Brett Nicholas d49e507926 - Support external flash for elf scatter-loading
- Support ELF scatter-loading on TC3xx
- Modify TC3xx HAL flash erase to support arbitrary offsets and sizes
- Realign partition size and addresses to support more efficient sector mass erase on update
2025-05-08 08:50:26 -06:00
Daniele Lacamera ea0b4fb935 Added missing files + cosmetics as per review
- Added missing `test-app/app_sim_scattered.c`
- Added missing `test-app/sim_scattered.ld`
- Fixed comments at the end of define blocks for consistency
- Removed unused constants as indicated
2025-04-11 15:55:05 +02:00
Daniele Lacamera 9c3e86241a Some of the fixes requested during review:
- ARCH_FLASH_OFFSET only used in simulation (dynamic 'base' address)
- Fixed the DISABLE_BACKUP case
- renamed define to WOLFBOOT_ELF_SCATTERED
2025-04-11 15:55:05 +02:00
Daniele Lacamera 11091944d7 ELF_SCATTERED: added sha check (WIP) 2025-04-04 19:15:04 +02:00
Daniele Lacamera e7cd340ebf Moved elf parsing/scattering to elf.c, WIP sim 2025-04-03 17:12:42 +02:00
Daniele Lacamera 0901bb4c92 Removed duplicate flag 2025-03-28 11:30:07 +01:00
Daniele Lacamera 068f1acfc9 Added missing symbols, change fix for double def 2025-03-27 18:21:25 +01:00
Patrik Dahlström 2f64090c49 stm32f103: add test application
The test application used during development of STM32F103 support. If
booting version 1 of the software, trigger an update. If running ver. 2,
all is good.

Signed-off-by: Patrik Dahlström <risca@dalakolonin.se>
2025-02-21 18:41:04 +01:00
Daniele Lacamera ea79b86fb1 Added comment in test-app 2025-02-20 16:20:05 +01:00
Daniele Lacamera 354df34b6c Added build test. Updated mcxa + mcxw to mcux-sdk 2025-02-18 14:43:37 +01:00
Daniele Lacamera 4d1bf5df28 Draft support for MCX W71 2025-02-18 14:42:39 +01:00
David Garske 7205820afa Added QSPI DMA support. 2024-12-30 15:36:43 +01:00
Brett Nicholas 21a4082952
Merge pull request #521 from danielinux/build-keytools-windows
Remove compile-time dependencies from key tools
2024-12-05 16:56:42 -07:00
David Garske d007c9af08 Initial support for NXP LS1028A. Booting into OCRAM app. Updates to ARMv8 startup. 2024-12-02 19:41:26 +01:00
Daniele Lacamera 04d2ecd246 Remove dependency from PQC parameters. Speed up tests. 2024-12-02 18:55:32 +01:00
Daniele Lacamera 137a97fbae Correct include order in nrf53 test app 2024-12-02 12:27:27 +01:00
Daniele Lacamera b0e3000d88 Added libwolfboot to nrf53 app build 2024-12-02 12:19:10 +01:00
Daniele Lacamera a31ddfc553 Fixed include order 2024-11-28 11:28:31 +01:00
Daniele Lacamera 75efbd9cfb Removed all compile-time dependency from keytools 2024-11-26 13:17:00 +01:00
Brett Nicholas 78e4275f99 Initial wolfHSM support for simulator and AURIX TC3xx 2024-11-13 09:52:49 +01:00
Daniele Lacamera 72a0aa3853 Added Benchmark script. Added ARMASM support. 2024-10-24 21:20:09 +02:00
Daniele Lacamera 95d58244a9 SAMA5D3: Hal fixes, add DBGU, enable ARM_ASM 2024-10-14 10:14:48 +02:00
Daniele Lacamera 07bdae680a ARMASM. Macros for clocks+gpios. Set MAC pins. 2024-10-14 10:14:48 +02:00
David Garske 7260ecbcbb Added tests for delta updates. Added logging for delta version errors. Added `SIGN_OPTIONS_EXTRA`. 2024-10-11 10:29:59 +02:00
David Garske f6c12839f3 Enable ECC384 and SHA384. Fix sleep_us. Add Cortex-M hard-fault handler support. 2024-10-11 10:29:59 +02:00
David Garske ab59175427 Fix for nRF5340 `uart_write` issue with memchr args, which caused occasional corrupt characters to be printed. Improve core state description in logging. Enabled network core test app GPIO work on `LED2 P0.29`. 2024-10-11 10:29:59 +02:00
David Garske 6db7de6a75 Support for the Nordic nRF5340 (application and network cores):
* Added nRF5340 driver support for Clock, Internal Flash (NVMC), GPIO, SPU, OTP, UART, SPI, QSPI and IPC.
* Added support for updating the network core (Sign using "--id 2")
* Cleanup the nRF52 port
* Improved external QSPI and internal Flash tests and logging.
* Improved internal printf support for formatter length.
2024-10-11 10:29:59 +02:00
Daniele Lacamera c80937bdea Addressed reviewer's comments 2024-10-02 10:25:36 +02:00
Daniele Lacamera 294d62d0c6 [SAMA5D3] Support for DDR2 memory on -xplained 2024-09-30 14:06:23 +02:00
Daniele Lacamera 76920599b3 [SAMA5D3] Added test-app, moved to SP_ASM 2024-09-30 14:06:17 +02:00
Daniele Lacamera 888d538760 [SAMA5D3] Nand flash driver 2024-09-30 14:06:17 +02:00
Daniele Lacamera bbd4e2b1c3 [SAMA5D3] Stub for test application 2024-09-30 14:06:06 +02:00
David Garske 8a7f5e5baa Refactor to eliminate PLATFORM_ -> TARGET_. Fix CI errors. 2024-08-14 18:06:12 +02:00
Daniele Lacamera 30a1f67e43
Added 32bit simulator via TARGET=sim FORCE_32BIT=1 (#485)
* Added 32bit simulator via TARGET=sim FORCE_32BIT=1

Tests can now run on 32bit simulator (e.g. to match XMALLOC fixed
sizes with sp_math and WOLFBOOT_SMALL_STACK).

* Added draft for new workflow: test simulator with different memory config

* Fix 64bit, SMALL_STACK xmalloc sizes

* Test defaults to SPMATH

* Fixed test: defaults to spmath. Added RSA tests (failing)

* Fixed RSA allocation sizes for 64bit build

* Added 64bit fastmath test (failing)

* Fixed ecc_point size for 64bit builds (FASTMATH)

* simulator config: use SPMATH by default

* Attempt to fix i386 libc dep in workflow

* Added HUGE_STACK to silence warning in FASTMATH+RSA4096 tests
2024-08-09 06:46:15 -07:00
David Garske 82094c92e1 Cleanup "tail" to "trailer" 2024-07-18 14:18:51 -07:00
Daniele Lacamera 428a943c83 Fixed STM32F7 linker script error with new gcc 2024-07-18 10:40:20 +02:00
Daniele Lacamera 8b73250324 Set trailer on BOOT partition when storing the enc key 2024-07-17 17:00:11 +02:00
David Garske 3444c47fdb * Added support for RX65N and RX72N with native Makefile and RX ELF GCC compiler.
* Added initialization of the clocks and UART driver.
   - wolfBoot uses on chip high speed oscillator (HOCO) at (120MHz RX65N and 240Mhz for RX72N).
* Added RX RSPI and QSPI driver support with external SPI flash
* Improve documentation and fix spelling errors.
* Added .srec (s-record) format support
* Added RX TSIP support for ECDSA (requires https://github.com/wolfSSL/wolfssl/pull/7685).
* Allow custom implementation of `get_trailer_at`, `set_trailer_at` and `set_partition_magic` using `CUSTOM_PARTITION_TRAILER`
2024-07-17 06:08:31 +02:00
John Bland 6c3940fafc refactor final step of powerfail safe update and add
emergency fallback test
2024-07-10 16:58:23 -04:00
David Garske 16bdc19914 Fixes for building STM32H5 without PKCS11. 2024-07-09 10:22:43 -07:00
David Garske 0d41724395 Fix for STM32H5 without OTP keystore `FLASH_OTP_KEYSTORE=0`. 2024-07-09 10:22:43 -07:00
Daniele Lacamera 0fb1f81c0a STM32H5 Test app: improved console 2024-07-09 10:22:43 -07:00
Daniele Lacamera 9b61f8923b Fixed update + write to the right bank 2024-07-09 10:22:42 -07:00
Daniele Lacamera 4f50f423a8 Take into account bank swapping on erase.
Fixes update demo.
2024-07-09 10:22:42 -07:00
Daniele Lacamera 107247f0fb Fix xmodem packet number sync 2024-07-09 10:22:42 -07:00
Daniele Lacamera 9d563ae60f Added XMODEM update 2024-07-09 10:22:42 -07:00
Daniele Lacamera aff2072694 Demo app: added test, benchmark, other gadgets 2024-07-09 10:22:42 -07:00
Daniele Lacamera 34d5ec15ea Fixed UART devices in NS-mode, fixed H5 clock 2024-07-09 10:22:42 -07:00
Daniele Lacamera 059868ec45 STM32H5 uart support, work in progress 2024-07-09 10:22:42 -07:00
David Garske 83359a2b1e Added RT1062 EVKB support and tested on real hardware. Updated documentation. 2024-07-03 14:58:04 -07:00
Daniel Fedai Larsen 74270cdc56 Add fsl_cache to test-app 2024-07-03 07:44:54 +02:00
Lealem Amedie 2d699b4fec CMake: Add BUILD_IMAGE option 2024-05-21 10:35:59 +02:00
David Garske 027c6847e5
Merge pull request #443 from wolfSSL/x86_fsp_backport
x86 fsp backport
2024-05-09 07:46:56 -07:00
Daniele Lacamera 3ec982109c STM32H5: added support for TrustZone
- Unified TZ support for STM32L5, STM32H5, STM32U5
- Fixed/added example configuration files
- Expanded documentation
- Added new configurations to automated tests
2024-05-09 16:33:40 +02:00
Marco Oliverio 5dd9fa94d7 minor fixes 2024-05-09 16:33:30 +02:00
Daniele Lacamera 19fdbb8998 Initial support for STM32H5, sunny day boot
STM32H5: Tested sunny day boot

- Temporarily decreased clock speed to 125MHz
- Test app working
- Re-mapped Nucleo board LEDs
- Tested on STM32H563ZI
2024-05-09 16:28:06 +02:00
Marco Oliverio 84350a9e96 x86_fsp: add QEMU test app (ELF 64bit) 2024-04-24 10:50:50 +02:00
David Garske a37a816693
Merge pull request #433 from danielinux/gpl3
Update license GPL2 -> GPL3
2024-04-16 10:36:10 -07:00
Daniele Lacamera 637f135ca6 Added section for ARM.exidx in test-app linker script 2024-04-16 18:36:25 +02:00
Daniele Lacamera fce6149cf8 Update license GPL2 -> GPL3 2024-04-16 16:46:15 +02:00
David Garske 574f42ad83 Add support for wolfBoot_success() from test-app. 2024-03-29 11:51:26 -07:00
David Garske 61d24ab857 Added test-app code to change LED color based on version. Improved documentation. Minor code cleanups. 2024-03-29 11:10:30 -07:00
Daniele Lacamera dfc53df909 Added support for NXP MCXA153 2024-03-29 10:25:08 +01:00
David Garske 5ecd2f749d Cleaned up TLV example and simulator output. Moved `wolfBoot_find_header` to the public header. 2024-03-08 12:15:23 -08:00
Daniele Lacamera 440ebb9dc1 Addressed reviewer's comments 2024-03-08 20:12:50 +01:00
Daniele Lacamera 00ec1b4395 Added github action to test custom TLV 2024-03-08 18:58:21 +01:00
Daniele Lacamera e9d65b3bd2 Fixed TLV alignment for 8B fields
+ added sim "get_tlv" command
2024-03-08 18:40:34 +01:00
David Garske 11017d8af2
Merge pull request #405 from MulattoKid/mimxrt1040evk_support
Add support for MIMXRT1042XJM5B
2024-02-15 15:02:09 -08:00
Daniele Lacamera c70c8a470d Added support for Microchip SAM E51 2024-02-15 17:30:11 +01:00
Daniel Fedai Larsen 0f25c80114 Add support for MIMXRT1042XJM5B 2024-02-13 11:50:21 +01:00
David Garske 6ccf221483 Fixes for building TI Hercules. 2024-02-06 15:31:34 +01:00
David Garske 83283c6cf7 Fixes for NXP T1024 and booting Integrity OS:
* Fixed PPC spin table based on ePAPR 1.1.
* Added flattened device tree (FDT) support. Setting required FDT fields per ePAPR 1.1.
* Added Frame Manager microcode upload.
* Fixed CPLD and setting QE clock.
* Added support for setting logical device numbers and updated device tree.
* Fixed QUICC Engine base address (was incorrect, should be 0x140000).
* Fixed "cpu-release-addr" to use 64-bit value.
* Added secondary cached boot page.
* Added L2 cache support to multi-core.
* Added flattened device tree parser tool for testing (`make fdt-parser` and `tools/fdt-parser/fdt-parser`).
* Added checks for FDT header.
* Added automated test case for NXP T1024 FDT.
2024-01-17 14:16:15 +01:00
Daniele Lacamera ba04692d1a Added test: enc-delta-update with extradata 2023-11-04 18:53:08 +01:00
David Garske c4dfa3f986 PR cleanups based on peer review. Fixes to support < 10KB wolfBoot for either RSA2048 or ED25519. Partition scheme allows 10KB application partition or (6KB actual due to NVM write once). Made space using NO_MPU=1, RAM_CODE=0, USE_SLOW_SHA256 and !FLASH_SECURABLE_MEMORY_SUPPORT. 2023-10-13 14:34:01 +02:00
Bill Phipps a1d584b838 STM32C0 support 2023-10-13 14:34:01 +02:00
John Bland 00a9572b94 change the final steps of wolfBoot_update into
repeatable steps so that power failure wont erase the encryption key and wont cause skipping the testing phase of boot. this is done by marking the update partition as final swap when erasing the final sector and backing up the key in boot sector 0 after swaping the real boot sector 0 to swap. then when a power failure occurs the encryption key will be available in either boot sector 0 or the normal location. the intermediate phase also prevents skipping the testing phase since the last sector, which holds the boot state, is erased and then set repeatably, since the final swap state is set on the update partition
2023-10-13 14:30:04 +02:00
David Garske b3e2fb9ddd NXP T1024 wolfBoot support:
* Added DDR4 w/ECC.
* Added L2 and L2 CPC SRAM support
* Added platform SRAM 160KB support
* Added support for core timers (timebase) and platform clock.
* Added IFC driver with erase/write
* Added stage 1 loader to relocate wolfBoot to DDR
* Added CPLD, QUICC, FMAN and MP drivers
* Added eSPI driver for TPM.
* Added hal_early_init instead of calling ddr_init directly.
* Fixes for device tree (DTB) loading with update_ram and PPC boot.
* Fixes for relocating CCSRBAR to upper.
* Fixes for interrupt offsets.
2023-10-06 15:28:16 +02:00
Daniele Lacamera b8a5a6243d Cleanup, config rename, documentation 2023-09-21 08:31:30 +02:00
Daniele Lacamera e4abcbd78b Expanded RAM space for App 64->128 KB 2023-09-21 08:29:16 +02:00
Daniele Lacamera ed0357289c Fixed NS flash access + flash write unlock + misc
- non-secure flash area increased to cover BOOT+UPDATE partitions
- call unlock/lock functions before accessing pkcs11 store for writing
- Enabled more features in application wolfcrypt front-end
- Fixed compiler w4rnings
2023-09-21 08:28:23 +02:00
Daniele Lacamera 4205e3105d Test code clean-up 2023-09-21 08:28:23 +02:00
Daniele Lacamera bcbb0c2cfe Rebased on latest master 2023-09-21 08:28:23 +02:00
Daniele Lacamera d53999de18 Fixed PKCS11 store functions.
Working C_InitToken/C_Login.
2023-09-21 08:28:23 +02:00
Daniele Lacamera fd862cbd8f Working PKCS11 test.
Temporarily removed some features so the image fits in 64Kb
2023-09-21 08:28:09 +02:00
Daniele Lacamera 20e8b021b5 Added NS wrappers for PKCS11 API 2023-09-21 07:57:18 +02:00
Daniele Lacamera f7d6c17685 TZ: PKCS11 wrappers via wolfPKCS11 in S world 2023-09-21 07:57:18 +02:00
Daniele Lacamera 9d62a7d13d Added ECC PK_CALLBACKS + CRYPTO_CB APIs 2023-09-21 07:57:18 +02:00
Daniele Lacamera 41b11ed1dd Added uart support for stm32l5 (LPUART1) 2023-09-21 07:57:18 +02:00
Daniele Lacamera 0cc1eea05d Added raw file read from NS-domain
+ fix linker script with the correct NSC address
+ fix ecc key import
2023-09-21 07:57:18 +02:00
Daniele Lacamera e2ab9a5553 Unified TZ support for STM32L5/U5
- added file with common code
- added support for TRNG on U5
- added support for wolfcrypt NSC on U5
2023-09-21 07:57:18 +02:00
Daniele Lacamera 80f881dab5 Fixed STM32L5 TRNG driver + simplified GTZC and SAU setup 2023-09-21 07:57:18 +02:00
Daniele Lacamera fd809c5b69 Expanded WCS interface
- Added TRNG driver for STM32L5
- Link with correct objects in test-app
- Expanded wc_callable interface
2023-09-21 07:57:18 +02:00
Daniele Lacamera 61ea65747b Added secure functions to set/provision key slots 2023-09-21 07:57:18 +02:00
Daniele Lacamera c7c90cd2cc Back-end calls for ecc sign/verify/getpublic 2023-09-21 07:57:18 +02:00
Daniele Lacamera 9bf80ab8cd Initial draft: wolfcrypt secure mode 2023-09-21 07:57:18 +02:00
David Garske 490286be7d Support for sealing/unseal a secret based on an externally signed PCR policy.
* Added new `WOLFBOOT_TPM_SEAL` and `WOLFBOOT_TPM_SEAL_NV_BASE` config options.
* Added new `tools/tpm/policy_create` tool for assisting with creation of a policy digest. The sign keytool `--policy=file` signs the policy.
* Added new `WOLFBOOT_TPM_VERIFY` option to enable offloading of the asymmetric verification to the TPM. By default wolfCrypt will be used.
* Added example seal/unseal to update_flash for ARCH_SIM.
* Renamed `WOLFBOOT_TPM_KEYSTORE_NV_INDEX` to `WOLFBOOT_TPM_KEYSTORE_NV_BASE` to support multiple public keys.
* Refactored most TPM code into tpm.c.
* Refactored the keystore ROT to use new `wolfBoot_check_rot` API.
* Refactored the sign keytool to have a sign_digest function to allow signing firmware and policy for sealing/unsealing.
* Fix for make distclean && make using the wrong key tools.
2023-09-12 12:26:48 +02:00
John Bland 34b563674a remove SysTick_Config, add wolfBoot_success 2023-08-22 10:24:05 -04:00
John Bland 245f5f4cfc move the update_trigger to before the SysTick_Config call 2023-08-21 23:30:45 -04:00
John Bland fabfa843be add hal_init to the imx test-app and trigger update 2023-08-21 17:39:05 -04:00
David Garske 6ea1a1e4a5 Added GitHub action build tests for NXP parts (iMX RT, Kinetis and LPC). 2023-08-21 11:08:48 +02:00
David Garske 7b454ab898 Added flash test case for iMX RT. Fixed CRLF. Fixed test app LED IO configuration. 2023-08-21 11:08:48 +02:00
David Garske 7073bf33b4 Fix RT1050 example app LED. Fix documentation for test-app location. Peer review feedback to clarify RT1050 flash chip configuration. 2023-08-21 11:08:48 +02:00
Daniele Lacamera a020ea1bc7 fix: arch-specific LDFLAGS discarded from test-app
Regression introduced in #334
2023-08-17 15:33:40 +02:00
David Garske 7190392245 Simulator fixes and support for using MacOS:
* Added simulator support for Mac.
* Fix for simulator to properly assemble wolfboot.bin + signedtestapp + update + swap.
* Fixes for handling 64-bit assigned mmap virtual addresses. Added hal_flash_write and hal_flash_erase support for 64-bit address using uintptr_t. Enabled if platform is 64-bit and `FORCE_32BIT` is not defined
* Fix simulator conflict with src/libwolfboot.o object in test-app.
* Cleanup test-app linker flags.
2023-08-07 20:54:18 +02:00
David Garske db15f9b0f1 Further NXP P1021 fixes and improvements:
* Added ELF32 and ELF64 loader support (config `ELF=1` or build option `WOLFBOOT_ELF`).
* Add ELF support to `update_ram.c` loader.
* Add support for loading entire flash image to RAM when `EXT_FLASH=1` and `NO_XIP=1` (or `WOLFBOOT_USE_RAMBOOT`).
* Added QUICC Engine support to load microcode and enable.
* Add multiple core support for NXP P1021.
* Fixes to resolve first stage boot ROM relocation.
  - Implemented temporary workaround to resolve stack traps.
* Added PPC GOT relocation support.
* Fix for the PPC `isr_empty` handler address.
* Fix to allow stack to use DDR by having assembly setup DDR TLB. After relocating wolfBoot use stack on DDR.
* Cleanup wolfBoot output.
  - Only remove extra .bin/.elf created unless `make distclean` is used.
  - Don't output the key grep test (only check result).
  - Adjust build order (first stage, wolfboot, test app, key, sign test app and factory).
  - Fix to make sure linker script is rebuilt before objects.

Sample NXP P1021 Output:

```
Relocating BOOT ROM to DDR
Loading wolfBoot to DDR
Jumping to full wolfBoot
wolfBoot HAL Init
Flash Init: Ret 0, ID 0x76207620
QE: Length 63732, Count 1
QE: uploading 'Microcode for P1021 r1.0' version 0.0.1
QE: Traps 0
MP: Starting core 2 (spin table 0xFFFFF240)
Versions: Boot 1, Update 0
Trying Boot partition at 0x200000
Loading header 512 bytes to 0x1DFFFE00
Loading image 3170724 bytes to 0x1E000000
Image size 3170724
Firmware Valid
Loading elf at 0x1E000000
Found valid elf32 (big endian)
Booting at 0x6000
```
2023-07-05 17:03:57 +02:00
Dimitri Papadopoulos be037ca04d Fix typos found by codespell 2023-07-04 07:43:02 +02:00
Daniele Lacamera 588b3192d2 New simulator tests
- internal flash now mapped at 0xC0000000 (using `ARCH_FLASH_OFFSET`)
- wolfBoot binary included in internal flash (wolfboot partition is also
  now writeable to test self-updates and encryption)
- sim test app supports encryption (sets the key for test)
- added new target to store the update in the external flash
- external flash mapped to 0xD0000000
2023-05-15 11:13:38 +02:00
David Garske 6f24981f03 Improvements to the clock calculation code (dynamic based on ratio). Remove execute bits on files. Make stage1 PIC. Disable L1/L2 for first stage. Add PLT/GOT to .data region. 2023-05-10 15:11:09 -07:00
David Garske 89b2303b87 Fix NXP T2080 build. 2023-05-09 09:49:51 -07:00
David Garske c2fbcecda1 Reduce first stage init code (don't relocate CCSRBAR or invalidate all TLB's). Improve udelay to use timebase. Fix L1 cache line sizes. Fix L2ADDR to enable all 256KB. Use `do_boot` not the jump to function pointer. Switch PPC test app linker script to use `WOLFBOOT_LOAD_ADDRESS`. 2023-05-08 17:42:14 -07:00
David Garske 790a63809f Update P1021 test-app to use shared HAL for UART. 2023-05-05 12:49:06 -07:00
David Garske ef35f473c9
Merge pull request #296 from jpbland1/tpm-root-trust
wolfTPM pubkey storage with policy based access restriction
2023-05-04 15:09:06 -07:00
John Bland fe2b797b01 get wolfboot simulator working with the tpm simulator
move pcr reset and extend outside of session

the tpm uses policy checking for modifying PCR's so we need to reset and extend the PCR's with the image hash before the session begins, currently tested unseal, having trouble getting the simulator to run update in order to test reseal
2023-05-03 11:39:25 -04:00
David Garske 69ca95eb94 Adds `factory_wstage1.bin` option to include first stage loader. Fix test-app verbose issue. 2023-04-21 16:41:00 +02:00
Daniele Lacamera 57a8fb30f1 Added test scripts 2023-03-21 18:03:38 +01:00
Daniele Lacamera 6aa5c114e5 Added option to sim target to simulate powerfails 2023-03-21 18:03:38 +01:00
Brett Nicholas 680ce5f8e8 first commit - test app boots on MIMXRT1064-EVK 2023-03-06 17:31:48 +01:00
David Garske 80ac15693c Fixed STM32H7 UART 5. Added CMake support for DEBUG_UART. Adjust example config to use correct QSPI offsets for update partition. 2023-03-06 16:25:06 +01:00
David Garske e375363bbb Add CMake `QSPI_FLASH` and `OCTOSPI_FLASH` options. 2023-02-02 12:11:23 -08:00
David Garske 8dd0ee347f Support for the STM32 OCTOSPI peripheral. 2023-02-02 12:11:23 -08:00
Daniele Lacamera d4cd79e678 Fixed cosmetics after code reviews 2023-01-27 08:35:08 +01:00
Daniele Lacamera b48b35a498 Fixed selection of the cached sector before write 2023-01-26 18:31:36 +01:00
Daniele Lacamera 3d517cfe8c NVM_FLASH_WRITEONCE refactoring
- Using two sectors to keep partition/sector flags
- Keep two redundant set of flags, update one at a time
- Erase is done when the sector is old
- Flags update is faster because Erase is done in advance
- Accessing trailer information (including encryption keys) is done by
  selecting the newest information

Tested via renode, using nrf52 with NVM_FLASH_WRITEONCE flag on.
2023-01-26 09:22:48 +01:00
David Garske 47e9d7a591
Merge pull request #261 from cmcquinn/cmake-fixes
Improvements and fixes for CMake
2023-01-13 15:28:55 -08:00
David Garske c6983b8c42 Progress on P1021 support (work in progress). 2022-12-29 18:27:40 +01:00
David Garske 022b8d3c13 Progress on adding NXP QorIQ P1021 support. 2022-12-29 18:27:40 +01:00
David Garske e88a7dcae3 Progress on DDR support for QorIQ. Refactor the platform to use "nxp_". 2022-12-29 18:27:40 +01:00
David Garske 005df0949d Disabled builds that have requirements not supported yet. Fixed L0 build. 2022-12-28 19:15:50 +01:00
David Garske a9526bab8f STM32 QSPI Flash support. Refactor SPI to allow different GPIO base/AF for each pin. Adds `DEBUG_UART` support for H7. 2022-12-20 13:31:28 +01:00
David Garske f283929161 Improvements to gap fill. The default gap filling byte is `0xFF`. If using `FLAGS_INVERT=1` uses `0x00`. Can be overridden at build-time using `FILL_BYTE`. Fixes ZD 15356. 2022-12-19 11:38:00 +01:00
Cameron McQuinn 8ace007cd8 Improvements and fixes for CMake 2022-12-15 00:56:57 -07:00
Lealem Amedie 18bfcecd6b wolfBoot cmake support 2022-12-07 13:00:10 -08:00
David Garske 2a481af879 Fix bug with update_ram.c when using fixed partitions. Support for MMU setup on e6500. Progress on DDR support. 2022-12-06 06:20:48 +01:00
David Garske bfed41889b Improvements to the NXP T2080 support. Adds NOR Flash and IFC configuration. Adds CPLD support. Make `DEBUG_UART` a configure option. 2022-12-06 06:20:48 +01:00
David Garske 2fc899254f Cleanups for NXP T2080 DEOS support:
* Expanded the NXP QorIQ T2080 documentation in `docs/Targets.md`.
* T2080 fixes for boot code placement and generation of .bin.
* T2080 UART driver cleanup.
* Improve bin-assemble fill speed and report items added.
* Make portability fixes to enable building in `mingw32-make`.
* Cleanup the `docs/Targets.md` sections and links.
* Cleanup execute bits on code files.
2022-12-06 06:20:48 +01:00
David Garske c346fab41b Support for NAII 68PPC2 with NXP T2080 on DEOS 2022-09-23 15:44:49 +02:00
Daniele Lacamera a6fdec3901 self-encrypt prototype; tested on stm32l0 2022-09-21 18:49:52 +02:00
Daniele Lacamera ec88e96037 Fixed regression compiling test-app 2022-07-21 21:05:13 +02:00
Daniele Lacamera 16dc1628af Fixed target 'simulator' 2022-07-21 20:23:13 +02:00
Marco Oliverio c077207b01 feature: simulated target
This commit introduces a simulated target where the internal and optionally the
external flash can be simulated and backed by files. Using this target will
produce an executable wolfBoot ELF image.
2022-07-12 10:13:10 +02:00
Daniele Lacamera 51de556e1b Added support for NXP i.MX-RT105x 2022-04-21 18:53:24 +02:00
elms 7dda1fe267
Merge pull request #176 from danielinux/renode-test 2022-02-15 07:48:43 -08:00
David Garske b46c5b222c Cleanup STM32H7 target documentation and code. 2022-02-14 10:51:53 -08:00
Daniele Lacamera 826305c2f1 Fixed warning in nrf52 app 2022-02-11 10:48:47 +01:00
Daniele Lacamera f2280f5575 Added renode board: nrf52840 2022-02-11 10:48:47 +01:00
Daniele Lacamera 539cc97e73 Added renode board: sifive-hifive-fe310.
+Quicker test
2022-02-11 10:48:47 +01:00
Daniele Lacamera 402d7b412c Added new renode board: stm32F746 2022-02-11 10:48:47 +01:00
Daniele Lacamera 43a5a38629 Fixes to AES-CTR encryption after testing 2022-01-31 16:46:09 +01:00
David Garske 5463105eab Adds STM32U5 support. Thank you ST. 2022-01-24 00:07:03 -08:00
Daniele Lacamera 33102a54fd Fixed STM32L5 dual-bank mode 2021-11-17 11:53:57 +01:00
David Garske ff28cec38a Minor cleanups. Add the required Cube HAL to app Makefile. 2021-08-26 13:03:49 -07:00
Hajer KALLEL 17a3d5c476 Added led support for STM32L4R5 2021-08-26 13:03:49 -07:00
Hajer KALLEL 94cacfe795 Added test-app for STM32L4 2021-08-26 13:03:49 -07:00
Daniele Lacamera 012bba3ce3 Fixed after review comments 2021-08-20 10:10:51 +02:00
Daniele Lacamera 39ee01a948 Added roll-back feature via inverse patch 2021-08-17 15:44:34 +02:00
Daniele Lacamera 301bc3e0b6 Test through 'test-delta' target
- changed syntax for test-expect-version to accept a UART_DEV
2021-08-16 12:00:39 +02:00
David Garske d38de3b432 Update copyright year 2021-07-19 07:50:02 -07:00
Daniele Lacamera a370d614a5 WOLFBOOT_NO_SIGN: Rebooting test app to repeat version
(in absence of verification, boot time is too short for the test)
2021-06-28 13:52:00 +02:00
Elms b4f68d0c6b TMS570LC43xx: fix default compiler programs and options 2021-06-23 09:12:17 +02:00
Elms fad70ef7f7 make: refactor `-Wstack-usage` and `XMALLOC_USER` and override for R5 2021-06-23 09:12:17 +02:00
Elms 529b138b7c TMS570LC43xx: cleanup ISR and add build release project 2021-06-23 09:12:17 +02:00
Elms ee0f93fee0 TMS570LC43xx: Add flash from RAM and test-app and cleanup
* add flash demo from RAM
 * clean up linker script and flags
 * Add hercules test-app: link script and minimal c file

`make CCS_ROOT=/c/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_20.2.4.LTS F021_DIR=/c/ti/Hercules/F021\ Flash\ API/02.01.01`
2021-06-23 09:12:17 +02:00
Elms a9ceedf298 TMS570LC43xx: fixup formatting
* add GPL headers
 * fix up whitespace (no tabs)
 * C style comments blocks
2021-06-08 18:14:41 +02:00
Elms b988cd3748 PPC-t2080: Add minimal test app
With debug it will spin for a while and print a count
Also improce config example
2021-06-08 18:14:41 +02:00
Elms c1e000faa0 make: clean up and check_config update
Also add emacs backup files to ignore
2021-06-08 18:14:41 +02:00
Elms 4c63cfd974 cleanup makefiles 2021-05-14 09:38:31 +02:00
Elms 17582b2cfc make: use objdump to fill out image 2021-05-14 09:38:31 +02:00
Benjamin Bruun cff0c54cc5 STM32H7 Test Program
This wolfBoot application has been specifically developed for and tested on NUCLEO-H753ZI.
Toogle between application A and B to use the application code to test firmware update capability of wolfBoot and to distinguish the two application versions.
2021-01-26 12:46:03 +01:00
Daniele Lacamera 2394c7424e Fixed stm32h7.c hal write from app 2020-11-26 17:43:21 +01:00
Daniele Lacamera 95a75627ef Added call to wolfboot_update_trigger in app_stm32h7 for test purposes 2020-11-26 17:43:21 +01:00
David Garske 4706d2f126 Peer review fixes. Fixes for SHA3 and RSA4096 in makefiles. Fixes for Xilinx SDK excludes. Cleanup of the printf to use the built-in facilities (`wolfBoot_printf`). 2020-11-12 10:47:32 +01:00
Daniele Lacamera 4e27d9197f Added compile-time option to invert FLAGS logic (FLAGS_INVERT=1) 2020-11-03 11:05:14 +01:00
David Garske c5ec4e31d8
Merge pull request #81 from danielinux/imx-rt1060
i.MX-RT1060 support
2020-10-09 09:35:29 -07:00
Daniele Lacamera f533c7c654 Cleanup test application + removed unused components 2020-10-09 16:53:07 +02:00
Daniele Lacamera 9186c263a2 Fixed IMX-RT-1060 flash driver, working update 2020-10-09 13:26:28 +02:00
Daniele Lacamera c26d2c0517 Fixed bootloader link step; added stub for nor flash driver 2020-10-07 18:41:02 +02:00
Daniele Lacamera 4e5517d0d9 Added makefile options + test application for i.mx-RT1060
(work in progress)
2020-09-28 14:45:15 +02:00
Daniele Lacamera 9f04c6242e Fixed DUALBANK_SWAP mode in STM32L5
- Added proper unlock procedure for FLASH_OPTKEYR
- fork bootloader when running with non-swapped banks
2020-09-09 14:26:30 -07:00
Daniele Lacamera 5614c75f1e Fixed address alignment, TZEN=0 mode not yet working 2020-09-09 14:26:30 -07:00
Daniele Lacamera 12ea412029 Cosmetic fixes (whitespaces) 2020-09-09 14:26:30 -07:00
David Garske 43c2e3dd79 Experimental support for STM32L5 2020-09-09 14:26:30 -07:00
Daniele Lacamera 30c851fa0a Fixed leftover include in stm32wb app 2020-06-18 16:43:34 +02:00
Daniele Lacamera f3f27ae2cb Fixed ChaCha20 IV usage/setting. Test/docs updated. 2020-06-18 11:12:01 +02:00
Daniele Lacamera ceb07ec315 Fixed encryption alignment and signing tool IV 2020-06-16 17:52:50 +02:00