8000 Changed define names used to customize application features · arduino/mcuboot-arduino-stm32h7@7d482df · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d482df

Browse files
committed
Changed define names used to customize application features
MCUBOOT_AS_ENVIE -> MCUBOOT_APPLICATION_HOOKS MCUBOOT_ENVIE_LITTLEFS -> MCUBOOT_APPLICATION_LITTLEFS MCUBOOT_ENVIE_SDCARD -> MCUBOOT_APPLICATION_SDCARD MCUBOOT_ENVIE_DFU -> MCUBOOT_APPLICATION_DFU
1 parent f15d48d commit 7d482df

File tree

11 files changed

+30
-37
lines changed

11 files changed

+30
-37
lines changed

app/dfu/usbd_conf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
******************************************************************************
1818
*/
1919

20-
#if MCUBOOT_AS_ENVIE && MCUBOOT_ENVIE_DFU
20+
#if MCUBOOT_APPLICATION_HOOKS && MCUBOOT_APPLICATION_DFU
2121

2222
/* Includes ------------------------------------------------------------------ */
2323
#include "target_init.h"

app/dfu/usbd_desc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
******************************************************************************
1818
*/
1919

20-
#if MCUBOOT_AS_ENVIE && MCUBOOT_ENVIE_DFU
20+
#if MCUBOOT_APPLICATION_HOOKS && MCUBOOT_APPLICATION_DFU
2121

2222
/* Includes ------------------------------------------------------------------ */
2323
#include "usbd_core.h"

app/dfu/usbd_dfu_flash.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
******************************************************************************
1818
*/
1919

20-
#if MCUBOOT_AS_ENVIE && MCUBOOT_ENVIE_DFU
20+
#if MCUBOOT_APPLICATION_HOOKS && MCUBOOT_APPLICATION_DFU
2121

2222
/* Includes ------------------------------------------------------------------ */
2323
#include "usbd_dfu_flash.h"

app/ota/ota.cpp

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if MCUBOOT_AS_ENVIE
1+
#if MCUBOOT_APPLICATION_HOOKS
22

33
#include "ota.h"
44
#include "rtc.h"
@@ -12,11 +12,11 @@
1212
#include "FileBlockDevice.h"
1313
#include "FATFileSystem.h"
1414

15-
#if MCUBOOT_ENVIE_SDCARD
15+
#if MCUBOOT_APPLICATION_SDCARD
1616
#include "SDMMCBlockDevice.h"
1717
#endif
1818

19-
#if MCUBOOT_ENVIE_LITTLEFS
19+
#if MCUBOOT_APPLICATION_LITTLEFS
2020
#include "LittleFileSystem.h"
2121
#endif
2222

