Skip to content
README.txt 35.9 KiB
Newer Older
patacongo's avatar
patacongo committed
README
^^^^^^

patacongo's avatar
patacongo committed
  o Installation
    - Installing Cygwin
    - Download and Unpack
    - Semi-Optional apps/ Package
    - Installation Directories with Spaces in the Path
    - Notes about Header Files
patacongo's avatar
patacongo committed
  o Configuring NuttX
    - Instantiating "Canned" Configurations
    - NuttX Configuration Tool
patacongo's avatar
patacongo committed
  o Toolchains
    - Cross-Development Toolchains
    - NuttX Buildroot Toolchain
  o Shells
patacongo's avatar
patacongo committed
  o Building NuttX
  o Cygwin Build Problems
    - Strange Path Problems
    - Window Native Toolchain Issues
patacongo's avatar
patacongo committed
  o Documentation

patacongo's avatar
patacongo committed
INSTALLATION
^^^^^^^^^^^^

patacongo's avatar
patacongo committed
Installing Cygwin
patacongo's avatar
patacongo committed

  NuttX may be installed and built on a Linux system or on a Windows
  system if Cygwin is installed.  Installing Cygwin on your Windows PC
  is simple, but time consuming.  See http://www.cygwin.com/ for
  installation instructions. Basically you just need to download a
  tiny setup.exe program and it does the real, internet installation
  for you.

  Some Cygwin installation tips:
  
  1. Install at C:\cygwin

  2. Install EVERYTHING:  "Only the minimal base packages from the
     Cygwin distribution are installed by default. Clicking on categories
     and packages in the setup.exe package installation screen will
     provide you with the ability to control what is installed or updated.
     Clicking on the "Default" field next to the "All" category will
     provide you with the opportunity to install every Cygwin package.
     Be advised that this will download and install hundreds of megabytes
     to your computer."
     
     If you use the "default" installation, you will be missing many
     of the Cygwin utilities that you will need to build NuttX.  The
     build will fail in numerous places because of missing packages.

  After installing Cygwin, you will get lots of links for installed
  tools and shells.  I use the RXVT native shell.  It is fast and reliable
  and does not require you to run the Cygwin X server (which is neither
  fast nor reliable).  The rest of these instructions assume that you
  are at a bash command line prompt in either Linux or in Cygwin shell.

Download and Unpack
-------------------

  Download and unpack the NuttX tarball.  If you are reading this, then
  you have probably already done that.  After unpacking, you will end
  up with a directory called nuttx-version (where version is the NuttX
  version number). You might want to rename that directory nuttx to
  match the various instructions in the documentation and some scripts
  in the source tree.

Semi-Optional apps/ Package
---------------------------
patacongo's avatar
patacongo committed

  All NuttX libraries and example code used to be in included within
  the NuttX source tree.  As of NuttX-6.0, this application code was
  moved into a separate tarball, the apps tarball.  If you are just
  beginning with NuttX, then you will want to download the versioned
  apps tarball along with the NuttX tarball.  If you already have your
  own product application directory, then you may not need the apps
  tarball.

  It is call "Semi-optional" because if you don't have some apps/
  directory, NuttX will *fail* to build!

  Download the unpack the apps tarball in the same directly where you
  unpacked the NuttX tarball.  After you unpack the apps tarball, you
  will have a new directory called apps-version (where the version
patacongo's avatar
patacongo committed
  should exactly match the version of the NuttX tarball).  Again, you
  might want to rename the directory to simply apps/ to match what
  you read in the documentation
  
  After unpacking the apps tarball, you will have two directories side
  by side like this:
  
             |
        +----+----+
        |         |
      nuttx/     apps/

  This is important because the NuttX build will expect to find the
  apps directory in that (default) location.  )That default location
  can be changed by editing your NuttX configuration file, but that
patacongo's avatar
patacongo committed
  is another story).

