Forum Discussion
Altera_Forum
Honored Contributor
15 years agoProblems debugging simple program in NIOS II IDE
Hardware and software tools:
NIOS II IDE 10.1 ("Legacy") Quartus II 10.1 Device:Arria II GX - EP2AGX260FF35I5N I am using software tools and hardware as described and a custom board.When i am trying to debug through NIOS II 10.1 IDE ("Legacy") ,the simplest debug there is -Hello World ("Hello from NIOS II),i get connection message in the console and i see that USB Blaster is connected (Blue LED is on)- (i am using jtag uart),but i never get the message "Hello from NIOS II" in the console.If i try to program another simple program such as blinking LEDs it doesn't run/debug either.The problem is probably not in the board ,because at my work colleague's computer he is able to run/debug this simple programs without any problems.11 Replies
- Altera_Forum
Honored Contributor
The same problem is described in topic :
t=26738 but i haven't quite got what exactly the user do,i can't PM him yet.Any ideas to resolve this issue would be welcome ( Or clarification of the topic mentioned ) - Altera_Forum
Honored Contributor
Check these:
- make sure you configured the fpga before starting Nios debugger - if you don't have a permanent Mios licence you must keep the USB blaster connected (don't close the warning window when fpga configuration ends) - check project and debugger properties: stdout must be set to redirect to jtag_uart module - in debugger properties the download and reset mode must be set to "Download program in RAM" and not to "Attach to existing program on target", nor "Reset target and execute..." - verify that when you start debug the code is actually downloaded: there should be a message in the console: download xxx kB... verify ... - Altera_Forum
Honored Contributor
well here are the messages:
Build message: **** Build of configuration Debug for project hello_world_after_license **** make -s all includes Compiling hello_world.c... ../hello_world.c: In function `main': ../hello_world.c:21: warning: unused variable `g' Linking hello_world_after_license.elf... Info: (hello_world_after_license.elf) 55 KBytes program size (code + initialized data). Info: 1992 KBytes free for stack + heap. Hardware simulation is not enabled for the target SOPC Builder system. Skipping creation of hardware simulation model contents and simulation symbol files. (Note: This does not affect the instruction set simulator.) Build completed in 1.89 seconds Nios II Download output: Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 Processor is already paused Reading System ID at address 0x002010B0: verified Initializing CPU cache (if present) OK Nios II terminal window: nios2-terminal: "USB-Blaster [USB-0]", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) Nios II gdb-server-output: Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 Processor is already paused Reading System ID at address 0x002010B0: verified Listening on port 4262 for connection from GDB: 59saccepted Exiting due to 'k' command from GDB Leaving target processor paused Nios II -elf-gdb: mi_cmd_stack_list_frames: No stack. No symbol "new" in current context. kill - Altera_Forum
Honored Contributor
--- Quote Start --- Nios II Download output: Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 Processor is already paused Reading System ID at address 0x002010B0: verified Initializing CPU cache (if present) OK --- Quote End --- As I suggested above, you are restarting processor without downloading code. Check debug target properties. The output should be (I copied here mine): Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 Pausing target processor: OK Initializing CPU cache (if present) OK Downloaded 336KB in 6.2s (54.1KB/s) Verified OK Starting processor at address 0x04000000 You may also try directly with Nios command shell: - open a shell window (n.1) and type nios2-terminal to open a terminal session - open another shell window (n.2) and type nios2-download <your_app_name>.elf -g You should see in window n.1 an output similar that I reported above, while in n.2 you'll the hello world message - Altera_Forum
Honored Contributor
what should i check in debug target properties.what are the proper settings (your settings)?
- Altera_Forum
Honored Contributor
This is for Nios IDE 9.0. I think it is something similar for 10.1
- select Run menu - select Run... or Debug... - select your target in the left pane - choose Debugger tag in the right pane - in "Download and Reset" section , select "Download program in RAM". Now you probably have "Attach to existing program on target", or "Reset target and execute..." - Altera_Forum
Honored Contributor
yeap,i have figured it would be the problem .thank you
- Altera_Forum
Honored Contributor
Firsr I built a project includes Nios II ,memories ,it works.
When I added a DDR2 SDRAM controller, not only the DDR2 does't work but also the system . The pin assignment has been finished. Can you tell me why? Thank you! - Altera_Forum
Honored Contributor
If you are sure about sopc system and pin assignments, then it is probably a timing problem.
- Altera_Forum
Honored Contributor
--- Quote Start --- If you are sure about sopc system and pin assignments, then it is probably a timing problem. --- Quote End --- I do it on Cyclone IV,it's OK;but on Stratix III 340, it does'n. I wonder to know if Stratix III 340 has special standard. I use Quartus10.1 and Nios Eclipse