@@ -118,7 +118,7 @@ static void initBlockTable(void) {
118118
//block_info[SCRATCH_BLOCK_DEVICE].raw_bd = block_info[SECONDARY_BLOCK_DEVICE].raw_bd;
119119
BOOT_LOG_ERR("U on IAP");
120120
} else if (block_info[SECONDARY_BLOCK_DEVICE].raw_type & SDCARD_FLAG) {
121-
#if MCUBOOT_ENVIE_SDCARD
121+
#if MCUBOOT_APPLICATION_SDCARD
122122
block_info[SECONDARY_BLOCK_DEVICE].raw_bd = new SDMMCBlockDevice();
123123
block_info[SCRATCH_BLOCK_DEVICE].raw_bd = block_info[SECONDARY_BLOCK_DEVICE].raw_bd;
124124
#else
@@ -138,7 +138,7 @@ static void initBlockTable(void) {
138138
//block_info[SCRATCH_BLOCK_DEVICE].raw_bd = block_info[SECONDARY_BLOCK_DEVICE].raw_bd;
139139
BOOT_LOG_ERR("U on IAP");
140140
} else if (block_info[SECONDARY_BLOCK_DEVICE].raw_type & SDCARD_FLAG) {
141-
#if MCUBOOT_ENVIE_SDCARD
141+
#if MCUBOOT_APPLICATION_SDCARD
142142
block_info[SECONDARY_BLOCK_DEVICE].log_bd = new SlicingBlockDevice(block_info[SECONDARY_BLOCK_DEVICE].raw_bd, block_info[SECONDARY_BLOCK_DEVICE].data_offset, block_info[SECONDARY_BLOCK_DEVICE].update_size);
143143
block_info[SCRATCH_BLOCK_DEVICE].log_bd = block_info[SECONDARY_BLOCK_DEVICE].log_bd;
144144
#else
@@ -180,7 +180,7 @@ static void initBlockTable(void) {
180180
/* Setup FS */
181181
if(!block_info[SECONDARY_BLOCK_DEVICE].raw_flag) {
182182
if((block_info[SECONDARY_BLOCK_DEVICE].storage_type & LITTLEFS_FLAG)) {
183-
#if MCUBOOT_ENVIE_LITTLEFS
183+
#if MCUBOOT_APPLICATION_LITTLEFS
184184
block_info[SECONDARY_BLOCK_DEVICE].log_fs = new LittleFileSystem("fs");
185185
#else
186186
BOOT_LOG_ERR("LFS");
@@ -207,7 +207,7 @@ static void initBlockTable(void) {
207207
//block_info[SECONDARY_BLOCK_DEVICE].raw_bd = new FlashIAPBlockDevice flashIAP_bd(data_offset, update_size);
208208
BOOT_LOG_ERR("U on IAP");
209209
} else if (block_info[SECONDARY_BLOCK_DEVICE].raw_type & SDCARD_FLAG) {
210-
#if MCUBOOT_ENVIE_SDCARD
210+
#if MCUBOOT_APPLICATION_SDCARD
211211
block_info[SECONDARY_BLOCK_DEVICE].raw_bd = new SDMMCBlockDevice();
212212
#else
213213
BOOT_LOG_ERR("SDMMC");
@@ -221,7 +221,7 @@ static void initBlockTable(void) {
221221
if (block_info[SCRATCH_BLOCK_DEVICE].raw_type & INTERNAL_FLASH_FLAG) {
222222
BOOT_LOG_ERR("S on IAP");
223223
} else if (block_info[SCRATCH_BLOCK_DEVICE].raw_type & SDCARD_FLAG) {
224-
#if MCUBOOT_ENVIE_SDCARD
224+
#if MCUBOOT_APPLICATION_SDCARD
225225
block_info[SCRATCH_BLOCK_DEVICE].raw_bd = new SDMMCBlockDevice();
226226
#else
227227
BOOT_LOG_ERR("SDMMC");
@@ -237,7 +237,7 @@ static void initBlockTable(void) {
237237
if (block_info[SECONDARY_BLOCK_DEVICE].raw_type & INTERNAL_FLASH_FLAG) {
238238
BOOT_LOG_ERR("U on IAP");
239239
} else if (block_info[SECONDARY_BLOCK_DEVICE].raw_type & SDCARD_FLAG) {
240-
#if MCUBOOT_ENVIE_SDCARD
240+
#if MCUBOOT_APPLICATION_SDCARD
241241
block_info[SECONDARY_BLOCK_DEVICE].log_bd = new SlicingBlockDevice(block_info[SECONDARY_BLOCK_DEVICE].raw_bd, block_info[SECONDARY_BLOCK_DEVICE].data_offset, block_info[SECONDARY_BLOCK_DEVICE].update_size);
242242
#else
243243
BOOT_LOG_ERR("SDMMC");
@@ -268,7 +268,7 @@ static void initBlockTable(void) {
268268
if (block_info[SCRATCH_BLOCK_DEVICE].raw_type & INTERNAL_FLASH_FLAG) {
269269
BOOT_LOG_ERR("S on IAP");
270270
} else if (block_info[SCRATCH_BLOCK_DEVICE].raw_type & SDCARD_FLAG) {
271-
#if MCUBOOT_ENVIE_SDCARD
271+
#if MCUBOOT_APPLICATION_SDCARD
272272
block_info[SCRATCH_BLOCK_DEVICE].log_bd = new SlicingBlockDevice(block_info[SCRATCH_BLOCK_DEVICE].raw_bd, block_info[SCRATCH_BLOCK_DEVICE].data_offset, block_info[SCRATCH_BLOCK_DEVICE].update_size);
273273
#else
274274
BOOT_LOG_ERR("SDMMC");
@@ -297,7 +297,7 @@ static void initBlockTable(void) {
297297
/* Setup FS */
298298
if(!block_info[SECONDARY_BLOCK_DEVICE].raw_flag) {
299299
if((block_info[SECONDARY_BLOCK_DEVICE].storage_type & LITTLEFS_FLAG)) {
300-
#if MCUBOOT_ENVIE_LITTLEFS
300+
#if MCUBOOT_APPLICATION_LITTLEFS
301301
block_info[SECONDARY_BLOCK_DEVICE].log_fs = new LittleFileSystem("sec");
302302
#else
303303
BOOT_LOG_ERR("LFS");
@@ -318,7 +318,7 @@ static void initBlockTable(void) {
318318
/* Setup FS */
319319
if(!block_info[SCRATCH_BLOCK_DEVICE].raw_flag) {
320320
if((block_info[SCRATCH_BLOCK_DEVICE].storage_type & LITTLEFS_FLAG)) {
321-
#if MCUBOOT_ENVIE_LITTLEFS
321+
#if MCUBOOT_APPLICATION_LITTLEFS
322322
block_info[SCRATCH_BLOCK_DEVICE].log_fs = new LittleFileSystem("scr");
323323
#else
324324
BOOT_LOG_ERR("LFS");
@@ -338,13 +338,6 @@ static void initBlockTable(void) {
338338
}
339339
}
340340

341-
/*
342-
* MCUBOOT_AS_ENVIE -> Secondary Block device defined by getOTAData [SDCARD, QSPI] Internal flash not supported
343-
* -> Scratch Block device defined by getOTAData [SDCARD, QSPI, FLASH]
344-
*
345-
* -> Secondary Block device on RAW QSPI @0x0000000
346-
* -> Scratch Block device on Internal flash @MCUBOOT_SCRATCH_START_ADDR
347-
*/
348341
mbed::BlockDevice* get_secondary_bd(void) {
349342

350343
if(!BlockTableLoaded) {
@@ -359,7 +352,6 @@ mbed::BlockDevice* get_secondary_bd(void) {
359352
}
360353
}
361354

362-
363355
mbed::BlockDevice* get_scratch_bd(void) {
364356

365357
if(!BlockTableLoaded) {

app/rtc/rtc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if MCUBOOT_AS_ENVIE
1+
#if MCUBOOT_APPLICATION_HOOKS
22

33
#include "rtc.h"
44
#include "bootutil/bootutil_log.h"

app/sdcard/BSP.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
6060
------------------------------------------------------------------------------*/
6161

62-
#if MCUBOOT_AS_ENVIE && MCUBOOT_ENVIE_SDCARD
62+
#if MCUBOOT_APPLICATION_HOOKS && MCUBOOT_APPLICATION_SDCARD
6363

6464
/* Includes ------------------------------------------------------------------*/
6565
#include "BSP.h"

app/sdcard/SDMMCBlockDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*/
1717

18-
#if MCUBOOT_AS_ENVIE && MCUBOOT_ENVIE_SDCARD
18+
#if MCUBOOT_APPLICATION_HOOKS && MCUBOOT_APPLICATION_SDCARD
1919

2020
#include "SDMMCBlockDevice.h"
2121
#include "mbed_debug.h"

app/target_init.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if MCUBOOT_AS_ENVIE
1+
#if MCUBOOT_APPLICATION_HOOKS
22

33
#include "mbed.h"
44
#include "target_init.h"
@@ -267,7 +267,7 @@ int target_init(void) {
267267
}
268268
}
269269

270-
#if MCUBOOT_ENVIE_DFU
270+
#if MCUBOOT_APPLICATION_DFU
271271
USBD_HandleTypeDef USBD_Device;
272272
extern PCD_HandleTypeDef hpcd;
273273
extern void init_Memories(void);
@@ -285,7 +285,7 @@ void envie_loop(void) {
285285

286286
//turnDownEthernet();
287287

288-
#if MCUBOOT_ENVIE_DFU
288+
#if MCUBOOT_APPLICATION_DFU
289289
init_Memories();
290290

291291
/* Otherwise enters DFU mode to allow user programming his application */
@@ -310,7 +310,7 @@ void envie_loop(void) {
310310
#endif
311311

312312
while(1) {
313-
#if MCUBOOT_ENVIE_DFU
313+
#if MCUBOOT_APPLICATION_DFU
314314
#ifdef USE_USB_HS
315315
if (USB_OTG_HS->GINTSTS & USB_OTG_HS->GINTMSK) {
316316
#else // USE_USB_FS

app/target_init.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "stm32h7xx_hal.h"
55
#include "stm32h7xx_hal_mdma.h"
66
#include "stm32h7xx_hal_qspi.h"
7-
#if MCUBOOT_ENVIE_DFU
7+
#if MCUBOOT_APPLICATION_DFU
88
#include "usbd_core.h"
99
#include "usbd_desc.h"
1010
#include "usbd_dfu.h"

default_bd.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
* Author: gdbeckstein
66
*/
77

8-
#if !MCUBOOT_AS_ENVIE
8+
#if ! MCUBOOT_APPLICATION_HOOKS
99

1010
#include "BlockDevice.h"
1111
#include "SlicingBlockDevice.h"
12+
#include "FlashIAPBlockDevice.h"
1213

1314
#if COMPONENT_SPIF
1415
#include "SPIFBlockDevice.h"
@@ -86,6 +87,6 @@ mbed::BlockDevice* get_scratch_bd(void) {
8687
static FlashIAPBlockDevice scratch_bd(MCUBOOT_SCRATCH_START_ADDR, MCUBOOT_SCRATCH_SIZE);
8788
return &scratch_bd;
8889
}
89-
#endif //MCUBOOT_AS_ENVIE
90+
#endif // MCUBOOT_APPLICATION_HOOKS
9091

9192

mbed_app.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@
6969
"mcuboot.max-img-sectors": "0x3C0",
7070
"mcuboot.max-align": 32,
7171
"mcuboot.bootstrap": true,
72-
"mcuboot.mcuboot-as-envie": true,
73-
"mcuboot.mcuboot-envie-littlefs": true,
74-
"mcuboot.mcuboot-envie-sdcard": true,
75-
"mcuboot.mcuboot-envie-dfu": true,
72+
"mcuboot.application-hooks": true,
73+
"mcuboot.application-littlefs": true,
74+
"mcuboot.application-sdcard": true,
75+
"mcuboot.application-dfu": true,
7676
"mcuboot.signature-algorithm": "SIGNATURE_TYPE_EC256",
7777
"mcuboot.encrypt-ec256": true,
7878
"mcuboot.include-keys": null

0 commit comments

Comments
 (0)
0