- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm just trying to get nios II ide to work with a simple Hello_world_small application. But I get a compilation error related to the "alt_putstr()" function... The board is working without this function (ie. led counting etc..) I leave all the setting to the defaults settings ... Here, the first error : /cygdrive/c/altera/81/nios2eds/components/altera_hal/HAL/src/alt_putstr.c undefined reference to `null' Then the following 4 errors are related to this function... Here the console output :
**** Build of configuration Release for project hello_world_small_1 ****
make -s all includes
Compiling hello_world_small.c...
Linking hello_world_small_0.elf...
/cygdrive/c/NiosII/software/hello_world_small_0_syslib/Release/libhello_world_small_0_syslib.a(alt_putstr.o)(.text+0x1c): In function `alt_putstr':
/cygdrive/c/altera/81/nios2eds/components/altera_hal/HAL/src/alt_putstr.c:64: undefined reference to `null'
/cygdrive/c/NiosII/software/hello_world_small_0_syslib/Release/libhello_world_small_0_syslib.a(alt_putstr.o)(.text+0x20):/cygdrive/c/altera/81/nios2eds/components/altera_hal/HAL/src/alt_putstr.c:64: undefined reference to `null'
/cygdrive/c/NiosII/software/hello_world_small_0_syslib/Release/libhello_world_small_0_syslib.a(alt_putstr.o)(.text+0x28):/cygdrive/c/altera/81/nios2eds/components/altera_hal/HAL/src/alt_putstr.c:64: undefined reference to `ALT_MODULE_CLASS_null_write'
/cygdrive/c/NiosII/software/hello_world_small_0_syslib/Release/libhello_world_small_0_syslib.a(alt_putstr.o)(.text+0x2c):/cygdrive/c/altera/81/nios2eds/components/altera_hal/HAL/src/alt_putstr.c:64: undefined reference to `ALT_MODULE_CLASS_null_write'
collect2: ld returned 1 exit status
make: *** Error 1
Build completed in 14.321 seconds
Please help me, what's wrong ?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i think you can turn off the lightweight device driver API to get around this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much for your fast reply..
But what is the lightweight driver ? And where I can turn off this driver ? Thanks...- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
in Nios IDE right click on your project hello_world_small0 and go down to System Library Properties. then uncheck the Lightweight device driver API box.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thepancake !! Thank you !
It was my problem !! Now I don't have this problem !!! But, I don't see anything in the console of the nios II IDE... How can I get message in the console ? Thank you again for your previous fast replies !!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
make sure the stdout is set as jtag_uart in the same System Libraries window.
then run on your target hardware.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Man, you're the best !
Thank you for your fast reply ! I don't have the choice... I have only the "null" choice in the stdout, even in the stdin and stderr etc..- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What's wrong ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Uhhh... I forgot to place the jtag_uart module in SOPC...
Now I have jtag_uart_0, which is appear... But even it's selected, I don't have any echos in the console ? Here : the output of the consoleUsing cable "USB-Blaster ", device 1, instance 0x00
Pausing target processor: OK
Initializing CPU cache (if present)
OK
Downloading 00002000 ( 0%)
Downloaded 3KB in 0.0s
Verifying 00002000 ( 0%)
Verified OK
Leaving target processor paused
I made some reset (hard reset with a push button..) and I don't have anything else in the console output... What's is wrong please ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
is the clock connected and are you sure the reset is of correct polarity, it should be active high. i am not sure whether NIOS IDE will download the program file if either the clock or reset is not connected correctly. you might check niosforum.com for similar issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, i'm using Nios2 9.1 and i'm getting the same error...i cant find any system library properties...any way to solve it?
*Solved the problem by adding a JTAG_UART (stdout device) in SOPC- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i use quartus 10.1,and i can't find what you say " uncheck the Lightweight device driver API box",eager for your answer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I too hit this issue. It is rather a shame that the HAL does not provide the trivial support required to have both Lightweight Drivers enabled *and* no stdin/stdout/stderr devices selected.
The solution is pretty trivial. Drop something like this into a .c file in your project: struct ALT_MODULE_CLASS_null_state_s {void * dummy;} null; int alt_module_class_null_write(struct ALT_MODULE_CLASS_null_state_s * sp, const char* ptr, int len, int flags) { return len; }- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've had this issue on my board when I had switch for programm/run located in the wrong position.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page