Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7a7b9e4

Browse files
committedNov 23, 2022
Simplify logic and update file flash size according key presence
1 parent 089917d commit 7a7b9e4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed
 

‎app/dfu/usbd_dfu_flash.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@
2828
#include "FlashSimBlockDevice.h"
2929
#include "flash_map_backend/secondary_bd.h"
3030
#include "bootutil/bootutil.h"
31-
#include "bootutil/bootutil_extra.h"
3231

3332
/* Private typedef ----------------------------------------------------------- */
3433
/* Private define ------------------------------------------------------------ */
3534
#define FLASH_DESC_STR "@Internal Flash 2MB /0x08000000/01*128Ka,15*128Kg"
3635
//#define BOOTLOADER_DESC_STR "@Option Bits /0x52002000/01*1Ka"
3736
#define QSPI_FLASH_DESC_STR "@Ext RAW Flash 16MB /0x90000000/4096*4Kg"
38-
#define FILE_FLASH_DESC_STR "@Ext File Flash 16MB /0xA0000000/4096*4Kg"
3937

4038
#define FLASH_ERASE_TIME (uint16_t)0
4139
#define FLASH_PROGRAM_TIME (uint16_t)0
@@ -44,6 +42,7 @@
4442
/* Private variables --------------------------------------------------------- */
4543
/* Private function prototypes ----------------------------------------------- */
4644
char BOOTLOADER_DESC_STR[48];
45+
char FILE_FLASH_DESC_STR[48] = "@Ext File Flash 16MB /0xA0000000/4096*4Kg";
4746

4847

4948
/* Extern function prototypes ------------------------------------------------ */
@@ -83,12 +82,11 @@ void init_Memories() {
8382
qspi_flash->init();
8483
if (dfu_secondary_bd != nullptr) {
8584
dfu_secondary_bd->init();
86-
}
87-
if(boot_empty_keys()) {
88-
snprintf(BOOTLOADER_DESC_STR, sizeof(BOOTLOADER_DESC_STR), "@Arduino boot v.%02d /0x00000000/0*4Kg", BOOTLOADER_VERSION);
89-
} else {
9085
snprintf(BOOTLOADER_DESC_STR, sizeof(BOOTLOADER_DESC_STR), "@MCUboot v.%02d /0x00000000/0*4Kg", BOOTLOADER_VERSION);
91-
}
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+
}
9290
}
9391

9492
Thread writeThread(osPriorityHigh);

0 commit comments

Comments
 (0)
Please sign in to comment.