Hello,
We are having issues with certain μSD cards with our custom board. The cards seem to fail in the 400kHz clock rate phase or at the first attempt at a higher speed. It is worth noting we did not appreciate the additional circuitry on the Eval board like the SD0_VSELECT and SD_PWREN. We did not implement these and thus I believe we need to force the driver to only work in standard speed mode with 3.3V only I/O. It is not very clear how to do this. In an attempt to keep it from running in UHS mode we turned off the following. It is worth noting the cards that don't work on our board do work on the eval board using the SDCARD_FATFS_FREERTOS demo.
FSL_FEATURE_USDHC_HAS_SDR50_MODE
FSL_FEATURE_USDHC_HAS_SDR104_MODE
This did not seem to resolve the issue. What else might we need to do? We are ok with running at slower speed 25Mhz and 3.3V I/O if we get it working, but like I said it isn't clear how to force the driver to do this. Thanks
Solved! Go to Solution.
Hi Diego,
We did limit the modes to Standard Speed mode and disabled the UHCI related modes since we did not implement the variable I/O voltage. This did not resolve everything. We discovered that for some reason the driver and CPU peripheral really needs the "SD CARD POWER SWITCH" to cycle power to the SDcard. We find this very strange but when we installed the switch on our board and routed "SD_PWREN" to the correct pin in the software, everything started to work just fine. Without this we had cards failing in the initial 400kHz mode.
Hi @andrew58210
I hope you are doing great, my apologies for the delayed response. Are you still having the same inquiry, or do you found out something new to aid the troubleshooting of this? Anyway, please allow me to provide you, my response.
I understand that you want to force the SDK driver to work at desired speed and desired voltage. In the case you want to change SD bus timing please check the below suggestions.
Modifying below macros is ok.
FSL_FEATURE_USDHC_HAS_SDR50_MODE (0)// in case you do not want 100 MHz
FSL_FEATURE_USDHC_HAS_SDR104_MODE (0) // in case you do not want 200 MHz
But you need to check the setup done in the SDMMCHOST_Init(sdmmchost_t *host) function.
Inside this function the i.MX RT SDMM host specifications are defined. This structure is especially important. So, you could change SD host parameters.
host->capability = (uint32_t)kSDMMCHOST_SupportHighSpeed | (uint32_t)kSDMMCHOST_SupportSuspendResume |
(uint32_t)kSDMMCHOST_SupportVoltage3v3 | (uint32_t)kSDMMCHOST_SupportVoltage1v8 |
(uint32_t)kSDMMCHOST_SupportVoltage1v2 | (uint32_t)kSDMMCHOST_Support4BitDataWidth |
(uint32_t)kSDMMCHOST_SupportDDRMode | (uint32_t)kSDMMCHOST_SupportDetectCardByData3 |
(uint32_t)kSDMMCHOST_SupportDetectCardByCD | (uint32_t)kSDMMCHOST_SupportAutoCmd12;
The function SD_SelectBusTiming(sd_card_t *card) is also important. You need to take a closer look at how this function executes, since it will select whether the SD card will work with SDR104, SR50 or less.
I hope this could be of any help,
Diego
Hi Diego,
We did limit the modes to Standard Speed mode and disabled the UHCI related modes since we did not implement the variable I/O voltage. This did not resolve everything. We discovered that for some reason the driver and CPU peripheral really needs the "SD CARD POWER SWITCH" to cycle power to the SDcard. We find this very strange but when we installed the switch on our board and routed "SD_PWREN" to the correct pin in the software, everything started to work just fine. Without this we had cards failing in the initial 400kHz mode.