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++
12665 Discussions

Issue with SRAM and SDRAM in NiosV

Kaazi32
Beginner
619 Views

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.

0 Kudos
5 Replies
JingyangTeh
Employee
548 Views

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


0 Kudos
Kaazi32
Beginner
528 Views

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

0 Kudos
JingyangTeh
Employee
442 Views

Hi

 

Sorry for the confusion. You could enable software optimization for NiosV to reduce the software elf size.

 

https://www.intel.com/content/www/us/en/docs/programmable/773196/current/software-optimization.html

 

For the On-chip ram (SRAM) you could try increase the onchip ram size to fit the software elf.

2024-09-03_09h48_25.png

 

Regards

Jingyang, Teh

 

0 Kudos
JingyangTeh
Employee
357 Views

Hi


Any update on this case?


Regards

Jingyang, Teh


0 Kudos
JingyangTeh
Employee
281 Views

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


0 Kudos
Reply