I am having issues related to the SMIF block and using it to access a QSPI flash. I am using a PSoC 6 (part number CY9C6247BZI-D54) on a custom board. We are using a Micron flash (part MT25QU512ABB8E12). The project is in ModusToolbox 1.1.
The behavior that I'm seeing is that memory reads do not seem to work reliably. I know _something_ is happening with the buffer, because the values within it change to all 0x00. However, that isn't the expected data. Sometimes, adding an additional delay after the call to ReadMemory() allows the data to reach that buffer, but this doesn't always work.
My project has a custom .cymem file I wrote, based on the S25FL512 .cymem file that the dev board uses. In doing so, I specified read and write commands that are specific for quad data width use, eliminating the need to call quad-enable.
I used the smif_mem.c/h files from the SMIF sample project for ModusToolbox (CE220823_PSoC6_SMIFMemWriteAndRead) as a base and modified them from there. As I mentioned, I no longer need to set a quad enable register. I also removed a few status register reads in ReadMemory, because they can't really show much on a read. In WriteMemory, I added a timeout to the reading the busy flag in the register, reads to both relevant status registers and checks of those values after a write. I also added the ability for it to retry a write, but I've never seen this actually occur.
In use, WriteMemory() seems to work, but ReadMemory() consistently returns with 0x00 in allocated buffer. However, the WriteMemory() is hard to check without an accompanying ReadMemory() to check data against. Behavior I have noticed sometimes is that a call to ReadMemory() will return and have 0x00 in the rxBuffer, and then a later read of that buffer shows something different. My assumption from this is that the busy check allows a read transaction to be "done" before the data arrives. However, this may not be the case.
What I want to know is this: Has anybody gotten a flash device that isn't on the SMIF Configuration tool dropdown to work consistently? What did you do to get that set up and working properly? Do you have to add any delay after a ReadMemory? I went ahead and attached to this my .cymem file and my modified smif_mem.c file in case that helps anybody get some insight into what I'm experiencing here.