Skip to content

Commit 75f931e

Browse files
Use MCUboot with changes from Mbed OS team (AGlass0fMilk#5)
* Update Mbed OS to mbed-os-6.4.0 release * Clean up unused files * Remove SerialOTA which should be in the user app * Temporary: use LDong-Arm's fork of MCUboot * Use MCUBOOT_SLOT_SIZE as secondary block device size * Update configurations * Reduce read/write granularity for ST DISCO target Co-authored-by: Lingkai Dong <[email protected]> Co-authored-by: George Beckstein <[email protected]>
1 parent 86fa6cf commit 75f931e

12 files changed

+35
-430
lines changed

SerialOTA.cpp

Lines changed: 0 additions & 85 deletions
This file was deleted.

SerialOTA.h

Lines changed: 0 additions & 66 deletions
This file was deleted.

convert_keys.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

default_bd.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ BlockDevice *BlockDevice::get_default_instance()
7676
*/
7777
mbed::BlockDevice* get_secondary_bd(void) {
7878
// In this case, our flash is much larger than a single image so
79-
// slice it into a smaller size, 1MB at the beginning
80-
79+
// slice it into the size of an image slot
8180
mbed::BlockDevice* default_bd = mbed::BlockDevice::get_default_instance();
82-
static mbed::SlicingBlockDevice sliced_bd(default_bd, 0x0, 0xDD000);
81+
static mbed::SlicingBlockDevice sliced_bd(default_bd, 0x0, MCUBOOT_SLOT_SIZE);
8382
return &sliced_bd;
8483
}
8584

ep-oc-mcu.lib

Lines changed: 0 additions & 1 deletion
This file was deleted.

mbed-os.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/ARMmbed/mbed-os/#7482462434d5cf718177653ef797547a976a7c5e
1+
https://github.com/ARMmbed/mbed-os/#8ef0a435b2356f8159dea8e427b2935d177309f8

mbed_app.json

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"requires": ["bare-metal", "mbedtls", "mcuboot", "flashiap-block-device", "spif-driver", "qspif", "mbed-trace", "serialcobs"],
2+
"requires": ["bare-metal", "mbedtls", "mcuboot", "flashiap-block-device", "spif-driver", "qspif", "mbed-trace"],
33
"config": {
44
"serial-bootloader-enable": {
55
"help": "Build bootloader with serial update support",
@@ -9,25 +9,41 @@
99
"target_overrides": {
1010
"*": {
1111
"target.restrict_size": "0x20000",
12-
"target.c_lib": "small"
12+
"target.c_lib": "small",
13+
"mcuboot.log-level": "MCUBOOT_LOG_LEVEL_DEBUG",
14+
"mbed-trace.enable": true,
15+
"mbed-trace.fea-ipv6": false
1316
},
14-
"NRF52840_DK": {
15-
"target.device_has_remove": ["ITM"],
16-
"target.features_add": ["STORAGE"],
17-
"target.features_remove": ["CRYPTOCELL310"],
18-
"target.macros_remove": ["MBEDTLS_CONFIG_HW_SUPPORT"],
19-
"target.components_add": ["QSPIF", "FLASHIAP"],
20-
"mcuboot.max-img-sectors": 256,
17+
"NRF52840_DK": {
18+
"target.features_remove": ["CRYPTOCELL310"],
19+
"target.macros_remove": ["MBEDTLS_CONFIG_HW_SUPPORT"],
20+
"mcuboot.primary-slot-address": "0x20000",
21+
"mcuboot.slot-size": "0xC0000",
22+
"mcuboot.scratch-address": "0xE0000",
23+
"mcuboot.scratch-size": "0x20000",
24+
"mcuboot.max-img-sectors": "0x180",
25+
"mcuboot.read-granularity": 4,
2126
"qspif.QSPI_MIN_PROG_SIZE": 4
22-
},
27+
},
2328
"EP_AGORA": {
24-
"target.device_has_remove": ["ITM"],
25-
"target.features_add": ["STORAGE"],
2629
"target.features_remove": ["CRYPTOCELL310"],
2730
"target.macros_remove": ["MBEDTLS_CONFIG_HW_SUPPORT"],
28-
"target.components_remove": ["QSPIF"],
29-
"target.components_add": ["SPIF", "FLASHIAP"],
30-
"mcuboot.max-img-sectors": 256
31+
"mcuboot.primary-slot-address": "0x20000",
32+
"mcuboot.slot-size": "0xC0000",
33+
"mcuboot.scratch-address": "0xE0000",
34+
"mcuboot.scratch-size": "0x20000",
35+
"mcuboot.max-img-sectors": "0x180",
36+
"mcuboot.read-granularity": 4,
37+
"qspif.QSPI_MIN_PROG_SIZE": 4
38+
},
39+
"DISCO_L475VG_IOT01A": {
40+
"mcuboot.primary-slot-address": "0x8020000",
41+
"mcuboot.slot-size": "0xC0000",
42+
"mcuboot.scratch-address": "0x80E0000",
43+
"mcuboot.scratch-size": "0x20000",
44+
"mcuboot.max-img-sectors": "0x180",
45+
"mcuboot.read-granularity": 1,
46+
"qspif.QSPI_MIN_PROG_SIZE": 1
3147
}
3248
}
3349
}

mbed_app.json.backup

Lines changed: 0 additions & 8 deletions
This file was deleted.

mcuboot.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/AGlass0fMilk/mcuboot/#aff9bd34ceb8e4fb1f0697045e2f09764e738844
1+
https://github.com/LDong-Arm/mcuboot.git/#03b472cb1800196a69e4878b5cdd7b529320d7d6

serial_loader.py

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)