Altera_Forum
Honored Contributor
18 years agoCyclone 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)