Forum Discussion

NRugg's avatar
NRugg
Icon for Occasional Contributor rankOccasional Contributor
5 years ago
Solved

NIOS II - Hanging on ECPQ / SPI initialization

So in our system we've recently added an EPCS/EPCQ flash controller IP. We've regenerated the BSP, it has all the fancy new files, and we're building in NIOS land.

However, when the NIOS application comes up, it runs the HAL initialization routines (alt_main), one of which is

ALTERA_AVALON_EPCS_FLASH_CONTROLLER_INIT

In the above routine, we attempt to read the electronic signature. In doing this we send out an alt_avalon_spi_command(). In this function, we hang infinitely on the following code

  /* Wait until the interface has finished transmitting */
  do
  {
    status = IORD_ALTERA_AVALON_SPI_STATUS(base);
  }
  while ((status & ALTERA_AVALON_SPI_STATUS_TMT_MSK) == 0);

I can see the registers mentioned above not changing. Specifically, I am getting a TRDY (transmitter ready) and RRDY (Receiver ready) bits set. Both of those bits need to be set to 0 in order to exit this infinite loop.

So my question becomes, is there some necessary setup item to be able to talk with EPCS flash that I'm missing? All of the routines that get called up until this point are in the BSP, and from my understanding we should never have to edit the BSP files. This leads me to believe there is some setting in Quartus / NIOS II EDS that is getting missed.

Thanks so much in advance for any help you can provide!

  • NRugg's avatar
    NRugg
    5 years ago

    Thanks for your time, but I was actually able to find the solution to this recently.

    As it turns out, the issue was entirely configuration related. We added the EPCQ IP to the build, but forgot to actually flash the chip with the new fabric image. So we were trying to access EPCQ registers but the fabric image didn't know how to handle it.

    So if you see this issue, make sure you have the latest and greatest fabric flashed onto your device! This was entirely the source if my issue.

3 Replies

  • Hi @NRugg,

    Thank you for posting in Intel community forum and hope this message find you well.
    What are the configuration device used?
    Which hardware board are involved and also which version of quartus are involved?

    Note: on for the time being maybe would recommend to refer to the link here for EPCS guide which contain the details configuration steps.

    Warm regards.
    BB

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

      Thanks for your time, but I was actually able to find the solution to this recently.

      As it turns out, the issue was entirely configuration related. We added the EPCQ IP to the build, but forgot to actually flash the chip with the new fabric image. So we were trying to access EPCQ registers but the fabric image didn't know how to handle it.

      So if you see this issue, make sure you have the latest and greatest fabric flashed onto your device! This was entirely the source if my issue.

      • BoonBengT_Altera's avatar
        BoonBengT_Altera
        Icon for Moderator rankModerator

        Hi @NRugg,

        Good to know that it is working now, we would be closing the thread. If you have further queries, Please do post a response in the next 15 days.
        After 15 days, this thread will be transitioned to community support. The community users will be able to help you with your follow-up questions.

        Warm Regards