This driver requires the STM32 device specific HAL and STM32CubeMX (CubeMX) initialization code generator. The driver instance is mapped to hardware as shown in the table below:
CMSIS Driver Instance | STM32 Hardware Resource |
---|---|
Driver_MCI1 | SDMMC1 or SDIO |
Driver_MCI2 | SDMMC2 |
This driver requires the following configuration in CubeMX:
Notes
- configuration information in the MX_Device.h file is based on CubeMX configuration.
- DMA configuration can differ between devices series so configure DMA as required by the used device.
- for DMA usage on devices with cache, ensure that data buffers for Transmit and Receive functions are in non-cacheable memory, or ensure that memory for transmit is updated (cache clean) before Transmit function is called and that memory containing received data is updated after the reception finishes (cache invalidate).
- some DMA controllers can only access specific memories, so ensure that proper memory is used for the buffers according to the DMA requirement.
Under Categories: Connectivity select SDMMC1:
Mode:
Configuration:
NVIC Interrupt Table | Enabled | Preemption Priority | Sub Priority |
---|---|---|---|
SDMMC1 global interrupt | checked | 0 | 0 |
Pin Name | Signal on Pin | GPIO output.. | GPIO mode | GPIO Pull-up/Pull.. | Maximum out.. | Fast Mode | User Label |
---|---|---|---|---|---|---|---|
PC8 | SDMMC1_D0 | n/a | Alternate Function Push Pull | Pull-up | Very High | n/a | . |
PC9 | SDMMC1_D1 | n/a | Alternate Function Push Pull | Pull-up | Very High | n/a | . |
PC10 | SDMMC1_D2 | n/a | Alternate Function Push Pull | Pull-up | Very High | n/a | . |
PC11 | SDMMC1_D3 | n/a | Alternate Function Push Pull | Pull-up | Very High | n/a | . |
PC12 | SDMMC1_CK | n/a | Alternate Function Push Pull | Pull-up | Very High | n/a | . |
PD2 | SDMMC1_CMD | n/a | Alternate Function Push Pull | Pull-up | Very High | n/a | . |
Under Categories: System Core select NVIC:
Configuration:
NVIC Interrupt Table | Enabled | Preemption Priority | Sub Priority |
---|---|---|---|
SDMMC1 global interrupt | checked | 0 | 0 |
Enabled interrupt table | Select for.. | Generate Enable in.. | Generate IRQ h.. | Call HAL handler |
---|---|---|---|---|
SDMMC1 global interrupt | unchecked | checked | unchecked | checked |
Pin | GPIO mode |
---|---|
PI8 | GPIO_Input |
PI0 | GPIO_Input |
Under Categories: System Core select GPIO:
Configuration:
Pin Name | Signal on Pin | GPIO output.. | GPIO mode | GPIO Pull-up/Pull.. | Maximum out.. | Fast Mode | User Label |
---|---|---|---|---|---|---|---|
PI8 | n/a | n/a | Input mode | Pull-up | n/a | n/a | MemoryCard_1_CD |
PI0 | n/a | n/a | Input mode | Pull-up | n/a | n/a | MemoryCard_1_WP |
Under Advanced Settings:
Generated Function Calls:
Generate Code | Function Name | Peripheral Inst.. | Do not generate .. | Visibility (Static) |
---|---|---|---|---|
checked | MX_SDMMC1_SD_Init | SDMMC1 | checked | checked |