@@ -981,7 +981,7 @@ bs_upload(char *buf, int len)
981
981
*/
982
982
const size_t area_size = flash_area_get_size (fap );
983
983
984
- #ifdef MCUBOOT_SWAP_USING_OFFSET
984
+ #if defined( MCUBOOT_SWAP_USING_OFFSET ) && defined( MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD )
985
985
uint32_t num_sectors = SWAP_USING_OFFSET_SECTOR_UPDATE_BEGIN ;
986
986
struct flash_sector sector_data ;
987
987
#endif
@@ -1028,8 +1028,7 @@ bs_upload(char *buf, int len)
1028
1028
1029
1029
img_size = img_size_tmp ;
1030
1030
1031
- #ifdef MCUBOOT_SWAP_USING_OFFSET
1032
- #ifdef MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD
1031
+ #if defined(MCUBOOT_SWAP_USING_OFFSET ) && defined(MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD )
1033
1032
if (img_num > 0 &&
1034
1033
(img_num % BOOT_NUM_SLOTS ) == BOOT_DIRECT_UPLOAD_SECONDARY_SLOT_ID_REMAINDER ) {
1035
1034
rc = flash_area_sectors (fap , & num_sectors , & sector_data );
@@ -1044,17 +1043,6 @@ bs_upload(char *buf, int len)
1044
1043
} else {
1045
1044
start_off = 0 ;
1046
1045
}
1047
- #else
1048
- rc = flash_area_sectors (fap , & num_sectors , & sector_data );
1049
-
1050
- if ((rc != 0 && rc != - ENOMEM ) ||
1051
- num_sectors != SWAP_USING_OFFSET_SECTOR_UPDATE_BEGIN ) {
1052
- rc = MGMT_ERR_ENOENT ;
1053
- goto out ;
1054
- }
1055
-
1056
- start_off = sector_data .fs_size ;
1057
- #endif
1058
1046
#endif
1059
1047
} else if (img_chunk_off != curr_off ) {
1060
1048
/* If received chunk offset does not match expected one jump, pretend
0 commit comments