Skip to content

Commit 0ac12a0

Browse files
author
Deepika
authored
Merge pull request ARMmbed#49 from LemonBoy/erase_size
Correct calculation of the erase sector size
2 parents c7347c9 + 705462d commit 0ac12a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SDBlockDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ uint32_t SDBlockDevice::_sd_sectors() {
948948
_erase_size = BLOCK_SIZE_HC;
949949
} else {
950950
// ERASE_BLK_EN = 1: Erase in multiple of SECTOR_SIZE supported
951-
_erase_size = ext_bits(csd, 45, 39);
951+
_erase_size = BLOCK_SIZE_HC * (ext_bits(csd, 45, 39) + 1);
952952
}
953953
break;
954954

0 commit comments

Comments
 (0)