Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

SOPC Building Error

Hy All ,

I am building a simple LED test pattern from "Board diagnostics" and selecting my own system (created my SOPC builder in Quartus II).

After that I go to the "system library properties" and change the setting to "program never exits" and "small C library".

when i build them , i got below error message.

Description :

In Fuction 'GetInputString' : board_diag.o

in Function 'main' : board_diag.o

undefined reference to 'getc' : board_diag.c

undefined reference to 'sscanf' : board_diag.c

undefined reference to 'sscanf' : board_diag.c

Any reply will be appreciated.

Thank you ,

Yuyex.

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello,

    That's because you chose "small C library" in which scanf,getc..etc.dont work.If u deselect that "small C library",you will not get that error if you have enough program memory.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello,

    I know this error in Nios that's y i told u if u have enough programming memory then and then u will be able to run.

    Anyway,you can not run this code with on chip memory.And if u unchecked "small C library" then u will not be able to use those functions.

    In quartus ,u got that error only because u increase your on chip memory.Try to reduce it till it wont get an error.

    And yes,Think another way for nios II but that way wouldn't work.Hope you understood .
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you again Supal Shah:),

    "Anyway,you can not run this code with on chip memory.And if u unchecked 'small C library' then u will not be able to use those functions."

    From above statements, it means that i have to run the functions off-chip memory(which can be larger)?

    Btw , I want to ask another newbie question about UART.I added UART function to my system and i got "rxd_to_the_uart" and "txd_from_the_uart" pins.

    My question is it necessary for those pins to be assigned to any of my DE0 board?

    Thank you,

    Yuyex:o
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hy all ..

    I have checked the largest on-board mem for DE0 = 56 M9K = 56 x 2^13

    = 57,334 Byte.

    I made an 20480 Bytes on-board mem for my system.

    After I unchecked the "small C library", NIOS II needs me to add another 39912 Bytes (20,480+39,912=60,392Bytes which is larger then the limitation for my DE0 board on-board mem).

    Is there any suggestion for this prob?

    Any reply will be appreciated.

    Thank you,

    Yuyex:o