Skip to content

Commit 87ec554

Browse files
authored
Clean up configuration (ARMmbed#155)
* Clean up configuration - Move all common configuration into mbed_lib.json - Clean up deprecated and unused defines - Merge configs that can be merged - Remove unnecessary defines of max app size, If undefined it will be the default value - Give more space to the power cut test binary
1 parent 393d7f6 commit 87ec554

17 files changed

+363
-611
lines changed

Jenkinsfile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,16 @@ def mbedBootloaderCliStep(step_name,
7070
execute("ls -al")
7171

7272
// build with specified config file
73-
app_config = "configs/test_configs/${bootloader_mbed_app}"
73+
app_config = "configs/${bootloader_mbed_app}"
7474
execute("mbed compile -m ${target} -t ${toolchain} -c -v --profile=tiny.json --app-config=${app_config}")
7575
}
7676

7777
// use same version of mbed-os to build cliapp
7878
execute("mv ${bootloader_repo_name}/mbed-os .")
7979

80+
// remove bootloader configuration
81+
execute("rm ${bootloader_repo_name}/mbed_lib.json")
82+
8083
// build cliapp with specified config file
8184
execute("mbed config root .")
8285
execute("mbed test --compile -m ${target} -t ${toolchain} --app-config configs/${cliapp_mbed_app} -n tests-*")
@@ -105,11 +108,11 @@ def mbedBootloaderCliStep(step_name,
105108

106109
def clitest_configs = [
107110
[ "simple_boot", "K64F", "GCC_ARM", "fake_rot_sd_card.json",
108-
"fake_rot_sd_card.json", "basic_update_test", "0xa400", "0xa000" ],
111+
"block_device_fake_rot.json", "basic_update_test", "0xa400", "0xa000" ],
109112
[ "separate_header_before_app", "K64F", "GCC_ARM", "header_separate.json",
110-
"header_separate_before_app.json", "basic_update_test", "40*1024", "32*1024" ],
113+
"test_configs/header_separate_before_app.json", "basic_update_test", "40*1024", "32*1024" ],
111114
[ "separate_header_after_app", "K64F", "GCC_ARM", "header_separate.json",
112-
"header_separate_after_app.json", "basic_update_test", "40*1024", "1020*1024" ]
115+
"test_configs/header_separate_after_app.json", "basic_update_test", "40*1024", "1020*1024" ]
113116
]
114117

