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

Automatically create SREC file after build

Altera_Forum
Honored Contributor II
1,045 Views

I want to automatically create a SREC file from the elf file after the build. I know the command to use is as follows: 

 

nios2-elf-objcopy -O srec MyProg.elf MyProg.srec 

 

The thing that I do not know how to do is get the IDE (NIOS II V1.1.0 Build 137) to automatically do that after each build. Any help would be appreciated. 

 

thanx
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
346 Views

See the thread: "touch file (http://www.niosforum.com/forum/index.php?act=st&f=17&t=1425)" for a discussion on how to add additional make targets to the IDE build process. 

 

In your case you will need to use a rule of the form: 

 

MyProg.srec: MyProg.elf 

nios2-elf-objcopy -O srec $< $@
0 Kudos
Altera_Forum
Honored Contributor II
346 Views

Thanx, it gets me closer, but I still have a problem. I have a 3 projects in my Workspace. It gives me an error when I build because one of the projects builds before the the desired elf file is created. Therefore, I get errors in the build. Is there a way to only run my little make file for a particular project?  

 

After a little more investigating, I came across &#39;External Tools Builder&#39; in properties. I tried just writing a simple shell script that does the nios2-elf-objcopy, but I get an error stating that there was an error in the command line. Not much help from that message http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif  

 

The IDE seems to be a lot fuzzy about this. It seems simple what I want to do. I just cannot seem to find the needed info.... 

 

 

 

Thanks
0 Kudos
Reply