05-17-2021, 06:38 PM
The MMC driver in the Linux kernel uses the SWITCH (CMD6) command. There are a few interesting C functions:
The slight trouble is that the results of the SWITCH (CMD6) command, in the current state of the MMC driver, are not directly available for debugging purposes. Regarding the issue I've originally described in this thread, my current "suspect" is the sd_set_current_limit() function, which may not properly handle all possible cases, i.e. all combinations of the MMC host capabilities and the microSD card requirements.
- mmc_sd_switch() – executes the SWITCH (CMD6) command
- mmc_read_switch() – saves some of the obtained microSD card parameters for later use
- sd_set_current_limit() – sets the current limit for the microSD card
The slight trouble is that the results of the SWITCH (CMD6) command, in the current state of the MMC driver, are not directly available for debugging purposes. Regarding the issue I've originally described in this thread, my current "suspect" is the sd_set_current_limit() function, which may not properly handle all possible cases, i.e. all combinations of the MMC host capabilities and the microSD card requirements.