Forum Discussion

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

Cyclone II and NIOS frustrations

I have an EP2C20 on a new board that I'm trying to debug, and am having very strange problems. I am using a USB Blaster.

Initially, the Quartus programmer would download the configuration, but then claim there was no response form the chip, although the logic portion of the chip seemed to mostly work. Sometimes a couple of the registers that I can read and write externally would return random numbers even when I wasn't trying to write to them - making a small change to the configuration might fix those registers, but cause another to go bad.

Now the Quartus programmer gives the error "Error: The OpenCore Plus IP in device 1 is not responding."

I also seem to be unable to change the NIOS firmware (I'm using the free time-limited NIOS core at present). Attempting to download a new version results in the error message "There are no Nios II CPUs with debug modules available which match the values

specified. Please check that your PLD is correctly configured, downloading a

new SOF file if necessary." On a couple of occasions I received an warning message about using a little-endian file with big-endian hardware.

When the download does seem to work, I get the following message:

Using cable "USB-Blaster [USB-0]", device 1, instance 0x00

Pausing target processor: not responding.

Resetting and trying again: OK

Initializing CPU cache (if present)

OK

Downloading 00004000 ( 0%)

Downloaded 4KB in 0.6s (6.6KB/s)

Verifying 00004000 ( 0%)

Verify failed between address 0x4000 and 0x4F9F

Leaving target processor paused

The program crashes frequently, sometimes restarting by itself, but eventually refuses to run without reprogramming the chip.

I've reduced the program to:

int main()

{

short enc_type;

/* Data from CAMAC */

int destinationa, destinationb;

int speeda, speedb; /* CAMAC speed * 8192 (<< 13)*/

int accelerationa, accelerationb;

int decelerationa, decelerationb;

short eratioa, eratiob, sratioa, sratiob;

int setactuala, setactualb;

short watchdog, wdog;

/* data from Magellan */

watchdog = 0;

wdog = 0;

printf("\r\n0982 Motor Controller 0.006\r\n");

destinationa = IORD(DESTINATIONA_BASE, 0);

accelerationa = IORD(ACCELA_BASE, 0);

decelerationa = IORD(DECELA_BASE, 0);

eratioa = IORD(ERATIOA_BASE, 0);

sratioa = IORD(SRATIOA_BASE, 0);

speeda = IORD(SPEEDA_BASE, 0) << 13;

printf("Dest: %6d, Accel: %3d, Decel: %3d, ERatio: %5d, SRatio: %5d, Vel: %5d\r\n", destinationa, accelerationa,

decelerationa, eratioa, sratioa, speeda);

/* main program loop */

while (1)

{

if(wdog++ >= 1000)

{

wdog = 0;

watchdog++;

IOWR(WATCHDOG_BASE, 0, watchdog);

printf("\n\rWatchdog: %5d", watchdog);

}

}

return 0;

}

It does usually get to the loop, but "watchdog" only counts up to a few hundred at most. The program fails in the printf statement - while running, it will miss the occasional character.

Any clues regarding any of these problems would be greatly appreciated. (I suppose this more properly belongs in the NIOS forum, but that seems to be broken today)

13 Replies

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

    --- Quote Start ---

    Can you please explain me step by step how to change resistors value? (I would even appreciate links to appnotes you were talking about).

    Your last post suggest me you didn't fix you problem during this week... Is it so difficult?

    Thanks

    --- Quote End ---

    I removed the 10K resistors and installed 1K, based on a co-worker's design, and info I found in Altera's Knowledge Base.

    The new resistor values seem to have corrected problems downloading - the programmer no longer complains that it can't communicate with the FPGA. However, the NIOS program still crashes.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    sorry to post a question, i'm still a beginner and you all seem to master my problem. I try to make the nios read something. I just knew here that we symply affect to a variable the result of IORD. But how the base argument (obviously the adress) can be configurated to read from a specific location (a vhdl code file for eg).

    Just to be sur the nios red the message i want to write another one with the IOWR but i know how to do all this so thank you to help me with the first part.

    ++