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

Nios II Hello World Small Build/Compilation Error

Altera_Forum
Honored Contributor II
3,876 Views

Hello All, 

 

I am new to using the Nios II Embedded Processor and I am trying to create a new Nios II Application with the "Hello World Small" template just to learn and get familiarized with the tool. I am currently using Nios II 13.1 Eclipse SBT version. When I tried to build the project, I got the following errors: 

 

make: *** [NiosII_Test2_HelloWorldSmall2.elf] Error 1 NiosII_Test2_HelloWorldSmall2 C/C++ Problem 

undefined reference to `ALT_MODULE_CLASS_null_write' alt_putstr.c /NiosII_Test2_HelloWorldSmall2_bsp/HAL/src line 51 C/C++ Problem 

undefined reference to `null' alt_putstr.c /NiosII_Test2_HelloWorldSmall2_bsp/HAL/src line 51 C/C++ Problem 

 

C:\...\...\...\...\...\software\NiosII_Test2_HelloWorldSmall2_bsp/HAL/src/alt_putstr.c:51: undefined reference to `null' 

C:\...\...\...\...\...\software\NiosII_Test2_HelloWorldSmall2_bsp/HAL/src/alt_putstr.c:51: undefined reference to `null' 

C:\...\...\...\...\...\software\NiosII_Test2_HelloWorldSmall2_bsp/HAL/src/alt_putstr.c:51: undefined reference to `ALT_MODULE_CLASS_null_write' 

collect2.exe: error: ld returned 1 exit status 

make: *** [NiosII_Test2_HelloWorldSmall2.elf] Error 1 

 

In my BSP>HAL>src folder, it seems that the error is flagged under the "alt_putstr.c" file with this line of code marked: return ALT_DRIVER_WRITE(ALT_STDOUT_DEV, str, strlen(str), 0); 

 

I tried referring to http://www.alteraforum.com/forum/showthread.php?t=5956, but I couldn't find the location that was specified in this thread. 

 

Thanks for the help in advance.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
1,956 Views

Have you defined stdout? It could cause the issue you're seeing.

0 Kudos
Altera_Forum
Honored Contributor II
1,956 Views

Hello "slacker", 

 

I fixed the issue by going to the _bsp's file's Properties>"Nios II BSP Properties">BSP Editor...>Main Tab>Advanced>Uncheck "enable_lightweight_device_driver" 

 

Thanks!
0 Kudos
Reply