Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
1,732 Views

undefined reference to getc error

Hi, 

I am new to nios processor. when I use getchar function in my programm, I am getting error "undefined reference to `getc'".My task is very simple.I need to read a charecter from console and compare that charecter,if it is "w" I have to send data to pio ( again from console and it is just 8 bit pio). If it is "r" I have to read data from PIO (I am lucky, atleast printf is working ).Can anybody tell me what is wrong with getchar function ? and any suggestions to impliment my task. 

Sarat
0 Kudos
3 Replies
Altera_Forum
Honored Contributor I
92 Views

Hi friends, 

Sorry for the previous post.I have got solution from some other thread.I have increased the memory size and I have unchecked the small c library on bps properties and my code is working fine:). 

 

Sarat
Altera_Forum
Honored Contributor I
92 Views

The 'small' C library may well have a function to read a character directly from the JTAG UART fifo - it wouldn't be that big! 

But I wouldn't know what it was called!
Altera_Forum
Honored Contributor I
92 Views

The hal.enable_lightweight_device_driver_api must set to true if the small device drivers bsp option is checked. 

 

Both settings can be made in the BSP editor 

 

links: 

http://www.altera.com/support/kdb/solutions/rd10152012_873.html  

 

http://www.altera.com/literature/an/an459.pdf page 36
Reply