Skip to content

Conversation

@SpooniSpoon
Copy link
Contributor

@SpooniSpoon SpooniSpoon commented Apr 29, 2021

dts/arm: stm32h7: quadspi added

quadspi added to device tree of stm32h7 family.

validated with samples/subsys/fs/littlefs

Signed-off-by: Raphael Löffel [email protected]

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SpooniSpoon have you been able to validate that this is sufficient to use quadspi on H7 ?

@zephyrbot zephyrbot requested a review from ABOSTM April 29, 2021 13:48
@SpooniSpoon SpooniSpoon changed the title quadspi added to device tree of stm32h7 familie dts/arm: stm32h7: quadspi added Apr 29, 2021
@SpooniSpoon
Copy link
Contributor Author

I used samples/subsys/fs/littlefs without DMA support for validation of the dts add-on.

@erwango
Copy link
Member

erwango commented Apr 29, 2021

I used samples/subsys/fs/littlefs without DMA support for validation of the dts add-on.

Nice! Was it done on an in tree board ?
If yes, would you be able to push related changes (so it can demonstrate how to use it and we could be able to at least compile the driver with H7 configuration in CI) ?

@SpooniSpoon
Copy link
Contributor Author

Nice! Was it done on an in tree board ?
If yes, would you be able to push related changes (so it can demonstrate how to use it and we could be able to at least compile the driver with H7 configuration in CI) ?

Unfortunately not, I am using a custom board with a W25Q128JVSIM QSPI device.

@erwango
Copy link
Member

erwango commented Apr 30, 2021

Unfortunately not, I am using a custom board with a W25Q128JVSIM QSPI device.

Ok. From what I can see we have an in-tree board with quad-spi memory (STM32H747I-DISCO),
so we'd need to enable on this board.
Did it work out of the box by just adding this node ? (board configuration put aside)

@SpooniSpoon
Copy link
Contributor Author

Ok. From what I can see we have an in-tree board with quad-spi memory (STM32H747I-DISCO),
so we'd need to enable on this board.
Did it work out of the box by just adding this node ? (board configuration put aside)

First of all I had to undefined the DMA node within the QSPI node. After that I still had some compiler errors related to the MDMA. As a quick fix I added select USE_STM32_HAL_MDMA to the file Kconfig.stm32_qspi. The board configuration I used is

&quadspi {
    pinctrl-0 = <&quadspi_clk_pb2
                 &quadspi_bk1_ncs_pb10
                 &quadspi_bk1_io0_pd11
                 &quadspi_bk1_io1_pd12
                 &quadspi_bk1_io2_pe2
                 &quadspi_bk1_io3_pd13>;
//    dmas = <&dma1 5 5 0x0000 0x03>;
//    dma-names = "tx_rx";

    status = "okay";

    w25q128jvsim: qspi-nor-flash@0 {
        compatible = "st,stm32-qspi-nor";
        label = "W25Q128JVSIM";
        reg = <0>;
        qspi-max-frequency = <100000000>;
        /* 128 Megabits = 16 Megabytes */
        size = <0x8000000>;

        status = "okay";

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

            fs_storage_partition: partition@0 {
                label = "storage";
                reg = <0x00000000 DT_SIZE_M(16)>;
            };
        };
    };
};

@erwango
Copy link
Member

erwango commented Apr 30, 2021

First of all I had to undefined the DMA node within the QSPI node.

This is not strictly an issue as we can have QPSI working w/o dma.
We'd have QSPI supported on H7 with the limitation that DMA is not yet supported.
But it would need to be clearly specified and documented. Typically generate a dedicated error message
in case one would try to enable DMA with QSPI on H7.

After that I still had some compiler errors related to the MDMA. As a quick fix I added select USE_STM32_HAL_MDMA to the file Kconfig.stm32_qspi.

Likely this is because QSPI support requires MDMA enabling in Cube H7 HAL, we can live with that,
but impacts of having DMA required in HAL and disabled in Zephyr would need a minimum investigation and information to users.

