Forum Discussion

Kaazi32's avatar
Kaazi32
Icon for New Contributor rankNew Contributor
2 years ago

Issue with SRAM and SDRAM in NiosV

Hey everyone. I am a student currently working on a project with niosv processor and de10 lite fpga. For this project i have Ashling Riscfree IDE to write the code. I currently have two designs and both of them cause errors related to SRAM in one and SDRAM Controller in another. In platform designer i had a design with IPs like niosv, jtag, sram, led_pio, uart_fifo. But then recently i added sdram controller and removed sram.


Problems:
1) Both of the designs compile successfully in quartus but i get errors in Ashling IDE. In SRAM Version, I was getting errors that my .bss, .text and .rwdata segments weren't in the region of sram and also there was a memory overflow by around 30 KB. All these errors occurred while i was using printf function. I checked the linker script and all of those were linked with sram. So i guess thats correct. The thing is: Whenever i was doing minimal use of printf function without line breaker (\n) inside the printf function, i was getting those errors. And, also using many printf function (around 7-10) with the line breaker, also resulted the same errors. My Sram has 128 KB and should be enough for my program.

2) Having that problem i switched my design from sram to sdram controller. Here i have PLL100 for the clock generator and has phase shift of - 3ns to 3ns. Niosv, jtag, sdram conrroller, uart_fifo and led_pio are used in this design. The problem with this version is that i dont get error that i had with sram cause my space went up from 128KB to 64 MB, i guess. But another error has come up and that being, my simple hello world wont get printed properly. Whatever i print with or without line breaker (\n) with the printf function, only alternate characters get printed. For example, if i print "Hi Niosv", i get "iNov". Line space between the words is also counted as a character.

Solution for either of these versions is acceptable, so i would really appreciate it, if you guys could give some tips or help to solve it.

Thanks in advance guys.

5 Replies

  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi


    As we do not receive any response from you on the previous question/reply/answer that we have provided. Please login to ‘https://supporttickets.intel.com/s/?language=en_US’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.



    Regards

    Jingyang, Teh


  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi


    We sincerely apologize for the inconvenience caused by the delay in addressing your Forum queries. Due to an unexpected back-end issue in our system, your Forum cases, along with others, did not get through as intended. As a result, we have a backlog of cases that we are currently working through one by one.

    Please be assured that we are doing everything we can to resolve this issue as quickly as possible. However, this process will take some time, and we kindly ask for your patience and understanding during this period. The cases will be attended by AE shortly.

    We appreciate your patience and understanding, and we are committed to providing you with the best support possible.

    Thank you for your understanding.


    Back to your issue, it seems like a size problem with the SDRAM. The nios application could not fit in the SDRAM.

    Could you try enabling the Small C library to further reduce the application size:

    https://www.intel.com/content/www/us/en/docs/programmable/683282/current/use-the-small-newlib-c-library.html


    Regards

    Jingyang, Teh


    Regards

    Jingyang, Teh


    • Kaazi32's avatar
      Kaazi32
      Icon for New Contributor rankNew Contributor

      Hi Jingyang,

      thanks for your Reply. I have actually two different Designs, one with Onchip Memory (SRAM) and another with SDRAM Controller. Both of them have issues. The issue you mentioned was with the SRAM not with SDRAM and also i am using NiosV. I didnt see any Option to enable the small C library in bsp editor, plus the small c doesnt support %f, while using printf, so i dont think thats gonna help me, as i need to use floating points in my Program.

      Regards,

      Kaazi