SD card experiment source code explanation

SD card experiment source code explanation

The connection relationship between the onboard SD card interface of the explorer STM32F4 development board and STM32F4 is shown in the figure: Source code explanation: SD_Init function in sdio_sdcard.c: This function first implements SDIO clock and Initialize the relevant IO ports, and then start the initialization process of the SD card. First, through the SD_PowerON function, we will complete the power on of the SD card and obtain the type of SD card (SDHC/SDSC/SDV1.x/MMC), and then call the SD_InitializeCards function to complete the initialization of the SD card. SD_InitializeCards function: SD_InitializeCards function mainly sends CMD2 and CMD3 to obtain the CID register content and the relative address (RCA) of the SD card, and obtains the CSD register content through CMD9. At this point, the initialization of the SD card has actually been completed. Subsequently, the SD_Init function calls the SD_GetCardInfo function to obtain SD card related information, and then calls the SD_SelectDeselect function to select the card to be operated (CMD7+RCA), and sets the SDIO data bit width to 4 bits through the SD_EnableWideBusOperation function (but the MMC card can only 1-bit mode is supported!). Finally set the frequency of SDIO_CK clock and set the working mode (DMA/Polling). SD card…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索