2174729_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2174729_en-US

2174729_en-US

Cannot configure two NOR flashes on single FlexSpi in Zephyr
Hi,
I am working with a board based on i.mx RT1050 board. There are two NOR flashes connected to two banks of the flexspi. I am also using the bank 1 for XIP booting. It works fine when I only use one flash. But when I add the second flash, I run into a problem that seems like there is insufficient space for LUT. My two flashes are w25q128 and w25q64 connected to flexspi Port A1 and B1 respectively.
 
This is my configuration in the overlay file.
 
/ {
    chosen {
        zephyr,flash-controller = &w25q128jv;
        zephyr,flash = &w25q128jv;
        zephyr,code-partition = &slot0_partition;
    };
};
 
&flexspi {
    status = "okay";

    rx-clock-source = <1>;
    pinctrl-0 = <&pinmux_flexspi1>;
    pinctrl-names = "default";

    reg = <0x402a8000 0x4000>, <0x60000000 DT_SIZE_M(64)>;
    /delete-node/ is25wp064@0;

    w25q128jv: w25q128jv@0 {
        compatible = "nxp,imx-flexspi-nor";
        size = ;
        reg = <0>;
        spi-max-frequency = <104000000>;
        status = "okay";
        jedec-id = [ef 70 18];
        erase-block-size = ;
        write-block-size = <16>;
        enter-4byte-addr = <0>;

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

            boot_partition: partition@0 {
                label = "mcuboot";
                reg = <0x00000000 DT_SIZE_K(256)>;
            };

            /* Adjusted slot sizes for 16MB total */
            slot0_partition: partition@20000 {
            label = "image-0";
            reg = <0x00040000 (DT_SIZE_M(3) + DT_SIZE_K(512))>; 
            };

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

            storage_partition: partition@620000 {
            label = "storage";
            reg = <0x00620000 (DT_SIZE_M(1) - DT_SIZE_K(768))>;  
            };
        };
    };


    w25q64jv: w25q64jv@2 {
        compatible = "nxp,imx-flexspi-nor";
        size = ;      /* 8MB (64Mbit) flash */
        reg = <2>;                     /* FlexSPI B */
        spi-max-frequency = <104000000>;
        status = "okay";
        jedec-id = [ef 40 17];        /* Winbond W25Q64JV JEDEC ID */
        erase-block-size = ;
        write-block-size = <16>;

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

            data_partition: partition@0 {
                label = "data-storage";
                reg = <0x00000000 DT_SIZE_M(8)>;
            };
        };
    }; 


};
 
And the pinmux is,
 
&pinctrl {
    pinmux_flexspi1: pinmux_flexspi1 {
        group_a {
            pinmux = <&iomuxc_gpio_sd_b1_06_flexspi_a_ss0_b>,
                     <&iomuxc_gpio_sd_b1_07_flexspi_a_sclk>,
                     <&iomuxc_gpio_sd_b1_08_flexspi_a_data0>,
                     <&iomuxc_gpio_sd_b1_09_flexspi_a_data1>,
                     <&iomuxc_gpio_sd_b1_10_flexspi_a_data2>,
                     <&iomuxc_gpio_sd_b1_11_flexspi_a_data3>;
            drive-strength = "r0-6";
            slew-rate = "fast";
            nxp,speed = "200-mhz";
            input-enable;
        };

        group_b {
            pinmux = <&iomuxc_gpio_sd_b1_03_flexspi_b_data0>,
                     <&iomuxc_gpio_sd_b1_02_flexspi_b_data1>,
                     <&iomuxc_gpio_sd_b1_01_flexspi_b_data2>,
                     <&iomuxc_gpio_sd_b1_00_flexspi_b_data3>,
                     <&iomuxc_gpio_sd_b1_04_flexspi_b_sclk>,
                     <&iomuxc_gpio_sd_b1_05_flexspi_b_ss0_b>;
            drive-strength = "r0-6";
            slew-rate = "fast";
            nxp,speed = "200-mhz";
            input-enable;
        };
    };
 
 
During bootup the program gets struck in this while loop,
 
if (flash_flexspi_nor_probe(data)) {
 if (memc_flexspi_is_running_xip(&data->controller)) {
 /* We can't continue from here- the LUT stored in
 * the FlexSPI will be invalid so we cannot XIP.
 * Instead, spin here
 */
while (1) {
 /* Spin */
 }
 }
LOG_ERR("SFDP probe failed");
return -EIO;
 }
 
 
When I debugged it step-by -step, it seems to me each flash device uses up 40-48 space in LUT. Therefore having two flashes makes it so that it exceeds the maximum LUT that is 64.
 
Am I doing something wrong? What can I do to make this work
i.MXRT 105xRe: Cannot configure two NOR flashes on single FlexSpi in Zephyr

I understand that you are using the two flashes independently, not in parallel mode. You can reserve the LUT for the flash used for XIP and use IP commands to access the other flash. Another option is to recycle the LUT for two flash, as the difference of both is the size, and disable SFDP for the second flash.

BR,
Omar

Re: Cannot configure two NOR flashes on single FlexSpi in Zephyr

Hi,

I am facing the same issue.

Could you please tell me how you solved your problem. I just need to store data in the second flash memory. How can I disable XIP for the second flash only ?

Thank you,

Best Regards,

Adrien Cléris

Tags (1)
No ratings
Version history
Last update:
2 weeks ago
Updated by: