Forum Discussion
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)13 Replies
- Altera_Forum
Honored 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. ++ - Altera_Forum
Honored Contributor
Thanks, Bennett...
I'll try to follow your suggestions... - Altera_Forum
Honored 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
Honored Contributor
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 - Altera_Forum
Honored Contributor
Sergej:
I changed the resistors from TMS and TDI to +3.3V from 10K to 1K, likewise the resistor from TCK to ground. I also added a 1K from TDO to +3.3V (as shown in some appnote) I assumed that the 10pF capacitor was to go from TCK to ground, preferably as close to the FPGA as possible - but putting it there, or on the JTAG connector kills downloads for me. - Altera_Forum
Honored Contributor
Hi bennett, that's my question: how did you reduced resistors from 10 K to 1 K?
Thanks - Altera_Forum
Honored Contributor
Adding the 10pF capacitor on TCK doesn't work for me - it prevents any download.
However, I looked closer at the JTAG connector and found a couple of problems, and reduced all the resistors from 10K to 1K - Quartus can now download without any complaints, but I still have problems with the NIOS program crashing. I'm using an Altera USB Blaster version C - is there any point in buying a Terasic Blaster? - Altera_Forum
Honored Contributor
Hi guys, I'm quite baffled about this matter to add a capacitor at TCK line...
somebody else in other forums says to replace the 10 K resistor with a 1 K one. Should I split my TCK (pin D 14) line to one GPIO pin, connect the 10 pF capacitor (or 1 K resistor) and again to ground? Or is there another different way? Sorry, but I'm quite confused about that, I have problems with my USB Blaster connection and don't knoe how to fix and go on. Thanks Sergio - Altera_Forum
Honored Contributor
Hi,
I experienced that I may help to close Quartus and the Nios IDE. Then start the task manager (in case your using windows) and kill the jtag daemon. After that you restart quartus and the Nios IDE, reload your bitstream and suddenly everything works ;-) Cheers, Alex - Altera_Forum
Honored Contributor
Hello,
the good thing with the JTAG problems is, that they depend on JTAG hardware only(assuming your power supply is O.K.), would be more difficult with design not operating correct after configuaration. Altera has apparently experimented a lot with driver hardware of USBBlaster, I think that AS programming is even worse than JTAG. With my revision B USBBlaster, I have been once increasing the TCK series resistor, also customer did that on Altera recommendation. Furthermore the flexprint adapter turned out to have unreliable contact with my exemplar, I changed it to a standard IDC cable and had no problems since that. Customer hardware usually has additional transient suppression by schottky diodes and series resistor, this may also help against ringing TCK. The suggested 10 pF parallel capacitor at TCK could be useful instead. Regards, Frank