Visible to Intel only — GUID: zji1538594389856
Ixiasoft
Visible to Intel only — GUID: zji1538594389856
Ixiasoft
6.2.3.6. Debugging the Nios II Software Running in On-Chip Flash
- Open the Nios® II Software Build Tools for Eclipse from Tools menu.
- To set a breakpoint, double click the space beside each c programming code as shown below.
Figure 252. Step 2 Illustration
The build tool selects either hardware breakpoint or software breakpoint automatically based on the setting in BSP. Hardware breakpoint is used because the code is in On-chip flash. Only four hardware breakpoints can be used as based on parameter set in the Nios® II IP.
- Right click on the application project, then click on Debug As>Debug Configuration.
- Under Project tab, select the correct project name if you have more than one project.
Figure 253. Step 4 Illustration
- Under Target Connection tab, ensure that the Intel® FPGA Download Cable II is detected for connection. Select Start processor and Reset the selected target system options. Un-select Download ELF to selected target system, as the Nios® II processor is booting from on-chip flash, therefore downloading ELF is not required.
Figure 254. Step 5 Illustration
- Under Debugger tab, you can choose to either stop the execution of the program at main or not.
Figure 255. Step 6 IllustrationNote: If you are using one of the hardware breakpoint, this option is enabled.
- Click on Debug. Click Yes when you are asked to switch to debug perspective. And the Nios® II Debug window is opened.
Figure 256. Step 7 Illustration
The execution of the program is stopped at the main. The small arrow beside the code indicates the execution of the program stop at that line of program.
- Use the different icons from the toolbar:
- Resume icon: to continue the execution of the program. The execution of the program stops at the next breakpoint set in the program.
- Step into or Step over icon: to debug the program line by line.
- Terminate icon: to stop the debugging process
Figure 257. Step 8 Illustration - You can view the variables, breakpoints, register values and memory as shown below.
Figure 258. Step 9 Illustration
- Nios® II console displays all the messages from printf() function during program execution.
Figure 259. Step 10 Illustration
- Nios® II Software Build Tools for Eclipse reports an error if more than four set hardware breakpoints are inserted in the program.
Figure 260. Step 11 Illustration