Generic serial flash interface can't WR/RW past certain address limit
I'm using a Cyclone 10LP and the flash is a Cypress S25FL256S. I've gotten familiar with reading and writing using the GSFI module but having a problem accessing the address past byte address 0x0001FFFF (Avalon memory address x07FFF). I'm using 4-byte addressing on all commands (Sector erase, write, and read) but when I try to read back the data written to 0x00020000 (Avalon memory 0x08000), I read back all 0's. Not sure if this is a limitation of the Cyclone 10LP or if I'm using the correct commands or not, both 3-byte and 4-byte commands result in the same behaviour. If I use address 0x0 to 0x0001FFFF the read and write operations work fine. Worst case this may be a damaged flash device.
Found the issue, the state machine was passing the 22-bit RSU addressing to the erase command instead of the 32-bit byte address, so the address that was being used to erase was pointed to almost half of where we needed it to be.