Skip to main content
Explorer
October 9, 2025
Solved

OSPI Muxed Dual Flash/HYPERRAM STM32U575 Devicetree Support

  • October 9, 2025
  • 1 reply
  • 178 views

I have been attempting to interface a STM32U575 mcu to a dual HYPERRAM/Flash memory set up in multiplexed mode as shown in the following image taken from the STM32 Octo-SPI AN5050 application note.

muxospistm32.png

I am trying to implement a POSIX based RTOS and have thus been trying to create this setup in my project devicetree as follows:

&octospi2 {
	pinctrl-0 = <&octospi_pins>;
	pinctrl-names = "default";
	status="okay";

	flash: ospi-nor-flash@0 {
		compatible = "st,stm32-ospi-nor";
		reg = <0>;
		size = <DT_SIZE_M(512)>;
		ospi-max-frequency = <DT_FREQ_M(50)>;
		spi-bus-width = <OSPI_OPI_MODE>;
		data-rate = <OSPI_STR_TRANSFER>;
		status = "okay";
	};

	hram: ospi-nor-flash@1 {
		compatible = "st,stm32-ospi-nor";
		reg = <1>;
		size = <DT_SIZE_M(512)>;
		ospi-max-frequency = <DT_FREQ_M(50)>;
		spi-bus-width = <OSPI_OPI_MODE>;
		data-rate = <OSPI_DTR_TRANSFER>;
		status = "okay";
	};
};

and I have also tried:

&octospi2 {
	pinctrl-0 = <&octospi2_pins>;
	pinctrl-names = "default";
	status="okay";

	flash: ospi-nor-flash@0 {
		compatible = "st,stm32-ospi-nor";
		reg = <0>;
		size = <DT_SIZE_M(512)>;
		ospi-max-frequency = <DT_FREQ_M(50)>;
		spi-bus-width = <OSPI_OPI_MODE>;
		data-rate = <OSPI_STR_TRANSFER>;
		status = "okay";
	};
};

&octospi1 {
 pinctrl-0 = <&octospi1_pins>;
	pinctrl-names = "default";
	status="okay";

	hram: ospi-nor-flash@1 {
		compatible = "st,stm32-ospi-nor";
		reg = <1>;
		size = <DT_SIZE_M(512)>;
		ospi-max-frequency = <DT_FREQ_M(50)>;
		spi-bus-width = <OSPI_OPI_MODE>;
		data-rate = <OSPI_DTR_TRANSFER>;
		status = "okay";
	};
};

but both configurations have returned a "__device_dts_ord" error with a device number that points to the second memory device that I am instantiating. I have confirmed that both of these memory devices work when set up individually by merely commenting out the other device in the device tree. I have also confirmed that it seems this configuration is valid when set up in the STM32CubeIDE. I wanted to confirm that there wasn't something obvious that I'm missing?

    This topic has been closed for replies.
    Best answer by KDJEM.1

    Hello @quoqer3452 and welcome to the community;

     

    Could you please share the memories references.

    In what mode are OCTOSPI1 and OCTOSPI2 configured? HyperBus Multiplexed or OCTOSPI Multiplexed?

    Could 

    When the multiplexed mode is set, the OCTOSPIs are time-multiplexed over the same bus. 

    In AN5050 example the HyperBus Multiplexed mode is used for HyperRAM and HyperFlash memories.

     

    Thank you.

    Kaouthar

     

    1 reply

    KDJEM.1Answer
    Technical Moderator
    October 28, 2025

    Hello @quoqer3452 and welcome to the community;

     

    Could you please share the memories references.

    In what mode are OCTOSPI1 and OCTOSPI2 configured? HyperBus Multiplexed or OCTOSPI Multiplexed?

    Could 

    When the multiplexed mode is set, the OCTOSPIs are time-multiplexed over the same bus. 

    In AN5050 example the HyperBus Multiplexed mode is used for HyperRAM and HyperFlash memories.

     

    Thank you.

    Kaouthar