In any case we'd need these both points to be addressed and provided as part of this change so others don't face and report the same issues.

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide related drivers changes.

@SpooniSpoon
Copy link
Contributor Author

But it would need to be clearly specified and documented.

Where is the right place for documentation in the related yml file of the qspi binding or in the help section of the related Kconfig file?

@erwango
Copy link
Member

erwango commented Apr 30, 2021

But it would need to be clearly specified and documented.

Where is the right place for documentation in the related yml file of the qspi binding or in the help section of the related Kconfig file?

I'd say both Kconfig and yaml.
Also, in the code directly, by generating a dedicated error message in case one would try to enable DMA with QSPI on H7.

@github-actions github-actions bot added the area: Devicetree Binding PR modifies or adds a Device Tree binding label May 3, 2021
@FRASTM
Copy link
Contributor

FRASTM commented May 6, 2021

commit message drivers/falsh --> drivers/flash

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix commit message for first commit ("quadspi added to device tree of stm32h7 familie")

quadspi added to device tree of stm32h7 family.

validated with samples/subsys/fs/littlefs

Signed-off-by: Raphael Löffel <[email protected]>
@erwango erwango added this to the v2.7.0 milestone May 10, 2021
whitespace issue fixed to pass compliance checks.

Signed-off-by: Raphael Löffel <[email protected]>
Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more comment.
Also please squash your 2 commits.

select FLASH_HAS_PAGE_LAYOUT
select DMA if $(DT_STM32_QUADSPI_HAS_DMA)
select USE_STM32_HAL_DMA if $(DT_STM32_QUADSPI_HAS_DMA)
select USE_STM32_HAL_MDMA if !$(DT_STM32_QUADSPI_HAS_DMA)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed logic is not correct.
User always has the possibility of not using DMA wth QSPI, even if supported on the series in use.
With this change, MDMA is systematically enabled in this case.

Copy link
Contributor Author

@SpooniSpoon SpooniSpoon May 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MDMA is always required by the STM32 QSPI HAL driver also without DMA support. As a workaround to avoid compiler errors I enabled the MDMA HAL driver if DMA support is disabled.

Copy link
Member

@erwango erwango May 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This maybe the case on H7, but not on all STM32 series.
You can have a try by doing the folloing change in disco_l475_iot1.dts:

 &quadspi {
 	pinctrl-0 = <&quadspi_clk_pe10 &quadspi_ncs_pe11
 		     &quadspi_bk1_io0_pe12 &quadspi_bk1_io1_pe13
 		     &quadspi_bk1_io2_pe14 &quadspi_bk1_io3_pe15>;
-	dmas = <&dma1 5 5 0x0000 0x03>;
-	dma-names = "tx_rx";
+	//dmas = <&dma1 5 5 0x0000 0x03>;
+	//dma-names = "tx_rx";
 

Then run:

west build -b  disco_l475_iot1 samples/drivers/flash_shell

@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Jul 14, 2021
@cfriedt
Copy link
Member

cfriedt commented Jul 16, 2021

@SpooniSpoon - please rebase and address the last comment

@github-actions github-actions bot removed the Stale label Jul 17, 2021
@cfriedt
Copy link
Member

cfriedt commented Sep 2, 2021

@SpooniSpoon , @erwango - is this one still moving forward?

@cfriedt cfriedt modified the milestones: v2.7.0, v3.0.0 Sep 20, 2021
@erwango
Copy link
Member

erwango commented Nov 3, 2021

@SpooniSpoon Do you plan to continue this PR ?

@github-actions
Copy link

github-actions bot commented Jan 3, 2022

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Jan 3, 2022
Copy link
Contributor

@nvlsianpu nvlsianpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar patch is one of parts of #40859

@github-actions github-actions bot closed this Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Devicetree Binding PR modifies or adds a Device Tree binding area: Devicetree platform: STM32 ST Micro STM32 Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants