From 57d5ba67c58f5226a9ddc8c58a01c29d71772c08 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 8 Feb 2014 15:45:58 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6672 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/sdc_lld.h | 9 ++++++++- os/hal/src/sdc.c | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/os/hal/ports/STM32/LLD/sdc_lld.h b/os/hal/ports/STM32/LLD/sdc_lld.h index f4a44d18c..6f0e389d6 100644 --- a/os/hal/ports/STM32/LLD/sdc_lld.h +++ b/os/hal/ports/STM32/LLD/sdc_lld.h @@ -82,7 +82,14 @@ * @brief Read timeout in milliseconds. */ #if !defined(STM32_SDC_READ_TIMEOUT_MS) || defined(__DOXYGEN__) -#define STM32_SDC_READ_TIMEOUT_MS 5 +#define STM32_SDC_READ_TIMEOUT_MS 25 +#endif + +/** + * @brief Card clock activation delay in milliseconds. + */ +#if !defined(STM32_SDC_CLOCK_ACTIVATION_DELAY) || defined(__DOXYGEN__) +#define STM32_SDC_CLOCK_ACTIVATION_DELAY 10 #endif /** diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c index d18f37b55..c75397291 100644 --- a/os/hal/src/sdc.c +++ b/os/hal/src/sdc.c @@ -200,6 +200,9 @@ bool sdcConnect(SDCDriver *sdcp) { /* Card clock initialization.*/ sdc_lld_start_clk(sdcp); + /* Clock activation delay.*/ + osalThreadSleep(MS2ST(STM32_SDC_CLOCK_ACTIVATION_DELAY)); + /* Enforces the initial card state.*/ sdc_lld_send_cmd_none(sdcp, MMCSD_CMD_GO_IDLE_STATE, 0);