Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
964 Views

Printf problem

Hi guys 

 i've posted before some problems with sdram and custon nios II platform, finally i was able to solve that issues by searching hard on the internet =/...  now i've got another problem, when running a program on my board i get strange printf's behavior, like this:  supose that my code is  printf("Hello nios II")  but my output is  "HHllooffoo iissII!!"   instead of   "Hello from NiosII!"  Does anyone has an solution for this? I'm using a Ciclone 2, EP2C35F with an external SDRAM on my design  Julio

0 Kudos
5 Replies
Highlighted
Valued Contributor III
2 Views

Re: Printf problem

hi, Julio 

 

could you please tell how you managed to solve your previous problem with DE2 example (nios II)? 

 

I try to make a project described in DE2_SYSTEM disk: "...\DE2_tutorialstut_sopc_introduction_verilogDE2.pdf" 

 

I have almost the same as you had: after compiling and programming the device in Quartus the "Altera debug client v3.3" says me:  

 

"Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 

Resetting and pausing target processor: FAILED 

Leaving target processor paused" 

 

i did all as in the tutorial pdf file. 

 

tried different versions of NIOS II IDE and Altera Debug Client, didn't work. 

 

thanks
0 Kudos
Highlighted
Valued Contributor III
2 Views

Re: Printf problem

hi cheplin... 

 

it was a SDRAM timing problem, to solve that (and learn other things) first i did the SOPC builder tutorial, that i've found on the internet... You can find it in the following link 

 

ftp://ftp.altera.com/up/pub/tutorials/de2/computer_organization/tut_sopc_introduction_vhdl.pdf 

 

The example works on DE2 pretty well, but for my application I need more memory. So I've found the following tutorial: 

 

ftp://ftp.altera.com/up/pub/tutorials/de2/computer_organization/tut_de2_sdram_vhdl.pdf 

 

The design worked well, but when I tryed to use printf, i've got the problem that is described in the first post. I've already solved the problem with printf by using the most powerfull version of the Nios 2, i don't know why, but this solved my problem =] 

 

Best luck 

 

Julio
0 Kudos
Highlighted
Valued Contributor III
2 Views

Re: Printf problem

Are you printing to the Jtag uart? It really looks strange. 

Can you try and run the program from on-chip memory instead of the SDRAM?
0 Kudos
Highlighted
Valued Contributor III
2 Views

Re: Printf problem

Unfortunatelly my program does't fit on the on chip memory... and yes i'm printing to the Jtag uart. 

 

As i said before i had the problem solved by using the Nios II/f, i don't know how, but this solved the issue. 

I have read that the problem was linked with some 8 bit write problem when using the SDRAM. There is something on the nios f that solve this problem. 

 

Julio
0 Kudos
Highlighted
Valued Contributor III
2 Views

Re: Printf problem

thank you, Julio. I'l try these tutorials...

0 Kudos