Forum Discussion

Balerion's avatar
Balerion
Icon for Occasional Contributor rankOccasional Contributor
2 months ago
Solved

Nios-V alt_epcq_controller_write() Problem

Hi,

I have a flash on my custom board which is MT25QU01G. The flash is connected to Nios-V/g with Epcq Controller. I am trying to erase, write, read sectors from flash. Before write and erase I unlock all sectors and after write and erase I lock all sectors. The problem is that my alt_epcq_controller_write() returns success(0) however it doesn't write to flash memory. I read same data from same place and it is not changed. I also look that memory from memory browser and still nothing changed. I call erase  method before each write method since it is nor flash but nothing happens. Could you please help me about the problem.

Thanks,

Balerion

  • Hi Balerion,

    Regading to avl_mem slave:

    If you also place avl_mem slave in Peripheral Region, you can use the current altera_epcq_controller.c file as is.

    However, you may want to place avl_mem slave in cacheable (non-Peripheral) region to take advantage of the cache for read accesses.  In that case, cache maintenance needed for flash memory write operation in Nios V/g system.  Here is a code example (= not fully validated) to achieve this attached (please replace the file extension from ".txt" to ".c").   At the end of the alt_epcq_controller_write_block() function, cache flush function call and error checking are added.

    Thanks,
    ShoH

13 Replies

  • ShoH_Altera's avatar
    ShoH_Altera
    Icon for Occasional Contributor rankOccasional Contributor

    Hi Balerion​ 

    I'll try to reproduce the issue. 
    Can you share Quartus version and FPGA device that you are using with?

    Regards,
    Sho

    • Balerion's avatar
      Balerion
      Icon for Occasional Contributor rankOccasional Contributor

      Hi,

      I'm using Quartus Pro 25.1.1 and My Fpga is Arria-10. 

      Thanks,

      Balerion

      • ShoH_Altera's avatar
        ShoH_Altera
        Icon for Occasional Contributor rankOccasional Contributor

        Thanks for the info.  I'll check if I can prepare a similar set-up.  
         
        Regarding flash controller, are you using Serilal Flash Controller, not Serial Flash Controller II ?

        And just to be sure, you are assigning avl_csr address of the flash controller in non-cached address region, right?

        Regards,
        Sho