Forum Discussion
Altera_Forum
Honored Contributor
12 years agoSize of C file running using NIOS II ON CHIP RAM
How to figure out how much amount of space is being occupied by the C.c file which is used to to run as an NIOS II hardware ?? For example in the file http://www.altera.com/literature/hb/extern...
Altera_Forum
Honored Contributor
12 years agoMost of the memory is needed for the libc functions that Altera support by default.
In particular printf() drags in about 70k of code because it is built on top of the standard stdio library code which also pulls in malloc(). Even if you don't actually call printf() there is code to close the fds after main returns. There is a 'small' version (that uses alt_printf() etc), but even that isn't as small as it could be. It really ought to be possible to write a 'hello world' program in less than a 100 instructions, and use that as a base for simple embedded systems.