This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Accessing flash memory


On Tue, Jan 24, 2006 at 03:16:19AM -0600, Peter Seebach wrote:
> In message <20060124082820.GI8395@lunn.ch>, Andrew Lunn writes:
> >Reading the documentation is a good place to start:
> 
> A followup on this.  I'm finding that there are things I can't even figure out
> where to find in the documentation, because I don't already know them to know
> where to look.
> 
> So, I should check the documentation.  Where should I even start looking?

If all else fails, grep -r is a good way to find things.
 
> For instance, imagine that I want a given feature.  How do I find out what
> to hand to "ecosconfig add" to get it?  I'll give a couple of specific
> examples I've run into:
> 
> 1.  I want "uint32_t".  This exists in <machine/types.h> in the ecos source
> tree.  It doesn't exist in install/include/* in my build tree.  Nothing in
> "ecosconfig list" says "<machine/types.h>".  In fact, the word "type" doesn't
> occur.  The string uint32_t doesn't occur in the documentation at all.
> There's no reference to <types.h> or anything like that.  The ISO specified
> <stdint.h> or <inttypes.h> aren't around.  Where should I look?

I've never used stdint.h in eCos code. I generally stick to the eCos
equivelent: cyg_uint32. 

machine/types is coming from the network stack and so is not a core
part of eCos. If eCos was to provide <stdint.h> and <stdbool.h>, i
think it would be in isoinfra which is include in every eCos
configuration. If you want to edd thiese files to eCos, that is where
i would suggest you put them.

> 2.  Undefined references for fileno.  No problem, I search the docs.
> I find a note in the docs that it's in the C stdio library.  ecosconfig list
> suggests I want "libc_stdio".  I add it.  Nothing changes; I still have
> undefined references to fieno.

a quick grep found:

2004-09-27  Jonathan Larmour  <jifl@eCosCentric.com>

        * cdl/stdio.cdl (CYGFUN_LIBC_STDIO_OPEN_POSIX_FDFUNCS): New option,
        to control whether or not fdopen()/fileno() are implemented.
        Only build fopen/fclose if CYGPKG_LIBC_STDIO_OPEN.

cdl_option CYGFUN_LIBC_STDIO_OPEN_POSIX_FDFUNCS {
            display       "POSIX fdopen/fileno functions"
            active_if     CYGPKG_LIBC_STDIO_FILEIO
            implements    CYGINT_ISO_STDIO_POSIX_FDFUNCS
            calculated    1
            description   "This identifies to the rest of the system
                           whether the POSIX fdopen() and
                           fileno() functions are implemented."
        }

My guess is you don't have CYGPKG_LIBC_STDIO_FILEIO enabled. 

> 3.  I want termios (tcsetattr, struct termios).  Where do I look?  Nothing
> in the documentation says anything but which features are implemented, and
> which aren't.

It is in io_serial. It will be disables by default so you need to
enable it: CYGPKG_IO_SERIAL_TERMIOS. You also need to configure which
serial port is is to be used on.

> I am quite open to the notion that there's an obvious way to use the
> documentation that I just haven't figured out.  I'm used to using grep for
> everything, but in the ecos tree, I haven't found a good way to ask the
> question "If I want this file, which I see in the source repository, which
> package do I add to get it?"

I guess most people work the other way around. They use the default
template, or the net template. This has most things enabled and so
don't run into some of these problems. The linker is quite good at
leave out what is not needed by an application, so the penalty for
doing it this way around is not very big. Once you have your
application working and you find you are short of RAM/ROM you can then
start disabling things.

> I guess what I'm trying to get at is that, while the documentation is pretty
> good at some things, it doesn't even come CLOSE to telling me what to do to
> enable a given feature.  The list of features ecosconfig lists is a very
> proper subset of the list of features referred to in the manual, and I can't
> find anything documenting how to go about turning features on that I want,
> except indirectly; maybe I'll get lucky and find a package that requires
> a given feature.

ecosconfig add/remove just provides the top level of configuration, it
includes or excludes the big blocks. For the fine level of
configuration you have to get inside the ecos.ecc. You can either do
this with a normal text editor, or you the configtool. It does take a
while to learn what is where if you don't use the default template.

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]