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

NIOS II Command Shell "make" issue with WSL

FPGAStormRaider
Beginner
1,645 Views

Hi,

I recently migrated from Quartus 18.1 to 20.1 (Lite). I installed WSL1 with Ubuntu 18.04 LTS and installed all necessary packages according to the Intel NIOSII guidelines. I am able to build and handle BSPs using Eclipse, no problem. However, my shell script to generate and build the BSP does not work anymore:

$QUARTUS_ROOTDIR/../nios2eds/nios2_command_shell.sh nios2-bsp hal . ../../hardware/$PROCESSOR_FILE.sopcinfo --cpu-name cpu

$QUARTUS_ROOTDIR/../nios2eds/nios2_command_shell.sh make

 

The nios2-bsp works, but the make gives me the error:

C:\intelFPGA_lite\20.1\quartus/../nios2eds/nios2_command_shell.sh: line 186: exec: make: not found

If I modify it to "wsl make", I get the following error:

Compiling alt_alarm_start.c...
nios2-elf-gcc.exe -xc -MP -MMD -c -I./newlib/nios2-elf/include -I./HAL/inc -I. -I./drivers/inc -pipe -D__hal__ -DALT_NO_INSTRUCTION_EMULATION -DALT_SINGLE_THREADED -O0 -g -Wall -mno-hw-div -mhw-mul -mno-hw-mulx -mgpopt=global -fno-math-errno -mcustom-fabss=224 -mcustom-fadds=253 -mcustom-fcmpeqs=227 -mcustom-fcmpges=228 -mcustom-fcmpgts=229 -mcustom-fcmples=230 -mcustom-fcmplts=231 -mcustom-fcmpnes=226 -mcustom-fdivs=255 -mcustom-fixsi=249 -mcustom-floatis=250 -mcustom-fmuls=252 -mcustom-fnegs=225 -mcustom-fsubs=254 -o obj/HAL/src/alt_alarm_start.o HAL/src/alt_alarm_start.c
make: nios2-elf-gcc.exe: Command not found
Makefile:553: recipe for target 'obj/HAL/src/alt_alarm_start.o' failed

 I tried to add the following before the line with the make command in the shell-script:

export WSLENV=PATH/l:${WSLENV}
sed -i 's/\(adjust-path[-mixed]*\) = .*/\1 = $1/' Makefile

but it didn't help.

 

Any idea why I cannot use make with my build script?

I use Windows 10 1909 build 18363.1256

0 Kudos
3 Replies
BoonBengT_Intel
Moderator
1,608 Views

Hi @FPGAStormRaider,

 

Thank you for posting in Intel community forum and hope this message find you well.
Would suggest to try on the following workaround to generate the make steps:
1) I believe you are able to use the Nios II SBT eclipse to build and generate the BSP
2) Delete the Makefiles from the apps project directory. (copy somewhere as backup if changes are done previously)
3) Open Nios ii command sheel and cd to the apps project directory
4) Execute the following command in shell "xport WSLENV=PATH/1:${WSLENV}" & "./create_this_app" (might be some error but do verify new Makefile are generated)
5) Edit the resulting new Makefile in the apps project directory as follows:
a) Approx line 326,change -“APP_LDFLAGS += -msys-lib=$(call adjust-path-mixed,$(SYS_LIB))” to “APP_LDFLAGS += -msys-lib=$(SYS_LIB)”
b) Approx line,132change –“BUILD_PRE_PROCESS :=” to “BUILD_PRE_PROCESS := touch $(ELF).srec”

 

Please do run a 'uname -r' in ubuntu and let us know what is return.
Do let us know if that steps helps.

 

Best Wishes
BB

FPGAStormRaider
Beginner
1,579 Views

Hi @BoonBengT_Intel,

 

I found the issue after running 'uname -r', as you suggested. While the correct Eclipse wsl command returned '4.4.0-18362-Microsoft', my shell script ran in MINGW64 and returned '3.1.7-340.x86_64'. This is why the path to the exes was not correct. Now I run the whole shell-script in the WSL Ubuntu and it works.

Thank you for the help!

0 Kudos
BoonBengT_Intel
Moderator
1,562 Views

Hi @FPGAStormRaider,

 

Good to know that it is working now and thanks for sharing your findings, this thread will be transitioned to community support. If you have new queries, please feel free to open a new thread to get support from Intel experts, and we would be right with you. Otherwise, the community users will further help you with doubts in this thread.

 

Best Wishes
BB

0 Kudos
Reply