新手入门
- 积分
- 15
- 金钱
- 15
- 注册时间
- 2021-2-19
- 在线时间
- 2 小时
|

楼主 |
发表于 2021-2-20 22:28:48
|
显示全部楼层
本人又仿真了一下程序,分频数改小后,程序都是死在下面函数的while循环处,一直在等待超时,
- /**
- * @brief Checks for error conditions for R1 response.
- * [url=home.php?mod=space&uid=271674]@param[/url] hsd: SD handle
- * @param SD_CMD: The sent command index
- * @retval SD Card error state
- */
- static uint32_t SDMMC_GetCmdResp1(SDIO_TypeDef *SDIOx, uint8_t SD_CMD, uint32_t Timeout)
- {
- uint32_t response_r1;
- uint32_t sta_reg;
-
- /* 8 is the number of required instructions cycles for the below loop statement.
- The Timeout is expressed in ms */
- register uint32_t count = Timeout * (SystemCoreClock / 8U /1000U);
-
- do
- {
- if (count-- == 0U)
- {
- return SDMMC_ERROR_TIMEOUT;
- }
- sta_reg = SDIOx->STA;
- }while(((sta_reg & (SDIO_FLAG_CCRCFAIL | SDIO_FLAG_CMDREND | SDIO_FLAG_CTIMEOUT)) == 0U) ||
- ((sta_reg & SDIO_FLAG_CMDACT) != 0U ));
复制代码 |
|