QSPI Flash memory configuration

Hello,

I have a nrf52840 project that uses an external flash over QSPI. My code works as expected with the PCA10056 devkit and the memory MX25R6435F (64 Mbit).
When I port the code to my custom PCB, which uses the memory MX25L25645G (256 Mbit), the same code works for addresses that are < 3 bytes length, but it fails to access bigger addresses. I.e. if I try to write to address 0x1000000, it will write to address 0, instead.

The MX25L25645G datasheet mentions that 4 bytes address mode needs to be enabled to access the higher addresses, so I suspect the flash driver (#include <zephyr/drivers/flash.h>) is not doing that.

My next step would be to check the driver implementation, but before I do that, I'd like to know what is the right way of solving this with Zephyr. This is my 1st Zephyr project and I'm not sure if I configured the memory correctly or I missed something.

In case I do need to change the driver, what's the best way of doing that? Just change the current code or create a new one? Guidance is appreciated.

This is the DTS configuration I'm using for the memory (I used the MX25R6435F as a base and changed the values accordingly).

qspi: qspi@40029000 
{
    compatible = "nordic,nrf-qspi";
    #address-cells = < 0x1 >;
    #size-cells = < 0x0 >;
    reg = < 0x40029000 0x1000 >, < 0x12000000 0x8000000 >;
    reg-names = "qspi", "qspi_mm";
    interrupts = < 0x29 0x1 >;
    status = "okay";
    pinctrl-0 = < &qspi_default >;
    pinctrl-1 = < &qspi_sleep >;
    pinctrl-names = "default", "sleep";
    mx25l25: mx25l25645g@0 
    {
        compatible = "nordic,qspi-nor";
        reg = < 0x0 >;
        writeoc = "pp4io";
        readoc = "read4io";
        sck-frequency = < 0x7a1200 >;
        jedec-id = [ C2 20 19 ];
        sfdp-bfp = [ E5 20 ... ];
        size = < 0x10000000 >;
        has-dpd;
        t-enter-dpd = < 0x2710 >;
        t-exit-dpd = < 0x88b8 >;
    };
};

Thank you!

Parents Reply Children
No Data
Related