SDMMC_DATATIMEOUT is used in multiple ways in the code and thus can't be adjusted.
alan-wood opened this issue · 6 comments
Describe the set-up
- The board (either ST RPN reference or your custom board).
Custom board. STM32F746 with SD Card interface, USB, DCMI . - IDE
AC6 SystemWorkbench ( eclipse )
gcc compiler
CubeMX 5.6.1
HAL 1.16.0
FatFS
Describe the bug
Clean up the use of SDMMC_DATATIMEOUT.
How To Reproduce
Code Review:
In stm32f7xx_hal_sd.c the value SDMMC_DATATIMEOUT is used in two ways.
The first is as a value for the SDMMC.DTIMER register which has units of the SD Clock ( 48Mhz for me ).
The other uses has units of the HAL_GetTick() ( 1ms ).
While trying to adjust the later value to give up after a few seconds with SDMMC_DATATIMEOUT=3000.
The SD Card was not completing the transfer in the 62us, giving a data timeout from the SDMMC.
Suggestion:
Use separate variables for the two uses.
Hi @alan-wood,
Thank you for reporting this report. It will be forwarded to our development teams for analysis. We will be back to you as soon as we get feedback.
Thank you for your patience and thank you again for your contribution.
With regards,
Hi @alan-wood,
Our development teams confirmed your request. Actually, the point you raised has also been discussed internally since a while, before we receive your request. A fix will be made available in the frame of a future release.
We cannot share a date for the moment. Hopefully, this should be done soon. So stay tuned and thank you once more for your contribution and for your patience.
With regards,
ST Internal Reference: 43235
Hi @alan-wood,
I hope you are fine. The issue you reported has been fixed in the frame of version v1.16.1 of the STM32CubeF7 published recently on GitHub.
Thank you again for having reported.
With regards,
Hi ASELSTM,
are you sure?
hi! I confirm the issue still exists in CubeMX Software 1.16.1
I've managed to fix it by replacing all:
if((HAL_GetTick() - tickstart) >= SDMMC_DATATIMEOUT)
to
if((HAL_GetTick() - tickstart) >= 5000)
But I am not sure if this is guaranteed to work in all sitiuations.