Altera_Forum
Honored Contributor
15 years agoNIOS2 on De2 board - verification failed
Hello!
I'm new to NIOS system programing. I am trying to make simple program based on my altera DE2 board with cyclone 2 ep2c35f672c6n on board.
#include <stdio.h>
#include "system.h"
#include "alt_types.h"
#include"altera_avalon_pio_regs.h"
int main(void)
{
unsignedchar pom;
unsignedchar dygacz=1;
int i=0;
while(1)
{
pom=IORD_ALTERA_AVALON_PIO_DATA(PIO_1_BASE);
{
for(i=0;i<1000*pom;i++);
dygacz=dygacz<<1;
if(dygacz==0) dygacz=1;
IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE,dygacz);
}
};
return 0;
}
As i follow the instructions/tutorials/how to-s im getting to the point of programing the board, however im getting an error message, followed by error popup saying: "downloading elf process failed"
Using cable "USB-Blaster ", device 1, instance 0x00
Pausing target processor: OK
Reading System ID at address 0x01001020: verified
Initializing CPU cache (if present)
OK
Downloading 00800000 ( 0%)
Downloaded 19KB in 0.3s (63.3KB/s)
Verifying 00800000 ( 0%)
Verify failed between address 0x800000 and 0x804943
Leaving target processor paused
After some diging in the Internet, i'v found how to disable verification. I did it by changing line in nios2-download file From eval nios2-gdb-server $arglist To eval nios2-gdb-server --no-verify $arglist right now, im not getting any error popups and the console log looks like this:
Using cable "USB-Blaster ", device 1, instance 0x00
Pausing target processor: OK
Reading System ID at address 0x01001020: verified
Initializing CPU cache (if present)
OK
Downloading 00800000 ( 0%)
Downloaded 19KB in 0.3s (63.3KB/s)
Starting processor at address 0x008001C4
everything looks just fine, with one exception - there is nothing happening on DE2 board! Moreover if the NIOS CPU "entry" point is at 008000000 why is it starting from 0x008001C4?? The funny part in all of this, that me and my firend have found the workaround for this. It is strange, but it proofs, that SRAM on board is programmed properly. The workaround is three simple steps (however we need two computers for this): 1) Program DE2 board with Quartus 9.1 SP1 on computer one 2) Then RUN nios application from eclipse (run as nios hardware) ----- NOW THE FUNNY PART------ 3) Get your error message, than unplug JTAG usb cable from your computer, plug it to my friend's computer and PROGRAM DE2 BOARD WITH THE SAME SCHEMATIC THAS U DID IN STEP 1 --- VOILA!--- The NIOS2 app, that u loaded in step 2 works fine now. For those, who didn't understand me due to my low language skills, we have prepared a VIDEO showing everything we are doing. PLEASE someone tell me, how to run this fricki'n thing on one computer only. www youtube com/watch?v=1HUt3KEVLik Replace spaces with . PS. SOOOORRRYYY EVERYONE FOR MY BAAAD ENGLISH :)