Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

Adding new packages to a hardware template

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

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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