Hi.
I created my own example project from a altera introduction pdf to use some buttons and leds. Thats the link to the tutorial ftp://ftp.altera.com/up/pub/Altera_M...PC_Builder.pdf. My board is the Altera Cyclone III DK-N2EVAL-3C25N NIOSII Development Board. Here an screenshot of the SOPC builder window.
sopc.jpg
Generating and compiling of the code works fine.
Here the verilog code:
module lights (SW, KEY, CLOCK_50, LEDG);
input [3:0] SW;
input [0:0] KEY;
input CLOCK_50;
output [3:0] LEDG;
// Instantiate the Nios II system module generated by the SOPC Builder:
// nios_system (clk, reset_n, out_port_from_the_LEDs, in_port_to_the_Switches)
nios_system NiosII (CLOCK_50, KEY[0], LEDG, SW);
endmodule
In the example are 8 leds and button used, my board has only 4 so I changed that in the sopc builder and in the code to 4 and connected the in/outputs in the pin planer. Took the pin information from another project which works.
pins.jpg
My nios code is:
#include <stdio.h>
#define Switches (volatile char *) 0x0003000
#define LEDs (char *) 0x0003010
int main()
{
printf("Hello from Nios II!\n");
while (1)
*LEDs = *Switches;
return 0;
}
But when I run the nios project it crashes with that error message:
Using cable "USB-Blaster [USB-0]", device 1, instance 0x00
Processor is already paused
Reading System ID at address 0x0C002F40: verified
Initializing CPU cache (if present)
OK
Downloading 05000020 ( 0%)
Downloading 05010000 (26%)
Downloading 05020000 (53%)
Downloading 05030000 (79%)
Downloaded 242KB in 0.6s (403.3KB/s)
Verifying 05000020 ( 0%)
Verifying 05010000 (26%)
Verifying 05020000 (53%)
Verifying 05030000 (79%)assertion "m_state == STATE_DEBUG" failed: file "nios2debug.cpp", line 578.....
I have no idea why. Even when i remove the most stuff and use only a while(1) without anything it crashes.
The reason must be in the quartus part, because the nios c code works with other projects but not with my own example.
I created my own example project from a altera introduction pdf to use some buttons and leds. Thats the link to the tutorial ftp://ftp.altera.com/up/pub/Altera_M...PC_Builder.pdf. My board is the Altera Cyclone III DK-N2EVAL-3C25N NIOSII Development Board. Here an screenshot of the SOPC builder window.
sopc.jpg
Generating and compiling of the code works fine.
Here the verilog code:
Quote:
module lights (SW, KEY, CLOCK_50, LEDG);
input [3:0] SW;
input [0:0] KEY;
input CLOCK_50;
output [3:0] LEDG;
// Instantiate the Nios II system module generated by the SOPC Builder:
// nios_system (clk, reset_n, out_port_from_the_LEDs, in_port_to_the_Switches)
nios_system NiosII (CLOCK_50, KEY[0], LEDG, SW);
endmodule
pins.jpg
My nios code is:
Quote:
#include <stdio.h>
#define Switches (volatile char *) 0x0003000
#define LEDs (char *) 0x0003010
int main()
{
printf("Hello from Nios II!\n");
while (1)
*LEDs = *Switches;
return 0;
}
But when I run the nios project it crashes with that error message:
Quote:
Using cable "USB-Blaster [USB-0]", device 1, instance 0x00
Processor is already paused
Reading System ID at address 0x0C002F40: verified
Initializing CPU cache (if present)
OK
Downloading 05000020 ( 0%)
Downloading 05010000 (26%)
Downloading 05020000 (53%)
Downloading 05030000 (79%)
Downloaded 242KB in 0.6s (403.3KB/s)
Verifying 05000020 ( 0%)
Verifying 05010000 (26%)
Verifying 05020000 (53%)
Verifying 05030000 (79%)assertion "m_state == STATE_DEBUG" failed: file "nios2debug.cpp", line 578.....
The reason must be in the quartus part, because the nios c code works with other projects but not with my own example.