Serial Flash Controller II not erasing


#1

Hi I am using an Arria 10 with Linux on the HPS. The EPCQ-L is my FPGA configuration device. I want to be able to update it through the HPS. I connected the avl_csr and the avl_mem from the Serial Flash Controller II Altera IP to the HPS’s lightweight hps2fpga bridge. I can read and write to the EPCQ, but I cannot write 1’s. In order to write 1’s I believe I need to erase sectors. This is where my problem occurs, I cannot seem to get the erase to work at all.
I feel like I am missing something minor that is causing it not to work. I am writing at the offset FLASH_MEM_OP 0x3 on avl_csr. I have tried different values, but I thought the easiest to test would be sector 0, which I wrote 0x00000002 to try to erase it. However, as mentioned before there is no change. If I write all 0s, no bits will flip to 1 until I reprogram the .jic file.
How can I start debugging this problem? (I am still pretty new to all of this)
I have also tried using ASMI II IP core, but I run into the same problem. I can read and write, but I cannot erase sectors.

Thank you


#2

I found the problem. I am using Serial Flash Controller II and my main problem was not being able to erase. The problem occurs because there is a write enable on the FLASH_MEM_OP register. A 0x4 or bit 3 needs to be set in order to set the write enable. However, as of right now in the documentation, that bit is marked as reserved :frowning:
I found this out by looking at the NIOS II driver code. I guess I should not trust the documentation too much then?