Skip to content

Commit

Permalink
mmcsd: fix cmd6 timeout error when repeat calling
Browse files Browse the repository at this point in the history
Signed-off-by: wanggang26 <[email protected]>
  • Loading branch information
wanggang26 committed Aug 28, 2024
1 parent 263f895 commit 769fdec
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion drivers/mmcsd/mmcsd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ static int mmcsd_switch(FAR struct mmcsd_state_s *priv, uint32_t arg)
* CMD6(SWITCH) to set the PARTITION_ACCESS bits in the EXT_CSD
* register, byte[179].After that, master can use the Multiple Block
* read and write commands (CMD23, CMD18 and CMD25) to access the
* RPMB partition.
* specified partition.
* PARTITION_CONFIG[179](see 7.4.69)
* Bit[2:0] : PARTITION_ACCESS (before BOOT_PARTITION_ACCESS)
* User selects partitions to access:
Expand All @@ -1049,7 +1049,17 @@ static int mmcsd_switch(FAR struct mmcsd_state_s *priv, uint32_t arg)
* [2:0] Cmd Set
*/

int ret;

ret = mmcsd_transferready(priv);
if (ret != OK)
{
ferr("ERROR: Card not ready: %d\n", ret);
return ret;
}

mmcsd_sendcmdpoll(priv, MMCSD_CMD6, arg);
priv->wrbusy = true;
return mmcsd_recv_r1(priv, MMCSD_CMD6);
}

Expand Down

0 comments on commit 769fdec

Please sign in to comment.