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.