Altera_Forum
Honored Contributor
15 years agoHow can i use SRAM properly with NORMAL C library?
Hello. I've some memory problems while using DE1 board(with cyclone 2)
I succesfully created a system and make an example of binary counter(the one that given in the official altera web site-niosII_hardware_tutorial-)That sample requires small C library so no problem occured. I tried a little different code. I tried to use scanf func so i have to use full C library. One of my friends actually used it. In his project he used scanf, leds and sram(for the memory problem). He pushes 1,2,3,4 from the keyboard and related led lights up(very simple and basic program :D ). I tried the same but i cannot be able to use sram. To add sram to my system i used Avalon-MM Tristate Bridge (i am able to associate with nios processor "only" with this component. Non of the other parts worked :\). In the end i created a system and defined required input output,clock,vcc etc and assinged default pins(which is givven in the CD that contains samples) to them. I opened it in Nios and wrote the code. The problem starts here.(I apologize for the looong story above but i have to explain :P ). When i try to compile my code without C++ support and "with" normal C, it gives memory error.(Smthing about overlappings.) Eventhough my sistem didn't contain an onchip memory, i have an extra error about inadequate onchip memory.(something like "26 kb more onchip memory required") Thus, What should i do? As title states How can i use SRAM properly with NORMAL C library? If you can give me some sample codes and some useful instructions about how to use memory parts , it would really help on my study. Again any help would be great!! Thank you for reading that long enty and thank this very moment for your comming answers :) -srht