Skip to content
Snippets Groups Projects
NuttxPortingGuide.html 126 KiB
Newer Older
patacongo's avatar
patacongo committed
    Each MTD device driver must implement an instance of <code>struct mtd_dev_s</code>.
    That structure defines a call table with the following methods:
    <p>
      Erase the specified erase blocks (units are erase blocks):
    </p>
    <ul>
     <p><code>int (*erase)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks);</code></p>
    </ul>
    <p>
      Read/write from the specified read/write blocks:
    </p?
    <ul>
     <p><code>ssize_t (*bread)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR uint8_t *buffer);</code><br>
     <code>ssize_t (*bwrite)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR const uint8_t *buffer);</code></p>
patacongo's avatar
patacongo committed
    </ul>
    <p>
      Some devices may support byte oriented reads (optional).
      Most MTD devices are inherently block oriented so byte-oriented writing is not supported.
      It is recommended that low-level drivers not support read() if it requires buffering.
    </p>
    <ul>
     <p><code>ssize_t (*read)(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, FAR uint8_t *buffer);</code></p>
patacongo's avatar
patacongo committed
    </ul>
    <p>
      Support other, less frequently used commands:
    </p>
    <ul>
      <li><code>MTDIOC_GEOMETRY</code>:  Get MTD geometry</li>
      <li><code>MTDIOC_XIPBASE:</code>: Convert block to physical address for eXecute-In-Place</li>
      <li><code>MTDIOC_BULKERASE</code>: Erase the entire device</li>
    </ul>
    <p>
      is provided via a sinble <code>ioctl</code> method (see <code>include/nuttx/ioctl.h</code>):
    </p>
    <ul>
     <p><code>int (*ioctl)(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg);</code></p>
    </ul>
  </li>
  <li>
    <b>Binding MTD Drivers</b>.
    MTD drivers are not normally directly accessed by user code, but are usually bound to another,
    higher level device driver.
    In general, the binding sequence is:
    <ul>
      <li>Get an instance of <code>struct mtd_dev_s</code> from the hardware-specific MTD device driver, and </li>
      <li>Provide that instance to the initialization method of the higher level device driver.</li>
    </ul>
  </li>
  <li>
    <b>Examples</b>:
    <code>drivers/mtd/m25px.c</code> and <code>drivers/mtd/ftl.c</code>
  </li>
</ul>

<h3><a name="sdiodrivers">6.3.7 SDIO Device Drivers</a></h3>

<ul>
  <li>
    <b><code>include/nuttx/sdio.h</code></b>.
    All structures and APIs needed to work with serial drivers are provided in this header file.
  </li>
  <li>
    <b><code>struct sdio_dev_s</code></b>.
    Each MTD device driver must implement an instance of <code>struct sdio_dev_s</code>.
    That structure defines a call table with the following methods:
    <p>
      Initialization/setup:
    </p>
    <ul>
     <p><code>void (*reset)(FAR struct sdio_dev_s *dev);</code><br>
     <code>uint8_t (*status)(FAR struct sdio_dev_s *dev);</code><br>
     <code>void (*widebus)(FAR struct sdio_dev_s *dev, bool enable);</code><br>
patacongo's avatar
patacongo committed
     <code>void (*clock)(FAR struct sdio_dev_s *dev, enum sdio_clock_e rate);</code><br>
     <code>int (*attach)(FAR struct sdio_dev_s *dev);</code></p>
    </ul>
    <p>
      Command/Status/Data Transfer:
    </p?
    <ul>
     <p><code>void (*sendcmd)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t arg);</code><br>
     <code>int (*recvsetup)(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, size_t nbytes);</code><br>
     <code>int (*sendsetup)(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer, size_t nbytes);</code><br>
patacongo's avatar
patacongo committed
     <code>int (*cancel)(FAR struct sdio_dev_s *dev);</code><br>
     <code>int (*waitresponse)(FAR struct sdio_dev_s *dev, uint32_t cmd);</code><br>
     <code>int (*recvR1)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R1);</code><br>
     <code>int (*recvR2)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t R2[4]);</code><br>
     <code>int (*recvR3)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R3);</code><br>
     <code>int (*recvR4)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R4);</code><br>
     <code>int (*recvR5)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R5);</code><br>
     <code>int (*recvR6)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R6);</code><br>
     <code>int (*recvR7)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R7);</code></p>
patacongo's avatar
patacongo committed
    </ul>
    <p>
      Event/Callback support:
    </p>
    <ul>
     <p><code>void (*waitenable)(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset);</code><br>
     <code>sdio_eventset_t (*eventwait)(FAR struct sdio_dev_s *dev, uint32_t timeout);</code><br>
patacongo's avatar
patacongo committed
     <code>void (*callbackenable)(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset);</code><br>
     <code>int (*registercallback)(FAR struct sdio_dev_s *dev, worker_t callback, void *arg);</code></p>
    </ul>
    <p>
      DMA support:
    </p>
    <ul>
     <p><code>bool (*dmasupported)(FAR struct sdio_dev_s *dev);</code><br>
     <code>int (*dmarecvsetup)(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, size_t buflen);</code><br>
     <code>int (*dmasendsetup)(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer,  size_t buflen);</code></p>
