summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbner <[email protected]>2024-04-19 09:00:49 +0800
committerGitHub <[email protected]>2024-04-18 21:00:49 -0400
commitcd77f988cd0182f18aae59892119ec908d2e1864 (patch)
tree21c66ab35b0cf80674c00c283c45456809281634
parentde32f35016f6ae5f2b02848a934c638be3499cc0 (diff)
[bsp][nxp]修改 drv_filesystem_spi_flash 驱动 (#8811)
Co-authored-by: yandld <[email protected]> Co-authored-by: Meco Man <[email protected]>
-rw-r--r--bsp/nxp/mcx/mcxn/frdm-mcxn947/board/ports/drv_filesystem_spi_flash.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/bsp/nxp/mcx/mcxn/frdm-mcxn947/board/ports/drv_filesystem_spi_flash.c b/bsp/nxp/mcx/mcxn/frdm-mcxn947/board/ports/drv_filesystem_spi_flash.c
index de993e45bf..be61835796 100644
--- a/bsp/nxp/mcx/mcxn/frdm-mcxn947/board/ports/drv_filesystem_spi_flash.c
+++ b/bsp/nxp/mcx/mcxn/frdm-mcxn947/board/ports/drv_filesystem_spi_flash.c
@@ -18,15 +18,18 @@
#include "dfs.h"
#include "dfs_file.h"
+#define DBG_TAG "spi-flash"
+#define DBG_LVL DBG_INFO
+#include <rtdbg.h>
+
#if DFS_FILESYSTEMS_MAX < 4
#error "Please define DFS_FILESYSTEMS_MAX more than 4"
#endif
#if DFS_FILESYSTEM_TYPES_MAX < 4
#error "Please define DFS_FILESYSTEM_TYPES_MAX more than 4"
#endif
-#if RT_DFS_ELM_MAX_SECTOR_SIZE == 512
-#define RT_DFS_ELM_MAX_SECTOR_SIZE 4096
-#endif
+
+
#define DBG_TAG "app.filesystem_spi_flash"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
@@ -44,7 +47,7 @@ static int filesystem_mount(void)
if(!spi70)
{
- rt_kprintf("spi sample run failed! can't find %s device!\n","spi7");
+ LOG_W("spi sample run failed! can't find %s device!\n","spi7");
return -RT_ERROR;
}
@@ -56,18 +59,16 @@ static int filesystem_mount(void)
/* legcy issue */
-// rt_spi_bus_attach_device_cspin(spi70, W25Q64_SPI_DEVICE_NAME, W25Q64_SPI_BUS_NAME, 96, RT_NULL);
rt_hw_spi_device_attach(W25Q64_SPI_BUS_NAME, W25Q64_SPI_DEVICE_NAME, 96);
if(RT_NULL == rt_sfud_flash_probe(W25Q64_SPI_FLASH_NAME, W25Q64_SPI_DEVICE_NAME))
{
- rt_kprintf("Flash sfud Failed!\n");
+ LOG_E("Flash sfud Failed!\n");
return -RT_ERROR;
}
-// dfs_mkfs("elm", "W25Q64_SPI_FLASH_NAME");
if(dfs_mount(W25Q64_SPI_FLASH_NAME, "/", "elm", 0, 0))
{
- rt_kprintf("dfs mount dev:%s failed!\n", W25Q64_SPI_FLASH_NAME);
+ LOG_E("dfs mount dev:%s failed!\n", W25Q64_SPI_FLASH_NAME);
return -RT_ERROR;
}