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

NIOS II library

Altera_Forum
Honored Contributor II
1,235 Views

Hello all, 

 

well, it´s a very newbie question, so sory. 

 

I´m doing my first software for NIOS II and I noticed that even when I do a "hello world" program the compiler builds the software with all ANSI C libraries, but I´m not using the most of them. The problem is that it consumes a lot of memory. So, can I do something for the compiler to take only the libraries the current program uses? 

 

Thanks a lot, 

 

Vinícius.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
356 Views

I hope this puts you in the right direction. but it's not a complete answer. 

Try optimising the code, like -O3?? 

 

Someone else can comment also. I think it's been discussed in another thread.
0 Kudos
Altera_Forum
Honored Contributor II
356 Views

Hi vgarcia!! 

 

Let's try this in NiosII IDE: 

 

1) click right on "hello_world_syslib" project and click "Properties" 

2) in "C/C++ Build" panel, set the "Optimization Level" to "Optimize most (-O3)" and define the following symbol for the "Preprocessor": ALT_NO_INSTRUCTION_EMULATION 

3) in "System Library" panel, set "Periodic system timer" to "none"; set "Max file descriptor" to 4; uncheck "Clean exit"; check "Reduced device drivers"; check "Small C Library 

4) click right on "hello_world" project and repeat step 2 

5) build all and have fun! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/tongue.gif  

 

Bye
0 Kudos
Reply