28
28
#include " FlashSimBlockDevice.h"
29
29
#include " flash_map_backend/secondary_bd.h"
30
30
#include " bootutil/bootutil.h"
31
+ #include " bootutil/bootutil_extra.h"
31
32
32
33
/* Private typedef ----------------------------------------------------------- */
33
34
/* Private define ------------------------------------------------------------ */
@@ -60,7 +61,21 @@ mbed::BlockDevice* dfu_secondary_bd = get_secondary_bd();
60
61
const uint32_t QSPIFLASH_BASE_ADDRESS = 0x90000000 ;
61
62
const uint32_t FILEBLOCK_BASE_ADDRESS = 0xA0000000 ;
62
63
63
- USBD_DFU_MediaTypeDef USBD_DFU_Flash_fops = {
64
+ USBD_DFU_MediaTypeDef USBD_DFU_Flash_fops_default = {
65
+ {
66
+ (uint8_t *) FLASH_DESC_STR,
67
+ (uint8_t *) QSPI_FLASH_DESC_STR,
68
+ (uint8_t *) BOOTLOADER_DESC_STR
69
+ },
70
+ Flash_If_Init,
71
+ Flash_If_DeInit,
72
+ Flash_If_Erase,
73
+ Flash_If_Write,
74
+ Flash_If_Read,
75
+ Flash_If_GetStatus,
76
+ };
77
+
78
+ USBD_DFU_MediaTypeDef USBD_DFU_Flash_fops_MCUboot = {
64
79
{
65
80
(uint8_t *) FLASH_DESC_STR,
66
81
(uint8_t *) QSPI_FLASH_DESC_STR,
@@ -83,7 +98,11 @@ void init_Memories() {
83
98
if (dfu_secondary_bd != nullptr ) {
84
99
dfu_secondary_bd->init ();
85
100
}
86
- snprintf (BOOTLOADER_DESC_STR, sizeof (BOOTLOADER_DESC_STR), " @MCUBoot version %d /0x00000000/0*4Kg" , BOOTLOADER_VERSION);
101
+ if (boot_empty_keys ()) {
102
+ snprintf (BOOTLOADER_DESC_STR, sizeof (BOOTLOADER_DESC_STR), " @Arduino boot v.%d /0x00000000/0*4Kg" , BOOTLOADER_VERSION);
103
+ } else {
104
+ snprintf (BOOTLOADER_DESC_STR, sizeof (BOOTLOADER_DESC_STR), " @MCUboot v.%d /0x00000000/0*4Kg" , BOOTLOADER_VERSION);
105
+ }
87
106
}
88
107
89
108
Thread writeThread (osPriorityHigh);
0 commit comments