I’m having an issue using QSPI flash with NRF Connect SDK 3.1.1. I have two PCB versions with nRF52840 MCUs — one uses the W25Q128JVEM chip and the other uses the W25Q128JVPIQ (both are wired with Nordic’s recommended QSPI GPIO configuration). The JVEM version works correctly, but for some reason the JVPIQ version doesn’t (the flash is initialized, but nothing can be written to it).
The only difference between the chips is the value of the QE (Quad Enable) register: JVEM has it set to 0 by default, while JVPIQ has it set to 1. When I use nrfjprog from the command line, I can write to and read from the flash before flashing my own firmware to the NRF. But after flashing my software, the flash becomes unreadable — all values are returned as BB.
What changes should I make in the Device Tree (DT) to get the JVPIQ chip working?
Working DT for W25Q128JVEM:
w25q128: w25q128_0@0 {
compatible = "nordic,qspi-nor";
reg = <0>;
sck-frequency = <24000000>; // 32 MHz is the max supported by nRF52840
jedec-id = [ef 70 18];
readoc = "read4io";
writeoc = "pp4o";
size = <DT_SIZE_M(128)>; // 128Mb
has-dpd;
t-enter-dpd = <3000>;
t-exit-dpd = <3000>;
};
Jedec id is different too (PIQ has ef 40 18).
I tried both my own code and the spi_flash sample — both behave the same way. The output from the spi_flash:
00> *** Booting nRF Connect SDK v3.1.1-e2a97fe2578a *** 00> *** Using Zephyr OS v4.1.99-ff8f0c579eeb *** 00> [00:00:00.251,403] <inf> spi_flash_test: 00> w25q128_0@0 SPI flash testing 00> 00> [00:00:00.251,403] <inf> spi_flash_test: ========================== 00> 00> [00:00:00.251,403] <inf> spi_flash_test: 00> Perform test on single sector 00> [00:00:00.251,434] <inf> spi_flash_test: 00> Test 1: Flash erase 00> 00> [00:00:00.261,749] <inf> spi_flash_test: Flash erase succeeded! 00> 00> [00:00:00.261,779] <inf> spi_flash_test: 00> Test 2: Flash write 00> 00> [00:00:00.261,779] <inf> spi_flash_test: Attempting to write 4 bytes 00> 00> [00:00:00.261,932] <inf> spi_flash_test: Data read does not match data written!! 00> 00> [00:00:00.261,962] <inf> spi_flash_test: 000ff000 wrote 55 read ff MISMATCH 00> 00> [00:00:00.262,023] <inf> spi_flash_test: 000ff001 wrote aa read ff MISMATCH 00> 00> [00:00:00.262,054] <inf> spi_flash_test: 000ff002 wrote 66 read ff MISMATCH 00> 00> [00:00:00.262,084] <inf> spi_flash_test: 000ff003 wrote 99 read ff MISMATCH 00>
Tiit