Hello,
I am working on integrating a 4G-BIT Nand Flash, the W25N04KVZEIR with datasheet here, with a custom board equipped with an NRF52840. Currently, I am trying to just get the flash example in Zephyr working in quad mode with my custom board file. My eventual goal is to get a FAT file system running on the flash along with USB mass storage. My attempts to interface over QSPI have been largely unsuccessful, and I am hoping that someone could point me in the right direction.
The Nand flash I am working with should have support for pp4o and read4io, but I always get a mismatch error, as in the bits written don’t match the bits read. I am not sure if this is because the flash is not correctly running in quad mode, or if it is because there is some write protection enabled. As I understand it, the W25’s first register determines write/register protection and quad operation mode.
I am trying to use has-lock = <0x00>; in my boards dts in order to set these registers. I have also tried <0xff> but both of these have not fixed the error. The flash example does work with pp2o and read2io and no has-lock, but takes about 15 seconds to write and then read the bits, this was true even when the max frequency is set high. The following is the QSPI section in my custom board file:
And this is the config I have for the flash project:
I am a little at a loss of what to try next, and what exactly the quad-enable code or has-lock code is doing. At this point I have tried every combination of the quad-enable options and the has lock options (00, ff, or none) but none have been able to get the flash working in quad mode. Is there some way I could directly send commands during init?
Additional detail - The QSPI is wired in the standard recommended configuration, and the flash example is unmodified running in single_sector_test mode.
Any help or guidance is greatly appreciated, thank you!