Skip to content

Commit a5fab93

Browse files
authored
Merge pull request #21 from arduino/dfu-ops
Customize dfu bootloader descriptor string according to key presence
2 parents 5f8ee0c + 7a7b9e4 commit a5fab93

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/dfu/usbd_dfu_flash.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#define FLASH_DESC_STR "@Internal Flash 2MB /0x08000000/01*128Ka,15*128Kg"
3535
//#define BOOTLOADER_DESC_STR "@Option Bits /0x52002000/01*1Ka"
3636
#define QSPI_FLASH_DESC_STR "@Ext RAW Flash 16MB /0x90000000/4096*4Kg"
37-
#define FILE_FLASH_DESC_STR "@Ext File Flash 16MB /0xA0000000/4096*4Kg"
3837

3938
#define FLASH_ERASE_TIME (uint16_t)0
4039
#define FLASH_PROGRAM_TIME (uint16_t)0
@@ -43,6 +42,7 @@
4342
/* Private variables --------------------------------------------------------- */
4443
/* Private function prototypes ----------------------------------------------- */
4544
char BOOTLOADER_DESC_STR[48];
45+
char FILE_FLASH_DESC_STR[48] = "@Ext File Flash 16MB /0xA0000000/4096*4Kg";
4646

4747

4848
/* Extern function prototypes ------------------------------------------------ */
@@ -82,8 +82,11 @@ void init_Memories() {
8282
qspi_flash->init();
8383
if (dfu_secondary_bd != nullptr) {
8484
dfu_secondary_bd->init();
85-
}
86-
snprintf(BOOTLOADER_DESC_STR, sizeof(BOOTLOADER_DESC_STR), "@MCUBoot version %d /0x00000000/0*4Kg", BOOTLOADER_VERSION);
85+
snprintf(BOOTLOADER_DESC_STR, sizeof(BOOTLOADER_DESC_STR), "@MCUboot v.%02d /0x00000000/0*4Kg", BOOTLOADER_VERSION);
86+
} else {
87+
snprintf(BOOTLOADER_DESC_STR, sizeof(BOOTLOADER_DESC_STR), "@Arduino boot v.%02d /0x00000000/0*4Kg", BOOTLOADER_VERSION);
88+
snprintf(FILE_FLASH_DESC_STR, sizeof(FILE_FLASH_DESC_STR), "@Ext File Flash 0MB /0x00000000/0*4Kg");
89+
}
8790
}
8891

8992
Thread writeThread(osPriorityHigh);

0 commit comments

Comments
 (0)