Repository navigation
STM32 {F7|H7} Use 250 Ms Data path timeout, regardless of Card Clock frequency - #3669
Conversation
|
Commiters Please review but wait for @antmerlino to cross test and approve. |
f70179c to
7715b50
Compare
| /* DTIMER setting | ||
| * | ||
| * Assuming Max timeout in bypass 48 Mhz | ||
| * | ||
| */ |
There was a problem hiding this comment.
| /* DTIMER setting | |
| * | |
| * Assuming Max timeout in bypass 48 Mhz | |
| * | |
| */ | |
| /* DTIMER setting | |
| * | |
| * Assuming Max timeout in bypass 48 Mhz | |
| */ |
nit: This empty line may be removed.
| #define IP_CLCK_FREQ UINT32_C(48000000) | ||
| #define SDIO_DTIMER_DATATIMEOUT_MS 250 |
There was a problem hiding this comment.
| #define IP_CLCK_FREQ UINT32_C(48000000) | |
| #define SDIO_DTIMER_DATATIMEOUT_MS 250 | |
| #define IP_CLCK_FREQ UINT32_C(48000000) | |
| #define SDIO_DTIMER_DATATIMEOUT_MS 250 |
nit: suggestion for alignment
| static void stm32_dataconfig(uint32_t timeout, uint32_t dlen, uint32_t dctrl) | ||
| { | ||
| uint32_t regval = 0; | ||
| uint32_t clkdiv; |
There was a problem hiding this comment.
| uint32_t clkdiv; | |
| uint32_t clkdiv = 0; |
nit: since regval is being initialized, clkdiv could also be.
There was a problem hiding this comment.
Thanks. All Vars are initialized in the body, So I opted to remove the wasteful inits.
| uint32_t dlen, uint32_t dctrl) | ||
| { | ||
| uint32_t regval = 0; | ||
| uint32_t clkdiv; |
There was a problem hiding this comment.
| uint32_t clkdiv; | |
| uint32_t clkdiv = 0; |
nit: same as the previous one
| static void stm32_dataconfig(struct stm32_dev_s *priv, uint32_t timeout, | ||
| uint32_t dlen, bool receive) | ||
| { | ||
| uint32_t clkdiv; |
There was a problem hiding this comment.
| uint32_t clkdiv; | |
| uint32_t clkdiv = 0; |
|
LGTM. |
7715b50 to
db97043
Compare
|
@gustavonihei - Thank you for being so thorough! |
I'll take that as a compliment! 😆 |
Good! Because It was meant as one! |
antmerlino
left a comment
There was a problem hiding this comment.
Tested and confirmed this fixes the issue I was seeing on the H7.
|
@jerpelea - This is critical for STM32 if CONFIG_MMCSD_MULTIBLOCK_DISABLE=y is not lit (using MULTIBLOCK) the driver will fail without this PR |
Summary
Timeouts were occurring on STMF4 based platforms on differnt SD card based on formatting, and age. For additional information See
Impact
The hard coded contestant would timeout at 100+ Ms. The spec is 250.
Testing
PX4 fmu-v3 (stm32F4)
PX4 fmu-v5X (stm32F7)
PX4 fmu-v6X (stm32H7)