diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c index 0cdc56f2c6..dea4a578cf 100644 --- a/firmware/target/arm/as3525/sd-as3525.c +++ b/firmware/target/arm/as3525/sd-as3525.c @@ -669,10 +669,6 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start, int ret = 0; unsigned loops = 0; - /* skip SanDisk OF */ - if (drive == INTERNAL_AS3525) - start += AMS_OF_SIZE; - mutex_lock(&sd_mtx); #ifndef BOOTLOADER sd_enable(true); @@ -692,6 +688,10 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start, goto sd_transfer_error; } + /* skip SanDisk OF */ + if (drive == INTERNAL_AS3525) + start += AMS_OF_SIZE; + last_disk_activity = current_tick; dma_retain(); diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index 8df947275d..94ba019183 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -795,10 +795,6 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start, const int drive = 0; #endif - /* skip SanDisk OF */ - if (drive == INTERNAL_AS3525) - start += AMS_OF_SIZE; - mutex_lock(&sd_mtx); #ifndef BOOTLOADER sd_enable(true); @@ -821,6 +817,10 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start, goto sd_transfer_error; } + /* skip SanDisk OF */ + if (drive == INTERNAL_AS3525) + start += AMS_OF_SIZE; + /* CMD7 w/rca: Select card to put it in TRAN state */ if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_NO_RESP, NULL)) return -19;