summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2020-11-24 23:30:20 +0800
committerGitHub <[email protected]>2020-11-24 23:30:20 +0800
commitd97a44526cdf93dde6e5cf08b9e760ca281aad78 (patch)
tree03bbe0686ec0c7c283b8181e8e5cc20c4455c00b /bsp
parent1d79a2ea82d3c85ab6669603ac8f05f7422c6303 (diff)
parent287e3c558216a2015cd5a8436603c229921f9bb0 (diff)
Merge pull request #4015 from whj4674672/fix
[fix] fix sdio non-aligned access problem
Diffstat (limited to 'bsp')
-rw-r--r--bsp/stm32/libraries/HAL_Drivers/drv_sdio.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_sdio.c b/bsp/stm32/libraries/HAL_Drivers/drv_sdio.c
index 290c89e159..5e6d4f6934 100644
--- a/bsp/stm32/libraries/HAL_Drivers/drv_sdio.c
+++ b/bsp/stm32/libraries/HAL_Drivers/drv_sdio.c
@@ -7,7 +7,8 @@
* Date Author Notes
* 2018-06-22 tyx first
* 2018-12-12 balanceTWK first version
- * 2019-06-11 WillianChan Add SD card hot plug detection
+ * 2019-06-11 WillianChan Add SD card hot plug detection
+ * 2020-11-09 whj4674672 fix sdio non-aligned access problem
*/
#include "board.h"
@@ -366,7 +367,7 @@ static void rthw_sdio_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *r
if (req->cmd != RT_NULL)
{
- memset(&pkg, 0, sizeof(pkg));
+ rt_memset(&pkg, 0, sizeof(pkg));
data = req->cmd->data;
pkg.cmd = req->cmd;
@@ -382,7 +383,7 @@ static void rthw_sdio_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *r
pkg.buff = cache_buf;
if (data->flags & DATA_DIR_WRITE)
{
- memcpy(cache_buf, data->buf, size);
+ rt_memcpy(cache_buf, data->buf, size);
}
}
}
@@ -391,13 +392,13 @@ static void rthw_sdio_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *r
if ((data != RT_NULL) && (data->flags & DATA_DIR_READ) && ((rt_uint32_t)data->buf & (SDIO_ALIGN_LEN - 1)))
{
- memcpy(data->buf, cache_buf, data->blksize * data->blks);
+ rt_memcpy(data->buf, cache_buf, data->blksize * data->blks);
}
}
if (req->stop != RT_NULL)
{
- memset(&pkg, 0, sizeof(pkg));
+ rt_memset(&pkg, 0, sizeof(pkg));
pkg.cmd = req->stop;
rthw_sdio_send_command(sdio, &pkg);
}