patacongo's avatar
patacongo committed
    </ul>
  </li>
  <li>
    <b>Binding SDIO Drivers</b>.
    SDIO drivers are not normally directly accessed by user code, but are usually bound to another,
    higher level device driver.
    In general, the binding sequence is:
    <ul>
      <li>Get an instance of <code>struct sdio_dev_s</code> from the hardware-specific SDIO device driver, and </li>
      <li>Provide that instance to the initialization method of the higher level device driver.</li>
    </ul>
  </li>
  <li>
    <b>Examples</b>:
    <code>arch/arm/src/stm32/stm32_sdio.c</code> and <code>drivers/mmcsd/mmcsd_sdio.c</code>
  </li>
</ul>

<table width ="100%">
  <tr bgcolor="#e4e4e4">
    <td>
      <h1><a name="apndxconfigs">Appendix A:  NuttX Configuration Settings</a></h1>
    </td>
  </tr>
</table>
patacongo's avatar
patacongo committed

<p>
  The following variables are recognized by the build (you may
  also include architecture-specific settings).
</p>

<h2>Architecture selection</h2>
patacongo's avatar
patacongo committed
  The following configuration items select the architecture, chip, and
  board configuration for the build.
</p>
patacongo's avatar
patacongo committed
<ul>
  <li><code>CONFIG_ARCH</code>:
    Identifies the arch subdirectory</li>
  <li><code>CONFIG_ARCH_name</code>:
    For use in C code</li>
  <li><code>CONFIG_ARCH_CHIP</code>:
    Identifies the arch/*/chip subdirectory</li>
  <li><code>CONFIG_ARCH_CHIP_name</code>:
    For use in C code</li>
  <li><code>CONFIG_ARCH_BOARD</code>:
     Identifies the configs subdirectory and hence, the board that supports
     the particular chip or SoC.</li>
  <li><code>CONFIG_ARCH_BOARD_name</code>:
     For use in C code</li>
  <li><code>CONFIG_ENDIAN_BIG</code>:
     Define if big endian (default is little endian).</li>
  <li><code>CONFIG_ARCH_NOINTC</code>:
     Define if the architecture does not support an interrupt controller
     or otherwise cannot support APIs like up_enable_irq() and up_disable_irq().</li>
  <li><code>CONFIG_ARCH_IRQPRIO</code>:
patacongo's avatar
patacongo committed
     Define if the architecture supports prioritization of interrupts and the
     up_prioritize_irq() API.</li>
patacongo's avatar
patacongo committed
</ul>

  Some architectures require a description of the RAM configuration:
</p>
<ul>
  <li><code>CONFIG_DRAM_SIZE</code>:
    Describes the installed DRAM.</li>
  <li><code>CONFIG_DRAM_START</code>:
    The start address of DRAM (physical)</li>
  <li><code>CONFIG_DRAM_VSTART</code>:
    The start address of DRAM (virtual)</li>
<h2>Build Options</h2>
<p>
  General build options:
</p>
<ul>
  <li><code>CONFIG_RRLOAD_BINARY</code>:
    Make the rrload binary format used with BSPs from <a href="www.ridgerun.com">ridgerun.com</a>
    using the <code>tools/mkimage.sh</code> script.
  </li>
  <li><code>CONFIG_INTELHEX_BINARY</code>:
    Make the Intel HEX binary format used with many different loaders using the GNU objcopy program
patacongo's avatar
patacongo committed
    This option should not be selected if you are not using the GNU toolchain.
  <li><code>CONFIG_MOTOROLA_SREC</code>:
    Make the Motorola S-Record binary format used with many different loaders using the GNU objcopy program
    Should not be selected if you are not using the GNU toolchain.
  </li>
  <li><code>CONFIG_RAW_BINARY</code>:
patacongo's avatar
patacongo committed
    Make a raw binary format file used with many different loaders using the GNU objcopy program.
    This option  should not be selected if you are not using the GNU toolchain.
  </li>
  <li><code>CONFIG_HAVE_LIBM</code>:
    Toolchain supports libm.a
  </li>
  <li><code>CONFIG_HAVE_CXX</code>:
    Toolchain supports C++ and <code>CXX</code>, <code>CXXFLAGS</code>, and <code>COMPILEXX</code>
patacongo's avatar
patacongo committed
    have been defined in the configurations <code>Make.defs</code> file.
<p>
  Building application code:
</p>
patacongo's avatar
patacongo committed
<ul>
  <li>
    <p>
      <code>CONFIG_APP_DIR</code>: Ldentifies the directory that builds the application to link with NuttX.
      This symbol must be assigned to the path to the application build directory <i>relative</i> to the NuttX top build direcory.
      As an an example, there are several example applicatins in the NuttX <code>examples/</code> sub-directory.
      To use one of these example applications, say <code>nsh</code>, you would set <code>CONFIG_APP_DIR=examples/nsh</code>.
      If you had an application directory and the NuttX directory both within another directory like this:
<ul><pre>
build
 |-nuttx
 |  |
 |  `- Makefile
 `-application
    |
    `- Makefile
</pre></ul>
      Then you would set <code>CONFIG_APP_DIR=../application</code>.
    </p>
    <p>
      The application direction must contain <code>Makefile</code> and this make file must support the following targets:
      <ul>
        <li>
          <code>libapp$(LIBEXT)</code> (usually <code>libapp.a</code>).
          <code>libapp.a</code> is a static library ( an archive) that contains all of application object files.
        </li>
        <li>
          <code>clean</code>.
          Do whatever is appropriate to clean the application directories for a fresh build.
        </li>
        <li>
          <code>distclean</code>.
          Clean everthing -- auto-generated files, symbolic links etc. -- so that the directory contents are the same as the contents in your configuration management system.
          This is only done when you change the NuttX configuration.
        </li>
        <li>
          <code>depend</code>.
          Make or update the application build dependencies.
        </li>
      </ul>
    </p>
    <p>
      When this application is invoked it will receive the setting <code>TOPDIR</code> like:
      <ul>
        <code>$(MAKE) -C $(CONFIG_APP_DIR) TOPDIR=&quot;$(TOPDIR)&quot;</code> &lt;target&gt;
      </ul>
    </p>
    <p>
      <code>TOPDIR</code> is the full path to the NuttX directory.
      It can be used, for example, to include makefile fragments (e.g., <code>.config</code> or <code>Make.defs</code>) or to set up include file paths.
    </p>
patacongo's avatar
patacongo committed
  </li>
</ul>
<p>
  Two-pass Build Options.
  If the 2 pass build option is selected, then these options configure the make system build a extra link object.
  This link object is assumed to be an incremental (relative) link object, but could be a static library (archive)
  (some modification to this Makefile would be required if CONFIG_PASS1_OBJECT is an archive).
  Pass 1 1ncremental (relative) link objects should be put into the processor-specific source directory 
  where other link objects will be created - ff the pass1 obect is an archive, it could	go anywhere.
</p>
<ul>
  <li>
    <code>CONFIG_BUILD_2PASS</code>:
      Enables the two pass build options.
  </li>
</ul>
<p>
  When the two pass build option is enabled, the following also apply:
</p>
<ul>
  <li>
    <code>CONFIG_PASS1_OBJECT</code>: The name of the first pass object.
  </li>
  <li><code>CONFIG_PASS1_BUILDIR</code>:
  The path, relative to the top NuttX build directory to directory that contains the Makefile to build the first pass object.
  The Makefile must support the following targets:
  <ul>
    <li>The special target <code>arch/$(CONFIG_ARCH)/src/$(CONFIG_PASS1_OBJECT)</code>, and</li>
    <li>The usual depend, clean, and distclean targets.</li>
  </ul>
</ul>

<h2>General OS setup</h2>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_DEBUG</code>: enables built-in debug options
  </li>
  <li>
    <code>CONFIG_DEBUG_VERBOSE</code>: enables verbose debug output
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_DEBUG_SYMBOLS</code>: build without optimization and with debug symbols (needed for use with a debugger).
  </li>
  <li>
    <code>CONFIG_DEBUG_SCHED</code>: enable OS debug output (disabled by default)
  </li>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_DEBUG_MM</code>: enable memory management debug output (disabled by default)
    <code>CONFIG_DEBUG_NET</code>: enable network debug output (disabled by default)
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_DEBUG_USB</code>: enable USB debug output (disabled by default)
  </li>
patacongo's avatar
patacongo committed
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_DEBUG_FS</code>: enable file system debug output (disabled by default)
  </li>
  <li>
    <code>CONFIG_DEBUG_LIB</code>: enable C library debug output (disabled by default)
patacongo's avatar
patacongo committed
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_DEBUG_BINFMT</code>: enable binary loader debug output (disabled by default)
  </li>
  <li>
    <code>CONFIG_DEBUG_GRAPHICS</code>: enable NX graphics debug output (disabled by default)
  </li>
patacongo's avatar
patacongo committed
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_ARCH_LOWPUTC</code>: architecture supports low-level, boot
patacongo's avatar
patacongo committed
    time console output
  </li>
  <li>
    <code>CONFIG_MM_REGIONS</code>: If the architecture includes multiple
    regions of memory to allocate from, this specifies the
    number of memory regions that the memory manager must
    handle and enables the API mm_addregion(start, end);
  </li>
  <li>
    <code>CONFIG_TICKS_PER_MSEC</code>: The default system timer is 100Hz
    or <code>TICKS_PER_MSEC</code>=10.  This setting may be defined to inform NuttX
    that the processor hardware is providing system timer interrupts at some interrupt
    interval other than 10 msec.
  </li>
patacongo's avatar
patacongo committed
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_RR_INTERVAL</code>: The round robin time slice will be set
patacongo's avatar
patacongo committed
    this number of milliseconds;  Round robin scheduling can
    be disabled by setting this value to zero.
  </li>
  <li>
    <code>CONFIG_SCHED_INSTRUMENTATION</code>: enables instrumentation in 
    scheduler to monitor system performance
  </li>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_TASK_NAME_SIZE</code>: Specifies that maximum size of a
patacongo's avatar
patacongo committed
    task name to save in the TCB.  Useful if scheduler
    instrumentation is selected.  Set to zero to disable.
  </li>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_START_YEAR</code>, <code>CONFIG_START_MONTH</code>, <code>CONFIG_START_DAY</code> -
patacongo's avatar
patacongo committed
    Used to initialize the internal time logic.
  </li>
  <li>
    <code>CONFIG_GREGORIAN_TIME</code>: Enables Gregorian time conversions.
    You would only need this if you are concerned about accurate time conversions in
    the recent past or in the distant future.
  </li>
  <li>
    <code>CONFIG_JULIAN_TIME</code>: Enables Julian time conversions.
    You would only need this if you are concerned about accurate time conversion in the distand past.
    You must also define <code>CONFIG_GREGORIAN_TIME</code> in order to use Julian time.
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_DEV_CONSOLE</code>: Set if architecture-specific logic
    provides /dev/console.  Enables stdout, stderr, stdin.
  </li>
    <code>CONFIG_MUTEX_TYPES</code>: Set to enable support for recursive and
    errorcheck mutexes.  Enables <code>pthread_mutexattr_settype()</code>.
    <code>CONFIG_PRIORITY_INHERITANCE</code>: Set to enable support for
    priority inheritance on mutexes and semaphores.
patacongo's avatar
patacongo committed
    Priority inheritance is a strategy of addressing
    <a href="NuttxUserGuide.html#priorityinversion"><i>priority inversion</i></a>.
    Details of the NuttX implementation of priority inheritance is
    discussed <a href="NuttxUserGuide.html#priorityinheritance">elsewhere</a>.
    <code>CONFIG_SEM_PREALLOCHOLDERS</code>: This setting is only used
    if priority inheritance is enabled.
    It defines the maximum number of different threads (minus one) that
    can take counts on a semaphore with priority inheritance support.
    This may be set to zero if priority inheritance is disabled OR if you
    are only using semaphores as mutexes (only one holder) OR if no more
    than two threads participate using a counting semaphore.
  </li>
    <code>CONFIG_SEM_NNESTPRIO</code>: If priority inheritance is enabled,
    then this setting is the maximum number of higher priority threads (minus
    1) than can be waiting for another thread to release a count on a semaphore.
    This value may be set to zero if no more than one thread is expected to
    wait for a semaphore.
  </li>
  <li>
    <code>CONFIG_FDCLONE_DISABLE</code>: Disable cloning of all file descriptors
    by task_create() when a new task is started.
    If set, all files/drivers will appear to be closed in the new task.
  </li>
  <li>
    <code>CONFIG_FDCLONE_STDIO</code>: Disable cloning of all but the first
    three file descriptors (stdin, stdout, stderr) by task_create()
    when a new task is started.
    If set, all files/drivers will appear to be closed in the new task except
    for stdin, stdout, and stderr.
  </li>
  <li>
    <code>CONFIG_SDCLONE_DISABLE</code>: Disable cloning of all socket
    desciptors by task_create() when a new task is started.
    If set, all sockets will appear to be closed in the new task.
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NXFLAT</code>: Enable support for the NXFLAT binary format.
    This format will support execution of NuttX binaries located
    in a ROMFS filesystem (see <code>examples/nxflat</code>).
  <li>
    <code>CONFIG_SCHED_WORKQUEUE</code>: Create a dedicated "worker" thread to
    handle delayed processing from interrupt handlers.  This feature
    is required for some drivers but, if there are not complaints,
    can be safely disabled.  The worker thread also performs
    garbage collection -- completing any delayed memory deallocations
    from interrupt handlers.  If the worker thread is disabled,
    then that clean will be performed by the IDLE thread instead
    (which runs at the lowest of priority and may not be appropriate
    if memory reclamation is of high priority).  If CONFIG_SCHED_WORKQUEUE
    is enabled, then the following options can also be used:
  </li>
  <li>
    <code>CONFIG_SCHED_WORKPRIORITY</code>: The execution priority of the worker
    thread.  Default: 50
  </li>
  <li>
    <code>CONFIG_SCHED_WORKPERIOD</code>: How often the worker thread checks for
    work in units of microseconds.  Default: 50*1000 (50 MS).
  </li>
  <li>
    <code>CONFIG_SCHED_WORKSTACKSIZE</code>: The stack size allocated for the worker
    thread.  Default: CONFIG_IDLETHREAD_STACKSIZE.
  </li>
  <li>
    <code>CONFIG_SIG_SIGWORK</code>: The signal number that will be used to wake-up
    the worker thread.  Default: 4
  </li>
patacongo's avatar
patacongo committed
</ul>

<p>
 OS setup related to on-demand paging:
</p>
<ul>
  <li>
    <code>CONFIG_PAGING</code>: If set =y in your configation file, this setting will
          enable the on-demand paging feature as described in
          <a href="http://www.nuttx.org/NuttXDemandPaging.html">http://www.nuttx.org/NuttXDemandPaging.html</a>.
  </li>
</ul>

<p>
  If CONFIG_PAGING is selected, then you will probabaly need <code>CONFIG_BUILD_2PASS</code> to correctly position
  the code and the following configuration options also apply:
  <li>
    <code>CONFIG_PAGING_PAGESIZE</code>:
    The size of one managed page.
    This must be a value supported by the processor's memory management unit.
  </li>
  <li>
    <code>CONFIG_PAGING_NLOCKED</code>:
    This is the number of locked pages in the memory map.
    The locked address region will then be from <code>CONFIG_DRAM_VSTART</code> through
    (<code>CONFIG_DRAM_VSTART</code> + <code>CONFIG_PAGING_PAGESIZE</code>*<code>CONFIG_PAGING_NLOCKED</code>)
  </li>
  <li>
    <code>CONFIG_PAGING_LOCKED_PBASE</code> and <code>CONFIG_PAGING_LOCKED_VBASE</code>:
    These may be defined to determine the base address of the locked page regions.
    If neither are defined, the logic will be set the bases to <code>CONFIG_DRAM_START</code>
    and <code>CONFIG_DRAM_VSTART</code> (i.e., it assumes that the base address of the locked
    region is at the beginning of RAM).
    <b>NOTE</b>:
    In some architectures, it may be necessary to take some memory from the beginning
    of this region for vectors or for a page table.
    In such cases, <code>CONFIG_PAGING_LOCKED_P/VBASE</code> should take that into consideration
    to prevent overlapping the locked memory region and the system data at the beginning of SRAM.
  </li>
  <li>
    <code>CONFIG_PAGING_NPPAGED</code>:
    This is the number of physical pages available to support the paged text region.
    This paged region begins at
    (<code>CONFIG_PAGING_LOCKED_PBASE</code> + <code>CONFIG_PAGING_PAGESIZE</code>*<code>CONFIG_PAGING_NPPAGED</code>)
    and continues until
    (<code>CONFIG_PAGING_LOCKED_PBASE</code> + <code>CONFIG_PAGING_PAGESIZE</code>*(<code>CONFIG_PAGING_NLOCKED</code> +
    <code>CONFIG_PAGING_NPPAGED</code>)
  </li>
  <li>
    <code>CONFIG_PAGING_NVPAGED</code>:
    This actual size of the paged text region (in pages).
    This is also the number of virtual pages required to support the entire paged region.
    The on-demand paging feature is intended to support only the case where the virtual paged text
    area is much larger the available physical pages.
    Otherwise, why would you enable on-demand paging?
  </li>
  <li>
    <code>CONFIG_PAGING_NDATA</code>:
    This is the number of data pages in the memory map.
    The data region will extend to the end of RAM unless overridden by a setting in the configuration file.
    <b>NOTE</b>:
    In some architectures, it may be necessary to take some memory from the end of RAM for page tables
    or other system usage.
    The configuration settings and linker directives must be cognizant of that:
    <code>CONFIG_PAGING_NDATA</code> should be defined to prevent the data region from extending all the way to the end of memory. 
  <li>
    <code>CONFIG_PAGING_DEFPRIO</code>:
    The default, minimum priority of the page fill worker thread.
    The priority of the page fill work thread will be boosted boosted dynmically so that it matches the
    priority of the task on behalf of which it peforms the fill.
    This defines the minimum priority that will be used. Default: 50.
    <code>CONFIG_PAGING_STACKSIZE</code>:
    Defines the size of the allocated stack for the page fill worker thread. Default: 1024.
  </li>
  <li>
    <code>CONFIG_PAGING_BLOCKINGFILL</code>:
    The architecture specific <code>up_fillpage()</code> function may be blocking or non-blocking.
    If defined, this setting indicates that the <code>up_fillpage()</code> implementation will block until the
    transfer is completed. Default:  Undefined (non-blocking).
  </li>
  <li>
    <code>CONFIG_PAGING_WORKPERIOD</code>:
    The page fill worker thread will wake periodically even if there is no mapping to do.
    This selection controls that wake-up period (in microseconds).
    This wake-up a failsafe that will handle any cases where a single is lost (that would
    really be a bug and shouldn't happen!)
    and also supports timeouts for case of non-blocking, asynchronous fills (see <code>CONFIG_PAGING_TIMEOUT_TICKS</code>).
  </li>
  <li>
    <code>CONFIG_PAGING_TIMEOUT_TICKS</code>:
    If defined, the implementation will monitor the (asynchronous) page fill logic.
    If the fill takes longer than this number if microseconds, then a fatal error will be declared.
    Default: No timeouts monitored.
  </li>
  <p>
    Some architecture-specific settings. 
    Defaults are architecture specific.
    If you don't know what you are doing, it is best to leave these undefined and try the system defaults:
  </p>
  <li>
    <code>CONFIG_PAGING_VECPPAGE</code>:
    This the physical address of the page in memory to be mapped to the vector address.
  </li>
  <li>
    <code>CONFIG_PAGING_VECL2PADDR</code>:
    This is the physical address of the L2 page table entry to use for the vector mapping.
  </li>
  <li>
    <code>CONFIG_PAGING_VECL2VADDR</code>:
    This is the virtual address of the L2 page table entry to use for the vector mapping.
  </li>
  <li>
    <code>CONFIG_PAGING_BINPATH</code>:
    If <code>CONFIG_PAGING_BINPATH</code> is defined, then it is the full path to a file on a mounted file system that contains a binary image of the NuttX executable.
    Pages will be filled by reading from offsets into this file that correspond to virtual fault addresses.
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_PAGING_MOUNTPT</code>:
    If <code>CONFIG_PAGING_BINPATH</code> is defined, additional options may be provided to control the initialization of underlying devices.
    <code>CONFIG_PAGING_MOUNTPT</code> identifies the mountpoint to be used if a device is mounted.
  </li>
  <li>
    <code>CONFIG_PAGING_MINOR</code>:
    Some mount operations require a &quot;minor&quot; number to identify the specific device instance.
    Default: 0
  </li>
  <li>
    <code>CONFIG_PAGING_SDSLOT</code>:
    If <code>CONFIG_PAGING_BINPATH</code> is defined, additional options may be provided to control the initialization of underlying devices.
    <code>CONFIG_PAGING_SDSLOT</code> identifies the slot number of the SD device to initialize.
    This must be undefined if SD is not being used.
    This should be defined to be zero for the typical device that has only a single slot (See <code>CONFIG_MMCSD_NSLOTS</code>).
    If defined, <code>CONFIG_PAGING_SDSLOT</code> will instruct certain board-specific logic to initialize the media in this SD slot.
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_PAGING_M25PX</code>:
    Use the m25px.c FLASH driver.
    If this is selected, then the MTD interface to the M25Px device will be used to support paging.
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_PAGING_AT45DB</code>:
    Use the at45db.c FLASH driver.
    If this is selected, then the MTD interface to the Atmel AT45DB device will be used to support paging.
  </li>
  <li>
    <code>CONFIG_PAGING_BINOFFSET</code>:
    If CONFIG_PAGING_M25PX or CONFIG_PAGING_AT45DB is defined then CONFIG_PAGING_BINOFFSET will be used to specify the offset in bytes into the FLASH device where the NuttX binary image is located.
patacongo's avatar
patacongo committed
    Default: 0
  </li>
  <li>
    <code>CONFIG_PAGING_SPIPORT</code>:
    If CONFIG_PAGING_M25PX or CONFIG_PAGING_AT45DB is defined and the device has multiple SPI busses (ports), then this configuration should be set to indicate which SPI port the device is connected.
patacongo's avatar
patacongo committed
    Default: 0
  </li>
patacongo's avatar
patacongo committed
<p>
  The following can be used to disable categories of APIs supported
  by the OS.  If the compiler supports weak functions, then it
  should not be necessary to disable functions unless you want to
  restrict usage of those APIs.
</p>
<p>
  There are certain dependency relationships in these features.
</p>
<ul>
  <li>
    <code>mq_notify()</code> logic depends on signals to awaken tasks
    waiting for queues to become full or empty.
  </li>
  <li>
    <code>pthread_condtimedwait()</code> depends on signals to wake
    up waiting tasks.
  </li>
</ul>

<ul>
    <code>CONFIG_DISABLE_CLOCK</code>, <code>CONFI_DISABLE_POSIX_TIMERS</code>,
    <code>CONFIG_DISABLE_PTHREAD</code>, <code>CONFIG_DISABLE_SIGNALS</code>,
    <code>CONFIG_DISABLE_MQUEUE</code>, <code>CONFIG_DISABLE_MOUNTPOUNT</code>
patacongo's avatar
patacongo committed
</ul>

<h2>Miscellaneous libc settings</h2>

<ul>
  <li>
    <code>CONFIG_NOPRINTF_FIELDWIDTH</code>: sprintf-related logic is a
    little smaller if we do not support fieldwidthes
  </li>
  <li>
    <code>CONFIG_LIBC_FLOATINGPOINT</code>: By default, floating point
    support in printf, sscanf, etc. is disabled.
  </li>
patacongo's avatar
patacongo committed
</ul>

<h2>Allow for architecture optimized implementations</h2>

<p>
  The architecture can provide optimized versions of the
patacongo's avatar
patacongo committed
  following to improve system performance.
patacongo's avatar
patacongo committed
</p>

<ul>
<p>
  <code>CONFIG_ARCH_MEMCPY</code>, <code>CONFIG_ARCH_MEMCMP</code>, <code>CONFIG_ARCH_MEMMOVE</code>,
  <code>CONFIG_ARCH_MEMSET</code>, <code>CONFIG_ARCH_STRCMP</code>, <code>CONFIG_ARCH_STRCPY</code>,
patacongo's avatar
patacongo committed
  <code>CONFIG_ARCH_STRNCPY</code>, <code>CONFIG_ARCH_STRLEN</code>, <code>CONFIG_ARCH_STRNLEN</code>,
  <code>CONFIG_ARCH_BZERO</code>, <code>CONFIG_ARCH_KMALLOC</code>, <code>CONFIG_ARCH_KZMALLOC</code>,
  <code>ONFIG_ARCH_KFREE</code>,
patacongo's avatar
patacongo committed
</p>
</ul>

<h2>Sizes of configurable things (0 disables)</h2>

<ul>
  <li>
    <code>CONFIG_MAX_TASKS</code>: The maximum number of simultaneously
    active tasks.  This value must be a power of two.
  </li>
  <li>
    <code>CONFIG_NPTHREAD_KEYS</code>: The number of items of thread-
    specific data that can be retained
  </li>
  <li>
    <code>CONFIG_NFILE_DESCRIPTORS</code>: The maximum number of file
    descriptors (one for each open)
  </li>
  <li>
    <code>CONFIG_NFILE_STREAMS</code>: The maximum number of streams that
    can be fopen'ed
  </li>
  <li>
    <code>CONFIG_NAME_MAX</code>: The maximum size of a file name.
  </li>
  <li>
    <code>CONFIG_STDIO_BUFFER_SIZE</code>: Size of the buffer to allocate
    on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
  </li>
  <li>
    <code>CONFIG_NUNGET_CHARS</code>: Number of characters that can be
    buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
  </li>
  <li>
    <code>CONFIG_PREALLOC_MQ_MSGS</code>: The number of pre-allocated message
    structures.  The system manages a pool of preallocated
    message structures to minimize dynamic allocations
  </li>
  <li>
    <code>CONFIG_MQ_MAXMSGSIZE</code>: Message structures are allocated with
patacongo's avatar
patacongo committed
    a fixed payload size given by this setting (does not include
patacongo's avatar
patacongo committed
    other message structure overhead.
  </li>
  <li>
    <code>CONFIG_PREALLOC_WDOGS</code>: The number of pre-allocated watchdog
    structures.  The system manages a pool of preallocated
    watchdog structures to minimize dynamic allocations
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_PREALLOC_IGMPGROUPS</code>: Pre-allocated IGMP groups are used
    Only if needed from interrupt level group created (by the IGMP server).
    Default: 4
  </li>
patacongo's avatar
patacongo committed
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_DEV_PIPE_SIZE</code>: Size, in bytes, of the buffer to allocated
    for pipe and FIFO support (default is 1024).
patacongo's avatar
patacongo committed
  </li>
patacongo's avatar
patacongo committed
</ul>

patacongo's avatar
patacongo committed
<h2>File Systems</h2>
<ul>
  <li>
    <code>CONFIG_FS_FAT</code>: Enable FAT filesystem support.
  </li>
  <li>
    <code>CONFIG_FAT_SECTORSIZE</code>: Max supported sector size.
  </li>
  <li>
    <code>CONFIG_FS_ROMFS</code>: Enable ROMFS filesystem support
  </li>
</ul>

<h2>Device Drivers</h2>
<h3>SPI driver</h3>
<ul>
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_SPI_OWNBUS</code> - Set if there is only one active device
    on the SPI bus.  No locking or SPI configuration will be performed.
    It is not necessary for clients to lock, re-configure, etc..
  </li>
  <li>
    <code>CONFIG_SPI_EXCHANGE</code>: Driver supports a single exchange method
    (vs a recvblock() and sndblock ()methods)
  </li>
</ul>

<h3>SPI-based MMC/SD driver</h3>
<ul>
  <li>
    <code>CONFIG_MMCSD_NSLOTS</code>: Number of MMC/SD slots supported by the driver. Default is one.
  </li>
  <li>
    <code>CONFIG_MMCSD_READONLY</code>: Provide read-only access.  Default is Read/Write
  </li>
  <li>
    <code>CONFIG_MMCSD_SPICLOCK</code>: Maximum SPI clock to drive MMC/SD card. Default is 20MHz.
  </li>
<h3>SDIO-based MMC/SD driver</h3>
<ul>
  <li>
    <code>CONFIG_FS_READAHEAD</code>: Enable read-ahead buffering
  </li>
  <li>
    <code>CONFIG_FS_WRITEBUFFER</code>: Enable write buffering
  </li>
  <li>
    <code>CONFIG_SDIO_DMA</code>: SDIO driver supports DMA
  </li>
  <li>
    <code>CONFIG_MMCSD_MMCSUPPORT</code>: Enable support for MMC cards
  </li>
  <li>
    <code>CONFIG_MMCSD_HAVECARDDETECT</code>: SDIO driver card detection is 100% accurate
  </li>
</ul>

<h3>RiT P14201 OLED driver</h3>
<ul>
  <li>
    <code>CONFIG_LCD_P14201</code>: Enable P14201 support
  </li>
  <li>
    <code>CONFIG_P14201_SPIMODE</code>: Controls the SPI mode
  </li>
  <li>
    <code>CONFIG_P14201_FREQUENCY</code>: Define to use a different bus frequency
  </li>
  <li>
    <code>CONFIG_P14201_NINTERFACES</code>:
      Specifies the number of physical P14201 devices that will be supported.
  </li>
  <li>
    <code>CONFIG_P14201_FRAMEBUFFER</code>:
      If defined, accesses will be performed using an in-memory copy of the OLEDs GDDRAM.
      This cost of this buffer is 128 * 96 / 2 = 6Kb.
patacongo's avatar
patacongo committed
      If this is defined, then the driver will be fully functional.
      If not, then it will have the following limitations:
      <ul>
        <li>Reading graphics memory cannot be supported, and</li>
        <li>All pixel writes must be aligned to byte boundaries.</li>
      </ul>
patacongo's avatar
patacongo committed
      The latter limitation effectively reduces the 128x96 disply to 64x96.
patacongo's avatar
patacongo committed
<h3>Nokia 6100 Configuration Settings:</h3>
<ul>
  <li>
    <code>CONFIG_NOKIA6100_SPIMODE</code>: Controls the SPI mode,
  </li>
  <li>
    <code>CONFIG_NOKIA6100_FREQUENCY</code>: Define to use a different bus frequency.
  </li>
  <li>
    <code>CONFIG_NOKIA6100_NINTERFACES</code>:Specifies the number of physical Nokia
      6100 devices that will be supported.
  </li>
  <li>
    <code>CONFIG_NOKIA6100_BPP</code>: Device supports 8, 12, and 16 bits per pixel.
  </li>
  <li>
    <code>CONFIG_NOKIA6100_S1D15G10</code>: Selects the Epson S1D15G10 display controller
  </li>
  <li>
    <code>CONFIG_NOKIA6100_PCF8833</code>: Selects the Phillips PCF8833 display controller
  </li>
  <li>
    <code>CONFIG_NOKIA6100_BLINIT</code>: Initial backlight setting
  </li>
patacongo's avatar
patacongo committed
  <p>
    The following may need to be tuned for your hardware:
  </p>
  <li>
    <code>CONFIG_NOKIA6100_INVERT</code>: Display inversion, 0 or 1, Default: 1
  </li>
  <li>
    <code>CONFIG_NOKIA6100_MY</code>: Display row direction, 0 or 1, Default: 0
  </li>
  <li>
    <code>CONFIG_NOKIA6100_MX</code>: Display column direction, 0 or 1, Default: 1
  </li>
  <li>
    <code>CONFIG_NOKIA6100_V</code>: Display address direction, 0 or 1, Default: 0
  </li>
  <li>
    <code>CONFIG_NOKIA6100_ML</code>: Display scan direction, 0 or 1, Default: 0
  </li>
  <li>
    <code>CONFIG_NOKIA6100_RGBORD</code>: Display RGB order, 0 or 1, Default: 0
  </li>
patacongo's avatar
patacongo committed
  <p>
    Required LCD driver settings:
  </p>
  <li>
    <code>CONFIG_LCD_NOKIA6100</code>: Enable Nokia 6100 support
  </li>
  <li>
    <code>CONFIG_LCD_MAXCONTRAST</code>: Must be 63 with the Epson controller and 127 with
      the Phillips controller.
  </li>
  <li>
    <code>CONFIG_LCD_MAXPOWER</code>:Maximum value of backlight setting.  The backlight
      control is managed outside of the 6100 driver so this value has no
      meaning to the driver.  Board-specific logic may place restrictions on
      this value.
  </li>
</ul>

<h3>ENC28J60 Ethernet Driver Configuration Settings</h3>
<ul>
  <li>
    <code>CONFIG_NET_ENC28J60</code>: Enabled ENC28J60 support
  </li>
  <li>
    <code>CONFIG_ENC28J60_SPIMODE</code>: Controls the SPI mode
  </li>
  <li>
    <code>CONFIG_ENC28J60_FREQUENCY</code>: Define to use a different bus frequency
  </li>
  <li>
    <code>CONFIG_ENC28J60_NINTERFACES</code>:
      Specifies the number of physical ENC28J60 devices that will be supported.
  </li>
  <li>
    <code>CONFIG_ENC28J60_STATS</code>: Collect network statistics
  </li>
  <li>
    <code>CONFIG_ENC28J60_HALFDUPPLEX</code>: Default is full duplex
  </li>
</ul>

patacongo's avatar
patacongo committed
<h2>Network Support</h2>
<h3>TCP/IP and UDP support via uIP</h3>
patacongo's avatar
patacongo committed
<ul>
  <li>
    <code>CONFIG_NET</code>: Enable or disable all network features
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_IPv6</code>: Build in support for IPv6
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NSOCKET_DESCRIPTORS</code>: Maximum number of socket descriptors per task/thread.
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_NACTIVESOCKETS</code>:  Maximum number of concurrent socket  operations (recv, send, etc.).
    Default: <code>CONFIG_NET_TCP_CONNS</code>+<code>CONFIG_NET_UDP_CONNS</code>.
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_SOCKOPTS</code>: Enable or disable support for socket options.
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_BUFSIZE</code>: uIP buffer size
    <code>CONFIG_NET_TCP</code>: TCP support on or off
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_TCP_CONNS</code>: Maximum number of TCP connections (all tasks).
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_TCPBACKLOG</code>:
    Incoming connections pend in a backlog until <code>accept()</code> is called.
    The size of the backlog is selected when <code>listen()</code> is called.
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_TCP_READAHEAD_BUFSIZE</code>: Size of TCP read-ahead buffers
  </li>
  <li>
    <code>CONFIG_NET_NTCP_READAHEAD_BUFFERS</code>: Number of TCP read-ahead buffers (may be zero)
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_MAX_LISTENPORTS</code>: Maximum number of listening TCP ports (all tasks).
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_TCPURGDATA</code>: Determines if support for TCP urgent data
    notification should be compiled in. Urgent data (out-of-band data)
    is a rarely used TCP feature that is very seldom would be required.
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_UDP</code>: UDP support on or off
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_UDP_CHECKSUMS</code>: UDP checksums on or off
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_UDP_CONNS</code>: The maximum amount of concurrent UDP connections
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_ICMP</code>: Enable minimal ICMP support. Includes built-in support
    for sending replies to received ECHO (ping) requests.
  </li>
  <li>
    <code>CONFIG_NET_ICMP_PING</code>: Provide interfaces to support application level
    support for sending ECHO (ping) requests and associating ECHO replies.
patacongo's avatar
patacongo committed
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_IGMP</code>:  Enable IGMPv2 client support.
  </li>
  <li>
    <code>CONFIG_PREALLOC_IGMPGROUPS</code>: Pre-allocated IGMP groups are used
    Only if needed from interrupt level group created (by the IGMP server).
    Default: 4
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_PINGADDRCONF</code>: Use "ping" packet for setting IP address
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_STATISTICS</code>: uIP statistics on or off
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_RECEIVE_WINDOW</code>: The size of the advertised receiver's window
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_ARPTAB_SIZE</code>: The size of the ARP table
patacongo's avatar
patacongo committed
  </li>
patacongo's avatar
patacongo committed
  <li>
    <code>CONFIG_NET_ARP_IPIN</code>: Harvest IP/MAC address mappings for the ARP table from incoming IP packets.
  </li>
patacongo's avatar
patacongo committed
  <li>
patacongo's avatar
patacongo committed
    <code>CONFIG_NET_BROADCAST</code>: Incoming UDP broadcast support
  </li>
  <li>
    <code>CONFIG_NET_MULTICAST</code>: Outgoing multi-cast address support
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_LLH_LEN</code>: The link level header length
patacongo's avatar
patacongo committed
  </li>
  <li>
    <code>CONFIG_NET_FWCACHE_SIZE</code>: number of packets to remember when looking for duplicates