I'm running the SDMMC in 1-line mode, so would like to free-up the unused pins for other functions. Specifically SD_DATA1, SD_DATA2, and SD_DATA3. However, after mounting the SD CARD, it seems the driver re-maps those pins to SDMMC and I can't access them properly in the UART driver I am trying to work with.
Symptom is that the UART simply doesn't work. If I comment-out the SDCARD initialisation code, the UART then works fine.
[solved] SDMMC 1-line mode, free-up unused pins
[solved] SDMMC 1-line mode, free-up unused pins
Last edited by markwj on Tue Feb 27, 2018 2:04 am, edited 1 time in total.
Re: SDMMC 1-line mode, free-up unused pins
Are you talking about the Arduino version? If so you should post in Arduino forum.
Re: SDMMC 1-line mode, free-up unused pins
No. Straight C code, using latest ESP IDF.WiFive wrote:Are you talking about the Arduino version? If so you should post in Arduino forum.
Re: SDMMC 1-line mode, free-up unused pins
Do you set host.flags = SDMMC_HOST_FLAG_1BIT and slot_config.width = 1 ?
Re: SDMMC 1-line mode, free-up unused pins
Yes.WiFive wrote:Do you set host.flags = SDMMC_HOST_FLAG_1BIT?
NoWiFive wrote:and slot_config.width = 1 ?
That fixed it. Best 1 line (pun intended) fix ever. Many thanks for the quick assistance.
So, code for 1 bit SDCARD is:
Code: Select all
sdmmc_host_t host = SDMMC_HOST_DEFAULT();
// this tells SD host to keep using 1-line bus mode
host.flags = SDMMC_HOST_FLAG_1BIT;
sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT();
// this tells the driver to only initialize 1 data line
slot_config.width = 1;
P.S. This thread (from last year) seems relevant as well:
viewtopic.php?t=3091
Who is online
Users browsing this forum: No registered users and 105 guests