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

How to Pass an Extra Option to 'elf2hex' in a BSP's 'mem_init.mk'

Altera_Forum
Honored Contributor II
1,429 Views

Hi, 

 

This is a question for someone who is familiar with the NIOS II building system. 

 

When executing 'make mem_init_generate' I want the extra option '--record=4' passed to elf2hex. It seems that I have to modify 'mem_init.mk' in the BSP directory, but the 'mem_init.mk' is generated automatically and my change will be overwritten next time I regenerate the BSP :cry:... 

 

So, what is the best place to set this? 

 

Thanks, 

 

-- Alex
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
282 Views

Hi,  

 

I have the same problem with quartus v9.1 sp2 (I'm forced to use this version to be compatible with an IP license).  

Did you find a solution to add the --record=4 parameter to elf2hex command without modifying manually the script ? 

 

Regards, 

 

Claude
0 Kudos
Altera_Forum
Honored Contributor II
282 Views

Hi, 

 

I modified "mem_init.mk" in the bsp directory, then created a patch that I apply it automatically in "create_bsp.sh". 

 

Hope that helps, 

 

-- Alex
0 Kudos
Altera_Forum
Honored Contributor II
282 Views

It might be possible to replace the 'elf2hex' binary seen by the script (eg put it earlier in $PATH) to an executable shell script that contians: 

#!/bin/sh exec /full_path/elf2hex --record=4 "$@"where 'full_path' is the real location of the program.
0 Kudos
Reply