mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-12 19:10:32 +03:00
[H7][LIB][SDMMC] Workaround for SDMMC Errata 2.11.4
Application of
STM32H750 - Apply workaround to the SDMMC Errata 2.11.4 (8446832
)
to V1.6.0
This commit is contained in:
parent
0397a1618a
commit
f2810551e7
1 changed files with 11 additions and 0 deletions
|
@ -444,6 +444,17 @@ HAL_StatusTypeDef SDMMC_ConfigData(SDMMC_TypeDef *SDMMCx, SDMMC_DataInitTypeDef*
|
||||||
Data->TransferMode |\
|
Data->TransferMode |\
|
||||||
Data->DPSM);
|
Data->DPSM);
|
||||||
|
|
||||||
|
// DC - See errata 2.11.4 - 8 SDMMC clock cycles must elapse before DTEN can be set.
|
||||||
|
// 32U below is used as a VERY rough guess that the SDMMC clock is 1/4 of the sytem clock, 8 * 4 = 32 and that the
|
||||||
|
// assembly below only takes 1 CPU cycle to run. All of which will be wrong, but right enough most of the time, especially
|
||||||
|
// when considering other processing overheads.
|
||||||
|
register uint32_t count = 32U;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
count--;
|
||||||
|
} while(count > 0);
|
||||||
|
// DC - See errata 2.11.4
|
||||||
|
|
||||||
/* Write to SDMMC DCTRL */
|
/* Write to SDMMC DCTRL */
|
||||||
MODIFY_REG(SDMMCx->DCTRL, DCTRL_CLEAR_MASK, tmpreg);
|
MODIFY_REG(SDMMCx->DCTRL, DCTRL_CLEAR_MASK, tmpreg);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue