Commit Graph

770 Commits (4cf18d4ec20d4648b68fcaec4c73ce87d58aee3b)

Author SHA1 Message Date
David Garske 4bbe28920c Fixes to wolfBoot self-update (memcmp was used which is not a RAMFUNCTION). 2026-01-19 19:13:01 +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 fdf241d21f Addressed reviewer's comments. 2026-01-13 14:15:10 +01:00
Daniele Lacamera d4e66e5c5e
Update src/image.c: remove duplicated code
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-12 12:39:31 +01:00
Daniele Lacamera 12f99a8b8c Silencing compiler warning 2026-01-12 09:44:44 +01:00
Daniele Lacamera 50d8aedf8c [ARMORED] Improved redundancy of verification 2026-01-12 09:44:44 +01:00
Daniele Lacamera 08692b1d8e Fix handling rollback when ARMORED=1 and FLASH_TOP 2026-01-12 09:44:44 +01:00
David Garske 8577188eaa
Merge pull request #663 from bigbrett/sim-self-update
basic simulator self-update test
2026-01-09 10:10:03 -08:00
Brett Nicholas d661c2afb3 Add support for simulator self-update test 2026-01-08 09:40:44 -08:00
Daniele Lacamera af670811fe zephyr integration as TEE.
- Integrates wolfPSA as psa_crypto/psa_store engine in TrustZone
- Provides interface to access APIs from non-secure mode
- Patches to enable wolfboot as TEE module in zephyr
- Patches to enable stm32h563-nucleo/ns as target in zephyr
- psa_crypto zephyr example using wolfboot/wolfPSA as secure engine
2026-01-07 08:27:58 +01:00
David Garske 46677d76e7 Refactor eMMC/SD code to reduce duplicate code. Moved SDHCI driver into generic module that can be used by other platforms. 2026-01-01 12:52:09 +01:00
David Garske cf08819d8e Support for CUSTOM_ENCRYPT_KEY that allows customer to supply their own implementation 2026-01-01 12:52:09 +01:00
Mattia Moffa 0462e0a198 More consistent formatting 2025-12-30 11:15:41 +01:00
Mattia Moffa ce4ae39d65 Address copilot suggestions 2025-12-30 11:15:41 +01:00
Mattia Moffa 7800c364e9 Fix cppcheck complaint 2025-12-30 11:15:41 +01:00
Mattia Moffa f12d2f06b4 Add PKCS11 backend for encrypted partitions 2025-12-30 11:15:41 +01:00
David Garske d38551a143 Add update_disk encryption support. 2025-12-30 11:10:21 +01:00
David Garske 249c8282f5 Add kernel boot args (for rootfs). Added optional SD tuning support. Yocto Linux is fully working now! 2025-12-30 11:10:21 +01:00
David Garske 2e54cf75a7 Fix for Yocto Linux boot issue with smpboot and hartid. 2025-12-30 11:10:21 +01:00
David Garske 609fd81890 Fixes for PolarFire SoC eMMC/SD to stabilize and add read DMA support. Refactor the RISC-V boot/vector code for use on both 32-bit and 64-bit architectures. 2025-12-30 11:10:21 +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 d12c79e956 Fix issue with pointer increment in update_disk.c loader refactor 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 3317fba381 Cleanups and improvements 2025-12-24 18:31:55 +01:00
David Garske 0292da582b Refactor disk.c for generic use. Wired up uSD read for MBR/GPT 2025-12-24 18:31:55 +01:00
David Garske ab614a93c8 Progress with eMMC/SD driver 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
gojimmypi 0c7fa9d4e4 Remove header gate 2025-12-12 17:51:17 +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
David Garske d2ed8c0a67 Update submodules for release 2025-11-25 07:44:36 +01:00
David Garske 2546ebcaf9 Fixes for unused variables. Also repaired STM32WB55 build with PKA 2025-11-20 18:26:58 +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 3a85a27fb9 Unify the hdr_cpy (we don't need two) 2025-11-19 11:11: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
Badr Bacem KAABIA 6313077805 fix(spi_flash): Resolve protocol errors and write verification bug
This commit improves the robustness and protocol compliance of the SPI flash
driver by resolving critical bugs and standardizing command sequences.

Key Changes:

1.  **Write Verification Bug (spi_flash_write_sb):**
    * Replaced the complex bitwise verification logic with a direct comparison
      (`verify == buf[j]`) for robust data validation.

2.  **Protocol Violations & Performance:**
    * **spi_flash_probe:** Fixed silent protocol failure by adding mandatory
      `WREN` before `WRSR` and adding explicit `wait_busy()` and `WRDI`.
    * **spi_flash_write_page:** Removed redundant `wait_busy()` after `WREN`
      to improve performance.
    * **Erase Functions:** Standardized erase flow by ensuring an explicit
      `wait_busy()` is performed after `WREN` before issuing the command.

These changes prevent silent failures, potential flash corruption, and
unnecessary latency.

Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
2025-11-18 15:20:10 +01:00
gojimmypi f198c6ba49
Hard fail if the wrong user settings is detected 2025-10-31 11:11:05 -07:00
David Garske 4d0106caee Fixes for build warnings 2025-10-30 16:31:27 +01:00
Juliusz Sosinowicz 2345138a1b Implement filesystem-based partition state access and CLI tools
- Add filesystem access implementation in HAL (`hal/filesystem.c`)
- Introduce new library_fs target and build rules for filesystem-backed partition management
- Provide example configuration for library_fs
- Add CLI application (`hal/library_fs.c`) to query and manage partitions
- Update documentation with usage instructions and build steps for the new CLI tool
- Update .gitignore
2025-10-30 16:31:27 +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
gojimmypi 74857d0029 Fix warnings with _MSC_VER and _MSC_VER 2025-10-22 16:04:39 +02:00
Brett Nicholas 10f8aa4089 fix for -wunused-but-set-variable: guard inverse with DELTA_UPDATES 2025-10-20 14:29:41 -06:00
Daniele Lacamera 480f3106a7 Fix regression in encrypted delta updates 2025-10-17 15:45:27 +02:00
Daniele Lacamera 61a0bf58d1 Added comments in delta update 2025-10-17 14:05:07 +02:00
Daniele Lacamera 8555ce4f3e Fix interrupted delta update fallback 2025-10-17 14:02:23 +02:00
Daniele Lacamera 38631d2481 Fixed regression in delta fallback 2025-10-17 13:16:31 +02:00
Daniele Lacamera b35f3b6334 Ensure version numbers are initialized before the inversion check 2025-10-17 12:11:32 +02:00
Daniele Lacamera 6fba3b4054 Fixed unit tests 2025-10-17 12:03:42 +02:00
Daniele Lacamera 18cbea59de Refactoring of IV handling to prevent reusing IVs
During fallback operations, use a different encryption IV than the one
used to encrypt the backup during the update. This ensures that the same
IV is never reused to encrypt different sectors.
2025-10-17 09:44:46 +02:00
gojimmypi fbd8dcf8a2
Update Copyright year to 2025 2025-10-15 11:33:53 -07:00