Installation Directories with Spaces in the Path
------------------------------------------------
patacongo's avatar
patacongo committed

  The nuttx build directory should reside in a path that contains no
  spaces in any higher level directory name.  For example, under
  Cygwin, your home directory might be formed from your first and last
  names like: "/home/First Last". That will cause strange errors when
  the make system tries to build.

  [Actually, that problem is probably not to difficult to fix.  Some
patacongo's avatar
patacongo committed
   Makefiles probably just need some paths within double quotes]
patacongo's avatar
patacongo committed

  I work around spaces in the home directory name, by creating a
  new directory that does not contain any spaces, such as /home/nuttx.
  Then I install NuttX in /home/nuttx and always build from 
  /home/nuttx/nuttx-code.
Notes about Header Files
------------------------
  Other C-Library Header Files.
    Some toolchains are built with header files extracted from a C-library
    distribution (such as newlib).  These header files must *not* be used
    with NuttX because NuttX provides its own, built-in C-Library.  For
    toolchains that do include built-in header files from a foreign C-
    Library, NuttX must be compiled without using the standard header files
    that are distributed with your toolchain.  This prevents including
    conflicting, incompatible header files (such as stdio.h).
  Header Files Provided by Your Toolchain.

    Certain header files, such as setjmp.h, stdarg.h, and math.h, may still
    be needed from your toolchain and your compiler may not, however, be able
    to find these if you compile NuttX without using standard header file.
    If that is the case, one solution is to copy those header file from
    your toolchain into the NuttX include directory.

  Duplicated Header Files.

    There are also a few header files that can be found in the nuttx/include
    directory which are duplicated by the header files from your toolchain.
    stdint.h and stdbool.h are examples.  If you prefer to use the stdint.h
    and stdbool.h header files from your toolchain, those could be copied
    into the nuttx/include/ directory. Using most other header files from
    your toolchain would probably cause errors.

  math.h

    Even though you should not use a foreign C-Library, you may still need
    to use other, external libraries with NuttX.  In particular, you may
    need to use the math library, libm.a.  NuttX supports a generic, built-in
    math library that can be enabled using CONFIG_LIBM=y.  However, you may
    still want to use a higher performance external math library that has
    been tuned for your CPU.  Sometimes such such tuned math libraries are
    bundled with your toolchain.

    The math libary header file, math.h, is a then special case.  If you do
    nothing, the standard math.h header file that is provided with your
    toolchain will be used.

    If you have a custom, architecture specific math.h header file, then
    that header file should be placed at arch/<cpu>/include/math.h.  There
    is a stub math.h header file located at include/nuttx/math.h.  This stub
    header file can be used to "redirect" the inclusion to an architecture-
    specific math.h header file.  If you add an architecture specific math.h
    header file then you should also define CONFIG_ARCH_MATH_H=y in your
    NuttX Configuration file.  If CONFIG_ARCH_MATH_H is selected, then the
    top-level Makefile will copy the stub math.h header file from
    include/nuttx/matn.h to include/math.h where it will become the system
    math.h header file.  The stub math.h header file does nothing other
    than to include that archicture-specific math.h header file as the
    system math.h header file.
  float.h

    If you enable the generic, built-in math library, then that math library
    will expect your toolchain to provide the standard float.h header file.
    The float.h header file defines the properties of your floating point
    implementation.  It would always be best to use your toolchain's float.h
    header file but if none is avaiable, a default float.h header file will
    provided if this option is selected.  However, there is no assurance that
    the settings in this float.h are actually correct for your platform!

  stdarg.h

    In most cases, the correct version of stdarg.h is the version provided with your toolchain.  However, sometimes there are issues with with using your toolchains stdarg.h.  For example, it may attempt to draw in header files that do not exist in NuttX or perhaps the header files that is uses are not compatible with the NuttX header files.  In those cases, you can use an architecture-specific stdarg.h header file by defining CONFIG_ARCH_STDARG_H=y.
    See the discussion above for the math.h header.  This setting works exactly
    the same for the stdarg.h header file.

patacongo's avatar
patacongo committed
CONFIGURING NUTTX
^^^^^^^^^^^^^^^^^

Loading full blame...