[bsp][nxp]修改 drv_filesystem_spi_flash 驱动 (#8811)

Co-authored-by: yandld <1453363089@qq.com>
Co-authored-by: Meco Man <920369182@qq.com>
This commit is contained in:
Abner 2024-04-19 09:00:49 +08:00 committed by GitHub
parent de32f35016
commit cd77f988cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 8 deletions

View File

@ -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;
}