Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve support for eMMC cards #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions os/hal/src/hal_sdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,9 @@ bool _sdc_wait_for_transfer_state(SDCDriver *sdcp) {
uint32_t resp[1];

while (true) {
if (sdc_lld_send_cmd_short_crc(sdcp, MMCSD_CMD_SEND_STATUS,
sdcp->rca, resp) ||
MMCSD_R1_ERROR(resp[0])) {
/* Not checking CRC here according to JEDEC Standard No. 84-B51 6.6.2
so that this function can be used after High-speed mode selection */
if (sdc_lld_send_cmd_short(sdcp, MMCSD_CMD_SEND_STATUS, sdcp->rca, resp) || MMCSD_R1_ERROR(resp[0])) {
return HAL_FAILED;
}

Expand Down Expand Up @@ -723,6 +723,10 @@ bool sdcConnect(SDCDriver *sdcp) {
}
sdc_lld_set_data_clk(sdcp, clk);

if (HAL_SUCCESS != _sdc_wait_for_transfer_state(sdcp)) {
goto failed;
}

/* Block length fixed at 512 bytes.*/
if (sdc_lld_send_cmd_short_crc(sdcp, MMCSD_CMD_SET_BLOCKLEN,
MMCSD_BLOCK_SIZE, resp) ||
Expand Down