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

Nios II Eclipse report error when run the mem_init_generate command

Rainwang
New Contributor II
1,099 Views

i am working on a project with a Nios II inside C4 FPGA, which uses on chip memory as the RAM.

so after i build the project, i still need to run make targets-->Build -->mem_init_generate to generate the initialzation HEX file for the on chip RAM.

this works well so far.

but yesterday i must renew my laptop per the requirement from the company, and then i need to re-install the same tool chain: Quartus 21.1, WSL 18.04 on windows, CDT 8.8.1.

i believe i have done all steps per instructions, and the project can be built without error. but when i try to generate the HEX file, it reported below error.(I copied all information in the console window in case it helps)

please help me on this, thank you.

-----------------------------------

wsl make mem_init_generate
Info: Building /mnt/c/myproject/force_assist/G4_force_assisted_OTS_FPGA/01_project/software/OTS_power_assist_bsp/
make --no-print-directory -C /mnt/c/myproject/force_assist/G4_force_assisted_OTS_FPGA/01_project/software/OTS_power_assist_bsp/
[BSP build complete]
Post-processing to create mem_init/program_ram.hex...
elf2hex.exe OTS_power_assist.elf 0x00020000 0x0002bfff --width=32 --little-endian-mem --create-lanes=0 mem_init/program_ram.hex
Post-processing to create mem_init/hdl_sim/program_ram.dat...
elf2dat --infile=OTS_power_assist.elf --outfile=mem_init/hdl_sim/program_ram.dat \
--base=0x00020000 --end=0x0002bfff --width=32 \
--little-endian-mem --create-lanes=0
/mnt/c/intelFPGA/21.1/nios2eds/bin/elf2dat: 2: .: Can't open /bin/sh_pl.sh
/mnt/c/myproject/force_assist/G4_force_assisted_OTS_FPGA/01_project/software/OTS_power_assist_bsp/mem_init.mk:301: recipe for target 'mem_init/hdl_sim/program_ram.dat' failed
make: *** [mem_init/hdl_sim/program_ram.dat] Error 2

0 Kudos
1 Solution
JingyangTeh
Employee
801 Views

Hi


Could you try adding a new environment variable below :


Name: WSLENV

Value: SOPC_KIT_NIOS2/p


Regards

Jingyang, Teh


View solution in original post

0 Kudos
9 Replies
JingyangTeh
Employee
1,024 Views

Hi


Could you check the WSL version that you are using currently?

It should be WSL version 1.

"wsl -l -v" To check the version

"wsl --set-version <ubuntu version> 1" to set version.


Regards

Jingyang, Teh


0 Kudos
Rainwang
New Contributor II
878 Views

hi, Jingyang, 

 

I am very sorry to send response to you so late because I was on vacation in past 2 weeks and can't acess the E-mail.

i just checked my WSL version, it is version 1. please see the attachment and give me more comments.

 

thank you for the strong support.

Rain

 

捕获.PNG

0 Kudos
JingyangTeh
Employee
987 Views

Hi


Any update on this case?


Regards

Jingyang, Teh


0 Kudos
JingyangTeh
Employee
923 Views

Hi


As we do not receive any response from you on the previous question/reply/answer that we have provided. Please login to ‘https://supporttickets.intel.com/s/?language=en_US’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.


Regards

Jingyang, Teh


0 Kudos
JingyangTeh
Employee
863 Views

Hi


Just curious did you installed the required packages in the linux distribution?

https://www.intel.com/content/www/us/en/docs/programmable/683472/23-1/installing-windows-subsystem-for-linux.html


If you have done that, then could you try launching the eclipse ide with administrator privilege?


Regards

Jingyang, Teh


0 Kudos
Rainwang
New Contributor II
848 Views

Hi, 

I checked my installation per the link you provided, all steps were done.

1. windows version: 22H2 19045.4651

2. WSL 1 and Ubuntu 18.04 installed.

3. windows subsystem for linux option turned on.

4. After reset PC, below commands were run.

sudo apt update
 
sudo apt install wsl
 
sudo apt install dos2unix 
 
sudo apt install make
 
sudo apt install build-essential

5. try to generate the HEX file, still the same error appears.

6. open the Nios II EDS with administrator privilege, also the same error as below:

 

15:13:50 **** Build of configuration Nios II for project OTS_power_assist ****
wsl make mem_init_generate 
Info: Building /mnt/c/myproject/force_assist/G4_force_assisted_OTS_FPGA/01_project/software/OTS_power_assist_bsp/
make --no-print-directory -C /mnt/c/myproject/force_assist/G4_force_assisted_OTS_FPGA/01_project/software/OTS_power_assist_bsp/
[BSP build complete]
Post-processing to create mem_init/program_ram.hex...
elf2hex.exe OTS_power_assist.elf 0x00020000 0x0002bfff --width=32 --little-endian-mem --create-lanes=0 mem_init/program_ram.hex
Post-processing to create mem_init/hdl_sim/program_ram.dat...
elf2dat --infile=OTS_power_assist.elf --outfile=mem_init/hdl_sim/program_ram.dat \
--base=0x00020000 --end=0x0002bfff --width=32 \
--little-endian-mem --create-lanes=0 
/mnt/c/intelFPGA/21.1/nios2eds/bin/elf2dat: 2: .: Can't open /bin/sh_pl.sh
make: *** [mem_init/hdl_sim/program_ram.dat] Error 2
/mnt/c/myproject/force_assist/G4_force_assisted_OTS_FPGA/01_project/software/OTS_power_assist_bsp/mem_init.mk:301: recipe for target 'mem_init/hdl_sim/program_ram.dat' failed
 
15:13:52 Build Finished (took 1s.345ms)

 

 thanks and regards,

Rain

 

 

0 Kudos
JingyangTeh
Employee
802 Views

Hi


Could you try adding a new environment variable below :


Name: WSLENV

Value: SOPC_KIT_NIOS2/p


Regards

Jingyang, Teh


0 Kudos
Rainwang
New Contributor II
786 Views

hi, Jingyang,

 

with this variable added, the issue was solved!

 

thank you for the support!

rain 

0 Kudos
JingyangTeh
Employee
748 Views

Hi


I’m glad that your question has been addressed, I now transition this thread to community support. If you have a new question, Please login to ‘https://supporttickets.intel.com/s/?language=en_US’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.


Regards

Jingyang, Teh


0 Kudos
Reply