Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12589 Discussions

nios ii doesn't run hello world (or sometimes not correctly)

Altera_Forum
Honored Contributor II
1,528 Views

Hi Guys, 

 

i have a problem with the niosii. I use a Altera Cyclone IV EP4CE22E22C8N on a selfmade board. The board now only contains a 60MHz Clock, the fpga and a sdram. The Reset and exception vectors are both in the sdram. 

The Problem is that after a creation of a niosii based system in Qsys (in older quartus versions sopc-builder) and creating a hello world program in NiosII 13.1 Software Build Tool for Eclipse, the niosii doesn't run. Sometimes he run but doesn'T works correctly. Instread of writing Hello from NIOS II for 100 times and counting the number down, i get this: 

 

llo from Nios II! 96 

Hello from Nios II! 95 

Hello from Nios II! 99 

Hello froHello from Nios II! 99 

HHello from Nios II! 99 

HeHello from Nios II! 99 

Hello froHello from Nios II! 99 

 

 

:confused::confused: 

 

But as i wrote abovde in the most times i don't get anything from the nios ii. 

Do someone has an idea where the problem could be ?;):cool:
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
431 Views

It's difficult to find the cause of the problem with this minimal information. 

I'll give you only a few ideas: 

- is your fpga design fully timing constrained? 

- does it meet timing? 

- are you using reduced HAL drivers? If yes, try to switch to the full featured version 

- is there any delay between one hello world print and the next one?
0 Kudos
Altera_Forum
Honored Contributor II
431 Views

Hi Cris72, 

 

between one hello world and another there is no delay. But the output i wrote in the post above doesn't appear everytime. Sometimes i get only an error Download Elf file failed and sometimes the nios ii seems to be running but nothing appears on the Niosii console.
0 Kudos
Altera_Forum
Honored Contributor II
431 Views

Did you connect the debug reset request to the CPU and all its peripherals? 

When you are downloading the elf content via nios2-download command, do include -r flag to reset your system.
0 Kudos
Altera_Forum
Honored Contributor II
431 Views

 

--- Quote Start ---  

Hi Cris72, 

 

between one hello world and another there is no delay. But the output i wrote in the post above doesn't appear everytime. Sometimes i get only an error Download Elf file failed and sometimes the nios ii seems to be running but nothing appears on the Niosii console. 

--- Quote End ---  

 

 

I have seen this type of things many times, it is usually the NIOS II being run at a clock speed above what the device can handle. The issues downloading are where I generally see the problem with to high of a NIOS clock. You did not state in your post what the NIOS II clock rate was?
0 Kudos
Altera_Forum
Honored Contributor II
431 Views

I have seen similar issue with de0-nano that the hello world does not run properly. It was due to timing issue with the SDRAM. 

ftp://ftp.altera.com/up/pub/altera_material/11.0/tutorials/verilog/de0-nano/using_the_sdram.pdf 

 

There is some kind of known clock skew issue with the board and the fix was to add a SDRAM_CLK that leads the NIOS_CLK by 3ns (more explanation in the reference, section 7). I am not sure the 3ns applicable to your case. But you can try.
0 Kudos
Altera_Forum
Honored Contributor II
431 Views

 

--- Quote Start ---  

I have seen similar issue with de0-nano that the hello world does not run properly. It was due to timing issue with the SDRAM. 

--- Quote End ---  

 

 

I agree with mikedsouze - SDRAM timing is probably the problem. 

 

Build a NIOS that runs from on-chip memory. Get the memory test running 

 

RK
0 Kudos
Reply