File tree Expand file tree Collapse file tree 3 files changed +3
-41
lines changed
lib/sdk11/components/libraries/bootloader_dfu Expand file tree Collapse file tree 3 files changed +3
-41
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ void bootloader_dfu_update_process(dfu_update_status_t update_status)
196
196
{
197
197
settings .bank_0_crc = update_status .app_crc ;
198
198
settings .bank_0_size = update_status .app_size ;
199
- settings .bank_0 = ( update_status . app_size ? BANK_VALID_APP : BANK_INVALID_APP ) ;
199
+ settings .bank_0 = BANK_VALID_APP ;
200
200
settings .bank_1 = BANK_INVALID_APP ;
201
201
202
202
m_update_status = BOOTLOADER_SETTINGS_SAVING ;
Original file line number Diff line number Diff line change @@ -184,25 +184,6 @@ void tud_msc_write10_complete_cb(uint8_t lun)
184
184
{
185
185
// update App
186
186
update_status .status_code = DFU_UPDATE_APP_COMPLETE ;
187
- update_status .app_crc = 0 ; // skip CRC checking with uf2 upgrade
188
- update_status .app_size = _wr_state .numBlocks * 256 ;
189
-
190
- if ( _wr_state .has_sd && is_sd_existed () )
191
- {
192
- /* Since the Bootloader Setting still needs to know the SD and App size separately
193
- * to stay compatible with DFU CDC interface. We re-calculate it based on written
194
- * address and its contents ( SD_MAGIC matches )
195
- */
196
- update_status .app_size -= (SD_SIZE_GET (MBR_SIZE ) - MBR_SIZE );
197
- }
198
-
199
- if ( _wr_state .has_mbr )
200
- {
201
- // MBR write isn't counted app size as well
202
- update_status .app_size -= MBR_SIZE ;
203
- }
204
-
205
- PRINT_INT (update_status .app_size );
206
187
}
207
188
208
189
bootloader_dfu_update_process (update_status );
Original file line number Diff line number Diff line change @@ -183,27 +183,8 @@ static uint32_t current_flash_size(void)
183
183
flash_sz = 256 ;
184
184
}else
185
185
{
186
- bootloader_settings_t const * boot_setting ;
187
- bootloader_util_settings_get (& boot_setting );
188
-
189
- flash_sz = boot_setting -> bank_0_size ;
190
-
191
- // Include SoftDevice (excluding MBR) for current.uf2
192
- if ( is_sd_existed () ) flash_sz += (SD_SIZE_GET (MBR_SIZE ) - MBR_SIZE );
193
-
194
- // Copy size must be multiple of 256 bytes
195
- // else we will got an issue copying current.uf2
196
- if (flash_sz & 0xff )
197
- {
198
- flash_sz = (flash_sz & ~0xff ) + 256 ;
199
- }
200
-
201
- // if bank0 size is not valid, happens when flashed with jlink
202
- // use maximum application size
203
- if ( (flash_sz == 0 ) || (flash_sz == 0xFFFFFFFFUL ) )
204
- {
205
- flash_sz = (USER_FLASH_END - USER_FLASH_START );
206
- }
186
+ // Use full application size for simplicity
187
+ flash_sz = (USER_FLASH_END - USER_FLASH_START );
207
188
}
208
189
209
190
return flash_sz ;
You can’t perform that action at this time.
0 commit comments