diff --git a/drivers/disk/usdhc.c b/drivers/disk/usdhc.c index 8ccc77ca4b2..6702ca06879 100644 --- a/drivers/disk/usdhc.c +++ b/drivers/disk/usdhc.c @@ -2534,20 +2534,22 @@ APP_SEND_OP_COND_AGAIN: usdhc_set_bus_width(base, USDHC_DATA_BUS_WIDTH_4BIT); } - /* set sd card driver strength */ - ret = usdhc_select_fun(priv, SD_GRP_DRIVER_STRENGTH_MODE, - priv->card_info.driver_strength); - if (ret) { - LOG_ERR("Set SD driver strehgth failed: %d\r\n", ret); - return ret; - } + if (priv->card_info.version >= SD_SPEC_VER3_0) { + /* set sd card driver strength */ + ret = usdhc_select_fun(priv, SD_GRP_DRIVER_STRENGTH_MODE, + priv->card_info.driver_strength); + if (ret) { + LOG_ERR("Set SD driver strehgth failed: %d\r\n", ret); + return ret; + } - /* set sd card current limit */ - ret = usdhc_select_fun(priv, SD_GRP_CURRENT_LIMIT_MODE, - priv->card_info.max_current); - if (ret) { - LOG_ERR("Set SD current limit failed: %d\r\n", ret); - return ret; + /* set sd card current limit */ + ret = usdhc_select_fun(priv, SD_GRP_CURRENT_LIMIT_MODE, + priv->card_info.max_current); + if (ret) { + LOG_ERR("Set SD current limit failed: %d\r\n", ret); + return ret; + } } /* set block size */ @@ -2560,11 +2562,13 @@ APP_SEND_OP_COND_AGAIN: return -EIO; } - /* select bus timing */ - ret = usdhc_select_bus_timing(priv); - if (ret) { - LOG_ERR("Select bus timing failed: %d\r\n", ret); - return ret; + if (priv->card_info.version > SD_SPEC_VER1_0) { + /* select bus timing */ + ret = usdhc_select_bus_timing(priv); + if (ret) { + LOG_ERR("Select bus timing failed: %d\r\n", ret); + return ret; + } } retry = 10;