115118
for (int i = 0; i < clitest_configs.size(); i++) {
@@ -181,8 +184,8 @@ def build_test_config = [
181184
"NUCLEO_F429ZI": ["mbed_app.json"],
182185
"UBLOX_EVK_ODIN_W2": ["mbed_app.json"],
183186
"NRF52_DK": [
184-
"configs/nrf52_block_device_fake_rot.json",
185-
"configs/nrf52_internal_flash_fake_rot.json"
187+
"configs/block_device_fake_rot.json",
188+
"configs/internal_flash_fake_rot.json"
186189
]
187190
]
188191

@@ -244,13 +247,13 @@ def sizeTestStepSimple(stepName) {
244247
stage(stepName) {
245248
node ("GCC_ARM") {
246249
dir("bootloader-internal") {
247-
deleteDir()
248-
unstash "deployed_bootloader_repo"
249-
execute("ls -al")
250-
execute("./scripts/runSizeTestAndGenerateGraph.sh")
251-
archiveArtifacts artifacts: 'mbed-os-linker-report/**/*.*', fingerprint: true
252-
// add this if you need all artifacts to debug something in this workspace
253-
//archive("/**/*.*")
250+
deleteDir()
251+
unstash "deployed_bootloader_repo"
252+
execute("ls -al")
253+
execute("./scripts/runSizeTestAndGenerateGraph.sh")
254+
archiveArtifacts artifacts: 'mbed-os-linker-report/**/*.*', fingerprint: true
255+
// add this if you need all artifacts to debug something in this workspace
256+
//archive("/**/*.*")
254257
}
255258
}
256259
}

configs/block_device_fake_rot.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"macros": [
3+
"ARM_UC_USE_PAL_BLOCKDEVICE=1",
4+
"MBED_CLOUD_CLIENT_UPDATE_STORAGE=ARM_UCP_FLASHIAP_BLOCKDEVICE"
5+
],
6+
"target_overrides": {
7+
"*": {
8+
"target.features_remove" : ["LWIP", "STORAGE"],
9+
"platform.stdio-baud-rate" : 115200,
10+
"platform.stdio-flush-at-exit" : false,
11+
"update-client.firmware-header-version": "2",
12+
"target.components_add" : ["SD"],
13+
"sd.CRC_ENABLED" : 0,
14+
"mbed-bootloader.use-nvstore-rot" : 0,
15+
"update-client.storage-address" : "(1024*1024*64)",
16+
"update-client.storage-size" : "(1024*1024*2)",
17+
"update-client.storage-locations" : 1
18+
},
19+
"NRF52_DK": {
20+
"sd.SPI_CS" : "SPI_PSELSS0",
21+
"sd.SPI_MOSI" : "SPI_PSELMOSI0",
22+
"sd.SPI_MISO" : "SPI_PSELMISO0",
23+
"sd.SPI_CLK" : "SPI_PSELSCK0",
24+
"minimal-printf.console-output" : "SWO",
25+
"target.app_offset" : "0x74000",
26+
"update-client.application-details" : "(508*1024)",
27+
"mbed-bootloader.application-start-address": "(152*1024)",
28+
"mbed-bootloader.max-application-size" : "((456-152)*1024)",
29+
"update-client.storage-page" : 512,
30+
"target.extra_labels_remove" : ["SOFTDEVICE_S132_FULL", "SOFTDEVICE_COMMON"],
31+
"target.extra_labels_add" : ["SOFTDEVICE_S132_MBR"]
32+
},
33+
"K64F": {
34+
"update-client.application-details" : "(FLASH_START_ADDRESS+40*1024)",
35+
"mbed-bootloader.application-start-address": "(FLASH_START_ADDRESS+41*1024)"
36+
},
37+
"K66F": {
38+
"update-client.application-details" : "(FLASH_START_ADDRESS+40*1024)",
39+
"mbed-bootloader.application-start-address": "(FLASH_START_ADDRESS+41*1024)"
40+
},
41+
"KW24D": {
42+
"update-client.application-details" : "(FLASH_START_ADDRESS+36*1024)",
43+
"mbed-bootloader.application-start-address": "(FLASH_START_ADDRESS+37*1024)"
44+
},
45+
"NUCLEO_L476RG": {
46+
"update-client.application-details" : "(FLASH_START_ADDRESS+36*1024)",
47+
"mbed-bootloader.application-start-address": "(FLASH_START_ADDRESS+38*1024)"
48+
},
49+
"DISCO_L476VG": {
50+
"update-client.application-details" : "(FLASH_START_ADDRESS+36*1024)",
51+
"mbed-bootloader.application-start-address": "(FLASH_START_ADDRESS+38*1024)"
52+
},
53+
"NUCLEO_F429ZI": {
54+
"update-client.application-details" : "(FLASH_START_ADDRESS+64*1024)",
55+
"mbed-bootloader.application-start-address": "(FLASH_START_ADDRESS+65*1024)"
56+
},
57+
"UBLOX_EVK_ODIN_W2": {
58+
"target.device_has_remove": ["EMAC"],
59+
"update-client.application-details" : "(FLASH_START_ADDRESS+64*1024)",
60+
"mbed-bootloader.application-start-address": "(FLASH_START_ADDRESS+65*1024)"
61+
},
62+
"UBLOX_C030_U201": {
63+
"update-client.application-details" : "(FLASH_START_ADDRESS+64*1024)",
64+
"mbed-bootloader.application-start-address": "(FLASH_START_ADDRESS+65*1024)"
65+
}
66+
}
67+
}

configs/internal_flash_fake_rot.json

Lines changed: 37 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,53 @@
11
{
22
"macros": [
3-
"MBEDTLS_USER_CONFIG_FILE=\"bootloader_mbedtls_user_config.h\"",
4-
"PAL_USER_DEFINED_CONFIGURATION=\"bootloader_pal_user_config.h\"",
5-
"MAX_COPY_RETRIES=1",
6-
"SHOW_PROGRESS_BAR=1",
7-
"MAX_BOOT_RETRIES=3",
8-
"ARM_UC_USE_PAL_CRYPTO=0",
9-
"ARM_UC_PROFILE_MBED_CLOUD_CLIENT=1",
10-
"ARM_UC_FEATURE_CRYPTO_PAL=0",
11-
"ARM_UC_FEATURE_CRYPTO_MBEDTLS=1",
12-
"ARM_BOOTLOADER_USE_NVSTORE_ROT=0",
13-
"MBED_CLOUD_CLIENT_UPDATE_STORAGE=ARM_UCP_FLASHIAP",
14-
"Mutex=PlatformMutex"
3+
"MBED_CLOUD_CLIENT_UPDATE_STORAGE=ARM_UCP_FLASHIAP"
154
],
16-
"config": {
17-
"application-start-address": {
18-
"help": "Address of the active application firmware in flash",
19-
"value": null
20-
},
21-
"max-application-size": {
22-
"help": "Maximum size of the active application",
23-
"value": null
24-
}
25-
},
265
"target_overrides": {
276
"*": {
28-
"target.features_remove": ["LWIP", "STORAGE"],
297
"platform.stdio-baud-rate": 115200,
308
"platform.stdio-flush-at-exit": false,
31-
"update-client.firmware-header-version": "2"
9+
"update-client.firmware-header-version": "2",
10+
"mbed-bootloader.use-nvstore-rot": 0
3211
},
3312
"K64F": {
34-
"update-client.application-details": "( 40*1024)",
35-
"application-start-address" : "( 41*1024)",
36-
"max-application-size" : "(MBED_CONF_UPDATE_CLIENT_STORAGE_ADDRESS-MBED_CONF_APP_APPLICATION_START_ADDRESS)",
37-
"update-client.storage-address" : "(436*1024)",
38-
"update-client.storage-size" : "(388*1024)",
39-
"update-client.storage-locations" : 1,
40-
"update-client.storage-page" : 8
13+
"update-client.application-details" : "( 40*1024)",
14+
"mbed-bootloader.application-start-address": "( 41*1024)",
15+
"mbed-bootloader.max-application-size" : "(MBED_CONF_UPDATE_CLIENT_STORAGE_ADDRESS-MBED_CONF_MBED_BOOTLOADER_APPLICATION_START_ADDRESS)",
16+
"update-client.storage-address" : "(436*1024)",
17+
"update-client.storage-size" : "(388*1024)",
18+
"update-client.storage-locations" : 1,
19+
"update-client.storage-page" : 8
4120
},
4221
"NUCLEO_F429ZI": {
43-
"update-client.application-details": "(0x08000000+64*1024)",
44-
"application-start-address" : "(0x08000000+65*1024)",
45-
"max-application-size" : "(MBED_CONF_UPDATE_CLIENT_STORAGE_ADDRESS-MBED_CONF_APP_APPLICATION_START_ADDRESS)",
46-
"update-client.storage-address" : "(0x08000000+1024*1024)",
47-
"update-client.storage-size" : "(512*1024)",
48-
"update-client.storage-locations" : 1,
49-
"update-client.storage-page" : 1
22+
"update-client.application-details" : "(0x08000000+64*1024)",
23+
"mbed-bootloader.application-start-address": "(0x08000000+65*1024)",
24+
"mbed-bootloader.max-application-size" : "(MBED_CONF_UPDATE_CLIENT_STORAGE_ADDRESS-MBED_CONF_MBED_BOOTLOADER_APPLICATION_START_ADDRESS)",
25+
"update-client.storage-address" : "(0x08000000+1024*1024)",
26+
"update-client.storage-size" : "(512*1024)",
27+
"update-client.storage-locations" : 1,
28+
"update-client.storage-page" : 1
5029
},
5130
"NUCLEO_F303RE": {
52-
"update-client.application-details": "(0x08000000+36*1024)",
53-
"application-start-address" : "(0x08000000+37*1024)",
54-
"max-application-size" : "(MBED_CONF_UPDATE_CLIENT_STORAGE_ADDRESS-MBED_CONF_APP_APPLICATION_START_ADDRESS)",
55-
"update-client.storage-address" : "(0x08000000+(256+18)*1024)",
56-
"update-client.storage-size" : "((256-18)*1024)",
57-
"update-client.storage-locations" : 1,
58-
"update-client.storage-page" : 4
31+
"update-client.application-details" : "(0x08000000+36*1024)",
32+
"mbed-bootloader.application-start-address": "(0x08000000+37*1024)",
33+
"mbed-bootloader.max-application-size" : "(MBED_CONF_UPDATE_CLIENT_STORAGE_ADDRESS-MBED_CONF_MBED_BOOTLOADER_APPLICATION_START_ADDRESS)",
34+
"update-client.storage-address" : "(0x08000000+(256+18)*1024)",
35+
"update-client.storage-size" : "((256-18)*1024)",
36+
"update-client.storage-locations" : 1,
37+
"update-client.storage-page" : 4
38+
},
39+
"NRF52_DK": {
40+
"minimal-printf.console-output" : "SWO",
41+
"target.app_offset" : "0x74000",
42+
"update-client.application-details" : "(508*1024)",
43+
"mbed-bootloader.application-start-address": "(4*1024)",
44+
"mbed-bootloader.max-application-size" : "(232*1024)",
45+
"update-client.storage-address" : "(236*1024)",
46+
"update-client.storage-size" : "(228*1024)",
47+
"update-client.storage-locations" : 1,
48+
"update-client.storage-page" : 4,
49+
"target.extra_labels_remove" : ["SOFTDEVICE_S132_FULL", "SOFTDEVICE_COMMON"],
50+
"target.extra_labels_add" : ["SOFTDEVICE_S132_MBR"]
5951
}
6052
}
6153
}

configs/internal_flash_nvstore.json

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,25 @@
11
{
22
"macros": [
3-
"MBEDTLS_USER_CONFIG_FILE=\"bootloader_mbedtls_user_config.h\"",
4-
"PAL_USER_DEFINED_CONFIGURATION=\"bootloader_pal_user_config.h\"",
5-
"MAX_COPY_RETRIES=1",
6-
"SHOW_PROGRESS_BAR=1",
7-
"MAX_BOOT_RETRIES=3",
8-
"ARM_UC_USE_PAL_CRYPTO=0",
9-
"ARM_UC_PROFILE_MBED_CLOUD_CLIENT=1",
10-
"ARM_UC_FEATURE_CRYPTO_PAL=0",
11-
"ARM_UC_FEATURE_CRYPTO_MBEDTLS=1",
12-
"ARM_BOOTLOADER_USE_NVSTORE_ROT=1",
13-
"MBED_CLOUD_CLIENT_UPDATE_STORAGE=ARM_UCP_FLASHIAP",
14-
"Mutex=PlatformMutex"
3+
"MBED_CLOUD_CLIENT_UPDATE_STORAGE=ARM_UCP_FLASHIAP"
154
],
16-
"config": {
17-
"application-start-address": {
18-
"help": "Address of the active application firmware in flash",
19-
"value": null
20-
},
21-
"max-application-size": {
22-
"help": "Maximum size of the active application",
23-
"value": null
24-
}
25-
},
265
"target_overrides": {
276
"*": {
28-
"target.features_remove": ["LWIP", "STORAGE"],
297
"platform.stdio-baud-rate": 115200,
308
"platform.stdio-flush-at-exit": false,
319
"update-client.firmware-header-version": "2"
3210
},
3311
"K64F": {
34-
"nvstore.area_1_address" : "( 32*1024)",
35-
"nvstore.area_1_size" : "( 4*1024)",
36-
"nvstore.area_2_address" : "( 36*1024)",
37-
"nvstore.area_2_size" : "( 4*1024)",
38-
"update-client.application-details": "( 40*1024)",
39-
"application-start-address" : "( 41*1024)",
40-
"max-application-size" : "(MBED_CONF_UPDATE_CLIENT_STORAGE_ADDRESS-MBED_CONF_APP_APPLICATION_START_ADDRESS)",
41-
"update-client.storage-address" : "(532*1024)",
42-
"update-client.storage-size" : "(492*1024)",
43-
"update-client.storage-locations" : 1,
44-
"update-client.storage-page" : 8
12+
"nvstore.area_1_address" : "( 32*1024)",
13+
"nvstore.area_1_size" : "( 4*1024)",
14+
"nvstore.area_2_address" : "( 36*1024)",
15+
"nvstore.area_2_size" : "( 4*1024)",
16+
"update-client.application-details" : "( 40*1024)",
17+
"mbed-bootloader.application-start-address": "( 41*1024)",
18+
"mbed-bootloader.max-application-size" : "(MBED_CONF_UPDATE_CLIENT_STORAGE_ADDRESS-MBED_CONF_MBED_BOOTLOADER_APPLICATION_START_ADDRESS)",
19+
"update-client.storage-address" : "(532*1024)",
20+
"update-client.storage-size" : "(492*1024)",
21+
"update-client.storage-locations" : 1,
22+
"update-client.storage-page" : 8
4523
}
4624
}
4725
}

configs/nrf52_block_device_fake_rot.json

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

configs/nrf52_internal_flash_fake_rot.json

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

0 commit comments

Comments
 (0)