Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
8 years ago

Arria 10 EPCQL Controller

Hi,

I am trying to program my EPCQ-512L from the HPS running Linux. I have the Altera Serial Flash Controller connected from its avl_csr and avl_mem connected to the HPS using the hps2fpga lightweight bridge. I have tried to write the EPCQ and have been successful in writing zeroes. From what I have gathered, I need to erase the sector, then write my values because it erasing sets all the values in the sector to '1'. Here lies my problem; following https://www.altera.com/en_us/pdfs/literature/ug/ug_embedded_ip.pdf , starting on page 153 about the Altera Serial Flash Controller I tried to write to the FLASH_MEM_OP register to erase sectors. I tried writing 0x2 to the register to erase the sector data, but nothing seems to change. I have tried writing other values and from what I can see (when reading the values back from the epcq) there is never a change. I also tried reading the status register to see if there are processes occurring, but it always reads 0.

Also when I try to read either the FLASH_RD_SID, FLASH_RD_RDID, FLASH_ISR, or FLASH_IMR, the HPS seems to stop responding and I need to reload my .sof. I use either ssh terminal or serial terminal to communicate with my system and when I try to read any of the mentioned registers, the system stops responding on both ssh and serial. I have other signals connected to the lightweight bridge and I have not run into this symptom before. I think this could be part of the problem; maybe the control register is not working at all, but I am not sure where to start debugging this. Any help or points in a direction would be much appreciated.

Thank you in advance :)

11 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello,

    I am using Cyclone 10 LP and Altera Serial Flash Controller II IP core. I am using Quartus Prime standard edition, V17.1 In my case also, it hangs when erase function is called. In both of following functions, alt_erase_flash_block and alt_write_flash erase routine is called and hence when I call any of them, it hangs.

    In alt_epcq_controller2_erase_block function, I made following change. (remember this is a manual change. Hence if you generate BSP again, this will get lost.)

    Instead of following

    /* write enable command */

    mem_op_value |= ALTERA_EPCQ_CONTROLLER2_MEM_OP_WRITE_ENABLE_CMD;

    I used following:

    /* Unprotect flash. */

    mem_op_value |= ALTERA_EPCQ_CONTROLLER2_MEM_OP_SECTOR_PROTECT_CMD;

    Not sure how it works. But it works! With this, it no longer hangs. (P.S. I got this idea by looking at flash_qspi.c file.)

    Perhaps somebody from Intel team might be able to give some insight into this.

    Cheers,

    Bhaumik