Skip to content

Commit 055c912

Browse files
Yossi LevyAlexander Zilberkant
authored andcommitted
v4.02 mbed-os 5.12 and PSA boards
1 parent 35620e8 commit 055c912

17 files changed

+775
-315
lines changed

.mbedignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,13 @@ mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX
2727
mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.cpp
2828
mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_11/libraries/fds/*
2929
mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/libraries/fds/*
30+
mbed-os/targets/TARGET_Cypress/TARGET_PSOC6/port_api.c
31+
mbed-os/targets/TARGET_Cypress/TARGET_PSOC6/i2c_api.c
32+
mbed-os/targets/TARGET_Cypress/TARGET_PSOC6/pwmout_api.c
33+
mbed-os/platform/mbed_alloc_wrappers.c
34+
mbed-os/platform/mbed_retarget.c
35+
mbed-os/usb/device/USBAudio/*
36+
mbed-os/usb/*
37+
mbed-os/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_WIFI_BT_PSA/spm_init_api.c
38+
mbed-os/drivers/I2CSlave.cpp
39+
mbed-os/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_M33_NS/device/cmsis_nvic_virtual.c

README.md

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,43 @@ In order for the cloud client to recognise this struct and obtain the informatio
9090
User **may** set in `mbed_app.json`:
9191
1. `mbed-bootloader.max-copy-retries`, The number of retries after a failed copy attempt.
9292
1. `mbed-bootloader.max-boot-retries`, The number of retries after a failed forward to application.
93+
1. `mbed-bootloader.show-serial-output`, Set to 0 to disable all serial output. Useful for reducing size on headless devices.
9394
1. `mbed-bootloader.show-progress-bar`, Set to 1 to print a progress bar for various processes.
9495
1. `mbed-bootloader.max-application-size`, Maximum size of the active application. The default value is `FLASH_START_ADDRESS + FLASH_SIZE - APPLICATION_START_ADDRESS`. Bootloader uses this value to reject candidate image that are too large.
9596

9697
## Flash Layout
9798

98-
### The flash layout for K64F with KVStore and firmware storage on internal flash
99+
### Default configuration using flash layout with KVStore and firmware storage on external storage
100+
101+
```
102+
+--------------------------+
103+
| |
104+
| |
105+
| |
106+
| Active App |
107+
| |
108+
| |
109+
| |
110+
+--------------------------+ <-+ mbed-bootloader.application-start-address
111+
|Active App Metadata Header|
112+
+--------------------------+ <-+ update-client.application-details
113+
| |
114+
| KVSTORE |
115+
| |
116+
+--------------------------+ <-+ storage_tdb_internal.internal_base_address
117+
| |
118+
| Bootloader |
119+
| |
120+
+--------------------------+ <-+ 0
121+
```
122+
123+
### Notes on Flash Layout of non PSA tagets with external storage
124+
125+
- This is the default implementation at the default mbed_app.json
126+
- The default flash layout is tested with GCC_ARM compiler and tiny.json compiler profile only. If a different compiler is used, the bootloader binary size will be larger and the offsets needs to be adjusted.
127+
- The KVSTORE regions require even number of flash erase sectors.
128+
129+
### The flash layout for non PSA targets with KVStore and firmware storage on internal flash
99130

100131
```
101132
+--------------------------+
@@ -127,13 +158,48 @@ User **may** set in `mbed_app.json`:
127158
+--------------------------+ <-+ 0
128159
```
129160

130-
### Notes on Flash Layout
161+
### Notes on Flash Layout of non PSA targets
131162

132163
- Internal Flash Only layout can be enabled by compiling the bootloader with the configuration file `--app-config configs/internal_flash_no_rot.json`. By default the firmware storage region and filesystem is on [external sd card](#external-storage).
133164
- The default flash layout is tested with GCC_ARM compiler and tiny.json compiler profile only. If a different compiler is used, the bootloader binary size will be larger and the offsets needs to be adjusted.
134165
- The KVSTORE regions require even number of flash erase sectors. If the firmware candidate is stored on internal flash, the bootloader does not access the KVStore. But it still needs to be there for the benefit of the Pelion Device Management Client.
135166
- Some micro-controller chips are designed with 2 banks of flash that can be read from and written to independently from each other. Hence it is a good idea to put your bootloader and active application on bank 1, your kvstore and firmware candidate storage on bank 2. This way when the application writes data to flash, it doesn't need to halt the processor execution to do it.
136167

168+
169+
### PSA configuration using flash layout with KVStore and firmware storage on external storage
170+
171+
```
172+
+--------------------------+
173+
| |
174+
| KVSTORE |
175+
| |
176+
+--------------------------+ <-+ storage_tdb_internal.internal_base_address
177+
| |
178+
| Free space |
179+
| |
180+
+--------------------------+
181+
| |
182+
| |
183+
| |
184+
| Active App |
185+
| |
186+
| |
187+
| |
188+
+--------------------------+ <-+ mbed-bootloader.application-start-address
189+
|Active App Metadata Header|
190+
+--------------------------+ <-+ update-client.application-details
191+
| |
192+
| Bootloader |
193+
| |
194+
+--------------------------+ <-+ 0
195+
```
196+
197+
### Notes on Flash Layout of PSA targets
198+
199+
- This is the PSA default implementation using the default mbed_app.json
200+
- The default flash layout is tested with GCC_ARM compiler and tiny.json compiler profile only. If a different compiler is used, the bootloader binary size will be larger and the offsets needs to be adjusted.
201+
- The KVSTORE regions require even number of flash erase sectors. For PSA targets the KVStore is located at the ends of the flash.
202+
137203
### Alignment
138204

139205
**Flash Erase Boundary**: Flash can usually only be erased in blocks of specific sizes, this is platform specific and hence many regions need to align to this boundary.

configs/block_device_fake_rot.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
"mbed-bootloader.use-kvstore-rot" : 0,
5454
"update-client.storage-address" : "(1024*1024*64)",
5555
"update-client.storage-size" : "((MBED_ROM_START + MBED_ROM_SIZE - MBED_CONF_MBED_BOOTLOADER_APPLICATION_START_ADDRESS) * MBED_CONF_UPDATE_CLIENT_STORAGE_LOCATIONS)",
56-
"update-client.storage-locations" : 1
56+
"update-client.storage-locations" : 1,
57+
"target.extra_labels_remove" : [ "WICED", "CORDIO", "PSA", "MBED_SPM" ]
5758
},
5859
"NRF52_DK": {
5960
"sd.SPI_CS" : "SPI_PSELSS0",

configs/internal_flash_no_rot.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,24 @@
5151
},
5252
"macros": [
5353
"MBED_CLOUD_CLIENT_UPDATE_STORAGE=ARM_UCP_FLASHIAP",
54-
"MBED_BOOTLOADER_SIZE=APPLICATION_SIZE",
5554
"MBED_BOOTLOADER_ACTIVE_HEADER_REGION_SIZE=1024",
56-
"FLASH_BANK_SIZE=MBED_ROM_SIZE/2"
55+
"MBED_BOOTLOADER_FLASH_BANK_SIZE=MBED_ROM_SIZE/2"
5756
],
5857
"target_overrides": {
5958
"*": {
6059
"platform.stdio-baud-rate": 115200,
6160
"platform.stdio-flush-at-exit": false,
6261
"update-client.firmware-header-version": "2",
6362
"mbed-bootloader.use-kvstore-rot": 0,
63+
"mbed-bootloader.bootloader-size": "APPLICATION_SIZE",
6464
"target.restrict_size": "0x8000",
6565
"update-client.application-details" : "(MBED_ROM_START + MBED_BOOTLOADER_SIZE)",
6666
"mbed-bootloader.application-start-address": "(MBED_CONF_UPDATE_CLIENT_APPLICATION_DETAILS + MBED_BOOTLOADER_ACTIVE_HEADER_REGION_SIZE)",
67-
"mbed-bootloader.max-application-size" : "(MBED_ROM_START + FLASH_BANK_SIZE - MBED_CONF_MBED_BOOTLOADER_APPLICATION_START_ADDRESS)",
68-
"update-client.storage-address" : "(MBED_ROM_START + FLASH_BANK_SIZE + KVSTORE_SIZE)",
69-
"update-client.storage-size" : "(FLASH_BANK_SIZE - KVSTORE_SIZE)",
70-
"update-client.storage-locations" : 1
67+
"mbed-bootloader.max-application-size" : "(MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE - MBED_CONF_MBED_BOOTLOADER_APPLICATION_START_ADDRESS)",
68+
"update-client.storage-address" : "(MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE + KVSTORE_SIZE)",
69+
"update-client.storage-size" : "(MBED_BOOTLOADER_FLASH_BANK_SIZE - KVSTORE_SIZE)",
70+
"update-client.storage-locations" : 1,
71+
"target.extra_labels_remove" : [ "WICED", "CORDIO", "PSA", "MBED_SPM" ]
7172
},
7273
"K64F": {
7374
"kvstore-size": "2*24*1024",
@@ -84,6 +85,10 @@
8485
"NUCLEO_F303RE": {
8586
"kvstore-size": "2*24*1024",
8687
"update-client.storage-page": 1
88+
},
89+
"DISCO_L475VG_IOT01A": {
90+
"kvstore-size": "2*8*1024",
91+
"update-client.storage-page": 1
8792
}
8893
}
8994
}

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/#51d55508e8400b60af467005646c4e2164738d48
1+
https://github.com/ARMmbed/mbed-os/#0f959dbe4749c20416236e4fe1dac5692cbe18ab

0 commit comments

Comments
 (0)