Skip to content

Commit

Permalink
[bsp][nxp]修改 drv_filesystem_spi_flash 驱动 (RT-Thread#8811)
Browse files Browse the repository at this point in the history
Co-authored-by: yandld <[email protected]>
Co-authored-by: Meco Man <[email protected]>
  • Loading branch information
3 people authored Apr 19, 2024
1 parent de32f35 commit cd77f98
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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;
}

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

Expand Down

0 comments on commit cd77f98

Please sign in to comment.