cancel
Showing results for 
Search instead for 
Did you mean: 

Zephyr STM32H7S XSPI SFDP failed with 0xFFFFFFFF magic id

kcm1
Associate

I am working with a custom board that uses the STM32H7S38T chip.

I am trying to use the SPI flash example from Zephyr to write to and read from the BY25Q16ES NOR flash. I am using the XSPI interface in normal SPI mode.

I can read out the JEDEC ID (0x9F) as 0x684015, which matches the value given in the datasheet.

kcm1_0-1770735295486.png

 

When reading the SFDP (0x5A), the MISO is pulled high after the dummy cycles.

kcm1_1-1770735351156.png

Have I overlooked something? The flash datasheet clearly states that the SFDP is available.

Zephyr Debug output:

-------------------------------------

[00:00:00.000,000] <dbg> flash_stm32h7: stm32h7_flash_init: Flash initialized. BS: 32
[00:00:00.000,000] <dbg> flash_stm32h7: stm32h7_flash_init: Block 0: bs: 8192 count: 8
[00:00:00.000,000] <dbg> flash_stm32_xspi: flash_stm32_xspi_init: XSPI Init'd
[00:00:00.100,000] <dbg> flash_stm32_xspi: flash_stm32_xspi_init: Reset Mem (SPI/STR)
[00:00:00.100,000] <dbg> flash_stm32_xspi: HAL_XSPI_StatusMatchCallback: Status Match cb
[00:00:00.100,000] <dbg> flash_stm32_xspi: flash_stm32_xspi_init: Mem Ready (SPI/STR)
[00:00:00.101,000] <dbg> flash_stm32_xspi: stm32_xspi_read_jedec_id: Jedec ID = [68 40 15]
[00:00:00.101,000] <inf> flash_stm32_xspi: OSPI flash config is SPI|DUAL|QUAD / STR
[00:00:00.101,000] <inf> flash_stm32_xspi: Read SFDP from externalFlash
[00:00:00.101,000] <err> flash_stm32_xspi: SFDP magic ffffffff invalid
*** Booting Zephyr OS build v4.3.0 ***
xspi-nor-flash@0: device not ready.

-------------------------------------

I also added the Saleae Logic trace as ZIP to the appendix.

Here is my DTS for the XSPI:

&xspi1 {
	pinctrl-0 = <&xspim_p1_clk_po4 &xspim_p1_ncs1_po0
		     &xspim_p1_io0_pp0 &xspim_p1_io1_pp1
		     &xspim_p1_io2_pp2 &xspim_p1_io3_pp3>;
	pinctrl-names = "default";

	status = "okay";
	// ssht-enable;
	// dlyb-bypass;

	BY25Q16ESTIG: xspi-nor-flash@0 {
		compatible = "st,stm32-xspi-nor";
		reg = <0>;
		size = <DT_SIZE_M(2)>; /* 16Mbits */
		ospi-max-frequency = <DT_FREQ_M(1)>;
		spi-bus-width = <XSPI_SPI_MODE>;
		data-rate = <XSPI_STR_TRANSFER>;
		// four-byte-opcodes;
		// writeoc = "PP_1_1_4";
		// writeoc = "PP";
		status = "okay";

		// jedec-id = [68 40 15];
		// quad-enable-requirements = "S2B1v1";

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			slot0_partition: partition@0 {
				label = "image-0";
				reg = <0x00000000 DT_SIZE_M(1)>;
			};

			slot1_partition: partition@100000 {
				label = "image-1";
				reg = <0x00100000 DT_SIZE_M(1)>;
			};

			// scratch_partition: partition@100000 {
			// 	label = "image-scratch";
			// 	reg = <0x00100000 DT_SIZE_K(64)>;
			// };

			// storage_partition: partition@110000 {
			// 	label = "storage";
			// 	reg = <0x00110000 DT_SIZE_K(64)>;
			// };
		};
	};
};

 

0 REPLIES 0