您的位置:首页 > 新闻 > 热点要闻 > RT-Thread Studio与CubeMX联合编程之rtthread stm32h743的使用(十三)读取W25QXX系列flash的SFDP

RT-Thread Studio与CubeMX联合编程之rtthread stm32h743的使用(十三)读取W25QXX系列flash的SFDP

2025/1/8 0:39:25 来源:https://blog.csdn.net/weixin_42306014/article/details/142167405  浏览:    关键词:RT-Thread Studio与CubeMX联合编程之rtthread stm32h743的使用(十三)读取W25QXX系列flash的SFDP

1.我们要在rtthread studio 开发环境中建立stm32h743xih6芯片的工程。我们使用一块stm32h743及fpga的核心板完成相关实验,核心板如图:
在这里插入图片描述
在这里插入图片描述
2.建立工程的过程我们就描述了,我们这一节的内容建立在RT-Thread Studio与CubeMX联合编程之rtthread stm32h743的使用(十一)spi设备SFUD驱动的使用这一节的,所以我们继续往下。
我们要读取SFDP,先大概看下sfdp里面的内容:
在这里插入图片描述
3.细节如下:在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
4.以上是对SFDP内有用的9条信息的详细解释,我们打开工程,在如图sfud_cfg.h文件里定义#define RT_DEBUG_SFUD,这时候sfdp里面的信息就能打印看到。
在这里插入图片描述
5.我们编译下载程序看下打印效果:
在这里插入图片描述

[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud.c:871) The flash device manufacturer ID is 0xEF, memory type ID is 0x40, capacity ID is 0x17.
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:132) Check SFDP header is OK. The reversion is V1.5, NPN is 0.
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:175) Check JEDEC basic flash parameter header is OK. The table id is 0, reversion is V1.5, length is 16, parameter table pointer is 0x000080.
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:203) JEDEC basic flash parameter table info:
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:204) MSB-LSB  3    2    1    0
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:207) [0001] 0xFF 0xF9 0x20 0xE5
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:207) [0002] 0x03 0xFF 0xFF 0xFF
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:207) [0003] 0x6B 0x08 0xEB 0x44
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:207) [0004] 0xBB 0x42 0x3B 0x08
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:207) [0005] 0xFF 0xFF 0xFF 0xFE
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:207) [0006] 0x00 0x00 0xFF 0xFF
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:207) [0007] 0xEB 0x40 0xFF 0xFF
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:207) [0008] 0x52 0x0F 0x20 0x0C
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:207) [0009] 0x00 0x00 0xD8 0x10
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:215) 4 KB Erase is supported throughout the device. Command is 0x20.
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:234) Write granularity is 64 bytes or larger.
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:245) Target flash status register is non-volatile.
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:271) 3-Byte only addressing.
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:305) Capacity is 8388608 Bytes.
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:312) Flash device supports 4KB block erase. Command is 0x20.
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:312) Flash device supports 32KB block erase. Command is 0x52.
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud_sfdp.c:312) Flash device supports 64KB block erase. Command is 0xD8.
[09:09:12.495] [I/SFUD] Found a Winbond flash chip. Size is 8388608 bytes.
[09:09:12.495] [D/SFUD] (../rt-thread/components/drivers/spi/sfud/src/sfud.c:849) Flash device reset success.
[09:09:12.495] [I/SFUD] W25Q64 flash device initialized successfully.
[09:09:12.495] [I/SFUD] Probe SPI flash W25Q64 by SPI device spi10 success.

可以看到
manufacturer lD is 0xEF,memory type lD is 0x40, capacitylD is 0x17。
以下9行数据就是jesd206标准中的9行。
在这里插入图片描述
我们找一行看下
在这里插入图片描述
我们看到第二行的值是0X03FFFFFF=64megabits 表示容量为64Mbit和实际芯片容量一致。
链接: JESD206

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com