Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

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

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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