diff --git a/.gitignore b/.gitignore index 409232b7376b9c452400727cdac69f42ffdc2c69..3ec700458d0a455ed748bb4a6a498a844ae197b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,33 +1,30 @@ -.depend -Make.dep -*.o -*.a -*.d -*.i -*~ -.swp -.*.swp -core -.gdbinit -cscope.out -/.config -/.config.old -/.version -/Make.defs -/setenv.sh -/setenv.bat -/nuttx -/nuttx.* -/nuttx-* -/_SAVED_APPS_config -/*.map -/*.elf -/*.srec -/*.bin -/*.ihx -/*.hex -/pcode -/tags -/.settings/ -/.cproject -/.project +.depend +Make.dep +*.o +*.a +*.d +*.i +*~ +.swp +.*.swp +core +.gdbinit +cscope.out +/.config +/.config.old +/.version +/Make.defs +/setenv.sh +/setenv.bat +/nuttx +/nuttx.* +/nuttx-* +/_SAVED_APPS_config +/*.map +/*.elf +/*.srec +/*.bin +/*.ihx +/*.hex +/pcode +/tags diff --git a/COPYING b/COPYING index a8113ab027c91b871a68a2632d5f69200e4ca81b..2fcc3edc6addae4a73847bb6371d8297dfa489d2 100644 --- a/COPYING +++ b/COPYING @@ -225,44 +225,3 @@ drivers/video/ov2640 content of those tables and still retain this BSD license. I am guessing so, but I am not a copyright attorney so you should use this driver in products at your own risk. - -apps/netutils/pppd -^^^^^^^^^^^^^^^^^^ - - This implementation of PPPD has a license that is mostly compatible the - NuttX 3-clause BSD license, but includes a fourth clause that required - acknowledgement of Mike Johnson/Mycal Labs if it is built into your - product: - - Copyright (C) 2000, Mycal Labs www.mycal.com - Copyright (c) 2003, Mike Johnson, Mycal Labs, www.mycal.net - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by Mike Johnson/Mycal Labs - www.mycal.net. - 4. The name of the author may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ChangeLog b/ChangeLog index 10c9ed34b6033696313bbecee90ff2cc886b1adb..06eba68671da0b6923ee8f6f92fdfc0bda9313ea 100755 --- a/ChangeLog +++ b/ChangeLog @@ -12117,3 +12117,181 @@ (2016-06-21). * drivers/syslog: Extend SYSLOG logic so that we can send SYSLOG output to a file. Not verified on initial commit (2016-06-21). + * arch/arm/src/stm32l4: Add some CAN mode IOCTL calls. These will be + useful for device autotest when the application boots. They are + redundant with the CONFIG_CAN_LOOPBACK option, which can now just be + interpreted as a default setting. From Sebastien Lorquet (2016-06-22). + * drivers/syslog: syslog_dev_flush() needs to check if the inode is a + mountpoint before calling the flush() method. Noted by David Sidrane + (2016-06-22). + * arch/arm/src/stm32f7: Adds SDMMC1 for stm32F7 74-75. From Lok Tep + (2016-06-22). + * drivers/syslog: SYSLOG character device channel will now expand LF to + CR-LF. Controllable with a configuration option (2016-06-22). + * arch/arm/src/stm32l4: Implementation of loopback IOCTLs. From + Sebastien Lorquet (2016-06-22). + * Documentation: Add SYSLOG documentation to the porting guide + (2016-06-22). + * configs/stm32f746g-disco: Removed knsh configuration it failed to + refresh (via tools/refresh.sh). I assume that it is a hand-edited + configuration and, hence, must be removed from the repository + (2016-06-23). + * arch/arm/arc/sam34: DAC bugfix: DACC_WPMR_WPKEY_MASK -> DACC_WPMR_WPKEY. + Timer bugfix: Fix ops check in TCIOC_STOP. From Wolfgang Reissnegge + (2016-06-23). + * configs/nucleo-144: Added SDMMC support to Nucleo-144. From David + Sidrane (2016-06-23). + * arch/arm/src/stm32: Port STM32L4 CAN IOCTLs to STM32. From Sebastien + Lorquet (2016-06-24). + * drivers/ioexpander: Add support for a very simple GPIO driver. It + supports only pre-conrigured input and output pins and only basic + input and output operations (2016-06-24). + * arch/arm/src/lpc43xx: Correct auto-negotiation mode in the LPC43xx + Ethernet. From Alexander Vasiljev (2016-06-24) + * arch/arm/src/samv7: TWIHS Driver improved and GPIO-Driver fixed for + Open-Drain Pins + - sam_gpioread: Now the actual line level from the pin is read back. + This is extremely important for Open-Drain Pins, which can be used + bidirectionally + - Re-Implemented twi_reset-function and enhanced it so it can be + called from inside the driver (see next point) + - Glitch-Filter: Added a configuration option to enable the twi-built- + in glitch filter + - Added a "Single Master Mode": In EMC Testing the TWI-Bus got stuck + because the TWI-Master detected a Multi-Master access (but there is + no second master). With the option "Single Master" we detect these + events and automatically trigger a twi_reset. We also do an + automatic recovery if a slave got stuck (SDA stays low). + With the above changes I²C-Bus reliability in harsh environments (eg. + EMC) is greatly improved. The small change in the GPIO-Driver was + necessary because otherwise you cannot read back the correct line + status of Open-Drain Outputs and this is needed by the twi_reset + function. From Michael Spahlinger (2016-06-24) + * arch/arm/src/stm32f7: BUGFIX:PLLs IS2 and SAI P Calculation. From + David Sidrane (2016-06-24). + * arch/arm/src/stm32f7: USB support. From Lok Tep (2016-06-27). + * configs/olimex-stm32-e407: Add support for Olimex STM32 E407 + board. From Mateusz Szafoni (2016-06-27). + * drivers/ioexpander: Shadow-Mode: The output- and configuration + registers of the IO-Expander are held in the microcontrollers memory + and only written to the IO-Expander. This reduces bus traffic and + is more error-proof than the normal read-modify-write operation. Retry + Mode: If enabled and an error occurs while writing to the IO-Expander + the current transmission is automatically repeated once. From Michael + Spahlinger (2016-06-27). + * libc/hex2bin: Move the portable library portion of apps/system/hex2bin + to nuttx/libc/hex2bin where it can be shared with the OS internals + (2016-06-27). + * configs/nucleo-144: Added USB OTG device to Nucleo-144. From David + Sidrane (2016-06-27). + * arch/arm/src/stm32l4: STM32 CAN fixes need to be backported to + STM32L4 as well (2016-06-27). + * ARM stack check: Fix double fault on IDLE task with stack size = 0. + From David Sidrane (2016-06-27). + * configs/nucleo-144: Added bbsram test to Nucleo-144. From David + Sidrane (2016-06-27). + * arch/arm/src/stm32f7: Added PWR, RTC, and BBSRAM support for stm32f7. + From David Sidrane (2016-06-27). + * Build system: Fixed build of SAMV71-XULT/nsh. With the changes from + 26f7b8c the build process of the default configuration did not succeed + anymore. From Michael Spahlinger (2016-06-28). + * sched/semaphore: Need to set errno to EINVAL on errors in sem_post() + and sem_wait(). From Paul Alexander Patience (2016-06-28). + * Build system: This change fixes a build problem that only occurs when + reconfiguring from Linux to Windows or vice-versa. It is a problem + that was present but not usually experienced until two things happened: + (1) The pre_config target was added to run before the menconfig + operation and (2) the context target was added before the pre_config + target in order to set up the correct symbolic links (in the apps/platform + directory) needed by the pre_config target. + But then now if you start with a Linux system and run 'make menuconfig' + to switch to Linux, the context target will execute first and set up + POSIX style symbolic links before doing the menuconfig. Then after the + menuconfig, the make will fail on Windows if you are using a Windows + native toolchain because that native toolchain cannot follow the Cygwin- + style symbolic links. + The fix here is to also execute the clean_context AFTER executing + menuconfig. A lot more happens now: It used to be that doing 'make + menuconfig' only did the menuconfig operation. No it does context, + pre_config, menuconfig, clean_context. Not nearly as snappy as it used + to be (2016-06-28). + * arch/arm/src/efm32, lcp43, stm32, stm32l4: disable interrupts with + NVIC_IRQ_CLEAR. From Paul Alexander Patience (2016-06-28). + * arch/arm/src/stm32f7: STMF7xxx RTC: (1) Remove proxy #defines, (2) + Ensure the LSE(ON) etal are set and remembered in a) A cold start + (RTC_MAGIC invalid) of the RTC, and b) A warm start (RTC_MAGIC valid) + of the RTC but a clock change. The change was needed because in bench + testing a merge of the latest's STM32 53ec3ca (and friends) it became + apparent that the sequence of operation is wrong in the reset of the + Backup Domain in the RCC code. PWR is required before the Backup + Domain can be futzed with. !!!This Code should be tested on STM32 and + if needed rippled to the STM32 families. From David Sidrane + (2016-06-28). + * arch/arm/src/stm32f7: Added STMF7xxx RTC. From David Sidrane + (2016-06-28). + * arch/arm/src/stm32: STM32 BBSRAM fixed (and formatted) flags. From + David Sidrane (2016-06-28). + * arch/arm/src/stm32f7: STM32F7 BBSRAM fixed (and formatted) flags. + From David Sidrane (2016-06-28). + * arch/arm/src/stm32f7: Added STM32F7 DBGMCU. From David Sidrane + (2016-06-28). + * arch/arm/src/samv7: SAMV7: CAN Message Filtering fixed: (1) stdfilters + didn't work because the filter was never enabled (wrong number of bits + to shift), and (2) Filters were never used because the configuration + register cannot be written without using the initialization mode. + Both bugs are fixed by this change. Filtering has been tested with + both standard and extended identifiers and is now working properly. + From Michael Spahlinger (2016-06-29). + * configs/Kconfig and dummy/: Add logic to support custom board + directories that include a Kconfig file. During the context phase + of the build, any Kconfig file in the custom board directory is copied + into configs/dummy, replacing the existing Kconfig file with the + target Kconfig file (2016-06-29). + * arch/arm/src/stm32l4: Port support for both RX FIFOs from STM32 CAN. + From Paul Alexander Patience (2016-06-29). + * Remove all inclusion of header files from the apps/include directory. + This caused a lot of reshuffling of logic: binfmt pcode support, + usbmonitor is now a kernel thread, TZ/Olson database moved to + libc/zoneinfo (2016-06-29). + * drivers/mtd: Several MTD FLASH drivers nullify the freed 'priv' + structure and failed to return NULL as stated in the comments. + Result, will operate on a NULL pointer later. Noted by David Sidrane + (2016-06-30). + * arch/arm/src/kinetis: Add basic support for the K64 family. I + leveraged the changes from https://github.com/jmacintyre/nuttx-k64f + and merged into the existing kinetis code with a lot of changes and + additions (like pin multiplexing definitions). (2016-07-01). + * configs/freedom-k64f: Add support for the NXP Freedom-K64F board. + This is primarily the work of Jordan Macintyre. I leveraged this + code from https://github.com/jmacintyre/nuttx-k64f but with + significant corrections (LEDs, buttons, README, etc) and extensions + and updates to match more recent BSPs (2016-07-01). + * libc/signal: Add raise() (2016-07-04). + * drivers/syslog: Add a SYSLOG character device that can be used to re- + direct output to the SYSLOG (2016-07-05). + * net/netdev: Break out internal interface psock_ioctl() (2016-07-06). + * configs/stm32f4disovery: add can driver for stm32f4discovery. From + Matthias Renner (2016-07-06). + * configs/freedom-k64f: Increase MCU clock to 120MHz (2016-07-06). + * arch/arm/src/stm32: Add support for Tickless mode (two timer + implementation). From Max Neklyudov (2016-07-06). + * drivers/usbdev: cdcacm_unbind leaks write request objects. This + arises due to freeing the bulk IN endpoint before the loop that + frees the requests via cdcasm_freereq. That function checks the + parameters and skips the freeing if either is NULL. Freeing the bulk + IN enpoint will cause the first param to be NULL, thereby bypassing + the free operation. To fix, I moved the release of the bulk IN + endpoint until after to loop (much as was the case for the OUT and + read requests, which did not exhibit the problem). From ziggurat29 + (2016-07-07). + * arch/arm/src/stm32l4: Update usb dev/host controller drivers to + reflect new(ish) logging standards; augment device enpoint and fifo + allocation #defines to do more sanity checking, and be automatically + adaptive to size changes. Update README.txt to reflect current status + of the implementation. From ziggurat29 (2016-07-07). + * arch/arm/src/stm32f7: Fixed STM32F7 DMA stm32_dmacapable. DMA working + on SDMMC. From David Sidrane (2016-07-07). + * configs/stm32f4discovery: add configuration files for canard. From + Matthias Renner (2016-07-08). + * drivers/pipe: Add missing configuration for pipe ring buffer size. + From Frank Benkert (2016-07-08). diff --git a/Directories.mk b/Directories.mk index 2e42a8a435f25de41b1646e5bcea5a60787b7a86..2e55b91a94007f210ad4b6ab58700092a32e3bb3 100644 --- a/Directories.mk +++ b/Directories.mk @@ -74,7 +74,7 @@ endif NONFSDIRS = sched drivers configs $(ARCH_SRC) $(NUTTX_ADDONS) FSDIRS = fs binfmt -CONTEXTDIRS = $(APPDIR) +CONTEXTDIRS = configs $(APPDIR) USERDIRS = OTHERDIRS = lib @@ -114,6 +114,10 @@ else OTHERDIRS += syscall endif +ifeq ($(CONFIG_LIB_ZONEINFO_ROMFS),y) +CONTEXTDIRS += libc +endif + ifeq ($(CONFIG_NX),y) NONFSDIRS += graphics libnx CONTEXTDIRS += graphics libnx diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index b067a8c13983b15f2d557eee1c985a07865cb281..d36ca6f21049566911241ccbfc14b953f1a35161 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@

NuttX RTOS Porting Guide

-

Last Updated: May 12, 2016

+

Last Updated: June 22, 2016

@@ -208,11 +208,18 @@ 6.3.8 USB Host-Side Drivers
6.3.9 USB Device-Side Drivers
- 6.4 Power Management + 6.4 SYSLOG + 6.5 Power Management + Appendix A: NuttX Configuration Settings
@@ -5546,9 +5553,507 @@ int kbd_decode(FAR struct lib_instream_s *stream, FAR struct kbd_getstate_s *sta -

6.4 Power Management

+

6.4 SYSLOG

+ +

6.4.1 SYSLOG Interfaces

+

6.4.1.1 Standard SYSLOG Interfaces

+ + The NuttX SYSLOG is an architecture for getting debug and status + information from the system. The syslogging interfaces are defined in the + header file include/syslog.h. The primary interface to SYSLOG sub-system + is the function syslog() and, to a lesser extent, its companion vsyslog(): + +

6.4.1.2 syslog() and vsyslog()

+

Function Prototypes:

+ +

Description: + syslog() generates a log message. The priority argument is formed by ORing the facility and the level values (see include/syslog.h). The remaining arguments are a format, as in printf() and any arguments to the format. +

+

+ The NuttX implementation does not support any special formatting characters beyond those supported by printf(). +

+

+ The function vsyslog() performs the same task as syslog() with the difference that it takes a set of arguments which have been obtained using the stdarg variable argument list macros. +

+ +

6.4.1.3 setlogmask()

+

+ The additional setlogmask() interface can use use to filter SYSLOG output: +

+

Function Prototype:

+ +

Description: + The setlogmask() function sets the logmask and returns the previous mask. If the mask argument is zerio, the current logmask is not modified. +

+

+ The SYSLOG priorities are: LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, and LOG_DEBUG. The bit corresponding to a priority p is LOG_MASK(p); LOG_UPTO(p) provides the mask of all priorities in the above list up to and including p. +

+

+ Per OpenGroup.org "If the maskpri argument is 0, the current log mask is not modified." In this implementation, the value zero is permitted in order to disable all SYSLOG levels. +

+

+ REVISIT: Per POSIX the SYSLOG mask should be a per-process value but in NuttX, the scope of the mask is dependent on the nature of the build: +

+ +

+ The above are all standard interfaces as defined at OpenGroup.org. Those interfaces are available for use by application software. The remaining interfaces discussed in this section are non-standard, OS-internal interfaces. +

+ +

6.4.1.4 Debug Interfaces

+

+ In NuttX, syslog output is really synonymous to debug output and, herefore, the debugging interface macros defined in the header file + include/debug.h are also syslogging interfaces. Those macros are simply wrappers around syslog(). The debugging interfaces differ from the syslog interfaces in that: +

+ +

+ Each debug macro has a base name that represents the priority and a prefix that represents the sub-system. Each macro is individually initialized by both priority and sub-system. For example, uerr() is the macro used for error level messages from the USB subsystem and is enabled with CONFIG_DEBUG_USB_ERROR. +

+

+ The base debug macro names, their priority, and configuration variable are summarized below: +

+ + +

6.4.2 SYSLOG Channels

+

6.4.2.1 SYSLOG Channel Interfaces

+

+ In the NuttX SYSLOG implementation, the underlying device logic the supports the SYSLOG output is referred to as a SYSLOG channel. Each SYSLOG channel is represented by an interface defined in include/nuttx/syslog/syslog.h: +

+ +

+ The channel interface is instantiated by calling syslog_channel(): +

+ +

6.4.2.1 syslog_channel()

+

Function Prototype:

+ +

Description: + Configure the SYSLOG function to use the provided channel to generate SYSLOG output. +

+

+ syslog_channel() is a non-standard, internal OS interface and is not available to applications. It may be called numerous times as necessary to change channel interfaces. + By default, all system log output goes to console (/dev/console). +

+

Input Parmeters: +

+

Returned Value: +

+ +

6.4.2.2 SYSLOG Channel Initialization

+

+ The initial, default SYSLOG channel is established with statically initialized global variables so that some level of SYSLOG output may be available immediately upon reset. This initialized data is in the file drivers/syslog/syslog_channel.c. The initial SYSLOG capability is determined by the selected SYSLOG channel: +

+ +

+ The syslog channel device is initialized when the bring-up logic calls syslog_initialize(): +

+ +

6.4.2.3 syslog_initialize()

+

Function Prototype:

+ +

Description: + One power up, the SYSLOG facility is non-existent or limited to very low-level output. This function is called later in the initialization sequence after full driver support has been initialized. It installs the configured SYSLOG drivers and enables full SYSLOG capability. +

+

+ This function performs these basic operations: +

+ +

Input Parameters: +

+

Returned Value: + Zero (OK) is returned on success; a negated errno value is returned on any failure. +

+

+ Different types of SYSLOG devices have different OS initialization + requirements. Some are available immediately at reset, some are available + after some basic OS initialization, and some only after OS is fully + initialized. In order to satisfy these different initialization + requirements, syslog_initialize() is called twice from the boot-up logic: +

+ +

+ There are other types of SYSLOG channel devices that may require even further initialization. For example, the file SYSLOG channel (described below) cannot be initialized until the necessary file systems have been mounted. +

+ +

6.4.2.3 Interrupt Level SYSLOG Output

+

+ As a general statement, SYSLOG output only supports //normal// output from NuttX tasks. However, for debugging purposes, it is also useful to get SYSLOG output from interrupt level logic. In an embedded system, that is often where the most critical operations are performed. +

+

+ There are three conditions under which SYSLOG output generated from interrupt level processing can a included the SYSLOG output stream: +

+
    +
  1. +

    Low-Level Serial Output. + If you are using a SYSLOG console channel (CONFIG_SYSLOG_CONSOLE) with a serial console (CONFIG_SYSLOG_SERIAL_CONSOLE) and if the underlying architecture supports the low-level up_putc() interface(CONFIG_ARCH_LOWPUTC), then the SYLOG logic will direct the output to up_putc() which is capable of generating the serial output within the context of an interrupt handler. +

    +

    + There are a few issues in doing this however: +

    + + +
  2. +
  3. +

    In-Memory Buffering. + If the RAMLOG SYSLOG channel is supported, then all SYSLOG output is buffered in memory. Interrupt level SYSLOG output is no different than normal SYSLOG output in this case. +

    +
  4. +
  5. +

    Serialization Buffer. + A final option is the use the an interrupt buffer to buffer the interrupt level SYSLOG output. In this case: +

    + +

    + The SYSLOG interrupt buffer is enabled with CONFIG_SYSLOG_INTBUFFER. When the interrupt buffer is enabled, you must also provide the size of the interrupt buffer with CONFIG_SYSLOG_INTBUFSIZE. +

    +
  6. +
+ +

6.4.3 SYSLOG Channel Options

+

6.4.3.1 SYSLOG Console Device

+

+ The typical SYSLOG device is the system console. If you are using a serial console, for example, then the SYSLOG output will appear on that serial port. +

+

+ This SYSLOG channel is automatically selected by syslog_initialize() in the LATE initialization phase based on configuration options. The configuration options that affect this channel selection include: +

+ +

+ Interrupt level SYSLOG output will be lost unless: (1) the interrupt buffer + is enabled to support serialization, or (2) a serial console is used and + up_putc() is supported. +

+

+ NOTE: The console channel uses the fixed character device at /dev/console. The console channel is not synonymous with stdout (or file descriptor 1). stdout is the current output from a task when, say, printf() if used. Initially, stdout does, indeed, use the /dev/console device. However, stdout may subsequently be redirected to some other device or file. This is always the case, for example, when a transient device is used for a console -- such as a USB console or a Telnet console. The SYSLOG channel is not redirected as stdout is; the SYSLOG channel will stayed fixed (unless it is explicitly changed via syslog_channel()). +

+

+ References: drivers/syslog/syslog_consolechannel.c and + drivers/syslog/syslog_device.c +

+ +

6.4.3.2 SYSLOG Character Device

+

+ The system console device, /dev/console, is a character driver with some special properties. However, any character driver may be used as the SYSLOG output channel. For example, suppose you have a serial console on /dev/ttyS0 and you want SYSLOG output on /dev/ttyS1. Or suppose you support only a Telnet console but want to capture debug output /dev/ttyS0. +

+

+ This SYSLOG device channel is selected with CONFIG_SYSLOG_CHAR and has no other dependencies. Differences fromthe SYSLOG console channel include: +

+ +

+ References: drivers/syslog/syslog_devchannel.c and drivers/syslog/syslog_device.c +

+ +

6.4.3.3 SYSLOG File Device

+

+ Files can also be used as the sink for SYSLOG output. There is, however, a very fundamental difference in using a file as opposed the system console, a RAM buffer, or character device: You must first mount the file system that supports the SYSLOG file. That difference means that the file SYSLOG channel cannot be supported during the boot-up phase but can be instantiated later when board level logic configures the application environment, including mounting of the file systems. +

+

+ The interface syslog_file_channel() is used to configure the SYSLOG file channel: +

+ +

6.4.3.4 syslog_file_channel()

+

Function Prototype:

+ +

Description: + Configure to use a file in a mounted file system at devpath as the SYSLOG channel. +

+

+ This tiny function is simply a wrapper around syslog_dev_initialize() and syslog_channel(). It calls syslog_dev_initialize() to configure the character file at devpath then calls syslog_channel() to use that device as the SYSLOG output channel. +

+

+ File SYSLOG channels differ from other SYSLOG channels in that they cannot be established until after fully booting and mounting the target file system. This function would need to be called from board-specific bring-up logic AFTER mounting the file system containing devpath. +

+

+ SYSLOG data generated prior to calling syslog_file_channel() will, of course, not be included in the file. +

+

+ NOTE interrupt level SYSLOG output will be lost in this case unless the interrupt buffer is used. +

+ +

Input Parameters: +

+

Returned Value: + Zero (OK) is returned on success; a negated errno value is returned on any failure. +

+

+ References: drivers/syslog/syslog_filechannel.c, drivers/syslog/syslog_device.c, and include/nuttx/syslog/syslog.h. +

+ +

6.4.3.5 SYSLOG RAMLOG Device

+

+ The RAMLOG is a standalone feature that can be used to buffer any + character data in memory. There are, however, special configurations + that can be used to configure the RAMLOG as a SYSLOG channel. The RAMLOG + functionality is described in a more general way in the following + paragraphs. +

+ +

6.4.4 RAM Logging Device

+

+ The RAM logging driver is a driver that was intended to support debugging output (SYSLOG) when the normal serial output is not available. For example, if you are using a Telnet or USB serial console, the debug output will get lost -- or worse. For example, what if you want to debug the network over Telnet? +

+

+ The RAM logging driver can also accept debug output data from interrupt handler with no special serialization buffering. As an added benefit, the RAM logging driver is much less invasive. Since no actual I/O is performed with the debug output is generated, the RAM logger tends to be much faster and will interfere much less when used with time critical drivers. +

+

+ The RAM logging driver is similar to a pipe in that it saves the debugging output in a circular buffer in RAM. It differs from a pipe in numerous details as needed to support logging. +

+

+ This driver is built when CONFIG_RAMLOG is defined in the Nuttx configuration. +

+ +

6.4.4.1 dmesg

+

+ When the RAMLOG (with SYSLOG) is enabled, a new NuttShell (NSH) command will appear: dmesg. The dmesg command will dump the contents of the circular buffer to the console (and also clear the circular buffer). +

+ +

6.4.4.2 RAMLOG Configuration options

+ +

+ If CONFIG_RAMLOG_CONSOLE or CONFIG_RAMLOG_SYSLOG is selected, then the following must also be provided: +

+ +

+ Other miscellaneous settings +

+ + +

6.5 Power Management

-

6.4.1 Overview

+

6.5.1 Overview

Power Management (PM) Sub-System. NuttX supports a simple power management (PM) sub-system. This sub-system: @@ -5632,12 +6137,12 @@ int kbd_decode(FAR struct lib_instream_s *stream, FAR struct kbd_getstate_s *sta Multiple PM domains might be useful, for example, if you would want to control power states associated with a network separately from power states associated with a user interface.

-

6.4.2 Interfaces

+

6.5.2 Interfaces

All PM interfaces are declared in the file include/nuttx/power/pm.h.

-

6.4.2.1 pm_initialize()

+

6.5.2.1 pm_initialize()

Function Prototype: