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

Adding new packages to a hardware template

Altera_Forum
Honored Contributor II
1,211 Views

Hi! 

 

I have a wallclock device that is not implemented in the std wallclocks of eCos. In Nios1, I managed to add a new wallclock device and include it in the target platform, but in Nios2, in the ecos.ecc file it says: 

# This section defines the toplevel configuration object. The only# values that can be changed are the name of the configuration and# the description field. It is not possible to modify the target,# the template or the set of packages simply by editing the lines# below because these changes have wide-ranging effects. Instead# the appropriate tools should be used to make such modifications. 

 

So I can't simply add my wallclock device, and include it in a new target? Which are "the appropiate tools?". I used to do it "by hand"... :-? 

 

aLeX
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
378 Views

The file you should edit is the ecos.db file in the packages directory of your install. You can add your new component to the nios2 targets there, or create your own target based on the ones provided. 

 

Making the change there avoids you having to edit machine generated files (which can cause your edits to be lost).
0 Kudos
Altera_Forum
Honored Contributor II
378 Views

Ok. I've done it and it works. I was trying to add the changes to ecos.ecc, when the file was ecos.db. 

 

Now... I have a question related. 

 

I&#39;ve added a new wqallclock device, but when I try to use it in my code, I have to include the file <cyg/io/wallclock.hxx>. The problem is that when I include any hxx or cxx in my program, it fails. 

 

Also, I&#39;ve found that in the previous version of ecos, there was a wallclock.h (or maybe watchdog.h, which was similar) in the io/wallclock section, that wrapped the "cxx" calls to "c" calls, so I was able to compile "C" code, without C++, and then it worked. Now there are no C wrappers... 

 

Now I am modifying this IO wallclock section to be able to use it, but I would appreciate any other ways, because I will have to modify it again when a new version arrives. 

 

Thank you  

 

aLeX
0 Kudos
Reply