eCos Home

RedBoot Home


About eCos

Supported Hardware

Downloading and Installation

Documentation

FAQ

Mailing lists

Problems

Licensing

Anonymous CVS

Contributions and Third Party Projects

eCos
(Category) (Category) eCos FAQ :
Using eCos
Questions about using eCos, its APIs and the many components within it
Subcategories:
(Category) Problems when building eCos itself

Answers in this category:
(Answer) How do I create an application using eCos?

(Category) (Category) eCos FAQ : (Category) Using eCos :
Problems when building eCos itself
This section deals with problems found when building eCos itself, as in the eCos libraries and header files.
jlarmourATredhatDOTcom
Subcategories:

Answers in this category:
(Answer) Linking tests produces the error "section .FOO is not within region ram"

(Answer) (Category) eCos FAQ : (Category) Using eCos : (Category) Problems when building eCos itself :
Linking tests produces the error "section .FOO is not within region ram"
You get this when linking the eCos tests (or your application) and it happens because the defined memory layout for your target indicates that the program image will not fit!

This commonly happens with trying to squeeze the net stack, which is quite big, on RAM constrained targets.

Verify the memory layout to check it does fit your hardware, and generate a linker map to see where the memory is going. This can be done using the option -Wl,-Map,mapfile on the gcc link line to create a file called "mapfile" in the current directory of the build at that point. Note that if you add this to CYGBLD_GLOBAL_LDFLAGS in your ecos.ecc file, then for the eCos tests, the linker map file will be generated in the build tree subdirectory corresponding to the package.

Certainly, many configuration options can reduce the memory usage, including removing entire packages. The linker map gives a better guide as to where the memory is being used. In the case of the net stack for example, it is very wise to try to reduce the size of the buffers, i.e. the CYGPKG_NET_MEM_USAGE option.
jlarmourATredhatDOTcom

(Answer) (Category) eCos FAQ : (Category) Using eCos :
How do I create an application using eCos?
An eCos application is built in two steps.
  • Configure and build eCos kernel
  • Link kernel with application code

The first step is quite fully documented elsewhere. The problem comes with the second step, since it will be unfamiliar to most users. Some additional command line arguments for the C compiler will be necessary in order to link your application with the eCos kernel. The simplest way to set an example up is by using the "build_Makefile" script, which you will find alongside the eCos sample programs.

Assume that the eCos kernel was created in the directory "ECOS" and that the application is in the directory "APP".

  % cd APP
  % SRCS=file.c DST=file build_Makefile ECOS

This script will build a simple Makefile template, using the appropriate eCos tools setup used for building the eCos kernel. This Makefile can then be modified as necessary to handle the actual application code setup.

It uses the default eCos compilation flags. This may include some flags that the application does not require or desire such as warning options. Obviously those flags can just be deleted by editting the generated makefile. Consult the GCC manual to see what the various flags do if you don't already know.

If you are using the graphical configuration tools, these lay out the build directory structure in a slightly different way from the command line ecosconfig tool. This should be fixed eventually, but for the moment it can be worked around. If you created a configuration called example, then when saved there will be:

  example.ecc
  example_build/
  example_install/

So enter the example_build directory and type:
    ln -s ../example_install install

build_Makefile can then be used as before.

Note: build_Makefile is only a starting point. Most applications will require modifications to the resulting Makefile in order to be complete.

Previous: (Category) Installing the eCos distribution
Next: (Category) Using RedBoot
This document is: http://ecos.sourceware.org/fom/ecos?file=11
[Search] [Appearance] [Show Top Category Only]
This is a Faq-O-Matic 2.719.

Send any queries about the contents of this FAQ to the ecos-discuss mailing list
Send any operational queries about this FAQ to the eCos maintainers