Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17255 Discussions

Garbage printed to Nios II Console

Altera_Forum
Honored Contributor II
1,642 Views

I am having difficulty with the NIOS II Console within Eclipse. I am using Nios II 9.1 and Quartus 9.1. 

 

I am using the JTAG_UART connection with my Cyclone III board (a BeMicro), operating over USB Blaster. I have JTAG_UART specified for stdin, stdout and stderr in my BSP. I am using the small C library. 

 

The output below is typical and illustrates the problem. It is supposed to say "This is a test!" followed by the ID and timestamp of the FPGA image. Below is what is actually printed: 

 

This s a eet! 

UUNQQE ID: 4FFCCB27 

TIIEETTAPP:44DEE4EE4= 011/03311 1:52::2 

 

The text is mangled differently everytime I run it. What kinds of things can cause this behavior?
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
613 Views

More information: 

 

The hardware, IP and software I'm using now used to result in a clean, error free stdio type interface over the jtag_usb into the NIOS II Console. I switched stdin, stdout, and stderr to "none" for a time to test the design in a fully embedded environment where there is no console. I made a few changes during that time but nothing major. Now that I have switched stdin, stdout and stderr back to jtag_uart, I am getting strange corruption in data communicated over this interface as indicated in my first post on this problem. 

 

As I mentioned my BSP is set to use the small C library. It is also configured to use the reduced device drivers. These settings are essential; I do not have enough memory available to change these. This has been true from the beginning. Without going into it too much, I am creating an extremely low power system and minimizing board chip count is critical. Using a 16K LE Cyclone III I only have access to 36K of RAM. This has always been true, including the time when i/o with the console worked flawlessly, so I know this is not causing the problem. 

 

I have tried enabling and disabling the lightweight device driver API in the HAL; no effect. I have also tried enabling and disabling the jtag_uart small driver and uart small driver, in the settings available on the "drivers" tab of the BSP editor. No change. 

 

It's always possible there's a hardware issue, but I think it is unlikely; the hardware performs flawlessly otherwise. The behavior reminds me of an old style RS-232 serial connection with mis-matched parameter settings. Doesn't seem like that should happen with USB though. 

 

Has anyone run into this problem and (hopefully) found a solution, or at least a promising lead or avenue for further inquiry? I have googled around and dug through Altera documentation to no avail so far. 

 

Any hints or information on this issue would be greatly appreciated. 

LH
0 Kudos
Altera_Forum
Honored Contributor II
613 Views

One other thing I forgot to mention: behavior is the same whether I interact via the NIOS II Console embedded within Eclipse or if I use the nios2-terminal program run from within the NIOS II Command Shell.

0 Kudos
Altera_Forum
Honored Contributor II
613 Views

What is your system clock speed? I don't think the JTAG connection will function reliably unless it's greater than 20MHz or so.

0 Kudos
Altera_Forum
Honored Contributor II
613 Views

Clock speed is 48 MHz. Nothing on hardware has changed between when it worked and now. I confirmed today that console i/o works fine with an earlier version of my IP and software design. The problem has something to do with either my curent IP design, current software design, or BSP settings, although I tried mirroring BSP settings from the working version into the broken version and nothing changed, so I am inclined to think the BSP settings are unlikely to be the problem at this point. 

 

Since I have a working version, worst case I can morph the working one towards the current one until it breaks to find the answer. I would still prefer to avoid that path if possible. 

 

 

--- Quote Start ---  

What is your system clock speed? I don't think the JTAG connection will function reliably unless it's greater than 20MHz or so. 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
613 Views

Got it fixed. Turns out I had a bad clock setting in my SOPC component that was throwing everything else off.

0 Kudos
Reply