RT-Thread SPI Flash 自动挂载后无法用ls 列出问题

通过下面代码

#include <rtthread.h>
#include "spi_flash.h"
#include "spi_flash_sfud.h"
#include "drv_spi.h"

#if defined(BSP_USING_SPI_FLASH)

static int rt_hw_spi_flash_init(void)
{
    __HAL_RCC_GPIOB_CLK_ENABLE();
    rt_hw_spi_device_attach("spi2", "spi20", GPIOB, GPIO_PIN_9);

    if (RT_NULL == rt_sfud_flash_probe("W25Q64", "spi20"))
    {
        return -RT_ERROR;
    }    

    return RT_EOK;
}
INIT_COMPONENT_EXPORT(rt_hw_spi_flash_init);
#endif

开启SPI Flash功能支持后

还需要在menucofig

开启自动挂载表功能

     -*- Using device virtual file system                             
     [*]   Using working directory                                    
     (2)   The maximal number of mounted file system                  
     (2)   The maximal number of file system type                     
     (16)  The maximal number of opened files                         
     [*]   Using mount table for file system                          
     [*]   Enable elm-chan fatfs                                      
             elm-chan's FatFs, Generic FAT Filesystem Module  --->    
     -*-   Using devfs for device objects                             
     [ ]   Enable ReadOnly file system on flash                       
     [ ]   Enable RAM file system                                     
     [ ]   Enable UFFS file system: Ultra-low-cost Flash File System  
     [ ]   Enable JFFS2 file system                                   
     [ ]   Using NFS v3 client file system                            
                                                                      

开启这个功能后,在shell终端需要用SF Probe 命令后才能用ls列表出来,不然调到芯片状态查询死循环出不来。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

aping_cs_dn

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值