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