Forum Discussion

Aviram's avatar
Aviram
Icon for New Contributor rankNew Contributor
2 months ago

MT25Q512 Programming Issue When Connected to Cyclone 10CX150Y

Hello friends,

I am trying to program an MT25Q512 QSPI Flash memory that is connected to an Altera Cyclone 10CX150Y FPGA through QSPI CS, CLK, DQ0, DQ1, DQ2, and DQ3.

The Flash memory can be programmed successfully when it is standalone. However, programming fails when it is connected to the FPGA.

During programming, I hold:

  • nCE High
  • nCONFIG Low

Could you please confirm whether this should force the FPGA QSPI pins into a high-impedance state?

Please advise whether any additional FPGA pin control, board-level isolation, or specific programming sequence is required in order to program the MT25Q512 externally while it remains connected to the FPGA.

 

Best regards

5 Replies

  • Aviram's avatar
    Aviram
    Icon for New Contributor rankNew Contributor

    Hello,

    I would like to clarify the behavior of the following Quartus assignment:

    `set_global_assignment -name TRI_STATE_SPI_PINS OFF`

    After programming the FPGA with a configuration generated using this assignment, if we subsequently perform an Erase operation through Quartus, does the effect of `TRI_STATE_SPI_PINS OFF` remain active in the FPGA, or is it removed immediately?

    I am asking because I observed that programming the external QSPI flash with an external QSPI programmer works successfully when using a blank, previously unconfigured FPGA. However, when using an FPGA that was previously programmed with a design containing `TRI_STATE_SPI_PINS OFF`, external QSPI programming does not work as expected.

    Could you please clarify whether an Erase operation in Quartus also clears the FPGA configuration or state responsible for controlling the QSPI pins? Is a power cycle, assertion of `nCONFIG`, or another action required to release the QSPI pins and place them in high-impedance mode?

    Best regards,
    Aviram 

    • FakhrulA_altera's avatar
      FakhrulA_altera
      Icon for Regular Contributor rankRegular Contributor

      Hi Aviram,
       

      Thank you for the clarification.

      TRI_STATE_SPI_PINS OFF affects the AS/QSPI pins only while the FPGA is in user mode. A Quartus Erase operation erases the flash but does not immediately clear the FPGA’s SRAM configuration.


      For external programming, please assert nCONFIG low and nCE high before any QSPI activity and keep them asserted through Erase/Program/Verify. With nCONFIG low, the Cyclone 10 GX loses its configuration and tri-states its I/O, so the assignment is no longer active.


      As the next diagnostic step, please power-cycle both devices while holding nCONFIG low, then reset/initialize the MT25Q512, including addressing, QE and protection settings, before programming. If the issue remains, please provide QSPI waveforms and the exact flash suffix and programmer version.
       

      Regards,
      Fakhrul

  • Aviram's avatar
    Aviram
    Icon for New Contributor rankNew Contributor

    Hi,

    Thank you for your response.

    I noticed an important difference in the behavior depending on whether the FPGA has previously been programmed:

    1. When I assemble a new FPGA from stock, I can successfully perform Erase, Program, and Verify on the MT25Q512 using the QSPI programmer.
    2. I then program a JIC file through Quartus.
    3. Afterward, I read back the Flash contents using QSPI programmer and save the readback data as a binary file.
    4. When I subsequently perform Erase, Program, and Verify using QSPI programmer, the Verify operation fails.
    5. During readback after the failed programming attempt, all Flash memory locations contain 0x00 or 0xFF.

    Throughout the external programming process, nCONFIG is held low and nCE is held high, as previously recommended.

    This behavior suggests that programming the JIC file through Quartus changes the condition of the FPGA or the QSPI interface in a way that prevents subsequent external Flash programming.

    Could you please advise whether JIC programming may affect the FPGA configuration pins, QSPI pin behavior, or any persistent FPGA setting that could cause this issue?

    Also, is a specific power-cycle or initialization sequence required after JIC programming before the MT25Q512 can be programmed externally again?

    Best regards,
    Aviram

    • FakhrulA_altera's avatar
      FakhrulA_altera
      Icon for Regular Contributor rankRegular Contributor

      Hi Aviram,
       

      Thank you for the details. Since external programming works before JIC programming, the issue is more likely related to the MT25Q512 flash state or addressing mode than to a persistent FPGA pin setting.


      Please try this sequence:

      • Fully power-cycle the FPGA and flash.
      • Hold nCONFIG low and nCE high before any QSPI activity.
      • Run the external programmer’s complete MT25Q512 initialization before Erase/Program/Verify, including flash reset, protection clear, and the correct 4-byte/Quad-SPI settings.

      The nCONFIG/nCE condition remains the correct method for tri-stating the FPGA QSPI pins. 

      Regards,
      Fakhrul

  • FakhrulA_altera's avatar
    FakhrulA_altera
    Icon for Regular Contributor rankRegular Contributor

    Hello,
     

    Yes. For the Cyclone 10 GX, holding nCONFIG low and nCE high should reset the FPGA and tri-state its AS/QSPI configuration pins. This is the normal condition for external flash programming, so additional FPGA pin control or board isolation is not normally required.


    Please verify the following:

    • Assert nCONFIG low and nCE high before any programmer activity, and keep them in that state until programming and verification are complete.
    • Confirm the FPGA and MT25Q512 I/O voltages are compatible and that no other device is driving CS, CLK, or DQ0–DQ3.
    • If Quartus/PFL is used, enable “Set flash bus pins to tri-state when not in use” and select the correct Micron MT25Q512 configuration.
    • Probe the signals at the FPGA pins to confirm that the FPGA QSPI pins are high-impedance during programming.


    If the failure remains, please provide the schematic around the QSPI interface, the exact MT25Q512 ordering code, programmer/software version, and waveforms for nCONFIG, nCE, CS, CLK, and DQ0–DQ3. This will allow us to distinguish a sequencing issue from board-level loading or flash-configuration incompatibility.


    Regards,
    Fakhrul