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

    I have an EP2C20 on my custom board too, and when I initially started trying to configure it, program flash etc. I had terrible problems, similar to those you describe. At the time I was using an Altera USB Blaster Revision B. I was advised by others to try a Terasic USB Blaster and it has been 100% reliable ever since. This may be worth a try in your case.

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

    I had a similar type problem with downloading via the USB Blaster. I finally found that I had a signal integrity problem on the TCK line. The signal had a slight "shelf" around the threshold that I only found after looking at it with a Ghz scope. If you look at the Cyclone II NIOS Dev. Kit you will notice a 10pf cap(C556) on the TCK line. After adding this capacitor( it needs to be adjacent to the TCK pin), my problem was resolved.

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

    That sounds like JTAG chain noise. At the very least, you should rule that out before proceeding. How have you ensured that your JTAG chain is clean?