Skip to content

Commit 0b2579a

Browse files
committed
F7_HAL/mmc: Fix CAPACITY constant used to determine high-capacity MMC.
In the code CAPACITY is compared against number of logical blocks, not number of bytes, so should be expressed as 2GB in 512 blocks. This is how it's done in the F4 code.
1 parent cfda9ea commit 0b2579a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_mmc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ typedef struct
243243
*/
244244

245245
#define BLOCKSIZE ((uint32_t)512U) /*!< Block size is 512 bytes */
246-
#define CAPACITY ((uint32_t)0x80000000U) /*!< 2 G bytes constant */
246+
#define CAPACITY ((uint32_t)0x400000U) /*!< Log Block Number for 2 G bytes Cards */
247247

248248
/** @defgroup MMC_Exported_Constansts_Group1 MMC Error status enumeration Structure definition
249249
* @{

0 commit comments

Comments
 (0)