From a5e93de18479879dd129cf6272cfd75e0c794bd4 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 1 Apr 2019 16:41:20 +1100 Subject: [PATCH] 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. --- STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_mmc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_mmc.h b/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_mmc.h index 714fb3e0..e99f3ff1 100644 --- a/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_mmc.h +++ b/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_mmc.h @@ -243,7 +243,7 @@ typedef struct */ #define BLOCKSIZE ((uint32_t)512U) /*!< Block size is 512 bytes */ -#define CAPACITY ((uint32_t)0x80000000U) /*!< 2 G bytes constant */ +#define CAPACITY ((uint32_t)0x400000U) /*!< Log Block Number for 2 G bytes Cards */ /** @defgroup MMC_Exported_Constansts_Group1 MMC Error status enumeration Structure definition * @{