From cd77f988cd0182f18aae59892119ec908d2e1864 Mon Sep 17 00:00:00 2001 From: Abner <162091683+LiKunZh@users.noreply.github.com> Date: Fri, 19 Apr 2024 09:00:49 +0800 Subject: [PATCH] =?UTF-8?q?[bsp][nxp]=E4=BF=AE=E6=94=B9=20drv=5Ffilesystem?= =?UTF-8?q?=5Fspi=5Fflash=20=E9=A9=B1=E5=8A=A8=20(#8811)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: yandld <1453363089@qq.com> Co-authored-by: Meco Man <920369182@qq.com> --- .../board/ports/drv_filesystem_spi_flash.c | 17 +++++++++-------- 1 file 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 de993e45bf6..be61835796c 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 + #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 @@ -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; }