From f3be7cb427bdb390b74ca474db3bf7c14b37297b Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sun, 13 Aug 2017 17:45:18 +0200 Subject: [PATCH] Correct calculation of the erase sector size The specification states that the real value is obtained by increasing by one the value extracted from the csd register. --- SDBlockDevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDBlockDevice.cpp b/SDBlockDevice.cpp index 3dc70cc..22576d1 100644 --- a/SDBlockDevice.cpp +++ b/SDBlockDevice.cpp @@ -941,7 +941,7 @@ uint32_t SDBlockDevice::_sd_sectors() { _erase_size = BLOCK_SIZE_HC; } else { // ERASE_BLK_EN = 1: Erase in multiple of SECTOR_SIZE supported - _erase_size = ext_bits(csd, 45, 39); + _erase_size = ext_bits(csd, 45, 39) + 1; } break;