Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QSPI NAND Flash driver question #50172

Closed
deyro opened this issue Sep 13, 2022 · 0 comments
Closed

QSPI NAND Flash driver question #50172

deyro opened this issue Sep 13, 2022 · 0 comments
Labels
Feature Request A request for a new feature

Comments

@deyro
Copy link

deyro commented Sep 13, 2022

Hello,

I am looking to interface a 2Gb NAND Flash MT29F02G01ABAGB with a STM32G473 processor. Previous we had a 256Gb NOR flash (MT25QL256) on the board which I was able to use with the flash_stm32_qspi.c driver and st,stm32-qspi-nor binding.

I tried using the same driver for the NAND flash but got the below error:
[00000000] <err> flash_stm32_qspi: SFDP magic 00000000 invalid

I debugged and found this section of the code fails in flash_stm32_qspi.c function flash_stm32_qspi_init

	uint32_t magic = jesd216_sfdp_magic(hp);

	if (magic != JESD216_SFDP_MAGIC) {
		LOG_ERR("SFDP magic %08x invalid", magic);
		return -EINVAL;
	}

My dtsi looks like this:

&quadspi {
    status = "okay";
    pinctrl-0 = <&quadspi_clk_pe10 &quadspi_bk1_ncs_pe11
                 &quadspi_bk1_io0_pe12 &quadspi_bk1_io1_pe13
                 &quadspi_bk1_io2_pe14 &quadspi_bk1_io3_pe15>;
    pinctrl-names = "default";
                   
	dmas = <&dmamux1 15 40 0x0000>;
	dma-names = "tx_rx";
	
	mt29f2g01abagdwb: mt29f2g01abagdwb@0 {
		compatible = "st,stm32-qspi-nor";
        label = "MT29F2G01ABAGDWB";
        reg = <0>;
        qspi-max-frequency = <170000000>;
        size = <DT_SIZE_M(250*8)>;
        /*jedec-id = [20 BA 19];*/
        spi-bus-width = <4>;
        status = "okay";
        
		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;
			
			settings_partition: partition@0 {
				label = "test";
				reg = <0x00000000 DT_SIZE_M(4)>;
			};

			data_partition: partition@100000 {
				label = "data";
				reg = <0x00400000 DT_SIZE_M(246)>;
			};
		};
	};
};

My question is should the same driver work with the NAND flash? I did not find any NAND flash driver in zephyr.
I do not have much knowledge / experience with flash memories. How can I make this work?

Zephyr version 2.7.99
Host: Ubuntu 18
Hardware: Custom board with STM32G473QET

Thanks

@deyro deyro added the Feature Request A request for a new feature label Sep 13, 2022
@zephyrproject-rtos zephyrproject-rtos locked and limited conversation to collaborators Sep 13, 2022
@henrikbrixandersen henrikbrixandersen converted this issue into discussion #50187 Sep 13, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Feature Request A request for a new feature
Projects
None yet
Development

No branches or pull requests

1 participant