Skip to content

Commit e9e8b05

Browse files
LiKunZhyandldmysterywolf
authored andcommitted
[bsp][nxp]修改 drv_filesystem_spi_flash 驱动 (#8811)
Co-authored-by: yandld <[email protected]> Co-authored-by: Meco Man <[email protected]>
1 parent 87cfd58 commit e9e8b05

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

bsp/nxp/mcx/mcxn/frdm-mcxn947/board/ports/drv_filesystem_spi_flash.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@
1818
#include "dfs.h"
1919
#include "dfs_file.h"
2020

21+
#define DBG_TAG "spi-flash"
22+
#define DBG_LVL DBG_INFO
23+
#include <rtdbg.h>
24+
2125
#if DFS_FILESYSTEMS_MAX < 4
2226
#error "Please define DFS_FILESYSTEMS_MAX more than 4"
2327
#endif
2428
#if DFS_FILESYSTEM_TYPES_MAX < 4
2529
#error "Please define DFS_FILESYSTEM_TYPES_MAX more than 4"
2630
#endif
27-
#if RT_DFS_ELM_MAX_SECTOR_SIZE == 512
28-
#define RT_DFS_ELM_MAX_SECTOR_SIZE 4096
29-
#endif
31+
32+
3033
#define DBG_TAG "app.filesystem_spi_flash"
3134
#define DBG_LVL DBG_INFO
3235
#include <rtdbg.h>
@@ -44,7 +47,7 @@ static int filesystem_mount(void)
4447

4548
if(!spi70)
4649
{
47-
rt_kprintf("spi sample run failed! can't find %s device!\n","spi7");
50+
LOG_W("spi sample run failed! can't find %s device!\n","spi7");
4851
return -RT_ERROR;
4952
}
5053

@@ -56,18 +59,16 @@ static int filesystem_mount(void)
5659

5760
/* legcy issue */
5861

59-
// rt_spi_bus_attach_device_cspin(spi70, W25Q64_SPI_DEVICE_NAME, W25Q64_SPI_BUS_NAME, 96, RT_NULL);
6062
rt_hw_spi_device_attach(W25Q64_SPI_BUS_NAME, W25Q64_SPI_DEVICE_NAME, 96);
6163

6264
if(RT_NULL == rt_sfud_flash_probe(W25Q64_SPI_FLASH_NAME, W25Q64_SPI_DEVICE_NAME))
6365
{
64-
rt_kprintf("Flash sfud Failed!\n");
66+
LOG_E("Flash sfud Failed!\n");
6567
return -RT_ERROR;
6668
}
67-
// dfs_mkfs("elm", "W25Q64_SPI_FLASH_NAME");
6869
if(dfs_mount(W25Q64_SPI_FLASH_NAME, "/", "elm", 0, 0))
6970
{
70-
rt_kprintf("dfs mount dev:%s failed!\n", W25Q64_SPI_FLASH_NAME);
71+
LOG_E("dfs mount dev:%s failed!\n", W25Q64_SPI_FLASH_NAME);
7172
return -RT_ERROR;
7273
}
7374

0 commit comments

Comments
 (0)