rt_sfud_flash_probe调用失败

发布于 2021-02-21 23:24:36

就是挂载SPI FLASH的时候失败,代码:

int rt_hw_spi_flash_init(void)
{
    int ret;
    
    __HAL_RCC_GPIOA_CLK_ENABLE();
    ret = rt_hw_spi_device_attach("spi1", "spi10", GPIOA, GPIO_PIN_4);
      if (ret != RT_EOK)
        {
           rt_kprintf("rt_hw_spi_device_attach failed! \n");
            return ret;
        }
        else
            {
           rt_kprintf("rt_hw_spi_device_attach succ! \n");
      }

    if (RT_NULL == rt_sfud_flash_probe("W25Q256", "spi10"))
    {
              rt_kprintf("rt_sfud_flash_probe failed! \n");
        return -RT_ERROR;
    }
        
    return RT_EOK;
}

INIT_COMPONENT_EXPORT(rt_hw_spi_flash_init);

打印的log:

> [22:55:52.505] 
 \ | /
- RT -     Thread Operating System
 / \     3.1.4 build Feb 21 2021
 2006 - 2019 Copyright by rt-thread team
rt_hw_spi_device_attach succ! 
[SFUD] (..\..\..\components\drivers\spi\sfud\src\骹ud.c:861) The flash device manufacturer ID is 0x00, memory type ID is 0x00, capacity ID is 0x00.
[SFUD] (..\..\..\components\drivers\spi\sfu鋅src\sfud_sfdp.c:122) Error: Check SFDP sig頰ture error. It's must be 50444653h('S' 'F' 'D' 'P').
跾FUD] Wa騨ing: Read SFDP paramet錼 header in鎜rmation fa閘ed. The W25Q256 is not support 蔈DEC SFDP.
[SFUD] Warning: This flash device is not found or not support.
[SFUD] Error: W25Q256 flash device is initialize fail.
ERROR: SPI flash probfailed by SPI device spi10.
rt_sfu鋉flash_probe failed! 
韘h >device         type         ref count
------ -------------------- ----------
spi10  SPI Device           0       
spi1   SPI Bus              0       
鮝rt3  Character Device     2       
pin    Miscellaneous Device 0

查看更多

关注者
0
被浏览
70
张世争
张世争 3 days ago

隐隐约约看到:

The flash device manufacturer ID is 0x00, memory type ID is 0x00, capacity ID is 0x00.

SPI Flash初始化失败了

4 个回答
yangjie
yangjie 3 days ago

硬件用的哪个spi? 是 spi1 吗?

OrangePeeeel
OrangePeeeel 2 days ago

image.png

这里勾选上了吗

Juggernaut
Juggernaut 2 days ago

问题解决了,是SPI FLASH一个pin的电阻问题,感谢各位关注帮助;

>  \ | /
- RT -     Thread Operating System
 / | \     3.1.4 build Feb 21 2021
 2006 - 2019 Copyright by rt-thread team
rt_hw_spi_device_attach succ! 
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud.c:861) The flash device manufacturer ID is 0xEF, memory type ID is 0x40, capacity ID is 0x19.
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:131) Check SFDP header is OK. The reversion is V1.0, NPN is 0.
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:173) Check JEDEC basic flash parameter header is OK. The table id is 0, reversion is V1.0, length is 9, parameter table pointer is *[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:203) JEDEC basic flash parameter table info:
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:204) MSB-LSB  3    2    1    0
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:206) [0001] 0xFF 0xF3 0x20 0xE5
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:206) [0002] 0x0F 0xFF 0xFF 0xFF
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:206) [0003] 0x6B 0x08 0xEB 0x44
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:206) [0004] 0xBB 0x42 0x3B 0x08
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:206) [0005] 0xFF 0xFF 0xFF 0xFE
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:206) [0006] 0x00 0x00 0xFF 0xFF
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:206) [0007] 0xEB 0x21 0xFF 0xFF
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:206) [0008] 0x52 0x0F 0x20 0x0C
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:206) [0009] 0x00 0x00 0xD8 0x10
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:215) 4 KB Erase is supported throughout the device. Command is 0x20.
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:234) Write granularity is 64 bytes or larger.
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:245) Target flash status register is non-volatile.
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:276) 3- or 4-Byte addressing.
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:305) Capacity is 33554432 Bytes.
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:311) Flash device supports 4KB block erase. Command is 0x20.
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:311) Flash device supports 32KB block erase. Command is 0x52.
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud_sfdp.c:311) Flash device supports 64KB block erase. Command is 0xD8.
[SFUD] Find a Winbond flash chip. Size is 33554432 bytes.
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud.c:840) Flash device reset success.
[SFUD] (..\..\..\components\drivers\spi\sfud\src\sfud.c:941) Enter 4-Byte addressing mode success.
[SFUD] W25Q256 flash device is initialize success.
[SFUD] Probe SPI flash W25Q256 by SPI device spi10 success.

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览