Skip to content

Commit efcf545

Browse files
Add encryption support
1 parent dcd2e6d commit efcf545

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

SimpleApp.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ int main()
3737
tr_info("Regular boot");
3838
break;
3939

40+
// Note: Older mcuboot versions appear to use SWAP_TYPE_REVERT.
41+
// Newer ones seem to use SWAP_TYPE_TEST.
42+
case BOOT_SWAP_TYPE_TEST:
4043
case BOOT_SWAP_TYPE_REVERT:
4144
// After MCUboot has swapped a (non-permanent) update image
4245
// into the primary slot, it defaults to reverting the image on the NEXT boot.
@@ -69,7 +72,6 @@ int main()
6972
// should never reach the application...
7073
case BOOT_SWAP_TYPE_FAIL: // Unable to boot due to invalid image
7174
case BOOT_SWAP_TYPE_PERM: // Permanent update requested (when signing the image) and to be performed
72-
case BOOT_SWAP_TYPE_TEST: // Revertable update requested and to be performed
7375
case BOOT_SWAP_TYPE_PANIC: // Unrecoverable error
7476
default:
7577
tr_error("Unexpected swap type: %d", swap_type);

mbed_app.json5

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,20 @@
1111
"required": false
1212
},
1313
},
14+
15+
"macros": [
16+
"MBEDTLS_CIPHER_MODE_CTR"
17+
],
18+
1419
"target_overrides": {
1520
"*": {
1621
"mcuboot.bootloader-build": 0,
1722
"target.c_lib": "small",
1823
"mcuboot.log-level": "MCUBOOT_LOG_LEVEL_DEBUG",
19-
"mbed-trace.enable": true
24+
"mbed-trace.enable": true,
25+
26+
// Change to true to enable encryption of the image
27+
"mcuboot.encrypt-rsa": false
2028
},
2129
// "NRF52840_DK": {
2230
// "demo-button-active-low": true,

0 commit comments

Comments
 (0)