Daniele Lacamera
64f3a395fb
Merge branch 'master' into swap_tail_type
2024-07-19 12:37:47 +02:00
David Garske
b3f3b5356c
Fix for image_open wolfBoot_get_blob_version print. Added NULL protection on `wolfBoot_get_blob_version`.
2024-07-19 09:08:48 +02:00
David Garske
094dc227de
Change default wolfBoot_printf logging to use stderr.
2024-07-19 09:08:48 +02:00
David Garske
a49f4405a5
Add logging for wolfBoot_update() and partition version information. Enabled with `DEBUG_UART` or other PRINTF_ENABLED logging.
...
Example Log:
```
wolfBoot HAL Init
SPI Probe: Manuf 0xC2, Product 0x20
Boot at 0xFFE00000 (size 115856, version 0x2)
Update at 0x200000 (size 115856, version 0x0)
Staring Update (fallback allowed 0)
Update at 0x200000 (size 115856, version 0x0)
Boot at 0xFFE00000 (size 115856, version 0x2)
Versions: Current 0x2, Update 0x3
Copy sector 0 (part 1->2)
Copy sector 0 (part 0->1)
Copy sector 0 (part 2->0)
Boot at 0xFFE00000 (size 115856, version 0x3)
Update at 0x200000 (size 115856, version 0x0)
Copy sector 1 (part 1->2)
Copy sector 1 (part 0->1)
Copy sector 1 (part 2->0)
Copy sector 2 (part 1->2)
Copy sector 2 (part 0->1)
Copy sector 2 (part 2->0)
Copy sector 3 (part 1->2)
Copy sector 3 (part 0->1)
Copy sector 3 (part 2->0)
Boot at 0xFFE00000 (size 115856, version 0x3)
Update at 0x200000 (size 115856, version 0x0)
Copy sector 58 (part 0->2)
Boot at 0xFFE00000 (size 115856, version 0x3)
Booting version: 0x3
```
2024-07-19 09:08:48 +02:00
David Garske
82094c92e1
Cleanup "tail" to "trailer"
2024-07-18 14:18:51 -07:00
David Garske
8b954d4a6c
Fix for update_flash.c `error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]`. Cleanup the swap logic for `EXT_ENCRYPTED`. Switch to using a `uint32_t` directly for checking tail magic.
2024-07-18 13:55:04 -07:00
David Garske
f0c4252bce
Merge pull request #470 from danielinux/nvm-writeonce-flags-compare
...
Fixed flag comparison selecting most recent flags
2024-07-18 06:07:22 -07:00
Daniele Lacamera
aaf40aa018
Removed ferror(NULL) from lms_common
2024-07-18 10:55:25 +02:00
Daniele Lacamera
428a943c83
Fixed STM32F7 linker script error with new gcc
2024-07-18 10:40:20 +02:00
Daniele Lacamera
682873ea6d
Test CI update on 'build' workflow
2024-07-18 10:32:29 +02:00
Daniele Lacamera
d390873096
Fix padding in test
2024-07-18 10:15:50 +02:00
Daniele Lacamera
55396ed969
Restore erase in update_trigger.
...
Caveat: in case of powerfail during wolfBoot_update_trigger, the key
previously set may be lost. This is OK assuming that the update process
can resume from the previous step in the application (setting the key
before triggering the update).
2024-07-18 09:33:58 +02:00
Daniele Lacamera
d31380675e
Fix key persistence with FLAGS_HOME + EXT_ENCTYPT
2024-07-18 08:42:39 +02:00
Daniele Lacamera
d3795c81cd
Implicitly add trailer when setting enc key
2024-07-17 18:33:37 +02:00
Daniele Lacamera
8b73250324
Set trailer on BOOT partition when storing the enc key
2024-07-17 17:00:11 +02:00
Daniele Lacamera
e586087422
Added unit test NVM + ENCRYPTION, fix offset
2024-07-17 13:42:28 +02:00
Daniele Lacamera
9250abbb8e
Fixed erase address in case of NVM + FLAGS_HOME
2024-07-17 12:09:13 +02:00
Daniele Lacamera
04111a67b4
Added unit tests for FLAGS_HOME + fix NVM election
...
Taking into account the additional offset for PART_UPDATE_FLAGS at the
end of each flags sector when comparing two redundant flag sectors in
NVM_FLASH_WRITEONCE + FLAGS_HOME
2024-07-17 11:28:40 +02:00
Daniele Lacamera
2ec2bcdf79
Fixed flag comparison selecting most recent flags
2024-07-17 08:55:14 +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
David Garske
35db4cf388
Merge pull request #469 from danielinux/nvm-unit-tests
...
New unit tests for NVM_FLASH_WRITEONCE, fix bug in offset calculation
2024-07-16 10:02:09 -07:00
Daniele Lacamera
8f0c090b69
Unit tests for memory blob parsers
2024-07-16 17:37:01 +02:00
Daniele Lacamera
a7668842c7
Remove silencer for -Warray-bounds
2024-07-16 17:18:41 +02:00
Daniele Lacamera
80fa66fe44
Added more tests
2024-07-16 17:13:05 +02:00
Daniele Lacamera
230174e2f7
nvm_select_fresh_sector: fix flag offset
...
The offset for the sector flags position to compare the two
redundant blocks with NVM_FLASH_WRITEONCE mode was wrong, resulting
in a negative offset, which in turn caused an out-of-bound access
outside of the UPDATE partition space.
2024-07-16 16:16:46 +02:00
Daniele Lacamera
dd4bd8e91a
Added new unit tests for NVM_FLASH_WRITEONCE
2024-07-16 16:06:54 +02:00
David Garske
b9dc7eee46
Merge pull request #463 from jpbland1/bad-image-recovery
...
add emergency fallback test, currently fails due to
2024-07-10 14:08:48 -07:00
John Bland
6c3940fafc
refactor final step of powerfail safe update and add
...
emergency fallback test
2024-07-10 16:58:23 -04:00
JacobBarthelmeh
eedd86f5ba
Merge pull request #455 from danielinux/stm32h5_uart
...
STM32H5 UART Demo
2024-07-09 21:48:25 -06:00
David Garske
1854383462
Do not enable OTP write protect unless `ENABLE_OTP_WP=1` is passed during make.
2024-07-09 16:18:08 -07:00
David Garske
463cc32b7d
Further documentation cleanups.
2024-07-09 14:07:24 -07:00
David Garske
fbc6f02dea
More documentation updates. Cleanups in the otp-keystore-gen.
2024-07-09 13:26:12 -07:00
David Garske
e89a10d21b
Minor documentation updates.
2024-07-09 12:43:54 -07:00
David Garske
750c8f6ace
Define a generic max OTP size to appease otp_keystore.h
2024-07-09 10:49:28 -07:00
David Garske
ace95cc2dc
Added instructions for STM32H5 demo to `docs/flash-OTP.md`.
2024-07-09 10:27:52 -07:00
Daniele Lacamera
11ce50f6c1
Removed debug print, added PKCS11_SMALL, fixes
2024-07-09 10:22:43 -07: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
David Garske
4e6e81c509
Don't hide the bank swap registers behind `DUALBANK_SWAP`.
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
78c9e11203
Merge pull request #468 from danielinux/otpgen
...
Add command line tool to generate otp.bin
2024-07-09 10:21:08 -07:00
Daniele Lacamera
c6586f2d85
test: Delete keystore after removing private key
2024-07-09 18:59:17 +02:00
Daniele Lacamera
4f5e168350
Moved keystore.c overwrite check
2024-07-09 18:03:51 +02:00