diff --git a/.gitee/ISSUE_TEMPLATE.zh-CN.md b/.gitee/ISSUE_TEMPLATE.zh-CN.md new file mode 100755 index 0000000..f09d98d --- /dev/null +++ b/.gitee/ISSUE_TEMPLATE.zh-CN.md @@ -0,0 +1,13 @@ +### 该问题是怎么引起的? + + + +### 重现步骤 + + + +### 报错信息 + + + + diff --git a/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md b/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md new file mode 100755 index 0000000..33948fd --- /dev/null +++ b/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md @@ -0,0 +1,15 @@ +### 相关的Issue + + +### 原因(目的、解决的问题等) + + +### 描述(做了什么,变更了什么) + + +### 测试用例(新增、改动、可能影响的功能) + + + + + diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..126cc2d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.swp +cscope.* diff --git a/COPYING b/COPYING new file mode 100755 index 0000000..07779ee --- /dev/null +++ b/COPYING @@ -0,0 +1,296 @@ +COPYING +======= + +Describes the terms under which Nuttx is distributed. A copy of the BSD- +style licensing is included in this file. In my words -- I believe that you +should free to use NuttX in any environment, private, private, commercial, +open, closed, etc. provided only that you respect the modest copyright +notices as described in license (below), respect Trademarks, and include a +copy of the BSD license. Please feel free to contact me if you have any +icensing concerns. + +Tool Licenses +------------- + +Tools under the nuttx/tools directory are not intended for binary +distribution. You may find other licensing on individual tools in that +directory. If you intend to redistribute these tools in binary form, please +respect the individual license of each tool as identified in the file header +of the tool source files. + +Copyright Date Notation +----------------------- + +Copyright information is provided in the header of each file. This +copyright information includes the name of the copyright holder and the +year(s) in which copyrighted additions to the file were made to the file. +A comma (',') is used to separate years in the list of years. A hyphen ('-') +is used as a more compact notation when additions were made over several +consecutive years. So for example, "2007, 2011" would mean that copyrighted +additions were made during the years of 2007 and 2011 whereas "2007-2011" +would indicate copyrighted additions in the years 2007, 2008, 2009, 2010, +and 2011. + +Copyright Line Continuation +--------------------------- + +Copy information which exceeds the usable line lengh may be broken and +continued on the following line, such as: + + Copyright (C) 2007-2010, 2012, 2014-2015, 2017 Gregory Nutt. All + rights reserved. + +NuttX +===== + +License for NuttX in general (authorship and copyright dates on individual +files will vary): + +/**************************************************************************** + * directory path/filename + * + * Copyright (C) 2007-2019 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +FAT Long File Names +=================== + + NOTE: If CONFIG_FAT_LFN is defined in your NuttX configuration file, then + there may be some legal, patent issues. The following was extracted from + the entry "File Allocation Table from Wikipedia, the free encyclopedia: + + "On December 3, 2003 Microsoft announced it would be offering licenses + for use of its FAT specification and 'associated intellectual property', + at the cost of a US$0.25 royalty per unit sold, with a $250,000 maximum + royalty per license agreement. + + o "U.S. Patent 5,745,902 (http://www.google.com/patents?vid=5745902) - + Method and system for accessing a file using file names having + different file name formats. ... + o "U.S. Patent 5,579,517 (http://www.google.com/patents?vid=5579517) - + Common name space for long and short filenames. ... + o "U.S. Patent 5,758,352 (http://www.google.com/patents?vid=5758352) - + Common name space for long and short filenames. ... + o "U.S. Patent 6,286,013 (http://www.google.com/patents?vid=6286013) - + Method and system for providing a common name space for long and + short file names in an operating system. ... + + "Many technical commentators have concluded that these patents only cover + FAT implementations that include support for long filenames, and that + removable solid state media and consumer devices only using short names + would be unaffected. ..." + + This Wikipedia entry has been updated with recent legal decisions in favor + of Microsoft. Refer to: + + https://en.wikipedia.org/wiki/File_Allocation_Table#Patents + + So you have been forewarned: Use the long filename at your own risk! + +uIP +=== + +Many lower-level networking components of NuttX derive from uIP which +has a similar BSD style license: + + Copyright (c) 2001-2003, Adam Dunkels. + All rights reserved. + +Rhombus Math Library +==================== + +The math library used in NuttX derives from the Rhombus OS by Nick Johnson +(with many, many addtions). The Rhombus OS is/was distributed under the ISC +license. The ISC licsense is a permissive license that allows people do +anything with your code with proper attribution and without warranty. The +ISC license is functionally equivalent to the BSD 2-Clause and MIT licenses, +removing some language that is no longer necessary. + +IGMP +=== + +IGMP support, if enabled, adds additional logic by Steve Reynolds: + + Copyright (c) 2002 CITEL Technologies Ltd. + All rights reserved. + +The HID Parser in drivers/usbhost +================================= + + Adapted from the LUFA Library (MIT license): + + Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + dean [at] fourwalledcubicle [dot] com, www.lufa-lib.org + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. + +Certain functions in the NuttX C-library derive from other BSD-compatible +sources: + +fs/nfs +====== + + NFS: + + Copyright (c) 1989, 1991, 1993, 1995 The Regents of the University of + California. All rights reserved. + + and RPC also has: + + Copyright (c) 2004 The Regents of the University of Michigan. + Copyright (c) 2004 Weston Andros Adamson . + Copyright (c) 2004 Marius Aamodt Eriksen . + + The University of Michigan uses a modified BSD license equivalent to + the NuttX license. The University of California code uses the original + BSD license and requires that I state the following: + + "This product includes software developed by the University of + California, Berkeley and its contributors." + +fs/spiffs +========= + + The MIT License (MIT) + + Copyright (c) 2013-2017 Peter Andersson (pelleplutt1976gmail.com) + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +strtod() +======== + + Copyright (C) 2002 Michael Ringgaard. All rights reserved. + Copyright (C) 2006-2007 H. Peter Anvin. + +dtoa() +====== + + If you enable floating point conversions with CONFIG_LIBC_FLOATINGPOINT, + then some files with an unmodified BSD license will be included. That + license is similar to the above (modified) BSD license, but has an + additional requirement that I state the following: + + "This product includes software developed by the University of + California, Berkeley and its contributors." + +libc/string/lib_vikmemcpy.c +=========================== + + If you enable CONFIG_MEMCPY_VIK, then you will build with the optimized + version of memcpy from Daniel Vik. Licensing information for that version + of memcpy() follows: + + Copyright (C) 1999-2010 Daniel Vik + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any + damages arising from the use of this software. + Permission is granted to anyone to use this software for any + purpose, including commercial applications, and to alter it and + redistribute it freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you + use this software in a product, an acknowledgment in the + use this software in a product, an acknowledgment in the + product documentation would be appreciated but is not + required. + + 2. Altered source versions must be plainly marked as such, and + must not be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. + +libs/libc/math +============== + + If you enable CONFIG_LIB, you will build the math library at libc/math. + This library was taken from the math library developed for the Rhombus + OS by Nick Johnson (https://github.com/nickbjohnson4224/rhombus). This + port was contributed by Darcy Gong. The Rhombus math library has this + compatible MIT license: + + Copyright (C) 2009-2011 Nick Johnson + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + +drivers/video/ov2640 +==================== + + WARNING: Some of the information in the data tables in this file came + from other projects with conflicting licenses: Linux and ArduCAM. Those + both have GPL licenses. I am not sure if it is proper or not to lift the + 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. diff --git a/ChangeLog b/ChangeLog new file mode 100755 index 0000000..18b386e --- /dev/null +++ b/ChangeLog @@ -0,0 +1,27615 @@ +0.1.0 2007-03-09 Gregory Nutt + + * Initial Release + * Support for Linux user mode simulation and TI + TMS320C5471 (Arm7) provided + +0.1.1 2007-03-14 Gregory Nutt + + * Corrected an error in interrupt level context switching + for C5471 + * Added fgets() and gets() logic; verified c5471 console read. + * Corrected error in reading from the C5471 serial port: + Improper use of semaphore can cause deadlock. + * Fixed an error in the memory cleanup: The idle task + cannot take semaphores (because it must always be ready + to run). + * Tasks can now accept a configurable maximum number of + input parameters (argc) + * _task_init() was divided into separate functions that + require fewer parameters. This was necessary to keep + the stack usage down for the 8051/2 (which has only + 256 bytes of stack). + * Attempts to use C5471 console from interrupt handlers + can cause errors. Added a special path for this case. + * Refuse calls to sem_wait and sem_trywait from interrupt + handlers. This was happening because interrupt handlers + were calling printf-like functions. + * Added strtok() and strtok_r() + * Added a simple shell called nsh (see examples/nsh). + * Platform support for 8052 is complete but not stable + when the timer interrupt is enabled. Seems to be an + issue when SP enters indirect address space. + * Documentation updates + +0.1.2 2007-03-19 Gregory Nutt + + * Add dirent.h, opendir(), readdir(), closedir(), etc. + * Add strerror() + * Added 'ls' command to nsh + * Added C5471 watchdog driver + * Fixed another bug where free() is called from IDLE task. + Can't do this; the caller must be able to wait for access + to memory. + * Fixed bugs associated with debug output: + Cannot do dbg() in middle of context switch logic. + because it may require use of semaphores and cause + additional context switches. lldbg() is safe. + * Interrupt must be disabled throughout all context switches. + * Separated C5471 serial driver; a shareable part is + in drivers/. ; the C5471 specific part is in arch/C5471. + serial.h defines the interface. + * Fixed mq_receive() and mq_send(): bad memcpy() + * Fixed C5471 signal deliver logic: use of dbg() and + other actions by use signal handler can alter errno. + need to protect errno during signal handling. + * Fixed uninitialized variable in filesystem that could + cause various problems + * Added a test for roundrobin scheduler. + +0.2.1 2007-03-22 Gregory Nutt + + * Fix error in handing signed decimal in vsprintf(). + * Major restructuring of header files to get closer to + POSIX compliance. + * Eliminate compilation warnings that crept into recent check-ins + * Add kill() + * Added support for POSIX timers + * Some Documentation updates + * Added support for the Neuros OSD / DM320 + +0.2.2 2007-03-26 Gregory Nutt + * Created the configs/ directory; separated board configuration + from processor architecture logic + * Add memory leak detection test to examples/ostest + * Corrected memory leak in OS pthread join logic + * Corrected memory leaks in examples/ostest due to failures + to join or detach from pthreads. + * Added pthread_once(), pthread_kill(), pthread_sigmask() + * Added pthread_barrierattr_*() APIs + * Added pthread_barrier_init(), pthread_barrier_destroy(), and + pthread_barrier_wait(); + * Added pthread barrier test + * Added protection so that errno cannot be modified from + interrupt handling. + * sched_setparam(), sched_setscheduler() now correctly set + errno; pthread_setscheduler() now returns the correct errno. + * Added pthread_setschedprio(). + * Added directories to hold board-specific header files + * Added directories to hold board-specific drivers + +0.2.3 2007-03-29 Gregory Nutt + + * mq_receive and mq_send now return errno's appropriately + * mq_receive and mq_send are now correctly awakened by signals. + * Fixed an unmatched sched_lock/unlock pair in task_delete(). + * sched_lock must be called in _exit() because operation of + task_delete() can cause pending tasks to be merged and a + context switch to occur. + * Added mq_timedreceive() and mq_timedsend() + * signal mask is now inherited by both child tasks and threads. + * Improved sharebility of stdout among pthreads (only). Nothing + was broken, but by moving the mutual exclusion logic to a + higher level, the printf output is more readable. + * Fixed a bug in file system cleanup: A list was being deleted + before the buffers contained in the list. + * Fixed a bug in the wait-for-message-queue-not-empty logic. + * Added a test of timed mqueue operations; detected and corrected + some mqueue errors. + * Identified and corrected a race condition associated with + pthread_join. In the failure condition, memory was being + deallocated while still in use. + +0.2.4 2007-04-28 Gregory Nutt + + * Verified c5471 build under Cygwin on WinXP + * Makesystem changes to better support different SoCs. + * Made arch/c5471/include and arch/dm320/include identical in + preparation for merging into arch/arm + * Logic from arch/c5471 and arch/dm320 combined into arch/arm. + arch/c5471 and arch/dm320 are deprecated and will be removed + when the new c5471 and dm320 logic is verified. + +0.2.5 2007-05-19 Gregory Nutt + + * Corrected some build/configuration issues introduced with the + last release. + * Added support for the NXP 214x processor on the mcu123.com lpc214x + development board (untested) + * Added support for block devices. + * Simulated target now exports a VFAT filesystem + * Begin support for VFAT filesystem (missing functionality) + * Added mount() and umount() + * Fix bug in memcmp return value + * Fix errors in timeslice calculation (several places) + * Added missing irqrestore() in timer_deleteall(). + * close() was not closing the underlying device. + * Added fsync() + * Added strspn() and strcspn() + +0.2.6 2007-05-26 Gregory Nutt + + * Added unlink(), mkdir(), rmdir(), and rename() + * Fixed several serious FAT errors with oflags handling (&& instead of &) + * Added FAT support for unlink(), mkdir(), rmdir(), and rename + * Added FAT support for opendir(), closedir(), readdir(), seekdir(), + telldir(), rewindir(). + * Fixed ARM compilation errors introduced in 0.2.5 (that is what I get + for only testing on the simulation). + +0.2.7 2007-06-09 Gregory Nutt + + * Added stat() to fs layer and to FAT + * Fixed reference counting errors associated with mounted filesystems + * Added fat_getattrib() and fat_setattrib() + * Added statfs() to fs layer and to FAT + * Correct file name extension in tools/zipme.sh + * Fix error in dependencies in 8051/2 Makefile + * sched/Makefile: Don't build sleep() or usleep() if signals are disabled + * sched/sched_setparam.c: Remove redundant disabling of interrupts + * sched/usleep.c: Fixed nsec calculation + * lib/lib_strcspn.c: Function incorrectly named strspn(). + * examples/ostest/main.c: Errors in SDCC version of a memcpy() call + * examples/ostest/sighand.c: Don't call fflush() if streams are disabled + * include/limits.h, include/time.h, sched/clock_internal.h: A support for + using selectable system timer frequency. + * Fixed error in mountpoint related conditional compilation introduced + in 0.2.5 + * Restructured some Makefiles to better handle enabling and disabling + NuttX features without having so much conditional compilation in the + source files. + * tools/mkconfig.c: No longer depends on asprintf() and _GNU_SOURCE and + so should now build in non-GNU, non-GLIBC environments. + * include/nuttx/compiler.h: Fix for using SDCC with the Z80. + * include/assert.h & arch/pjrc-8051/src/up_assert.c: SDCC does support + __FILE__and __LINE__ (not tested) + * examples/ostest/barrier.c: Don't call usleep() when signals are + disabled. + +0.2.8 2007-07-02 Gregory Nutt + * tools/Makefile.mkconfig: Under Cygwin, executable has a different name + * tools/mkdeps.sh & arch/arm/src/Makefile: Corrected a problem makeing dependencies + * tools/zipme.sh: Force directory name to be nuttx-xx.yy.zz + * fs/fs_opendir.c: Correct errors in semaphore usage that can cause deadlock. + * lib/lib_getopt.c: Added getopt() support + * examples/nsh/: NSH now supports cat, mount, umount, and mkdir. ls supports + -l -s, and -R + * Added basic OS support to manage environment variables: environment + storage, cloning on task creation, sharing on pthread creation, destruction + on thread/task exit. + * Add environment variables APIs: environ, getenv, putenv, clearenv, setenv, + unsetenv + * Correct an error in realloc() when the block is extended "down" in memory. + In this case, the old memory contents need to be copied to the new location + and an allocated bit was not being set. + * examples/ostest/: Added an environment variable test. + * examples/nsh/: Break into several files. + * lib/: Added strrchr, basename, dirname + * examples/nsh/: Add cp, rm, rmdir, set, unset commands. echo will now print + environment variables. + +0.3.0 2007-11-06 Gregory Nutt + + * Imported uIP into the tree (see + http://www.sics.se/~adam/uip/index.php/Main_Page) + * Adding socket(), bind(), connect() + * Added snprintf() + * Added send() and sendto(); integrate write() and close() with socket descriptors. + * Added recv() and recvfrom(). + * Added getsockopt() and setsockopt() + * Documentation updated to address socket interfaces. + * Implemented receive timeouts via setsockopt(SO_RCVTIMEO). + * Provide support for multiple network devices + * Implement socket ioctl() calls to set addresses + * Added listen() and accept() + * Added DM90x0 Ethernet driver + * ARP timer is now built into the network layer + * Basic client functionality verified: TCP socket(), bind(), connect(), recv(), send(). + +0.3.1 2007-11-19 Gregory Nutt + + * Separated net/uip/uip.c into several functions in several files. + * Corrected a TCP problem where packets were dropped because there was no + recv() in place but the packet was being ACKed. There are still TCP + recv buffering issues, but this is part of a larger buffering issue. + * Basic server functionality verified: TCP listen(), accept() + * Fix DM90x0 driver problem that caused TX overruns + * Add strncmp() + * Added TCP/IP read-ahead buffer to minimize failed ACKs and packet loss. + +0.3.2 2007-11-23 Gregory Nutt + + * Add strcat() and strncat() + * Integrated uIP micro webserver + * Corrected a serious bug in TCP queue management + * Fix leak in socket close logic + * Add TX notification to driver so that it can respond faster to + the availability of TX data. + * Moved urgent data info into device structure. + * TCP and ICMP protocols can now be disabled. + * Added UDP test in examples/udp + * Verified/debugged UDP socket(), bind(), sendto() and recvfrom() logic + using examples/udp + * recvfrom() and accept() now correctly return the remote address. + * Fixed computation error in ntohl(). + +0.3.3 2007-11-28 Gregory Nutt + + * Removed unused uIP files + * sched/, mm/, and net/ subsystem debug can now be selectively enabled/disabled + * Correct socket close logic: needs to disconnect TCP socket on close + * uIP webserver now seems to be fully functional + * fs/ and lib/ subsystem debug can now be selectively enabled/disabled + * Added vsnprintf + * Integrated uIP telnetd + * Add missing logic to read-ahead buffer logic + * examples/nettest uses larger buffers + * Improved ACK handling in send() to better handler deferred acknowledgements + and polling intervals. Greatly improves send performance. + +0.3.4 2007-12-10 Gregory Nutt + + * Added and partially verified DHCP server logic (netutils/dhcpd) + * Fix BROADCAST=y compilation problems + * Fix UDP recvfrom timeout bug + * Correct processing of input UDP broadcast packets. + * Verfied basic DHCP client functionality (netutils/dhcpc) + * Implemented send() timeout logic + * Added and verified a TELNETD front end to NSH (examples/nsh) + * Add a skeleton Ethernet device driver (drivers/net/skeleton.c) + * Added C5471 Ethernet device driver (arch/arm/src/c5471/c5471_ethernet.c) + * Found and fixed several problems in uIP when compiled for ARM with optimization. + +0.3.5 2007-12-18 Gregory Nutt + + * Added inet_ntoa() and ether_ntoa() + * Added netdev_foreach() to support traversal of registered network devices + * Added support for 'ifconfig' command to NSH (examples/nsh) + * Moved MAC and Ethernet definitions to net/ethernet.h + * Fix sim and DM90x0 compilation errors introduced in 0.3.4 + * Fixed errors in C5471 configuration files for examples/uip + * Modified DHCPC (netutils/dhcpc) so that it should work in environments where + there are more than one DHCPD server. + * NSH ifconfig command now shows uIP status as well (examples/nsh) + +0.3.6 2008-01-06 Gregory Nutt + + * Changes for use with SDCC compiler + * Added a simulated z80 target + * Fix deadlock errors when using stdio but with no buffering + * Add support for Pascal P-Code interpreter + +0.3.6.1 2008-01-07 Gregory Nutt + + * The initial 0.3.6 release including an error that prevented + building successfully if the Pascal add-on was + was not present. + +0.3.7 2008-01-31 Gregory Nutt + + * Added support for the Zilog Z16F using the Zilog Z16F2800100ZCOG + Development Kit. + * Add support toolchains that do not support making of dependencies + * Fix Cygwin build with spaces in directory names + * Name make system changes to deal with non-GNU toolchains (i.e., Zilog) + * Add support for Windows native toolchains that cannot follow Cygwin soft links + * Modified serial driver interface to handle hardware with non-16550A-like + interrupt architecture (like the Z16F) + * Added a "dumb" serial console driver to simplify OS bringup + * Corrected a bug that caused the errno value of one task to be clobbered + when a different task exits. Affects all architectures. + +0.3.8 2008-02-10 Gregory Nutt + + * Added a test case to verify the Pascal P-Code interpreter + * Added /dev/zero + * 'errno' is now defined to be *get_errno_ptr() with no name conflicts + * Added lseek() and fseek() + * Integrated Pascal interpreter test case on the simulation platform. Needs + pascal-0.1.1. + * Add Pascal test case on the z16f platform. Needs pascal-0.1.2 (does not + yet work due to some tool issues). + * C buffered I/O fixes: + - Fix fflush() return value, + - Add correct fflush behavior when the FILE argument is null. + - Add logic to a correctly handle read/write access on the same FILE + - fseek() flushes read/write data when before moving the file pointer + - When read data is flushed, reposition the file pointer to account for + buffered, but unread data + * Pascal P-Code files are now standardized to big-endian for portability + * Fix a build problem with z80 and SDCC 2.7.0 (format of a map file changed) + (see bug 1887170) + * Pascal P-Code runtime now compiles with the SDCC toolchain. + * Added a generic CAN driver. This driver is untested as of this writing. + * Corrected DM320 UART configuration problem + +0.3.9 2008-03-09 Gregory Nutt + + * Began adding support for the ZiLOG Z8Encore! microcontroller for the Z8Encore000ZCO + development board and the Z8F6403 part. + * Fix broken 'clean' target on z80sim configurations + * Re-structure arch/z80 to provide support for all ZiLOG 8-bit microcontrollers (ez8 + in particular for now). + * Add support for TRS80-Model 3 based on the xtrs emulation (http://www.tim-mann.org/xtrs.html) + Per patch from Jacques Pelletier. + * In all shell scripts, change #!/bin/sh to #!/bin/bash to resolve problems in + Ubuntu where /bin/sh is a link to dash. + * Z8Encore! port verified on ZDS-II instruction set/chip simulator. + +0.3.10 2008-05-15 Gregory Nutt + + * Add support for the ZiLOG EZ80Acclaim microcontrooler (EZ80F91 chip). + * Add configuration for the ZiLOG z8f64200100kit development kit, Z8F6423 part. + * Add configuration for the ZiLOG ez80f0910200kitg development kit, EZ80F091 part. + * Correct critical list handling errors in task shutdown logic: One in timer + deletion logic (timer_delete.c) and one in stream logic (lib_init.c) reported + by kwonsk. + +0.3.11 2008-06-01 Gregory Nutt + + * Add support for recursive mutexes. + * Eliminate a memory leak: contained watchdog instance was not being + deleted with a POSIX timer was deleted reported by kwonsk. + * Eliminate a deadlock condition in opendir() reported by kwonsk. + * Fix several FAT filesystem problems reported by kwonsk (Changes not yet + verified). + * Host simulator no longer uses Linux system calls directly; Now works with Cygwin. + * Fix an error that occurs when a POSIX timer is deleted by the timer signal handler. + * Add logic to allow the examples/ostest to be run repetitively as an endurance test. + * Add a ramdisk block driver + +0.3.12 2008-08-10 Gregory Nutt + + * Improved solution to POSIX timer lifetime controls bug fixed in 0.3.11. + * Add test for recursive mutexes + * Correct bug in recursive mutex logic + * Add mkfifo() + * Add pipe() and test for both pipes and fifos + * Attempts to open a FIFO will now block until there is at least one writer + * Add test/Fixed errors in FIFO reader/writer interlocks + * Removed limitation: task_create() was only dup'ing 3 file descriptors (now + dups all open file descriptors). + * Added a test for redirection of stdio through pipes + * Fixed error in dup and dup2: Must call open/close methods in fs/driver so that + driver can correctly maintain open reference counts. + * Same issue on closing file descriptors in exit() + * Fixed in error in stdio flush logic. Needed ssize_t vs size_t for error + check. + * Moved all FAT related files from fs to fs/fat + * Implemented mkfatfs(), a non-standard API to create a FAT filesystem on a + block device (not yet tested). + * Added a test for mkfatfs() on a RAM disk in examples/mount and verified + basic mkfatfs functionality for FAT12. + +0.3.13 2008-09-01 Gregory Nutt + + * NSH: Added mkfatfs, mkfifo, sleep, usleep and nice commands + * Fixed problem with console input in Cygwin-based simulator; NSH now works + with simulator. + * NSH will now execute commands in background + * sched_get_priority_max/min returned error on SCHED_RR + * Removed duplicate getenv() implementation in /lib + * Correct detection of End-of-File in fgets + * NSH: Implemented sh and crude script handler + * Fix prototype of read() and write(). Need to use ssize_t and size_t, not + int and unsigned int. + * NSH now supports redirection of command output + * NSH can now use both telnet and serial front ends together + * NSH: $variable can be used for any command value + * Fixed an error in opendir() that could cause an assertion to fail + inappropriately. + * Correct an error in the FAT that caused files opened for writing with + O_APPEND to fail. The file was not being properly positioned to the + end of the file in that case. + * NSH now supports last exit status $? + * NSH now supports if-then[-else]-fi construct + * NSH now supports comments beginning with '#' + * NSH now supports commands to inspect and modify memory + * NSH cat command now supports multiple files on command line + * Add chdir() and getcwd() + * Fix error in getopt() when called with argc==1 + * Fix error in stat() when used on the root directory + * NSH: Add cd and pwd commands and current working directory to all NSH + commands that refer to paths. + * Fix errors and warnings introduced into Linux sim build because of recent + Cygwin-based sim changes + * NSH: Add mem command to display heap usage + * Added telnet NSH configuration for Neuros OSD. + * Basic integration of concurrent telnet/serial NSH functional on Neuros + OSD. + * Fixed a critical bug that affects the way that environment variables are + shared amongst pthreads. + * uIP port enhance to support multi-threaded, concurrent socket access. So, + for example, one thread can be reading from a socket while another is + writing to the socket. + +0.3.14 2008-09-08 Gregory Nutt + * FAT FS now uses position variable in struct file. This simplifies operations + like ftell(). + * fseek() needs to discard bytes buffered by ungetc(). + * Corrected ftell() return value. + * Added fsetpos() and fgetpos(). + * NSH: Now supports 'test' and '[' commands + * Correct error in send() timeout logic. + * Correct error in multi-threaded socket handling in send() and sendto(). + Outgoing data could overwrite incoming data. + * Add support to uIP for application access to ICMP protocol stacks; Add + ping request logic. + * NSH: Add ping command + * Correct IP checksum calculation in ICMP and UDP message send logic. + * NSH: Created an HTML document and a more detailed README file describing NSH. + * Added basic TFTP client logic (netutils/tftpc). + * NSH: Add get and put commands to support TFTP get and put operations. + * NSH: Added a mkrd command that will create a RAMDISK that can be formatted + and mounted. + * Corrected a critical bug that prevent recvfrom from receiving packets from + any remote UDP port. + * NSH: Add hexadecimal dump command (xd) + * Fixed several critical bugs with regard to fat reading and writing and FAT12 + accesses. Basically the FAT FS only worked with my tiny test files and test + cases. A lot of stronger FAT tested is needed!! + * Fixed another FAT bug in implementation of FAT lseek; this prohibit correct + random access to large files. + +0.3.15 2008-09-20 Gregory Nutt + * Added support for ROMFS filesystem. + * Added a simple test the ROMFS filesystem (examples/romfs) + * NSH: Use ROMFS to provide an option for a start-up script at /etc/init.d/rcS + * Add definition of BIOC_XIPBASE ioctl and implement in RAM disk block driver. + This is a low level requirement for eXecute In Place (XIP) support. + * Add a FIOC_MMAP to perform memory mapping of a file and implemented the + ioctl command in the ROMFS filesystem. This is a requirement for eXecute + In Place (XIP) support. + * Add mmap() API with restricted capability (only for XIP support) + * Extend ROMFS test at /examples/romfs to verify mmap() and XIP support. + * Add support for Intel Hex format output using objcopy + * Completed the basic port of the NXP LPC2148 on the mcu123.com board. + The basic port includes successful booting, timer interrupts, serial console, + succesfully passing the examples/ostest, and a NuttShell (NSH) configuration. + * ARM architectures now support drivers/lowconsole.c + +0.3.16 2008-10-10 Gregory Nutt + * Added header files defining a common USB device controller architecture + * Added USB device side driver for the LPC214x + * Correct the frequency of system timer interrupts in the NXP LPC214x port + (off by 20x in nuttx-0.3.15) + * Add an option to set aside a separate stack for interrupt handling (ARM only). + This is useful when memory is constrained, there are multiple tasks, and + the interrupt stack requirement is high (as when USB is enabled). + * Added USB serial class device side driver (emulates Prolific PL2303 + serial-to-USB adaptor) + * Add LPC214x USB serial configuration; Add examples/usbserial test + * Added USB device side driver for the DM320 (untested at initial release) + * Fixed an error in a previous (post 0.3.15) check-in that broke the LPC214x + system timer. + * Fixed serial driver bugs related to (1) open counts and (2) recognizing + O_NONBLOCK on read. + * Fixed an error in read(); it was not setting the errno on errors returned + from the driver. + +0.3.17 2008-10-28 Gregory Nutt + * Incorporate patch "[2164503] nuttx-0.3.16 does not build for ARM with USB disabled" + * Reduced the amount of memory reserved for USB serial control requests. It + was unnecessarily large. + * Added LPC214x SPI1 driver to interface with MMC on mcu123.com board. + * Added a simple SPI-based MMC/SD block driver + * NSH: Add LPC214x-specific support to NSH; NSH now mounts any SD cards in the slot. + * FAT: Fix access to unaligned 32-bit values in partion table (start sector & size) + * Fixed a problem with a un-initialized variable in the USB serial driver. + * Added USB storage NXP LPC214x configuration + * Added a test for USB storage under examples/usbstorage + * Fixed a bug in the LPC214x USB driver: It was not properly clearing a HALTed + endpoints (other than EP) on receipt of CLEAR FEATURES request. + * Added USB storage class device side driver (BBB) + * Fixed a bug in the LPC214x USB driver: It was not properly handling request buffers + larger then the endpoint's max packet (DM320 driver also fixed, untested) + * Added logic to the USB device interface: A bit is needed to force the driver to + to terminate an IN transfer with a short packet (zero-length if necessary). + * Fix an error in the NXP LPC214x USB device driver that was causing corruption of + the request queue (M320 driver also fixed, untested) + * Correct another error in the NXP LPC214x USB device driver that caused read failures + when the request buffer size was larger than maxpacket. + * Numerous corrections/extensions to the USB tracing logic included in 0.3.16 (but + not integrated until 0.3.17) + * Fixed another bug in the NXP LPC214x USB device driver: After a stalled endpoint + is resumed (view CLEAR FEATURE), we must restart the IN (outgoing) queue. + +0.3.18 2008-11-16 Gregory Nutt + * Added port for the STMicro STR71x processor and configuration for the Olimex STR-P711 + board (STR71x testing is stalled because I have been unable to get OpenOCD to + communicate with my JTAG wiggler on Linux). + * Fix race condition workaround delay in LPC214X SPI logic. This was also the cause of the + very bad MMC/SD performance. + * Began port of the Hitachi SH-1 using the SH-1/US7032EVB1 board + * Re-built all configurations that use SDCC and Zilog toolchains to make sure they still + build (they didn't, but they do now). + * Fixed several erroneous "list empty" checks in the CAN driver. + * Hitachi SH-1 passes (reduced) examples/ostest; the examples/nsh test still fails. + There are remaining instabilities that make the port un-usable. The nature of these is + not understood; the behavior is that certain SH-1 instructions stop working as advertised. + This could be a silicon problem, some pipeline issue that is not handled properly by the + gcc 3.4.5 toolchain (which has very limit SH-1 support to begin with), or perhaps with the + CMON debugger. At any rate, I have exhausted all of the energy that I am willing to put + into this cool old processor for the time being. + * Renamed configuration item CONFIG_PROC_STACK_SIZE as CONFIG_IDLETHREAD_STACKSIZE: It now + only controls the size of the stack for the IDLE thread. Added CONFIG_USERMAIN_STACKSIZE: + This is the size of stack used with the user_start() thread is created. The two stacks + no longer have to be the same. + * Add a loop device that converts a file into a block device. + * Each NSH command can now be disabled through a configuration setting. All of these + settings make the configuration of NSH potentially complex but also allow it to squeeze + into very small memory footprints. + * Added a block to character (BCH) driver. This is kind of the reverse of the loop + device; it allows you access a block device like a character device. + * Added strcasecmp() and strncasecmp() + * NSH: Added the 'dd' command + * NSH: Added the 'losetup' command + * Fixed a FAT bug: After recent changes, it would mount a (invalid) FAT file system + even if the medium is not formatted! + * Corrected two important errors in FAT lseek implementation: (1) the sectors-per-cluster + value was being reset to "1" and (2) important lseek logic was omitted when the seek + position was zero. + * Fixed a bug in getopt(). It would fail if on certain combinations of terminal argument + types. + +0.3.19 2008-11-26 Gregory Nutt + * Add poll() and select() APIs (in the initial check-in, these work only with character devices) + * Add poll() methods to /dev/null, /dev/zero, pipes, fifos, and serial drivers. + * Add examples/poll for testing poll() and select() + * Fix hostile behavior of getc, fgetc, getchar, etc.: the serial driver was waiting for a + full buffer of read data before return. This means that getc would stall when it needed + to refill the input buffer. The old behavior (read full blocks) might be useful in other + contexts, so it is still available within the driver as a configuration option. + * Implement poll() and select() support for TCP/IP sockets + * Fixed an important bug in the TCP/IP buffering logic. When TCP/IP read-ahead is enabled + and not recv() is in-place when a TCP/IP packet is received, the packet is placed into + a read-ahead buffer. However, the old contents of the read-ahead buffer were not being + cleared and old data would contaminate the newly received buffer. + * Implemented support for connection backlog. The size of the backlog is specified by the + second argument of the standard listen() API. Hooks are provided to support poll()/select() + waiting for connections, with a subsequent call to accept() to use the backlogged connection. + * Fixed a minor bug in accept(). It should allow the address and addresslen values to be NULL + * Added first-cut definition for a framebuffer interface (and simulated framebuffer for testing + purposes only) + * Added fixed precision math support + * Added some color converson routines into what may become a real graphics library someday. + * Added a framebuffer driver for the DM320 (untested on initial check-in) + * Network: Add support for outgoing multicast addresses + * Added some rasterizers to the graphics library + +0.4.0 2008-12-06 Gregory Nutt + * Initial release of a tiny windowing system for NuttX + * Add fixed precision sin() and cos() (not well tested at initial check-in) + * Add an X11-based simulated framebuffer driver + * The simulated target now has an option (CONFIG_SIM_WALLTIME) that will let the simulation + run in more-or-less realtime. + * Added more extensive window support: frames, toolbars, etc. + * Added support for bitmap fonts + * Integrated the new font support with a font test in examples/nx + * Add documentation for NX graphics subsystem + +0.4.1 2009-02-06 Gregory Nutt + * Added board support for the ZiLog eZ80Acclaim! ez80f910200zco Development Kit. + * Fixed several compilation errors in fixed precision math library when built + against toolchains that do not support 64-bit type 'long long'. + * Fix errors in some function prototypes in dirent.h + * Add eZ80F91 EMAC driver + * Fix recvfrom() compilation error: only noted under ZDS + * Updated all ARM Make.def files to work with gcc 2.4.2 (However, there are + still some build issues associated with that toolchain in use of arm-elf-objcopy + -- see the TODO.txt list for details) + * Fix problems with Z16F and eZ80 compilation introduced with recent changes. + +0.4.2 2009-02-28 Gregory Nutt + + * M16C: Add support for the Renesas M16C MCU and the SKP16C26 StarterKit. However, + the target cannot be built because the GNU m16c-elf-ld link fails with + the following message: + + m32c-elf-ld: BFD (GNU Binutils) 2.19 assertion fail /home/Owner/projects/nuttx/buildroot/toolchain_build_m32c/binutils-2.19/bfd/elf32-m32c.c:482 + + Where the reference line is: + + /* If the symbol is out of range for a 16-bit address, + we must have allocated a plt entry. */ + BFD_ASSERT (*plt_offset != (bfd_vma) -1); + + No workaround is known at this time. This is a show stopper for M16C. + + * eZ80Acclaim!: Fix interrupt vectors positioning; they were being positioned + wrong by 64 bytes (Kevin Franzen). + * eZ80Acclaim!: Corrected some stack handling errors during interrupt handling + context save and restore (Kevin Franzen). + * eZ80Acclaim!: Corrected vector initialization logic (Kevin Franzen). + * eZ80Acclaim!: Corrected overflow problem in the calculation of UART baud rate + divisor, the system timer divisor, and the EMAC poll timer. + * eZ80Acclaim!: Fixed GPIO pin configuration get serial output + * eZ80Acclaim!: Correct stack overflow in ostest example configuration + * eZ80Acclaim!: Fixed restoration of interrupts state on interrupt level context swith. + +0.4.3 2009-03-04 Gregory Nutt + + * z8Encore! and eZ80Acclaim!: Fixed the serial driver initialization sequence + * eZ80Acclaim!: Fixed error in vector table: Missing space set aside for the + "unused" vectors. As a result, all vectors above timer4 were skewed. + * eZ80Acclaim!: Fixed logic error in UART interrupt handler. + * Many fixes in FAT file system and in NSH for correct compilation with ZDS-II + * eZ80Acclaim!: Added and verified a NuttShell (NSH) configuration. + * eZ80Acclaim!: Correct endian-ness; defconfig files said BIG endian. + * Restructured parts of the uIP port for correct compilation with ZDS-II + * eZ80Acclaim!: Complete basic integration of the eZ80F91 EMAC driver. The + driver is basically functional and should mature prior to the 0.4.3 release. + * Implemented priority inheritance logic for POSIX semaphores. Because the pthread + mutexes are built on semaphores, they will have this property as well. + +0.4.4 2009-03-29 Gregory Nutt + + * examples/nsh: A debug option was left on that can (and does) cause + infinite loops and stack overflows. + * net/uip: Correct calculation of checksum on ICMP ping response. + * examples/dchpd: Added a tiny DHCP server example + * net/uip: Correct UDP bind behavior. It should select a valid port number + if it receives a port number of zero. + * netutils/dhcpd: correct for ZDS compiler. Fix issue with re-use of a + port number. Fixed a number of broadcast-related problems. + * eZ80Acclaim!: Add a tiny webserver configuration + * eZ80Acclaim!: Fixed an important bug in the EMAC Tx timeout logic. It was + always timing out when the load was heavy and worse, for some reason, + resetting the Tx function caused unexpected registers to be reset in + the Rcv function was well. + * Z80: Patch incorported: "[2696648] Z80: interrupt flag stored in parity bit" + (submitted by JPelletier). The is the same fix that was needed for the + eZ80 and fixed in 0.4.2. + * netutils: Added logic to support a simple wget() function + * examples/wget: Added a test for wget() (untested -- see NOTE) + * lib/strncasecmp: Fix cut'n'paste error in function name. + * NSH: Added wget command (untested -- see NOTE). + * examples/sendmail: A simple sendmail example (untested -- see NOTE) + + NOTE: Features related to wget and sendmail are not tested on the target platform + in this release and, hence, most likely have problems. I don't have the correct network + setup to perform that testing now (I'm in a hotel). + +0.4.5 2009-04-19 Gregory Nutt + + * Add an enumeration argument to the SPI chip select and status methods so + that the interface can handle more than one device. + * eZ80Acclaim!: Add a generic SPI driver for all eZ80 boards. + * Add a setmode() method to the SPI interface to handle parts with differing + mode requirements. + * include/nuttx/i2c.h: Defined a standard I2C interface + * eZ80Acclaim!: Add an I2C driver. + * eZ8Encore!: Add an I2C driver. + * Add support for the Freescale i.MX1/L architecture and a configuration for + the Freescale MX1ADS development board. + * examples/helloxx: Added a simple C++ hello world example + * include/css: Added std header files + * libxx: New C++-only directory provides support for minimal C++ applications + +0.4.6 2009-05-19 Gregory Nutt + + * Change SPI interface so that is can accommodate interfaces where the + number of bits per word is greater an 8 (such as with many 9-bit display + interfaces). -- this might have broken a few things which will need to + be retested! + * arch/arm/src/imx: Added i.MX SPI driver + * SPI: Add a method to set the number of bits per word. Also add an + alternative interface for so that (eventually) I can phase the sndblock + and recvblock methods and replace them with a single exchange method + * Build: objcopy fails with toolchains that use newer GCC and binutils. The + following arguments need to be included in the objcopy command line "-R .note + -R .note.gnu.build-id -R .comment" This has been fixed in arch/arm/src/Makefile, + but other architectures may have the same problem. Thanks to Dave Marples + for verifying this. + * configs/eagle100/ostest: Added support for the MicroMint Eagle100 board. + This board has a Luminary LM3S6918 Cortex-M3. Added a configuration to build + examples/ostest. + * arch/arm/src/lpc214x: Add configuration option to enable fast GPIO (vs. + legacy, "slow" GPIO) for LPC214x. + * arch/arm: Restructured the arch/arm directory structure to better support ARM + and Cortex-M3. + * sched/: pthread_create() must return a (non-negated) errno value on failure. + * configs/eagle100/nsh: Add a NuttShell (NSH) configuration for the Eagle-100 + +0.4.7 2009-05-29 Gregory Nutt + + * arch/arm/src/lm3s: Added an Ethernet driver for the LM3S6918 + * configs/eagle100/nettest: Added an examples/nettest configuration for the + Micromint Eagle100 board. + * Documentation/NuttxPortingGuide.html: Added a section on NuttX device drivers. + * configs/eagle100/httpd: Added an examples/uip configuration for the + Micromint Eagle100 board. + * arch/arm/src/lm3s: Added an SSI driver for the LM3S6918 + * examples/nsh: Added MMC/SD support for the LM3S6918 + * arch/arm/src/lm3s: Fix logic for setting and clearing output GPIOs (critical + fix!). + * drivers/mmcsd: Found numerous errors in current MMC/SD SPI driver. Bad frequency + calculation based on CSD settings, inappropriate timeouts, odd code that looks like + a bad search and replace. Also needs support for SDHC ver 2.x. New MMC/SD is + largely redesigned and probably non-functional in the first check-in. + * drivers/mmcsd: Changes verified on 4Gb Kingston microSHDC card and on a 2Gb + SanDisk microSDC card on the Eagle100 platform. + * fs/fat: With the 4Gb card, the first tests of FAT32 were (finally) performed. + Found and corrected a problem that prevented use of FAT32: It was not updating + the sector cache before checking the FAT32 FSINFO sector. + * configs/eagle100/*/Make.defs: Added configuration options that should make + it possible to build NuttX for the Eagle100 using CodeSourcery 2009q1 toolchain + and the devkitARM GNU toolchain. + * configs/mcu123-lpc214x/src: Corrected some logic in the LPC2148 SPI receive block + logic. Re-verified SDC ver1.x support with 1Gb Toshiba SDC, 1Gb PNY SDC, and + 4Gb Kingston SDHC. There are CMD0 issues with the 2Gb SanDisk SDC on this board. + * fs/fs_mount.c: Corrected error handling that could cause a deadlock on certain + mount() failures. + +0.4.8 2009-06-13 Gregory Nutt + + * lib/lib_*stream.c: Extend internal stream logic to support incoming streams. + * arch/arm/src/str71x: Serial output is now correct and timer interrupts are + working. The test at configs/olimex-strp711/ostest passes. This means that + the basic STR-P711 port is complete. + * configs/olimex-strp711/nsh: Add and verified a NuttShell (NSH) configuration + for the STR-P711. + * arch/arm/str71x/str71x_serial.c: The STR711 interrupt driven serial driver + finally works after some extradinary measures to handle missed interrupts. + NSH is fully functional on the Olimex STR-P711 board. + * example/nsh: Moved architecture specific files from NSH directory to board- + specific directories. + * config/olimex-strp711/src/up_nsh.c: Add an NSH board specific directory for + for the Olimex STR7P11 board. + * Fixed build of LM3X6918 using the CodeSourcery Windows native toolchain. There + were lots of issues with Cygwin paths and Cygwin symbolic links. These changes + may work with the devarmKIT as well, but that remains untested. + * The NXP LPC2148 and STR711 targets can now also be built using the CodeSourcery + or devkitARM Windows native toolchains. + +0.4.9 2009-06-26 Gregory Nutt + + * Add strtoll() and strtoull(); Add macros for atol() and atoll(). + * dup() and dup2() will now clone socket descriptors + * All socket descriptors are now cloned when a new task is started via + task_create(). + * Add configuration options to suppress or eliminate cloning of file + and/or socket descriptors when a new task is started by task_create(): + CONFIG_FDCLONE_DISABLE, CONFIG_FDCLONE_STDIO, CONFIG_SDCLONE_DISABLE. + * Use of C++ reserved word 'private' in C header files causes problems + for C++ that include them. + * Added 'binfmt' support to allow execution of programs in a file system, + binding to NuttX symbols. A custom format call NXFLAT is used; this + derives from http://xflat.sourceforge.net. At present is supports on + XIP execution from ROMFS file systems. Initial check-in is untested + and probably breaks many builds. + * examples/lib: Added qsort() + * examples/nxflat: Added support for symbol tables + * Correct logic that creates compiler include paths. On Cygwin, the + include paths for Cygwin-based GCC were being converted to windows + native paths. That causes many problems -- breaking dependencies + for one. + * Fixed an important bug in ROMFS. The initial XIP offset was set + incorrectly so if sector zero was read first, there was a bad read. + I don't know how it worked before. + * arch/arm/src/common/up_use_stack.c. Fixed a fatal stack setup error. + This file has been around for a long time, but I don't think it has + every been used before (i.e., prior to the NXFLAT logic) + +0.4.10 2009-08-08 Gregory Nutt + + * lib/: Added some basic regex-subset, pattern matching functions + * lib/: Greatly simplified mktime() and gmtime_r(). The Gregorian and + Julian time calculations were interesting, but not necessary in the + typical embeddd system. + * sched/: Added gettimeofday(). This implementation is simply a thin + wrapper around clock_gettimer(). + * lib/: Add gmtime(), localtime(), and strftime() + * binfmt/: Add exec(). This is just a wrapper that executes both + load_ and exec_module() in a more familiar manner. It is not consistent + with more standard exec() functions, however, because (1) it returns + and (2) it requires symbol table arguments. + * lib/: Add fileno() + * examples/ostest: Several of the tests used a big, hard-coded stack size + when creating test threads (16K stacksize). The stack size should + be controlled by the .config file or the OSTest won't work on platforms + with memory constraints. + * netutils/thttpd: An initial port of Jeff Poskanzer's THTTPD HTTP server. + See http://acme.com/software/thttpd/. + * examples/thttpd: A basic test program for THTTPD + * configs/eagle100/thttpd: A build configuration for THTTPD on the Micromint + Eagle-100 LMS6918 (Cortex-M3) board. + * configs/ntosd-dm320/thttpd: A build configuration for THTTPD on the Neuros + DM320 platform. + * lib/: Added strstr() and strpbrk(). + * net/recvfrom.c and net/accept(): Sockets now support some non-blocking + operations, specifically for (1) TCP/IP read operations when read-ahead + buffering is enabled, and (2) TCP/IP accept() operations when TCP/IP + connection backlog is enabled. + * fs/fs_fcntl.c and net/net_vfcntl.c: Minimal support provided for fcntl(). + It can, at least, be used to mark sockets as blocking or non-blocking. + * net/net_close.c: Fix bug in close(). If reference count not set to zero + then uip_tcpfree() will assert when DEBUG is enabled. + * net/accept.c: Fix bug in accept(). The logic expected parts of the + return address structure to be initialized or it would return an error. + +0.4.11 2009-09-16 Gregory Nutt + + * fs/fs_read.c and fs/fs_write.c. read() and write() to socket is the + same as recv() and send() with flags = 0. Fixed! + * net/recvfrom.c: Fix errors in return value from non-blocking socket read. + * lib/lib_strcasecmp.c and lib/lib_strncasecmp.c. Use of post-incremented + argument to macro caused strcasecmp() and strncasecmp() to fail. + * lib/lib_strstr.c: Length of substring off by one causes false alarm + sub-string matches. + * arch/arm/src/lm3s/lm3s_ethernet.c: Fix errors in LMS6918 FIFO length + handling. (1) The incorrect size of the Ethernet header was being + subtracted on outgoing messages (4 vs 14), which caused outgoing messages to + be a little too long. (2) The size of incoming FIFO messages is 6 bytes + larger than it expected (2 for the length and 4 for the FCS). The unhandled + extra two bytes of length cause the driver to sometimes read one too many + words from the received FIFO (corrupting the next queued receive packet, + if any). + * net/net_poll.c and net/uip/uip_tcpbacklog.c. Fixed an important race condition + bug in polling for connections. The logic worked if the poll was inplace + before the connection was received; but the poll failed to awaken if the + connection was already pending in the backlog when poll() was called. + * net/net_close.c. Fixed another important TCP/IP race condition bug: If + the host closes the TCP connection just before the target calls close(), then + the close operation may hang indefinitely! + * net/net_tcppoll.c. Removed an unnecessary check for outstanding, un-ACKed + data. The NuttX socket layer keeps track of ACKs and doesn't need this check; + removing the check should improve write throughput + * Add DEBUG configuration option to enable debug console output without disabling + optimization (and vice versa) + * Changed lots of occurrences of debug macro dbg() to lldbg(). dbg() uses + stdout to output debug data. That works fine unless (1) the dbg() macro + is interrupt logic and the interrupted task has redirected stdout! Most + changes were in uIP. + * net/uip/uip_tcpinput.c. Connection reference count was not being set correctly + when a socket is created by accepting a new connection. Since the reference + count is bad, such sockets are not successfully duplicated when being passed + to new tasks. + * net/net_clone.c. Similarly, after a socket is cloned, its reference count + was not being initialized. + * lib/lib_strstr.c. Improperly incremented pointer could cause comparison + failures. + * net/. Connection reference count must always be set to zero before calling + uip_tcpfree() or it could trigger a DEBUGASSERT that verifies that the + reference count is zero before freeing a connection structure. + * net/uip/uip_listen.c. uip_accept() consulted the wrong list to find the + listener on a socket. The previous logic worked most of the time, but + occasionally picked the wrong listener. + * net/net_close.c and net/net_sockets.c. Sockets were not being closed + when a task exits. If many server tasks are created and exit without closing + sockets (such as with CGI tasks), then eventually, you will run out of sockets. + * netutils/thttpd. Basic functionality of THTTPD is complete. This includes + serving up files from a file system and executing NXFLAT-based CGI programs + and pipe the stdout back to the HTTP client. + +0.4.12 2009-10-17 Gregory Nutt + + * arch/arm/src/stm32 and configs/stm3210e-eval. Added basic support for the + STMicro STM32, Cortex-M3 MCU. The specific port is to the STMicro STM3210E-EVAL + development board based around the STM32F103ZET6 MCU. + * configs/stm3210e-eval/RIDE. Added a basic STMicro RIDE7 project that can be + used to perform basic STM32 board bring-up (due to RIDE7 size limitations, it + cannot be used for the full NuttX bring-up). + * configs/stm3210e-eval/ostest. The STM32 now passes the basic NuttX OS test + at examples/ostest. The rest should be a piece of cake. + * configs/stm3210e-eval/nsh. Added NuttShell (NSH) example. + * configs/stm3210e-eval/src/stm32102e-internal.h. Fix on-board LED GPIO definitions. + * arch/arm/src/stm32/src/stm32/stm32_dma.c. Added DMA channel support for the STM32 + * arch/arm/src/stm32/src/stm32/stm32_spi.c. Added a DMA-based SPI driver for the STM32. + * arch/arm/src/stm32/src/stm32/stm32_serial.c. Finished interrupt-driven, + USART console driver. This makes NSH work perfectly. + * Things left to do for the STM32 deferred to the 0.4.13 release: USB device driver, + LCD driver and NX bringup on the eval board's display and MicroSD support. An SPI + driver was included in the 0.4.12 release, but is not yet tested. + +0.4.13 2009-11-04 Gregory Nutt + + * include/nuttx/mtd.h. Added a simple interface definition to support some + FLASH, EEPROM, NVRAM, etc. devices. + * driver/mtd/m25px.c. Added a driver for SPI based FLASH parts M25P64 and M25P128. + * configs/stm3210e-eval/usbserial. Add a USB serial configuration for the STM32. + Depends on the STM32 USB driver. + * arch/arm/src/cortexm3/up_switchcontext.S & up_svccall.c. Made an improvement + to context switching. There are two types of context switches: interrupt + context switches and background/user context switches. This change should + improve the performance of those background/user context switches by a factor + of about two. + * arch/arm/src/stm32/: Fix several typos in the serial logic. It turns out + that these typose don't make any difference as long as you use only one + serial port and all uarts are configured the same. But the typos are bugs + waiting to happen in any other configuration. + * arch/arm/src/stm32/: You have to configure CTS/RTS function pins for USART + 2 and USART 3 even if you are not using flow control. + * arch/arm/src/stm32/stm32_usbdev.c: Added a USB device-side driver for the + STM32. NOTE: This is an early release of the USB driver. There is at least + one known issue. The examples/usbserial test only executes correctly under + certain conditions (see the full bug description in the TODO list). + * arch/arm/src/stm32/stm32_rcc.c: Fixed an error in clock initialization. + On some boards (none of mine), the HSE (high speed external clock) delay + loop times out if the optimization level is high. The STM32 then falls + back to the HSI (internal clock), and the system clock is too slow by a + factor of 11.1%. This was fixed by simply add the volatile storage class + to the timeout loop counter + * arch/arm/src/stm32/stm32_irq.c: Fixed a critical bug in the interrupt + control logic. The wrong register was being used for interrupts in a + certain range. Worked fine until you try to use an interrupt in that + range! + +4.14 2009-12-02 Gregory Nutt + + * arch/arm/src/stm32/stm32_gpio.c: Add support for configure an input GPIO + to generate an EXTI interrupt. + * config/stm3210e-eval/src/up_buttons.c: Add support for on-board buttons. + * include/nuttx/rwbuffer.h: Add generic support for read-ahead buffering + and write buffering that can be used in any block driver. + * include/nuttx/wqueue.h: Added a generic worker thread that can used to + defer processing from an interrupt to a task. + * include/nuttx/sdio.h: Defines a generic SD/SDIO interface can can be + bound to a MMC/SD driver to provide SDIO-based MMC/SD support. + * drivers/mmcsd/mmcsd_sdio.c: Provides an SDIO-based MMC/SD driver. + * arch/arm/src/stm32/stm32_sdio.c: Provides an STM32 implementation of + the SDIO interface defined in include/nuttx/sdio.h. + * fs/fs_mount.c: Correct error handling logic. If the bind() method + fails, then a reserved node is left in the tree. This causes subsequent + attempts to mount at the location to fail (reporting that the node + already exists). This is a problem for block drivers for removable + media: The bind method could fail repeatedly until media is inserted. + * arch/arm/src/stm32/chip.h & stm32_dma.c: Fixed several definitions + that can cause compilation errors when DMA2 is enabled. + * arch/arm/src/stm32/stm32_dma.c: Integrated and debugged STM32 DMA + functionality that was added in 0.4.12. + * configs/stm3210e-eval/usbstorage: Add a configuration to exercise + the STM32 with the USB mass storage device class example + (examples/usbstorage). + * configs/mcu123-lpc214x/up_usbstrg: Move LPC-specific code from + examples/usbstorage to configs/mcu123-lpc214x. + * configs/stm321e-eval/up_usbstrg: Add STM32-specific logic for the + examples/usbstorage test. + * arch/arm/src/stm32/stm32_usbdev.c: Fix bugs in STM32 USB device-side + driver: (1) Need to disconnect after reset received, (2) Status setup + to recover from stall on TX endpoint. + +5.0 2009-12-21 Gregory Nutt + + * arch/hc: Adding framework to support m68hc11/12 + * configs/demo9s12ne64: Configuration to support Freescale DEMO9S12NE64 + development board (MC9S12NE64 m68hcs12 processor). + * drivers/mtd/ftl.c: A FLASH translation layer (FTL) has been implemented. + This layer will convert a FLASH MTD interface into a block driver that + can be used with any file system. Good performance of this layer will + depend upon functioning write buffer support! + NOTE: FTL support is untested as of the initial check-in. + * Numerous minor changes for m68hc12 to eliminate compilation errors and + warnings due to the fact that it uses 16-bit integer types and for casts + between uint32 (32-bits) and an mc68hc12 pointer (16-bits). + * sys/types: Size of off_t and blkcnt_t should not depend on size of + int in the architecture; Removed non-standard type STATUS + * include/: Added header files stdint.h, stdbool.h, cxx/cstdint, and + cxx/cstdbool + * Changed ALL references to non-standard fixed-size types (like uint32, + ubyte, etc.) to standard types (like uint32_t, uint8_t, etc.) from + stdint.h. Use type bool and {true, false} from stdbool. This effected + most of the files in the system! Almost all configurations have been + re-built and many have been re-verified in order to get confidence in + these changes. + * graphics/ and examples/nx: Fix numerous build errors that have been + introduced lately. NXGL has suffered some bit-rot from not being used + in some of the most recent ports. + * The misc/pascal NuttX add-on package has been updated to use the new + standard types from stdint.h and stdbool.h and re-integrated with NuttX. + The released pascal-2.0 will be the first version that contains the + compatible changes. + * arch/arm/src/lm3s/lm3s_ethernet.c: Fixed an important bug in the LM3S + Ethernet driver: If full packet is received, the packet-too-big check + will fail because it needs to subtract 6 from the packet size (to + account for the 2-byte packet length and the 4-byte packet FCS in the + FIFO). + * net/accept.c: Fixed a bad assertion (only happens when debug is enabled). + * net/send.c net/uip/uip_tcpseqno.c: Fixed a critical error in the TCP/IP + logic. The NuttX port of uIP imcludes logic to send data ahead without + waiting for ACKs from the recipient; this greatly improves throughput. + However, the packet sequence number was not being updated correctly and, + as a result, packets were not be ACKed by the recipient and transfers + would sometimes stall. This is a very important bug fix (in fact, I + don't understand how TCP/IP worked at all without this fix???) + * include/nuttx/arch.h and arch/*/common/up_udelay.c: Change argument + of up_udelay() to type useconds_t to avoid warnings when sizeof(int) + is 16-bits. + * drivers/mmcsd/*: Add casts in constant expressions to avoid warnings + when sizeof(int) is 16-bits. + +5.1 2010-01-30 Gregory Nutt + + * arch/arm/src/lpc313x and arch/arm/include/lpc313x: Added framework + to support the NXP LPC3131. + * Add configs/ea3131. The LPC3131 port for the Embedded Artist EA3131 + (LPC3131) is code complete and waiting for me to get hardware in + hand. + * arch/arm/src/sam3u, arch/arm/include/sam3u, and configs/sam3u-ek - + Added the basic framework needed to begin a port for the SAM3U-EK + development board. + * lib/lib_crc32.c: Add CRC32 logic by Gary S. Brown to lib/. This is + the larger (but faster) table look-up version of the CRC32 algorithm. + * configs/ea3131/tools: Added a tool to create a image suitable for + use with the LPC313x bootloader. + * configs/sam3u-3k/ostest: Completed verification of the basic NuttX + OS test for the SAM3U. + * arch/arm/src/common/up_createstack: stack was always been cleared + when it was allocated. This is a good feature for monitoring the + stack during debug, but really hurts thread start-up performance. + Clearing is now done if CONFIG_DEBUG=y only. Changes was only made + for arm, but really should be made for all architectures. + * configs/sam3u/nsh: Added NSH configuration for SAM3U + +5.2 2010-03-18 Gregory Nutt + + * arch/arm/src/sam3u/sam3u_pio.c: Fix an address calculation error + that caused ports B & C to get mapped to the PIOA base address. + This is an important bugfix! (a patch is available) + * arch/arm/src/lpc313x/lpc313x_boot.c: Fix an error in the vector + initialization was causing a memory fault. + * lib/lib_strtod.c: Add strtod() + * lpc3131/ea3131: Several bring fixes submitted by David Hewson. The + lpc3131 is almost there! Thanks David! + * arch/arm/src/arm/up_head.S: Corrected backward conditional compilation + that selects if vectors are located at 0x0000:0000 or 0xffff:f000. + This fixes the last show stopper bug in the lpc313x bring-up. + * configs/ea3131/nsh: Added a NuttShell (NSH) configuration for the + EA3131. + +5.3 2010-04-11 Gregory Nutt + + * arch/arm/src/lpc313x/lpc313x_usbdev.c: USB driver for the LPC313x + contributed by David Hewson. + * configs/ea3131/src/up_ubstrgc.c, configs/ea3131/usbserial, + configs/ea3131/usbstorage: USB storage and USB serial example support + contributed by David Hewson. + * Several important compilation error fixes in lpc313x and (dualspeed) USB + code also contributed by David Hewson. + * arch/arm/src/sam3u/sam3u_dmac.c: DMA support for the AT90SAM3U. + * arch/arm/src/sam3u/sam3u_hsmci.c: SD memory card support for AT90SAM3U + (Neither the DMA nor the HSMCI driver are functional on the initial checkin). + * drivers/usbdev: Several important fixes to the USB mass storage driver + submitted by David Hewson. + * configs/olimex-lpc2378, arch/arm/include/lpc2378, and arch/arm/src/lpc2378 - + Basic port of the NXP 2378 on the Olimex board contributed by + Rommel Marcelo. + * arch/arm/src/sam3u/sam3u_internal.h: Fixed a critical bug in the AT91SAM3U + PIO decoding. No PIOs greater than 15 could be used on any port! Obviously, + no one has been using this port. + +5.4 2010-04-23 Gregory Nutt + + * include/nuttx/lcd.h: Defines an LCD interface. + * graphics/nxglib/fb and lcd: Support LCD and framebuffer rasterizers for NX. + * configs/sam3u-ek/src/up_lcd.c: LCD driver for LCD on SAM3U-EK development + board. + * configs/sam3u-ek/nx: NX graphics configuration for the SAM3U-EK + +5.5 2010-05-09 Gregory Nutt + + * drivers/net/enc28j60.c: Microchip ENC28J60 SPI Ethernet chip driver. + (untested on original check-in). + * configs/olimex-str7p11/nettest: examples/nettest configuration using + the ENC28J60 driver on the Olimex STMicro STR-P711. + (unverified on original check-in) + * configs/olimex-str7p11/src/up_enc28j60.c: Add ENC28J60 initialization + logic. + * configs/olimex-str7p11/src/up_spi.c: Fixed some bugs; added support + for ENC28J60. + * arch/arm/src/str7x/str7x_xti.c: Add basic XTI support (external + interrupts). + * arch/arm/src/lm3s and arch/arm/include/lm3s: Add definitions for + LM3S6965 + * configs/lm3s6965-ek: Add configuration for Stellaris LM3S6965 + Evaluation Kit (including basic examples/ostest configuration) + * lib/lib_dtoa.c and lib/lib_dtoa.c: printf will not print floating + point values if you select CONFIG_LIBC_FLOATINGPOINT in your + configuration file. Contributed by Yolande Cates. NOTE: these + floating point operations have not been well tested and may not + be portable to all floating point implementations. + * configs/lm3s6965-ek/nsh: Added NuttShell (NSH) configuration for + the LM3S6965 Evaluation Kit. Includes both serial and telnet + interfaces. + * net/net_close.c: Correct a UDP reference counting error + +5.6 2010-06-05 Gregory Nutt + + * drivers/lcd/p14201.c: Driver for RiT P14201 series 128x96 4-bit OLED. + * configs/lm3s6965-ek/nx: NX graphics configuration for the LM3S6965 + Ethernet Evaluation Kit. + * graphics/: Numerous fixes to get the P14201 4-bpp grayscale display + working (there may still be some minor issues .. see the TODO list). + * arch/arm/include/lpc17xx and arch/arm/src/lpc17xxx: Began port for + NXP LPC1768. As of the 5.6 release, there is a complete set of + LPC17xx header files defining all bits in all LPC17xx registers, + but little else (I still do not have hardware in hand). + * drivers/mtd/m25px.c: Add support for M25P1 flash part (See NOTE) + * include/nuttx/i2c.h: Extended I2C interface definition to handle + multiple transfers (See NOTE). + * include/nuttx/usbdev.h: Corrected an important macro definition + needed to correctly handle USB null packet transfers (See NOTE). + * arch/arm/src/lpc313x: New drivers: I2C and SPI. Plus several + important LPC313x USB bug fixes (See NOTE). + + NOTE: Contributed by David Hewson. + +5.7 2010-06-22 Gregory Nutt + + * configs/nucleus2g: Add ostest configuration for the Nucleus 2G + LPC1768 board from 2G Engineering (http://www.2g-eng.com/) + * arch/arm/src/lpc17xx: Added basic LPC17xx boot-up logic, + interrupt handling, and GPIO configuration. + * configs/nucleus2g/ostest: Completed bring-up of LPC1768 on + the Nucleus2G board using the examples/ostest + * configs/nucleus2g/nsh: Added and verified a NuttShell (NSH) + configuration for the LPC1768 on the Nucleus2G board. + +5.8 2010-07-18 Gregory Nutt + + * configs/nucleus2g/src/up_nsh.c and up_ssp.c: Add support + for SPI-based MMC/SD cards and integrate into the NSH example. + * arch/arm/src/lm3s/lm3s_vectors.S: Correct vectors for GPIOC & D + interrupts. + * arch/arm/src/lpc17xx/lpc17_clockconfig.c: Power was not being + provided to GPIO module. This is a critical bugfix! + * arch/arm/src/lpc17xx/lpc17_serial.c: Improved logic to handle + missed TX interrupts. + * arch/arm/src/lpc17xx/lpc17_ssp.c: Fix a hard fault during SSP + initialization. + * configs/nucleus2g/src/up_led.c: Change how LEDs are controlled + so that they can be used both for NuttX instrumentation and + by application software. + * include/net/uip/igmp.h and uip-igmp.h: Add header files ini + preparation for NuttX IGMP support + * net/uip/uip_igmp*.c: Add IGMP support (untested on initial + checkin). + * examples/igmp: Add a trivial test for IGMP (much more is needed) + * configs/nucleus2g/usbserial and usbstorage: Add USB configurations + for testing purposes. + * arch/arm/src/common/up_internal.h, cortexm3/up_assert.c, + */*_vectors.S: Correct compilations errors when CONFIG_ARCH_INTERRUPTSTACK + is enabled (feature still not tested) + +5.9 2010-08-25 Gregory Nutt + + * examples/nsh/nsh_telnetd.c: Fix compilation errors that happen + when both DHCPC and TELNETD are enabled in the Nuttshell. + * graphics/nxglib/fb/nxglib_moverectangle.c: Fix a logic error + that caused an uninitialized variable warning. I still don't + have a test to prove that the changes are correct. + * configs/olimex-lpc2378: Add support for the CodeSourcery toolchain + under Linux (contributed by Alan Carvalho de Assis). + * arch/arm/src/lpc17xx/lpc17_gpio.c: Fix an important GPIO configuration + bug: When attempting to set no pull-up or pull-down (floating), + it would, instead, select pull-down. + * arch/arm/src/lm3s/lm3s_gpioirq.c: Fix warning for returning a value + from functions returning void (contributed by Tiago Maluta). + * netutils/dhcpc/dhcpc.c: lease_time was not in host order + * examples/uip/main.c: if DHCPC is selected, this example now shows + the assigned IP address. + * arch/arm/src/lm3s and arch/arm/include/lm3s: Definitions for the + TI LM3S9B96 contributed by Tiago Maluta. + * arch/arm/src/lm3s/lm3s_gioirq.c: Fix a logic error in the address + table lookup. + * arch/arm/src/lm3s/lm3s_gioirq.c: Also needs to enable the global + GPIO interrupts. + * arch/arm/src/lm3s/lm3s_internal.h and lm3s_gpio.c: Fixed the encoding + of GPIO port number that limited support for GPIO ports to 8 + * sched/pg_*.c and *.c and include/nuttx/page.h: Implemented the + common, core logic for on-demand paging. See + http://www.nuttx.org/NuttXDemandPaging.html for details. + * drivers/usbdev/usbdev_serial.c: Correct compilation errors that + occur if CONFIG_USBDEV_DUALSPEED is selected. + * configs/ea3131/pgnsh: Add an NSH configuration with on-demand paging + enabled. This is not expected to be a functionality configuration (at + least not yet); it was created in order to debug the on-demand paging + feature. + * configs/ntosd-dm320/*/Make.defs: Codesourcery and devkitARM toolchains + now supported for the Neuros OSD. + * configs/ntosd-dm320 and arch/arm/src/dm320: Add support for the + Neuros production OSD (changes contributed by bf.nuttx). + +5.10 2010-09-07 Gregory Nutt + + * configs/ea3131/locked: Create logic to support a two pass build + process: The first pass forces critical logic into the locked text + region, the second pass builds the NuttX executable more-or-less as + normal. + * Makefile, arch/arm/src/Makefile, configs/ea3131: Add logic to + support a two-pass final link. This logic is only in place in + the arch/arm/src/Makefile for now. + * arch/arm/src/lpc17xx/lpc17_internal.h: Add missing parentheses in + macros definitions (patch submitted by Tiago Maluta). + * Documents/NuttxPortingGuide.html, configs/README.txt, etc. - + Replaced CONFIG_EXAMPLE with CONFIG_APP_DIR (see documents for + description). This allows NuttX application code to be built + outside of the examples/ directory. + + For people who have their own configurations and/or Makefiles, + you will need to make a couple of changes: + + - Replace all occurrences of CONFIG_EXAMPLE=foobar with + CONFIG_APP_DIR=examples/foobar in all of the configuration + files. + - Replace any occurrences of examples/$(CONFIG_EXAMPLE) with + $(CONFIG_APP_DIR) + - Replace any occurrences of lib$(CONFIG_EXAMPLE)$(LIBEXT) + with libapp$(LIBEXT) in your Makefiles. + - Check any other occurrences of CONFIG_EXAMPLE. + + * arch/arm/src/lpc313x/lpc313x_spi.c: Fix compilation error when + when CONFIG_DEBUG is enabled. + * arch/arm/src/lm3s and arch/arm/include/lm3s: Support for the + lm3s8962 contributed by Larry Arnold. + * configs/lm328962-ek: Support for the TI/Stellaris EKC-LM3S8962 + board (also contributed by Larry Arnold). + * arch/arm/src/lpc313x/lpc313x_boot.c: The call to lpc313x_boardinitialized() + should not be conditioned on CONFIG_ARCH_LEDs being defined! + * arch/arm/src/lpc313x/: APB0 and APB1 cannot lie in different + sections; they are too close together. + * arch/arm/src/lpc313x/lpc13x_boot.c: Resetting all of the clocking + had a side effect of wiping out the first 6 words of memory where the + interrupt vectors are located (and also not resetting the fractional + dividers). This is not usually noticeable because the IRQ vectors + are after this point, but really causes problems if you want to handle + data and prefectch aborts which are within this zeroed region. + +5.11 2010-10-01 Gregory Nutt + + * configs/ea3131/src/up_fillpage.c: Added new configuration item + CONFIG_PAGING_BINPATH. If CONFIG_PAGING_BINPATH 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. up_fillpage.c implements logic to perform page + files using the CONFIG_PAGING_BINPATH file. + * configs/mbed: Add configuration to support the mbed.org LPC1768 + board (Contributed by Dave Marples). + * sched/sem_wait.c and sem_waitirq.c: Eliminate a race condition + that can occur when a semaphore wait is interrupt by a signal. + (see email thread: https://groups.yahoo.com/neo/groups/nuttx/conversations/messages/530) + * drivers/mtd/at45db.c: Add a driver for the Atmel AT45DB161D 4Mbit + SPI FLASH part (untested on initial check-in). + * arch/arm/src/lm3s and arch/arm/include/lm3s: Corrections for the + lm3s8962 port contributed by Larry Arnold. That port is purported + to work correctly with these changes in place. + * examples/ostest/prioinherit.c: Need to reinitialize globals if + test is ran repeatedly in a loop. + * configs/ez80f910200zco: Updated to used ZDS-II 4.11.1 + +5.12 2010-10-26 Gregory Nutt + + * arch/avr: Add a place to support AVR family processors. + * arch/avr/include/avr32 and arch/avr/src/avr32: Add support for AVR32 + (all of the AVR32 is a work in progress). + * arch/avr/include/at32uc3 and arch/avr/src/at32uc3: Add support + for the AVR32 UC3A/B family of AVR32 MCUs. + * configs/avr32dev1: Add support for the Atmel AVR32DEV1 board featuring + the AT32UC3B0256 MCU. This board is produced by www.mcuzone.com. + * include/stdlib.h, lib/Makefile, lib/lib_abs.c, lib/lib_labs.c, + lib_labs.c, lib_llabs.c, lib_imaxabs.c: Add abs(), labs(), llabs(), and + imaxabs(). + * Add include/inttypes.h + * arch/hc/src/mc9s12ne64: This hcs12 port grew a few more files. But it + is still a long way from complete. + * arch/*/src/*/*_sigdeliver.c: Fixed a serious error in the signal + trampoline logic. Essentially, interrupts are re-enabled while the + signal handler executes, but the logic to re-disable the interrupts + before returning from the signal handler trampoline was missing. Under + certain circumstances, this can cause stack corruption. This was + discovered by David Hewson on an ARM9 platform, but since the code + has been leveraged, the bug has been propogated from ARM to Cortex-M3, + AVR32, M16C, SH1, ZNEO, eZ80, Z8, and Z80 -- almost every architecture. + The correction has been incorporated for all architectures but only + verified on a few. + +5.13 2010-11-09 Gregory Nutt + + * lib/lib_strnlen.c: Added POSIX 2008 strnlen() function. Contributed + by Michael Hrabanek. + * Fix wild, consistent naming error. For some reason, I called the at32uc3* + parts at91uc* everywhere. Fixed by changing lots of files and directories. + * configs/avr32dev1/ostest: The AVR32 port now successfully passes the + examples/ostest. We have a good AVR32 port! + * configs/avr32dev1/nsh: Added a configuration to support the NuttShell + (NSH). As of this writing, here is a problem receiving serial data (this + is, very likely, my hardware setup). + * lib/lib_open.c: Fix an error in fdopen when a valid file descriptor does + not refer to an open file. + * configs/olimex-lpc1766stk: Add support for the Olimex LPC1766-STK + development board. The OS test and NSH configurations (only) have been + verified. + +5.14 2010-11-27 Gregory Nutt + + * configs/olimex-lpc1766stk/nettest: Add examples/nettest configuration to + verify the LPC17xx Ethernet driver currently under development. + * arch/arm/src/lpc17xx/lpc17xx_ethernet.c/.h: Began development of + the LPC17xx Ethernet driver. Driver in CVS functional after 2010-11-23. + * sched/timer_settime.c: Fix an error in set-up of a one-shot POSIX timer. It + was using the repititive timer value (which is zero in the one-shot case), + always resulting in a 10Ms timer! Found and fixed by Wilton Tong. + * arch/arm/src/lpc17xx/lpc17_vector.S, stm32/stm32_vector.S, lm3s/lm3s_vector.S, + sam3u/sam3u_vector.S: Fixed a hard fault problem that can occur if certain + types of interrupts are pending at the time another interrupt returns + (SYSTICK). This has not been verified on all plaforms, but is a critical + fixed that is needed by all Cortex-M3 NuttX users. + * configs/olimex-lpc1766stk/thttpd: Add a THTTPD configuration for the + Olimex LPC2766-STK board. Verified successfully. + * net/uip/uip_tcpappsend.c: Correct an important logic bug in some uIP state + data the is used to manage retransmissions. The uIP logic was incompatible + with the retransmission logic of net/send.c in one place. The final error + was that the final packet in a sequence of packets was too large! In the + THTTPD example, this would leave some garbage at the bottom of the display + (or worse). I don't know why I haven't see this bug before??? + * net/uip/uip_tcpinput.c: The change to uip_tcpappsend.c unmasked an + additional error in the TCP sequence number handling. This sympom was that + the send() function would hang with outstanding, unacknowledged data (with + no re-transmit requests). The was due to differences in sequence number + handling in send() and in uip_tcpinput.c; uip_tcpinput.c thought (incorrectly) + that all of the bytes were acknowledged; send.c knew that they were not. + +5.15 2010-12-12 Gregory Nutt + + * net/uip/uip_tcpaddsend.c and net/send.c: Another place where the TCP sequence + number problem "fixed" in 5.14 might occur. + * net/send.c: Check if the destination IP address is in the ARP table. If + not, then don't consider the packet sent. It won't be, an ARP packet will go + out instead. This improves behavior, for example, on the first GET request + from a browser. + * arch/arm/src/lpc17xx/lpc17_emacram.h and lpc17_allocateheap.c: The Ethernet + logic was using all of AHB SRAM Bank0 for Ethernet packet buffers (16K). An + option was added to limit the amount of SRAM used for packet buffering and to + re-use any extra Bank0 memory for heap. configs/olimex-lpc1766stk/nettest + now uses only 8K at the beginning of Bank0; the 8K at the end of Bank0 is + included in the heap + * arch/arm/src/lpc17xx/lpc17_ssp.c: Fix compilation errors when SSP1 is + selected. + * configs/olimex-lpc1766stk/nsh: Enable network and SD/MMC card support in + NSH. Networking and telnetd interface as well as SPI-based microSD are + now functional. + * examples/nsh/nsh_netinit.c: Fix NSH bug. If CONFIG_NET is selected, but + CONFIG_EXAMPLES_NSH_TELNETD is not selected, then the network is never + initialized and bad things happen if you try to ping. + * drivers/lcd: Add header files for the Phillips PCF8833 LCD controller and + for the Epson S1D15G10 LCD controller. A driver for the Nokia 6100 LCD is + coming. + * include/nuttx/spi.h and almost all other SPI files: Added an optional + cmddata() method to the SPI interface. Some devices require an additional + out-of-band bit to specify if the next word sent to the device is a command + or data. This is typical, for example, in "9-bit" displays where the 9th bit + is the CMD/DATA bit. The cmddata method provides selection of command or data. + * drivers/lcd/p14201.c: Now uses the cmddata() method of the SPI interface. + * arch/arm/src/lpc17xx/lpc17_usbdev.c: LPC17xx USB driver now appears to + to be fully functional. examples/usbstorage configuration verified (the + examples/usbserial configuration is untested). + * drivers/usbdev/usbserial.c and usbstorage.c: All USB class drivers need + to call DEV_CONNECT() when they are ready to be enumerated. That is, + (1) initially when bound to the USB driver, and (2) after a USB reset. + * drivers/lcd/nokia6100.c: A driver for the Nokia 6100 LCD. This driver + has not be verified as of the initial check-in. + * configs/olimex-lpc1766stk/nx: A NX graphics configuration for the Olimex + LPC1766-STK board using the Nokia 6100 LCD driver. This configuration has + not been verified as of the initial check-in. + * include/nuttx/spi.h: the SPI_SETBITS macro was calling the setmode method. + This is a very important bug-fix in some usages. + +5.16 2011-01-10 Gregory Nutt + + * include/nuttx/usb: Created new directory. Moved all usb-related header + files to this new directory. Created a skeleton for a new USB host header + file + * drivers/usbhost: Add USB host "registry" where connect devices can be + matched with the correct USB class driver. + * arc/arc/src/lpc17xx/lpc17_usbhost.c: Add a simple USB host driver for + the NXP lpc17xx. + * drivers/usbhost: Add generic USB device enumeration logic. + * drivers/usbhost: Add a USB host class driver for the (Bulk-Only) USB + Mass Storage Class. + +5.17 2011-01-19 Gregory Nutt + + * include/nuttx/usb: rename usb_storage.h to storage.h. + * arch/arm/src/lpc17xx/lpc17_usbhost.c: Add support for low-speed devices. + * drivers/usbhost/usbhost_skeleton.c: Template for new class drivers + * include/nuttx/usb/hid.h and drivers/usbhost/usbhost_hidkbd.c: New + files for HID keyboard support. + * arch/arm/src/lpc17xx/lpc17_usbhost.c: Will now handle multiple + concurrent transfers on different endpoints (still only one TD per + endpoint). All methods are protected from re-entrancy; lots of re- + structuring in preparation for interrupt endpoint support. + * arch/arm/src/lpc17xx/lpc17_usbhost.c: Add support for periodic + interrupt transfers. + * examples/hidkbd: Added a simple test for the USB host HID keyboard + class driver. + * configs/olimex-lpc1766stk/hidkbd: Added a configuration to build the + USB host HID keyboard class driver test for the LPC17xx. + * Ran the tool CppCheck (http://sourceforge.net/apps/mediawiki/cppcheck) and + fixed several errors in the code identified by the tool. + +5.18 2011-02-27 Gregory Nutt + + * Incorporate several uIP patches from http://gitweb.aeruder.net/?p=uip.git;a=summary. + - Lost SYNACK causes connection reset + - Fix missing UDP stats for sent/received packets + - Added support for Cygwin as development/test platform. + * configs/demo9s12ne64: Integrate new buildroot-1.9 m8s12x toolchain. + * 'uname -o' is used throughout the build logic in bash scripts and also in + Make.defs files in order to distinguish between Cygwin and Linux. However, + the -o option is not standard and is not supported under, for example, OS-X or + Solaris. This was solved by changing all 'uname -o' references to the more + complex: 'uname -o 2>/dev/null || echo "Other"' + * drivers/usbhost/usbhost_enumerate.c: Add logic to get the VID and PID. This + is necessary in order to support vendor-specific USB devices. + * examples/wlan, configs/olimex-lpc1766stk/wlan, drivers/usbhost/usbhost_rtl8187.c, + Add infrastructure to support RTL18187 wireless USB. + * configs/nucleus2g: backed out USB host changes... wrong board. + * Renamed arc/hc/include/mc9s12ne64 and src/mc9s12ne64 to m9s12. That name is + shorter and more general. + * The NuttX repository has been converted to SVN and can now be found here + http://svn.code.sf.net/p/nuttx/code/trunk/ + * configs/mbed/hidkbd: Added USB host support for the mbed LPC1768 board; add + a USB host HID keyboard configuraion. + * drivers/usbhost/hid_parser.c: Leverages the LUFA HID parser written by + Dean Camera. + * examples/nsh: Correct an usage of getopt(): If you stop calling getopt() + before all parameters are parsed, you can leave getopt() in a strange state. + * include/nuttx/video/fb.h: Restore missing RGB type that was accidentally removed + when Nokia 6100 support was added. + * Rename arch/pjrc-8051 to arch/8051 + * configs/ne64badge: Add a configuration for the Future Electronics Group + NE64 Badge development board (Freescale MC9S12NE64) + * Changes contributed by Uros Platise: + - Add support for the STM32F103RET6 + - configs/vsn: Support for the ISOTEL NetClamps VSN V1.2 ready2go sensor + network platform + * arch/hc, configs/ne64badge: Development is complete for the Freescale + mc9s12ne64 on the Future Electronics Group NE64 /PoE Badge board. Howeve, + this port remains untested until I figure out this BDM / Code Warrior + and paged build thing + * Added a new 'kill' command to NSH that will support sending signals to + running NuttX tasks. + +5.19 2011-03-12 Gregory Nutt + + * arch/arm/stm32/stm32_idle.c: During idle times, the STM32 now uses the + WFI instruction to sleep in a reduced power mode until the next interrupt + occurs (Contributed by Uros Platise). + * NSH: 'mem' command renamed to 'free'. Output is now more similar to the + Linux 'free' command. + * NSH: Correct a redirection bug in NSH. The following would not work; it + resulted in a hang after the 'cat /dev/fifo': + + nsh> mkfile /dev/fifo + nsh> cd /tmp # /tmp is a mounted RAM disk + nsh> cat /dev/fifo > test.txt & + nsh> echo "This is a test" > /dev/fifo + + The error was caused because (1) there was a path that resulted in stdout + being closed (the "hang") and also (2) the 'cat' command was always outputting + to stdout, not to the redirected file descriptor. Now: + + nsh> cat test.txt + This is a test + + * drivers/pipes/pipe_common.c: Driver open method was not returning an EINTR + error when it received a signal. Instead, it just re-started the wait. This + makes it impossible to kill a background pipe operation from NSH. + * include/stdint.h: Correct some errors in conditional compilation (submitted + by Johannes Hampel). + * arch/arm/lpc17xx/lpc17_idle.c: Uses the same logic as the STM32: uses the + WFI instruction to sleep in a reduced power mode until the next interrupt + occurs. + * configs/olimex-lpc1766stk: Added an LED encoded to indicate if the LPC1766 + is in sleeping. + * examples/mm: This is a simplified version of the "built-in" memory manager + test of mm/mm_test.c. It is simplified because it does not have access to + the internals of the memory manager as does mm/mm_test.c, but it has the + advantage that it runs in the actual NuttX tasking environment (the + mm/mm_test.c only runs in a PC simulation environment). + * drivers/mmcsd_sdio.c/h: Several corrections submitted by Uros Platise. + * arch/x86: Provide support for x86 architectures. Support for the i486 + architecture under QEMU is provided under arch/x86/include/i486, + arch/x86/include/qemu, arch/x86/src/i486, and arch/x86/src/qemu. + * configs/qemu-i486: "Board" support configurations for verifying the QEME + i486 port. + * arch/arm/src/stm32/stm32_spi.c: Correct base address of SPI3 (reported by + Uros Platise). + * drivers/mmcsd/mmcsd_sdio.c: Correct a loop termination condition (also + reported by Uros Platise). + * drivers/mtd/ramtron.c: Driver for SPI-based RAMTRON NVRAM devices FM25V10 + (and others). Contributed by Uros Platise. + * examples/nsh and tools/mkromfsimg.sh: Add support for platform-specific + ROMFS-based NSH start-up scripts. + * drivers/serial/uart_16550.c and include/nuttx/serial/uart_16550.h: Support + for a generic 16550 UART. + * configure/qemu-i486/nsh: QEMU NSH example. + * ../apps: The apps directory add-on was created by Uros Platise. It + supports a set of end-user applications than can be executed on top of + NSH. Think of it this way: In a buckled-up embedded application, your + end-user programs will probably have their own dedicated start-up logic. + But, during development, you might want to have you applications + available and executable from the NSH command line. This apps/ addon + (and NSH hooks) was contributed by Uros to accomplish just that. + * sched/sched_waitpid() and include/sys/wait.h: Provides a simple and + very incomplete implementation of waitpid(). waitpid() is only available + if CONFIG_SCHED_WAITPID is defined in your configuration file. + * sched/atexit.c and sched/exit.c: The atexit function is not frequently + used. In order to save a few bytes, it is now conditioned on + CONFIG_SCHED_ATEXIT. It your application is currently using atexit(), + you will need to add CONFIG_SCHED_ATEXIT to your configuration file. + * drivers/net/slip.c: Add a SLIP driver (untested on initial check-in). + * configs/olimex-lpc1766stk/slip-httpd: An example that uses SLIP to + provide a serial-port based THTTPD web server. + +6.0 2011-03-21 Gregory Nutt + + * lib/lib_fopen(): fopen() was not returning the correct errno value + when the underlying open() failed. + * include/net/uip/uip-arch.h: The uIP interface has been extended + slightly so that drivers can be concurrenly filling and sending + packet buffers. This capability was needed by the SLIP driver. + * drivers/net/slip.c: Several corrections and some re-design of + of the driver. + * apps/ChangeLog.txt: the apps/ directory now has its own ChangeLog. + * configs/vsn: + - IDLE LED blinking fix + - Added board power off function + * arch/arm/src/stm32/stm32_gpio.c and stm32_internal.h: Fixed + PullUp/Down Input Configuration. + * arch/arm/src/lpc17xx/lpc17_serial.h: Now supports Auto-RTS and + Auto-CTS modes. This is needed to support SLIP. + * drivers/net/slip.c: SLIP is now basically functional on the + LPC17xx with some caveats as described in the TODO list under + LPC17xx. + * arch/x86/include/i486/irq.h: Fix irqrestore() macro... it was not + correctly re-enabling interrupts. + * arch/x86/src: Fix numerous problems with i486/QEMU context + switching. Basically, the logic was missing the cases to handle + the differing stack frames when a priority change occurs and when + no priority change occurs. + * configs/qemu-i486/ostest and nsh: The QEMU i486 port is complete. + it now passes the OS test and supports the NuttShell (NSH). + * misc/drivers: Created a new directory to hold non-BSD licensed + drivers that may be added into NuttX via an installation script. + * drivers/usbhost/usbhost_rtl8187.c: A decision was made to + incorporate code taken from the Linux kernel. That changes the + licensing on this module to GPL. To avoid licensing contamination, + this driver was moved to misc/drivers/rtl8187x *prior* to adding + any of the GPL logic. There is an INSTALL.sh script at the location + where the GPL driver(s) can be re-installed into the NuttX source + tree. By re-installing the driver, you agree to the GPL licsensing + and all of its implications. + * Makefile, apps/Makefile, tools/configure.sh: Add logic to copy + configs///appdir to apps/.config and to simply the + application configuration logic. + * examples/nsh and apps/nshlib: Move the core NuttShell (NSH) logic + out of the exemples directory and into the apps/ directory where + it belongs. + * apps/Makefile and configs/*/appconfig: Use '=' as the delimiter + instead of '/' so that sub-directories in apps/ can be used. + * apps/vsn: Move all VSN apps to apps/vsn. + * nuttx/examples moved to apps/examples + +6.1 2011-04-11 Gregory Nutt + + * arch/arm/include/lpc17xx/irq.h and arch/arm/src/lpc17xx/lpc17_gpio*.c: + Fix several bugs in the GPIO interrupt logic. Submited by + Decio Renno. + * Initialization for the CONFIG_APPS_DIR is now supported during the + earlier, 'context' build phase. + * arch/arm/src/lpc17_gpioint.c: Finish coding of the LPC17xx GPIO + interrupt logic. + * net/netdev_unregister.c: Add capability to un-register a network + device. + * drivers/mmcsd/mmcsd_sdio.c: extra effort to correctly handle cases + without the SDcard (but one issue still exists in STM32) + * arch/arm/src/stm32/stm32_tim.*: Added basic timer support TIM1..TIM8 + with output PWMs and interrupt logic + * config/vsn/src: Added basic support for Sensor Interface (GPIO and + PWM Power Output, and the sif utility program) + * fs/: Reorgnize header so that file systems can be built outside + of the nuttx source tree + * apps/namedapp/binfs.c: Create a tiny filesystem that can be used + to show the internal named apps under /bin. + * fs/fs_opendir.c: Correct an error that occurs when a file system is + mounted in the root directory. This was discovered while mounting + the named app's /bin directory. + * lib/: Move all source files into a subdirectory of lib/ named after + the header file in which the library function is prototyped. + * sched/ and lib/pthread/: Move pthread attribute-related interfaces + from sched/ to lib/pthread where they more appropriately belong. + * sched/ and lib/semaphore/: Move some semaphore-related interfaces + from sched/ to lib/pthread where they more appropriately belong. + * syscall/: The beginnings of an optional syscall Kernel interface. + * tools/mksyscall.c: Add a tool that will auto-generate syscall proxies + and stubs from a comma-separated-value (CSV) data file. + * arch/arm/src/cortexm3/mpu.h: Add a header file describing the Cortex-M3 + MPU registers. + * Numerous modifications to the build system. Various people have reported + build problems since the re-organization and release of NuttX-6.0. I am + unable to replicate the build problems in my environment, but the changes + have be incorporated in hope of correcting the build issues in other + environments. + * drivers/i2c/st_lis331dl.c: I2C-based driver for the LIS331DL MEMS + motion sensor. Contributed by Uros Platise. + * Makefile: The NuttX build system will now supported building NuttX as two + separately linked images: (1) a kernel-mode RTOS image, and (2) a user- + mode application image that communicates to the RTOS kernel via system + calls. A lot more still must be done. + * user_initialize(): Eliminated the user_initialize() initialization hook. + It is difficult to maintain and redundant: Board level initialization + an up_initialize() provide the same kind of capability. + * arch/*/include/*/type.h: On some compilers, char defaults as unsigned. + Explicitly add signed to integer types if signed is what is required. + * arch/*: For all architectures -- Global register state save structure + (usually called g_current_regs) should be marked volatile; Added general + capability to support nested interrupts (not fully realized for all + architectures). + * sched/task_create.c: Add support for starting kernel-mode thread. + * drivers/usbdev/usbdev_serial.c: Fix reported by Sheref Younan. USB + was being reset after serial driver was closed. As a result, you could + no reopen the serial driver. + * configs/lpcxpresso-lpc1768: Add a board configuration for the Embedded + Artists LPCXpresso LPC1768 board. + +6.2 2011-05-06 Gregory Nutt + + * arch/arm/src/lpc17xx/lpc17_gpioint.c: Correct errors in logic that maps + and IRQ number into a register bit number. + * Makefile: Fix an error introduced in the top-level Makefile in NuttX-6.1. + This error only shows up if you have a /tftpboot directory. Then the + make will fail with an obscure error about not being able to stat pass2. + * configs/lpcxpresso-lpc1768/nsh: Add an NSH configuration for the + LPCXpresso board. + * configs/*/ld.script: Removed 'sh_link not set for section .ARM.edix' for + a few of the builds. In you have this warning, it can be removed with the + following change to the ld.script file: + + + __exidx_start = ABSOLUTE(.); + .ARM.exidx : { + - __exidx_start = ABSOLUTE(.); + *(.ARM.exidx*) + - __exidx_end = ABSOLUTE(.); + } >sram + + __exidx_end = ABSOLUTE(.); + + * arch/arm/src/lpc17xx: Correct some typos/bugs in configuration of LPC17xx + UART2 and UART3. + * nuttx/clock.h: Replace all references to the global variable g_system_timer + with clock_systemtimer() (currently just a macro that that returns g_system_timer). + * lib/string/strrch.c: Would fail if the searched-for character were the first + character in the string. + * tools/version.sh and mkversion.c: Tools to manage a NuttX version number + file + * sched/clock_getutc() and lib/time/lib_time.c: Add support for 1 second UTC + interface. + * net/net_dup2.c and include/nuttx/net.h: The conditional compilation for + '#if CONFIG_NFILE_DESCRIPTOR > 0' was wrong in both of these files. It should + be '#if CONFIG_NFILE_DESCRIPTORS > 0'. This causes a dup2() failure in THTTPD + and a failure to get a CGI page. The consequence can be a very serious bug! + * configs/lpcxpresso-lpc1768/usbstorage, thttpd, and dhcpd: Add an USB storage, + THTTPD web server, and DHCP server configurations for the NXP LPCXpresso board. + * drivers/lcd/ug-9664hswag01.c and ssd1305.h: Add support for Univision UG-9664HSWAG01 + OLED with Solomon Systech SD1305 LCD controller. + * configs/lpcxpresso-lpc1668/nx: Add a NX graphics configuration for the LPCXPRESO + board. + * graphics/nxglib/nxglib_nonintersecting.c: Fix some single bit errors in + calculation of non-intersecting regions. This was causing an anomaly + in examples/nx in column 0. + * drivers/mtd/rammtd.c: Added a RAM based MTD driver. This RAM driver simulates + FLASH and is useful for testing purposes. + * arch/arm/src/arm/up_head.S: Fix backward conditional compilation. This cause + the configs/mx1ads configuration to fail to build but does not appear to affect + any other ARM9 build. + * fs/nxffs: Adding a tiny, wear-leveling FLASH file system for NuttX. This + file system is intended to be small and will have some limitations. The + implementation is incomplete on initial checkin. + * apps/examples/nxffs and configs/sim/nxffs: Add a test a a configuration that + will be used to verify NXFFS. + * fs/fat/fs_fat32.c and fs_fat32util.c: Incorpated two bugs with fixed provided + by Sheref Younan. Thanks! + * fs/nxffs: After a couple of weeks of testing and bug fixes, NXFSS appears + stable and functional. + +6.3 2011-05-15 Gregory Nutt + + * Remove clock_getutc(). It is replaces with clock_gettime(CLOCK_ACTIVETIME). + Add other RTC related changes provided by Uros Platise. + * arch/arm/src/stm32/stm32_flash.c: Add support for access to on-chip STM32 + FLASH; beginning of integration with NXFFS (Uros Platise). + * arch/mips: Added directory structure for PIC32 support + * configs/pcblogic-pic32mx: Add directory structure for PCB Logic PIC32MX board + * apps/include: Move include/apps to apps/include. A symbolic link is created at + build time + * Makefile: Removed support for Pascal pcode interpreter. Support for that + interpreter has been moved to apps/interpreter/Makefile. + * tools/mkdep.sh: Should not report an error if there are no files on the command + line. This happens normally in certain configurations. + * drivers/usbhost: Sheref Younan reported an error in the error handling when + connection to a USB device fails. In certain fail cases, the logic would try + to free the device class instance twice, the first was okay, but the second + caused a crash. + * graphics/nxbe/nxbe_colormap.c: Fix error noted by Bassem Fahmy. The function + nxbe_colormap was change to nxbe_configure... apparently "search-and-replace" + error. This error was not noticed before because most NX platforms do not use + colormapping. + * arch/rgmp and configs/rgmp. Add architecture support and build + configuration for RGMP. RGMP is a project for running GPOS and + RTOS simultaneously on multi-processor platforms. See + http://rgmp.sourceforge.net/wiki/index.php/Main_Page for further + information about RGMP. + * lib/stdio/lib_fclose.c: Must flush all buffered data when the file is closed. + Instead, it was discarding the buffered data. + * lib/stdio: All output stream logic was modified to support CONFIG_STDIO_LINEBUFFER. + If standard C buffered I/O is enabled (CONFIG_STDIO_BUFFER_SIZE > 0), then this + option may be added to force automatic, line-oriented flushing the output buffer + for putc(), fputc(), putchar(), puts(), fputs(), printf(), fprintf(), and vfprintf(). + When a newline is encountered in the output string, the output buffer will be + flushed. This (slightly) increases the NuttX footprint but supports the kind of + behavior that people expect for printf. + +6.4 2011-06-06 Gregory Nutt + + * lib/drivers/cc1101: Add initial, functional CC1101 wireless driver + (contributed by Uros Platise) + * arch/mips and configs/pcblogic-pic32mx: The MicroChip PIC32MX port is now + code complete and ready to begin testing. Unfortunately, it looks like + testing will be delayed due to tool issues (My PICkit 2 will not work the + the MPLAB debugger on PIC32; I will need to get a PICkit 3). + * drivers/net/e1000.c/h: A PCI-based E1000 Ethernet driver submitted + by Yu Qiang. + * lib/net/lib_inetaddr.c: An implementation of the inet_addr() function + submitted by Yu Qiang. + * arch/arm/src/lpc31xx and arch/arm/include/lpc31xx: Renamed from lpc313x + to make name space for other famiy members. + * arch/arm/*/lpc31xx: Added support for the LPC315x family (untested). + * sched/task_exithook.c: Functionality performed when a task exits or is + deleted has been moved to a common file task_exithook.c. Now exit() + functionality (like flushing I/O and calling registered atexit() + functions, etc.) will be performed when a task is deleted as well. + * mm/: Added support for CONFIG_MM_SMALL. Each memory allocation has a + small allocation overhead. The size of that overhead is normally + determined by the "width" of the address support by the MCU. MCUs + that support 16-bit addressability have smaller overhead than devices + that support 32-bit addressability. However, there are many MCUs + that support 32-bit addressability *but* have internal SRAM of size + less than or equal to 64K. In this case, CONFIG_MM_SMALL can be + defined so that those MCUs will also benefit from the smaller, 16- + bit-based allocation overhead. + * lib/string/lib_strndup.c: Add standard strndup() library function. + * net/getsockname.c: Added standard getsockname() to return the local + address associated with a socket. + * lib/stdio/lib_asprintf.c: Add asprintf() + * configs/olimex-lpc1766stk/ftpc: Add a configuration to support + testing of the FTP client shell. + * fd/fs_fdopen.c and net/net_checksd.c: Add support so that fdopen may + be used with socket descriptors. + * net/recvfrom.c: Fix an error found in receiving small files via FTP: + The small file is received a buffered in the readahead buffer, then the + socket is disconnected. When the app calls recvfrom, the socket is + already disconnected and the buffered data is stranded. Now, recvfrom + will continue to return success after the socket is disconnected until + the readahead buffer is drained. + * olimex-lp1766stk/ftpc/defconfig: Many configurations have the MTU + (CONFIG_NET_BUFSIZE) set to very small numbers, less then the minimum + MTU size that must be supported -- 576. This can cause problems in + some networks: CONFIG_NET_BUFSIZE should be set to at least 576 in + all defconfig files. This has only been fixed in this defconfig file. + +6.5 2011-06-21 Gregory Nutt + + * arch/avr/src/avr and arch/avr/include/avr: Adds general support for + the Atmel 8-bit AVR family. + * arch/avr/src/atmega and arch/avr/include/atmega: Adds support for the + Atmel AVR ATMega family. + * arch/avr/src/at90usb and arch/avr/include/at90usb: Adds support for the + Atmel AVR AT90USB family. + * configs/micropendous3: Adds a board configuration for the Opendous + Micropendous 3 board. This board may be populated with several different + members of the Atmel AVR AT90USB family. + * configs/amber: This is a placehold for the Atmel ATMega128 Amber Web + Server from SoC Robotics. Not much present in this directory on initial + check-in. + * configs/teensy: Adds a board configuration for the PJRC Teensy++ 2.0 board + that features an Atmel AT90USB1286 MCU. + * fs/fat: Offsets, sector numbers, etc. need to be off_t, not size_t. size_t + is intended to be the maximum size of a memory object, not a file offset. This + does not make any difference except on systems (like the AVR) where size_t + is only 16-bits. + +6.6 2011-07-11 Gregory Nutt + + * drivers/mtd/ramtron.c, net/net_checksd.c, fs/fs_fdopen.c, and include/nuttx/mii.h: + Several structural changes made to get a clean compile under the eZ80 ZDS-II + toolchain (no design changes). + * drivers/usbhost/usbhost_storage.c: Incorpated bugfixes reported by Sheref H. + Younan: (1) Read capacity logic read largest block, not the number of blocks + and was, therefore, off by one, and (2) Some devices stall of get Max LUN request + if they support only a single LUN. Logic now assumes a single LUN if the get + Max LUN request fails. + * include/nuttx/arch.h, lib/stdio/lib_libvsprintf.c, lib/stdio/lib_fputs.c: Add + a new configuration option to support extracting strings from FLASH or EEPROM + or other memories where the string data cannot be accessed by simply de-referencing + a string pointer. + * arch/sim/src/up_romgetc.c: Used to test the basic logic to access strings + without directly de-referencing a string pointer. + * arch/avr/src/avr/up_romget.c: Used to access strings that lie in the first + 64K of FLASH (But I still haven't figured out how to get strings to reside in + FLASH without using the PROGMEM attribute). + * configs/teensy/src/up_spi.c: Correct reading of SD CD and WP pins (was reading + the wrong register. AVR SPI now appears to be functional. + * arch/avr/src/at90usb/at90usb_usbdev.c: Correct USB initialization. Interrupts + were being enabled BEFORE the interrupt handler was attached. + * configs/sure-pic32mx: Add a configuration for the Sure Electronics, "Advanced USB + Storage Demo Board," Model DB-DP11215 (http://www.sureelectronics.net/goods.php?id=1168). + This board features the MicroChip PIC32MX440F512H MCU. (Untested on initial + check-in). + * configs/stm3210e-eval/nsh2: Add another NSH configuration for the STM32 with + some different properties. + * CONFIG_NSH_CONDEV: Add a configuration option to allow using a different character + device (such a a different UART) for the NSH interface. This allows, for example, + debug output to come from the console device while using another device for NSH. + There are some issues on initial check-in: NuttX doesn't have termios and the + console device has special properties that make using NSH awkward. Examples: + No CR-LF expansion, no character echoing, no command line editting. + * arch/arm/src/stm32/stm32_lowputc.c and stm32_serial.c. Correct several bugs + involving serial port configuration. These bugs are only critical if you + are trying to using multiple UARTs on STM32. + * configs/stm3210e-eval/src/up_lcd.c: Add a driver for the STM3210E-EVAL's LCD. + * configs/stm3210e-eval/nx: Add NX configuration for the STM3210E-EVAL. + * configs/nuttx/arch.h (and arch/arm/src/stm32, configs/*/src/up_buttons.c): + Standardize interfaces exported for button support and button interrupts. + * configs/stm3210e-eval/src/up_buttons.c: Add interrupting button support. + Also fixes a few errors in STM3210E-EVAL button decoding. + * configs/stm3210e-eval/buttons: Add a configuration to exercise STM3210E-EVAL + buttons. + * arch/arm/src/stm32/stm32_gpio.c: GPIO interrupt handling for pin + numbers were being aliased: 5-9 together and 10-15 together. Extended + the logic to peform decoding of GPIO interrupts and unique dispatching + for all 16 pins. + * configs/stm3210e-eval/nxtext: Add a configuration for the apps/examples/nxtext + example. This example focuses on placing text on the background while + pop-up windows occur. Text should continue to update normally with or without + the popup windows present. + * arch/arm/src/common/up_checkstack.c: ARM stack overflow checking submitted + by Hal Glenn. + * arch/arm/src/lpc17xx: Changes to compile successfully with no serial console + (also submitted by Hal Glenn). + * graphics/nxfonts/nxfonts_convert.c: Fixed a critical bug that caused + when renderer some fonts with bits-per-pixel > 8 + * graphics/nxbe/nxbe_move.c: Fixed an error in the graphics move logic (This + was a previously untested interface). Basically, there is some confusion + between use of (x,y) as a relative offset or as an absolute position. + * graphics/nxbe/nxbe_close.c: Fixed an important graphics system bug: + When a window is closed, the display was not being updated. The old + window graphic was left on the display for a time. + +6.7 2011-08-02 Gregory Nutt + + * Makefile: Added a export target that will bundle up all of the NuttX + libraries, header files, and the startup object into an export-able + tarball. + * arch/arm/src/lpc17xx/lpc17_can.h: Correct some typos in the CAN + register definitions. + * drivers/serial/serialirq.c: Correct an error that can occur if the + serial RX buffer becomes full. Data is now discarded in that case; + before, leaving data in the hardware would cause infinite interrupts + one most MCUs since you must read the data in order to clear the + interrupt. + * arch/arm/src/lpc17xx/lpc17_can.c: Added a CAN driver contributed by + Li Zhuoyi (Lzyy). + * include/stddefs.h and sys/types: Added type wchar_t. + * fs/fat/fat_fat32dirent.c: Move all FAT directory operations to this + new file; Implement VFAT long file name support. + * fs/fat/fat_fat32dirent.c: The configuration CONFIG_FAT_LCNAMES has + been around for some time but never tested until now. This setting + will mimic the NT 8.3 file name behavior: File names or extensions + may be all upper or all lower case (but not mixed). If + CONFIG_FAT_LCNAMES is not selected, all filenames are strictly upper + case. + * configs/stm3210e-eval/nsh2: Console is back on UART1; Added + examples/nx as an NSH "built-in" command as a demonstration. + * fs/fat/fs_fat32dirent.c: Fix an important bug in the directory + allocation (fat_allocatedirentry()). I looks like it could be + initializing the wrong sectors! NOTE: This function was in + fs_fat32utils.c in earlier releases. + * arch/arm/src/stm32_sdio.c: Correct an important DMA-related bug; + SDIO transfer completion events and DMA completion eventes were + not being coordinated correctly. + * configs/stm3210e-eval/nsh2: Enable FAT long file name support + * sched/sem_timedwait.c: Add the standard sem_timedwait() interface. + * graphics/nxfonts/nxfonts_getfont.c, nxfonts_bitmap.c, + Makefile.source, and include/nuttx/nxfonts.h: Support for multiple + fonts included. A new interface, nxf_getfonthandle() takes a font + ID and returns a handle that is now used at all other font interfaces + to specify which of the multiple fonts to use. + * arch/arm/src/lpc17xx/lpc17_syscon.h: Fix typo (reported by Li Zhuoyi). + * configs/stm3210e-eval/nsh2: Extended to support two new commands: + 'msconn' will connect the USB mass storage device; 'msdis' will + disconnect the USB storage device. + * tools/bdf-converter.c. This C file is used to build the bdf-converter + program. The bdf-converter program be used to convert fonts in Bitmap + Distribution Format (BDF) into fonts that can be used in the NX graphics + system. + * include/nuttx/nx: Move all NX header files from include/nuttx to + include/nuttx/nx. + * drivers/usbdev/usbdev_usbstorage.c and arch/arm/src/stm32/stm32_usbdev.c: + Correct a memory leak when the USB mass storage driver is connected and + then disconnected from the target. The write requests were not being + freed. NOTE that the unregister logic in the STM32 needed to call + stm32_reset() in order to return the write requests to the USB mass + storage driver; it is possible that a similar but could exist for other + architectures. + * graphics/nxfonts/nxfonts_*.h: Add serveral more new fonts + * arch/z80/src/eZ80/ez80_serial.c: Fix some errors in serial driver + setup for UART1 (submitted by Paul Osmialowski). + * drivers/input/tsc2007.c and include/nuttx/input/*: Add a generic NuttX + touchscreen interface. Add a driver for the TI TSC2007 touchscreen + controller. + * graphics/nxglib/lcd and fb: Add low level routines to set single pixels. + * lib/math/lib_b16atan2.c: Add a fixed precision atan2() function + * graphics/nxglib/nxglib_splitline.c: Add logic to divide a wide line into + trapezoidal components. + * graphics/nxmu/nx_drawline.c, graphics/nxsu/nx_drawline.c, + graphics/nxtk/nxtk_drawlinewindow.c, graphics/nxtk/nxtk_drawlinetoolbar.c: + Add new line drawing interfaces (untested). + +6.8 2011-08-19 Gregory Nutt + + * arch/arm/src/lpc17xx/chip.h: Fix some chip memory configuration errors + for the LPC1764, LPC1756, and LPC1754 (submitted by Li Zhuoy (Lzyy)) + * arch/arm/src/lpc17xx/lpc17_can.h: Revised CAN driver submitted by + Li Zhuoy (Lzyy). The driver now supports both CAN1 and CAN2. + * arch/arm/sim/up_lcd.c: Add a simulated LCD driver. + * configs/stm3210e-eval/nxlines: Added a configuration to build + examples/nxlines. + * arch/graphics: Used apps/examples/nxlines to (finally) verify the NX + trapezoid drawing functions and (wide) line drawing functions. + * arch/rgmp and configs/rgmp. Yu Qiang has ported RGMP to the OMAP4430 (arm) + pandaboard and release the new RGMP 0.3 version. The main changes are: (1) + Separate configs/rgmp/x86 and configs/rgmp/arm configuration directory, and + (2) Extract architecture dependent code in arch/rgmp/include and + arch/rgmp/src into corresponding x86/ and arm/ directories. + * arch/arm/src/kinetis, arch/arm/include/kinetis, configs/kwikstick-k40: + Add a directory structure to support the port to the Kinetis KwikStik-K40. + There is no real substance in the initial check-in; only the directory + structure and skeleton files (Code complete on 8/15/11). + * arch/arm/include/armv7-m, arch/arm/src/armv7-m, etc.: Rename all cortexm3 + directories and files to armv7-m; Change name of of all CORTEXM3 constants + to ARMV7M. This is a major namespace change needed to cleanly support the + ARM Cortex-M4 which is also in the ARMv7 M Series (specifically, ARMv7E-M). + * sched/sig_initialize.c, sig_received.c, and mq_waitirq.c. Fixed several + critical bugs related to signal handling initialization and for signals + the wake up tasks that are waiting to send or receive message queues. In + the first two files, errors would prevent proper allocation of signal-related + structures from interrupt handlers. In the second, there was missing + "clean-up" logic after a signal occurred, leaving the message queue in + a bad state and resulting in PANICs. All are important. (submitted by + hkwilton). + * arch/arm/src/kinetis: Added header files defining all Kinetis registers + and bit fields within all Kinetis registers. + * configs/twr-k60n512: Add support for the Kinetis K60 Tower board + (TWR-K60N512). + * drivers/can.c: Fixed a semaphore overflow problem in the CAN driver + (reported by Li Zhouy (Lzyy)). + * 8/18/2011: The basic port to the FreeScale Kinetis TWR-K60N512 board is + now functional. + * configs/twr-k60n512: Add Kinetis TWR-K60N512 NSH configuration. + * drivers/analog and include/nuttx/analog: Add ADC driver infrastructure + and TI ADS1255 driver developed and submitted by Li Zhouy (Lzyy)). + * arch/arm/stm32/stm32_sdio.h and drivers/mmcsd/mmcsd.c: Add logic to + multiplex usage of the GPIO pins (contributed by Uros Platise). + * configs/twr-k60n512/nsh: Added and verified a NuttShell (NSH) + configuration for the Freescale, Kinetis TWR-K60N512 board. + +6.9 2011-09-11 Gregory Nutt + + * arch/arm/src/kinetis/kinetis_sdhc.c: SDHC driver for Kinetis parts. + Initially check-in is just a crude port of the STM32 SDIO driver. + Much more work is needed. + * graphics/, include/nuttx/nx: Add new NX interfaces for drawing + circles -- both circular outlines and filled circles. + * graphic/nxglib/nxglib_spitline.c: Add a "fudge factor" that eliminates + some problems for rendering nearly horizontal, wide lines. Hmm... + but I suspect this fudge factor also leads to new problems rendering + very thin, nearly horizontal lines. More tuning is needed. + * drivers/analog, include/nuttx/analog, arch/arch/src/lpcxx: (1) Add + updates to the ADS1255 driver, (2) fix errors from my last merge (sorry), + (3) Add DAC infrastructure, (4) add AD5410 DAC driver, and (5) add + LPC17xx ADC and DAC drivers. All contributed by Li Zhuoyi (Lzyy). + * tools/mkexport.sh: Extended the script that implements the top-level + 'make export' logic. The script now also finds and bundles up all of + the architecture-specific header files as well. + * drivers/arch/arm/src/stm32/stm32_i2c.c: Add a reset to the I2C + initialization logic to prevent spurious interrupts when the I2C + interrupts are enabled (submitted by Uros Platise). + * Scripts/makefiles/documents. Several adjustments, corrections and + typo fixes so that NuttX will build correctly on FreeBSD using the + ASH shell (submitted by Kurt Lidl). + * drivers/mtd/flash_eraseall.c: Add a callable function that accepts + the path to a block driver and then erases the underlying FLASH memory + (assuming that the block driver is an MTD driver wrapped in the FTL + layer). Hmmm... this is probably not the best long term solution; + flash_eraseall() should be a user-callable function that operates + one driver interfaces; not an internal, OS function that operates + on directly on block drivers. + * drivers/bch: Fixed some important bugs in the BCH driver (noted by + Li Zhuoyi (Lzyy)). This would have effected any large reads or writes + (larger than the hardware sector size). + * arch/*/src/Makefile: Use of -print-libgcc-file-name to get path to + libgcc.a may select the wrong libgcc.a if a multilib toolchain (like + CodeSourcery) is used. This can be a serious problem and can cause + crashes on Cortex-M3 if the ARM libgcc is used, for example. The fix + is to include ARCHCPUFLAGS on the gcc command line when asking it to + -print-libgcc-file-name. + * lib/time/lib_gmtimer.c: Correct several calculations that could lead + to errors in dates. + * drivers/pm: Add the beginnings of a NuttX power management sub-system. + * arch/arm/src/stm32/stm32_irq.c: Fix a error introduced in 6.8. + Timeout calculation uses clock_settime() instead of clock_gettime(). + Pretty gross error, but actually it works with the side effect of setting + a bad time. + * drivers/mtd/at24xx.c: Driver for I2C-based at24cxx EEPROM submitted by + Li Zhuoyi (Lzyy). + * arch/arm/src/lpc17xx/lpc17_i2c.c: I2C driver for the NXP LPC17xx family + submitted by Li Zhuoyi (Lzyy) + * arch/arm/src/stm32_i2c.c: Correct two issues with the STM32 I2C driver: + (1) Clocking needs to be based on PCLK1, not HCLK and fast speed settings + need some additional bits; and (2) Correct a hang that will occur on + I2C1 if FSMC is also enabled. + * drivers/sensors/lm75.c and include/nuttx/sensors/lm75.h: Add an LM-75 + temperature sensor driver. + * configs/stm3210e-eval/src/up_lm75.c: Add support for the LM-75 on the + STMicro STM3210E-EVAL board. + * sched/clock_gettime.c: Correct an error in the tv_nsec calculation + that happens only config CONFIG_RTC is enabled. + * arch/arm/src/stm32/stm32_i2c.c: Correct some bugs related to waiting + for the I2C STOP condition to be cleared. + +6.10 2011-10-06 Gregory Nutt + + * lib/stdio/lib_fopen.c: Fix an error in fopen(); the file pointer was not + being positioned at the end of the file when the "a" and "a+" modes are + used. There are other issues with the "a+" modes (see the top-level TODO + list). + * drivers/usbdev/cdc_serial.c and include/nuttx/usb/cdc.h and cdc_serial.h: + Add support for the CDC ACM serial device class. + * fs/fat/fs_fat32.c: Fix a critical bug in the write logic: It a tiny write + cross a sector boundary, then two sector writes will occur. The first part + in the first sector may be written to the wrong sector number. + * fs/fat/fs_fat32util.c: Fix a stray write into the FAT (always sector 964 on + FAT32). This bug will cause some lost chains. I'm sure this bug could + corrupt files but at present, the only thing I have seen is that before + fixing this bug, the Windows chkdsk utility would report these lost chains. + * arch/arm/src/stm32/stm32_i2c.c: Driver can now operate in a faster polled + mode (at the expense of using more cpu cycles). + * arch/arm/src/stm32/stm32_i2c.c: Add trace debug capability. Enabled with + CONFIG_I2C_TRACE. + * arch/arm/src/stm32/stm32_i2c.c: Fix another bug where I2C conflicts with FSMC + being enabled. That time at the tail end of the transaction where there is + an unfinished stop condition. + * sched/mq_timedreceive.c and sched/mq_timedsend.c: The count of threads + waiting on the message queues was not being decremented after a timeout. + This would cause the accounting logic to become out of sync and the, perhaps, + an assertion to be triggered. This is an important bug and fixes a + potential crash when using mq_timedreceived() and mq_timedsend(). + * sched/mq_sndinternal.c: Related to the above, the send logic was incrementing + the wrong counter when it waited as part of the mq_timedsend.c logic. + * fs/fat: Fix an error in the long file name logic: If the long file name + is an even multiple of 13 bytes in length, then it should not include a + NULL terminating character. Fix contributed by Kaushal Parikh. + * configs/sim/nx11: Created a separate configuration to build the NX + example using the a simulated framebuffer driver on an X11 window. This + example has been verified on Ubuntu 9.09 (it does not work on Cygwin). + * arch/sim/src/up_touchscreen.c and up_x11eventloop.c: Adds support for a + simulated NuttX touchscreen device using mouse/pointer feedback from an + x11 window. + * configs/sim/touchscreen: Adds a configuration to verify the simulated + touchscreen driver (Does not work on Cygwin). + * configs/sam3u/touchscreen: This is the configuration that I plan to use + to verify the SAM3U-EK touchscreen driver. However, as of this writing, + there is no touchscreen driver for the board. + * CONFIG_RTC_HIRES: Add an option to support either a high-resolution RTC + that completely replaces the system timer tick but may overflow and lose + time when the MCU is off and also for a low-resolution (1 sec/tick) RTC + that can run until 2106 with no overflow. But in this latter case, higher + resolution time must come from the system timer. + * CONFIG_SYSTEM_UTC: Removed support for the UTC system timer. It just + doesn't do enough to be worth the CPU cycles or the complexity. + * CONFIG_SYSTEM_TIME16: Added support for an optional 64-bit system timer. + * fs/fat/fs_fat32util.c: Add support for FAT date/time stamps; Enabled via + CONFIG_FS_FATTIME. + * arch/arm/src/sam3u/sam3u_spi.c: Add an SPI driver for the AT91SAM3U. + * drivers/input/ads7843e.c and include/nuttx/input/ads7843e.h: Add a + driver for the TI ADS7843E touchscreen controller. + * fs/nxffs/nxffs_open.c: Fix an error when a file is open for writing; since + the file will get deleted it is already exists, there must be a check if + there are other open references to the file. + * arch/arm/src/stm32/stm32_sdio.c: Fixed an error where during SDHC + initialization interrupts were not being re-enabled. Caused more subtle + errors than you would think. + * arch/arm/src/stm32/stm32_i2c.c: Fixed an error where I2C timeouts appeared + to be successful transfers. + * configs/sim/nsh2: Add another simulated NSH configuration. This one + supports X11 graphics, C++, and exercises graphic functions as built-in + commands. + +6.11 2011-11-12 Gregory Nutt + + * arch/arm/stm32/Make.defs: Don't build stm32_rtc.c if CONFIG_RTC is not + selected. Doing so will cause errors if other configuration dependencies + are not met. + * configs/stm3210e-eval/src/up_lcd.c: Color corrections for SPFD5408B LCD + do not work with R61580 LCD. + * configs/pic32-starterkit: Beginning of a configuration for the Microchip + PIC32 Ethernet Starter Kit. Hmmm.. I don't have a clue how to test this + with no serial port?! + * lib/stdio/lib_fclose.c: fclose() always returns an error (EOF) when it + closes a read-only file. This is because it calls flush() which will + fail on read-only files. No harm is done other that a bad value is + returned. + * arch/sim/src/Makefile: Correct build issue for sim/nsh2 target. Old + libboard.a was not being cleaned. + * arch/mips/src/pic32mx/pic32mx-gpio*.c: Add GPIO support for the PIC32MX. + * configs/sure-pic32mx/src/up_leds.c and up_buttons.c: Add button and LED + support for the Sure Electronics PIC32MX board. + * configs/ea3152: Add a configuration for the Embedded Artists LPC3152 + daughter board (with the same base-board used with configs/ea3131) + * graphics/nxmu/nx_getrectangle.c, graphics/nxsu/nx_getrectangle.c, + graphics/mxtk/nx_getwindow.c, graphics/nxmu/nx_gettoobar.c: New + interfaces to read from graphics memory + * graphics/nxbe/nxbe_bitmap.c: Fix an error in the error handling that + can cause valid bitmaps to fail to render. + * include/nuttx/video/rgbcolors.h: Fix errors in some 16- and 8-bit color + conversion macros. + * tools/incdir.sh: Fix issues when g++ is used as the compiler. It was + not being recognized and handled properly. + * graphics/nxsu/nx_releasebkgd.c: Fix a bad cast that was causing + problems with the background window was released. + * fs/nxffs/nxffs_pack.c: Correct a critical bug in the NXFFS file system: + When repacking the filesystem, there was a missing check to see if an + inode structure would fit at the end of a block. This is a rare case + if the block size is large, but can be common for tiny block sizes + and results in a crash and file system corruption. + * fs/nxffs/nxffs_initialize.c: Fix an initialize error. If the FLASH + is full on power-up, NXFFS will fail to initialize correctly. + * fs/nxffs/nxffs_write.c and nxffs_pack.c: Fix an error that can occur + when attempt to write to FLASH volume that is completely full but + has no value inodes on it. + * drivers/mtd/at24xx.c: Now supports a configurable block size that + supports using "clusters" of AT24 pages as blocks. This allows bigger + block sizes and more efficient use of EEPROM when the AT24 is used to + support a file system (such as NXFFS). (Contributed by Hal Glenn). + * include/nuttx/video/rgbcolors.h: More fixes to RGB color conversion + macros. + * arch/arm/src/common/up_createstack.c and up_usestack.c: For ARM EABI + the stack must be aligned to 8-byte boundaries. This is necessary for + passing aligned floating point values under EABI. Fix contributed by + David Sidrane. + * Numerous changes and fixes to the PIC32 interrupt handing logic. The + PIC32 port is almost complete but still not ready for prime time. + +6.12 2011-12-06 Gregory Nutt + + * fs/fat/fs_fat32util.c and fs_fat32.h: Logic extended to look in up to + four partitions for a valid FAT file system. + * drivers/input/tsc2007.c: Add support for 8-bit conversions; make sure + that A/D converters are active before requesting conversions. + * drivers/mmcsd0/mmcsd_sdio.c: Increase capacity variable from size_t + to uin64_t (if available) so that SD cards with capacities greater + than 4Gb can be supported. + * fs/fat/fs_fat32dirent.c: The root directory structure is different + from other directories. When formatted by Windows, it is not initialized + at all. Some additional special handling is required to initialize the + root directory entry to interoperate correctly with windows. + * fs/fat/fs_fat32util.c: In fat_systime2fattime(void) should be + clock_gettime() and not clock_gettime(). Also, there is a place where + FAT date is used instead of FAT time. (Thanks to David Sidrane). + * arch/arm/src/stm32 and arch/arm/include/stm32: Add support for the + STM32F40xxx family of MCUs. + * configs/stm3240g-eval: Add framework for the STMicro STM3240G-EVAL + board. + * include/sys/types.h: wchar_t is a builtin type in C++ and its + declaration can cause errors with certain C++ compilers. + * sched/sig_timedwait.c: Fix signal handling when the returned info + is NULL. Before this change, it would derefence a NULL pointer + in this case. + * graphics/nxfonts/nxfonts_sans17x22.h and nxfonts_sans20x26.h: Add + some very small sans serif fonts. + * graphics/nxfonts/nxfonts_sans17x23b.h and nxfonts_sans20x27b.h: Add + corresponding sans serif bold fonts. + * drivers/input/ads7843e.c and tsc2007.c: Fix some errors in the poll + setup error checking that was cloned into both drivers. + * sched/mq_notify.c: Set errno appropriately on failures. There are + still several message queue functions that do not set errno! + * arch/arm/src/stm32: Fixes to several STM32F40xxx files (contributed by + Mikhail Bychek). + * configs/stm3210e-eval/src/up_lcd.c: Fix banding problem on the R61580 + LCD + * configs/stm3240g-eval/ostest: The basic STM32F40xx bringup is functional + (11/12/06) for the STM3240G-EVAL board and passes the OS test. + * configs/stm3240g-eval/nsh: Adds a NuttShell (NSH) configure for the + STM3240G-EVAL board. + +6.13 2011-12-26 Gregory Nutt + + * arch/arm/src/stm32/stm32f40xxx_dma.c: Add DMA support for the STM32 F4 + family (untested on initial check-in) + * arch/arm/src/armv7-m/up_fpu.c: Add logic for saving an restoring VFP + floating point registers on context switches (but also disable the FPU + because CodeSourcery doesn't support hard flowing point!) + * arch/arm/src/stm32/chip/stm32_eth.h: Add Ethernet register definitions + for the STM32 F4. + * arch/arm/srcm/stm32/stm32_eth.c: Adds an Ethernet driver for the STM32 F4. + * arch/arm/srcm/stm32/stm32_dac.c and stm32_adc.c: "Skeleton" files for STM32 + DAC and ADC drivers. The actual logic will come later. + * arch/arm/srcm/stm32/stm32_eth.c: There may be a few more lurking bugs, but + the STM32 Ethernet driver appears to be fully functional on the STM3240G-EVAL. + * arch/arm/srcm/stm32/stm32_eth.c: Fix an error in clearing abnormal interrupt + events. + * configs/stm3240g-eval/dhcpd: Add a DCHP daemon configuration for the + STM3240G-EVAL board. + * configs/stm3240g-eval/nettest: Add a network test configuration for the + STM3240G-EVAL board. + * arch/arm/srcm/stm32/stm32_rtc.c, stm32f10xxx_rtc.c, and stm32f40xxx_rtc: + Broke out separate drivers to handle the very different RTC implementations + in the STM32 F1 and F4 family. + * arch/arm/srcm/stm32/stm32f10xxx_rtc.c: STM32 F4 RTC is functional (12/14/2011) + * net/uip-arp.c: Fix compilation issue with CONFIG_NET_ARP_IPIN + * include/nuttx/pwm.h and drivers/pwm.c: Add an interface definition and a + "upper half" driver for PWM output. + * arch/arm/src/stm32/stm32_pwm.c: Added a PWM "lower half" driver for the + STM32. The initial check-in is little more than a framework for the driver. + * arch/arm/src/stm32/stm32_usbdev.c: Corrected two CRITICAL errors in the USB + device-side driver: (1) Handling of data overrun condition was wrong. When + there was no further memory to accept further OUT endpoint data, the driver + would hang with infinite interrupts; (2) the logic in setting toggle bits + was not correct. However, this driver has functioned for a long time until + the particular condition that revealed the bug occurred. My impression is + that this latter bugfix also fixes some STM32 USB performance problems. + * configs/hymini-stm32v: A configuration for the HY-Mini STM32v board contributed + by Laurent Latil. These changes also include support for the STM32F103VCT6. + * arch/configs/stm3240g-eval/src/up_pwm.c: Add hooks needed to use the new + apps/examples/pwm test of the STM32 PWM driver. + * drivers/mtd/mp25x.c: Add ability to use different SPI modes and different + manufacturers codes. Fix a error in the wait for not busy (submitted by + Mohammad Elwakeel. + * arch/arm/src/stm32/stm32_can.c: Add a low-level STM32 CAN driver. (Initial + check is incomplete). Add loopback support to the driver. + * arch/arm/src/stm32/stm32_adc.c: The ADC is now functional. A more complete + driver would require DMA support. I have some questions still about the + accuracy of the timer-driven sampling. + * configs/sure-pic32mx/nsh: The PIC32 port is (finally) functional. Add an + NSH configuration for the Sure PIC32MX board. + * configs/sure-pic32mx/*/defconfig. Calibrated all PIC32 delay loops. + * configs/pcblogic-pic32mx/nsh: Add an NSH configuration for the PCBLogic + PIC32 board. + * Both PIC32 OS test and NSH configurations have now been verified. + +6.14 2012-01-15 Gregory Nutt + + * tools/Makefile.export, mkexport.sh, and configure.sh: Changes submitted + by Mike Smith to support configuration and 'make export' on MAC OS. + * arch/arm/src/stm32/stm32_gpio.c: Disabled interrupts while configuring + GPIO pins so that we have exclusive access to the GPIO configuration + registers. + * arch/mips/src/pic32mx/pic32mx_usbdev.c: Add a USB device-side driver + for the PIC32MX family. + * arch/arm/src/stm32/stm32_gpio.c: Correct an error in some of the GPIO + initialization logic. Fix submitted by Mike Smith. + * configs/olimex-lpc1766stk/src/up_leds.c: Add new interfaces so that is + CONFIG_ARCH_LEDS are not set, the LEDs may be controlled from application + logic. + * configs/olimex-lpc1766stk/src/up_buttons.c: Add support for the buttons + on the Olimex LPC1766-STK board. + * Makefile: Added 'apps_clean' and 'apps_distclean' target to simplify + managing the state of the application directory while in the NuttX directory + * Documentation/NuttXGettingStarted.html: Added a "Getting Started" Guide + for NuttX. At present, this is just a stub and it refers to the NuttX + top-level README.txt file which is the only, real "Getting Started" Guide + that exists at the time being. + * arch/arm/src/lpc17xx/lpc17_gpioint.c: Correct an value used as the lower + end of an IRQ number range test. + * arch/arm/src/lpc17xx/lpc17_gpio.c: Fix a integer flow problem in shift. + This error would prevent pins > 15 from being used as interrupt sources. + * arch/arm/src/stm32/stm32_can.c: The CAN driver has been verified in + loopback mode on the STM3240G-EVAL board. + * configs/stm3240g-eval/src/up_adc.c: Complete coding of ADC support for the + potentiometer on board the STM3240G-EVAL. + * arch/arm/src/lpc17_can.c: Several CAN driver improvements. Adds support for + testing in loopback mode. now uses all three transmit buffers for better + performance. + * configs/olimex-lpc1766stk/nsh: Now supports the CAN loopback test as an + optional "built-in" application. + * sched/irq_attach.c: Fix an issue with disabling interrupts when they are + detached. For the PIC32, this can't be done because there is a 1-to-many + relationship between vector numbers and interrupt numbers or different. + Added a new configuration option CONFIG_ARCH_VECNOTIRQ to at least flag + the architectures that have this issue and to (at least) avoid doing + something too wrong. + * drivers/can.c: Fix a test for buffer full in the generic, "upper half", + can driver. + * arch/arm/src/lm3s: Add support for the LM3S6432S2E (Contributed by Mike Smith) + * configs/lm3s6432-s2: Add support for the TI RDK-S2E (LM3S6432S2E) board + (Contributed by Mike Smith) + * configs/stm3240g-eval/src: Add APIs support to support user access to the + LEDs + * arch/arm/src/lpc17xx/lpc17_can.c: Add logic to change the CAN bit rate based + on the NuttX configuration. + * arch/arm/src/lpc17xx/lpc17_can.c: PCLK divisor is now a configuration + option. + * arch/arm/src/stm32/stm32_serial.c and stm32_lowputc.c: Support for + UART4-5 and USART6 added by Mike Smith. Also includes a more flexible + way of managing UART pin configurations. + * include/nuttx/pwm.h, drivers/pwm.c, arch/arm/src/stm32/stm32_pwm.c: Add + support for pulse count in order to better support stepper motors. + * arch/arm/src/stm32/stm32_dumpgpio.c: Checking wrong register to see if + GPIO is enabled. Also not adding the GPIO base address to several offsets. + * configs/stm32f4discovery: Port to the STMicro STM32F4Discovery board + (Contributed by Mike Smith). + * fs/fat/fs_fat32util.c: On a failure to recognize a FAT file system, the + mount logic should return -EINVAL, not -ENODEV. + * arch/arm/src/stm32/stm32_tim.c: Support for STM32 F4 32-bit timers + (Contributed by Mikhail Bychek) + * lib/stdio/lib_vsprintf.c: Add support for fixed-size fields with floating + point numbers (Contributed by Mikhail Bychek) + +6.15 2012-02-12 Gregory Nutt + + * arch/arm/src/stm32/stm32_pwm.c: Pulse count was limited to 128; now is + (essentially) unlimited. + * configs/stm3240g-eval/include/board.h: Input frequencies wrong for all but + one APB2 timer. + * arch/mips/src/pic32mx/pic32mx-ethernet.c: The PIC32 Ethernet driver is + code complete, but still untested. + * configs/sim/*/Make.defs and arch/sim/src/Makefile: Add support for building + a 32-bit executable on a 64-bit Linux target. + * configs/sure-pic32mx/src/up_leds.c: Correct GPIOs used for LEDs. The wrong + pins were being used. + * arch/arm/src/stm32/chip/stm32f10xxx_gpio.h: Correct offset to one AFIO EXICR + register. + * arch/arm/src/lpc17xx/lpc17_can.c: Added "advanced" configuration options + to specify the CAN TSEG1 and TSEG2 clock counts specifically. + * include/nuttx/can.h and drivers/can.c: Add support for extended (29-bit) + CAN IDs. + * arch/arm/src/lpc17xx/lpc17_can.c: Add support for extended (29-bit) CAN IDs. + * arch/arm/src/stm32/stm32_can.c: Add support for extended (29-bit) CAN IDs. + * include/nuttx/power/pm.h: Move include/nuttx/pm.h into a sub-directory named + power. + * drivers/power: Rename the drivers/pm directory to power + * include/power/battery.h and drivers/battery.c: Add the interface definitions + for an upper and lower half battery driver. Add the implementation of the + common upper half battery driver. + * drivers/power/max1704x.c: Add a driver for MAX17040x battery "fuel gauge" + * arch/arm/src/stm32/stm32_i2c.c: Add support for I2C3 + * drivers/usbdev/: Lots of name changes: cdc_serial->cdcacm, usbstrg->usbmsc, + usbser->pl2303 + * drivers/usbdev/composite: Fleshed out support for a composite USB device. + * drivers/stm3210e-eval/composite and drivers/stm3210e-eval/src/up_composite.c: + Add a configuration test the USB composite device. + * include/nuttx/usb/usb.h, drivers/usbdev/composite_descriptors.c, and + drivers/usbdev/cdcacm_descriptors.c: Add support for the USB Interface + Association Descriptor (IAD) + * arch/arm/src/stm32/stm32_i2c.c: Correct a typo in STM32 I2C3 support + (submitted by Mike Smith) + * arch/*/src/Makefile: Candidate solution for dependency issue in the board + sub-directory: By making libboard.a a "phony" target, libboard.a should + always rebuilt (the end result is worth the small increase in build time) + (submitted by Mike Smith). + * include/net/psock.h: Added a new low level socket interface that allows the + OS to use the socket interface without having a socket descriptor. + * include/net/psock.h: Removed psock.h. The new interfaces are moved into + nuttx/net.h which already has similar logic. + * include/nuttx/usb/usb.h: Can't use 'class' as a field name in USB structures. + This upsets C++ if usb.h is included. 'class' -> 'classid' in this header + file and all places that referenced 'class' + * drivers/usbdev/usbmsc.c: Fixed some backward conditional compilation. + * sched/on_exit.c: Add support for the on_exit() function., + * sched/exit.c, task_exithook.c, task_delete.c, sched_releasetcb.c: Move + the logic that closes file descriptors sooner in the task shutdown sequence. + When drivers are closed, they may need to do things that require a fully + up-and-running task. Some things cannot be done later when the task is + crippled. + * lib/dirent: Moved readdir_r() and telldir() from lib/misc to this new + directory where they belong. + * lib/termios. Implemented tcsetattr() and tcgetattr(). + * lib/stdio/lib_fgets.c: The old fgets includes some terminal related + functionality: It handles VT-100 commands, includes a command line editor + and echo characters back to the terminal. This old, overloaded fgets() + was renamed readline() and moved to apps/system/readline. The version + of fgets() in lib/stdio was them simplified and stripped down so that it + *only* gets a string -- as its description implies. + * arch/arm/src/lpc214x/lpc214x_usbdev.c: Add corrections suggested by + David Hewson many, many months ago. + * configs/mcu123-lpc214x/composite and configs/mcu123-lpc214x/src/up_composite.c: + Add a configuration to test the USB composite device. + * configs/stm3240g-eval/Telnetd: Add a configuration for testing the + Telnet daemon. + * configs/stm3240g-eval/nsh2: This is another NSH configuration. It differs + from the original nsh configuration because it does not have an RS-232 + console (only a Telnet console) and SDIO is enabled. This configuration is + required because the STM3240G-EVAL board cannot simultaneously support + RS-232 and SDIO due to pin conflicts. + * lib/string/lib_strcasestr.c: Add strcasestr(). + * lib/stdio/lib_avsprintf.c: Add avsprintf(). + * lib/net/lib_inetntop.c: Add inet_ntop(). + * lib/net/lib_inetpton.c: Add inet_pton(). + * include/pthread.h: Correct PTHREAD_MUTEX_INITIALIZER. + * fs/fat/fs_fatfs.c: Fix an error in the FAT statfs() implementation that + was causing some block counts to be reported incorrectly (reported by + David Sidrane). + * drivers/ramlog.c: Add a character driver that can substitute + for /dev/console and or be used for logging debug output when there + is no serial port available (such as when a Telnet console is used). + * lib/stdio/lib_syslogstream: Add a stream object that will be used to + re-direct all debug output to the RAM log if CONFIG_SYSLOG and + CONFIG_RAMLOG_SYSLOG are defined. + * lib/misc/lib_dbg.c: Add an interface enabled with CONFIG_DEBUG_ENABLE that + can be used to turn debug output on and off. + +6.16 2012-03-10 Gregory Nutt + + * drivers/sensors/qencoder.c and include/nuttx/sensors/qencoder.h: Add an + implementation for a quadrature encoder upper half driver. + * arch/arm/src/stm32/stm32_qencoder.c/.h: Add a initial implementation of + a lower-half quadrature encoder driver for the STM32. On initial check-in, + this is little more than a "skeleton" file. + * Various files: CAN ISO-11783 support contributed by Gary Teravskis. + * net/recv.c and net/recvfrom.c: Correct a bug in return value: The the peer + gracefully closes the connections, needs to return zero and not ENOTCONN. + * arch/arm/src/stm32/stm32_eth.c: Fix an error in the STM32 ethernet driver. + The received buffer size must be two bytes larger to account for the two byte + checksum that is appended to the packet. Otherwise, the last two bytes of + real data in the packet will get clobbered. + * arch/arm/src/stm32f40xx_dma.c: The STM32 F4 DMA has (finally) been verified + * arch/arm/src/stm32_sdio.c: STM32 F4 SDIO DMA is now supported + * configs/stm3240g-eval/nsh/defconfig: This configuration now supports SDIO + with DMA (see configs/stm3240g-eval/README.txt for some issues). + * arch/arm/src/armv7-m/up_vectors.S and arch/arm/src/armv7-m/up_vectors.S: New, + streamlined Cortex-M exception handling (with FPU supported). Contributed byh + Mike Smith + * net/accept.c, connect.c,and net_monitor.c: Correct an error in the accept + logic. After a new connection is made via accept(), monitoring for losses + of TCP connection must be set up (just as with connect()). The new file + net_monitor.c holds the common TCP connection monitoring logic used by both + the accecpt() and connect() logic. Contributed by Max Nekludov. + * net/recvfrom.c and net/uip/uip_tcpcallback.c: Fix a leak in the TCP + read-ahead logic. This is a *critical* bug fix! + * net/uip/uip_tcpinput.c: Correct an error in the TCP stack. It was + incrementing the received sequence number BEFORE determining if the + incoming data could be handled. If the data was dropped (usually because + there is insufficient buffering space), then no ACK will be sent and the + sequence number will be wrong. The end consequence of the bad sequence + number was that the when the dropped packet was re-transmitted, it was + was ignored because its sequence number looked wrong. Fix was, obviously, + to only increment the recevied sequence number if the TCP data was + accepted. + * configs/stm3240g-eval, configs/stm32f40discovery, and arch/*/src/Makefile: + Add changes to support building with the Atollic "Lite" toolchain. + * fs/fs_select.c: Correct select(), in the case of loss of network + connection (POLLHUP), select() must report a read-ready event. This + is how the standard select() interface is supposed to work: In the case + of loss-of-connection, select() reports read-ready. The next time you + read from the socket, you detect the end-of-connection event. Change + submitted by Max Nekludov. + * arch/arm/src/armv7-m/up_fpu.S and arch/arm/src/stm32/stm32_vectors.S: Fix + lazy FPU register saving with CONFIG_ARCH_FPU is set in the configuration. + * arch/arm/src/armv7-m: Lazy saving of floating point registers on context + switches now seems to be functional. + * net/uip/uip_tcpinput.c: Fix a TCP protocol error reported by Max Nekludov. + * configs/stm3240g-eval, configs/stm32f40discovery: Add changes to support + building with the Atollic "Pro" toolchain. + * Makefile: Use the more common .hex extension for Intel hex files instead of + more precise .ihx extension. This change has ripple effects to many build- + related scripts and programs and could cause some short-term problems. + * configs/stm3240g-eval/, arch/arm/src/stm32/up_allocateheap.c: Add support + for the 16-mbit SRAM on-board the STM3240G-EVAL board. + * drivers/usbdev/cdcacm.c and include/nuttx/usbdev/cdcacm.h: The CDC/ACM + driver can now be dynamically connected and disconnected from the host + under software control. + * include/nuttx/arch.h, configs/stm3240g-eval/src/up_cxxinitialize.c, and + configs/stm3240g-eval/src/up_cxxinitialize.c: Add support for C++ static + initializers. + * net/setsockopt.c, net/getsockopt.c, net/bind.c, net/socket.c: Add more + low level, thread-independent socket interfaces for use within the OS. + Some of these are currently used by the FTP controlling terminal. More will + be used to support the NFS file system currenly underwork. + * include/nuttx/net/: Major re-organization of networking headerf files. + Moved all non-standard, NuttX-specific header files from include/net and + include/nuttx into include/nuttx/net. + * arch/mips/src/pic32mx/pic32mx_usbdev.c: The PIC32 USB driver now appears to + be fully functional. + * configs/sure-pic32mx/usbnsh and configs/sure-pic32mx/src: Add support for + NSH using only USB serial I/O to support the console. This is useful on + devices that have USB, but no serial port. + * arch/mips/src/pic32mx/pic32mx_spi.c: Add a PIC32 SPI driver. Initial + checkin is primitive, incomplete (lacks interrupt logic), and untested. + * configs/pic32-startkit/nsh: Completed verification of the PIC32 Ethernet + Starter Kit port. Added and verified the NuttShell (NSH) on the PIC32 + Ethernet Starter Kit. I can now (finally) claim to have complete the + basic port to this board. + * configs/pic32-startkit/nsh/up_usbdev, up_nsh.c, and up_usbterm.c: Verified + the USB (device) driver on the PIC32 Ethernet Starter Kit. + * arch/mips/src/pic32mx/pic32mx_ethernet.c: Verified the PIC32 Ethernet + driver on the PIC32 Starter Kit. Status: It is occasionally functional + but not stable enough for use. + * arch/arm/include/stm32, arch/arm/src/stm32: Add general support for + the STM32 F2 family. Contributed by Gary Teravskis, + * configs/stm3220g-eval: Add support for the STMicro STM3220G-EVAL board. + Contributed by Gary Teravskis, + +6.17 2012-04-14 Gregory Nutt + + * configs/sure-pic32mx: Add support for the Sure DB-DP11212 PIC32 General + Purpose Demo Board + * arch/arm/src/stm32/stm32_usbhost.c/.h: Add files that will (eventually) + hold an STM32 USB host driver (the initial check-in is the NuttX LPC17 + USB host driver with name changes only). + * arch/arm/src/stm32/chip/stm32_otgfs.h: STM32 USB OTG FS register + definitions (not complete on initial check-in). + * net/connect.c: Add another low level, thread-independent socket interface + for use within the OS. + * arch/mips/src/pic32mx/pic32mx_ethernet.c: The PIC32 Ethernet driver + is now stable on the PIC32 Starter Kit. + * configs/pic32-starterkit/nsh2: Add a PIC32 Ethernet Starter Kit NSH + configuration that has no serial console; all interaction is done via + Telnet. + * net/netdev_sem.c: Correct a deadlock condition by making a seamphore + recursive. To my knowledge this deadlock only occurs when running the + NSH command ifconfig over Telnet. In that case the function netdev_foreach + takes the network device semaphore, but so does the telnet logic causing + the deadlock. + * arch/arm/src/stm32/stm32_pm*.c: Add basic STM32 power management logic + that will eventually be used to implement low power states. + * arch/arm/src/stm32/stm32f*0xx_rcc.c: In order to use CAN2, both CAN1 and + CAN2 clocking must be enabled. + * arch/mips/src/pic32mx/picm32mx-usbdev.c: Several stall-related fixes so that + the USB device driver can used the mass storage class (which does a LOT + of stalling as part of its normal protocol). The PIC32 USB Mass Storage + device is, however, still non-functional when debug is OFF. + * include/nuttx/fs: Move all file-system related files from include/nuttx to + include/nuttx/fs. + * include/nuttx/serial: Move all serial-driver related files from include/nuttx to + include/nuttx/serial. + * include/nuttx/clock.h and sched/clock_initialize.c: Add a new OS interface + called clock_sychronize() that can be used to re-synchronize the NuttX + system time with a hardware RTC. This function is called normally at power + up but may also need to be called when recovering from certain low-power + usage states where the system time is no longer accurate. + * arch/arm/src/calypso and arch/arm/include/calypso: Support for the TI "Calypso" + phone processor. Contributed by Denis Carilki and includes the work of Denis, + Alan Carvalho de Assis, and Stefan Richter. + * configs/compal_e88 and configs/compal_e99: Support for Compal e88 and e99 phones + Contributed by Denis Carilki and includes the work of Denis, Alan Carvalho de + Assis, and Stefan Richter. + * arch/arm/src/lpc17xx: Several fixes for error that have crept in for the LPC17xx + DAC. Contributed by by Lzyy. + * graphics/nxconsole: Add a character driver that can be used as a console output + device for text output (still under development on initial check-in). + * graphics/nxmu: Fix several compilation errors that have crept into the multi- + user NX server because of lack of use. + * graphics/nxconsole: The NX text console is basically function (in multi- + user NX mode only). + * arch/arm/src/stm32/stm32_i2c.c: Correct a bug in the STM32 I2C driver. The + behavior of I2C status bits seems to be different between F1 and F4. + * configs/stm3210e-eval/nxconsole: New STM32 F1 configuration that runs the + NuttShell (NSH) within an NX window. + * graphics/nxconsole/nxcon_sem.c: Add protection from re-entrance with debug + is enabled. + * include/nuttx/ascii.h and vt100.h: Header files to centralize ASCII and + VT100 escape sequence definitions. + * graphics/nxconsole/nxcon_vt100.c: Add add framework to support VT100 escape + sequences in NxConsole. + * fs/fs_read.c: Fix read() return value for attempt to read from write-only + file or device. Was returning EBADF, should return EACCES. + * graphics/nxconsole.c: NxConsole now supports backspace and a cursor. + * Kconfig and arch/sim/Kconfig: Beginnings of support for a NuttX + configuration tool. Currently using the kconfig parser 'kconfig-frontend' + available at http://ymorin.is-a-geek.org/projects/kconfig-frontends + (version 3.3.0-1 is also available in the NuttX SVN at + trunk/misc/tools/kconfig-frontends-3.3.0-1.tar.gz). Contributed by Lzyy. + * */Kconfig: Added skeleton Kconfig files to all directories that + may need them. + * include/nuttx/math.h: Moved include/math.h to include/nuttx/math.h + because it conflicts too often with the system math.h (and people aren't + inclined to read the documentation on how to handle this). Now, if + CONFIG_ARCH_MATH_H=y is defined, the top-level makefile will copy + the redirecting math.h header file from include/nuttx/math.h to + include/math.h. So for the architectures that define CONFIG_ARCH_MATH_H=y, + include/math.h will be in place as it was before; for the architectures + that don't select CONFIG_ARCH_MATH_H, the redirecting math.h header + file will stay out-of-the-way in include/nuttx/. + * Kconfig, sched/Kconfig, lib/Kconfig, libxx/Kconfig, arch/sim/Kconfig, + drivers/Kconfig, drivers/mtd/Kconfig, drivers/input/Kconfig + drivers/analog/Kconfig, drivers/lcd/Kconfig: Updated kernel + configuration support provided by Lzyy. + * Kconfig: Many more Kconfig updates (no longer tracking in the ChangeLog) + * arch/arm/src/Makefile, arch/x86/src/Makefile, arch/avr/src/Makefile, + arch/mips/src/Makefile, arch/sim/src/Makefile, arch/hc/src/Makefile, + arch/sh/src/Makefile: The libgcc.a in newer versions of GCC now + have an dependency on an external implementation of abort(). This + required modification to the Makefiles that do the final link: Now + libgcc.a must be included within the group of libraries that are + search recursively. + * arch/arm/srm/stm32/stm32_otgfsdev.c: A USB OTG FS device-side driver + for the STM32 F4 (and maybe F2 and F1 connectivity line). + * tools/cmpconfig.c: A tool for comparing two configuration files. + * include/nuttx/usb/usbdev.h, drivers/usbdev/*, arch/*/src/*/*usb*.c: + Extend the USB device side interface so that EP0 OUT data can be passed + with OUT SETUP requests. + * include/nuttx/watchdog.h: Add the definition of a standard watchdog + driver interface. + * drivers/watchdog.c: The "upper half" watchdog timer driver. + +6.18 2012-05-19 Gregory Nutt + + * Kconfig: Continued Kconfig file updates (no longer tracking on a per-file + basis in the ChangeLog) + * arch/arm/src/stm32/stm32_iwdog.c and stm32_wwdog.c: Add the STM32 IWDG + and WWDIG watchdog timer driver. + * configs/stm3240g-eval/src/up_lcd.c: Add LCD from for the STM3240G-EVAL (the + initial check-in is just a stm3210e-eval driver with renaming). + * sched/sched_setscheduler.c: Correct successful return value (Contributed + by Richard Cochran). + * include/fcntl.h and lib/stdio: Ignore CONFIG_STDIO_LINEBUFFER is the + file was opened in binary mode. + * lib/stdio/lib_fopen.c: Correct an error in parsing open mode string. The + plus sign may not appear right after the basic mode. For example, "r+", "rb+", + and "r+b" are all valid open strings and mean the same thing. + * lib/stdio/lib_fopen.c: Correct return errno value from f_open() and + f_fdopen() if the open mode string is invalid. + * drivers/serial/serial.c: Do not disable Rx interrupts on each byte. + Rather, only disable Rx interrupts when the Rx ring buffer may be empty. + * include/nuttx/usb/audio.h: USB Audio 1.0 definitions (in progress). + * arch/arm/src/stm32/stm32fxx_dma.c: STM32 F4 DMA now supports circular + buffer mode (contributed by Mike Smith) + * arch/arm/src/stm32/stm32_serial.c: The serial driver can now support + Rx DMA into a circular buffer (contributed by Mike Smith) + * configs/pic32mx7mmb: Beginning of a configuration for the Mikroelektronka + PIC32MX7 Multimedia Board (MMB). + * net/recvfrom.c: Fix a compilation problem. Some UDP logic was conditioned + on TCP, not UDP. + * drivers/usbdev/cdcacm.c: Fix an infinite loop that occurs when the serial + device is unregisters. + * arch/arm/src/stm32/stm32_otgfs.c: The driver needs to reset the software (in + order to flush the requests) and to disable the software connection when the + device is unregistered. + * include/sys/prctl.h, sched/prctl.c, include/pthread.h: Add interfaces to + support getting and setting of the thread or task name. + * configs/ubw32: Added a configuration to support the Sparkfun UBW32 PIC32 board. + * configs/ubw32/nsh: Added an NSH configuration for the Sparkfun UBW32 PIC32 board. + * configs/ubw32/up_buttons.c: Added button support for Bit Whacker board. + * configs/stm3240g-eval/nxconsole: Added a configuration to run the NSH + shell in an NX window for the STM3240G-EVAL board. + * include/cxx/cunistd: C++ header file to make sure that everything in + unistd.h is in the std:: namespace. + * configs/sim/nxwm: Added a configuration for testing the NuttX Window Manager + (NxWM) + * fs/fs_fcntl.h: On success, always returned OK. However, some fcntl commands + require returning other values on success. + * Various files. Fix warnings about variables that were initialized by not used. + * configs/sim/*/defconfig: Changes to build a 32-bit simulation on a 32-bit + platform did not make into all of the Make.defs files. + * graphics/nxmu/nx_move.c: Wrong opcode was being used in the server message; + Also there was an error in the offset calculation. + * graphics/nxglib/fb/nxglib_moverectangle.c: Offset argument is really a + position, not an offset. + * graphics/nxtk/nxtk_drawframe.c: Framed windows are now drawn in three + colors (instead of just two). + * drivers/input/stmpe811_*: Added a driver to support the STMicro STMPE811 + IO Expander and touchscreen driver. + * configs/stm3240g-eval/nxwm: Added to configuration for testing the NxWM + window manager on the STM3240G-EVAL board. + * graphics/nxtk/nxtk_toolbarbounds.c: Added an interface to get the toolbar + bounding box. + * graphics/nxtk/nxtk_drawframe.c: Fix an error in drawing the window frame. + * NX, NxConsole: Replace CONFIG_NXCONSOLE_NOGETRUN to CONFIG_LCD_GETRUN. The + inability to read from the LCD is a property of the LCD, not of NxConsole. + Then add CONFIG_NX_WRITEONLY which is the more generic way of saying that + no NX component should try to read from the underlying graphic device (LCD + or other). + * configs/stm3240g-eval/src/up_stmpe811.c: Add board-specific support for the + the STMPE811 I/O expander on the STM3240G-EVAL board. Verfied that the + STM3240G-EVAL touchscreen is now fully functional. + * include/cxx/cfcntl: Added std:: header file. + * graphics/nxbe/nxbe_filltrapezoid.c and graphics/nxglib/fb/nxglib_filltrapezoid.c: + Fix several errors in the trapezoid fill logic. + * include/nuttx/input/touchscreen.h, configs/hymini-stm32, configs/stm3240g-evel, + * configs/sam3u-ek, configs/sim, arch/sim/src/up_touchscreen.c, and + apps/examples/touchscreen: Standardize the board-specific, touchscreen + initialization interfaces. + * drivers/input/stmpe811_base.c and configs/stm3240g-eval: The STMPE811-based + touchscreen seems to work better with edge (vs. level) interrupts + * drivers/input/stmpe811_tsc.c: Fix some status checks so that the touchscreen + interrupt handling logic does not read data if the fifo is not at the + threshold level. + * include/nuttx/wqueue.h: Add macro work_available() to determine if the + previously scheduled work has completed. + * drivers/stmpe811_tsc.c: Correct errors: (1) Since all interrupt logic is done on + the worker thread, disabling interrupts does not provide protected; Need to + disable pre-emption. (2) Fix handling of touch ID and (2) add some logic to + prevent certain kinds of data overrun. + * include/nx/nxtk.h and graphics/nx/nxtk/nxtk.h: Move setting + of configuration defaults from the internal header file to a place where + other logic can use the defaults. + * graphics/nxtk/nxtk_events.c: Fixed an important but in the logic that + translates the mouse/touchscreen position data for framed windows and toolbars. + * drivers/input/stmpe811_tsc.c, tsc2007.c, and ads7843e.c: Need to keep track of + when if positional data is valid. When the touch is released, the X/Y position + of the release must be the same as the X/Y position of the last touch (se that + the release occurs in the same window as the last touch). + * graphics/nxtk/nxtk_events.c: Fix an error in mouse/touchscreen input logic: + Was autoraising the window AFTER processing the mouse press. This raises havoc + if the result of processing the mouse click was to raise some other window! + * graphics/nxtk/nxtk_events.c: I had to disable the whole autoraise feature + for multi-user case because it does not work correctly. In a scenario where (1) there + are multiple queued touchscreen events for the same window and (2) the result of the + first input was to switch windows, then the autoraise implementation will cause the + window to revert to the previous window. Not good behavior. + * sched/sched_mergepending.c: Add task switching instrumentation. There is a case + here where instrumentation was missing. Contributed by Petri Tanskanen. + * CONFIG_STMPE811_THRESHX, CONFIG_STMPE811_THRESHX, and drivers/stmpe811_tsc.c: Add some + thresholding controls to all slow down processing of touchscreen samples. + This is a problem with NX in multi-user mode: touchscreen data gets sent + via a message and when the message queue gets full the sender blocks and + touch events are lost. Basic data overrun. The badly effects touchscreen + human factors. + * include/sched.h: Fix a typo (missing semicolon) in prototype of on_exit(); + * sched/on_exit.c and include/nuttx/sched.h: Fix some old typos that caused + compilation errors when CONFIG_SCHED_ONEXIT is defined. + * configs/stm3240g-eval/nxwm/defconfig: The default NxWM now uses the STMPE811 + touchscreen. + * include/cxx/csched: Added + * graphic/nxmu/nxmu_sendserver.c, nxmu_sendwindow.c, and nxmu_sendclient.c: + Refactor NX messaging logic in preparation for a new message control + feature. + * graphics/nxtk, graphics/nxmu, include/nuttx/nx: Add a new window communication + to support blocking and flushing of client window messages. If there are + stale, queue window messages at the time that a window is destroyed, very bad + things happen. + +6.19 2012-06-15 Gregory Nutt + + * graphics/nxconsole/nxcon_kbdin.c: If selected, the NxConsole will take + input from the NX keyboard input callback. If this option is set, then + the interface nxcon_kdbin() is enabled. That interface may be driven by + window callback functions so that keyboard input *only* goes to the top + window. If CONFIG_NXCONSOLE_NXKBDIN is not selected, then the NxConsole + will receive its input from stdin (/dev/console). This works great but + cannot be shared between different windows. Chaos will ensue if you + try to support multiple NxConsole windows without CONFIG_NXCONSOLE_NXKBDIN + * graphics/nxmu/nx_kbdin.c: Fix pointer argument. This is a error + introduced in changes leading up to the 6.18 release. This error will + cause crashes or perhaps simply not work when you try to handle window + keyboard data in multi-user mode. + * graphics/nxconsole/nxcon_kdbind.c: Fixed unmatched sem_wait and sem_post. + Fix some conditional compilation that included a few too many lines of code. + * drivers/input/stmpe811_tsc.c and stmpe811.h: Add a timeout to catch missed + pen up events. Now the STM3240G-EVAL touchscreen works very smoothly. + * configs/stm3240g-eval/nxwm/defconfig: Enable support for NxConsole keyboard + input. Increasing spacing of icons. + * configs/stm3240g-eval/nxwm/defconfig: Use a larger font for the calculator. + * include/nuttx/lcd/ssd1289.h, drivers/lcd/ssd1289.c and .h: Generic LCD + driver for LCDs based on the Solomon Systech SSD1289 LCD driver. This + of this as a template for an LCD driver that will have to be cusomized + for your particular LCD hardware. + * configs/stm32f4discovery/src/up_extmem.c and up_ssd1289.c: Add support to + STM32F4Discovery for than an external, SSD1289-based LCD. + * configs/stm32f4discovery/nxlines: Add an STM32F4Discovery configuration + to thest the SSD1289-based LCD. + * configs/stm3240g-eval/src: Add USB GPIO initialization logic needed + in board-specific boot logic. + * configs/stm32f4discovery/src: Add USB GPIO initialization logic needed + in board-specific boot logic. + * drivers/usbdev/pl2303.c and cdcacm.c: Fix the request size used for sending + packets. It was not using the maximum request size, but instead the previous + request size. As a result, packets get smaller, and smaller, and ... This + is an important USB serial fix. + * arch/arc/src/stm32_otgfsdev.c: Bug fix: Don't process TXFE if we have + already processed an XFRC interrupt. We have already done what needs + to done in that case. + * arch/arc/src/stm32_otgfsdev.c: Fixed some status settings in queuing of write + messages. Added a "hack" to work around missing TxFIFO empty interrupts. The + hack is basically to poll for space in the TxFIFO instead of of setting up + the interrupt. + * arch/arm/src/stm32/stm32f2* and chip/stm32f2*: Update all STM32 F2 file so + that they are equivalent to F4 files. This is kind of a maintenance nightmare. + * configs/stm3220g-eval/: Update existing configurations to the same level + as the corresponding STM3240G-EVAL configurations. This adds FSMC SRAM, + touchscreen, and LCD support. + * configs/stm3220g-eval/: Add a NxWM configuration for the STM3220G-EVAL. + * stmpe11*: Fix a massive naming problem. All references to STMPE11 should be + STMPE812. + * arch/arm/src/stm32/stm32_otgfsdev.c: Need to enabled USB reset interrupt + (contributed by Erik Van Der Zalm). + * sched/sleep.c: Fix the return value from sleep(). The correct behavior is + to return the number of unwaited seconds; the implementation was always + returning zero. + * sched/usleep.c and include/unistd.h: Was a void function, but should return + 0 on success. usleep() needs to check the return value from sigtimedwait(). + sigtimewait() returns the signal number that awakened it and an error (EAGAIN) + if the timeout expired (normal case). + * sched/sig_timedwait.c: Fix sigtimedwait() return value. On a timeout, it was + setting the 8-bit si_signo field to -1 and eded up reported successfully awakened + by signal 255! Now detects the timeout and errors -1 with errno == EGAIN. If + sigtimedwait() is awakened by an unblocked signal, but it is not one of the + signals in the waited-for set, it will return -1 with errno == EINTR. + * arch/arm/src/stm32_i2c.c: Fix STM32 F2 I2C. It is apparently bug-for-bug + compatible with the F4 and needs the same work-around for the missing BTF + signal that was needed for the F4. + * drivers/lcd/ssd1289.*: Fix some of the initial register settings. + * configs/stm32f4discovery/src/up_ssd1289.c: FSMC address bit 16 is used to + distinguish command and data. But FSMC address bits 0-24 correspond to ARM + address bits 1-25, se we need to set bit 17 in order generate output on + FSMC_A16. + * arch/arm/src/lm3s/lm3s_epi.h and lm3s_timer.h: LM3S header files + (contributed by Max Neklyudov). + * arch/arm/src/stm32/stm32_irq.c: Some of the interrupt priorities were + not be initialized (F2 and F4 only). Thus, the very high numbered + interrupts (like UART6) and cause nested interrupts. This leads to + some very difficult to debug crashes. Fix contributed by Mike Smith. + * arch/mips/src/pic32/pic32_head.S and pic32_config.h and + configs/pic32mx7mmb/include/board.h: Extended PIC32 device configuration + capabilities and change board.h to support unique clocking requirements + of the Mikroelektronika PIC32MX7 MMB. That board now works! + * configs/pic32mx7mmb/nsh: Added and verify a NuttShell configuration + for the Mikroelektronika PIC32MX7 MMB board. + * arch/mips/pic32/pic32mx-ethernet.c: Fix logic that guesses PHY address; + the search loop missed the PHY address needed by the Mikroelektronika + PIC32MX7 MMB board. + * configs/pic32mx7mmb/nsh: Configuration now supports a network by default. + * configs/pic32mx7mmb/src: Add support for the MMC/SD slot on board + the Mikroelektronika PIC32MX7 MMB board (not working on initial check-in). + * arch/mips/src/pic32/pic32mx-spi.c: Add support for very low-level, + register access debug output. + * configs//pic32mx7mmb/include/board.h: Reduced peripheral clock to + 4MHz to match other PIC32 configurations. + * configs/pic32mx7mmb/src/up_nsh.c: SD card needs to operate in SPI + mode 2. + * configs/pic32mx7mmb/nsh/defconfig: MMC/SD card support is now + enabled by default in the PIC32MX7 MMB board configuration. + * configs/pic32mx7mmb/nsh/defconfig: Verified the USB Mass Storage + Class (MSC) using MMC/SD card as the logical unit. Updated the default + PIC32MX7 MMB board configuration so that USB and the mass storage class + are enabled by default. + * drivers/lcd/mio283qt2.c and include/nuttx/lcd/mio283qt2.h: Add generic + support for the MIO283QT2 LCD. + * configs/pic32mx7mmb/src/up_mio283qt2.c: Add support for the MIO283QT2 + LCD on the PIC32MX7 MMB board. + * configs/pic32mx7mmb/src/up_touchscreen.c: Add an ADC-based touchscreen + driver for the PIC32MX7 MMB board. Kind of works, but needs more + verification and tuning. + * arch/mips/src/common/up_idle.c: Strange but important fix. For some still- + unknown reason, interrupts are left in an unhealthy state in the IDLE + when the work queue is enabled. This is partially because some interrupt + related logic is not built in that case. Simply disabling then re- + enabling interrupts restores the proper state. + * graphics/nxglib/lcd/nxglib_filltrapezoid.c and fb/nxglib_filltrapezoid.c: + Fix an error when the trapezoid is only 1 line high. In this case, a + divide by zero error would occur. The fix is to draw the 1 line high + trapezoid as a run. + * drivers/usbdev/pl2303.c: Fix a cut'n'paste error that snuck into + the PL2303 emulation driver several months back. + +6.20 2012-07-12 Gregory Nutt + + * configs/stm3210e-eval/src and arch/arm/src/stm32/: Add beginnings of + power management support for the STM32 and the STM3210E-EVAL board, in + particular. + * Documentation/NfsHowTo.html: Add a How-To document for the new NFS + client feature. + * arch/mips/include/pic32mx and arch/mips/src/pic32mx: Add support for the + PIC32MX1 and PIC32MX2 families. + * configs/mirtoo: Add a board configuration to support the DTX1-4000L + "Mirtoo" module from http://www.dimitech.com/ + * tools/pic32mx: All of the duplicate directories containing the same + same PIC32 tools were move to this single location. + * configs/mirtoo: The basic Mirtoo port is now functional. + * configs/mirtoo/ostest: Added support for the microchipOpen toolchain + (see http://sourceforge.net/projects/microchipopen/). + * configs/mirtoo/nsh: Added a NuttShell (NSH) configuration for + the Mirtoo module. + * configs/mirtoo/scripts: Move all Mirtoo linker scripts to a common + directory. + * arch/mips/src/pic32mx/pic32mx-gpio.c: All digital inputs were being + configured as outputs. This is a *critical* bug fix and needs to be + incorporated by any PIC32 users. + * drivers/mtd/sst25.c: Added a driver for the SST 25 SPI-based FLASH + parts. + * configs/mirtoo/src/up_nsh.c: The Mirtoo NSH configuration can now + mount the SST 25 devices so that it can be used for a FAT file system. + There are are, however, some NSH memory usage issues if this configuration + enabled now. Some tuning is still needed. + * configs/mirtoo/nxffs: Add an alternative NSH configure for the Mirtoo + module for testing the on-module SST 25 chip using the NXFFS file system. + * arch/arm/src/lpc43xx and arch/arm/include/lpc43xx: The NXP LPC43xx port + is slowly evolving in these directories. + * configs/stm3210e-eval/pm: Add a new configuration for testing STM32 power + management. + * configs/stm3210e-eval/scripts: Moved all of the duplicate ST3210-EVAL + linker scripts into one set of linker scripts at this location. + * configs/stm3210e-eval/src/up_buttons.c, up_lcd.c, and up_pm.c: New logic + for testing STM32 power management. + * configs/lincoln60: Add a configuration to support the Micromint Lincoln60 + board. + * configs/ekk-lm3s3b96: Add a configuration to support the TI/Stellaris + EKK-LM3S3B96 development board. Contributed by Jose Pablo Rojas V. + * arch/arm/src/lpc43xx/chip: Created header files for *all* (really) + lpc43xx registers and all bit-fields. + * configs/lpc4330-xplorer: Added a configuration for the NXP LPC43XX + Xplorer board. This is just to facilitate testing of the LPC43xx + port but will, with any luck, become proper board support for that + board. + * arch/arm/src/lm3s/lm3s_syscontrol.c: Fix an optimization related problem + by adding a volatile qualifier to a timing loop. Oddly, the consequence + of the bug is that when debug was off, the LM3S platform too a long time + to boot. It now boots rapidly whether debug is on or off. + * arch/*/include/limits.h: Change all values in all limits.h for all + architectures to signed decimal; the hex values were not sign extending + appropriate in most uses (reported by Lorenz Meier). + * arch/arm/src/stm32/chip/stm32f103/7vc_pinmap: Fix typographical error in + two pinmap definition files. + * lib/net/lib_inetntoa.c: Fix typographical error that cause compilation + failure on platforms that do not support passing of structures as + parameters. + * arch/arm/*/lpc43xx and configs/lpc4330-xplorer and code complete and + ready for testing. Hopefully, verified LPC43xx support will appear + in NuttX-6.20. + * include/nuttx/stdarg.h: If CONFIG_ARCH_STDARG_H=y is defined, the top-level + makefile will copy the generic (GCC-only) stdarg.h header file from + include/nuttx/stdarg.h to include/stdarg.h. So for the architectures + that cannot use their GCC toolchain's stdarg.h file, they can use this + alternative by defining CONFIG_ARCH_STDARG_H=y. If CONFIG_ARCH_STDARG_H, + is not defined, then the redirecting stdarg.h header file will stay + out-of-the-way in include/nuttx/. + * configs/lpc4330-xplorer/nsh: Add an NSH configuration for the LPC4330 + Xplorer board. + +6.21 2012-08-25 Gregory Nutt + + * configs/lpc4330-xplorer/up_nsh.c: Add support for a basic SPIFI block + driver for use by NSH. Does not work! Crashes on first SPIFI write. + * configs/lpc4330-xplorer/*/defconfig: Calibrate delay loops (this is + based on the current "slow" 72MHz M4 clock and will need to be + re-calibrated when this is increased). + * configs/stm3220g-eval/include/board.h and configs/stm3240g-eval/include/board.h: + The SDIOCLK frequency in the F2 and F4 derives for PLL48CLK and not HCLK + so that the SDIOCLK input frequency should always be 48MHz. + * sched/os_internal.h, sched_setupidlefiles.c, sched_setuptaskfiles.c, and + sched_setupidlefiles.c: Detangle some conditional compilation. Allow for + a perverse configuration that has socket descriptors and streams but no file + descriptors (sure, why not?). + * sched/: Stylistic clean-up of all files. Some of these files are pretty old + and do not follow current NuttX coding standards in detail. + * fs/: More stylistic file clean-up. + * mm/: More stylistic file clean-up. + * drivers/ and drivers/serial/: More stylistic file clean-up. + * arch/arm/src/lpc43xx/lpc43_clockconfig.c: Fix PLL1 bit manipulation logic. + Critical bugfix! This would often cause the LPC43xx to fail to boot. + * arch/arm/src/lpc43xx/lpc43_rgu.c: The soft reset logic called from the + beginning of __start seems cause problems. A magic delay seems to improve + the logic some. But I suspect that real fix is to get rid of all of the + soft reset logic. This would also be a critical bugfix if I believed + that it really fixed all of the issues. + * arch/arm/src/lpc43xx/chip/lpc43_cgu.h: Fix a bit mask in the PLL1 + control register. Critical bugfix. + * arch/arm/src/lpc43xx/lpc43_clockconfig.c and configs/lpc4330-xplorer/include/board.h: + Implement PLL1 ramp-up logic; Now the LPC43xx is running at 204MHz. + * configs/lpc4330-xplorer/*/defconfig: Re-calibrated delay loops using + the 204MHz clock. The LPC43xx ripping rips! This calibration was performed + with symbols enabled and all optimization disabled. It will need to be + better recalibrated again down the road. + * arch/arm/src/stm32/stm32_exti.c: Renamed to rch/arm/src/stm32/stm32_exti_gpio.c + to make a little room in the file name space. + * arch/arm/src/stm32/stm32_exti_alarm.c: Add initial logic to attached the + RTC alarm EXTI interrupt. This is work be performed mostly by Diego Sanchez. + * include/: More stylistic file clean-up. + * arch/arm/src/lpc43xx/lpc43_spifi.c, lpc43_spifi.h, and chip/lpc43_spifi.h: Add + logic to configure and initialize the SPIFI device (does not yet work). + * configs/lpc4330-xplorer/include/board.h: Reduce SPI SCLK value. + * arch/arm/src/lpc43xx/lpc43_spifi.c, lpc43_spifi.h, and chip/lpc43_spifi.h: + Logic completely redesigned. It now creates an MTD driver to access SPIFI... + but the driver still does not work. + * arch/arm/src/stm32 and arch/arm/include/stm32: Make name of RTC ALARM interrupt + common on STM32 F1,2,4 + * arch/arm/src/stm32 and arch/arm/include/stm32: Add support for the + STM32F100x "Value Line" devices. This includes changes to stm32F10xx_rcc.c that + add the ability to run the chip off the internal oscillator. There is no open + board configuration for this part yet (the STM32VLDiscovery would be a candidate). + Contributed by Mike Smith. + * arch/arm/src/stm32: Fixed typos in conditional compilation in the CAN and DMA + and some pin configuration. This would have caused problems for STM32 F107xx. + Typos noted by Mike Smith. + * arch/arm/src/lpc43xx/lpc43_serial.c: Add support for certain RS-485 features + * lib/termios/lib_cfsetispeed.c, lib_cfsetospeed.c, lib_tcflush.c: Add + simple implementations of cfsetispeed(), cfsetospeed(), and tcflush(). + * include/sys/str_tty.h, lib/lib_setspeed.c, lib_getspeed.c, and lib_resetspeed.c: + Add APIs to support setting non-standard BAUD values not supported by POSIX + termios. These are non-standard interfaces but have a precedence: There are + similar interfaces in AIX. + * include/sys/str_tty.h, lib/lib_setspeed.c, lib_getspeed.c, and lib_resetspeed.c: + Sigh... removed. We don't need any more almost standard interfaces! (SVN + revision 4968 if you want the short-lived code). + * include/termios.h and lib/termios/*: Open the existing, standard termios + interfaces to permit some non-standard baud settings. The new termios definitions + still supports the POSIX standard except that it does not strictly enforce + baud rate settings, permitting some non-portable, but useful baud rate settings + (this is what the short-lived AIX-like interfaces would have accomplished as well). + * include/termios.h and lib/termios/*: Redesigned yet again (this is getting + painful. NuttX now supports the BOTHER baud setting just as Linux does. termios + Bxxx definitions are again encoded; cf[set|get][o|i]speed now deal with only the + encoded values. If the encoded baud is set to BOTHER, then the values in the (non- + standard) c_ispeed and c_ospeed baud values may be accessed directly. + * arch/arm/src/stm32/stm32_serial.c: Add minimal termios support for the STM32 + (BOTHER style baud settings only). Contributed by Mike Smith. + * configs/lpc4343-xplorer/src: Clean up SPIFI-library based build to that it + actually works. + * arch/arm/src/lpc43xx/lpc43_spifi.c: Add support for verification to writes. + Add debug option to dump buffers. Several bugfixes... almost works. + * include/termios.h, lib/termios/*, and arch/arm/src/stm32/stm32_serial.c: : + BOTHER is gone again. + * arch/arm/src/stm32/stm32_sdio.c and chip/stm32f20xx_pinmap.h: STM32 F2 SDIO + fixes from Gary Teravskis and Scott Rondestvedt. + * include/termios.h and lib/termios/*: Replace cfsetispeed and cfsetospeed with + cfsetspeed (with definitions for the input/outputs in termios.h). + * configs/stm32f4discovery/src and configs/stm32f4discovery/pm: Add a power + management configuration for the STM32F4Discovery and supporting logic. This + check-in also includes some fixes for the F4 RTC alarm logic. + * drivers/input/pga11x.c and include/nuttx/input/pga11x.h: Add support for the + TI PGA112/3/6/7 amplifier/multiplexer parts. + * configs/mirtoo/README.txt, nsh/defconfig, and nxffs/defconfig: Add support + for the PGA117 on the Mirtoo module. + * drivers/analog/pga11x.c and include/nuttx/analog/pga11x.h: These belong in + the analog subdirectories, not input. + * configs/compal_e99/src/ssd1783.c and /ssd1783.h: Drivers for the SSD1783 + LCD found in the Motorola C155 telephone. The driver is specific to the C155 + because it uses the uwire transport. Contributed by Denis Carilki and + Alan Carvalho de Assis. + * drivers/power/pm_changestate.c. Correct a case where interrupts were not + being re-enabled. Found by Diego Sanchez. + * configs/mirtoo/nxffs/defconfig: This Mirtoo NXFFS configuration now uses the + open Pinguino toolchain by default. This is necessary because the free C32 + toolchain does not support any optimization and the unoptimized NXFFS image + hits the PIC32MX2 FLASH size (128K). There is plenty of room to grow using + the Pinguino toolchain with -O2 optimization. + * configs/mirtoo/src/up_adc.c. This is just a stub for now, but this is + where Mirtoo ADC logic will eventually need to go. + * arch/mips/src/pic32mx/pic32mx-gpio.c: Now supports the PIC32MX1/2 ANSEL + IOPORT register. + * lib/string/lib_memchr.c: Add support for memchr() (contributed by Mike Smith) + * lib/string/lib_memccpy.c: Add support for memccpy() + * arch/arm/src/lpc17xx/lpc17_serial.c: Now supports ioctl commands to change + the baud using tcsetattr() (contributed by Chris Taglia). + * arch/*/src/*_serial.c: Fix ioctl method return values. These methods + should return a negated errno value; they should not set the errno + variable. + * sched/on_exit.c, sched/task_exithook.c, and include/nuttx/sched.c: Add + support for multiple registered on_exit() functions if CONFIG_SCHED_ONEXIT_MAX + is defined. + * drivers/syslog/ramlog.c: Move the RAM SYSLOG device into drivers/syslog + so that it will be in the same directory as some new SYSLOGing devices + in the works. + * include/nuttx/syslog.h and drivers/syslog/ramlog.c: The SYSLOG putc function + now has a common name that is independent of the device that provides the + SYSLOG. + * include/nuttx/syslog.h and drivers/syslog/syslog.c: This is a new, generic + SYSLOG device that can redirect debug output to any character device or file. + So you can log debug output to a file or you can put the console on /dev/ttyS0 + and the debug output on /dev/ttyS1. + * arch/arm/src/lpc43xxl/lpc43_spifi.c: Correct an addressing error in the LPC43 + SPIFI MTD driver + * drivers/syslog/syslog.c and fs/fs_syslog.c: Moved the generic syslog logic + from drivers/syslog to fs/ where is belongs. Especially after realizing that + the syslog logic is going to have to some internal FS operations in order + to realize a totally thread-independent SYSLOG interface. + * arch/arm/src/stm32/stm32*_rcc.c and .h: If CONFIG_PM is defined, add a + function called stm32_clockenable() that can be used by PM logic to re-start + the PLL after re-awakening from deep sleep modes. + * fs/fs_foreachinode.c and fs/fs_foreachmountpoint.c: Add logic to traverse + inodes and mountpoints in the NuttX pseudo-file system. + * fs/fat/fs_fat32.c: Max. filename length reported by statfs() was wrong + if FAT long file names were enabled. + * lib/stdio/lib_libvsprintf.c: Fieldwidth and justification were not + supported for the %s format. As a result, %s, %12s, and %-12s all + produced the same output. + * lib/stdio/lib_libdtoa.c: Fix several issues with presenting floating + point numbers (conversions are fine, but presentation was bad). This + is a critical bug fix if you use printf or sprintf to deal with floating + point numbers. + * lib/stdio/lib_libdtoa.c and lib_libvsprintf.c: Correct some floating + point options. + * arch/arm/lpc43xx/lpc43_usb0dev.c: Add framework for development of + an USB0, device-side driver for the LPC43XX. The initial check-in, + however, is simply for the LPC31xx driver with name changes. The + LPC31xx has the same USB IP, but will require some additional initialization + (and lots of testing) before it can be used with the LPC43xx. + * nuttx/Documentation/NuttShell.html: Added a section covering ways to + customize the behavior of NSH. + * arch/arm/src/stm32/chip/stm32f1*_pinmap.h: STM32 CAN TX/RX pins reversed; + inconsistent conditional compilation. Reported by Max Holtzberg. + * arch/arm/*/stm32: Add support for STM32 F107 "Connectivity Line" + Ethernet (contributed by Max Holtzberg). + * configs/olimex-stm32-p107: Add board support for the Olimiex STM32-P107 + board (contributed by Max Holtzberg). + * arch/arm/src/stm32/stm32f2xx_dma.c, stm32f4xx_dma.c, stm32_serial.c, and + stm32_spic.c: DMA priority was getting zeroed by STM32 F2/F4 DMA drivers + so that all DMAs ran at the lowest priority. + * configs/stm3240g-eval/include/board.h and configs/stm3220: Drop SD card + frequency from 24 to 16 MHz. Apparently 24 MHz is too fast for the board. + This (plus the change to the STM32 DMA (above) fixes SDIO DMA on the + STM3240G-EVAL (and probably STM3220G-EVAL -- untested). + * arch/arm/src/stm32/stm32f2xx_dma.c and stm32f4xx_dma.c: Backed out the + DMA priority change just above. The reduced SD card frequency was + necessary and sufficient to resolve the problem. + * drivers/serial/serial.c: open, read, write, and poll methods may now + abort return EINTR (or a short transfer size) if a signal is received + while waiting to receive or send serial data. This behavior is required + by POSIX. + * include/sys/types.h: Define NULL to be (0) if __cplusplus is defined. + (contributed by Mike Smith) + * include/ctype.h: Remove a stray semi-colon in a definitions (Thanks + Mike Smith). + * configs/.../Make.defs. Fix C++ include path set-up in Make.defs file + for all 8-bit AVR platforms (Thanks Richard Cochran). + * lib/stdio/lib_*stream.c: Revised to handle new error return values from + serial.c. + * arch/arm/src/stm32/stm32_spi.c: SPI driver can now service re- + initialization (Mike Smith). + * tools/mkconfig.c: If CONFIG_DRAM_END is not specified, this tool + will provide default definition of (CONFIG_DRAM_START + CONFIG_DRAM_SIZE) + * arch/arm/src/stm32/stm32_otgfshost.c: Renamed from stm32_usbhost.c. + This is nearly code complete and, with any luck, will be available + in NuttX-6.21. + * configs/*/defconfig: Update all defconfig files to remove syntax + that is incompatible with the mconf configuration tool. + * arch/arm/src/stm32/stm32_otgfshost.c: This driver now appears to be + functional (although more testing is necessary). + +6.22 2012-09-29 Gregory Nutt + + * include/semaphore.h, sched/sem_holders.c, and lib/semaphore/sem_init.c: + Fix some strange (and probably wrong) list handling when + CONFIG_PRIORITY_INHERITANCE and CONFIG_SEM_PREALLOCHOLDERS are defined. + This list handling was probably causing errors reported by Mike Smith + * sched/sched_waitpid.c: Fix a possible issue with logic logic that + should be brought into a critical section (suggested by Mike Smith) + * sched/sched_setuptaskfiles.c: Should be 'struct socket' not + 'struct sockets'. How did this compile before? (found by Kate) + * syscall/syscall.csv: Fix prototype for usleep() and prctl() (also + from Kate). + * arch/arm/src/lpc17xx/lpc17_ethernet.c: Conditionally elide setting PHY + speed/duplex. This does not work for certain PHYs. Still some unresolved + issues (also from Kate). + * tools/Config.mk, Makefile, configs/*/Make.defs: Add a new Makefile + fragment to de-quote certain strings from the Kconfig logic that + need to be used at path segments (Richard Cochran). + * arch/arm/src/stm32/stm32_usbotghost.c: The STM32 USB host driver only + works with debug turned on. The problem appears to be that with debug + OFF, there are more NAKs occuring in more places than before and this + reveals a variety of errors. This check in improves NAK robustness + for control transfers but does not resolve all of the issues. + * configs/stm3220g-eval/*/defconfig: Calibrated delay loop. It had + never been calibrated was way off. + * sched/sem_holder.c: Add logic to handler some priority inheritance + cases when sem_post() is called from an interrupt handler. The + logic is clearly wrong, but it is not known if this is the + cause of any known bugs. + * lib/stdio/lib_perror(): Add perror(). Contributed by Kate. + * lib/string/lib_strerror(): Add option CONFIG_LIBC_STRERROR that + is now required to enabled strerror(). Add an option + CONFIG_LIBC_STRERROR_SHORT that can be used to output shortened + strings by strerror(). + * arch/arm/src/stm32/stm32_usbotghost.c: Finally... the USB OTG FS + appears to handle NAKing correctly. + * configs/stm32f4discovery/*: Added and verifed support for USB OTG FS + host on the STM32F4Discovery board. + * configs/*/defconfig: Remove configuration documentation from config + files. It is redundant, error-prone, and difficult to maintain. + Configuration documentation is available in configs/README.txt for + common configurations and in configs/*/README.txt for board and MCU- + specific configurations. + * configs/stm3240g-eval: Add USB host support. + * sched/os_bring.c, configs/*/defconfig, tools/mkconfig.c, and others: Added + configuration variable CONFIG_USER_ENTRYPOINT that may be used to change + the default entry from user_start to some other symbol. Contributed by + Kate. NOTE: This change does introduce a minor backward incompatibility. + For example, if your application uses NSH as its start-up program, then your + build will now fail because it will be unable to find "user_start". The fix + for this link failure is to add the following to your configuration file: + CONFIG_USER_ENTRYPOINT="nsh_main". + * libs/stdio/lib_libfread.c and lib_*flush*.c: Correct a couple of + error cases where the lib semaphore was not be released on error + exits (thanks Ronen Vainish). Also, improved some error reporting: + the generic ERROR was being used instead of the specific errno + value; the errno variable was not always set correctly. + * tools/mkfsdata.pl: The uIP web server CGI image making perl script was + moved from apps/netutils/webserver/makefsdata to nuttx/tools/mkfsdata.pl + (Part of a larger change submitted by Max Holtzberg). + * configs/stm3240g-eval/script/ld.script: All of the identical ld.script + files for the STM3240G-EVAL were replaced by one version in this directory. + * configs/stm3240g-eval/webserver: Configuration submitted by Max Holtzberg + for testing the changes to the uIP web server (see apps/ChangeLog.txt). + * lib/stdio/lib_perror.c: Remove CONFIG_LIBC_PERROR_DEVNAME. What was I + thinking? Arbitrary streams cannot be shared by different tasks. + * tools/mksyscall.c, csvparser.c, and csvparser.h: Separate CSV parsing + logic from mksyscall.c into files where it can be shared. + * tools/mksymtab.c: Add a tool that can be used to convert a CSV file + into a NuttX-style symbol table. + * sched/work_cancel.c: Fix a bad assertion (reported by Mike Smith) + * configs/stm3210e-eval/src/up_idle.c: Correct some power management + compilation errors (reported by Diego Sanchez). + * include/nuttx/wqueue.h, sched/work*, and others: Added logic to support + a second, lower priority work queue (CONFIG_SCHED_LPWORK). + * arch/arm/src/stm32/stm32_dma.c, chip/stm32*_memorymap.h: FSMC SRAM is + only 16-bits wide and the SDIO DMA must be set up differently. + * arch/arm/src/stm32/stm32_dma.c: Back out the 16-bit DMA change. It + is incorrect. + * configs/: Make use of UART4/5 vs USART4/5 consistent in all places. + * Kconfig: Serial 2STOP setting must be integer 0/1, not a boolean. + * lib/misc/sendfile.c and include/sys/sendfile.h: Add a Linux style + sendfile() (non-standard!) + * Kconfig: Refactor serial settings (moved from chip to drivers/serial). + AVR "teensy" now builds with Kconfig (contributed by Richard Cochran). + * Kconfig: Add configuration settings for the LPC17xx + * Kconfig: Add configuration settings for the LM3S (from Richard Cochran). + * Kconfig: Verify configuration settings for the STM32. This includes + changes in the way that the external SRAM is configured: Define + CONFIG_HEAP2_SIZE (decimal) instead of CONFIG_HEAP2_END (hex). + * tools/configure.sh: Don't append the apps directory path setting + if the correct setting is already in defined in the defconfig file. + * fs/fat/fs_utils.c: Improperly constructed bool expression. This + would cause many unnecessary writes to FLASH (Thanks Ronen Vainish). + * Kconfig: Verify configuration settings for the LPC43xx. This includes + some corrections to configuration variable names and defconfig settings. + * Kconfig: Add and verify configuration settings for the LPC31xx. + * arch/arm/src/stm32/stm32_uart.h and stm32_serial.c: Add logic to + re-initialize the console UART as needed to enable DMA on the + console UART (contributed by Mike Smith). + * net/recvfrom.c, net/Kconfig, include/nuttx/net/uipopt.h: Remove delay + after receiving data. That has historical reasons to be there (it + was needed before read-ahead buffering was added), but kills performance. + (Noted by Max Holtzberg). + * configs/shenzhou: Add beginnings of a board configuration for the + Shenzhou STM32107 board (see www.armjishu.com). Very little is in + place as of this initial check-in. + * QEMU: Fixes from Richard Cochran to build QEMU with Kconfig files. + * arch/*/src/Makefile: Remove some old logic that was kicked off + when CONFIG_BOOT_RUNFROMFLASH=y. The old logic used to use + objcopy to move sections. Newer logic changes the load position + of sections in the linker script. As far as I can tell, there + is nothing in the source tree now that depends on the old way of + doing things (if I am wrong, they will need a change to the linker + script). + * configs/fire-stm32v2: Configuration for the M3 Wildfire board. I + don't know very much about this board other than is has an + STM32F103VET6 chip, LCD, touchscreen, and ENC28J60 network. Very + little is in place on the initial check-in. + * configs/shenzhou: Coding for the Shenzhou board port is complete, + but tested has been deferred until I get the right tools. + * arch/arc/include/stm32/chip.h and arch/arm/src/stm32/chip.h: + Add support for the STM32F103VET6. + * fs/fs_fdopen.c: Bad check for failure to allocate memory. (Noted + by Ronen Vainish). + * drivers/mmcsd/mmcsd_sdio.c: If the MMC/SD driver were ever + uninitialized then there would be a double release of memory + (Noted by Ronen Vainish). + * fs/mmap/fs_rammap.c: Fix logic error and errno check (contributed + by Kate). + * arch/avr/src: Fixes from AVR32 build errors that have crept in + over the time; incorporated Kconfig for AVR3 (Richard Cochran). + * fs/fat and include/nuttx/fs/fat.h: The FAT file system allocates + memory for sector I/O buffers used to exchange data with the + configured block driver. In some contexts, the block driver may + require DMA-capable memory. If CONFIG_FAT_DMAMEMORY is defined, + then the FAT FS will use platform-provided DMA memory allocators + to allocate the block driver I/O buffers. + * CONFIG_NET_ENC28J60 renamed CONFIG_ENC28J60 to be consistent + in all places. + * drivers/enc28j60.c, include/nuttx/net/enc28j60.h, and + olimex-strp711/src/up_enc28j60.c: No longer passes IRQ number + as a parameter. Instead now passes a call table to manage + ENC28J60 GPIO interrupts. That is because GPIO interrupts are + handled in different ways by different MCUs and some do not + support IRQ numbers for GPIO interrupts. + * mm/mm_gran* and include/nuttx/gran.h: Add a simple granule- + based allocator. The intent of this allocator is to support + simple allocation of DMA I/O buffers. The initial check-in + is code complete but untested (not event built into the + mm/Makefile yet. + * configs/fire-stm32v2: The board port is basically functional. + Not all features have been verified. The ENC28J60 network + is not yet functional. + * configs/stm3240g-eval/discover: A configuration for testing + the UDP discovery utility. Contributed by Max Holtzberg. + * mm/README.txt: Add a new README file. + * include/nuttx/usb/usb.h, arch/*/src/*usb.c, and arch/*/src/*otg*.c: + Add hooks to use common, external DMA buffer allocation + implementation. + * net/recvfrom.c: Don't block in recvfrom if (1) read-ahead buffering + is enabled and (2) some data was obtained from read-ahead buffers. + Blocking is a bad idea in that case because there is no timeout! + (submitted by Max Holtzberg). + * configs/stm3240g-eval/xmlrpc: An example configuration for the + Embeddable Lightweight XML-RPC Server at apps/examples/xmlrpc. + See http://www.drdobbs.com/web-development/ + an-embeddable-lightweight-xml-rpc-server/184405364 for more info. + Contributed by Max Holtzberg. + * configs/*/nxwm/defconfig and sched/task_exithook.c: Fixes for + bugs that crept in during recent changes. (Submitted by Max + Holtzberg). + * arch/arm/include/armv7-m/irq.h: Fix a critical bug in irqsave(). + It looks like sometimes the compile will re-order some instructions + inapproapriately. This end result is that interrupts will get + stuck off. + * drivers/mtd/w25.c: Beginning of a driver for the Windbond SPI + FLASH family (W25x16, W25x32, and W25x64). The initial check-in + is basically just the SST25 driver with some name changes. + * arch/arm/include/armv7-m/irq.h and arch/arm/src/stm32/stm32_spi.c: + Back out the last change in irq.h. It is (most likely) fine the + way it was. The really interrupt related problem was in stm32_spi.c: + When SPI3 is not enabled, then the irqrestore() falls in the + else clause. + * include/nuttx/compiler.h and other files: Moved always_inline + and noinline __attributes__ here. Also replaced all occurrences + of explicit __atributes__ in other files with definitions from + this header file. + * drivers/mtd/w25.c: The Windbond SPI FLASH W25 FLASH driver is + code complete (but still untested). + * arch/arm/src/stm32/stm32_i2c.c: I2C improvements from Mike Smith. + Unified configuration logic; dynamic timeout calculations; + I2C reset logic to recover from locked devices on the bus. + * configs/*/*/Make.defs, tools/Config.mk, Makefile: Refactor all + common make definitions from the various Make.defs files into + the common tools/Config.mk. Add support for a verbosity options: + Specify V=1 on the make command line in order to see the exact + commands used in the build (Contributed by Richard Cochran). + * drivers/net/enc28j60.c: The ENC28J60 Ethernet driver is + now functional. + * configs/fire-stm32v2: Add support or the fire-stm32v3 board as + well (untested because I do not have a v3 board). + * lib/stdio/lib_sscanf.c: Add %n pseudo-format (from Kate). + * lib/stdio/lib_sscanf.c: There is an issue of handling input + when (1) no fieldwidth is provided and (2) there is no space + seperating the input values. No solutions is in place for this + case now (either space or a fieldwidth must be provided). But + at least some of the bad logic that attempted to handle this + case has been removed (noted by Kate). + * arch/arm/src/stm32/stm32_eth.c: DMA buffer sizes must be an + even multiple of 4, 8, or 16 bytes. + * arch/arm/src/stm32/stm32_idle.c: Fixes STM32F107 DMA issues: + We cannot go into sleep mode while Ethernet is actively DMAing. + * configs/shenzhou/src/up_ssd1289.c: Add infrastructure to support + SSD1289 LCD. Initial checkin is just a clone of the + STM32F4Discovery's FSMC-based LCD interface. The Shenzhou + will need a completely need bit-banging interface; this + initial check-in is only for the framework. + * configs/shenzhou/src/up_ssd1289.c: Bit-banging driver is + code complete. + * configs/shenzhou/src/up_lcd.c: Oops. Shenzhou LCD does not + have an SSD1289 controller. Its an ILI93xx. Ported the + STM3240G-EVAL ILI93xx driver to work on the Shenzhou board. + * configs/shenzhou/nxwm: Added an NxWM configuration for the + Shenzhou board. This is untested on initial check-in. It will + be used to verify the Shenzhou LCD driver (and eventually the + touchscreen driver). + * configs/shenzhou/src/up_touchscreen.c: Add ADS7843E touchscreen + support for the Shenzhou board. The initial check-in is untested + and basically a clone of the touchscreen support for the SAM-3U. + * tools/cfgparser.c: There are some NxWidget configuration + settings that must be de-quoted. + * arch/arm/src/stm32/Kconfig: There is no SPI4. Some platforms + support SPI3 and some do not (still not clear). + * nuttx/configs/shenzhou: Various fixes to build new NxWM + configuration. + * configs/shenzhou: Oops. The Shenzhou LCD is and SSD1289, + not an ILI93xx. + * configs/shenzhou/src/up_ssd1289.c: The LCD is basically functional + on the Shenzhou board. + * graphics/nxmu: Correct some bad parameter checking that caused + failures when DEBUG was enabled. + * arch/arm/src/armv7-m/nvic.h: Add bit definitions for the AIRCR + register. + * drivers/input/ads7843.c: Need semaphore protection in logic + that samples the position. + * drivers/lcd/ssd1289.c: On some platforms we are unable to + read the device ID -- reason unknown; workaround in place. + * drivers/input/ads7843.c: Add thresholding options and an + option to swap X and Y positions. Fix some logic errors in + the SPI locking/selecting logic. + * arch/arm/src/armv7-m/up_systemreset.c: Add logic to reset + the Cortex-Mx using the AIRCR register. Contributed by Darcy + Gong. + * arch/arm/src/stm32/up_eth.c: Add logic specifically for the + DM9161 PHY. If the DM9161 failed to initialize, then use the + up_sysemreset() logic to reset the MCU. Contributed by Darcy + Gong. + * arch/arm/src/stm32/stm32_gpio.c: Add missing logic to set bit + for SPI3 remap. This fixes the XPT2046 touchscreen driver using + drivers/input/ads7843.c + * configs/shenzhou/src/up_ssd1289.c: Fix naming error in + conditional compilation. + * configs/shenzhou/nxwm/defconfig: Disable reading from the LCD. + This does not work. The hardware and the driver support the + capability, but there is some bug that causes memory corruption. + The work around for now: Just disable reading from the LCD. + * drivers/lcd/ssd1289.c: Add some logic to reduce the amount of + output when CONFIG_DEBUG_LCD is enabled. + * configs/shenzhou/nxwm/defconfig: Bug found and fixed... The + original configuration had too much stuff turned on. Reducing + stack sizes, some features, and buffer sizes made the + configuration reliable (Reading from the LCD is still disabled). + * net/uip/uip_icmpping.c: Fix problem that prevented ping from + going outside of local network. Submitted by Darcy Gong + +6.23 2012-11-05 Gregory Nutt + + * arch/arm/src/stm32/stm32_rng.c, chip/stm32_rng.h, and other files: + Implementation of /dev/random using the STM32 Random Number + Generator (RNG). + * board.h file for shenzhou, fire-stm32v2, and olimex-stm32-p107: + Add frequencies for HSE, HSI, LSE, and LSI. These are needed + by the STM32 watchdog driver. + * CONFIG_EXAMPLES_*: To make things consistent, changed all occurrences + of CONFIG_EXAMPLE_* to CONFIG_EXAMPLES_*. + * drivers/mtd/w25.c and configs/*/src/up_w25.c: Several fixes for the + W25 SPI FLASH. + * configs/*/Make.defs: All buildroot tools now use the extension + xxx-nuttx-elf- vs. xxx-elf- + * configs/shenzhou/*/Make.defs: Now uses the new buildroot 4.6.3 + EABI toolchain. + * lib/stdio/lib_libdtoa.c: Another dtoa() fix from Mike Smith. + * configs/shenzhou/src/up_adc.c: Add ADC support for the Shenzhou + board (Darcy Gong). + * configs/shenzhou/thttpd: Add a THTTPD configuration for the + Shenzhou board (Darcy Gong). + * include/termios.h and lib/termios/libcf*speed.c: The non-standard, + "hidden" c_speed cannot be type const or else static instantiations + of termios will be required to initialize it (Mike Smith). + * drivers/input/max11802.c/h, and include/nuttx/input max11802.h: Adds + support for the Maxim MAX11802 touchscreen controller (contributed by + Petteri Aimonen). + * graphics/nxtk/nxtk_events.c: Missing implementation of the blocked + method. This is a critical bugfix for graphics support (contributed + by Petteri Aimonen). + * drivers/usbdev/pl2303.c, drivers/usbdev/usbmsc.h, and + include/nuttx/usb/cdcacm.h: USB_CONFIG_ATTR_SELFPOWER vs. + USB_CONFIG_ATT_SELFPOWER (contributed by Petteri Aimonen). + * arch/arm/src/armv7-m/up_memcpy.S: An optimized memcpy() function for + the ARMv7-M family contributed by Mike Smith. + * lib/strings/lib_vikmemcpy.c: As an option, the larger but faster + implemementation of memcpy from Daniel Vik is now available (this is + from http://www.danielvik.com/2010/02/fast-memcpy-in-c.html). + * lib/strings/lib_memset.c: CONFIG_MEMSET_OPTSPEED will select a + version of memset() optimized for speed. By default, memset() is + optimized for size. + * lib/strings/lib_memset.c: CONFIG_MEMSET_64BIT will perform 64-bit + aligned memset() operations. + * arch/arm/src/stm32/stm32_adc.c: Need to put the ADC back into the + initial reset in the open/setup logic. Opening the ADC driver works + the first time, but not the second because the device is left in a + powered down state on the last close. + * configs/olimex-lpc1766stck/scripts: Replace all of the identical + ld.script files with the common one in this directory. + * configs/stm3220g-eval/scripts: Replace all of the identical + ld.script files with the common one in this directory. + * configs/hymini-stm32v/scripts: Replace all of the identical + ld.script files with the common one in this directory. + * configs/lpcxpresso-lpc1768/scripts: Replace all of the identical + ld.script files with the common one in this directory. + * binfmt/elf.c, binfmt/libelf, include/elf.h, include/nuttx/elf.h: Add + basic framework for loadable ELF module support. The initial check- + in is non-functional and is simply the framework for ELF support. + * include/nuttx/binfmt.h, nxflat.h, elf.h, and symtab.h: Moved to + include/nuttx/binfmt/. + * arch/sim/src/up_elf.c and arch/x86/src/common/up_elf.c: Add + for ELF modules. + * arch/arm/include/elf.h: Added ARM ELF header file. + * include/elf32.h: Renamed elf.h to elf32.h. + * configs/stm32f4discovery/ostest: Converted to use the new + Kconfig-based configuration system. + * configs/stm32f4discovery/elf and configs/stm32f4discovery/scripts/gnu-elf.ld + Add a configuration for testing the ARM ELF loader. + * binfmt/libelf: Can't use fstat(). NuttX does not yet support it. Damn! + * binfmt/libelf: The basic ELF module execution appears fully functional. + * configs/shenzhou/src/up_relays.c: Add support for relays from the + Shenzhou board. Contributed by Darcy Gong. + * lib/fixedmath: Moved the old lib/math to lib/fixedmath to make room for + the math library from the Rhombus OS + * lib/math: Now contains the math library from the Rhombus OS by Nick Johnson + (submitted by Darcy Gong). + * include/float.h: Add a first cut at the float.h header file. This + really should be an architecture/toolchain-specific header file. It + is only used if CONFIG_ARCH_FLOAT_H is defined. + * lib/math: Files now conform to coding standards. Separated float, + double, and long double versions of code into separate files so that + they don't draw in so much un-necessary code when doing a dumb link. + * binfmt/libelf: The ELF loader is working correctly with C++ static + constructors and destructors and all. + * Documentation/NuttXBinfmt.html: Add documentation of the binary loader. + * configs/sim/ostest: Converted to use the mconf configuration tool. + * configs/sim/cxxtest: New test that will be used to verify the uClibc++ + port (eventually). + * include/nuttx/fs/fs.h, lib/stdio/lib_libfread.c, lib_ferror.c, + lib_feof.c, and lib_clearerr.c: Add support for ferror(), feof(), + and clearerror(). ferror() support is bogus at the moment (it + is equivalent to !feof()); the others should be good. + * configs/stm32f4discovery/include/board.h: Correct timer 2-7 + base frequency (provided by Freddie Chopin). + * include/nuttx/sched.h, sched/atexit.c, and sched/task_deletehook.c: + If both atexit() and on_exit() are enabled, then implement atexit() + as just a special caseof on_exit(). This assumes that the ABI can + handle receipt of more call parameters than the receiving function + expects. That is usually the case if parameters are passed in + registers. + * libxx/libxx_cxa_atexit(): Implements __cxa_atexit() + * configs/stm32f4discovery/cxxtest: New test that will be used to + verify the uClibc++ port (eventually). The sim platform turned not + to be a good platform for testing uClibc++. The sim example will not + run because the simulator will attempt to execute the static + constructors before main() starts. BUT... NuttX is not initialized + and this results in a crash. On the STM324Discovery, I will have + better control over when the static constructors run. + * RGMP 4.0 updated from Qiany Yu. + * configs/*/Make.defs and configs/*/ld.script: Massive clean-up + and standardization of linker scripts from Freddie Chopin. + * net/netdev_ioctl.c: Add interface state flags and ioctl calls + to bring network interfaces up and down (from Darcy Gong). + * config/stm32f4discovery: Enable C++ exceptions. Now the entire + apps/examples/cxxtest works -- meaning that the uClibc++ is + complete and verified for the STM32 platform. + +6.24 2012-12-20 Gregory Nutt + + * arch/arm/src/stm32: Support for STM32F100 high density chips + added by Freddie Chopin. + * configs/stm32f100_generic: Support for generic STM32F100RC board + contributed by Freddie Chopin. + * arch/arm/src/stm32_otgfsdev.c: Partial fix from Petteri Aimonen. + * drivers/lcd/ug-2864ambag01.c and include/nuttx/lcd/ug_2864ambag01.h: + LCD driver for the Univision OLED of the same name (untested on + initial check-in). + * configs/stm32f4discovery/nxlines: Configure to use mconf/Kconfig + tool. + * configs/stm32f4discovery/src/up_ug2864ambag01.c: Board-specific + initialization for UG-2864AMBAG01 OLED connecte to STM32F4Disovery. + * libxx/libxx_stdthrow.cxx: Exception stubs from Petteri Aimonen. + * configs/stm32f4discovery/src/up_ug2864ambag01.c: Driver has been + verified on the STM32F4Discovery platform. Some tuning of the + configuration could improve the presentation. Lower resolution displays + are also more subject to the "fat, flat line bug" that I need to fix + someday. See http://www.nuttx.org/doku.php?id=wiki:graphics:nxgraphics + for a description of the fat, flat line bug. + * libc: Renamed nuttx/lib to nuttx/libc to make space for a true lib/ + directory that will be forthcoming. Also rename libraries: liblib.a -> libc.a, + libulib.a -> libuc.a, libklib.a -> libkc.a, liblibxx.a ->libcxx.a. + (I will probably, eventually rename libxx to libcxx for consistency) + * Makefile, lib/: A new, empty directory that will hold generated libraries. + This simplifies the library patch calculations and lets me get rid of some + bash logic. The change is functional, but only partially complete; + additional logic is needed in the arch/*/src/Makefile's as well. Right + now that logic generate multiple library paths, all pointing to the lib/ + directory. + * arch/*/src/Makefile: Now uses only the libraries in lib/ + Replace bash fragments that test for board/Makefile. + * Makefile.win: The beginnings of a Windows-native build. This is just + the beginning and not yet ready for prime time use. + * configs/stm32f4discovery/winbuild: This is a version of the standard + NuttX OS test, but configured to build natively on Windows. Its only + real purpose is to very the native Windows build logic. + * tools/mkdeps.bat and tools/mkdeps.c: mkdeps.bat is a failed attempt + to leverage mkdeps.sh to CMD.exe. It fails because there are certain + critical CFLAG values that cannot be passed on the CMD.exe command line + (like '='). mkdeps.c is a work in progress that will, hopefully, + replace both mkdeps.sh and mkdeps.bat. + * tools/Config.mk: Centralize the definition of the script that will be + used to generated header file include paths for the compiler. This + needs to be centralized in order to support the Windows native build. + * tools/incdir.bat: A replacement for tools/incdir.sh for use with the + the Windows native build. + * Makefile.unix: The existing top-level Makefile has been renamed + Makefile.unix. + * Makefile: This is a new top-level Makefile that just includes + either Makefile.unix or Makefile.win + * configs/stm3240g-eval/src: Qencoder fixes from Ryan Sundberg. + * arch/arm/src/stm32/stm32_qencoder.c: TIM3 bug fix from Ryan Sundberg. + * tools/mkromfsimg.sh: Correct typo in an error message (Ryan Sundberg) + * arch/*/src/Makefile: Remove tftboot install and creation of System.map + for Windows native build. The first is a necessary change, the second + just needs re-implemented. + * configs/mirtoo: Update Mirtoo pin definitions for Release 2. Provided + by Konstantin Dimitrov. + * Fixed an uninitialized variable in the file system that can cause + assertions if DEBUG on (contributed by Lorenz Meier). + * Config.mk: Defined DELIM to be either / or \, depending upon + CONFIG_WINDOWS_NATIVE. This will allow me to eliminate a lot of + conditional logic elsewhere. + * nuttx/graphics: One a mouse button is pressed, continue to report all + mouse button events to the first window that received the initial + button down event, even if the mouse attempts to drag outside the + window. From Petteri Aimonen. + * nuttx/graphics/nxmu/nx_block.c: One more fix to the NX block message + logic from Petteri Aimonen. + * include/nuttx/wqueue.h: Some basic definitions to support a user- + space work queue (someday in the future). + * graphics/nxmu: Add semaphores so buffers messages that send buffers + will block until the buffer data has been acted upon. + * graphics/nxmw: Extended the blocked messages to cover mouse movement + and redraw events. These will also cause problems if sent to a window + while it is closing. + * arch/several: Change UARTs are enabled for i.MX, LM3S, eZ80, and M16C to + match how they are enabled for other architectures. + * configs/ez80f910200kitg: Convert to use mconf configuration. + * sched/pause.c: Implements the POSIX pause() function. + * eZ80: Lots of changes to eZ80 configurations and build logic as I + struggle to get a clean Windows build (still not working). + * configs/cloudctrl: Darcy Gong's CloudController board. This is a + small network relay development board. Based on the Shenzhou IV development + board design. It is based on the STM32F107VC MCU. + * arch/arm/src/stm32_serial.c and stm32_lowputc.c: Added optional RS-485 + direction bit control. From Freddie Chopin. + * Lots of build files: ARMv7-M and MIPS32 Make.defs now include a common + Toolchain.defs file that can be used to manage toolchains in a more + configurable way. Contributed by Mike Smith + * configs/stm32f4discovery/winbuild and configs/cloudctrl: Adapted to use + Mike's Toolchain.defs. + * tools/configure.sh: Adapted to handle paths and setenv.bat files correctly + for native Windows builds. + * More of build files: AVR and AVR32 Make.defs now include a common + Toolchain.defs file that can be used to manage toolchains in a more + configurable way. Contributed by Mike Smith + * tools/incdir.sh and incdir.bat: Add -s option to generate system header + file paths. + * nuttx/arch/arm/src/arm/Toolchain.defs: Add support for more ARM toolchains + (from Mike Smith). + * arch/arm/src/stm32/stm32f40xxx_rcc.c: Enabled FLASH prefetch (from Petteri + Aimonen). + * graphics/nxtk/nxtk_filltrapwindow.c: Correct an offset problem (from + Peterri Aimonen). + * graphics/nxglib/nxglib_splitline.c: Fix error in drawing of near horizontal + lines (from Peterri Aimonen). + * sched/task_exithook.c: Missing right bracket with certain conditional + compilation (thanks James Goppert). + * arch/arm/srch/stm32/stm32_otgfshost.c: Replace timeout handling; use + system tick instead of frame counter. The frame counter gets reset to + zero at 0x3fff making it error prone. + * arch/arm/src/stm32/stm32f20xx_rcc.c and stm32f40xx_rcc.c: Added option + CONFIG_STM32_FLASH_PREFETCH. FLASH prefetch will now only be enabled + if this option is selected. + * configs/ez80f910200zco/ostest: Now uses Kconfig/mconf configuration + tool. Updated to build in native Windows environment. Other ez80f910200zco + build scripts also updated. + * configs/z8f64200100kit/ostest: Update to same level as eZ80 configurations. + * nuttx/configs/z8f64200100kit/scripts/setenv.bat: Add support for native + Windows build. + * nuttx/arch/arm/src/lpc17xx/lpc17_i2c.c: Resources not being released when + I2C is uninitialized. + * cloudctrl/src/up_chipid.c and shenzhou/src/up_chipid.c: Add functions to + get chip ID. Contributed by Darcy Gong. These should not be board-dependent, + but should be in arch/arm/src/stm32 where they can be used from any board. + * sched/work_thread.c: Fix backward conditional compilation. This might + has caused a memory leak. From Freddie Chopin. + * configs//Make.defs: Fix typo -wstrict-prototypes should be + -Wstrict-prototypes (From Denis Carilki). + * arch/arm/src/calapyso/calypso_keypad.c: Add Calypso keypad driver. From + Denis Carilki. + * z8encore000zco/ostest and z8f64200100kit/ostest: Converted to use Kconfig/ + mconf configuration tool. + * arch/arm/src/armv7-m/up_exception.S: missing curly braces for push/pop + From Freddie Chopin. + * z8encore000zco/ostest and z8f64200100kit/ostest: Can now be modified to + support the Windows native builds (see corresponding README.txt files). + * configs/z16f2800100zcog - All configurations updated to use the ZDS-II + 5.0.1 toolchain. + * configs/z16f2800100zcog - All configurations updated to use Kconfig/mconf + configuration tools. + * configs/z16f2800100zcog/ostest - Now supports a native Windows build + (other ZNEO configs may also support the native build, but this has not + been verfiied). + * include/nuttx/input/keypad.h, arch/arm/src/calypso/calypso_keypad.c, and + configs/compal_e99/nsh_highram: First cut at a standard keypad interface + definition. Contributed by Denis Carikli. + * libc/stdlib/lib_rand.c: Always add one to result congruential generators + to avoid the value zero. Suggested by Freddie Chopin. + * tools/b16.c: Fixed precision math conversion utility. + * graphics/nxglib/nxglib_splitline.c: Fix the "fat, flat line bug" + * arch/z80/src/*/Toolchain.defs: Add dummy Toolchain.defs files for the + z80 family. + * configs/z80sim/ostest: Converted to build with the Kconfig/mconf tool. + Current configuration failed to build for me (Ubuntu 12.10, SDCC 3.2.0 + pre-built for Linux) due to a glibc memory corruptionerror in SDCC. + * configs/z80sim/ostest: Default is now the Windows native build. See + configs/z80sim/README.txt for instructions to convert back to a Linux or + or Cygwin build. + * arch/z80/src/Makefile.sdccw: Renamed makefiles with extensions zdiil, + zdiiw, sdccl, and sdccw for the ZDS-II vs SDCC compilers and for the + POSIX vs Windows native builds. + * nuttx/drivers/mtd/ftl.c: Fix for the flash translation layer. Short + unaligned writes were buggy. From Petteri Aimonen. + * nuttx/libc/math/lib_round*.c: Add rounding functions to the math + library. Contributed by Petteri Aimonen. + * include/cxx/cstdlib: Add stroul(). From Petteri Aimonen. + * arch/*/include/limits.h: Change signed minimum values from, for example, + (-128) to (-127 - 1) to avoid overflows under certain conditions. From + Peterri Aimonen. + * graphics/nxtk/nxtk_subwindowmove.c: Previously it was very difficult to + do e.g. "scroll by dx, dy". When given the full window area, nxtk_subwindowmove + would clip the offset always to 0,0. It makes more sense for it to clip the + source area and not modify the offset. From Petteri Aimonen. + * graphics/nxtk/nxtk_getwindow.c: Clipping would change the offset of returned + data, and caller has no way to know what the new offset would be. This messes + up font drawing when the text is partially out of window, e.g. when scrolling. + Also from Petteri Aimonen. + * include/stdbool.h: Can now be disabled for C++ files if CONFIG_C99_BOOL8 is + defined. CONFIG_C99_BOOL8 indicates (1) that the sizeof(_Bool) is one in both + C and C++, and (2) the C compiler is C99 and supports the _Bool intrinsic + type. Requested by Freddie Chopin. + * include/stdlib/lib_rand.c: Various additional changes so that the integer + value zero can be returned. Requested by Freddie Chopin. + * arch/z80/src/Makefile.sdcc*, z80/up_mem.h: Redesign Z80 build so that it + no longer depends on Bash scripts. + * configs/z80sim/nsh and pashello: Converted to (1) use the kconfig-frontends + configuration tool, and (2) to build natively under Windows. The NSH + configuration is verified; the pashello configuration needs a more TLC. + * tools/copydir.sh: Rename tools/winlink.sh to tools/copydir.sh + * tools/link.bat, unlink.bat, and copydir.bat: Add Windows counterparts + to the link.sh, unlink.sh, and copydir.sh Bash scripts. + * configs/z80sim/pashello: Now builds correctly. + * configs/xtrs/ostest, nsh, and pashello: Converted to (1) use the kconfig- + frontends configuration tool, and (2) to build natively under Windows. + * drivers/serial/Kconfig and sched/Kconfig: Two names for same configuration: + CONFIG_LOWLEVEL_CONSOLE is bogus and CONFIG_DEV_LOWCONSOLE is in the wrong + Kconfig file. Moved to drivers/serial/Kconfig replacing CONFIG_LOWLEVEL_CONSOLE. + * arch/z80/include/z180: Add header files for z180 chips. Initial versions + are just clones of z80 header files. + * arch/z80/src/z180: Add source files for z180 chips. Initial versions + are just clones of z80 source files. + * include/nuttx/arch.h: Add address environment control interfaces (for use + with CPUs the provide MCUs and support process-like address environments). + * arch/z80/src/z180/z180_mmu.*: Add MMU support for z180 tasks. + * configs/p112: Add very basic board support and an examples/ostest + configuration for the venerable P112 board. + * sched/os_bringup.c: If CONFIG_PATH_INITIAL is defined, then the initial + environment of the task started by os_bringup() will have the PATH + environment variable defined to be that string. + * binfmt/binfmt_exepath.c: If CONFIG_BINFMT_EXEPATH is defined, then this + file will be built. It contains logic to search for regular files at + the absolutes paths found in the current PATH environment variable + setting. This is untested and not yet hooked into the binfmt exec() + logic on initial check-in + * binfmt/binfmt_loadmodule.c: load_module() will now traverse the PATH + variable to locate files from their relative path. + * include/nuttx/arch.h and arch/z80/src/z180/z180_mmu.c: Restructure the + address environment interfaces so that they will better integrate with + binfmt/. + * binfmt/libelf/*, binfmt/libnxflat/* and other files: Integrate the + address environment interfaces. If CONFIG_ADDRENV=y, then binfmt/ + will now create an address environment for new tasks (instead of + just malloc'ing the task memory). + * configs/stm32f4discovery/elf: Enable support/test of the PATH + to find executables using a relative path. + +6.25 2013-02-01 Gregory Nutt + + * graphics/: Adds 5x8 monospace font. This tiny font is useful for graph + labels and for small bitmapped display. Contributed by Petteri + Aimonen. + * configs/stm3220g-eval/nxwm: Converted to use the kconfig-frontends + configuration tool. + * configs/sim/nxwm: Converted to use the kconfig-frontends configuration + tool. + * include/pthread.h: In sys/prctl.h because it is needed by + pthread_[set|get]name_np() + * tools/kconfig.bat: Kludge to run kconfig-frontends from a DOS shell. + * sched/sig_timedwait.c: Should always move the time up to the next + largest number of system ticks. The logic was rounding. Noted by + Petteri Aimonen. + * arch/arm/src/up_head.S: Fix backward conditional compilation. NOTE + there is a issue of ARM9 systems with low vectors and large memories + that will have to be addressed in the future. + * libc/misc/lib_kbdencode.c and lib_kbddecode.c: Add logic to marshal + and serialize speical keyboard commands intermixed with normal ASCII + data (not yet hooked into anything). + * drivers/usbhost/usbhost_hidkbd.c: If CONFIG_HIDKBD_ENCODED is + defined, this driver will now use libc/misc/lib_kbdencode.c to + encode special function keys. + * configs/olimex-lpc1766stk/hidkbd: This configuration has been + converted to use the kconfig-frontends configuration tool. + * drivers/lcd/ug-2864hsweg01.c and include/nuttx/lcd/ug-2864hsweg01.h: + Driver for UG-2864HSWEG01 OLED contributed by Darcy Gong. + * configs/stm32f4discovery/src/up_ug2864hsweg01.c: Support for the + UG-2864HSWEG01 OLED for the STM32F4Discovery board. + * drivers/usbhost/usbhost_hidkbd.c: Correct a logic error in how + tasks waiting for read data are awakened. + * libc/misc/lib_kbdencode.c and lib_kbddecode.c: Now handles keypress + events too. However, the USB HID keyboard driver has not yet been + updated to detect key release events. That is kind of tricky in + the USB HID keyboard report data. + * configs/mcu123-214x/nsh: Converted to use the kconfig-frontends + configuration tool. + * configs/zp214xpa: Add basic support for the The0.net ZP213x/4xPA + board (with the LPC2148 and the UG_2864AMBAG01). + * configs/sim/nxlines: Add an nxlines configuration for the + simulator. + * configs/zp214xpa/nxlines: Add an nxlines configuration for the + ZP213x/4xPA (with the LPC2148 and the UG_2864AMBAG01). Working + as of 2012-12-30. + * configs/olimex-lpc1766stk/wlan: Remove non-functional + configuration. + * configs/stm32f4discovery/src and nuttx/drivers/lcd/ug-2864hsweg01.c: + Updates and corrections for the UG-2864HSWEG01 from Darcy Gong. + * configs/lm326965-ek: All configurations converted to use the + kconfig-frontends configuration tool. + * configs/Kconfig: NSH_MMCSDSPIPORTNO should depend on MMCSD_SPI, + not just SPI (from Jose Pablo Carballo). + * arch/arm/src/arm/Kconfig and armv7m/Kconfig: Add an option for + buildroot toolchains: They may be EABI or OABI. + * include/nuttx/progmem and arch/arm/src/stm32/stm32_flash.c: + Fix a counting bug plus change interface to use either relative + or absolute FLASH addressing (from Freddie Chopin). + * libc/misc/Make.defs: Fix error in conditional for KBD CODEC. + * libc/Kconfig and configs/*/defconfig (several): The default + setting should be CONFIG_LIB_KBDCODEC=n + * tools/configure.c: configure.c can be used to build a work-alike + program as a replacement for configure.sh. This work-alike + program would be used in environments that do not support Bash + scripting (such as the Windows native environment). + * tools/configure.bat: configure.bat is a small Windows batch + file that can be used as a replacement for configure.sh in a + Windows native environment. configure.bat is actually just a + thin layer that executes configure.exe if it is available. If + configure.exe is not available, then configure.bat will attempt + to build it first. + * arch/arm/src/lpc17xx/lpc17_syscon.h: Correct some typos in bit + definitions (from Rommel Marcelo). + * libc/string/lib_strndup.c: strndup() should use strnlen(), not + strlen(), to determine the size of the string. + * sched/os_bringup.c: Remove support for CONFIG_BUILTIN_APP_START. + This is not really a useful feature and creates a violation of the + OS layered architecture. + * include/unistd.h, arch/arch/src/*: Implement a simple vfork(). + On initial checkin, this API is available only for ARM platforms. + * binfmt/binfmt_exec.c: exec() now sets the priority of the new task + to the same priority as the current task (instead of the arbirtrary + value of 50). + * libc/unisted/lib_execv.c and lib_execl.c: New, somewhat flawed, + implementations of execv() and execl(). + * tools/cfgdefine.c: Strips quotes from CONFIG_EXECFUNCS_SYMTAB + value. + * arch/arm/include/lm3s/chip.h: Move chip definitions into + public include area for compatibility with other architectures. + * arch/arm/src/lm3s/chip: Move register definition header files + into a new chip/ sub-directory. + * arch/arm/src/lm3s/lm3s_internal.h: Broke up into several + smaller header files. + * arch/arm/src/lm: Rename the arch/arm/src/lm3s directory to + arch/arm/src/lm so that is can support other members of the + Stellaris family. + * libc/spawn: Add file action interfaces needed by posix_spawn(). + * sched/clock_time2ticks.c: Another case where time was being + rounded down instead of up (from Mike Smith). + * libc/spawn: Implementation of posix_spawn() is complete but + untested and undocumented. + * drivers/usbdev/pl2303.c: Fix typols in the PL2303 driver + (from Max Holtzberg). + * configs/stm32f4discovery/posix_spawn: Added a configuration + that can be used for testing posix_spawn(). + * arch/arm/src/stm32: Bring F1 support for general DMA and serial + DMA in paricular up to parity with F2/F4 (from Mike Smith). + * libc/stdio/lib_libfread.c: Correct some error handling when + lib_fread() was passed a bad stream. Needed to move the + releasing of a semaphore inside of some conditional logic + (cosmetic). + * include/nuttx/sched.h, sched/task_setup.c, and sched/task_exithook.c: + Add support for remembering the parent task and sending + SIGCHLD to the parent when the task exists. + * sched/task_exithook.c: Fixed a *critical* bug. Here is + the scenario: (1) sched_lock() is called increments the lockcount + on the current TCB (i.e., the one at the head of the ready to run + list), (2) sched_mergepending is called which may change the task + at the head of the ready-to-run list, then (3) sched_unlock() is called + which decrements the lockcount on the wrong TCB. The failure case + that I saw was that pre-emption got disabled in the IDLE thread, + locking up the whole system. + * sched/sched_waitpid.c: Use SIGCHLD instead of a semaphore. This + is a much more spec-compliant implementation. However, there are + some issues with overrunning signals because NuttX does not support + queueing of signals (POSIX does not require it). I think it may + need to. + * sched/sched_waitid.c and sched_wait.c: Add support for waitid() + and wait(). See issues with waitpid() above. + * include/nuttx/fs/fs.h and fs/fs_files.c: Add a dup() method to + the struct mountpt_operations. When dup'ing a file that resides + on a mounted volume, let the file system's dup() method do the + work. + * fs/romfs/fs_romfs.c: Implemented the dup() method for the ROMFS + file system. + * fs/fat/fs_fat32.c, fs/nxffs/nxffs_initialize, and + fs/nfs/nfs_vfsops.c: Add hooks for dup() method (not yet + implemented). + * fs/romfs: Remove the rf_open flag. It looks good, but actually + does nothing. + * fs/fat: Remove the ff_open flag. Same story as for the ROMFS + rf_open flag. + * fs/fat/fs_fat32.c, fs/nxffs/nxffs_initialize, and + fs/nfs/nfs_vfsops.c: Completed implementation of the dup() methods. + There is still no good test available. + * sched/sig_timedwait.c: sigtimedwait() would return a bad signal + number if the signal was already pending when the function was + called. + * configs/ubw32/scripts: All common linker scripts moved to this + scripts sub-directory + * configs/ubw32/ostest: Configuration configured to use the + kconfig-frontends tools. + * arch/mips/src/mips32/up_vfork.c, up_vfork.h, and vfork.S: + Implement vfork() for MIPS32 (no floating point support) + * configs/ubw32/ostest: Enable the vfork() test. + * fs/binfs: Move apps/builtin/binfs.c to fs/binfs/fs_binfs.c + CONFIG_APPS_BINDIR rename CONFIG_FS_BINFS + * include/nuttx/binfmt/builtin.h: Some of the content of + apps/include/apps.h moved to include/nuttx/binfmt/builtin.h + * binfmt/libbuiltin/libbuiltin_utils.c: Move builtin + utility functions from apps/builtin/exec_builtins.c to + binfmt/libbuiltin/libbuiltin_utils.c + * binfmt/builtin.c and binfmt/libbuiltin: Add a binary "loader" + that can be used to execute builtin programs from the BINFS + file system. + * configs/sim/nsh: Convert to use kconfig-frontends configuration + tool. + * binfmt/binfmt_schedunload.c: Add logic based on SIGCHLD to + automatically unload and clean-up after running a task that + was loaded into memory. + * binfmt/libbuiltin: Extensions from Mike Smith + * sched/task_reparent.c: Add internal interface to change the + parent task. + * sched/task_posixspawn(): Move libc/spawn/lib_ps.c to + sched/task_posixspawn() now it requires internal, reparenting + interfaces + * include/nuttx/spawn(): Move libc/spawn.h to include/nuttx/spawn.h + * arch/arm/include/lpc17xx/chip.h, irq178x.h: Integrate Marcelo + Rommel's LPC1788 definitions into the base LPC17xx. + * configs/olimex-lpc1766stk/nsh: Convert configuration to use + the kconfig-frontends tools. + * sched/task_reparent.c: Simplify reparenting interface. + * arch/arm/src/[many]: More LPC1788 definitions from Rommel + Marcelo incorporated. + * configs/open1788: Board configuration for the Wave Share + Open1788 board. Still fragmentary (contributed by Rommel + Marcelo, adapted to use kconfig-frontends. + * net/send(): Add logic to work around delayed ACKs by splitting + packets (contributed by Yan T.). + * net/recvfrom(): Fix a bug. When the host closes a connection + (gracefully). recv[from]() returned success and the closure + was never detected. Hmmm.. I don't know why the network monitor + did not catch this event. This is an important bug fix. + * net/recvfrom(): Fix a introduced with the last bugfix. If + the peer does an orderly closure of the socket, report 0 not + -ENOTCONN + * configs/lm3s6965-ek/README.txt and tools/: Add an OpenOCD + configuration for the LM3S (from Jose Pablo Carballo). + * nuttx/lcd/hd4478ou.h and configs/pcblogic-pic32mx/src/up_lcd1602: + Start of support of LCD1602 alphanumeric LCD. I need a few + more parts before I can finish integrating this one. + * arch/arm/src/*/chip.h and arch/arm/include/*/chip.h: Move all + priority ranges from the src to the include chip.h header file. + * arch/arm/include/armv7-m/irq.h: Add inline functions to enable + and disable interrupts via the BASEPRI register. + * arch/arm/Kconfig: Add new option CONFIG_ARM7VM_USEBASEI + * arch/arm/src/*/*_irq.c: Set the priority of the SVCALL exception + to the highest possible value. + * arch/armv7-m/up_hardfault.c: Fail if a hardfault occurs + while CONFIG_ARM7VM_USEBASEPRI=y. + * arch/arm/src/stm32/stm32_serial.c: Add support for USART + single wire mode (Contributed by the PX4 team). + * sched/: Implement support for retaining child task status after + the child task exists. This is behavior required by POSIX. + But in NuttX is only enabled with CONFIG_SCHED_HAVE_PARENT and + CONFIG_SCHED_CHILD_STATUS + * Add support for keyboard encode to the keypad test (from + Denis Carikli). + * configs/olimex-lpc1766stk/nettest: Configuration converted to + use the kconfig-frontends tools. + * net/net_poll.c: Split net_poll() to create psock_poll() too. + * net/net_poll.c: Fix poll/select issure reported by Qiang: + poll_interrupt() must call net_lostconnection() when a + loss of connection is reported. Otherwise, the system will + not know that the connection has been lost. + * sched/group_create.c, group_join.c, and group_leave.c: Add + support for task groups. + * sched/group_signal.c and task_exithook.c: Send signal to all + members for the parent task group. + * include/nuttx/sched.h and sched/env_*.c: Move environment + variables into task group structure. + * sched/: Lots of file changed. Don't keep the parent task's + task ID in the child task's TCB. Instead, keep the parent + task group IN the child task's task group. + * fs/, sched/, include/nuttx/sched.h, and include/nutts/fs/fs.h: + Move file data from the TCB to the task group structure. + * libc/stdio/, sched/, include/nuttx/lib.h, and include/nutts/fs/fs.h: + Move stream data from the TCB to the task group structure. + * net/, sched/, and include/nuttx/net/net.h: Move socket data + from the TCB to the task group structure. + * sched/task_starthook.c, sched/task_start.c, and include/nuttx/sched.h: + Add a task start hook that will be called before the task main + is started. This can be used to schedule C++ constructors to run + automatically in the context of the new task. + * binfmt/binfmt_execmodule: Execute constructors as a start hook. + * sched/os_start.c: Fix ordering of group initialization. + * configs/stm32f4discovery/usbnsh: Add an NSH STM32F4Discovery + configuration that uses USB CDC/ACM for the NSH console. + * configs/stm32f4discovery/nsh: Converted to use the kconfig-frontends + tools. + * configs/*/src/up_userleds.c: Fix a error that was cloned into + all STM32 user LED code. The wrong definitions were being used + to set LEDs on or off. + * arch/*/common/up_internal.h and arch/*/common/up_initialize.c: + Serial was driver was not being built if there is no console + device. Obviously, the serial driver may be needed even in + this case. + * arch/arm/src/stm32/stm32_serial.c: If there is a serial console, + it would be ttyS0 and the others would be ttyS1-5. If there + is not serial console, was labeling them ttyS1-6; now labels them + ttyS0-5. + * fs/fs_syslog.c: Can't handle SYSLOG output to character device from + the IDLE task (because it can't block). syslog_putc now returns EOF + on failure and sets errno. Fixed some errors in error handling. + * libc/stdio/lib_syslogstream.c: Checking of return value from + syslog_putc was bogus. Switching to EOF for all errors solves + this. + * arch/arm/src/lm/chip/lm4f_memorymap.h: More LM4F changes from + Jose Pablo Carballo. + * drivers/serial/serial.c, include/nuttx/serial/serial.h, + drivers/usbdev/cdcacm.c, and drivers/pl2303.c: Add support for + removable serial devices (like USB serial). This support is enabled + by CONFIG_SERIAL_REMOVABLE. + * arch/*/src/*/Toolchain.defs: Change assignment so that we can + override CROSSDEV with a make command line argument. + * include/assert.h: Mark assertion functions as non-returning. + * arch/*/src/*/up_assert.h: Mark _up_assert() as non-returning. + * drivers/mtd/at25.c: When the AT25 device was not available the + initialization did not fail like it should. From Petteri Aimonen. + * fs/fat/fs_configfat.c: Fix some errors in FAT formatting logic + for large devices and for FAT32. From Petteri Aimonen. + * fs/fat/fs_fat32util.c: Fix an initialization error found by + Petteri Aimonen. freecount and next freecount initialization were + reversed. + * drivers/mmcsd/mmcsd_spi.c: Some SD cards will appear busy until + switched to SPI mode for first time. Having a pull-up resistor on + MISO may avoid this problem, but this patch makes it work also + without pull-up. From Petteri Aimonen. + * fs/fat/fs_fat32.c: Fix a compilation error when FAT_DMAMEMORY=y. + From Petteri Aimonen. + * arch/arm/src/stm32/chip/stm32_spi.h: STM32F4 max SPI clock freq is + 37.5 MHz. Patch from Petteri Aimonen. + * arch/arm/src/stm32/stm32_spi.c: Fixes for SPI DMA work on the + STM32F4. Includes untested additions for the F1 implementation as + well. From Petteri Aimonen. + +6.26 2013-03-15 Gregory Nutt + + * drivers/serial/serial.c: Correct some race conditions when checking + for disconnection of a removable serial device. + * sched/task_posixspawn.c, task_spawn.c, task_spawnparms.c and + spawn_internal.h: Create new interface task_spawn() that is + like posix_spawn(), but uses entry point addresses like + task_create(). + * Corrected all argv[] arguments. Should be char * const *, not + const char **. + * sched/pthread* and include/nuttx/sched: Move pthread join data + and pthread key calculation data into the "task group" structure. + * sched/atexit.c, on_exit.c, task_exithook.c and include/nuttx/sched.h: + Move atexit and on_exit data structures to task group. These + callbacks are only issued now when the final member of the task + group exits. + * sched/waitpid.c, task_exithook.c and include/nuttx/sched.h: + Move waitpid data data structures to task group. Callers of + of waitpid() are now only awakened when the final thread of the + task group exits. + * sched/mq_descreate.c, mq_open.c, mq_remove.c, group_leave.c, and + include/nuttx/sched.h: Move list of opened message queues to + the task group structures. Now all message queues opened by + members of the group are closed when the last member of the group + exits. + * includes/nuttx/sched.h and Lots of files: Change name of _TCB to + struct tcb_s so that (1) it is consitent with other NuttX naming and + so that (2) the naming can handle some upcoming changes. + * includes/nuttx/sched.h and sched/: There are three TCB structures: + struct tcb_s is a generic common version, struct task_tcb_s is a + version for tasks and kernel threads and pthread_tcb_s is a version + for pthreads. By dividing the TCB structure into these variants, + pthreads do not have to be burdened by task-specific data structures + (and vice versa). + * sched/task_exithook.c adn group_create.c: Fix an error, the + task within the task group may exit early leaving a pthread to + exit the task group last. In this case, we need to remember the + the PID of the main task in the task group and use that PID for + signalling SIGCHILD to the parent task group. + * included/nuttx/sched.h and sched/sig*.c: Numerous changes to the + signal deliver logic so that the delivery of signals to threads + within a task group will be compliant with delivery of signals + to threads within a POSIX process. + * sched/mq_recover.c and task_exithook.c: Add logic to handle the + case where a task is deleted (or pthread canceled) while it is + waiting on a message queue. task_delete() and pthread_cancel() + are dangerous interfaces. This is only one feeble recover measure + of *many* that would be needed to do this safely. + * sched/group_killchildren.c, task_recover.c, group_foreachchild.c, + sched/restart.c, sched/task_delete.c, and others: Beef up logic + to better support task deletion and pthread cancellation. Needed + to pass need OS test case for task_restart(). + * sched/include/sched.h and all timed functions in sched/: Move + timer from local variables to TCB. This is needed so that if a + task is canceled or restarted while it is waiting for a timed + event, we can gracefully recover. We can't let the timer expire + after the task has been deleted. + * arch/arm/include/stm32 and arch/arm/src/stm32: Add support for + the STM32 F3 family (still missing some things). + * configs/stm32f3discovery: This will (eventually) be support for + the STM32F3Discovery board. + * STM32 F3 and STM32F3Discovery port is complete a ready for test. + * arch/arm/src/lpc17xx: Add support for the Cortex-M4 FPU and + Mikes "common vector" logic. The LPC1788 is going to need + these things. + * arch/arm/src/stm32/stm32_spi.c: Fix SPI DMA logic that does + not work if sem_wait() is interrupt by a signal. From Petteri + Aimonen. + * drivers/input/max11802.c: MAX11802: Fix a timing bug that + corrupted coordinates. From Petteri Aimonen. + * drivers/mmcsd/mmcsd_spi.c: Use SPI locking so that MMC/SD can + exist on the same bus as other SPI devices. From Petteri + Aimonen. + * graphics/nxfonts/nxfonts_sans17x22.h: Small mod to hyphen in + sans17x22 font. The hyphen did not have any space on its sides. + This caused it to run together with other characters so that for + example "+-" would look weird. From Petteri Aimonen. + * mm/mm_mallinfo.c: Take MM semaphore in mm_mallinfo. From Petteri + Aimonen. + * configs/stm32f3discovery/nsh/defconfig: Disable SPI. It is not + used. + * drivers/mtd/sst39vf: Add a driver for the SST29VF NOR FLASH parts. + * sched/os_start.c: Add an additional call-out to support board- + specific driver initialization during the start phase: If + CONFIG_BOARD_INITIALIZE is defined, then an additioinal + initialization function called board_initialize() will be called + just after up_initialize() is called and just before the initial + application is started. + * arch/arm/src/stm32/stm32_otgfsdev.c, drivers/usbdev/usbdev_trprintf.c, + and include/nuttx/usb/usbdev_trace.h: Add logic to support decoding + of device-specific trace events to make the trace output more readable. + From Petteri Aimonen. + * arch/arm/src/stm32/stm32_otgfsdev.c: Need to manually set CNAK in + the case where we are waiting for a SETUP command with DATA. Otherwise, + the core may NAK further transactions. From Petteri Aimonen. + * arch/arm/src/stm32/stm32_otgfsdev.c: Add logic to prevent premature + to IDLE state. This change (plus the previous) was necessary to get + the CDC/ACM driver working the certain STM32 F4 hardware (but not others). + These changes appear to prevent certain race conditions that may or may + not cause USB problems. From Petteri Aimonen. + * arch/arm/include/armv6-m and arch/arm/src/armv6-m: First cut at support + for the Cortex-M0 + * configs/nutiny-nuc120, arch/arm/include/nu1xx, and arch/arm/src/nuc1xx: + Support for Nuvoton NuTiny NUC120. + * 2013-02-22: the Cortex-M0, NuvoTron NUC1xx, and NuTiny-SDK-NUC120 port + is code complete and ready for testing. + * configs/ekk-lm3s9b96/ostest and nsh: All EKK-LM3S9B96 configurations + converted to use the mconf configuration tool. + * configs/zkit-arm-1769: Add support for Zilogic System's ARM development + Kit, ZKIT-ARM-1769. From Rashid. + * configs/zkit-arm-1769/hello: Add a "Hello, World!" configuration for + the KBIT-ARM-1769 board. From Rashid. + * configs/zkit-arm-1769/thttpd: Add a THTTPD configuration for the + KBIT-ARM-1769 board. From Rashid. + * 2013-02-27: All configurations for the Cortex-M0 NuTINY-SDK-NUC120 + appear to be functional and stable. + * configs/zkit-arm-1769/nsh: Add an NSH configuration for the + KBIT-ARM-1769 board. From Rashid. + * arch/arm/src/stm32/stm32_otgfsdev.c: Fixes from Petterri Aimonen + related to corner cases that can cause infinite interrupts. + * drivers/usbdev/usbmsc_scsi.c: Change to allow the full name in the + USB descriptor but a truncated, 8-byte name in the SCSI field. + From Petteri Aimonen. + * arch/arm/src/stm32/stm32_spi.c: Need to clear error flags to prevent + corruption of subsequent transfers. Also, bit count should not be + changed while the SPI peripheral is enabled. From Petteri Aimonen. + * drivers/mmcsd/mmcsd_spi.c: When bus is shared, the speed has to be + set every time. Also SD cards require a few dummy clocks to react + into CS release. From Petteri Aimonen. + * configs/lm4f120-launchpad: In initial configuration for testing + the LM4F120 LaunchPad port. This is to support testing only and + is not yet a functional board port (as of 2013-03-01). + * arch/arm/include/lm/lm4f_irq.h and arch/arm/src/lm/chip/lm4f_vector.h: + Add interrupt vector/IRQ number definitions for the LM4F120. + * arch/arm/src/stm32f20xxx_dma.c and stm32f40xxx_dma.c: Fix a typo + in assigned base register addresses for each DMA channel. From + Yan T. + * Several build fixes from Mike Smith were incorporated. These were + mostly compilation errors introduced into the system because of the + large number of recent changes with broad scope (2013-03-04). + * configs/zkit-arm-17969/src/up_can.c: Add CAN support to the + Zilogics Technologies ZKIT-ARM-1769 board (From Rashid Fatah, (2013-03-04)). + * arch/arm/src/lpc17/lpc17*_clockconfig.c: The WaveShare Open1788 + board now boots and passes the OS test. This is the work of + Rommel Marcelo (2013-03-04). + * arch/arm/src/lm/lm_gpio.c, lm_gpio.h, and chip/lm4f_pinconfig.h + Extend GPIO logic to handle LM4F. Add LM4F pin configuration header + file (2013-03-04). + * configs/open1788: Enable LED support in all configurations. + (2013-03-04) + * configs/open1788/nsh: NSH configuration verified function. By Rommel + Marcelo (2013-03-05). + * configs/open1788/src/lpc17_nsh.c: Use the SD card interface, not SPI + to interface with SD cards (2013-03-05. + * arch/arm/src/lpc17xx/lpc17_sdcard.c and header files: Clone the STM32 + SD card interface to the LPC1788. It appears to be the same IP. + (2013-03-05) + * libc/wqueue: Work queue logic moved from sched/ to libc/wqueue. It + is not really core OS functionality and this move helps prepare for + user-space work queues. (2013-03-05) + * libc/wqueue: Implemented user-space work queues. These will not + get tested until the next time I attempt a NuttX kernel build. + (2013-03-05). + * arch/arm: Correct some bad syscall dispatching logic. This change + cannot be fully tested until there is a fielded NuttX kernel build. + (2013-03-06). + * net/net_poll.c: Correct logic that checks if the socket is + disconnected when the poll is setup. That is bad logic: Listen + sockets, for example, are not connected. In that case, the purpose of + the poll is to wait for connection events. As a result of this, + poll/select would return immediately with POLLHUP with it was used to + detect connection events. This fix for now was to check instead if + the socket is closed (meaning that it was connected at one time but + was closed by the remote peer). That excludes the listen socket which + was never connected. This does introduce a new problem, however. If + the socket was not closed, but lost the connection through an abnormal + event, then poll/select will hang. That needs to be revisited. + (2013-03-07) + * fs/fs_select.c: Was not checking if the timeout parameter was NULL + but would, instead, setup a bogus timeout based on whatever it found at + address zero. Also, improved some of the memory allocation logic so + that it will not use so much memory. (2013-03-07) + * net/net_poll.c: Handle the missing case. Now tests for not connected + AND not listening. I think that now covers all of the cases including + the missing case noted above. (2013-03-07) + * mm/: Move all memory manager globals into a structure. A reference + to this structure is now passed internally between mm APIs. This + change will (eventually) support multiple heaps and heap allocators. + (2013-03-08). + * mm/ and include/nuttx/mm.h: Implement support for multiple heaps. + (2013-03-08). + * arch/*/src: xyz_addregion() needs to call kmm_addregion, not mm_addregion. + (2013-03-08). + * sched/kmm*.c: Move this garbage kmm*.c file to mm/. until I decide what + to do with them (which is probably to just delete them). (2013-03-08). + * mm/mm_test.c and Makefile.test: Deleted the memory test. This was + a good test and helped me a lot when I wrote the memory manager, but + now it is in the way and paralyzing other efforts. So the memory unit + test was deleted. (2013-03-08) + * sched/sched_free.c: Rename sched_free() to sched_ufree(); Add + sched_kfree() to handler deferred kernel heap allocations. (2013-03-10) + * arch/: User user-accessible heap to allocate all stacks. (2013-03-10) + * arch/arm/src/sam3u: The AT91SAM3U will now support a kernel heap if + so configured. (2013-03-10) + * configs/sam3u-ek/knsh: This configuration was converted to use the + kconfigs-frontends build tool. (2013-03-10) + * configs/*/include/user_map.h and include/nuttx/userspace.h: Remove + the very kludgy user_map.h file and replace it with a header that + is expected at the beginning of the user-space blob. (2013-03-10) + * configs/sam3u-ek/kernel/up_userspace.c: This is the header for + the SAM3U-EK's user space. (2013-03-10) + * sched/os_bringup.c: In the kernel build, os_bringup() now uses the + user-space header to automatically start the user-space work queue, + if so configured. (2013-03-10) + * arch/arm/src/lpc17xx/lpc17_mpuinit.c and lpc17_userpace.c: Add + support for the MPU and kernel build for the LPC17xx family. + (2013-03-11) + * configs/open1788/kernel and knsh: Add kernel build support and + a kernel NSH configuration for the WaveShare Open1788 board. + (2013-03-11) + * configs/sam3u_ek/kernel, knsh, and scripts: Move some files around + for better supportability. (2013-03-11) + * configs/open1788/kernel, knsh, and scripts: Add a kernel mode build + configuration for the WaveShare Open1788 board. (2013-03-11) + * arch/arm/src/armv7-m/up_mpu.c: Several fixes to MPU logic. + (2013-03-12). + * arch/arm, configs/sam3u-ek, configs/open1788: Fix memory map for + kernel mode build; Some regions were overlapping. (2013-03-13). + * arch/: Rename g_heapbase to g_idle_topstack. This is the same value + however: The top of the IDLE stack is the same as the base of the + heap in the flat build. But not in the kernel build: The base of + the heap is elsewhere so the naming was wrong. (2013-03-13). + * libc/stdlib/lib_itoa.c: Implementation of itoa() contributed by + Ryan Sundberg. (2013-03-14). + +6.27 2013-04-28 Gregory Nutt + + * arch/arm/src/armv7-m/up_mpu.c: Correct MPU sub-region settings for + unaligned regions (2013-03-15). + * arch/arm/src/armv6-m/up_svcall.c: Bring up to equivalent to the + ARMv7-M version (2013-03-15). + * configs/lm4f120-launchpad/tools: Add scripts and instructions to + simplify use of OpenOCD with ICDI (from JP Carballo, 2013-03-15). + * tools/mkconfig.c: Logic that attempts to suppress buffered I/O + within the kernel is wrong. sizeof(struct file_struct) must be + the same in both kernel- and user-spaces (2013-03-16). + * arch/arm/src/common/up_pthread_start.c, libc/pthread/pthread_startup.c, + and related files: Implement switch to user-space and user-space + pthread start-up function (2013-03-16). + * arch/arm/src/common/up_signal_handler.c, libc/pthread/pthread_startup.c, + and related files: Implement switch to user-space and user-space + pthread start-up function (2013-03-16). + * arch/arm/src/common/up_signal_handler.c, libc/signal/signal_handler.c, + arch/arm/src/armv[6|7]-m/up_svcall.c, arch/arm/include/armv[6|7]-m/svcall.h, + include/nuttx/userspace.h, and sched/sig_deliver.c: Implement switch + to user-space from kernel signal delivery trampoline before calling user- + space signal handler. Return from user-space signal handler using a + system call (2013-03-16). + * arch/arm/src/armv[6|7]-m/up_schedulesigaction.c: Need make sure we are + in kernel mode before switching to kernel-mode signal handler + trampoline (2013-03-16). + * arch/arm/include/armv[6|7]-m/irq.h, and arch/arm/src/armv[6|7]-m/up_svcall.c: + Add support for nested system calls. In the current design, this can + happen only under one condition: When the kernel system call logic calls + back into user space in order to allocate user space memory. So it is + expected that the maximum nesting level will be only 2 (2013-03-17). + * libc/stdio/lib_sccanf.c: Correct an error in sscanf. If %n occurs in + the format statement after the input data stream has been fully + parsed, the %n format specifier will not be handled. Reported by + Lorenz Meier (and also earlier by Kate) (2013-03-17). + * drivers/serial/serial.c: Support for O_NONBLOCK was not supported + in the "upper half" serial driver. This is normally not an issue + because UART TX is almost always available, but it does become an + if the UART uses hardware flow control or if the a "lower half" is + something like the USB CDC/ACM driver that may need to block for + significant amounts of time (2013-03-18). + * arch/arm/src/armv7-h/ram_vectors.h, up_ramvec_*.c, arch/arm/src/*/*_irq.c, + and Make.defs: Add support for modifiable interrupt vectors in RAM + (2013-03-18). + * arch/arm/src/armv7-m/up_exception.S, sam3u/sam3u_vectors.S, and + lpc17xx/lpc17_vectors.S: In exception handling with CONFIG_NUTTX_KERNEL, + need to explicity set and clear the privilege bit in the CONTROL + register on return. I assumed this would be handled automatically + by the EXC_RETURN. Silly me (2013-03-18). + * arch/arm/src/lpc17_adc.c: Add a work-around for an ADC errata. From + Chris Taglia (2013-3-19). + * arch/arm/src/armv7-m/up_hardfault.c: If the PRIMASK is used to disable + interrupts, then additional logic is required in the hard fault handler + (2013-3-19). + * libc/ and mm/: Directories where the same sources files are used to + build different objects in the first and second pass kernel builds need + to keep those objects in separate directories so that they are not + constantly rebuilt (2013-3-19). + * fs/fat: Create an error in FAT file creation. The FAT logic was + not making a distinction between directory non-existence and file + non-existence so when it you try to create a file in a non-existent + directory, it would create a file with the name of the missing + directory. Reported by Andrew Tridgell (2013-03-30). + * Numerous files: Changed the protoypes of up_create_stack() and + up_release_stack() so that is includes a task type. Normally you + can get this type from the TCB parameter, but there are certain + conditions when the task type is not valid in the TCB when these + functions are called. Only the prototypes were changed on this + big, initial checkin. The next step will be to add logic to + allocate stacks for kernel threads from protected kernel memory + and all other task types from unprotected user memory (2013-03-20). + * arch/*/src/common/up_createstack.c, up_use_stack.c, and + up_release_stack.c: If creating or releasing the stack for a kernel + thread, use the kernel allocator so that the kernel thread stacks + are protected from user application meddling (2013-03-20). + * arch/arm/src/armv[6|7]-m/up_scall.c: Fix parameter passing for + all system call inline functions with > 3 parameters (2013-03-20) + * arch/*/src/common/up_stackframe.c and include/nuttx/arch.h: Add + and new interface to set aside memory on the stack. This will be + used at least in the kernel build to hold task arguments (2013-03-21). + * sched/sig_deliver.c: When dispatching signals to user threads, + copy the siginfo_t from the sigq to the stack. The signal queue + is allocated from kernel memory; however, the current stack is + the user's stack and the user code will be able to access the + signinfo_t data from the stack copy (2013-03-21). + * arch/arm/src/stm32: Added support for the kernel mode build + (cloned from the lpc17xx). (2013-03-21). + * configs/stme32f4discovery/kernel and scripts: Add support for + the kernel mode build on the STM32F4Discovery (2013-03-21). + * drivers/st7567.c/h and include/nuttx/lcd/st7567.h: Driver for + the ST7567 LCD Display Module from Univision Technology Inc. + contributed by Manikandan.S (2013-03-22). + * configs/zkit-arm-1769: Now supports the ST7567 LCD display + module. Added an nxhello configuration for testing (Manikandan.S, + 2013-03-22). + * configs/stm32f4discovery/kostest: Add a kernel mode version + of the OS test for the STM32F4Discovery board (2013-03-22). + * nuttx/include/nuttx, nuttx/configs/sam3u-ek, nuttx/configs/open1788, + nuttx/configs/stm32f4discovery, and nuttx/arch/arm: Complete + re-archtecting of how signals are dispatched to user-space code + in the kernel build. The original implementation was C-based + and simpler. However, the C code intermixed with SVC calls was + not properly preserving registers. The more complex, assembly + language version does not suffer from these issues. I believe + the kernel build can now be called "feature complete" + (2013-03-23). + * binfmt/binfmt_execmodule.c: Here is a place where I forget + to update the call to sched_releasetcb() to pass the thread + type as the second parameter (2013-03-23). + * arch/arm/src/lm, kinetis, lpc43, and nuc1xx: Add kernel build + support to all ARMv7-M and ARMv6-M chips. There are no + configurations in place to verify these additions! + (2013-03-24). + * arch/arm/src/lm/lm_gpio.h: Correct typos in alternate function + definitions (2013-03-24). + * arch/arm/src/lm/lm_lowputc.c and lm_serial.c: Add support for + the 7 UARTs on the LM4F120 (2013-03-24). + * configs/lm4f120-launchpad/ostest/defconfig: Fix the configured + RAM size. This appears to be the last show-stopper bug: The + LaunchPad now runs NuttX! (2013-03-24). + * configs/lm4f120-launchpad/nsh: Add an NSH configuration for the + LaunchPad (2013-03-24). + * configs/kwikstik-k40: Converted configurations to use the + konfig-frontends tool (2013-03-25). + * configs/twr-k60n512: Converted configurations to use the + konfig-frontends tool (2013-03-25). + * arch/arm/src/lpc17xx/lpc17_lcd.c: Add an LCD framebuffer driver + for the LPC177x/8x family (2013-3-26). + * arch/arm/src/lpc17xx/lpc17_emc.c and + configs/open1788/src/lpc17_sdraminitialize.c: Began testing the + Open1788 SDRAM. The SDRAM is basically functional, but there are + failures with the SDRAM is stressed by the memory test at + apps/example/ramtest (SDRAM support and the RAM test can be configured + into the base configs/open1788/nsh configuration as described in + configs/open1788/READMT.txt (2013-3-27). + * configs/open1788/nxlines: Add a configuration to test both the + Open1788 LCD and SDRAM which is used as a framebuffer (2013-3-27). + * arch/arm/src/lpc17xx/lpc17_gdma.c and lpc17_sdcard.c: Began + implementation of the LPC17 DMA and integration into the SDCARD + driver (2013-3-29). + * arch/arm/src/lpc17xx/lpc17_gdma.c: LPC17 DMA is code complete and + under test. Does not yet work (2013-3-30). + * fs/fat/fs_fat32dirent.c and fs_fat32util.c: Several fixes to the + FAT file system from Ronen Vainish. These fixes mostly involve the + logic to extend directory clusters for the case of long file names + but also include a few important general fixes (such as for storing + 32 bit FAT values) (2013-03-31). + * arch/arm/src/lpc17xx/lpc17_gdma.c and lpc17_sdcard.c: SD card DMA + is now functional. Thre may be some issues with DMA from CPU SRAM + which is apparently disabled in sleep mode; up_idle() always enters + sleep mode (2013-03-31). + * arch/arm/src/stm32: Add architecure support for the STM32 F427/F437 + chips. Contributed by Mike Smith (2013-4-01). + * configs/zkit-arm-1769/src/up_can.c: Add support for both CAN1 + and CAN2. Contributed by M.Kannan (2013-4-01). + * arch/arm/src/lpc17xx/lpc17_spi.c and lpc17_ssp.c and + configs/olimex-lpc1766stk, nucleus2g, zkit-arm-1769, and + lpcxpresso-lpc1768: The initialization function for both the LPC17xx + SPI and SSP blocks was called up_spinitialize() which is the common API + definition of include/nuttx/spi.h. But this raises a problem when the + MCU has multiple blocks for differ SPI implementations as does the + LPC17xx (and also as does other architectures like STM32 that have + USARTs that can serve as SPI interfaces as well). These were renamed + to lpc17_spiinitialize() and lpc17_sspinitialize() in this case. + Problem reported by M. Kannan (2013-4-01). + * arch/arm/src/lpc17xx/lpc17_gpdma.c and lpc17_idle.c: In sleep mode, + DMA can only be performed from peripheral SRAM. CPU SRAM is shutdown + in sleep mode. In order to simplify DMA memory allocation, the LPC17xx + IDLE will now hold off going to sleep mode if there is a DMA in progress + (2013-4-01). + * configs/open1788/src/lpc17_autoleds.c: Reversed sense of the IDLE LCD. + It is now off when the LPC17 is sleeping and on when awake. That is + much more useful because it provides a good visual indication of the + dynamic CPU load (2013-4-01). + * configs/open1788/src/lpc17_touchscreen.c and lpc17_ssp.c: Add + support for the touschscreen on the WaveShare LCD (2013-4-01). + * configs/several: There were already some functions called + lpc17_sspinitialize(). So they had to be renamed (2013-4-01). + * arch/arm/src/lpc17xx/lpc17_ssp.c: Adapted to work with the LPC178x + family (2013-4-01). + * arch/arm/src/lpc17xx/lpc17_gpio.c/.h: Separate LPC176x and LPC178x + logic into separate files. The logic is diverging to much to + try to retain common code (2013-4-03). + * net/net_clone.c: Fix compilation error when socket options are + are disabled. Reported by Daniel O'Connor (2013-4-05). + * configs/zkit-arm-1769/src/up_leds.c: Fix a typo introduced into + the button interrupt logic (2013-4-05). + * arch/arm/src/lpc17xx/lpc178x_gpio.c: Re-design of the GPIO + logic for the LPC178x family by Rommel Marcelo (2013-4-05). + * arch/arm/src/lpc17_gpiodbg.c: Updated so that it correctly + reports LPC177x/8x GPIO registers when GPIO debug is enabled + (2013-4-05). + * arch/arm/src/Makefile: The variable NUTTX already includes + the extension $(EXEEXT). So remove the second extension + $(NUTTX)$(EXEEXT) in two places (2013-4-7). + * arch/arm/src/lpc17xx/lpc17_gpioint.c: Disable interrupts in + lpc17_setintedge(). This logic must be atomic because it can be + re-entered before it completes enabled interrupts, sometimes + leaving the interrupts in a strange state (2013-4-7). + * arch/arm/src/lpc17_lcd.c: Rommel Marcelo got the LPC1788 + framebuffer-based LCD working. Very nice! (2013-4-08). + * arch/arm/src/lm/lm_clockconfig.c and configs/lm4f120-launchpad: + Fix handling of the RCC SYSDIV2 field when the PLL output is + 400MHz. Don't forget to set the USERCC2 bit in the register or + all is for naught (2013-4-09). + * configs/zkit-arm-1769/src/up_lcd.c, up_ssp.c, and up_spi.c: + Use SSP0 to LCD and SPI to SD-Card on the Zkit-arm-1769 board. + From Manikandan. S (2013-4-10) + * configs/olimex-lpc1766stk/usbserial: Converted to use the + kconfig-config frontends tools (2013-4-12). + * drivers/usbdev/pl2303.c: Fix some compilation errors that + crept in when fixes to the CDC/ACM driver where blindly + incorporated in the PL2303 driver (2013-4-12). + * configs/stm3210e-eval/usbserial: Converted to use the + kconfig-config frontends tools (2013-4-12). + * configs/nucleus2g/usbserial: Converted to use the + kconfig-config frontends tools (2013-4-12). + * arch/arm/src/kl and arch/arm/include/kl: Add support for the + Kinetis L family of Cortex-M0+ MCUs. Contributed by Alan + Carvalho de Assis. NOTE: This is still very much a work in + progress as of this initial commit (2013-04-16). + * configs/freedom-kl25z: Support for the Freedom KL25Z board + contributed by Alan Carvalho de Assis. NOTE: This is still + very much a work inprogress as of this initial commit + (2013-04-16). + * arm/arm/src/armv6-m and arch/arm/include/armv6-m: Ooops. Fix + a major screw-up: The Cortex-M0 has no BASEPRI register but + the current logic was using it to manage interrupts. Switch + to using the PRIMASK. This means that hardfaults will (again) + occur when SVC instructions are executed (2013-4-16). + * configs/stm3240g-eval/ostest: Converted to use the kconfig-frontends + tools (2013-4-17). + * sched/task_exithook.c: Don't flush the streams until the + final thread of the group exits. Flushing may cause the + thread to get suspended at a bad time and other threads in the + group may run while the exiting thread is in an unhealthy state. + This can cause crashes under certain circumstance. This is a + critical bugfix (2013-4-18). + * drivers/mtd/ramtron.c: Extended to support the FM25V01 device. + Contributed by Lorenz Meier (2013-4-18). + * sched/task_deletecurrent.c and task_exit.c, arch/*/up_exit.c: + Renamed task_deletecurrent() and task_exit() since it really + handles the architecture independent part of _exit(). _exit() + is used internally, but if it is called from the user, it should + unregister any atexit() or on_exit() functions (2013-4-18). + * tools/kconfig2html.c: This is the beginning of a tool to + replace the hand-generated documentation of the NuttX configuration + variables with auto-generated documentation. The initial checkin + is an incomplete, poorly structured prototype that I hope to + evolve into a useful tool (2014-4-20). + * libc/string/lib_strchr.c: strchr(str, '\0') should return a + pointer to the end of the string, not NULL. From Petteri + Aimonen (2014-4-22). + * fs/fat/fs_writefat.c: mkfatfs was writing the boot code to the + wrong location. From Petteri Aimonen (2014-4-22). + * Documentation: The NuttX documentation now expects to find an + auto-generated version of the configuration variable documentation + at Documentation/NuttXConfigVariables.html (2014-4-22). + * arch/arm/src/lpc17xx/lpc17_adc.c: Only one ADC pin was configured. + Need to configure all that are in the ADC0 set. From MKannan + (2014-4-23). + * configs/zkit-arm-1769/src: ADC and SPI/USB MSC updates from + MKannan (2014-4-23). + * arm/src/armv7-m/ram_vectors.h and arm/src/armv7-m/up_ramvec_initialize.c: + Fixes to RAM vector logic from Paul Y. Zhang (2014-4-23) + * tools/kconfig2html.c: Improve behavior of Expand/Collapse + Table of Contents; Handle errors in parsing of strings and in + some uninitialized variables. Add an option to use jQuery. + * tools/mkconfigvar.sh: Fix make target (2014-4-23). + * sched/exit.c, pthread_exit.c, task_exit.c, task_delete,c and + task_exithook.c: For pthread_exit(), move some logic to an early + point in the exit sequence where the task may need to block. Add + conditional logic in the lower end of the eixt logic kicked off by + _exit() to prohibit blocking after the task has been torn down and is + no longer cabable of blocking (2014-4-23). + * arch/arm/src/common/up_initialize.c: Add missing registration + of /dev/zero. Registration of /dev/null should depend upon + conditional compilation. From Ken Pettit (2014-4-24). + * arch/*/src/common/up_initialize.c: Same change required to other + architectures (2014-4-24). + * arch/arm/src/kl/kl_clockconfig.c and configs/freedom-kl25z/include/board.h: + Modify out PLL configuration so that it uses the values in + board.h; Fix PLL settings in board.h so that the correct core + and bus clock frequencies are generated. (2014-4-24). + * arm/src/kl/chip/kl_memorymap.h, kl_sim.h, andkl_uart.h: Correct some + register definitions (2014-4-25). + * arch/arm/src/kl/Kconfig, kl_lowputc.c, kl_serial.c, and kl_config.h: + No UART3-5 (2014-4-25). + * arch/arm/src/kl/kl_serial.c: Various fixes to various files in the + KL architecture directory as need to get the interrupt-driven + serial driver to work. The Freedom KL25Z NSH configuration now + works (2014-4-25). + * include/nuttx/assert.h, arch/*/src/*/up_assert.c, and other file: + Remove up_assert_code(). While asserting with an encoded value + could be a good feature, the codes have not be well utilized nor + documented. Give that situation it is better to remove the API + and reduce the footprint a little (2014-4-25). + * drivers/serial/Kconfig and arch/*/src/*/*_serial.c: Add + compilation so that the useless TIOCSERGSTRUCT ioctl logic + is not build unless CONFIG_DEBUG and CONFIG_SERIAL_TIOCSERGSTRUCT + are defined. + * sched/task_delete.c and task_terminate.c: Most task_terminate() + out of task_delete.c into its own C file. This should prevent + dragging task_delete() into the link when it is never called. + +6.28 2013-06-14 Gregory Nutt + + * arch/arm/src/lpc17xx/lpc17_i2c.c: Interrupts were not being + re-enabled in the I2C initialization function (2013-4-30). + * net/sendto.c: Added skeleton of implementation of send timeouts + for UDP. However, this functionality really does not make + sense, so it is disabled in the code (2013-4-30). + * drivers/mtd/mtd_partition.c: Support capability to clone one + MTD driver into several, MTD partition drivers, each of which + can manage a sub-region of the FLASH (2013-4-30). + * configs/sim/nxffs: Converted to use the kconfig-frontends + tools (20130-4-30). + * configs/sim/mtdpart: A new configuration to test MTD + partitions (2013-4-30). + * configs/sim/mkroe-stm32f4: Support for the MikroElektronika + Mikromedia for STM32F4 development board (from Ken Pettit, 2013-4-30). + * fs/smartfs: Add Ken Pettit SMART FS (2013-4-30). + * include/nuttx/mtd.h and most MTD drivers: Add support for + (optional) method to perform byte oriented writes if so configured + (2013-5-1). + * arch/arm/src/kl/chip/kl25z128_pinmux.h: Corrections fo the + pin multiplexing definitions from Alan Carvalho de Assis + (2013-5-2). + * drivers/mtd/mtd_partition.c: Fix a few bugs and add support for the + (option) byte write method (2013-5-3). + * arch/arm/src/kl: Repartitioning of definitions in header files + from Alan Carvalho de Assis (2013-5-3). + * drivers/mtd/smart.c, fs/smart, and other files: SMART file system + now makes use of the MTD byte write capabilities when present (from + Ken Pettit, 2013-5-3). + * drivers/mtd/m25px.c: Some rearchitecting to use the byte write + capability (when possible) and to use 4KB sectors for the erase block + size when the part supports it (Ken Pettit, 2013-5-3). + * configs/pirelli_dpl10: Adds a configuration for the pirelli phone + (from Craig Comstock via Alan Alan Carvalho de Assis, 2013-5-3). + * arch/arm/src/calypso: Fix some compilation warnings (2013-5-5). + * configs/pirelli_dpl10/nsh_highram: Converted to use the + kconfig-frontends tools (2013-5-5). + * drivers/lcd/mio283qt2.c: LCD was not being selected in setpower + method (also not being deselected in hwinitialize function) + (2013-5-6). + * arch/arm/src/kl/kl_gpio.c and .h, configs/freedom-kl25z/src/freedom-kl25z.h, + and configs/freedom-kl25z/src/kl_led.c: Fixes LEDs on the Freedom KL25Z + board (2013-5-6). + * arch/arm/src/kinetis/kinetis_pin.c and arch/arm/src/kinetis/kinetis.h: + The Kinetis GPIO logic had some of the same issues as did the + Kinetis L (2013-5-6). + * arch/arm/src/stm32/stm32_idle.c: Add an option to conditionally disable + the "wfi" sleep mode. This is needed with certain JTAG debuggers to + to prevent the debug session from begin disconnected. From Ken Pettit + (2013-5-7). + * configs/mikroe-stm32f4/fulldemo/, nx/, nxlines/, nxtext/: Add more + configurations for the Mikroelektronika Multimedia STM32-M4 board. + From Ken Pettit (2013-5-7). + * configs/mikroe-stm32f4/src/up_mio283qt2.c and other files: Integrate the + MIO283QT2 display on the Mikroelektronika Multimedia STM32-M4 board. + From Ken Pettit (2013-5-7). + * arch/arm/src/lpc17xx/lpc17_i2c.c: Fix for lpc17xx i2c single byte read + timeout error problem from M.Kannan (2013-5-8). + * arch/arm/src/stm32/stm32_adc.c: Typo in F2/F4 specific logic: ACD_ + instead of ADC_. From Ken Pettit (2014-5-8). + * configs/olimex-lpc1766stk/tools: Tweaks to support OpenOCD-0.70 + (2013-5-10). + * configs/mikroe-stm32f4: Changes to get the Mikroelektronika MultiMedia + STM32 F4 touchsceen working. From Ken Pettit (2013-5-11). + * configs/*/nxwm: Default priorities for NxWidget and NxWM threads + should be 100, not 50, to be consistent with other default priorities. + * configs/hymini-stm32v/buttons, nsh, and nsh2: Configurations converted + to use the kconfig-frontends tools (Laurent Latil, 2013-5-14) + * configs/hymini-stm32v/src: Converted to use the common SSD1289 driver + (Laurent Latil, 2013-5-14) + * configs/hymini-stm32v/ostest and usbnsh: Add OS test and USB/NSH + configurations (Laurent Latil, 2013-5-14). + * configs/hymini-stm32v/src/up_nsh.c: Add support for the card detect + (CD) interrupt (Laurent Latil, 2013-5-14). + * configs/hymini-stm32v/src/nx and nxlines: Removed these configurations + (Laurent Latil, 2013-5-14). + * arch/arm/src/stm32/chip/stm32f10xx_dma.h: Fix some bad DMA register + definitions. From Laurent Latil (2013-5-15). + * configs/hymini-stm32v: Enable SDIO in nsh2 configuration; remove + warning from src/up_ssd1289.c. From Laurent Latil (2013-5-15). + * configs/hymini-stm32v/src/up_r61505u.c: Support for the R65105- + based LCD that comes with some HY-Mini STM32v board. From Christian + Faure (2013-5-16). + * syscall/syscall_lookup.h: Missing underscore character in SYS_onexit. + Reported by Ken Pettit (2013-5-17). + * nuttx/syscall/syscall.csv: Type of first parameter of on_exit() is + wrong. Reported by Ken Pettit (2013-5-17). + * configs/mikroe-stm32f4/kernel/, kostest/ and scripts/: Add kernel build + support and kernel mode OS test example for the MikroElektronkia + MultiMedia STM32 M4 board. From Ken Pettit (2013-5-17). + * arch/arm/include/stm32/chip.h and arch/arm/src/stme32/chip/stm32l15xxx_pinmap.h: + Beginning of support for the STM32L15X family (2013-5-18). + * arch/arm/include/stm32/stm32l15xxx_irq.h and arch/arm/src/stm32/chip/stm32l15xxx_vectors.h: + Support for STM32L15X interrupt vectors (2013-5-18). + * arch/arm/src/stm32/chip/stm32l15xxx_gpio.h and related STM32 GPIO files: + Add GPIO support for the STM32L215X (2013-5-18). + * arch/arm/src/stm32/chip/stm32l15xxx_memorymap.h: STM32L215X memory map + (2013-5-18). + * arch/arm/src/stm32/chip/stm32_pwr.h, stm32fl15xxx_rcc.h, and stm32l15xxx_syscfg.h: + More updates for the STM32L152 (2013-5-19). + * configs/stm32ldiscovey: Configuration for the STM32L-Discovery board. + Still does not build on initial check-in (2013-5-19) + * STM32L15X: Add DMA and UART start. Correctly initialize the heap + (2013-5-19). + * arch/arm/src/stm32/stm32l15xxx_rcc.c chip/stm32_flash.h: Add RCC PLL + and FLASH configuration logic for the STM32L152X (2013-5-19). + * include/nuttx/usb/audio.h: Typo- and bug-fixes from Ken Pettit + (2013-5-19) + * audio/, drivers/audio, include/nuttx/audio.h: Add a new audio subsystem + and VS1053 driver to NuttX. Contributed by Ken Pettit (2013-5-19). + * configs/miroe-stm32f4/: Add audio logic to NSH configuration. From Ken + Petty (2013-5-19). + * nuttx/arch/arm/src/lm/chip/lm_flash.h and nuttx/arch/arm/src/lm/lm_flash.c: + Add support for TI/Stellaris internal FLASH MTD driver. From Max + Holtzberg (2013-5-20). + * arm/src/stm32/chip/stm32l15xxx_vectors.h: After correcting errors in the + vector definition file, the STM32L-Discovery NSH port now seems to be + fully functional. Also fixed an error that was causing the LEDs to be + controlled incorrectly (2013-5-21). + * arch/arm/src/stm32/chip/stm32_lcd.h: Add definitions for STM32L15X + segment LCD (2013-5-21). + * configs/lm3s6965-ek/discover: Add an example configuration for UDP + discovery tool on the lm3s6965-ek board. From Max Holtzberg + (2013-5-21). + * audio/, drivers/audio, include/nuttx/audio: Added a callback interface + to the Audio upperhalf driver for dequeueing, reporting async events, + etc. Also included is some initial work for the VS1053 driver. From + Ken Pettit (2013-5-21). + * include/nuttx/audio/audio.h: Moved from include/nuttx/ to include/nuttx/audio. + (2013-5-21). + * configs/lm3s6965-ek/tcpecho: This configuration builds the simple TCP + echo example based on W.Richard Steven UNIX Programming book to ensure + correct usage of the socket API. Contributed by Max Holtzberg (2013-5-22). + * configs/stm32ldiscovery/src/stm32_lcd.c: Framework for support of the + STM32L-Discovery's segment LCD (2013-5-22). + * fs/fs_poll.c: Poll setup/teardown logic should ignore invalid (i.e., + negative) file descriptors. Max Holtzberg (2013-5-23). + * net/net_poll.c: When readahead data is available, the network poll + logic should set POLLIN (or POLLRDNORM), not POLLOUT. Max Holtzberg + (2013-5-23) + * fs/fs_poll.c: Actually, it should also set revents == 0. (2013-5-23). + * libc/misc/lib_slcdencode.c and lib_slcddecode.c: Add logic to marshal + and serialize special SLCD intermixed with normal ASCII data (2013-5-23) + * configs/stm32ldiscovery/src/stm32_lcd.c: STM32L-Discovery's segment LCD + is code complete but completely untested (2013-5-23). + * include/nuttx/fs/ioctl.h, include/nuttx/lcd/slcd_codec.h, and + configs/stm32ldiscovery/src/stm32_lcd.c: Add SLCD ioctl commands to get + SLCD geometry, set bars, and manage contrast (2013-5-23). + * configs/stm32ldiscovery/src/stm32_usb.c: This file and all references + to USB removed for the STM32L-Discovery. While the chip supports a + USB device, the board does not (2013-5-24). + * arch/arm/src/stm32/stm32_lse.c: Add support for the STM32L CSR register + and for the LSE LCD clock source (2013-5-24). + * The STM32L-Discovery segment LCD is now functional and the README file + includes instructions for adding the apps/examples/slcd segment LCD + test as an NSH "built-in" command (2013-5-24). + * configs/pcblogic-pic32mx: Converted all configurations to use the + kconfig-frontends tool (2013-5-25). + * configs/pcblogic-pic32mx/src: Renamed files using pic32mx_ vs up_ + prefix. Enable building of LCD1602 LCD (2013-5-25). + * configs/pcblogic-pic32mx/src/pic32mx_lcd1602.c: Now uses SLCD CODEC + (2013-5-25) + * configs/stm32ldiscovery/src/stm32_lcd.c: Now supports ioctl to get + cursor position (2013-5-25). + * include/nuttx/lcd/slcd_ioctl.h: Moved ioctls commands and structures + from slcd_codec.h (2013-5-25) + * libc/misc/lib_slcdencode.c and lib_slcddecode.c: Several encoding + and decoding bug fixes (2013-5-26) + * configs/sure-pic32mx: Converted all configurations to use the + kconfig-frontends tools, cleaned up the directory structure and + naming to match some of the more recent configurations, and added + a segment LCD driver for the board. The initial checkin of the + LCD driver is just a clone of configs/pcblogic-pic32mx/src/pic32mx_lcd1602 + and it not yet expected to be functional (2013-5-26). + * include/nuttx/lcd/slcd_ioctl.h and all SLCD drivers: Rename geometry + structure to attributes; Move MAX contrast to attributes. Add + attribute and ioctl commands to get and set LCD brightness (2013-5-27). + * configs/sure-pic32mx/pic32mx_lcd1602.c: This driver appears to + fully functional (at least to the extent that it has been tested) + (2013-5-27). + * arch/mips/src/pic32mx/pic32mx-usbdev.c: Fix NULL packet handling in + the PIC32 USB device driver. Without this fix the CDC/ACM driver + cannot be used reliably with the PIC32 USB. With this change the + configs/sure-pic32mx/usbnsh configuration works great (2013-5-28). + * configs/sure-pic32mx/src/pic32mx_nsh.c: The NSH configurations will + support the USB monitor applications (2013-5-28). + nuttx/arch/arm/include/stm32/chip.h, src/stm32/Kconfig, src/stm32/chip.h, + and src/stm32/chip/stm32f103c_pinmap.h: STM32F103C4 and F103C8 chip + support from Laurent Latil (2013-5-28) + * configs/stm32_tiny: Add support for the STM32 Tiny development board + based on the STM32 F103C8T6 MCU (2013-5-28). + * arch/arm/src/stm32/stm32_usbdev.c: Fix an error in NULL packet + handling: If the NULL-packet needed flag ever gets set, then + it is not cleared and inifinite NULL packets result. This only + effects the CDC/ACM class and was the cause of the failure of + configs/stm32f3discovery/usbnsh configuration which works great + after this change (2013-5-29). + * drivers/usbdev/cdcacm.c and pl2303.c and include/nuttx/usb/cdcacm.h: + Change the default IN request buffer size from 64 to 96. This will + avoid requests of exactly MAXPACKET size and, hence, avoid so many + NULL packets. Also, fix the OUT request buffers size to exactly + the max packet size. It cannot be any other size (2013-5-29). + * .gitignore: Clean-up of most all .gitignore files: Make scope of + ignore to be only the current directory; Ignore .dSYM files in + directories where .exe's may be build. Also, in Makefiles, + clean .dSYM files in directories where .exe may be built (2013-5-30). + * drivers/wireless/nrf24101.c/.h and include/nuttx/wireless/nrf24101.h: + Add new driver for the wireless nRF24L01+ transceiver. From Laurent + Latil (2013-6-1). + * drivers/wireless/cc1101: Move files in the cc1101 up one directory. + From Laurent Latil (2013-6-1). + * configs/stm32_tiny: Fix nRF24L01+ driver integration for the STM32 + Tiny. From Laurent Latil (2013-6-01). + * configs/sam3u-ek: All remaining configurations changed to use + the kconfig-frontends tools (2013-6-2). + * arch/arm/src/sam3u/chip: All SAM3U register definition files moved + to this subdirectory. Naming of registers changed from SAM3U_ to + just SAM_. This is in preparation for a SAM4L port (2013-6-2). + * arch/arm/src/sam3u: Renamed files to sam_* vs. sam3u_*. + Eliminated sam3u_internal.h; instead uses individual header + files for each SAM interface block (2013-6-2). + * arch/arm/src/stm32/stm32f20xxx_rcc.c and stm32f40xxx_rcc.c, and + configs/mikroe-stm32f4/src/up_clockconfig.c. Correct some bad + conditional compilation (CONFIG_ missing from setting name). This + affects some STM32 FLASH pre-fetch settings. From Lorenz Meier + (2013-6-2). + * arch/arm/include/sam34 and arch/arm/src/sam34: The old sam3u/ + directories were renamed sam34/ to make room in the namespace for + the SAM4L (2013-6-2). + * libc/stdio/lib_dprintd.c and lib_vdprintf.c: Add dprintf() and + vdprintf() (the latter from Andrew Tridgell, 2013-6-2). + * sched/sem_holder.c: Modify assertion that is reported to cause + false alarm assertions (2013-6-2). + * arch/arm/include/sam34/sam4l_irq.h and + arch/arm/src/sam34/chip/sam4l_memorymap.h: Add interrupt and memory + map definitions for the AT91SAM4L (2013-6-3). + * arch/arm/src/sam34/chip/sam4l_vectors.h and arm/src/sam34/sam_vectors.S: + Add interrupt vector support for the SAM4L family (2013-6-3). + * arch/include/sam34/chip.h: Add chip definitions for the SAM4L + family (2013-6-3). + * configs/sam4l-xplained: A partial configuration that will (eventually) + support the SAM4L Xplained Pro developement board (2013-6-3). + * arch/arm/src/sam34/chip/sam4l_pinmap.h: Initial cut as SAM4L + pin mapping (2013-6-3). + * arch/arm/src/stm32/stm32*_dma.*: Add a new interface function, + stm32_dmacapable() that can be used to determine if DMA is + possible from the specified memory address. From Petteri Aimonen + (2013-6-4). + * arch/arm/src/stm32/stm32_spi.c: If CONFIG_STM32_DMACAPABLE is + defined, use stm32_dmacapable() to determine if it is possible + to perform DMA from the specified address. This change is + important for the STM32 F4 which may have SPI data buffers + allocated on the stack in CCM memory which cannot support the + DMA. From Petteri Aimonen (2013-6-4). + * nuttx/arch/arm/src/sam34/sam4l_gpio.h: Created GPIO driver + header file for the SAM4L. Also renamed the SAM3U header + file to sam3u_gpio.h (2013-6-4). + * nuttx/arch/arm/src/sam34/sam4l_gpio.c: Created GPIO driver for + the SAM4L (2013-6-4). + * nuttx/configs/sam4l-xplained/src/sam_userleds.c: Added. + (2013-6-4). + * configs/sam4l-xplained/src/sam_userleds.c: Add application + LED interfaces (2013-6-5). + * arch/arm/src/sam34/sam4l_gpio.c and arch/arm/src/sam34/chip/sam4l_gpio.h: + Fix GPIO port address; fix compilation errors (2013-6-5). + * arch/arm/src/sam34/chip/sam4l_flashcalw.h: Add header file + for SAM4L FLASH and PICOCACHE definitions (2013-6-5). + * arch/arm/src/sam34/chip/sam4l_pm.h: Add header file for SAM4L + Power Management. Leveraged from AVR32 (2013-6-5). + * arch/arm/src/sam34/sarm4l_clockconfig.c: SAM4L clock configuration + logic (leveraged from AVR32). + * nuttx/arch/arm/src/sam34/sam4l_periphclks.c/h: Add common + logic to enabled/disable SAM4L peripheral clocking (2013-6-5). + * nuttx/arch/arm/src/sam34/chip/sam4l_bpm.h and sam4l_scif.h: Add + register definitions for the SAM4L BMP and SCIF blocks (2013-6-6). + * nuttx/arch/arm/src/sam34/sam4l_clockconfig.c: Now selects an + optimal power scaling mode (2013-6-6). + * nuttx/arch/arm/src/stm32/stm32_serial.c and nuttx/include/termios.h: + Change for hardware flow control support for STM32. It also fixes + incorrect operation of USART2 and UART5 in current master. Submitted + by Lorenz Meier but includes changes by Mike Smith (2013-6-6). + * nuttx/arch/arm/src/stm32/stm32_otgfshost.c: A backward conditional + prevent detection of disonnection events. Reported by Scott (2013-6-6). + * nuttx/arch/arm/src/sam34/chip/sam4l_bscif.h: Add registers definitions + for the SAM4L BSCIF module (2013-6-6). + * nuttx/arch/arm/src/sam34/sam4l_clockconfig.c and chip/sam4l_wdt.h: + Finally finished the SAM4L clock configuration logic; Added a + WDT register definition header file (2013-6-8). + * nuttx/arch/arm/src/sam34/chip/sam4l_usart.h and sam4l_picouart.h: + Add UART/USART register definition files for the SAM4L (2013-6-8). + * arm/src/sam34/chip/sam3u_periphclks.h: More macros and definitions + to generalize peripheral clocking and to hide differences between + the SAM3U and the SAM4L (2013-6-8). + * configs/sam4l-xplained/ostest: The SAM4L now passed the OS test + (2013-6-9). + * configs/sam4l-xplained/nsh: Added an NSH configuration for the + SAM4L Xplained Pro board (2013-6-9). + * configs/sam4l-xplained/src/sam_cxxinitialize.c: Added C++ support + to the SAM4L Xplained Pro board configuration (2013-6-9). + * arm/src/sam34/chip/sam_irq.c: Extend IRQ support to handle the + larger number of NVIC interrupts used by the SAM4L (2013-6-9). + * arch/arm/src/sam45/chip: Beginning updates of SAM3U header files + to include support for the SAM4S: WDT, SUPC, EEFC, MATRIX, PMC, + UARTs, USARTs, HSMCI, SPI (2013-6-10). + * arch/arm/src/chip/sam4s_memorymap.h, sam4s_irq.h, and sam4s_vectors.h: + Add SAM4S memory map and interrupt definitions (2013-6-10) + * configs/sam4s-xplained: Add framework for the SAM4S Xplained board. + There is not much there on initial checkin (2013-6-10). + * arch/arm/src/sam34: SAM3S support: GPIO, chip characteristics, + peripheral Kconfig (2013-6-11). + * arch/arm/src/sam34/chip/sam4s_pinmap.h: Add SAM4S pin configuration + definitions (2013-6-11). + * arch/arm/src/sam34/sam4s_periphclks.h: Add macros to manage SAM4S + peripheral clocks (2013-6-11). + * configs/sam4s-xplained: Configuration builds error-free (2013-6-11). + * configs/sam4s-xplained/nsh: Added an NSH configuration for the + SAM4S Xplained board. Both the OS test and the NSH configurations + no execute error-free. Delay loops calibrated for both the SAM4L + and SAM4S boards (2013-6-12). + * Standardize on CONFIG_NSH_BUILTIN_APPS. Remove all other variants + of the build-as-an-NSH-application configuration settings + (2013-6-12). + * arch/arm/src/sam34/sam_periphclks.h: A header file that just + includes the right header file. This cleans up the messy logic + in all of the C files and puts the mess in one place (2013-6-12). + * arch/arm/src/arm*/Toolchain.mk, Kconfig (and lots of configuration + files): Add support for a generic Windows EABI toolchain (2013-6-13). + +6.29 2013-07-31 Gregory Nutt + + * arch/arm/src/sam34/chip/sam4l_pinmap.h: Change naming of some pin + configurations to match names used with other SAM part (2013-6-15). + * arch/arm/src/sam34/sam4l_clockconfig.c: Corrected some typos + (2013-6-15). + * configs/sam4l-xplained/src/sam_buttons.c: Eliminate a warning + (2013-6-15). + * configs/sam4l-xplained/src/sam_mmcsd.c, sam_nsh.c, sam_spi.c, + sam3u-ek.h, Kconfig, Makefile, sam4l-xplained.h, + configs/sam4l-xplained/README.txt, and + configs/sam4l-xplained/include/board.h: Add support for the SPI- + based SD card on the I/O1 module (2013-6-15). + * arch/arm/src/sam34/sam_spi.c: Re-architect the SAM3/4 SPI driver + so that is it compatible with the SPI drivers of other MCUs + (2013-6-16). + * configs/sam3u-ek/src/up_touchscreen.c and configs/sam4l-xplained/src/sam_mmcsd.c: + Changed needed because of the above change to the SAM3/4 SPI + interface (2013-6-16). + * drivers/input/ads7843e.c: Remove the wait for the touchscreen busy + bit. I don't see the busy bit changing on the SAM3U-EK board. But + maybe it is not supposed to. From my reading of the ADS7843 spec, it + would not be appropriate to wait for the BUSY bit to de-asserted + anyway (since it is only de-asserted when we read the data) + (2013-6-16). + * configs/sam3u-ek/src/up_touchscreen.c: Fix polarity of the /PENIRQ + signal (it is active low) (2013-6-16). + * configs/sam3u-ek/include/board.h: The SAM3U-EK board now runs at + 96MHz. This might have broken some things? (2013-6-17). + * drivers/mmcsd/mmcsd-spi.c: Driver need to make sure that the SPI mode + and data width are correct (2013-6-17). + * arch/arm/src/kinetis/kinetis_tsi.h: Corrections to the Kinetis + (2013-6-18) + * arch/arm/src/sam34/sam_spi.c: Fix SPI mode setting. In the SAM3/4 + family, the clock phase control (CPHA) is inverted (NPHA) (2013-6-18). + * arch/arm/src/kl/chip/kl_tsi.h: Freescale KL25Z TSI register + definitions from Alan Carvalho de Assis (2013-6-18). + * configs/freedom-kl25z/src/kl_tsi.c: Example TSI driver for the + Freedom KL25Z board from Alan Carvalho de Assis (2013-6-18). + * arch/arm/src/sam34/sam_spi.c: Correct an incorrect pointer test. + Was checking if the wrong pointer was NULL (2013-6-18). + * arch/arm/src/kl/kl_spi.c and chip/kl_spi.h: Add SPI driver and + register definitions for the Freescale KL25Z (2013-6-19). + * arm/src/sam34/chip/sam4l_lcdca.h: Register definition file for + the SAM4L LCD peripheral (2013-6-19). + * arm/src/sam34/chip/sam_spi.h: SPI register definition file updated + to include a few differences for the SAM4L (2013-6-19) + * arm/src/sam34/chip/sam4l_pdca.h: Add SAM4L PDCA register definition + file; also renamed sam_dmac.* files to sam3u_dmac.* to identify + them as SAM4U/4S only files (2013-6-19). + * configs/freedom-lk25z/src/kl_spi.c: Add the framework for + controlling SPI-related discrete inputs and outputs. Taken from + work by Alan Carvalho de Assis (2013-6-20). + * arch/arm/src/kl/kl_dumpgpio.c: Now compiles (2013-6-20). + * configs/: Several defconfig files were changed that had + CONFIG_HAVE_CXXINITIALIZE=y. Because of recent changes to + apps/examples, these configurations may need to have + CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y so that they behave as they did + before, i.e., so that C++ initializers will be called when NSH starts + up (2013-6-21). + * configs/sam4l-xplained/src/sam_slcd.c: Beginning of a driver for the + LED1 segment LCD module. This driver is incomplete on initial check- + in (2013-6-21). + * drivers/net/enc28j60.c: Change buffer ordering to work around Errata + #5. From Dave (ziggurat29, 2013-6-22). + * configs/sam4l-xplained/src/sam_slcd.c: LED1 segment LCD module is now + functional (2013-6-23). + * drivers/lcd/ssd1306.c and include/nuttx/lcd/ssd1306.h. Renamed + ug-2864hsweg01.c and .h to ssd1306.c and .h. Extended to support the + UG-2832HSWEG04 which is very similar and also based on the SSD1306 + controller (2013-6-23). + * configs/sam4l-xplained/src/sam_ug2832hsweg04.c: Add support for the + UG-2832HSWEG04 OLED on the SAM4L Xplained Pro's OLED1 module + (2013-6-23). + * include/debug.h: Added macro DEBUGPANIC for forces crashes when debug + is enabled. + * drivers/lcd/ssd1306.c: Driver now appears to be function for the + UG-2832HSWEG04 in landscape mode (2013-6-24). + * drivers/lcd/ug-2864ambag01.c and ug-9664hswag01.c: Add/updated + support for reverse portrait mode from lessons learned with the + UG-2832HSWEG04. Untested changes! (2013-6-24). + * arch/arm/src/stm32/stm32_ccm.c and .h: Add support for a seperate CCM + heap. This may be useful for segregating allocations for CCM (which + cannot be used for DMA) from other allocations (that may be used used + for DMA) (2013-6-25). + * arch/arm/src/sam32/sam3u_gpio.h: Correct configuration of PIO pins + for SAM4S B and C peripherals (2013-6-26) + * configs/sam4s-xplained/src/sam_sram.c: Added support for on-board + 1MB SRAM (2013-6-26). + * arch/arm/include/sam34/chip.h and sam3x_irq.h: Add support for + SAM3X and SAM3A chips (2013-6-26). + * arch/arm/src/sam34/chip/sam3x_vectors.h: Add support for SAM3X/3A + interrupt vectors (2013-6-26). + * arch/arm/src/sam34/sam3x_periphclks.h: Add peripheral clock + controls for the SAM3X/3A (2013-6-26). + * arch/arm/src/sam34/chip/sam3x_memorymap.h: Add SAM3X/3A memory map + (2013-6-26). + * arch/arm/src/sam34/chip/sam3x_pinmap.h: Add SAM3X/3A pin + multi-plexing definitions (2013-6-26). + * arch/arm/src/sam34/sam3x_gpio.h: Add SAM3X/3A gpio encoding + macros. These differ from the SAM3U only in because of the + 6 PIOs: PIOA-PIOF (2013-6-26). + * configs/arduino-due: This is an empty directory now with only + a README file in it but this directory will eventually hold a port + for the Arduino Due (2013-6-26). + * arch/arm/src/sam34/Kconfig: Add SAM3X/3A peripherals to the SAM3/4 + configuration logic (2013-6-26). + * arch/arm/src and include/ and configs/sam*/: Large rename of all + references to SPI with SPI0. This is because all other SAMs have + only SPI but the 3X/3A have SPI0 and SPI1 (2013-6-26). + * configs/arduino-due: Complete the basic board configuration and + integrate this into the configuration and build system. The Arduino + Due is now ready to begin test (2013-6-17). + * configs/arduino-due/nsh: Add an NSH configuration for the Arduino + Due. Both the OS test and NSH configuration are now functional + (2013-6-28). + * configs/arduino-due/src: Add support for the "L" LED (2013-6-28). + * arch/arm/src/sam34/sam_allocateheap.c: Clocking must be applied + to the SMC module for the 3X and 3A family in order for the NFC + SRAM to be functional (2013-6-28). + * arch/arm/src/sam34/sam3u_gpio.c: Need to disable write + protection before configuring PIO pins. + * configs/sam3u-ek/nsh: The touchscreen is now functional. The above + fix to the sam3u_gpio.c write protection also fixed the touchscreen + problem (2013-6-28). + * confgis/sam3u_ek/nxwm: Created a configuration for the NxWM + window manager for the SAM3U-EK board (2013-6-29). + * drivers/spi and include/nuttx/spi: New sub-directories to hold + SPI-related files. includes/nuttx/spi.h moved to include/nuttx/spi/.; + SPI-related Kconfig info moved from drivers/Kconfig to drivers/spi/kconfig + (2013-7-1). + * drivers/spi/spi_bitbang.c and include/nuttx/spi/spi_bitbang.h: Add + support for a generic bit-bang SPI driver. This checkout is the + common upper-half logic. Still missing the lower half (2013-7-1). + * include/nuttx/spi/spi_bitbang.c: This is the common lower-half bit- + bang SPI logic (2013-7-1). + * configs/arduino-due/src/sam_nsh.c and sam_mmcsd.c: Add NSH customize + initialization. If so configured, initialize the SPI bit bang + interface to the MMC/SD slot on the ITEAD shield (2013-7-1). + * fs/fs_mount.c: Fix compilation error if no file systems are enabled: + Change error to ERROR (2013-7-3). + * arch/arm/src/sam34/sam_gpioirq.c: Fix some errors for interrupts + on ports D-F (2013-7-3). + * /drivers/usbdev/composite.c: Fix a typo in the composite device + driver unitialization logic. DEV1 should be DEV2 in one case + (2013-7-4). + * arch/arm/src/sam34/sam3u_gpio.c: sam_configgpio() must protect + against re-entrancy (2013-7-5). + * libc/misc/lib_crc16.c and include/crc16.h: Add CRC16 support + (2013-7-7). + * arch/arm/src/stm32/stm32_otgfsdev.c: SourceForge bug #16: Fix + to the endpoint allocation logic. Apparently the same endpoint can + be allocated as both an IN or an OUT endpoint. The existing + implementation only supported one allocation, either IN or OUT. This + resulted in failures to allocate endpoints when used with the CDC/ACM + + MSC composite driver (From Chia Cheng Tsao, 2013-7-8). + * arch/arm/src/stm32/stm32_sdio.c: SourceForge bug #17: Add + support for the data block end (DBCKEND) interrupt to terminate + transfers (From Chia Cheng Tsao, 2013-7-8) + * drivers/rwbuffer.c: SourceForge bug #17: Correct typos that can cause + failures in some configurations (From Chia Cheng Tsao, 2013-7-8). + * include/nuttx/usb/usbdev.h: Fix some typos that cause compiler errors + when CONFIG_USBDEV_DMA and CONFIG_USBDEV_DMAMEMORY are selected (From + Chia Cheng Tsao, 2013-7-12). + * nuttx/configs/olimex-lpc1766stk/zmodem: Add a new configuration to + test the Zmodem sz and rz commands (which don't actually exist yet, + but will). (2013-7-12). + * arch/arm/include/armv7-a and src/armv7-a: Beginning to add support + for the ARMv7-A, the Cortex-A5 in particular. The initial checkin + is only fragmentary: A few header files and some copied ARM9 + assembly files. More to come (2013-7-18). + * arch/arm/include/sama5, arch/arm/src/sama5, and configs/sama5d3x-e: + Add a directory framework to support the Atmel AT91SAMA5D3 family and + the SAMA5D3x-EK board(s) in particular. There is very little here on + the first check-in, this structure is being used now primarily to + create the Cortex-A5 support (2013-7-19). + * arch/arm/src/armv7-a/arm_cache.S: Cortex-A5 cache operations + (2013-7-20). + * /arch/arm/src/armv7-a/arm_fpuconfig.S and fpu.h: A few more files for + the ARMv7-A/Cortex-A5 port (2013-7-21). + * arch/arm/src/sama5/sam_boot.c, sam_clockconfig.h, sam_lowputc.h, and + sam_timerisr.c: A few more files for the SAMA5D3 port (2013-7-21). + * configs/sama5d3x-ek/src/sam_autoleds.c: A few more files for the port + to the SAMA5D3x-EK board (2013-7-21). + * arch/arm/src/sama5/sam_irq.c: SAMA5 interrupt handling logic + (2013-7-22). + * arch/arm/src/sama5/sam_clockconfig.c: Add SAMA5 PLL configuration + logic (plus associated header files). Initiali checkin is for the + SAM3U which is very similar but needs to be verified (2013-7-22). + * arch/arm/src/sama5/sam_periphclks.h: Add macros to enable and + disable SAMA5 peripheral clocks (2013-7-22). + * arch/arm/src/sama5/sam_lowputc.c and sam_serial.c: Add support + for SAMA5 UARTs. Does not even compile as of initial checkin. + (2013-7-22). + * arch/arm/src/sama5/sam_gpio.c: Add GPIO configuration support + for the SAMA5. Still compilation issues. (2013-7-22). + * arch/arm/src/sama5/chip/sama5d3x_pinmap.h: Add pin multiplexing + definitions for the SAMA5D3 (2013-7-23). + * arch/arm/src/sama5/chip/: New header files for SAMA5 AXI Matrix + SFR, and BSC blocks (2013-7-23). + * arch/arm/src/armv7-a/arm_vectors.S: Force 8-byte stack alignment + in interrupt handlers before calling C code. Other ARM + architectures need to do this as well (2013-7-23). + * arm/src/armv7-m/up_copyarmstate.c and armv7-a/up_copyarmstate.c: + Added a new form of the register copy function that should save quit a + bit of time for armv7-m (without common vectors) and with armv7-a + (2013-7-23). + * arch/arm/src/armv7-a/arm_restorefpu.S, arm_savefpu.S, arm_doirq.c, + arm_fullcontextrestore.S, arm_saveusercontext.S: Add hardware + floating point register save/restore logic for the Cortex-A5 + (2013-7-23). + * arch/Kconfig: Attempt at generic external memory configuration is not + flexible enough, especially for the SAMA5. Move external memory + configuration options from arch/Kconfig to + arch/arm/src/lpc17xx/Kconfig, lpc31xx/Kconfig, sam34/Kconfig, and + sama5/Kconfig and renamed each from CONFIG_ARCH_ to, for example, + CONFIG_LPC31_. This renaming also affect many defconfig files + (2013-7-24). + * arch/arm/src/sama5/Kconfig and sam_allocateheap.c: Set up + configuration options for SAMA5 external memory regions; add a custom + sam_allocateheap.c to add the various configured memory regions to the + heap (2013-7-24). + * configs/sama5d3x-ek/src/sam_buttons.c, sam_userleds.c, and + sam_autoleds.c: Add support for the buttons and LEDs on-board the + SAMA5D3x-EK (2013-7-24). + * configs/sama5d3x-ek/ostest/defconfig: Switch console to USART1 + (2013-7-4). + * arch/arm/src/sam34/Kconfig and drivers/serial/Kconfig: All serial + configuration logic for USARTs needs to depend on if the USART is + configured as a UART or not. And this is for all CPUS, not just + SAM3/4 (2013-7-24). + * arch/arm/src/arm/up_head.S and arch/arm/src/armv7-a/arm_head.S: + Fix a bug (uninitialized register error) that crept in the ARM9 + boot-up code several years ago and was cloned into the Cortex-A5 + code. Obviously no one has used the ARM9 NuttX port for years! + * Many files: Finally... I changed the naming of configuration + variables like CONFIG_DRAM_ to CONFIG_RAM_. This has bothered + me for a long time since most boards don't have DRAM. The more + generic RAM naming should not produce so much cognitive dissonance + (2013-7-26). + * configs/sama5d3x-ek/hello: Added a tiny hello world configuration + to simplify bring up of the SAMA5 (it will probably be removed + later) (2013-7-26). + * The sama5d3x-ek/hello now runs correctly (2013-7-28). + * configs/sama5d3x-ek/ostest/: This configuration has been modified + to run out NOR flash. More work is still needed to reconfigure the + SMC so that the NOR flash can work with the high clock (2013-7-28). + * arch/arm/src/sama5/sam_clockconfig.c/h and + configs/sama5d3x-ek/src/sam_norflash.c: Add a file structure that + will (eventually) support reconfiguration of NOR flash when NuttX + boots from NOR FLASH (2013-7-29). + * arch/arm/src/sama5/chip/sam_hsmc/h: SAMA5 HSMC register + definition file (2013-7-29) + * configs/sama5d3x-ek/src/sam_norflash.c: Add board specific + logic to re-configure the SAMA5D3x-EK NOR FLASH before while + running out of NOR FLASH. We need to change the NOR FLASH + timing BEFORE increasing the main clock (2013-7-29). + * configs/sama5d3-ek/norboot and src/nor_main.c: The norboot + configuration to help debug NuttX in NOR flash. It runs + out of ISRAM, configures NOR FLASH, then waits for you to + break in with a debugger to start the program in NOR FLASH + (2013-7-29). + * arch/arm/src/armv7-a/arm_cache.S: Separate the bigger cache + operations into separater files (2013-7-29). + * arch/arm/src/stm32/stm32_dac.c: Fixed numerous DAC driver + errors and added support for DAC DMA (contributed by John + Wharington, 2013-7-30). + * arch/arm/src/stm32/stm32f30xx_i2c.c: An I2C driver for + the STM32 F3 family from John Wharington (2013-7-30). + * arch/arm/include/armv7-m: Add irqdisable() (2013-7-30); + * configs/sama5d3-ek/src/nor_main.c: Now disables interrupts + before jumping to NOR flash (2013-7-30). + * configs/sama5d3-ek/nsh: Add an NSH configuration for the + SAMA5D3x-EK (2013-7-31) + * configs/sama5d3-ek/src/sam_cxxinitialize.c: Add C++ support + (2013-7-31). + +6.30 2013-09-14 Gregory Nutt + + * arch/arm/src/sama5/arm_pghead.S: Separate the logic that is + enabled by CONFIG_PAGING out of arm_head.S. That was just + too much conditional compilation to be supportable + (2013-8-1). + * arch/arm/src/sama5/arm_head.S: Setup page table mappings for + all of .text, .bss, .data, stacks and heap before enabling + the MMU and caching. This is safer because it avoids the + caching issues (and much less redundant) (2013-8-1) + * arch/arm/src/sama5/chip/sam_mpddrc.h: Add DDR controller + registers definitions for the SAMA5 (2013-8-1). + * nuttx/configs/sama5d3x-ek/src/sam_sdram.c: Add logic which + will (eventually) support the SDRAM on the SAMA5D3x-EK + board. Initial commit is untested and incomplete (2013-8-1). + * arch/arm/src/armv7-a/arm_mmu.c: Move some generic MMU logic + out of SAMA5-specific code into this share-able file (2013-8-2) + * arch/arm/src/armv7-a/mmu.h: Add inline functions to invalidate + a single TLB. + * arch/arm/src/sama5/sam_allocateheap.c and chip/sama5d3x_memorymap.h: + Add logic to handle signed overflow when a memory region is + greater than or equal to 2GB (2013-8-2). + * arch/arm/src/sama5/sam_boot.c: Boot logic now initially + configures DRAM as strongly ordered so that it can be initialized. + After initialization, the page table entries are modified so + that DRAM is fully cache-able (2016-8-2). + * arch/arm/src/sama5/chip/sam_mpddrc.h: Correct typos in the + SAMA5 DDR controller register definitions (2013-8-2). + * arch/arm/src/sama5/sam_irq.c: Correct handling of spurious + interrupts (2013-8-3). + * arch/*/src/*/*_irq.c: Standardize configuration variables used + to enable interrupt controller debug output (2013-8-3). + * arch/arm/src/sama5/chip/sam_dmac.h: Add register definitions for the + SAMA5 DMA controller (2013-8-3). + * arch/arm/src/sama5/sam_dmac.c and sam_dmac.h: Add support for the + SAMA5 DMAC controllers. Initial check-in is untested and is a + straight leverage from the SAM3/4 (2013-8-4). + * arch/arm/src/sama5/sam_spi.c, sam_spi.h, and chip/sam_spi.h: + Leverage SPI support from SAM/3/4. Initial check-in is untested + and have several limitations: No DMA, no SPI1 support (2013-8-4). + * arch/arm/src/sama5/sam_spi.c and sam_spi.h: Now supports SPI1 + and a register access debug option (2013-8-4). + * configs/sama5d3x-ek/src/sam_spi.c: Add board support for the + AT25 serial flash (2013-8-4). + * configs/sama5d3x-ek/nsh/defconfig: FAT file system support is + now enabled by default (2013-8-5) + * configs/sama5d3x-ek/src/sam_nsh.c: Automatically mount AT25 + file system for NSH if so configured (2013-8-5). + * configs/sama5d3x-ek/src/sam_nsh.c: Verified that the AT25 FLASH + works on the SAMA5D3x-EK boards and can support a FAT file system + (2013-8-5). + * arch/arm/src/sam34/sam_spi.c: Corrected an error in the SAM3/4 + SPI driver while testing the SAMA5 SPI driver: If CONFIG_SPI_OWNBUS + is not set, the driver will not configure the SPI mode correctly + (2013-8-5). + * configs/sama5d3x-ek/src/sam_at25.c: Move AT25 initialization logic + out of sam_nsh.c and into a separate file where it can be better + shared (2013-8-5). + * arch/arm/src/sama5/sam_hsmci.c, sam_hsmci.h, and chip.sam_hsmci.h: + Add register definitions and a driver for the (3) HSMCI memory card + interfaces provided by the SAMA5. Leveraged from the SAM3/4 and + untested on initial commit (2013-8-5). + * nuttx/configs/sama5d3x-ek/src/sam_hsmci.c and sam_nsh.c: Add support + for the (2) SD card slots provided on the SAMA5D3x-EK boards. + Untested on initial commit (2013-8-5). + * arch/arm/src/sama5 and nuttx/configs/sama5d3x-ek: Massive renaming + to get consistent once and for in the usage of PIO vs GPIO. Other + platforms use the term GPIO more, but Atmel prefers PIO. I prefer + consistency. Also fixed CONFIG_PIO vs CONFIG_SAMA5_PIO and renamed + files sam_gpio.* to sam_pio.* (2013-8-6). + * arch/arm/src/sama5/sam_pioirq.c: Add support for SAMA5 PIO interrupts + (2013-8-6). + * configs/sama5d3x-ek/src/sam_hsmci.c: Add support for SD slot card + detection PIO interrupts (2013-8-6). + * arch/arm/src/sam34/sam_hsmci.c and sama5/sam_hsmci.c: Fix handling + of some masked status conditions that can cause false-alarm errors + (2013-8-6). + * arch/arm/src/sama5/sam_dmac.c and sam34/sam34_dmac.c: For SAMA5, + correct some bad register address and some bad assertions that caused + false alarms. These latter were backported to the SAM34 DMAC driver + as well (2013-8-6). + * arch/arm/src/sama5/sam_dmac.c and sam34/sam34_dmac.c: Correct + some parameters reversed in function call (2013-8-6). + * arch/arm/src/sama5/sam_spi.c: The SAMA5 SPI driver now supports + DMA transfers (2013-8-9). + * arch/arm/src/sama5/sam_dmac.c: Finally after many bugfixes (the + last being caching issues), the SAMA5 DMA support has been + verified (with SPI) (2013-8-9). + * arch/arm/src/sama5/sam_memories.c and .h: Centralize logic for + conversions between physical and virtual addresses (2013-8-9). + * arch/arm/src/sama5/sam_hsmci.c and sam34/sam_hsmci.c: Correct a + race condition in the SAMA5 HSCMI driver: The transfer done + interrupt was firing before the wait was started. Fix this and + also backported the changes to SAM3/4 (untested). Now HSCMI is + functional on the SAMA5 with DMA! (2013-8-10). + * arch/arm/src/sam34/sam3u_periphclks.h: Correct a typo in a register + name (2013-8-10). + * drivers/mmcsd/mmcsd_sdio.c: Correction for a bad return value + when multiple block SDIO transfers are suppressed. By Andrew Tridgell + via Lorenz Meier (2013-8-10). + * drivers/serial/serial.c, drivers/usbdev/cdcacm.c, and + include/nuttx/fs/ioctl.h: Added support for FIONREAD and FIONWRITE, + added TERMIOS input / output processing support for UART and CDCACM + serial ports. Implemented by Mike Smith, Andrew Tridgell and Lorenz + Meier (2013-8-10). + * drivers/usbdev/cdcacm.c: Added FIONREAD and FIONWRITE to CDC/ACM + driver based on serial.c implementation. From Lorenz Meier + (2013-8-10). + * arch/arm/src/stm32/Kconfig and stm32_serial.c: Added option to + disable serial port reordering. From Lorenz Meier (2013-8-10). + * arch/arm/src/sama5/Kconfig, sam_ohci.c, and + arch/arm/src/sama5/sam_clockconfig.c: Add a OHCI driver for the SAMA5. + Untested on initial check-in (2013-8-11). + * include/nuttx/usb/usbhost.h, arch/arm/src/stm32, arch/arm/src/lpc17xx, + and include/nuttx/usb/usbhost.h, and nuttx/configs/: + Move prototype of usbhost_initialize() of usbhost.h and into + architecture specific files. This is necessary because some chips + (like the SAMA5) have multiple, different USB host interfaces + (2013-8-11). + * drivers/usbhost/usbhost_hidkbd.c and usbhost_storage.c: Correct some + compilation errors when pre-allocated class structures are used. Also + eliminate some warnings about uninitialized variables (2013-8-11). + * configs/sama5d3x-ek/src/sam_usb.c and related files: Add support for + initialization of the USB host and mass storage class device (2013-8-11). + * arch/arm/src/sama5/sam_ohci.c and sam_usbhost.h (was sam_ohci.h), and + configs/sama5d3x-ek/src/sam_usb.c, and sama5d3x-ek.h: Add controls + to enable VBUS power in OHCI host most (2013-8-12). + * includes/nuttx/usb/usbhost.h, all USB host drivers in arch/, and all + USB host-side connection monitoring threads in configs/*/src: The + SAMA5 has three downstream ports; all of the other USB host + implementations have only one. This will require significant changes + to the USB host interfaces starting with these chnages to monitor + connections on a port-by-port basis. This effects a lot of files and + more changes are coming for this issues. Changes are being blindly + incorporated into other architrectures. I am being careful to avoid + breakage, but I expect some (2013-8-12). + * configs/olimex-stm32-p107/nsh/defconfig and appconfig: Converted to + use the kconfig-frontends tool. From Max Holtzberg (2013-8-12). + * includes/nuttx/usb/usbhost.h, et al: Continued changes to the USB + host interface to support multiple downstream ports. When a class + is disconnected, it needs to provide the FunctionAddress to the + USB HCD disconnect method so that the HCD will know which port + is being disconnected (2013-8-12). + * nuttx/arch/arm/src/stm32/Kconfig, Make.defs, and /stm32f30xxx_i2c.c: + STM32 F3 I2C fixes from John Wharington (2013-8-13). + * nuttx/arch/arm/src/sama5/sam_serial.c: Fix a re-entrancy problem + in up_putc(). I think all architectures have this re-entrancy + than can result in serial interrupt being disabled, but I have only + seen the symptom on SAMA5 (2013-8-13). + * includes/nuttx/usb/usbhost.h and many other affected files: Separate + wait() and enumerate() methods from struct usbhost_driver_s and move + to new interface, struct usbhost_connection_s. This is part of the + necessary restructuring of the USB host interface to support multiple + root hub ports (2013-8-13). + * arch/arm/src/sama5/sam_ohci.c: Major restructuring of the driver due + in order to handle multiple root hub ports. Basically instead of one + driver structure with an arrayof root hub port structures, there is no + one container structure with an array of driver structures, one for + each root hub port. The advantage is that each class->driver call not + passes information associated with the RHport implicitly. The klugey, + procedural alternative was to add the function address to every + interface method (which I started to do but backed above) (2013-8-13). + * arch/arm/src/sama5/sam_memories.c and .h: Extended logic so do + conversions from physical to virtual addresses (2013-8-14). + * arch/arm/src/sama5/sam_ohci.c: Add D cache contols and conversion + between physical and virtual address (2013-8-14). + * arch/arm/src/stm32/stm32_spi.c: nbits() interface extended to + control bit order as well as bit width (from Teemu Pirinen) + (2013-8-16) + * arch/arm/src/sama5/sam_ohci.c: More to be tested, but the SAMA5 + OHCI driver is now basically funtional (2013-8-16). + * include/nuttx/usb/ehci.h: EHCI header file (2013-8-17). + * arch/arm/src/stm32/stm32_i2c.c: Correct an error that crept into + the STM32 F1 I2C driver with some recent changes. From Yiran Liao + (2013-8-18). + * drivers/usbhost/usbhost_devaddr.c and include/nuttx/usb/usbhost_devaddr.h: + Add logic for management of device addresses. This logic does not + currently hook into into anything. It will someday be a part of the + NuttX USB hub implementation (2013-8-18). + * nuttx/arch/arm/src/sama5/sam_ehci.c and other files: Create a skeleton + environment for development of an EHCI driver. Not much in place yet + (2013-8-20). + * nuttx/arch/arm/src/sama5/sam_ehci.c: Now code complete for all + asynchronous endpoints (control and bulk); nothing yet in place + for periodic endponts (interrupt and isochronous) (2013-8-22). + * include/nuttx/serial/serial.h and arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h: + SourceForge bug #16 Fix IO pin map. Add CONFIG_SERIAL_TERMIOS support. + Also fixes some STM32 F4 Timer 8 pin configurations. From CCTSAO + (2013-8-23). + * arch/arm/src/lpc17xx/lpc17_usbhost.h: Fix #endif with missing #if + condition. Reported by Andrew Bradford (2013-8-23). + * nuttx/arch/arm/src/sama5/sam_ehci.c: Now handles low- and full-speed + connections by giving the port to the OHCI driver (2013-8-24). + * nuttx/arch/arm/src/sama5/sam_ohci.c: Now uses the work queue to + defer interrupt processing (2013-8-24). + * nuttx/arch/arm/src/sama5/sam_ohci.c and nuttx/arch/arm/src/sama5/sam_ehci.c: + EHCI is now the common interrupt "master." It will receive all UHPHS + interrupts and route the interrupt event to both the OHCI and EHCI + logic (2013-8-24). + * net/uip/uip_arp.c: Correct backward condition in netmask task. + From Max Holtzberg (2013-8-25). + * arch/arm/src/sama5/sam_ohci.c: SAMA5 OHCI is again functional by + itself after all of the changes to integrate with EHCI. (2013-8-25). + * drivers/net/encx24j600.c/.h and include/nuttx/net/encx24j600.h: + Support the Microchip ENCX24J600 Ethernet driver from Max Holtzberg + (2013-8-25). + * configs/olimex-stm32-p107: Incorporate ENCX24J600 support for the + Olimex STM32 P107 board. From Max Holtzberg (2013-8-25). + * fs/romfs/fs_romfsutil.c: Fix an error where long (>15) file names + were read incorrectly from a ROMFS file system. From Mike Smith + (2013-8-25). + * arch/arm/src/stm32/stm32_sdio.c: SourceForge bug #17 Fix if + CONFIG_SDIO_BLOCKSETUP defined, OS will crash". Generate an error + if CONFIG_SDIO_BLOCKSETUP is defined; that option is not yet supported + by the STM32 SDIO driver. From CCTSAO (2013-6-26) + * drivers/net/encx24j600.c and .h: Use the ENC's SRAM for multiple TX + packets. From Max Holtzberg (2013-6-26). + * include/nuttx/usb/usbhost.h, drivers/usbhost/usbhost_enumerate.c, and + all USB host drivers: Added a new driver method: getdevinfo. This + method is intended to get various information about the connected device, + but currently returns only the device speed. The device speed is + necessary by usbhost_enumerate in order to set a credible initial EP0 + max packetsize. High speed needs 64 bytes, low speed needs 8 bytes, + and full speed can handle almost any size (2013-8-26). + * arch/arm: Add hooks for Cortex-A8. Not much more yet (2013-8-27). + * Lots of files: Fix all occurrents of "the the" in documentation and + comments (2013-8-27). + * arch/arm/src/sama5/sam_allocateheap.c: Correct the logic that + determines which memory regions get added to the heap. When + CONFIG_MM_NREGIONS > 1, the logic was adding the ISRAM region to + the heap twice! (2013-6-27). + * nuttx/arch/arm/src/sama5/sam_ehci.c: Add (untested) support for + interrupt endpoints (2013-8-28). + * arch/arm/src/sama5/chip/sam_udphs.h: High-speed USB device register + definitions for the SAMA5 (2013-8-28) + * arch/arm/src/sama5/sam-udphs.c: A framework for the USB device + driver taken from another architecture. There is very little + useful in this initial check-in (2013-8-29). + * Remove all empty and most useless README.txt files (2013-8-31) + * configs/freedom-kl25z/src/kl_spi.c: Correct typo in name of a + function. From Alan Carvalho de Assis (2013-8-31). + * drivers/usbdev/cdcacm_desc.c: Fixed some compilation errors that + only occur when dual speed support is enabled (2013-9-1). + * arch/arm/src/sama5/sam_clockconfig.c and configs/sama5d3x-ek/include/board_*mhz.h: + Add logic to support UDPHS clocking (2013-9-13). + * arm/src/stm32/chip/stm32_tim.h: Some CCER bit settings changed + per SourceForge bug #18 submitted by CCCTSAO (2013-9-2). + * apps/examples/cc3000, configs/freedom-kl25z, drivers/wireless/cc3000, + and nuttx/include/nuttx/cc3000. Initial support for the TI CC3000 + network module on the Freescale Freedom-KL25Z board from Alan Carvalho + de Assis. This is still very much a work in progress (2013-9-3). + * configs/*/usbmsc: Renamed from config/*/usbstorage to match the + change in naming in apps/examples submitted by CCTSAO (2013-9-5). + * drivers/usbdev/cdcacm.c and pl2303.c: Don't use max packetsize assigned + to the endpoint when allocating request buffers; The default value of + the endpoint max packetsize may be incorrect because the endpoint + has not yet been configured. Verified on CDC/ACM. Corresponding + changes made to pl2303, but untested (2013-9-5). + * arch/arm/src/sama5/sam_udphs.c: The high-speed device side driver + is now functional (although more testing is always needed) (2013-9-5). + * net/net_monitor.c: Fixes a race condition where a loss of connection + may not be detected when the connection is lost before it has been + accepted (from Max Holtzberg) (2013-9-6). + * configs/sama5d3x-ek/demo: Add a new NSH configuration. The + original NSH configuration will be a simple platform for testing + individual features; the demo configuration will be a more complex + platform for demonstrating multiple interacting features (2013-9-6). + * net/uip/uip_tcpbacklog.c: Fix a major bug in the TCP/IP backlog + initialization: Only the first backlog buffer was getting added + to the free list. From Max Holtzberg (2013-9-6). + * configs/sama5d3x-ek/demo: Add support for USB MSC device on the + AT25 serial FLASH (untested) (2013-9-6). + * drivers/net/enc28j60.c: Changes back-ported from the ENCX24J600 + to the ENC28J60 by Max Holtzberg. These seem like reasonable and + correct changes, but have yet to be verified on an ENC28J60 (2013-9-6). + * drivers/usbdev/usbdev_strings.c: Extended decoding and stringifying + of USB trace output to include trace output from class drivers. + (2013-9-6). + * drivers/usbdev/usbmsc_desc.c: Fix a warning when USB MSC is + compiled for a high-speed device (2013-9-7). + * drivers/usbhost/usbhost_storage.c: If device is returning fatal + transfer errors while attempt to initialize, don't bother with + the startup retries; abort immediately so that the device will + be reset and we can try again (2013-9-9). + * drivers/usbhost/usbhost_storage.c: Correct a reference counting + error: When an MSC device transfer fails while waiting for + UnitTestReady (see 2013-9-9), the reference count was not being + decremented. The end result is a memory leak (2013-9-10). + * arch/arm/src/sama5/chip/sam_twi.h: Added SAMA5 TWI register + definition file (2013-9-11). + * arch/arm/src/sama5/sam_twi.c and .h: Framework for a SAMA5 + TWI driver (not much present in initial checkin) (2013-9-11). + * fs/nxffs: Clean up some compilation warnings (2013-9-12) + * drivers/mtd/at24xx.c: Add support for the AT 24C512 part + (2013-9-12). + * arch/arm/src/sama5/sama5_twi.c: Clean up some errors that + only occur with CONFIG_DEBUG_I2C (2013-9-12). + * arch/arm/src/sama5/chip/sam_emac.h and sam_gmac.h: Register + definition files for the SAMA5 EMAC and GMAC peripherals + (incomplete on the initial commit) (2013-9-12). + * arch/arm/src/stm32/stm32_can.c: Make filter register accessible + for CAN1 and CAN2. Patch provided by Lorenz Meier (2013-9-13). + * nuttx/include/nuttx/usb/cdcacm.h: Fix backward conditional + compilation in the CDC/ACM driver with regard to remote + wakeup and self-powered capabilites. Provided by Lorenz Meier + (2013-9-13) + * fs/romfs/fs_romfsutil.c: Fix for filenames > 15 characters. + Provided by Lorenz Meier (2013-9-13). + * arch/arm/src/stm32/Kconfig: Fix STM32 UART7/8 kconfig names + and UART DMA. Provided by Lorenz Meier (2013-9-13). + * configs/maple: Board configuration for the LeafLabs Maple + and Maple Mini boards. From Librae (2013-9-13). + * arch/arm/src/sama5/sam_emac.c and .h: Skeleton files for + a SAMA5 EMAC driver. Not much in the initial files; these + are just hacked out and gutted versions of the corresponding + STM32 files (2013-9-13). + +6.31 2013-10-28 Gregory Nutt + + * nuttx/fs/romfs/fs_romfsutil.c: Back out part of a recent + ROMFS change (2013-9-14). + * configs/sama5d3x-ek/src/sam_ethernet.c: Add support for + PHY interrupts (2013-9-15). + * arch/arm/src/kl/chip/kl_pit.h and kp_tpm.h: Add register + definitions for the Freescale Kinetis KL25Z from Alan + Carvalho de Assis (2013-9-15). + * configs/ and a few Ethernet drivers: Add the prefix ETH0 + to all PHY configuration selections. This will allow us + to support to Ethernet MAC drivers with two different + PHYs (identified with ETH0 and ETH1) (2013-9-17). + * net/Kconfig and drivers/net/Kconfig: Move PHY selections from + net/Kconfig to drivers/net/Kconfig where they belong. Add the previx + ETH0_ to each PHY selection. And a new configuration + CONFIG_NETDEV_MULTINIC that can be set to enable support for multiple + Ethernet MAC drivers (not fully implemented yet). When Enabled, + another set of PHY selections are enabled for ETH1_ (2013-9-17). + * include/nuttx/net/mii.h: Add definitions for the Micrel KSZ8051 PHY + (2013-9-17). + * configs/zkit-arm-1768: MMC/SD is on SPI, not SSP0. From Rashid + Fatah (2013-9-17). + * configs/: Lots of defconfig files changes. A consequence of the + above renaming and moving of the PHY configuration settings is + that the you now also have to set CONFIG_NETDEVICES=y if you + need to set a PHY configuration (2013-9-17). + * arch/arm/src/lpc17xx/lpc17_spi.c: Remove undefined spi_select() + prototype. This was causing compile time warnings (2013-9-17). + * configs/sama5d3x-ek/src/sam_ostest.c: Add OS test support for + the FPU test (2013-9-18). + * arch/arm/src/sama5/sam_usbhost.h and include/nuttx/usb/usbhost_trace.h + Correct some inconsistencies in the way that USB configuration + settings are used. This caused compilation errors in SAMA5 OHCI + when USB debug was ON but USB host tracing was off (2013-9-19). + * nuttx/arch/arm/src/sama5/sam_clockconfig.c: When 480MHz UPLL + is used to drive OHCI, it should have a divider of 10. However, + that does not work. A divider of 5 does. Why? (2013-9-19). + * Several USB device driver files: Change naming of SELFPOWERED + and REMOTEWAKEUP to avoid name collisions. Prepend the name + of the driver (for example CDCACM_SELFPOWERED) (201309-20). + * configs/sama5d3x-ek/nsh and demo: Increase the number of pre-allocated + watchdog timers. The default number of 4 was easily being exhausted + in the more complex configurations. Enable the task name feature + to provide prettier ps command output. src/sam_usb.c: Use more + descriptive task names when starting the EHCI and OHCI monitor tasks + (2013-9-20). + * arch/arm/src/sama5/sam_ohci.c: Fix a place where DMA-related data + needed to be flushed to data cache; Fix another where a virtual address + was being used in a register where a physical address was required + (2013-9-20). + * arch/arm/src/armv7-a/cp15_clean_dcache.S and cp15_flush_dcache.S: + fix an error in the alignment of addresses to cache line boundaries + (2013-9-21). + * drivers/usbdev/cdcacm_desc.c: Change the interval for the interrupt + endpoint from 0xff (invalid) to 10. This is not a critical change + but will avoid a complaint from the Linux driver when it overrides + the 0xff value (2013-9-22). + * configs/zkit-arm-1769: LED1 is now user controllable after booting. + From Rashid Fatah (2013-9-23). + * arch/arm/src/sama5/sam_hsmci.c: TX DMA disabled. It is just not + reliable. No idea why. RX DMA is still used (2013-9-23). + * driver/net/encx24j600.c: UDP/RXAVAIL backlog support from Max + Holtzberg (2013-9-24). + * Standardized stack checking logic so the interfaces can be used + by common stack monitoring logic (2013-9-24). + * drivers/net/Kconfig: Move CONFIG_NET_DUMPPACKET out of LPC17 + and STM32 Kconfigs into the common network driver Kconfig (2013-9-25). + * arch/arm/src/sam_emac.c: EMAC driver is basically functional. More + testing is needed (as always) (2013-9-25). + * configs: Changes to many defconfig files resulting from moving + apps/examples/usbmsc to apps/system/usbmsc (2013-9-25). + * configs: Changes to many defconfig files resulting from moving + apps/examples/cdcacm to apps/system/cdcacm (2013-9-25). + * configs: Changes to many defconfig files resulting from moving + apps/examples/composite to apps/system/composite (2013-9-25). + * configs/stm3210e-eval/composite: Converted to use the kconfig- + frontends tool (2013-9-25). + * arch/arm/src/sama5/sam_gmac.c: Initial GMAC driver is really + just the EMAC driver forced to compile with the GMAC register + definitions (2013-9-26). + * arch/arm/src/sama5/sam_gmac.c and include/nuttx/net/gmii.h: + Beginning of support for GMII/RGMII PHY support (2013-9-26) + * net/netdev_txnotify.c: Look up of device using subnet will fail + if the packet is being sent out of our subnet (via a router). + The fallback here is just to use "eth0" if the subnet lookup + fails. This will, of course, will have to be revisited if/when + multiple NICs are supported. From Max Holtzberg (2013-9-27). + * net/send.c: Fix some backward conditional logic in check + to see if we should check if the ARP address in the table. From + Max Holtzberg (2013-9-27). + * drivers/net/encx24j600.c: Removed logic that polls for the + next outgoing packet from the TX done interrupt handling. From + Max Holtzberg (2013-9-27) + * sched/os_start.c: Should not call group_setupidlefiles() if there + are no file descriptors (and, hence, no file system) (2013-9-27). + * arch/arm/src/sama5/sam_gmac.c: GMAC driver and GMII logic is + code complete and ready for test (2013-9-27) + * configs/compal_e86: Basic board support for the Motorola C139 + (Compal E86) phone. From Craig Comstock (2013-9-27). + * configs/compal_e86: Converted to use the kconfig-frontends + tools (2013-9-27). + * drivers/net/encx24j500.c: Use separate pools for RX and TX + descriptors. From Max Holtzberg (2013-9-28). + * nuttx/fs/fs_sendfile.c, nuttx/net/net_sendfile.c, and other file: + Integrate an optimized sendfile() operation from Max Holtzberg + (2013-9-28). + * tools/mkdeps.*, nuttx/mm/Makefile, nuttx/libc/Makefile: Dependency + generation generation was broken for directories that keep objects in + a sub-directory. Fixed by adding a object path to the mkdeps.c, + mkdeps.bat, mkdeps.sh tools (2013-0-29). + * arch/arm/src/sama5/chip/sam_adc.h: ADC register definition file. + Incomplete on initial check-in (2013-9-29). + * arch/arm/src/sama5/sam_adc.c and .h: Framework for an ADC + driver to come (just empty "skeleton" files on initial commit) + (2013-9-30). + * arch/arm/src/sama5/sam_touchscreen.h and .h: Framework for a + touchscreen driver (also an empty "skeleton" file on the initial + commit) (2013-9-30). + * arch/arm/src/kl/kl_lowgetc.c and .h: First cut at low-level + getc() function for operation with no file system (and, hence, + no serial driver) (from Alan Carvalho de Assis, 2013-9-30). + * configs/freedom-kl25z/minnsh: A new configuration that is + an experiement to see how small we can get the NuttX footprint. + From Alan Carvalho de Assis. (2013-9-30). + * net/net_sendfile: The high performance sendfile logic is + now functional. From Max Holtzberg (2013-9-30). + * tools/define.sh: 'cut' no longer works as it once did. Script + adapted to observed behavior (2013-9-30). + * include/nuttx/net/route.h and net/net_*route.c: Partial + implementation of a routing table. Not yet hooked into the + build system (2013-10-1) + * include/net/route.h: Defines the application interface to + the routing table (2013-10-2). + * configs/spark: Add configuration for the Spark Core. The + initial check-in is basically the Maple Mini board (2013-10-2). + * include/net/route.h and libc/net/lib_addroute.c and delroute.c: + Add an application interface to manage the routing table + (2013-10-2). + * arch/arm/src/sama5/sam_adc.c and sam_tsc.c: The SAMA5 + touschscreen drive is basically functional) (2013-10-3) + * arch/arm/src/sama5/chip/sam_lcdc.h: Add SAMA5 LCD register + definition header file (2013-10-4). + * net/netdev_findbyaddr.c: Now (1) uses the routing table + if available to look up the router to get to a remote network, + and (2) if there is only a single network device and no + route, then it will simply return that single device. The + ARP logic will use the default router address associated with + the interface in this case (2013-10-5). + * net/netdev_router.c and net/uip/uip-arp.c: When the target IP address + does not lie on the device's networker when we have a routing table, + looking the correct router IP address to use in the ARP request. + In that case, we want the MAC address of the router, not of the + target endpoint (2013-10-5). + * net/netdev_rxnotify.c and others: Use the new signature of rxnotify + caused by the routing table. From Max Holtzberg (2013-10-6). + * arch/arm/src/sama5/sam_lcdc.c and .h: Empty "skeleton" file that + will eventually become an LCDC driver for the SAMA5 (2013-10-6). + * net/net_close.c, net/uip/uip_tcpcon, and include/nuttx/net/uip/uip-tcp.h: + Make net_close() nonblocking and free unestablished connections if no + free connections available. From Max Holtzberg (2013-10-6). + * net/net_close.c and other: Update of change of 2013-10-6 from + Max Holtzberg (2013-10-8). + * arch/arm/src/sama5/sam_lcd.c: LCDC driver is code complete and + incorporated into the build system (but still untested (2013-10-8). + * configs/sama5d3x-ek/nx: Add an examples/nx configuration that + will be used for the SAMA5 LCD bring-up (2013-10-8). + * configs/arduino-due/Kconfig and include/board.h: Add configuration + to select revision 3 of the Arduino Due which has some small + but important differences. Suggested by gdi@embedders.org. + * arch/arm/src/sama5/sam_allocateheap.c, Kconfig, chip/sama5d3_memorymap.h: + Add support so that subsets of the total DRAM (and other external + memory) can be added to the heap, leaving other memory reserved for + other purposes (like LCDC framebuffers) (2013-10-10). + * arch/arm/src/sama5/sam_lcd.c: Change how DMA descriptors are + allocated. My reading of the SAMA5 MATRIX is that the LCDC will + be unable to DMA from internal SRAM (2012-10-10). + * arch/arm/src/sama5/Kconfig and configs/sama5d3x-ek/nx/defconfig: The + default LCD resolution is now RGB565. Added output resolution selection + which can be different from the software resolution (2013-10-10. + * arch/arm/src/sama5/sam_lcd.c wait before modifying register if the LCDC + is re-synchronizing (SIF). Use start-up configuration settings from + Barebox. They still don't work (2013-10-10). + * net/net_monitor.c: Notify the socket layer if a connection is lost + before the monitoring callback has been registered. From Max + Holtzberg (2013-10-11). + * net/recvfrom.c, sendto.c, uip/uip_input.c, uip/uip_udpcallback.c, + uip/uip_udpconn.c, uip/uip_udpinput.c: Changed the meaning of the + uip_*input functions. They now return success when a packet is + dropped; This is needed for the ENCX24J600 driver that must make + a decision to return the packet or not: It should not retry + dropped packets. From Max Holtzberg (2013-10-11). + * drivers/net/encx24j600.c and Kconfig: ENCX24J600: Improved descriptor + handling, free packets on rx abort interrupt. From Max Holtzberg + (2013-10-11). + * arch/arm/src/sama4/sam_lcd.c and configs/sama5d3x-ek/include/board.h: + Fix PWM precealler divider. This eliminiates the backlight flicker + (2013-10-11). + * arch/arm/src/sama5/sam_boot.c: Correct how framebuffer memory was + being mapped. The mapping was getting overrwritten and the + framebuffer memory was ending up cacheable (2013-10-13). + * arch/arm/src/sama5/Kconfig, sam_lcdc.c, defconfig, and related files: + Remove options for obtaining framebuffer memory in other ways. That + option just really cannot work (2013-10-13). + * configs/sama5d3x-ek/nxwm: Add NxWM configuration for SAMA5D3x-EK + (2013-10-13). + * configs/sama5d3x-ek/nxwm/defconfig: Now uses scaled icons in the + the NxWM taskbar (2013-10-15). + * configs/sama5d3x-ek/nxwm/defconfig: Use the 320x320 NuttX logo as + the NxWM background (2013-10-15). + * arch/arm/src/stm32/chip/stm32f103c_pinmap.h: Pinmapping corrections + from David Sidrane (2013-10-16). + * configs/spark: The Spark device configuration is receiving some + TLC from David Sidrane (2013-10-16). + * drivers/mtd/sst25.c: Add support for the SST25VF016B. From David + Sidrane (2013-10-16). + * net/net_close.c: Changed net_close debug output to verbose. From + Max Holtzberg (2013-10-17). + * net/send.c and net_sendfile.c: Reset the send timeout when the + data is ACKed, not when the data is sent. Remove conditions on + checking for timeout. From Max Holtzberg (2013-10-17). + * net/net_sendfile.c: Correct parameter passed to netdev_txnotify() + from Max Holtzberg (2013-10-17). + * include/nuttx/net/uip/uip-tcp.h, net/send.c, uip/uip_tcpconn.c, and + uip/uip_tcpinput.c: Change how the initial minimum MSS is calculated. + Max Holtzberg (2013-10-17). + * net/uip/uip_tcpinput.c: Move tcp connection into SYN_RCVD state + after aception instead of bypassing and moving directly into ESTABLISHED. + From Max Holtzberg (2013-10-17). + * net/net_sendfile.c: Let the ACK callback handle the REXMIT flag and + don't return until all data has been ACK'd. From Max Holtzberg + (2013-10-17). + * arch/arm/src/stm32/chip/stm32f40xxx_dma.h: Typo fixes for UART7 and + UART8 DMA configs. From Mike Smith (2013-10-18). + * arch/arm/src/stm32/Kconfig: DMA priority corrections from Mike Smith + (2013-10-18). + * arch/arm/src/stm32/stm32*_dma.c, stm32_sdio.c, and stm32_dma.h: + Changes to the stm32_dmacapable API. In order to correctly verify that + a buffer can be transferred, the transfer count and the CCR value are + required. Implemented stm32_dmacapable for stm32f1xx devices. Enhanced + stm32_dmacapable for stm32f2xx and stm32f4xx devices to check for + additional conditions that will cause DMA to fail or lose data (2013-10-18). + * include/nuttx/sdio.h: Add a preflight method to the SDIO interface. + From Mike Smith (2013-10-18). + * drivers/mmcsd/mmscd_sdio.c: Enhanced the mmcdd_sdio driver to perform + DMA preflight operations and fail DMA read/write requests that fail + preflighting. From Mike Smith (2013-10-18). + * fs/fat/fs_fat32.c: Enhanced the FAT32 filesystem code to understand DMA + preflight failures, and to use the file sector buffer as a bounce buffer + when a user-supplied buffer is not suitable for DMA. From Mike Smith + (2013-10-18). + * arch/arm/src/sama5/chip/sam_rtc.h and sam_wdt.h: Add WDT and RTC + register definition header files (2013-10-18). + * arch/arm/src/sama5/chip/sam_rtc.c and sam_rtc.h: Basic RTC driver. + Support for RTC alarms is fragmentary and this has not yet been hooked + into the build system (2013-10-18). + * Various Spark and CC3000 files: Update by David Sidrane (2013-10-18). + * arch/arm/src/sama5/chip/sam_gpbr.h: Add SAMA5 GPBR register + definitions (2013-10-19). + * Kconfig: Add support for CONFIG_DEBUG_RTC (2013-10-19). + * configs/sama5d3x-ek/README.txt, demo/defconfig: Describe how to + enable RTC support for the nsh/ configuration; RTC is now enabled by + default in the demo configuration (2013-10-19). + * arch/arm/src/sama5/sam_rtc.h and other files: Hook the SAMA5 RTC + driver into the build system; Verify the correct operation of the + SAMA5 RTC driver (2013-10-19). + * arch/arm/src/sama5/sam_wdt.c and .h: Add a SAMA5 watchdog timer + driver. Untested on initial check-in (2013-10-19). + * arch/arm/src/sama5/sam_trng.c, sam_trng.h, and chip/sam_trng.h: Add + a /dev/random driver based on the SAMA5D3 TRNG peripheral (2013-10-20). + * configs/sama5d3x-3k/demo: The TRNG and /dev/random are now enabled + by default in the demo configuration (2013-10-20). + * arch/arm/src/sama5/chip/sam_tc.h: SAMA5D3 timer/counter register + definition header file (2013-10-20). + * libc/stdio/lib_sscanf.c: scanf() fixes from kfrolov: 1) sscanf() + function hangs in the following example: sscanf("2", "%u,%u,%u,%u", ...), + 2) sscanf() returns incorrect number of parsed numbers if some arguments + can't be parsed: sscanf("=2", "%u,%u,%u,%u",...)==1 instead of 0, and + 3) using of char* instead of const char* in vsscanf function leads to + warnings from GCC (2013-10-21). + * arch/arm/src/sama5/chip/sam_can.h: SAMA5D3X CAN register definition + header file (2013-10-21) + * arch/arm/src/sama5/sam_can.c and .h: Framework for a SAMA5 CAN driver. + Initial checkin is the STM32 CAN driver with name changes (2013-10-21). + * arch/arm/src/sama5/sam_can.c and .h: SAMA5 CAN driver is code complete + but still untested (2013-10-22). + * configs/spark: Spark configuration updated by David Sidrane (2013-10-23). + * drivers/wireless/cc3000: CC3000 driver updates from David Sidrane + (2013-10-23). + * include/nuttx/wireless/cc3000: More CC3000 driver updates from David + Sidrane (2013-10-23). + * net/Kconfig, drivers/net/wireless/cc3000/Kconfig, and Kconfig: Add + ARCH_HAVE_NET that determines if a network is present or not. This + currently can happen if CONFIG_NET is set or if CONFIG_WL_CC3000 is + is set (23013-10-23). + * arch/arm/src/stm32/stm32f10xxx_dma.c: DMA fix from David Sidrane: + The DMA_CNDTRx register cannot be modified if the DMA channel is + disabled (2013-10-23). + * arch/arm/src/sama5/sam_tc.c and .h: First cut at a timer/counter + library for the SAMA5D3 (2013-10-23). + * configs/spark/nsh/defconfig: Spark configuration update from David + Sidrane (2013-10-24). + * drivers/wireless/cc3000/cc3000.c: CC3000 driver update from David + Sidrane (2013-10-24). + * arch/arm/include/stm32/chip.h and arch/arm/src/stm32/Kconfig: + Add support for the STM32F207ZE chip. From Martin Lederhilger + (2013-10-24). + * arch/arm/src/stm32/stm32_adc.c and stm32_pwm.c: Fix some bits + that should have been cleared in a register. From Martin Lederhilger + (2013-10-24). + * configs/olimex-stm32-p207 and other files: Support for the Olimex + STM32 P207 board added by Martin Lederhilger (2013-10-24). + * arch/arm/src/sama5/sam_adc.c, sam_tc.c and sam_tc.h: Hook in the + timer/counter logic so that it can driver periodic ADC sampling + (2013-10-24). + * configs/freedom-kl25z/src/Makefile: Only build kl_wifi.c if + CONFIG_WL_CC3000 is selected. From Alan Carvalho de Assis + (2013-10-24). + * configs/sama5d3x-ek/src/sam_adc.c: Integrate support for the + apps/examples/adc into the SAMA5D3x-EK configuration (2013-10-24). + * include/nuttx/fs/ioctl.h and arch/arm/src/sama5/sam_adc.c: Add + and ioctl command that can be used to trigger ADC/DAC conversion + (2015-10-25). + * configs/spark: Spark configuration updated by David Sidrane + (2013-10-25). + * drivers/wireless/cc3000 and include/nuttx/wireless/cc3000: + CC3000 driver update from David Sidrane (2013-10-25). + * arch/arm/src/sama5/chip/sam_isi.h: Camera interface register + definitions added (2013-10-26). + * audio/ and include/nuttx/audio/audio.h: Updated audio subsystem + from Ken Pettit (2013-10-27). + * drivers/audio/ and include/nuttx/audio/vs1053.h: Updated + VS1053 driver from ken Pettit (2013-10-27). + * configs/mikroe-stm32f4/: Updated configuration for the + Mikroe STM32F4 board from Ken Pettit (2013-10-27). + * arch/arm/src/stm32/stm32_spi.c: DMA-related fixes from Ken + Pettit (2013-10-27). + * sched/sched_releasetcb.c: Fix a cornercase: If sched_releasetcb() + is called as part of a failed pthread startup before the flags + field in the TCB has been initialized, then a crash occurs. + Pointed out by David Sidrane (2013-10-27) + * arch/arm/src/sama5/sam_adc.c: ADC now works in all implemented + modes: single channel or multiple channel with sequencer support. + software trigger or timer trigger; ADC channel interrupts or + DMA (2013-10-28). + * nuttx/drivers/audio/vs1053.c and nuttx/include/nuttx/audio/audio.h: + Add logic to verify the audio sub-format. From Ken Pettit (2013-10-28). + +6.32 2013-12-07 Gregory Nutt + + * configs/spark: Spark configuration updated by David Sidrane + (2013-10-30). + * drivers/wireless/cc3000 and include/nuttx/wireless/cc3000: + CC3000 driver updates from David Sidrane (2013-10-13). + * arch/arm/src/sama5/chip/sam_ssc.h: SSC register definition + header file (2013-10-30). + * arch/arm/src/sama5/chip/sam_pwm.h: PWM register definition + header file (2013-10-31). + * drivers/mtd/mtd_partition.c: Fix erase block vs page block confusion. + From Ken Pettit (2013-10-31). + * arch/arm/src/stm32/stm32_usbdev.c: On a failure to bind the class + driver, the driver reference was being nullified too soon. This + caused an exception in usbdev_reset() later. The driver reference + will be nullified later usbdev_unregister when the caller gets the + error. From David Sidrane (2013-10-31). + * drivers/mtd/mtd_config.c and include/nuttx/configdata.h: Add a container + for an MTD device that can be used to provide a simple, lightweight + interface to configuration data storage that resides on some storage + media that is wrapped as an MTD device. From Ken Pettit (2013-11-1). + * configs/mikroe-stm32f4: Now uses /dev/config for configuration data + storage. From Ken Pettit (2013-11-1). + * arch/ stack management functions: Extension and standardization of + stack debug logic. Now includes coloration of the IDLE and interrupt + stacks as well as the heap. Suggested by David Sidrane (2013-11-1). + * configs/spark/usbmsc: Add spark USB MSC configuration. From David + Sidrane (2013-11-1). + * fs/fat/fs_fat32util.c: In one error return case, the error return + value was not being set, making the failure look like success. From + David Sidrane (2011-10-1). + * drivers/usbdev/usbmsc.c and usbmsc_scsi.c: pthread_join() does not + work if called from a different task group than the pthread. This + is correct behavior, but a problem. The correct solution would be + configure the USB MSC thread to a task, however, this workaround + from David Sidrane plugs the hole for now (2013-11-1). + * drivers/mtd/mtd_config.c: Reduce configuration header size. From + Ken Pettit (2013-11-1). + * drivers/mtd/sst25.c: Improved write performance by fixing a bug + that prevented operation in the faster write mode. The code did + not wait on the last write complete before issuing the WRDI The + loop in general failed to wait on the fist 2 bytes after the + SST25_AAI if the next 2 were FF FF, then it would reissue the + address but not cancel the write. Reorganized to always wait for + completion after and address with data write and on any data + write so that the device is complete before WRDI is sent. From + David Sidrane (2013-11-2). + * configs/sama5/src/sam_can.c: Add CAN initialization logic + and fix a data alignment problem (2013-11-3). + * drivers/mtd/mtd_config.c: Updated configuration driver from + Ken Pettit (2013-11-4). + * configs/sim/configdata: MTD configuration driver unit test for + the simulation platform. From Ken Pettit (2013-11-4). + * configs/mikroe-stm32f4/fulldemo: Configuration updated by Ken + Pettit (2013-11-4). + * arch/arm/src/stm32/stm32_usbdev.c: Correct EP0 state handling + logic when buffers larger than the EP0 packet size are sent. + Also add support for decoded USB trace strings. From David + Sidrane (2013-11-5). + * drivers/usbdev/cdcacm.c, composite.c, usbmsc.c: uninitialization + logic cause re-use of a stale pointer. Changed to a two pass + uninitialization for the case of the composite driver: Memory + resources are not freed until the second uninitialization pass. + From David Sidrane (2011-11-5). + * arch/arm/src/sama5/sam_pwm.c and .h: Add PWM driver for SAMA5 + untested on initial checkout (not even incorporated in to build + system) (2013-11-6). + * arch/arm/src/sama5/Make.defs and Kconfig: SAMA5 PWM driver now + incorporated into build and configuration system. Builds with + no errors (2013-11-6). + * configs/sama5d3x-ek: Add support for the PWM test for the + SAMA5D3x-EK board (2013-11-6). + * arch/arm/src/sama5/sam_pwm.c and .h: SAMA5 PWM driver is now + functional (2013-11-7). + * include/nuttx/audio/i2s.h: First cut at an I2S interface + definition. This initial definition is sparse will will + probably evolve significantly (2011-11-7). + * arch/arm/src/sama5/sam_ssc.c and .h: Skeleton and build setup + for a forthcoming SSC (aka I2S) driver for the SAMA5. The + initial check-in is just the SAMA5 SPI driver gutted and hacked + to use the I2S interface. More coming (2013-11-7). + * arch/arm/src/stm32 and arch/arm/include/stm32: Added support for + the STM32F429. From Ken Pettit (2013-11-7). + * configs/stm32f429i-disco: Support for the STM32F429I-Discovery + board from Ken Pettit (2013-11-7). + * arch/arm/src/stm32/stm32_usbdev.c: The long outstanding bug + involving the handling of OUT SETUP commands has been fixed in + the STM32 F1 USB device driver by David Sidrane (2013-11-7). + * configs/spark/composite/cdc-acm.inf: Windows CDC/ACM driver + provided by David Sidrane (2013-11-7). + * configs/spark/usbserial.c: Add an apps/examples/usbserial + configuration for the Spark. From David Sidran (2013-11-7). + * arch/arm/src/sama5/sam_ssc.c and .h: First cut of SAMA5 + SSC/I2S driver is code complete (2013-11-9). + * arch/arm/src/stm32 (numerous files): OTG FS device and host + drivers extended so that they can support either the OTG FS + peripheral or the OTG HS peripheral (in FS mode). This was + done as a quick way to get USB support on the STM32F429 which + has only OTG HS. From Ken Pettit (2013-11-10). + * configs/stm32f429i-disco: Add support for the usbnsh and + usbmsc configurations using the OTG HS peripheral in FS mode. + From Ken Pettit (2013-11-10) + * drivers/audio/i2schar.c: A simple character driver to support I2S + accesses. This driver in its current state is intended only to + support I2C testing and would not be appropriate to used for any real + driver application. (2013-11-10). + * arch/arm/src/kl/kl_pwm.c and .h: PWM driver for the Freescale + Kinetis KL family from Alan Carvalho de Assis (2013-11-10). + * configs/freedom-kl25z: Add PWM support. From Alan Carvalho de Assis + (2013-11-10). + * drivers/audio/vs1053: VS1053 worker thread stack size is now + configurable and assigned a name via pthread_setname_np(). From Ken + Pettit (2013-11-10). + * libc/audio/lib_buffer.c: Moved audio/buffer/c to libc/audio/lib_buffer.c. + This file was moved because it contains buffer management functions + that must be available to audio applications. If it was left in the + audio/ directory then it would not be available to applications in the + NuttX Kernel build (2013-11-10). + * arch/arm/src/sama5/sam_ssc.c and Kconfig: Add configurable support + for SSC loopback mode (2013-11-10). + * include/nuttx/audio/i2s.h, arch/arm/src/sama5/sam_ssc.c, and + drivers/audio/i2schar.c: Improved I2S interface design: Simplified + audio buffer queuing (2013-11-10). + * arch/arm/src/sam34 and arch/arm/include/sam34: Basic support for + the Atmel SAM4E family. From Mitko (2013-11-11). + * libc/audio/lib_buffer.c: Remove unused apb_prepare() function + (2013-11-11). + * arch/arm/src/stm32: Added header files and driver framework for the + STM32F429 LTDC framebuffer driver. From Ken Pettit (2013-11-11). + * configs/sama5d3x-ek/src/sam_i2schar.c: Add support for the + apps/examples/i2schar test (2011-11-11). + * arch/arm/src/sama5/sam_ssc.c: I2S loopback test finally works + (2013-11-11). + * fs/procfs: Add a little, primitive procfs file system. (2013-11-13). + * fs/binfs/README.txt: Add a README file for binfs (2013-11-13). + * arch/arm/src/stm32/Kconfig: Add missing setup of CAN TSEG1 and + TSEG2 values. From Martin Lederhilger (2013-11-14). + * arch/arm/src/sama5/sam_pck.c and .h: Add support for programmable + clock outputs (2013-11-14). + * configs/ea3131/nsh: Converted to use kconfig-frontend tools + (2013-11-14). + * arch/arm/src/lpc31: Create configuration and build support for a + forthcoming USB host controller driver (2013-11-14). + * arch/arm/src/lpc31/lpc31_ehci.c: First cut at an EHCI driver + tailed for the LPC31 (2013-11-14). + * fs/fs_mount.c: SMART FS must be included in the conditional + compilation for the set of file systems that require block + drivers. From Daniel Palmer (2013-11-15). + * tools/mkconfig.c: SMART FS must be included in the conditional + compilation for the set of writable file systems. Noted by + Daniel Palmer (2013-11-15). + * arch/arm/src/sama5/sam_nand.c and .h: Framework for an MTD driver + that will provide raw access to NAND (2013-11-15). + * configs/sama5d3x-ek/src/sam_nandflash.c: Provides board-specific + memory controller initialize for NAND flash (2013-11-15). + * include/nuttx/mtd/mtd.h: Move include/nuttx/mtd.h to + include/nuttx/mtd/mtd.h where it will, hopefully, soon be joined by + other MTD-related header files (2013-11-15). + * drivers/mtd/mtd_onfi.c and include/nuttx/mtd/onfi.h: Add shared + NAND routines for use with ONFI compatible NAND FLASH devices + (2013-11-15). + * configs/ea3131/src/up_usbhost.c: Board-specific USB host support + for the EA3131 board (2013-11-15). + * drivers/mtd/mtd_nand.c, include/nuttx/mtd/nand.h, nand_config.h, + and nand_scheme.h: Further NAND support (still incomplete). + (2013-11-16). + * drivers/mtd/mtd_modeltab.c: Further NAND support (still incomplete). + (2013-11-16). + * drivers/mtd/mtd_nandmodel.c: More NAND support (same story). + (2013-11-16). + * drivers/mtd/mtd_rawnand.c and include/nuttx/mtd/nand_raw.h: More + NAND support (2013-11-17). + * drivers/mtd/mtd_nandscheme.c: More NAND support (2013-11-17). + * include/nuttx/mtd/nand_ecc.h: More NAND (2013-11-17). + * drivers/mtd/hamming.c and mtd_nandecc.c and + include/nuttx/mtd/hamming.h: Beginning of NAND software ECC + calculations. (2013-11-18). + * configs/olimex-lpc-h3131: Add support for the Olimex LPC-H3131 + * board. Does not yet boot (2013-11-18). + * arch/arm/src/lpc31xx/lpc31_ehci.c: Add USB host trace support + (2013-11-19). + * configs/olimex-lpc-h3131/include/board.h, src/lpc31_boot.c, + lpc31_leds.c, lpc31_usbhost.c, and lpc_h3131.h: Add GPIO + support for LED1/2 and for USB power enable and overcurrent + detection (2013-11-19). + * configs/olimex-lpc-h3131/nsh/defconfig: Drop loops-per-msec + count for the Olimex-LPC-H3131. It seems to be about 25% as + fast as the Embedded Artists EA3131 at the same clocking. + (2013-11-19). + * arch/arm/src/arm/up_cache.S and cache.h: More cache management + functions (2013-11-20). + * configs/olimex-lpc-h3131/src/Makefile: Add SDRAM support. + Untested and probably needs some fine tuining (2013-11-21) + * fs/smartfs/README.txt: Add README for SMARTFS file system. From + Ken Pettit (2013-11-23) + * tools/mkctags.sh: A script for creating ctags from Ken Pettit + (2013-11-23) + * configs/sama5d3x-ek/src/sam_nand.c: Add support for "auto-mounting" + NAND MTD block driver or NXFFS file system (2013-11-25). + * include/mtd/mtd.h: Packed the geometry structure so that it can + support larger erase block sizes without increasing the size of + the geometry structure (2013-11-27). + * drivers/mtd/sst25xx.c: Add another SST25 SerialFlash driver. This + one differs from sst25.c because it supports larger SST25 parts: In + the larger parts support page write instead of byte/word writes like + the smaller parts. From Ken Pettit (2013-11-28). + * drivers/mtd/smart.c: Fixes a minor bug with SMART partition number + reporting (that would only be seen if both partition support and + multi-root directory support are enabled at the same time). From Ken + Pettit (2013-11-28). + * arch/arm/src/stm32/chip/stm32f40xxx_gpio.h: Add support for GPIOK and + GPIOJ. From Ken Pettit (2013-11-28). + * configs/stm32f429i-disco/extflash, Kconfig, include/board.h, + src/stm32f429i-disco-internal.h, up_nsh.c, and up_spi.h: Add a + configuration and board support for an external SST25 FLASH. From Ken + Pettit (2013-11-28). + * fs/fs_inode.c: The inode semaphore must be re-entrant. Here is the + re-entering path that I found: (1) USB host connects to FLASH drive + and creates /dev/sda, (2) /dev/sda is mounted, (3) FLASH drive is + removed but /dev/sda is not destroyed because there is still a + reference on the device because of the mount, (4) umount() is called, + taking the inode semaphore, now the driver tries to destroy the block + driver by calling unregister_blockdriver(). But (5) + unregister_blockdriver() also takes the inode semaphore causing a + deadlock if the inode semaphore is not re-entrant. (2013-11-28). + * configs/viewtool-stm32f107: Add board support for the ViewTool + STM32F103/F107 board with the STM32F107VCT6 installed. Initial + check-in is the unverified board-support framework only + (2013-11-30). + * configs/viewtool-stm32f107/src/stm32_buttons.c and stm32_leds.c: + Add support for LEDs an buttons on the ViewTools STM32F107 board + (2013-11-30). + * fs/nxffs/nxffs_initialize.c: First of probably several changes for + NAND FLASH. NAND can report read errors because of bad ECC. Logic + in NXFFS must account for it and not just throw in the towel every + time a read fails (2013-11-30). + * drivers/mtd/mtd_nand* and arch/arm/src/sama5/sam_nand.c: NAND + accesses now work (at least with software ECC and now DMA). Still + lots of testing to be done (2013-11-30). + * fs/nxffs/nxffs_dump.c: Do not abort on a read error. Just not + the error and continue. Otherwise, we would not be able to dump + NAND FLASH (2013-11-30). + * fs/nxffs: All read error logic has been revisited and modified in + most places. If we are using NAND, then read errors probably mean + that the block that was read contains uncorrectable bit errors. In + this case, we cannot just give up and abort the operations. Rather, + we need to treat read error like normal bad blocks in order to work + with NAND (2013-12-2). + * fs/nxffs/Kconfig and nxffs_initialize.c: Make the start up scan of + the media option. It just takes to long! (2013-12-02). + * drivers/mtd/mtd_nand.c: Fix a typo in calculation of page number + (2013-12-02). + * drivers/mtd/README.txt: New README file (2013-12-04). + * arch/arm/src/lm/lm_start.c: Don't initialize .data if not running + from FLASH (2013-12-05). + * fs/fat/fs_configfat.c: Fix a typo in the FAT16 formatting logic. + Was this ever able to format a FAT16 volume? (2013-12-05). + * drivers/mtd/mtd_nand.c: Check if block number is within range at + the top of the loop not the bottom. Otherwise, we will do a bogus + transfer with the out-of-range block before we test it (2013-12-05). + +6.33 2014-01-30 Gregory Nutt + + * arch/arm/include/a1x and src/a1x: Directory structure to support + the Allwinner A10. Not much there on the initial check-in + (2013-12-7). + * configs/pcduino-a10: Directory structure for the pcDuino board. This + board is based on the Allwinner A10 (2013-12-7). + * arch/arm/src/a1x/a1x_boot.c and chip/a1x_intc.h: More A10 logic + (2013-12-8). + * arch/arm/src/a1x/a1x_irq.c: A10 interrupt handling logic (partial) + (2013-12-8). + * drivers/video/ov2640.c: An OV2640 camera driver that will be used to + verify the SAMA5D3x-EK ISI peripheral (2013-1209). + * sama5d3x-ek/ov2640 and src/sam_ov2640.c. Board logic to test the SAMA5D3 + ISI peripheral usign the OV2640 camera (2013-12-9). + * arch/arm/src/a1x/chip/a1x_uart.h: A10 UART register definition + header file (2013-12-9). + * include/nuttx/video/fb.h: Move fb.h to include/nuttx/video/ + (2013-12-10). + * include/nuttx/video/rgbcolors.h: Move rgbcolors.h to include/nuttx/video. + (2013-12-10). + * include/nuttx/fs/smart.h: Move smart.h to include/fs/smart.h + (2013-12-10). + * include/nuttx/fs/ramdisk.h: Move ramdisk.h to include/fs/ramdisk.h + (2013-12-10). + * arch/arm/src/a1x/chip/a1x_pio.h and a10_piocfg.h: PIO register + definition header files (2013-12-10). + * arch/arm/src/a1x/a1x_pio.c and .h: Support for PIO configuration + (2013-12-11). + * libc/misc/lib_match.c: Pattern matching logic extended to handle + matches to sets of characters and ranges of character values. From + Ken Pettit (2013-12-12). + * fs/procfs, drivers/mtd, fs/smartfs, includes/nuttx/fs, .. to many + files to list: Extensive changes by Ken Pettit to extend procfs/ + functionality. Includes some incomplete changes related to + SmartFS (2013-12-12). + * configs/stm32f429i-disco: Add support for procfs/ MTD part names. + From Ken Pettit (2013-12-12) + * arch/arm/src/a1x/chip/a1x_timer.h: Timer register bit definitions + (incomplete on initial check-in) (2013-12-12). + * lbc/time/lib_strftime.c: Need null-termination on the string + generated by strftime(). From Max Holtzberg (2013-12-12). + * sched/nanosleep.c and include/time.h: Add nanosleep() (2013-12-12). + * libc/unistd/lib_sleep.c and lib_usleep.c. Move sleep() and + usleep() from sched/sleep.c and usleep.c to libc/unistd. These + functions now just call nanosleep(). (2013-12-13). + * syscall/ and include/sys/syscall.h: Remove sleep and usleep + system calls. Add nanosleep system call (2013-12-13). + * arch/arm/src/a1x/a1x_timerisr.c: Timer interrupt handler for the + A10 (2013-12-13). + * arch/arm/src/a1x/a1x_config.h: Header file to keep track of A10 + configuration decisions (2013-12-13). + * arch/arm/src/a1x/a1x_lowputc.c, a1x_serial.c, and a1x_serila.h: + Beginning of an A10 serial driver. From Alan Carvalho de Assis + (2013-12-13). + * fs/procfs/procfs_utils.c: Move some re-usable functions out of + fs_procfsproc.c into a utility file (2013-12-14). + * fs/procfs/fs_procfsuptime.c: Supports /proc/uptime (2013-12-14). + * graphics/nxconsole/nxcon_font.c: Fix a typo that causes a compile + error when CONFIG_NXCONSOLE_BPP < 8. From Librae (2013-12-15). + * fs/procfs/fs_procfsproc.c: procfs now shows information about + the group that each thread belongs: Like parents, group member, + open file, and open sockets (2013-12-15). + * fs/procfs/fs_procfsproc.c: Now shows task stack information + (2013-12-15). + * arch/arm/src/armv7-a/cp15.h: Review A9 TRM and updated CP15 + register definitions accordinglyg (2013-12-16). + * Makefile.unix: Now has supports qconfig and gconfig targets. + These tools will use the Qt and GTK versions of the kconfig- + frontends configuration tools (if you built them) (2013-12-16) + * arch/arm/src/armv7-a/arm_head.h: Fix some errors in the cache + invalidation logic (only seem to matter for Cortex-A8) (21-3-12-19). + * Kconfig and all Make.defs files: Add CONFIG_DEBUG_NOOPT. Now + you can independently enable/disable debug symbols and optimization + (2013-12-20). + * configs/README.txt and Documentation/NuttxPortingGuide.html: + Remove documentation of NuttX configuration variables. Since + converting to the kconfig-frontend tools, the NuttX configuration + is now documented in the Kconfig files and summarized in the + autogenerated Documentation/NuttXConfigVariables.html file. + This old configuration variable documentation is now a liability + and, hence, was removed (2013-12-20). + * arch/Kconfig, arch/arm/Kconfig, arch/arm/include/x/chip.h, and + and arch/arm/src/x/x_irq.c where x={kinetis, lm, lpc17xx, lpc43xx, + sam34, or stm32}: Beginning of support for nested, high priority + interrupts. Lots more still needs to be done (2013-12-21). + * arch/arm/src/armv7-m/up_exception.S and arch/arm/src/x/x_vectors.S: + where x={kinetis, lm, lpc17xx, lpc43xx, sam34, or stm32}: completes + the basic implementation of nested, high priority interreupts. + Still untested and need documentation (2013-12-21). + * configs/stm3210e-eval/buttons: Converted to use kconfig-frontends + tools (untested) (2013-12-22). + * configs/Kconfig, configs/viewtool-stm32f107/include/board-stm32f103vct6.h, + and /board-stm32f107vct6.h: The viewtool board can now be configured + to support either the STM32F103VCT6 or the STM32F107VCT6 (2013-12-22). + * configs/Kconfig, README.txt, viewtool-stm32f107/highpri, Kconfig, + README.txt, and src/stm32_highpri.c: This is the initial framework + for a test of the high priority, nested interrupt logic. Still + incomplete and does not yet run (2013-12-22). + * arch/arm/src/armv7-m/ram_vectors.h and up_ramvec_initialize.c: + Correct alignment of the RAM vector table (2013-12-22). + * Kconfig: Support configuration of interrupt controller debug output + (2013-12-22). + * configs/viewtool-stm32f107/scripts: Need to do some special things + in linking of the common vectors are used (2013-12-22). + * arch/arm/include/*/irq*.h: Add definition NR_VECTORS so that the RAM + vector logic can know how many vectors there are. NR_IRQS is often + not equal to NR_VECTORS (2013-12-23). + * arch/arm/src/*_vectors.S: Standardize the name of the vector table + and the name of the common vector handling logic so that the MCU- + independent logic and work with these (2013-12-23). + * configs/viewtool-stm32f107/scripts: Move the RAM vector tables to the + beginning of SRAM. It seems to require this alignment. Also, we + don't need different scripts for the CMNVECTOR case now that the vector + table has a common name. + * arch/arm/src: armv-7/up_exception.S and xxx/xxx_vectors.S where + xxx={kinetis, lm, lpc17xx, sam34, and stm32}: Modified register usage + when saving the context on the stack: In order to handler nested + interrupts, the stack pointer must be used so that when it is + decremented, the contents on the stack are protected from the nested + interrupt handling (2013-12-23). + * arch/Kconfig: The CONFIG_ARCH_INT_DISABLEALL feature is disabled (i.e., + depends on EXPERIMENTAL). That is because the current implementation + will not work because interrupts get disabled in the interrupt handler + too, defeating the nesting of interrupts. The fix is easy: It just + needs more levels of priority of disabling interrupts vs interrupt + handling (2013-12-23). + * configs/viewtool-stm32f107/src/stm32_highpri.c: Improved debug output + (2013-12-23). + * drivers/lcd/memlcd.c and include/nuttx/lcd/memlcd.h: Support for the + Sharp Memory LCD from Librae (2013-12-23). + * configs/maple/nx and src/: Add support for a custom Sharp Memory + LCD on the Maple board. From Librae (2013-12-23). + * configs/viewtool-stm32f107/netnsh: Add a NSH configuration that + supports networking with the DP83848C module installed (2013-12-25). + * configs/viewtool-stm32f107/src/stm32_nsh.c, stm32_mmcsd.c, stm32_usb.c, + and stm32_usbmsc.c: Lay out basic framework for USB and SD card + support. Code is incomplete and has been neither built nor tested + (2013-12-25). + * nuttx/arch/arm/src/stm32/Kconfig, chip/stm32f103vc_pinmap.h, + stm32f105vb_pinmap.h, and stm32f107vc_pinmap.h: Fix configuration and + pin definition that would prevent building USB for the connectivity and + performance lines (2013-12-25). + * stm32l15xxx_pinmap.h: Fix a typo in USB pin definitions (2013-12-25). + * configs/viewtool-stm32f107: Fix building of USB for F103 and F107. + F103 has device only; F107 has OTG FS (2013-12-25). + * arch/arm/src/stm32/stm32f10xxx_rcc.c and chip/stm32f10xxx_rcc.h: Add + clocking support for STM32F107 USB OTG FS (which does not work) + (2013-12-26). + * configs/viewtool-stm32f107: Updates to USB for F103 and USB OTG FS + for F107 (2013-12-16). + * arch/arm/src/stm32/chip/stm32f3xxxx_pinmap.h: Fix pin definition names + for SPI2 MOSI and MISO. Noted by Brian Webb (2013-12-27). + * graphics/nxmu, nxsu, and nxglib and libc/nx, nxmu, and nxglib: Massive + reshuffling of files with (hopefully) no logic changes. This + reshuffling is necessary if we ever want to build graphics applications + as kernel builds. There is still more today (NXTK and NXFONTS need to + be moved to libc as well) (2013-12-27). + * Move libc/nx, nxmu, and nxglib to a new library, libnx. The NX + graphics is not properly a part of libc (2013-12-28). + * Move graphics/nxfonts to libnx/nxfonts (2013-12-28). + * Move graphics/nxtk to libnx/nxtk (2013-12-28). + * syscalls: Need to add sem_timedwait() (2013-12-28) + * Move more files from graphics/nxmu to libnx/nxmu (2013-12-29). + * graphics/nxmu/nx_start.c: NX server start-up wrapper function to + simplify starting the NX server from within the RTOS (2013-12-29). + * configs/stm3240g-eval/kernel and configs/stm3240g-eval/scripts: Port + kernel build logic from the STM32F4Discovery to the STM3240G-EVAL. + This will eventually support testing of the kernel mode NX server + (2013-12-29). + * configs/stm3240g-eval/nxwm: Converted to use the kconfig-frontend + tools (2013-12-29). + * configs/stm3240g-eval/knxwm: Add a kernel mode NxWM build + configuration (not yet verified) (2013-12-29). + * Moved configs/stm3240g-eval/src/up_cxxinitialize.c to + apps/platform/stm3240g-eval/up_cxxinitialize.c: Now it is available + in user-space in the kernel mode build (2013-12-29). + * graphics/nxbe, nxsu, libnx/nxmu, and nxtk: Need to be consistent with + which allocator is used in the different configurations. Always uses + the user-space allocator because that one is required in certain + configurations (2013-12-30). + * include/nuttx/kthread.h: Move kernel thread definitions out of + os_internal.h so that the rest of the OS can start kernel threads as + well (2013-12-30). + * configs/sim/mount/defconfig: Converted to use kconfig-frontends + tools (2013-21-31). + * configs/z16f2800100zcog/nsh: Add a Z16F NSH configuration. Does not + yet work (2014-1-1). + * arch/arm/src/stm32/stm32_serial.c: Single-wire UART support from + Thomas Grubler (2014-1-2). + * tools/configure.c and mkdeps.c: Fixes for Windows build issues + from Max Holtzberg (2014-1-4). + * configs/olimex-stm32-p107/nsh/Make.defs: Add native Windows build + support for the Olimex STM32 P107. From Max Holtzberg (2014-1-4). + * Makefile.win: Changes for native Windows build: Fix creation of + a .version file if one does not exist. Make sure that the APPDIR + environment variable is set before configuring. From Max Holtzberg + (2014-1-4). + * configs/viewtool-stm32f107/src/stm32_ssd1289.c: Add support for + Viewtool SSD1289-based LCD (untested on initial checkin) (2013-1-5). + * arch/arm/include/syscall.h and armv7-a/syscall.h: Add the syscall.h + header file needed for the Cortex-A architecture (2014-1-5). + * arch/arm/src/a1x/a1x_serial.c: Remove bad flow control logic. Add + missing interrupt handling logic for UART4-7 (2014-1-6). + * nuttx/tools/mkconfig.c: Cast size to unsigned in calculation of + CONFIG_RAM_END to avoid complains about integer overflow (2013-1-6). + * nuttx/tools/mkconfig.c: Back out the last change, this causes + problems for assembly language. How to prevent the integer over- + flow warnings? (2014-1-6). + * arch/arm/src/a1x/a1x_serial.c: Handle BUSY interrupt (2014-1-6). + * arch/arm/src/armv7-a/arm_head.S and arm_pghead.S: Add more nop's + after enabling the MMU. The cortex-a8 seems to need these + (2014-1-7). + * arch/arm/src/a1x/a1x_serial.c: Correct handling of the BUSY + interrupt (2014-1-7). + * include/sys/types.h: Add a bogus rsize_t type (2014-1-7). + * libc/stdio/lib_gets_s.c: Add a quick'n'dirty implementation of + gets_s() which replaces gets() in C11 (2014-1-7). + * libc/stdio/lib_fopen.c: Add support for new C11 exclusive open + ("x") (2014-1-7) + * include/threads.h: First crude cut at a C11 threads.h header + file (just maps to pthreads) (2014-1-7). + * libc/stdio/lib_libfgets.c: Common implementation supports all + of the slightly different requirements of gets(), gets_s(), and + fgets() (2014-1-7). + * arch/arm/include/stm32/chip.h and chip/stm32f103ze_pinmap.h: + various fixes for STM32F103ZE SPI3. From Steve Redler IV + (2014-1-7). + * graphics/nxsu/Make.defs: Typo that crept into build in recent + NX reorganization. Found by Steve Redler IV (2014-1-7). + * graphics/nxsu/: Another typo from the + recent NX reorganization from Steve Redler IV (2014-1-7). + * graphics/nxbe/nxbe_closewindow.c, nx_close.c, nx_constructwindow.c, + nx_open.c, and nx_openwindow.c: Needs to use kuzalloc and kufree, + not umm_zalloc and umm_free. Additional typo in nx_constructwindow.c + (wnd should be hwnd). Also noted by Steve Redler IV (2014-1-7). + * configs/viewtool-stm32f107/src/stm32_touchscreen.c (and other + files): Add support for the XPT2046 touchscreen controller on + the Viewtool LCD module connected to the Viewtool STM32F103 + board (2014-1-9). + * libc/strings/lib_stpcpy.c: Add stpcpy() (2014-1-9). + * arch/arm/src/a1x/a1x_lowputc.c and a1x_serial.c: Mystery + finally solved: The A10 serial clock is the OSC24M clock. + Thanks to Alan Carvalho de Assis (2014-1-10) + * binfmt/binfmt_loadmodule.c: Fix a memory leak (2013-1-11). + * configs/stm3vldiscovery: Support for the STM32VL-Discovery board. + Contributed by Alan Carvalho de Assis (2014-1-12). + * net/net_close.c, net/Kconfig, include/nuttx/net/net.h, and + include/sys/socket.h: Add support for the SO_LINGER socket option. + Extended from logic provided by Jason Jiang. Enabled with + CONFIG_NET_SOLINGER. At this point, it has only been verified that + the changes does not seem to do any harm (2014-1-13). + * net/connect.c and net/uip/uip_callback.c: prevent tcp_connect + callback from being double freed. From Max Holtzberg (2014-1-13). + * net/Kconfig and include/nuttx/net/uip/uipopt.h: Add configuration + support for forthcoming TCP write buffering (2014-1-13). + * net/net_send_buffered.c, net_send_unbuffered.c, and + uip/uip_tcpwrbuffer.c: First set of changes to bring in Jason + Jiang's TCP write buffering logic. Still not complete but + apparently harmless if not selected. (2014-1-13). + * All of Jason Jiang's TCP write buffering logic is checked in. + Unfortunately, it does not yet work (2013-1-14). + * configs/px4fmu-v2_upstream: Configuration for testing simple + configurations on the PX4FMU v2. This version is incomplete + for the PX4 application and is not a replacement for the version + in the PX4 GIT repository. + * fs/fat/fs_fat32.c: A correction to FAT cluster allocation from + Tridge via Lorenz Meier (2014-1-14). + * net/net_clone.c: If CONFIG_NET_TCP_WRITE_BUFFERS is selected, + then the socket-related write buffering information must copied + with the other cloned socket data (2014-1-14). + * net/net_close.c: If CONFIG_NET_TCP_WRITE_BUFFERS is selected, + then it is necessary to free the write buffer callback structure + when the socket is closed (2014-1-14). + * fs/fat/fs_fat32.c: Fix some root directory logic that was + conditionally done only for FAT 32. Apparently this needs to + done for all FAT types. From Tridge via Lorenz Meier + (2014-1-14). + * arch/arm/src/armv6-m/up_doirq.c and armv7-m/up_doirq.c and all + implementations of up_maskack_irq() for all Cortex-M architectures: Do + not disable and enable the IRQ on each interrupt. Because (1) + interrupts are already disabled on interrupt entry, (2) this + interferes with controlling the IRQ interrupt setting from interrupt + handlers, and (3) up_disable_irq() does not work anyway so that this + has never done anything (2014-1-15). + * All implementations of up_disable_irq() for all Cortex-M3 and M4 + architectures: To enable an interrupt on the Cortex-M3/4 CPU, you + need to set a bit in the ISER registet on the Cortex-M3/4 CPU, you + need to set a bit in the ISER register. To disable the interrupt, you + need to set a bit in the ICER register. Existing logic was trying to + disable interrupts by clearing the bit in the ISER register. That will + not work; writing a '0' to the ISER register has no effect. That + means that up_disable_irq() was doing nothing! It turns out that that + is not really important because up_disable_irq() is not really used + for that purpose. But some spurious STM32 ADC interrupts have been + reported to me and this turned out to be the cause in that case. My + concern now that up_disable_irq() works is that there may now be + unmasked bugs that leave devices in the disabled state? Thanks to + Manuel Sthn for the tip(2014-1-15). + * libc: Move strtol(), strtoll, strtoul(), strtoull(), and strtod() from + libc/string to libc/stdlib where they belong (2014-1-16). + * configs/Kconfig: Board configuration sub-directory can now be + specified. The default need not be used. This is really only + useful when CONFIG_ARCH_BOARD_CUSTOM is selected and there is no + meaningful default sub-directory (2014-1-16). + * configs/Kconfig: Backed out the previous change for two reasons: + (1) it has a bad side effect in that the sub-directory setting + no longer tracks the board setting, and (2) you still can't + source the Kconfig file from the custom board directory (2014-1-16). + * Makefile.unix, Makefile.win, and configs/Kconfig: After thinking a + little harder, I re-implemented the backed-out custom configuration + feature. The new version does not have bad side-effect (1) (but still + has bad side-effect (2)) (2014-1-16). + * arch/x86/Kconfig and configs/qemu-i486/nsh/Make.defs and + ostest/Make.defs: Add a configuration option to select the -m32 + compiler option when building for a 32-bit target on a native 64-bit + compiler (2014-1-18). + * include/ctype.h: Typo in macro name: iscntrl, not iscontrol (2104-1-17) + * libc/unistd/lib_getopt.c: If there are no arguments (argc == 1), then + getopt() will leave the optind variable in an undefined state (2014-1-20). + * configs/olimex-stm32-p107: Fails to build if SPI3 for UEXT is not + remapped. From Max Holtzberg (2014-1-21). + * Several network related files: Changes from Max Holtzberg to improve + how network status is reported. New controls to manage carrier + detect. (2014-1-21). + * configs/16z: Add basic support for the 16z board. The 16z board is + based on the ZiLOG ZNEOZ16F2811AL20EG part. See + https://github.com/toyaga/16z for further information (2014-1-22), + * tools/Config.mk: 'cypath' must be called if we are using a Windows + native toolchain with the Cygwin 'make' to convert paths to proper + Windows paths. From Richard Cochran (2014-1-23). + * /arch/arm/src/Makefile: dependency directory list is now computed + from the VPATH. From Richard Cochran (2014-1-23). + * arch/arm/src/efm32 and include/efm32: Basic support for the EFM3 + processor family from Richard Cochran (2014-1-23). + * configs/efm32-dk3650: This is Energy Micro's development kit for + the Leopard Gecko MCU, which is an ARM Cortex-M3 device. From Richard + Cochran (2014-1-23). + * arch/arm/src/armv7-m/up_memcpy.S: Assembler changes with the gcc-47 + distribution from ARM mean that we need to be explicit about branch + sizes; one or more of the wide branch opcodes results in bad table + branching. From Mike Smith (2014-1-23). + * Many files: renamed up_buttoninit() to board_button_initialize to + better conform to the naming standard. Now ONLY prototypes in + include/nuttx/arch.h (2014-1024). + * Rename up_buttons() to board_buttons() for the same reason (2014- + 1-14). + * Rename up_irqbutton() to board_button_irq() (2014-1-24). + * Rename up_ledinit() to board_led_initialize() (2014-1-24). + * Rename up_ledon() to board_led_on() and up_ledoff() to board_led_off() + (2014-1-24). + * arch/x86/src/qemu-i486/gemu_head.S: Patch from Matt Campbell + to fix 'Error: .size expression for idle_stack does not evaluate to + a constant" (2014-1-25). + * arch/arm/include/efm32, arch/arm/src/efm32, and configs/efm32-dk360: + Removed all EFM32 support. Not yet ready to be fielded (2014-1-27). + * arch/arm/src/armv7-a/arm_head.S, sama5/sam_boot.c, and several other + files: Now supports execution from NOR FLASH with .data and .bss in + SDRAM. This was not possible prior to this because .bss and .data + were initialized before SDRAM was configured. This logic is still + kind buggy. (2014-1-28). + * arch/arm/src/armv7-a/arm_head.S and arm_pghead.S: Back off to a + somewhat less efficient loop for initializing .data and .bss. The + original, efficient logic violated the ARM C ABI. It was okay when + called from boot logic, but not when called from C logic. This fixes + bugginess reported on 2014-1-28. (2014-1-29). + +7.1 2014-03-15 Gregory Nutt + + * arch/arm/src/lm/lm_serial.c: Fix cut'n'paste error that prevented + UARTS2-7 from being used with the LM4F120 Launchpad (2014-02-03). + * configs/stm32f4discovery/src: Almost everything renamed to conform + to the ever-evolving naming standard (2014-02-03). + * arch/arm/src/a1x/a1x_serial.c: Had the same cut'n'paste error + that the LM4f120 Launchpad had (2013-02-03). + * Documentation/NuttXCCodingStandard.html: Add a coding standards + document. Very boring stuff (2014-2-6). + * Several changes to restore the native Windows build (2014-2-7). + * arch/arm/src/lpc17xx/lpc17_usbhost.c: Fix an compilation error + that crept into the LPC17xx USB host driver. What happened here? + (2014-2-9). + * drivers/usbhost/usbhost_hidmouse.c and other files: Add support + for a HID boot mouse device. It compiles but is otherwise + completely untested on initial check-in (2014-2-9). + * configs/olimex-lpc1766stk/src/lpc17_hidmouse.c and hidmouse: Add + support of a test of the USB HID mouse (2014-2-9). + * drivers/usbhost/usbhost_hidmouse.c: The driver appears to be + functional. But there are usability issues: How do you use the + mouse with no cursor? The HID mouse currently emulates a touchscreen + driver. That would work in the long run for several reasons (see the + top-level TODO list for details) (2014-2-9). + * include/nuttx/input/mouse.h and drivers/usbhost/usbhost_hidmouse.c: + Defined a mouse interface that is very similar to a touchscreen + interface, but allows reporting of all mouse buttons. Also, unlike + touchscreen drivers, mouse drivers need to report positional data + with no button is pressed so that the mouse position can drive a + cursor (2014-2-10). + * drivers/usbhost/usbhost_hidmouse.c, include/nuttx/input/mouse.h, and + include/nuttx/usb/hid.h: Add support for a mouse wheel (2014-2-10). + * drivers/lcd/mio283qt9a.c and include/nuttx/lcd/mio283qt9a.h: Support + for the MIO283QT9A LCD. From Toby Duckworth (2014-2-10). + * configs/mikroe-stm32f4/src/up_mio283qt9a.c: The Mikroe STM32F4 can + now support the newer MIO283QT9A LCD. From Toby Duckworth (2014-2-10). + * MANY files changes based on complaints from the tool CppCheck. Several + latent bugs were fixed (and most likely some new typos were introduced) + (2014-2-10). + * arch/arm/include/samd and src/samd: Basic framework to support Atmel + SAMD20 Cortex-M0+ chips. Initial check-in is incomplete; this is a + work in progress (2014-2-12). + * configs/samd20-xplained: Framework to support the Amtel SAMD20 + Xplained Pro. Initial check is just an unverified, rough port of + the SAM4L Xplained Pro configuration (2014-2-12). + * arch/arm/src/stm32/stm32_serial.c: Fix cloned typo: FLOWCONTROL + vs FLOWCONROL (2014-2-14). + * net/uip/uip_tcptimer.c: Back out a small part of the 6.33 write + buffering changed. David G says that this causes problems in + connecting to a server (2014-2-15). + * The basic SAMD20 Xplained Pro port is complete but still untested + (2014-2-16). + * sched/task_terminate.c: Always returns an error because the + return value was not being set correctly. From Gosha (2014-2-18). + * stm32f429i-disco/ostest-fpu: OS test for FPU-enabled system from + David Alessio (2014-2-18). + * Other misc changes to support FPU on STM32F429 Discovery from + David Alessio (2014-2-18) + * stm32f429i-disco/src: Files renamed to make more consistent + with current board file naming conventions (2014-2-18). + * stm32 SPI: Disable SPI before changing CR1 register. From David + Sidrane (2014-2-18). + * stm32 TIM: Set CCMR when selecting timer channel. From David + Sidrane (2014-2-18). + * configs/spark: Board configuration updated by David Sidrane + (2014-2-19). + * libc/stdio/lib_sscanf.c: Bug fixes from David Sidrane (2014-2-18). + * nuttx/drivers/wireless/cc3000 and nuttx/include/nuttx/wireless/cc3000: + Numerous updates to the CC3000 driver from David Sidrane (2014-2-18). + * nuttx/configs/stm3240g-eval/webserver: Converted to use the + kconfig-frontends tools by Alan Carvalho de Assis (2014-2-18). + * configs/mbed: All mbed configurations have been converted to use + the kconfig-frontends tools (unverified) (2014-2-18). + * fs/fs_opendir.c, fs_readdir.c, et al: Modified so that errors + will not be reported if you attempt to list a empty pseudo-directory + (2014-2-19). + * fs/fs_rmdir.c: 'rmdir' can now be used to remove empty directories in + the pseudo-filesystem such as might be left after umounting a + file system (2014-2-19). + * fs/fs_mkdir.c: 'mkdir' can now be used to create empty directories in + the pseudo-filesystem (2014-2-19). + * drivers/lcd/mio283qt9a.c: Bug fix from Toby Duckwork (2014-2-19). + * fs/fs_rename.c: 'rename' can now be used to rename nodes in the + pseudo-filesystem (2014-2-19). + * arch/arm/src/samd/sam_sercom.c: Move some common SERCOM logic + from the USART-specific files to a share-able file where it can + also be used by SPI and I2C drivers (2014-2-19). + * arch/arm/src/samd/sam_spi.c: Add framework for a SAMD SPI driver. + The initial check-in is a crude port of the SAMA5 SPI driver with + a lot of missing logic (2014-2-19). + * arch/arm/src/lm/lm_lowputc.c and lm_serial.c: Several errors + are unmasked with UARTs > UART2 are enabled. From Gosha (2014-2-19). + * arch/arm/src/samd/sam_spi.c: The SPI driver is code complete, + but untested (2014-2-20). + * configs/olimex-lpc1766stck/ftpc: Configuration convert to use + the kconfig-frontends tools by Alan Carvalho de Assis (2014-2-20). + * fs/fs_mkdir.c: 'unlink' can now be used to remove things from the + pseudo-filesystem. A new configuration option as been added: + CONFIG_DISABLE_PSEUDOFS_OPERATIONS that effectively can be set + back out these recent changes in rmdir, mkdir, unlink, and rename + for operations on the pseudo-filesystem (2014-2-20). + * Kconfig: Add an option to select default values for configuration + variables based upon whether you want a smaller footprint or more + features. CONFIG_DEFAULT_SMALL is used in sched/Kconfig and + fs/Kconfig and in apps/. It turns out this this is not very useful + if you are modifying existing configurations because then the + defaults do not apply (2014-2-20). + * arch/arm/src/sam34/chip/sam4e_vectors.h: Add vector definitions + for the SAM4E (2014-2-21). + * arch/arm/src/sam34/chip/sam4e_memorymap.h: Add SAM4E memory map + (2014-2-21). + * arch/arm/src/sam34/sam4e_gpio.h, sam4e_periphclks.h, and chip/sam4e_pio.h: + Add PIO support for the SAM4E (2014-2-21). + * configs/stm3220g-eval/nsh/defconfig: Converted to use kconfig-frontends + by Alan Carvalho de Assis (2014-2-10) + * configs/*/defconfig: Comment out all CONFIG_APPS_DIR settings. These + should not be set in the default configurations because we don't know + where the apps/ directly will reside until configuration time (2014-2-21). + * arch/arm/src/sam34/chip/sam4e_pinmap.h: SAM4E pin multiplexing + definitions (2014-2-21). + * sched/sched_processtimer.c and fs/procfs/fs_procfscpuload.c: Add + logic to measure and calculate the CPU load percentage. From David + Alessio (2014-2-22). + * sched/sched_processtimer.c, sched_cpuload.c, fs/procfs/fs_procfscpuload.c, + and fs_procfscpuload.c: CPU load logic extended to keep counts on each + thread. The per-thread CPU is now reported in the procfs under + /loadavg (2014-2-23). + * include/stddef.h: ptrdiff_t is defined twice in stddef.h and also in + sys/types.h. stdef.h is the correct location for the definition, but + it includes sys/types.h so, at least for now, the definition will be + retained in sys/types.h (2014-2-25). + * net/net_close.c: Fix one place where the connection reference count + was not being decremented. This is really a cosmetic change BUT + when CONFIG_DEBUG_NET is enable, it will cause assertions (2014-2-25). + * arch/arm/src/sama5/sam_adc.h: Fix typos in the SAMA5 ADC register + definition header file (2014-2-26). + * arch/arm/src/sam34: The port to the SAM4E is code complete (2014-2-16). + * include/cxx: Fix some bad idempotence definitions in header files + (2014-2-27). + * sched/sched_cpuload.c: Change calculation of the total count when the + time constant related delay elapsed. The total count is now always + guaranteed to add up to 100% (excepting only truncation errors) + (2014-2-27). + * fs/procfs/fs_procfscpuload.c and fs_procfsproc.c: Remove the newline + at the end of the percentage so that the returned strings can be + printed on the same line as other values (2014-2-27). + * sched/Kconfig, sched_cpuload.c, and nuttx/sched/sched_processtimer.c: + An asynchronous, "external" clock may now be used to drive the CPU + load calculations for more accurate load measurements when needed + (2014-2-27). + * configs/*/defconfig: If CONFIG_NSH_LIBRARY=y then set CONFIG_NSH_READLINE=y + otherwise the CLE will be selected by default the next time that + make menuconfig is used (2014-2-28). + * include/cxx/cstdbool: Ignore _Bool8 if CONFIG_C99_BOOL8=y. (2014-2-28). + * configs/*/defconfig: Set CONFIG_DEFAULT_SMALL on all tiny MCU + configurations (2014-2-28). + * configs/stm3240g-eval/nsh: Configuration converted to use the + kconfig-frontends tools (2014-2-28). + * configs/*/ostest: Removed most OS test configurations (except in a few + cases where there was some good argument to retain the ostest + configuration) (2014-2-28). + * configs/stm3240g-eval/nsh2: Configuration converted to use the + kconfig-frontends tools (2014-3-1). + * configs/stm3220g-eval/nsh2: Configuration converted to use the + kconfig-frontends tools (2014-3-1). + * configs/stm3210e-eval/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-1). + * configs/stm3210e-eval/nsh2: Configuration converted to use the + kconfig-frontends tools (2014-3-1). + * configs/lincoln60/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-1). + * configs/lpcxpresso-lpc1768/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-1). + * configs/nucleus2g/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-1). + * configs/vsn/nsh: Configuration converted to use the kconfig-frontends + tools (2014-3-1). + * configs/mirtoo/nsh: Configuration converted to use the kconfig-frontends + tools (2014-3-1). + * configs/pic32-starterkit/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-1). + * configs/pic32-starterkit/nsh2: Configuration converted to use the + kconfig-frontends tools (2014-3-1) + * configs/pic32mx7mmb/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-1). + * configs/ubw32/nsh: Configuration converted to use the kconfig-frontends + tools (2014-3-1). + * configs/sim/nsh2: Configuration converted to use the kconfig-frontends + tools (2014-3-1). + * configs/lm3s6432-s2e/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-1) + * configs/lm3s8962-ek/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-1). + * configs/eagle100/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-1). + * configs/stm32f4discovery/src/Makefile: Fix typo: stm32_pwm.c not + stm32_psm.c. Noted by Max Kriegleder (2014-3-1). + * configs/lpc4330-xplorer/nsh Configuration converted to use the + kconfig-frontends tools (2014-3-1). + * configs/ea3152/ostest: Configuration converted to use the + kconfig-frontends tools (2014-3-1). + * configs/stm3210e-eval/RIDE, nxlines, and nxtext: Remove some old + style configurations that are not worth converting to use the + kconfig-frontends tools (2014-3-2). + * configs/stm3210e-eval/nx: Configuration converted to use the + kconfig-frontends tools (2014-3-2). + * configs/mirtoo/nxffs: Configuration converted to use the + kconfig-frontends tools (2014-3-2). + * arch/arm/src/lpc2378/Kconfig: Create Kconfig file for the LPC2378. + Change most configuration variable names to avoid collisions with + other platforms (2014-3-2) + * configs/olimex-lpc2378/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-2) + * configs/olimex-lpc1766stk/nx: Configuration converted to use the + kconfig-frontends tools (2014-3-2) + * configs/lpcxpresso-lpc1768/nx: Configuration converted to use the + kconfig-frontends tools (2014-3-2) + * configs/lm3s8962-ek/nx: Configuration converted to use the + kconfig-frontends tools (2014-3-2) + * configs/sim/nx: Configuration converted to use the kconfig-frontends + tools (2014-3-2) + * configs/c5471evm/nettest: Configuration converted to use the + kconfig-frontends tools (2014-3-3) + * configs/olimex-strp11/nettest: Configuration converted to use the + kconfig-frontends tools (2014-3-3) + * configs/eagle100/nettest: Configuration converted to use the + kconfig-frontends tools (2014-3-3). + * configs/ez80f910200zco/nettest: Configuration converted to use the + kconfig-frontends tools (2014-3-3). + * configs/stm3220g-eval/nettest: Configuration converted to use the + kconfig-frontends tools (2014-3-3). + * configs/stm3240g-eval/nettest: Configuration converted to use the + kconfig-frontends tools (2014-3-3). + * configs/sim/nettest: Configuration converted to use the kconfig-frontends + tools (2014-3-3). + * configs/ez80f910200zco/dhcpd: Configuration converted to use the + kconfig-frontends tools (2014-3-3). + * configs/stm3220g-eval/dhcpd: Configuration converted to use the + kconfig-frontends tools (2014-3-3). + * configs/stm3240g-eval/dhcpd: Configuration converted to use the + kconfig-frontends tools (2014-3-3). + * configs/lpcxpresso-lpc1768/dhcpd: Configuration converted to use the + kconfig-frontends tools (2014-3-3) + * configs/olimex-lpc1766stk/usbmsc: Configuration converted to use the + kconfig-frontends tools (2014-3-3) + * configs/nucleus2g/usbmsc: Configuration converted to use the + kconfig-frontends tools (2014-3-3) + * configs/lpcxpresso-lpc1768/usbmsc: Configuration converted to use the + kconfig-frontends tools (2014-3-3) + * configs/stm3210e-eval/usbmsc: Configuration converted to use the + kconfig-frontends tools (2014-3-3) + * configs/hymini-stm32v/usbmsc: Configuration converted to use the + kconfig-frontends tools (2014-3-3) + * configs/ea3131/usbmsc: Configuration removed. It could not possible + useful because there is no MCI driver for the EA3131 (2014-3-3) + * configs/mcu123-lpc214x/usbmsc: Configuration converted to use the + kconfig-frontends tools (2014-3-3) + * configs/teensy/nettest: Configuration converted to use the kconfig-frontends + tools (2014-3-3). + * configs/*/dhcpd: Add missing DHCPD configuration settings (2014-3-3). + * configs/stm32f4discovery/pm: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/stm3210e-eval/pm: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/stm3240g-eval/nxconsole: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/stm3210e-eval/nxconsole: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/stm3240g-eval/telnetd: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/stm3220g-eval/telnetd: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * fs/fat/fs_fat32.c: Fix an error in the FAT logic that can cause file + corruption. The error conditions are rare and only seen with very + large files. From Andrew Tridgell. This replaces a previous, partial + fix for the same problem (2014-3-4). + * configs/hymini-stm32v/usbserial: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/ea3131/usbserial: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/mcu123-lpc214x/usbserial: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/olimex-lpc1766stk/thttpd: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/lpcxpresso-lpc1768/thttpd: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/eagle100/thttpd: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/eagle100/httpd: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/ez80f910200zco/httpd: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/c5471evm/httpd: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/eagle100/nxflat: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/sim/touchscreen: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/sim/pashello: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/sim/nx11: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/ez80f910200zco/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/ez80f910200zco/poll: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/olimex-lpc1766stk/slip-httpd: Configuration converted to use the + kconfig-frontends tools (2014-3-4) + * configs/c5471evm/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/compal_e99/nsh_compalram: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/compal_e99/nsh_highram: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/mcu123-lpc214x/composite: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/olimex-strp711/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/amber/hello: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/micropendous3/hello: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/teensy/hello: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/teensy/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * arch/avr/Kconfig, avr32/Kconfig, at32uc3/Kconfig, atmega/Kconfig, and + at90usb/Kconfig: Reshuffle lots of AVR-related configuration names to + make space for AVR32. Populate AVR32 Kconfig file (2014-3-5). + * configs/avr32dev1/ostest: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/avr32dev1/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/ntosd-dm320/nettest: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/ntosd-dm320/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/ntosd-dm320/poll: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/ntosd-dm320/thttpd: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/ntosd-dm320/udp: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/ntosd-dm320/uip: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * arch/Kconfig, arch/arm/Kconfig, configs/ea3131/Kconfig, + configs/ea3131/pgnsh/defconfig, configs/ea3131/src/up_fillpage.c, + configs/ea3152/Kconfig, nuttx/configs/ea3152/src/up_fillpage.c, + include/nuttx/page.h, and tools/cfgdefine.c: Add configuration + settings for the on-demand paging option (2014-3-5). + * configs/ea3131/pgnsh: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/qemu-i486/ostest: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * configs/qemu-i486/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-5) + * Many files: Use common naming for all buildroot toolchains + (2014-3-5). + * Many files: Use common naming for rest of the toolchains (2014-3-5). + * configs/ne64badge/ostest and demo9s12nec64/ostest: Configurations + converted to use the kconfig-frontends tools (2014-3-5) + * fs/nxffs/nxffs_open.c: Missing call to nxffs_freeentry() causes + memory leak. From Lzyy (2014-3-6). + * fs/nxffs/nxffs_stat.c: Looks like stat() has the same problem as + the one reported by Lzyy (2014-3-6). + * configs/skp16c26/ostest: Configuration converted to use the + kconfig-frontends tools (2014-3-6) + * configs/us7032evb1/ostest: Configuration converted to use the + kconfig-frontends tools (2014-3-6) + * configs/us7032evb1/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-6) + * configs/mx1ads/ostest: Configuration converted to use the + kconfig-frontends tools (2014-3-6) + * configs/pjrc-8051: Configuration converted to use the kconfig-frontends + tools (2014-3-6) + * configs/rgmp/arm/default: Configuration converted to use the + kconfig-frontends tools (2014-3-6) + * configs/rgmp/arm/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-6) + * configs/rgmp/x86/default: Configuration converted to use the + kconfig-frontends tools (2014-3-6) + * configs/rgmp/x86/nsh: Configuration converted to use the + kconfig-frontends tools (2014-3-6) + * configs/rgmp/x86/helloxx: Configuration converted to use the + kconfig-frontends tools (2014-3-6) + * configs/rgmp/x86/cxxtest: Configuration converted to use the + kconfig-frontends tools. This completes the conversion of all + configurations to the newer format (2014-3-6) + * Removed the CONFIG_NUTTX_NEWCONFIG setting from every defconfig + file (2014-3-6). + * The legacy, manual configuration is no longer supported by the + NuttX build system. Only the newer configurations generated by + the kconfig-frontends tools will generate viable NuttX + configurations. All board configurations in the NuttX source tree + have been converted to use the newer configuration, but if you have + some older style configurations for you board, you will need to + convert those configurations to use the kconfig-frontends tools. + See http://www.nuttx.org/doku.php?id=wiki:howtos:convertconfig for + some guidelines (2014-3-6). + * drivers/serial/Kconfig: Correct an error introduced in this file + in very recent commits (2013-3-6). + * configs/*sam*: Refresh all SAM* configurations with the latest + Kconfig files (2014-3-6). + * configs/stm32f4discovery: Refresh all configurations (except + winbuild) with the latest Kconfig files (2014-3-6). + * configs/viewtool-stm32f107: Refresh all configurations with the + latest Kconfig files (2014-3-6). + * configs/16z, mikroe-stm32f4, olimex-lpc1766stk, px4fmu-v2_upstream, + sim, and stm32f429i-disco: Refresh all configurations (2014-3-6). + * Documentation/NuttShell.html: Update per recommendations from Max + Kriegleder (2014-3-6). + * configs/pic32-starterkit, pic32mx7mmb, stm3210e-eval, stm3220g-eval, + and stm3240g-eval: Refresh all configurations with the latest + Kconfig files (2014-3-7). + * configs/qemu-i486/src: Files renamed to correspond with current + thinking about naming (2014-3-8). + * arch/x86/src/qemu/qemu_keypad.c and qemu_vga.c: New QEMU keyboard + and VGA drivers from Lizhuoyi (2014-3-8). + * configs/olimex-lpc2378/src: Files renamed to correspond with current + thinking about naming (2014-3-8). + * arch/arm/src/lpc2378/lpc23xx_i2c.c and lpc23xx_spi.c: I2C and SPI + drivers for the LPC23xx from Lizhuoyi (2014-3-8). + * arch/arm/include/tiva and src/tiva: The old lm/ directories were + renamed tiva/ to better support new products coming down the pipe + from TI (2014-3-8). + * arch/arm/include/tiva, src/tiva, and configs/: All files and all + all functions beginning with the name lm_ changed to tiva_ + (2014-3-8). + * configs/: Refresh all LM3/4/Tiva configurations (2014-3-9). + * arch/arm/src/tiva/chip/tm4c_pinmap.h: Add pin multiplex definitions + for the TM4C123 (2014-3-9). + * arch/arm/src/tiva/chip/tm4c_memorymap.h: Add memory map for the + TM4C123 (2014-3-9). + * arch/arm/src/tiva/: Add GPIO and SYCONTROL register bit definitions + for the TM4C123 (2014-3-10). + * configs/tm4c123g-launchpad: Add basic board support for the + TM4C123G-Launchpad (2014-3-10). + * configs/sam4e-ek: Add basic board support for the SAM4E-EK board. + More work is needed. The initial commit is little more than the + SAM3U-EK with name changes (2014-3-10). + * configs/spark: Refresh all spark configurations (2014-3-11). + * arch/arm/src/tiva/chip/tm4c_memorymap.h: Fix typos reported by + Daniel Pereira de Carvalho (2014-2-12). + * arch/arm/src/sam34/sam_emac.c: Add an Ethernet MAC driver for the + SAM4E. The initial checkin is essentially the SAMA5D3 EMAC driver + with naming changes as appropriate (2014-3-12). + * arch/arm/src/sam34/sam_cmcc.c: Add logic to manage the Cortex-M + Cache Control block. Untested on initial check-in (2014-3-12). + * arch/arm/src/sam34/sam_emac.c: Fix EMAC pin configuration (was been + set up for RMII instead of MII). Now the driver EMAC appears to be + functional (2014-3-13). + * configs/sam4e-ek/nsh: Networking support is now enabled by default + in the NSH configuration (2014-3-13). + * arch/arm/src/sam34/sam_spi.c: Backported the SAMA5 SPI driver to + the SAM3/4 architecture. The SAMA5 version supports both multiple + SPI peripherals as needed by the SAM3A and SAM3X and also supports + DMAC (but not PDC). The initial commit is untested and may very + well have (temporarily) broken SPI for the SAM3/4/ family (2014-3-13). + * configs/sam4e-ek/src/sam_at25.c and sam_hsmci.c: Added support for + the AT25 serial FLASH. Restructured the logic that registers the + HSMCI block driver (2014-3-13). + * arch/arm/src/sam34/sam_dmac.c and sam_spi.c: Fixes to DMA in general + and to SPI in particular (2014-3-14). + * configs/sam4e-ek/nsh: DMA-based SPI and a FAT file system on the + AT25 Serial FLASH are now supported by default in the NSH configuration + (2014-3-14). + * sched/nanosleep.c: Fix a missing call to re-enable interrupts. From + Jason Jiang (2014-3-15). + +7.2 2014-04-29 Gregory Nutt + + * arch/arm/src/sam34/sam_udp.c and .h: Add a USB full speed device + driver (UDP) for the SAM4E (2014-3-17). + * Documentation/NuttxPortingGuide.html: Typo fixes from Vijay Kumar + (2014-3-18). + * arch/arm/Kconfig: Improved documentation of the use of the + BASEPRI register from Vijay Kumar (2014-3-19). + * include/nuttx/i2c.h: More typo fixes from Vijay Kumar (2014-3-19). + * arch/Kconfig and *_assert.h: Add a configuration option to enable + dumping of the USB trace buffer on assertion (2014-3-19). + * drivers/usbdev/Kconfig, arch/arm/src/sam34/Kconfig, and + drivers/usbdev/usbmsc_scsi.c: If DCD can support queuing of stall + requests, then the USB MSC stall work around delays are not necessary + (2014-3-20). + * net/netdev_findbyaddr.c: Skip network devices that are in the + "down" state. It does not make sense to consider an address match + with a "down" device. From Brennan Ashton (2014-3-20). + * configs/sam4e-ek/usbnsh: Add a NSH configuration that uses the + NSH console (2014-3-22). + * arch/arm/src/stm32/stm32_eth.c: Add IGMP hashing support. From + Manuel Sthn (2014-3-24). + * net/netdev_ioctl.c and uip/uip_input.c: IGMP-related bug fixes + from Manuel Sthn (2014-3-24). + * arch/arm/src/sam34: Add missing HSCMI configuration settings to + Kconfig; update naming to include SAM34_ (2014-3-24). + * configs/sam4e-ek/include/board.h: Update HSMCI timing to use the + CLKODD bit (2014-3-24). + * drivers/include/mtd/Kconfig, sector512.c, and include/nuttx/mtd/mtd.h: + Add a new MTD driver that can be used to contain another driver and + force its apparent sector size to be 512 bytes (2014-3-24). + * arch/arm/src/sam34/sam_lowputc.c sam_serial.c: Fix a mysterious + multithreading bug that can lock up the serial port (2014-3-14). + * drivers/usbdev/Kconfig, usbmsc.c, usbmsc.h, and usbmsc_scsi.c: + Redesign threading module used with the USB MSC driver. It was using + pthreads before and these were changed to a kernel thread. The reason + for this has to do with task grouping: A pthread is a memory of the + group of the task that started it. A kernel thread is independent of + the task that started in (other than knowing it as the parent). This + allows me to remove so kludge logic to "deparent" the pthread on + startup (2014-3-25). + * tools/astyle.sh: A code formatting tool from Lorenz Meier. This + tool should do a better job than the old tools/indent.sh tool + (2014-3-26). + * arch/arm/src/sam_hsmci.c and sam_spi.c: Add support to invalidate + cached memory if the CMCC is enabled (not yet tested, 2014-3-26). + * arch/arm/src/sam_spi.c: Add logic to handle SPI word widths > 8 + (also untested on initial checkin, 2014-3-26). + * configs/sam4e-ek: All configurations updated to run with 120MHz + CPU speed and with the CMCC enabled. Calibrated delay loop + (2014-3-26). + * drivers/lcd/Kconfig: Add missing configuration for the MIO283QT-9A + LCD. Reported by Toby Duckworth (2014-3-27). + * arch/arm/include/sama5/chip.h and arch/arm/src/sama5/Kconfig: Add + support for the SAMA5D36 (2014-3-28). + * libc/strings/lib_strncpy.c: Change ordering of test and copy. Logic + would have failed if n=0; one byte was always copying before testing + for the end of the copy. + * nuttx/configs/sama5d3-xplained/: Add a board support configuration + for the Atmel SAMA5D3 Xplained board. The initial check in is not + finished. For example, it still builds to run out of NOR FLASH but + the SAMA5D Xlpained has no NOR FLASH (2013-4-28). + * arch/arm/src/sama5/sam_pmc.c and .h: Add functions to calculate + PLLACK, PCK, and MCK frequencies given the main clock frequency + (2014-3-29). + * configs/sama5d*/include/board.h, board_sdram.h, and other files: + When booting from SDRAM, we need to query the PMC registers (using + the functions in sam_pmc.c) to determine the MCK, PCK, etc. We assume + that the MCK input clock is well known main crystal oscillator + frequency (2014-3-29). + * configs/sama5d3x-ek: Change all configuration names to board- + specific names so that this are no name collisions with other + boards that have similar configuration variables (2013-3-30). + * configs/nuttx/compiler.h: Add macro UNUSED() that can be used + to eliminate warnings about variables that are set to values + that are not used (2014-3-30). + * arch/arm/src/sama5/sam_hsmci_clkciv.c: Remove HSCMI-related + functions that did not belong in sam_pmc.c and give them their + own file (2014-3-30). + * arch/arm/src/sama5/sam_boot.c: Fix some backward conditional + compilation (2014-3-30). + * libc/stdio/lib_sccanf.c: Fix a counting error in the return + value from sscanf(). Noted by kfrolov. Also, sscanf() should + return EOF if no values were converted (2014-3-30). + * include/time.h and sched/clock_settime(): Add support for + CLOCK_REALTIME. From Macs N (2014-3-31). + * libc/stdio/lib_ferror.c, lib_fread.c, lib_libfflush.c, + lib_libfread.c, and lib_libfwrite.c: Finish incomplete support + for ferror(). From Macs N (2014-3-14). + * libc/stdio/lib_ftell.c: Fix a logic error in ftell(). It was + simply using the file offset and did not take into account data + buffered in memory. From Macs N (2013-3-31). + * Add CONFIG_CLOCK_MONOTONIC that case used to disable CLOCK_MONOTONIC + for a smaller footprint (2013-3-31). + * sched/Kconfig: Menu has gotten too long. And another layer of + menuing in order to simplify this layer (2014-3-31). + * arch/arm/src/sama5_boot.c: Fix double mapping of SDRAM when executing + out of SDRAM. In this case, the SDRAM was already mapping in + arm_head.S (2014-3-31). + * arch/arm/src/sama5/chip/sam_dbgu.h: Add SAMA5D3 DBGU definition + header file (2014-3031). + * arch/arm/src/sama5/sam_dbgu.c and .h: Add support for the SAMA5D3 + DBGU (2014-4-1). + * configs/sama5d3-xplained/nsh: Configurations now use the DBGU for + the serial console (instead of USART1) (2014-4-1). + * libc/stdio/lib_sccanf.c: Use stroul() vs strol() with %u format + otherwise, range of values is restricted because of sign bit + from kfrolov (2014-4-2). + * arch/arm/src/sama5/sam_boot.c, sam_irq.c, chip/sama5d3x_memorymap.h: + When running from SDRAM, vectors must lie in SRAM (2014-4-2). + * arch/arm/src/armv7-a/arm_head.S and cache.h: On start-up, make + certain that the MMU and caches are disabled (probably un-necessary) + (2014-4-2). + * arch/arm/src/sama5/sam_boot.c: If we have to copy vectors, then + make sure to clean the DCache to be sure that the copied vectors are + in the physical RAM (2014-4-2). + * arch/arm/src/sama5/sam_irq.c: After we modify the AXI MATRIX, make + sure to invalidate all caches and TLBs (probably un-necessary) + (2014-4-2). + * arch/arm/src/sama5/sam_irq.c: Set the VBAR register to zero. If + were started by a bootloader (vs. a RESET), then the VBAR register + may not be in its reset state (zero, 2014-4-3). + * arch/arm/src/sama5/sam_boot.c, sam_irq.c, and chip/sama5d3x_memorymap.h: + When booting from SDRAM, don't relocated vectors to ISRAM. Instead, + just set the VBAR register to address of the vectors in SDRAM. + * arch/arm/src/sama5/sam_clockconfig.c: BMS Fixed to match what the HW + does. From David Sidrane (2014-4-3). + * arch/arm/src/sama5/Kconfig, sam_boot.c, andsam_clockconfig.c: On some + hardware, reconfiguring the PLL while executing out of NOR FLASH causes + crashes. This was fixed by David Sidrane by implementing RAM functions. + The killer code is copied and executed from ISRAM and the crash is + avoided (2014-4-3). + * configs/sama5d3-xplained/Kconfig and include/board*.h; + configs/sama5d3x-ek/Kconfig and include/board*.h: Add support for + 528MHz CPU clock (2014-4-3). + * arch/arm/src/sama5/Make.defs: Fix a build error that occurs when + only USB device tracing is enabled (2014-4-4). + * Documentation/UsbTrace.html: Add some discussion of the USB monitor + (2014-4-4). + * nuttx/arch/arm/src/armv7-a/mmu.h: Bufferable bit did not do what + I thought it was going to do. Result was the NOR FLASH accesses + were very slow (2014-4-3). + * arch/arm/src/sama5/sam_udphs.c: Fix a case where received status + was not being cleared, causing OUT SETUP commands to fail (2014-4-6). + * arch/arm/src/tiva/tiva_syscontrol.c: Add logic for TM4C125GXL based + on logic from Daniel Carvalho with modifications. I think the + LM4F120 may have broken before as well(?). In any event, the LM4F120 + also works well with this change (2014-4-7). + * Back out part of 610e2aa0c224e2936fe8009ef4a2351ce607067a: Need to + be able to select USB console devices when there is no /dev/console + enabled. Noted by Librae (2014-4-8). + * configs/*/defconfig: Increase the number of preallocated watchdogs + in all configurations that use networking or USB (2014-3-9). + * include/nuttx/syslog/syslog.h and ramlog.h: Move syslog.h and + ramlog.h to include/nutt/syslog (2014-4-10). + * sched/errno_getptr.c and getpid.c: Add some checks. If these + functions are called early in initialization before the tasking + structures are initialized, they will not behave properly + (2014-4-10). + * arch/arm/src/sama5/sam_twi.c: TWI data sending is fails to increment + the number of bytes transferred on first byte sent. From David Sidrane + (2014-4-10). + * configs/sama5d3x-ek/src: The red LED is controlled by PE24 which is + also the camera/ISI interface reset line. So if the a camera is + installed, then we must avoid controlling the red LED or we inadvertently + also reset the camera module. Noted by David Sidrane (2014-4-11). + * arch/arm/src/stm32/stm32_usbhost.c/.h and stm32_otgfshost.c: USB host + tracing added by Leo (2014-4-12). + * arch/arm/src/sama5/sam_adc.c, sam_can.c, sam_emac.c, sam_gmac.c, + sam_ssc.c, and sam_twi.c: If running from SDRAM, then BOARD_MCK_FREQUENCY + is not a constant and cannot be used in conditional compilation (2014-4-16). + * drivers/lcd/mio283qt9a.c and include/nuttx/lcd/mio283qt9a.h: Update the + MIO183QT-9A LCD driver to support reading from the LCD. From Toby + Duckworth (2014-4-16). + * arch/arm/src/stm32/chip/stm32f20xxx_pinmap.h: Correct a mapping for + SPI MOSI pin. From dlsitzer (2014-4-26). + * arm/src/sama5/sam_clockconfig.c and common/up_internal.h: Move the + un-definitions of __ramfuncs__ from the .c file to the .h file or, + otherwise, the attribute will be applied differently for the prototype + and the function definition. Sourceforge patch 38 from Luciano Neri + (2014-4-17). + * arch/arm/src/sama5/sam_emac.c: Add missing right parentheses. This + introduced in the above change and is Sourceforge patch 39 from Luciano + Neri (2014-4-17). + * configs/sama5dx-ek/include/board.h and sama5d3-xplained.h: These files + reference type xcpt_t and so must include nuttx/irq.h. This is + Sourceforge bug 25 submitted by Luciano Neri (2014-4-17). + * arch/arm/src/stm32/stm32_otgfshost.c: Some fixes related to low-speed + devices and interrupt endpoints from Leo (2014-4-17). + * configs/stm32f4discovery/src/stm32_usb.c: Add support to register + keyboard and mouse classes if so configured. From Leo (2014-4-17). + * include/nuttx/usb/usbhost: Fix some USB HID-related conditional + compilation. From Leo (2014-4-17). + * drivers/usbhost/usbhost_hidmouse.c: Don't include NAKs from the device + in the error count. From Leo (2014-4-17). + * arch/arm/src/sam34/sam_irq.c: Fix initialization of the default + priorities (2014-4-17). + * arch/arm/src/kinetis/kinetis_irq.c, lpc17xx/lpc17_irq.c, and + tiva/tiva_irq.c: Modify the logic to disables the interrupts and sets + the default interrupt priority so that it uses the ICTR to get the + number of interrupt lines/registers. This is instead of using some + fixed number of initializations based a priori knowledge of the number + of interrupt lines in the MCU. This logic is untested on some MCUs + on initial check-in0 (2014-4-17). + * arm/src/lpc17xx/Kconfig and lpc17_ethernet.c: The default interrupt + priority should be default, not the highest priority (2014-4-19). + * configs/lpcxpresso-lpc1768: Refreshed all defconfig files (2014-4-19). + * configs/olimex-lpc1766stk: Refreshed all defconfig files (2014-4-19). + * configs/zkit-arm-1769: Refreshed all defconfig files (2014-4-19). + * include/nuttx/binfmt/ieee695.h: Beginning of header file for IEEE + 695 OMF header file (2014-4-19). + * arch/arm/include/stm32/chip.h and src/stm32/Kconfig: Add support + for the STM401RE. From Frank Bennett (2014-4-20). + * README.txt, Documentation/README.html, configs/Kconfig and README.txt, + configs/nucleo-f401re: Add support for the Nucleo-F401RE board. From + Frank Bennett (2014-4-20). + * arch/arm/src/sam34/sam_rtc.c/.h: Port RTC driver from SAMA5 to + SAM3/4. From Bob Doiron (2014-4-21) + * arch/arm/src/sam34/sam4s_periphclks.h: Fix error in macros that + disable peripheral clocking. From Bob Doiron (2014-4-21) + * drivers/mmcsd/mmcsd_sdio.c/.h: Misc improvements from Bob Doiron + (2014-4-21) + * arch/arm/src/sam34/sam_hsmci.c and chip/sam_hsmci.h: Extensions + from Bob Doiron needed to support PDC-based HSMCI DMA transfers + (2014-4-21). + * configs/sam4s-xplained-pro: Support for the SAM4S Xplained Pro + board from Bob Doiron (2014-4-21). + * configs/sam4s-xplained-pro: Added card detect (kind of broken + still); added proc/vfat mounting during init to save some typing. + From Bob Doiron (2014-4-21). + * configs/sam4s-xplained-pro: Boost PLLA to 240MHz to allow USB. From + Bob Doiron (2014-4-21). + * arch/arm/src/sam34/sam_wdt.c/.h: Add watchdog driver. From Bob + Doiron (2014-4-21). + * nuttx/configs/sam4s-xplained-pro: Add board-specific watchdog + timer support. From Bob Doiron (2014-4-21). + * drivers/timer.c and include/nuttx/timer.h: Timer "upper half" + driver and lower half interface definition from Bob Doiron + (2014-40-22). + * arch/z16/src/z16f/z16f_espi.c: Add ZNEO ESPI driver (2014-4-24). + * arch/arm/src/stm32/stm32_sdio.c: The dmaflight method must + be conditioned on CONFIG_SDIO_PREFLIGHT. Noted by Pelle + Windestam (2014-4-25) + * configs/nucleo-f401re: Removed bogus references to the MPU + (2014-4-25). + * arch/z16/src/z16f_timerisr.c: Fix calculation of timer + reload and prescaler. The timer frequency was way too fast + (2014-4-25). + * arch/arm/src/stm32/stm32_otgfsdev.c and others: Sourceforge + Ticket #26. up_prioritize_irq should not be called if + CONFIG_ARCH_IRQPRIO is not defined (2014-4-25). + +7.3 2014-06-25 Gregory Nutt + + * arch/arm/src/sama5/sam_clockconfig.c: Needed function sam_pmcwait() + is needed when UDPHS, EHCI, or OHCI is configured but may not be + compiled in due to insufficient conditional logic. From Luciano Neri + (SourceForge patch #40) (2014-4-29). + * arch/arm/include/stm32/chip.h, src/stm32/Kconfig, stm32_allocateheap.c, + configs/nucleo-f401re/nsh/defconfig, and scripts/ld.script: Numerous + changes, most correcting memory usage on the Nucleo-F401RE (2014-4-30). + * /drivers/mtd/w25.c: Extended by Mark Whitehorn to support the 8Mbit + W25Q80BV part (2014-4-30). + * configs/sam4s-xplained-pro: Update LED control logic from Bob Doiron + (2014-4-30). + * drivers/timer.c and include/nuttx/timer.h: Enhanced timer interface + from Bob Doiron (2014-4-30). + * arch/arm/src/sam34/Kconfig and sam_tc.c: Enhanced timer/counter driver + from Bob Doiron (2014-4-30). + * configs/sam4s-xplained-pro/Kconfig, nsh/defconfig, and src/sam_tc.c: + The SAM4S Xplained Pro now uses the extended timer/counter features. + From Bob Doiron (2014-4-30). + * include/nuttx/arch.h and sched/os_internal.h: If the CPU load + measurements are being driven by an external clock, then the prototype + for sched_process_cpuload() must be available in include/nuttx/arch.h + (2014-4-30). + * Documentation/NuttShell.html and many defconfig files: The alternate + console device CONFIG_NSH_CONDEV must not be defined unconditionally. + This causes errors when using Telnet sessions. This was solved by + adding CONFIG_NSH_ALTCONDEV: CONFIG_NSH_ALTCONDEV enables or disables + the feature then, if enabled, CONFIG_NSH_CONDEV provides the alternative + console device name (2014-5-5). + * arch/arm/src/sam34/sam_rtt.c/.h: RTT driver from Bob Doiron. Also + added high resolution RTC emulation using the RTT for the sub-second + counter (2014-5-5). + * configs/sam4s-xplained-pro: Clean-up of LED usage and also some + integration of new timer features. From Bob Doiron (2014-5-5). + * drivers/timer.c and include/nuttx/timer.h: Timer driver updates from + Bob Doiron (2014-5-5). + * binfmt/symtab_findorderedbyname.c: Fix an error in the symbol search + function. Noted by Pelle Windestam (2014-5-6). + * arch/arm/src/stm32/stm32f40xxx_rcc.c and configs/nucleo-f401re/include/board.h: + The Nucleo-F401RE has no on-board crystals and, hence, needs to run + with the PLL input from the on-chip HSI clock (2014-5-6). + * arch/arm/src/armv7-a/arm_memcpy.S: This is the same optimized memcpy() + function that Mike Smith brought in for the ARMv7-M with minor tweaks + by David Sidrane to work with the ARMv7-A (2014-5-6). + * binfmt/libpcode, pcode.c, include/nuttx/poff.h, and binfmt/pcode.h: + Framework to support Pascal P-Code as a binary format. At present this + logic is incomplete and really nothing more than a thought experiment + to determine the feasibility of the P-code binary format (2014-5-7). + * drivers/sensors/Make.defs: Correct build dependency. Sourceforge + ticket #41 from Kosma Moczek (2014-5-8). + * drivers/serial.c, include/nuttx/serial.h, arch/arm/src/stm32/stm32_serial.c + and minor updates to all other drivers using the serial interface: Add an + rxflowcontrol method to the serial interface to better support RX flow control. + From Jussi Kivilinna (2014-5-8). + * arch/arm/include/stm32 and src/stm32: Add support for the STM32152 and + STM32162 Medium+ density parts (plus miscellaneous other improvements to + the original STM32151 logic). From Jussi Kivilinna and Sami Pelkonen + (2014-5-8). + * binfmt/binfmt_dumpmodule.c, binfmt_loadmodule.c, binfmt_unloadmdoule.c, + builtin.c, elf.c, nxflat.c, pcode.c, and include/nuttx/binfmt/binfmt.h: + Extend the binfmt interface to handle error conditions where format-specific + binfmt clean-up is needed in the event of error conditions. This is needed + by the P-Code binfmt (2014-5-8). + * binfmt/libpcode, pcode.c, include/nuttx/poff.h, and binfmt/pcode.h: + Now uses apps/interpreters/prun and is basically functional. More work + is needed because (1) it is too coupled with apps/ and (2) will not work + with CONFIG_NUTTX_KERNEL (2014-5-9). + * arch/arm/src/stm32/stm32_i2c.c: Bring in PX4 fix for I2C in very high + noise environments or with rogue perpipherals. Taken from the PX4 commit + 099b2017ccfa0fc7696f168db2a0c2e13fe5edbc by Tridge here: + https://github.com/PX4/NuttX (2014-5-10). + * include/nuttx/video/rgbcolors.h: Fix typo in several macros: RBG -> RGB. + (2014-5-12). + * drivers/mtd/ramtron.c: Add support for Fujitsu MB85RS1MT part. From + Charles Ash (2014-5-12). + * configs/sam4e-ek/src/sam_ili9325.c: Add an LCD driver for the SAM4E-EK + board. Untested on initial check-in (2014-5-13). + * configs/sam4e-ek/src/sam_ads7843e.c: Add a touchscreen driver for the + SAM4E-EK board. Untested on initial check-in (2014-5-13). + * arch/arm/src/stm32/stm32_i2c_alt.c: Add an alternative I2C implementation + for the STM32 F03 that works around errata in that part. From Patrizio + Simona (2014-5-14). + * arch/arm/src/sam34/sam_gpio.c: Fix some SAM4E compiler errors when + CONFIG_DEBUG_GPIO is enabled (2014-5-15). + * sched/sig_mqnotempty.c: Test for a valid signal number is inverted; this + function could not have been working correctly??? From eero.nurkkala + (2014-5-20). + * arch/arm/src/stm32/stm32_lowputc.c: Fix error in conditional + compilation. From Sami PelKonen (2014-5-20). + * arch/*/src/* (several files): Make sure that all references to + up_prioritize_irq() are conditioned on CONFIG_ARCH_IRQPRIO. Problem + noted by Mike Smith (2014-05-20). + * drivers/wireless/cc3000/Kconfig: Correct SPI mode for CC3000 is CPOL=0 + CHPA=1. See http://processors.wiki.ti.com/index.php/CC3000_Serial_Port_Interface_(SPI) + From Jussi Kivilinna (2014-5-21). + * drivers/wireless/cc3000/cc3000.c and include/nuttx/wireless/cc3000/include/cc3000_upif.h: + Configuration has CC3000_SPI_MODE settings but source uses + CONFIG_CC3000_SPIMODE. From Jussi Kivilinna (2014-5-21). + * drivers/wireless/cc3000/cc3000drv.c: unsoliced_thread does + initialization of message queue, but main thread might block that + thread from running and use the uninitialized message queue. The main + thread must wait until unsolice_thread initializes the required + structures before proceeding. From Jussi Kivilinna (2014-5-21). + * drivers/wireless/cc3000/cc3000.c: Fix build when POLL is enabled. + From Jussi Kivilinna (2014-5-21). + * arch/arm/include/armv7-m/irq.h: Change bne to bne.n in irqrestore() + (2014-5-22). + * Many files: Convert all old-style variadic macros to the C99 form. + Recent GCC changes tightens up that behavior and can cause some problems + (at least for the IAR compiler for some reason). See + https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html#Variadic-Macros. + Noted by Bob Grimes (2014-5-22). + * configs/viewtool-stm32f107/nsh: Configuration refreshed (2014-5-23). + * arch/arm/src/stm32/stm32_i2c_alt.c: Final driver from Max Kriegleder et al. + Reduces footprint and fixes a bug. (2014-5-23). + * tools/configure.sh: In-place SED edit messes up permissions on windows. + From Hannes Delago (2014-5-25). + * include/nuttx/mtd/mtd.h: Needs forward reference to struct spi_dev_s. + (2014-5-25). + * arch/arm/src/stm32/stm32_i2c.c and stm32_i2c_alt.c: Back out PX4 fixes + that were reverted in the PX4 repositories (2014-5-25). + * sched/Kconfig: CONFIG_START_YEAR/MONTH/DAY are not required if the + RTC is enabled (2014-5-26). + * arch/arm/src/stm32/stm32_rtcc.c: Add retry logic to RTC initialization. + It sometimes takes longer for the RTC to initialize, at least as noted + on an F2 part. From dlsitzer (2014-5-27). + * libc/stdio/lib_snprintf.c: If the size passed to snprintf() is zero, + then snprintf() must write nothing, but instead return the size of the + buffer needed to hold the entire string. From Sami Pelkonen (2014-5-30). + * net/arp: Move arp related files from net/uip to net/arp. Files renamed + with arp_ prefix (2014-5-30). + * include/nuttx/net/arp.h and net/arp/arp_timer.c: Moved + include/nuttx/net/uip/uip-arp.h to include/nuttx/net/arp.h; moved + net/net_arptimer to arp/arp_timer.c. (2014-5-30). + * net/igmp: Moved IGMP files from net/uip to net/igmp (2014-5-30). + * net/icmp: Moved ICMP files from net/uip to net/icmp (2014-5-30). + * net/uip/uip_tcptimer.c: NET: Notify upper layer when TIME_WAIT or + FIN_WAIT_2 timeout occurs. Otherwise connections possibly won't get + freed. From Max Holtzberg (2014-6-2). + * TCP fallback allocation: Added all states in which the connections are + about to be closed. Fallback mechanism is disabled when SO_LINGER is + enabled to prevent deadlocks in netclose_disconnect(). From Max Holtzberg + (2014-6-2). + * configs/olimex-stm32_h405: Support for the Olimex STM32 H405 board + contributed by Martin Lederhilger (2014-6-3). + * net/arp/Make.defs: Fix an error introduced recently in the net/ build + (2014-6-3). + * net/iob: Add generic I/O buffering. Not currently used by anything. + (2014-6-4). + * arch/arm/include/sama5 and arch/arm/src/sama5: Basic framework to + support the SAMA5D4 family. Incomplete on initial check-in (2014-6-3). + * arch/arm/src/sama5/chip/sam_xdmac.h: Beginning of XDMAC register + definition header file (incomplete) (2014-6-4). + * arch/arm/src/sama5/chip/sam_l2cc.h: Add SAMA5D4 L2CC register definition + header file (incomplete on initial check-in) (2014-6-5). + * drivers/usbdev/cdcacm.c: Reset RX head to avoid resending last serial + data when USB cable disconnected/re-connected. From Lizhuoyi (2014-6-6). + * drivers/usbdev/pl2303.c: Same change cloned for PL2303 (2014-6-6). + * arch/arm/src/lpc2378: Fix several typos. From Lizhuoyi (2014-6-6). + * arch/arm/src/lpc17xx/lpc17_gpdma.c: Fix an error when DMA is + started: The read-modify-write fails when the DMA is started. This + is because the value read is not the same as the value set (on write + it is the number of transfers to do; on read it is the number of + transfers completed). From Lizhuoyi (2014-6-6). + * configs/sama5d4-ek: Initial board support for the SAMA5D4-EK board. + This initial check-in is basically the SAMA5D3-Xplained board support + with appropriate name changes (2014-6-6). + * stm32/arch/arm/src/stm32_serial.c: Handle configuration for the + case of 8-bit data with parity. From Freddie Chopin (2014-6-11). + * binfmt/libelf/elf.c: Fix a compilation error when CONFIG_ELF_DUMPBUFFER + is defined. From Pelle Windestam (2014-6-12). + * net/, include/nutt/net, and include/netpacket: Add support for "raw" + sockets. From Lazlo Sitzer (2014-6-12). + * arch/arm/src/sama5: Add SAMA5D4 XDMAC driver. Initial check-in is + just the DMAC driver with a few naming changes (2014-6-12). + * configs/sama5d4x-ek/ramtest: Add an SDRAM test configuration + (2014-6-14). + * libc/stdio/lib_libsnoflush.c, lib_memsistream.c, and lib_memsostream.c: + Add support for seekable memory streams (2014-6-14). + * libc/stdio/lib_rawsistream.c, and lib_rawsostream.c: Add support for + seekable raw streams (2014-6-14). + * libc/stdio/lib_stdsistream.c, and lib_stdsostream.c: Add support for + seekable standard streams (2014-6-14). + * configs/sam4x-xplained*/src/sam_buttons.c: Button interrupts not being + disabled after being detached. (2014-6-15). + * binfmt/binfmt_exec.c: Fix a critical error in exec(); argv was not + being passed (2014-6-15). + * arch/arm/src/sama5/sam_dmac.h: Fix some critical typos in the SAMA5D3 + DMA definitions (2014-6-17). + * nuttx/net/net_send_unbuffered.c: Notify the device driver of the + availability of TX data. From Daniel Lazlo Sitzer (2014-6-18). + * net/net_close.c, net_send_unbuffered.c, socket.c, and uip_poll.c: + Various fixes for raw sockets from Daniel Lazlo Sitzer: (1) properly + free the socket in psock_close(), (2) socket() returns failure when + there is no free socket/connection, and (3) Set number of bytes to + transmit is set in the uip_driver_s instance (2014-6-18). + * net/tcp: Move all TCP files from net/uip to net/tcp (2014-6-18). + * net/udp: Move all UDP files from net/uip to net/udp (2014-6-18). + * net/pkt: Move all AF_PACKET files from net/uip to net/pkt (2014-6-18). + * net/Kconfig: Add option to select CONFIG_NET_GUARDSIZE (2014-6-18). + * net/net_send_buffered.c: Add checks from buffer allocation failures. + from Max/Himax (2014-6-19). + * tools/mkfsdata.pl: Apparently, the trailing the 0x00 in http server + files is seen as a bug in javascript and images. From Max/Himax + (2014-6-19). + * net/ and include/nutt/net (many files): Conversion of the TCP + write buffering logic to use I/O buffer chains (not tested on initial + check-in) (2014-6-22). + * include/time.h and sched/clock_gettime.c: Fix typo in conditional + compilation: CONFIG_CLOCK_MONOTONIC vs. CLOCK_MONOTONIC. From Manuel + Sthn (2014-6-23). + * arch/avr/Kconfig and arch/avr/src/avr32/Kconfig: Fix typos in + Kconfig files from Stefan Sperling (2014-6-23). + * net/net_send_unbuffered.c: Remove some spurious white space from + field selectors. SourceForge ticket #42 (2014-6-23). + * arch/arm/src/lpc17xx and configs/lpcexpresso-lpc1768: Added support + for the lpcxpresso's rtc handler, adc, dac, timers, pwm and mcpwm + drivers. From Max (himax) (2014-6-23). + * net/tcp/Kconfig: Cannot enable bother TCP write buffering AND raw + packet sockets. This should not logically be the case, but is because + the implementations are presently too coupled. The logic packet + socket logic in net/net_send_unbuffered.c needs to be broken out into + a separate file so that write buffered TCP and packet socket transfers + can co-exist (2014-6-23). + * net/uip/uip_pktsend.c: Move the logic that copies data into the + device buffer from net/net_send_unbuffered.c to net/uip/uip_pktsend.c. + This makes the packet socket design more consistent with TCP and UDP + (2014-6-23). + * net/: Separate net/net_send_buffered.c and net/net_send_unbuffered.c + to net/tcp/tcp_send_buffered.c, net/tcp/tcp_send_unbuffered.c, and + pkt/pkt_send.c (2014-6-24). + * include/net/if.h and /net/arp/arp_inout.c: Suppress ARP requests on + data sent from packet sockets (2014-6-24). + * include/nuttx/net/netconfig.h: Move include/nuttx/net/uip/uipopt.h to + include/nuttx/net/netconfig.h (2014-6-24). + * include/nuttx/net/netdev.h: Move include/nuttx/net/uip/uip-arch.h to + include/nuttx/net/netdev.h (2014-6-24). + * include/nuttx/net/tcp.h: Move include/nuttx/net/uip/uip-tcp.h to + include/nuttx/net/tcp.h (2014-6-24). + * include/nuttx/net/udp.h: Move include/nuttx/net/uip/uip-udp.h to + include/nuttx/net/udp.h (2014-6-24). + * include/nuttx/net/pkt.h: Move include/nuttx/net/uip/uip-pkt.h to + include/nuttx/net/pkt.h (2014-6-24). + * include/nuttx/net/icmp.h: Move include/nuttx/net/uip/uip-icmp.h to + include/nuttx/net/icmp.h (2014-6-24). + * include/nuttx/net/igmp.h: Move include/nuttx/net/uip/uip-igmp.h to + include/nuttx/net/igmp.h (2014-6-24). + * include/nuttx/net/ip.h: Move include/nuttx/net/uip/uip-ipopt.h to + include/nuttx/net/ip.h (2014-6-24). + * include/nuttx/net/uip.h: Move include/nuttx/net/uip/uip.h to + include/nuttx/net/uip.h (2014-6-24). + * net/uip/uip.h: Rename net/uip/uip_internal.h to net/uip/uip.h + (2014-6-24). + * net/iob: Add support for throttling read-ahead buffering if the + read-ahead buffering is competing with write buffering for I/O + buffers (2014-6-24). + * net/: Many files changed. Convert existing TCP read-ahead logic + to use I/O buffer chains (2014-6-24). + * net/: Clean up all TCP and UDP related naming (204-6-24). + * net/: Clean up all ICMP, IGMP, ARP, and PKT related naming + (204-6-25). + * arch/arm/src/sam34 and include/sam34: Add support for the SAM4CM + family. From Max Neklyudov (2014-6-25). + +7.4 2014-08-15 Gregory Nutt + + * arch/arm/src/stm32/stm32_i2c.c: Fix missing configuration of + GPIO pins in I2C driver. Fix from Alex D. (2014-6-25). + * NET: Fix an include file ordering problem when CONFIG_NET_STATISTICS=y. + (2014-6-26). + * include/nuttx/net/netstats.h: Move statistics from uip.h to new netstats.h + to remove nasty circular inclusion problem (2014-6-26). + * arch/arm/src/sama5: Add logic to redirect all SAMA5D4 interrupts to + the AIC (2014-6-26). + * net/route: Move routing table functions to net/route (2014-6-26). + * net/utils: Move some files into net/utils (2014-6-26). + * net/: Repartition initialization logic so that net/uip is at the bottom + of the food chain, instead of at the top. + * apps/include/hex2bin.h: The hex2bin library did not build with + debug disabled (2014-6-26). + * configs/sama5d4-ek/dramboot and src/dram_main.c: Add a boot loader that + runs from ISRAM and loads an Intel HEX file into DRAM (2014-6-26). + * configs/sama5d4-ek/nsh and scripts/: Setup the SAMA5D4-EK NSH + configuration to use the DRAMBOOT loader by default (2014-6-26). + * binfmt: Various changes associated with symbol tables. Most from Pelle + Windestam (2014-6-27). + * Networking: Add network device ioctl to access PHY registers. From Daniel + Lazlo Sitzer (2014-6-27). + * net/netdev: Move net/netdev*.c to net/netdev/netdev*.c (2014-6-27). + * arch/arm/src/sam34/chip/sam4cm_ipc.h: Add SAM4CM IPC register header + file. From Max Neklyudov (2104-6-27). + * arch/arm/src/sam34: Various fixes PMC and clock configuration for the + SAM4CM port from Max Neklyudov (2104-6-27). + * configs/sama5d4-ek/src/dram_main.c: SAMA5D4: Bootloader needs to flush + D-Cache to memory before disabling the caches (2014-6-27). + * net/Makefile: Fix a Make.defs inclusion omitted in a previous check-in + (2014-6-17). + * net/utils: Move net/uip/uip_chksum.c to net/utils/net_chksum.c + (2014-6-17). + * configs/sama5d4-ek/at25boot and src/at25_main.c: Add a configuration + that will load a bootloader into AT25 Serial FLASH (2014-6-28). + * libc/math: Change double_t to double in rint(). Add rintf() and rintl() + while we are at it (2014-6-28). + * net/iob: Fix some errors in recent network I/O buffering when stack runs + from interrupt level. Reported by Manuel Sthn (2014-6-28). + * net/sockets: Create the net/sockets directory and hook it into the + build system. Move all socket-related C files into net/socket. Move + net/net.h to net/socket/socket.h (2014-6-28). + * net/ipv6: Move IPv6 files from net/uip to net/ipv6 (2014-6-28). + * net/devif: Rename net/uip to net/devif. Rename uip/uip.h to + devif/devif.h (2014-6-28). + * net/devif: Rename many functions in net/devif from uip_* to devif_* + (2014-6-28). + * configs/sama5d4-ek/src/nsh: The SAMA5D4-EK NSH configuration now + supports the RTC by default (2014-6-29). + * arch/arm/src/sama5/Kconfig and sam_hsmci.c: Add configuration to + assign an XDMAC channel to an HSMCI (2014-6029). + * Various fixes for networking and tiny webserver from Max (2014-6-29). + * SAMA5: Various fixes related to DMA in order to get the HSMCI + driver to build for the SAMA5D4 (2014-6-29). + * SAMA5D4-EK: Fix HSMCI card-detect pin selection (2014-6-29). + * net/: Still renaming, mostly uip_* to net_* (2014-6-29). + * arch/arm/src/stm32/stm32_i2c.c and stm32_i2c_alt.c, and + libc/time/lib_daysbeforemonth.c: Make variable definitions + 'static const' when possible to save RAM usage. From Kosma + Moczek (2014-6-30). + * include/stdint.h: Correct naming of [U]INT_LEASTn_{MAX|MIN} + and [U]INT_FASTn{MAX|MIN}. From Kosma Moczek (2014-6-30). + * drivers/mtd/mtd-config: Extend erase block size to 18-bits in + order (decrease block size to 14-bits) to handle parts with large + erase blocks. From Kosma Moczek (2014-6-30). + * drivers/analog/adc.c: Remove empty ADC write method. From Kosma + Moczek (2014-6-30). + * arch/arm/src/stm32/stm32_serial.c: Unconfigure GPIO pins when + closing a serial port to prevent back effects from back-powering on + the TX pin. From Kosma Moczek (2014-6-30) + * arch/arm/src/stm32/Kconfig: Move temperature ranges from chip + selection configuration prompts. Reorder MCUs in choice menu; + remove duplicates. Add support for the STM32F103RC and RD. From + Kosma Moczek (2014-6-30) + * configs/sam4s-xplained-pro: Correct description of LEDs and + usage. From Kosma Moczek (2014-6-30) + * include/unistd.h: Some POSIX_* and _POSIX_* macros are defined + without value, whereas (as far as I can tell) the newer versions + of the standard require them to have the value corresponding to + the standard version implemented, like 200809L. Are the any plans + to clean this up? For now I've put together a quick patch that + defines those macros to 1, consistent with the rest of unistd.h. + From Kosma Moczek (2014-6-30) + * arch/arm/src/sama5/sam_memories.c: Fix some logic in conversion + of physical and virtual DRAM addresses when running out of DRAM. This + is an important bug fix for the SAMA5D3 and 4 when running out of + DRAM (2014-6-30). + * arch/arm/src/sama5/sam_pio.c: Another *critical* SAMA5D3 and 4 bug + fix: PIO clocking must be enabled for all input pins or else the + value that is read never changes. (2014-6-30). + * net/: Many more functions renamed to follow new modularization of + the networking code. This is part of an ongoing repartitioning + effort and there is still more to be done. There will be no additional + notations in this ChangeLog until the renaming is complete (2014-6-30). + * arch/arm/src/sam34/sam_emac.c, sama5/sam_emaca.c, sam_emacb.c, and + sam_gmac.c: Fix cloned error: Wrong bits being cleared before ORing + in new bits (2014-7-1). + * drivers/syslog/ramlog.c: syslog_putc needs to set the errno and + return EOF on a failure (2014-7-1). + * SAM3/4 and SAMA5 Ethernet: Fix an error in the function that + determines the number of free TX descriptors. This is an important + bugfix on busy networks (2014-7-2). + * SAM4 AES driver. Contributed by Max Neklyudov (2014-7-3). + * crypto/ and include/crypto: Beginnings of a crypto/ subsystem from + Max Neklyudov (2014-7-3). + * arch/arm/src/stm32 and fs/procfs: Add a procfs entry to show the + state of the CCM heap usage. From Pelle Winderstam (2013-7-3). + * SAMA5 OHCI: Fix an error in a DEBUGASSERT statement. Caused assertion + to fire inappropriately when a low- or full-speed device was removed + and CONFIG_DEBUG=y (2013-7-3). + * SmartFS. Fix for a bug that would show up if CONFIG_MTD_BYTE_WRITE + was not selected and the SMART sector size was larger than the mt + device's block size (like it would be if using SMARTFS on larger + flash devices). From Ken Pettit (2014-7-3). + * tools/mkdeps.c: NAME_MAX not available on SunOS; use FILENAME_MAX + or MAXNAMELEN. Noted by Douglas Beattie (2014-7-4). + * drivers/mtd/smart.c: Increase some variables from uint16_t to uint32_t + to handle larger device sizes. From Ken Pettit (2014-7-4). + * SAMA5 OHCI: Pointers to allocated port values were not being nullified + after being deallocated. This caused some assertions to fire when + debug was enabled (2014-7-4). + * include/nuttx/net/ip.h and ipopt.h: ip.h renamed ipopt.h. Moved + parts of uip.h to net.h. Renamed the rest of uip.h to ip.h. Removed + all includes of uip.h; added includes of ip.h wherever needed. + Tried to fix problems of the now missing sneak inclusions because + uip.h was removed. There are probably a few of these that were + missed! (2014-7-4). + * drivers/input/mxt.c/h and include/nuttx/input/mxt.h: Add very basic + support for the Atmel maXTouch touchscreen controller (2014-7-5). + * net/*/*.h: Start moving the private definitions from header files + at include/nuttx/net to the corresponding header file under net/. + So far pkt.h, upd.h, and igmp.h have been sanitized. Still a few + to go (2014-7-5) + * configs/sama5d4-ek/src/sam_maxtouch.c: Add board support for the + maXTouch touchscreen controller (2014-7-5). + * net/*/*.h: Finish moving the private definitions from header files + at include/nuttx/net to the corresponding header file under net/. + This additional header files have been sanitized: arp.h, icmp.h, tcp.h + (2014-7-6) + * net/: Add a few missing configuration options to the Kconfig files + (2014-7-8). + * net/iob/iob_trimhead_queue.c and socket/recvfrom.c: Important fix to + the read-ahead buffer queue management: Consumed bytes were being + trimmed from the head of the queue, but the queue head itself was + not being updated. From Rony XLN (2014-7-7). + * drivers/bch: Add configurable AES encryption support to block-to- + character (BCH) driver. This allows any block device to be accessed + as an encrypted character device. From Max Nekludov (2014-7-7). + * SAM3/4: Fix compile of sam_aes.c if CONFIG_CRYPTO_AES is defined. + From Max Nekludov (2014-7-7) + * SAMA5D3/4 I2C: Test for read or write operation was reversed. How + could this have worked before? (2014-7-7). + * SAMA5D3/4 PIO Interrupts: Correct a typo in + arch/arm/src/sama5/sam_pio.h that could disable PIO interrupt support + if only PIOE interrupts were enabled (2014-7-7). + * SAMA5D4 PIO Interrupts: Macro SAM_PION_VBASE is not defined for the + SAMA5D4 and must be replaced with a table lookup (2014-7-7). + * configs/sam*: Fix some cloned errors in SAM GPIO interrupt setup + (1014-7-7). + * arch/arm/src/sama5/Kconfig and sam_allocateheap.c: Add a + configuration option to reserve DRAM for a framebuffer when executing + out of DRAM. This optional was available before when executing out of + NOR, but needs to work a little differently in this case (2014-7-7). + * arch/arm/src/sama5/sam_lcd.c and chip/sam_lcdc.h: Adapt the SAMA5D3 + LCDC driver to work with the SAMA5D4 which has no hardware cursor + (2014-7-8). + * configs/sama5d4-ek: Add options to support an LCD (2014-7-7). + * arch/arm/src/sama5/sam_twi.c: Now support the up_i2creset() method + (2014-7-9) + * drivers/input/mxt.c: Use i2c_reset() if it thinks that the bus + might by hung (2014-7-9). + * arch/arm/src/sama5/sam_pio.c/.h: Add a new interface + sam_pio_forceclk() that can be used to force PIO clocking on. I am + afraid I was too conservative with PIO clocking in the initial design; + this is the price (2014-7-9). + * arch/arm/src/sama5/sam_twi.c: Use sam_pio_forceclk() so that we can + read the current state of an open-drain output in the TWI reset logic + (2014-7-9). + * arch/arm/src/sama5/sam_pio.c/.h: Fix a typo in Schmitt trigger + configuration; Configure pin as a a vanilla input first so that final + pin configuration is more read-able (i.e., easier to debug) + (2014-7-9). + * drivers/input/mxt: The maXTouch driver works! (2014-7-10). + * configs/sama5d4-ek: The TM7000 LCD works! (2014-7-10). + * configs/sama5d4-ek/NxWM: Add an NxWM configuration (2014-7-10). + * drivers/mtc_rwbuffer.c (and others): Add an MTD layer that will add + read-ahead or write buffering to any MTD driver (incomplete) (2014-7-11). + * arch/arm/src/lpc17xx/lpc17_ethernet.c: Comment out an assertion that + is reported to fire inappropriately. From Max (2014-7-11). + * drivers/mtd (mostly): Addition rwbuffer interfaces should not be + enabled unless they are needed; if rwbuffer support is enabled, it + should not be unconditionally enabled in SMART and FTL (2014-7-11). + * libnx/nxglib/nxglib_colorcmp.c and include/nuttx/nx/nxglib.h: New + utility to compare two colors (2014-7-11). + * graphics/Kconfig and nxbe/nxbe_configure.c: The initial background + color is now configurable (2014-7-11). + * graphics/nxmu/nxmu_server.c and nxsu/nx_setbgcolor.c: Don't change + the background if the color did not really change (2014-7-11). + * arch/arm/src/sama5/sam_ldc.c and sama5d4-ek/include/board.h: Back + out the delay kludge. The actual fix to the LDC instability was to + drive the LCD at 2xMCK instead of 1xMCK (2013-7-12). + * drivers/input/mxt.c: Fix an error in the state machine (2014-7-12). + * drivers/input/mxt.c: Add thresholding so that "move" reports are not + generated unless there is a significant change in the reported + position (2014-7-12). + * SAMA5D4-EK MXT: The maXTouch should be able to handler an I2C + frequency of 400KHz. Valid interrupts should occur only on the + falling edge of the ~CHG signal (2014-7-12). + * SAMA5D3x-EK: Use larger icons in NxWM configuration instead of + scaling (2014-7-14). + * Graphics: Rename CONFIG_NX_MOUSE to CONFIG_NX_INPUT, then add + CONFIG_NX_XYINPUT_MOUSE and CONFIG_XYINPUT_TOUCHSCREEN (2014-7-16). + * drivers/input/mxt.c: Fix error in threshoold test... backward + logic (2014-7-16). + * graphics/nxconsole/nxcon_scroll.c: Fix scrolling in the NxConsole + for the case of the framebuffer device. In this case, the logic + for clearing the vacated region at the bottom was missing so garbage + up from the last, uncleared line (2014-7-17). + * drivers/audio/wm8904.c/.h and include/nuttx/audio.wm8904.h: Framework + for a WM8904 audio driver. The initial driver check-in is simply Ken + Pettit's VS1053 driver forced to compile with only WM8904 definitions + (2014-7-18). + * configs/sama5d4-ek/src/sam_wm8904.c: Add logic to configure and + initialize the WM8904 audio CODEC (2014-7-17). + * arch/arm/src/sama5/sam_sckc.c/.h and chip/sam_sckc.h: Add SAMA5 + slow clock support. + * arch/arm/src/sama5/sam_pck.c and .h: Add support to use the slow + clock as the PCK clock source (2014-7-19). + * drivers/audio/wm8904.c/: The WM8904 audio driver is mostly code + complete and ready to begin initial testing (2014-7-19). + * arch/arm/src/sama5/sam_pio.c: Logic for Schmitt trigger selection + backward (2014-7-20). + * drivers/net/slip.c: Fix an error in SLIP escaping. From Max + Neklyudov (2014-7-22). + * drivers/input/Kconfg: Add missing configuration option to select the + MAX11802 touchscreen controller. From Petteri Aimonen (2014-7-22). + * arm/src/stm32/chip/stm32_dac.h: Fix typos, from Peterri Aimonen + (2014-7-22). + * arch/arm/src/stm32/stm32_otgfsdev.c: STM32 OTGFS device: Various + changes to try to reduce that amount of time in interrupts handles and + with interrupts disbled. Needs verification on other platforms. From + Petteri Aimonen (2014-7-22). + * arch/arm/src/sama5/sam_pck.c: Fix a recently introduced typo that was + being masked by some bad conditional compilation (2015=4-7-22). + * drivers/audio/wm8904.c and include/nuttx/audio/wm8904.h: Remove WM8904 + driver unused parameters, clean-up comments, remove some kruft in + capability reporting (2014-7-22). + * audio/Makefile and pcm_decode.c, include/nuttx/audio/pcm_decode.c, + configs/sama5d4-ek/src/sam_wm8904.c and others: Add new framework for + the PCM decoder. It is now a 'front end' for lower-level drivers like + the WM8904 that performs the PCM decoding from end (2014-7-22). + * audio/pcm_decode.c, configs/sama5d4-ek/src/sam_wm8904.c, + drivers/audio/wm8904.c, and include/nuttx/audio/pcm.h: Rename + pcm_decode.h to pcm.h since it will hold more than just decoding + definitions. Fix some porting errors like idbg should auddbg, etc. + Add wav file header and a few low-level wav utilities (2014-7-22). + * audio/pcm_decode.c and include/nuttx/audio/pcm.h: Flesh out a few + more PCM methods, still incomplete. Re-vision PCM structure + definition (2014-7-22). + * configs/sama*: Disable MMC/SD multiblock transfers in all SAMA5D3/4 + configurations. I suspect an issue but have not had time to run it + down yet so the easiest thing is simply to disable the feature for + now (2014-7-23). + * drivers/audio/audio_null.c, include/nuttx/audio/audio_null.c, and + configs/sama5d4-ek/src/sam_audio_null.c: Add a NULL audio device that + can be used to simply unit-level testing of audio decoders (2014-7/23). + * audio/pcm_decode.c, include/nuttx/audio/audio.h, and drivers/audio/audio_null.c + and wm8904.c: Add ioctls so that PCM decoder can configure the driver + bitrate, num channels, and sample width (2014-7-23). + * drivers/audio/Kconfig: Fix a typo in the audio Kconfig file, + UDIO->AUDIO (2014-7-23). + * configs/sama5d4-ek/nxwm/defconfig: The NxPlayer and audio system are + now enabled in the default configuration (although they have not yet + been fully integrated into the NxWM media player) (2014-7-23). + * configs/sama5d4-ek/nsh/defconfig: Enable the command line media player + in the NSH configuration as well (still does not work, however) + (2014-7-23). + * audio/Kconfig, audio.c, and include/nuttx/audio/audio.h: Add hooks for + fast-forward and rewind needed by CMediaPlayer; add hooks for + equalizer settings needed by the WM8904 (2014-7-24). + * drivers/audio/audio_null.c and wm8904.c: Fix some compile errors when + audio DEBUG is enabled (2014-7-24). + * SAMA5D4-EK NxWM: Configuration refreshed (2014-7-24). + * arch/arm/src/armv7-m/up_initialstate.c: Correct the initial value of + the BASEPRI register. This was apparently never being initialized! + From Max (2014-7-24). + * configs/mbed/src/up_adc.c, up_dac.c, and up_pwm.c and include/board.h: + Port ADC, DAC, and PWM logic from the configs/zkit-arm-1769. From Max + (2014-7-24). + * arch/arm/src/lpc17xx/lpc176x_rtc.c: Eliminate warnings. From Max + (2014-7-24). + * arch/arm/src/lpc17xx/lpc17_pwm.c, lpc17_timer.c, lpc17_dac.c: Mostly + cosmetic updates from Max (2014-7-24). + * arch/arm/src/lpc17xx/lpc17_adc.c and Kconfig : Added burstmode ADC + conversion mode, with CONFIG_ADC_BURSTMODE option in Kconfig. From + Max (2014-7-24). + * arch/arm/src/lpc17xx/lpc17_ethernet.c: Added option to use the kernel + worker thread to do most of the workload with CONFIG_NET_WORKER_THREAD + option in Kconfig. Eliminated a problem with PHY DP83848C : it doesn't + need a specific initialization on mbed. Critical bugfix: From time to + time (after some hours) the Ethernet receiver would lose one receive + interrupt and the IP stack never recover because there is no receive + watchdog as the transmit watchdog. From Max (2013-7-24). + * audio/pcm_decode.c: Add missing audio callback forwarding logic + (2014-7-25). + * arch/arm/armv7-a/l2cc_pl310.h: Move arch/arm/sama5/chip/sam_l2cc.h to + arch/arm/armv7-a/l2cc_pl310.h. Adjust the two corresponding Kconfig + files as well (2014-7-25). + * arch/arm/src/armv7-a/arm_l2cc_pl310.c, l2cc.h, l2cc_pl310.h, Kconfig: + Add initial support for the ARM L2CC-PL310 L2 cache (2014-7-26). + * arch/arm/src/armv7-a/cp15_cacheops.h: Rename ARMv7-A cache.h to + cp15_cache.h. Things will be broken on this commit until I get the + new cache.h in place (2014-7-26). + * arch/arm/src/armv7-a/cache.h: New cache.h file. Renames all functions + like cp15_XYZ_cache() to arch_XYZ_cache() and adds L2 cache support if + L2 cache is enabled (2014-7-26). + * arch/arm/src/sama5/*.c (many files): Change naming from cp_XYZ_cache() + to arch_XYP_cache() so that all cache operations will pick up L2 + support if it is enabled (2014-7-26). + * arch/arm/src/sama5/sam_boot.c: Enables cache early in boot-up sequence + (2014-7-26). + * arch/arm/src/armv7-a/arm_l2cc_pl310.c and l2cc.h: Minor bugfixes/ + improvements (2014-7-26) + * arch/arm/src/armv7-a/Kconfig: L2 Cache currently depends on + EXPERIMENTAL because it does not yet work properly (2014-7-26). + * include/nuttx/audio/audio.h: Move sub-sampling rate definitions from + nxplayer.h to audio.h (2014-7-17). + * audio/pcm_decode.c: PCM: First cut at fast forward by sub-sampling. + This design is overkill: It manages too many audio buffers. I think + that a cleaner design could do all sub-sampling in place without + managing additional audio buffers (2014-7-27). + * drivers/audio/audio_null.c: Was not returning buffers to the upper + level (2014-7-27) + * include/nuttx/audio/audio.h and audio/pcm_decode.c: Misc bugfixes + while integrating fast forward by sub-sampling (2014-7-27). + * audio/pcm_decode.c: Back out a change; the fix really belongs in + NxPlayer. (2014-7-27). + * arch/arm/src/lpc17xx/lpc17_adc.c and arch/arm/src/lpc17xx/lpc17_ethernet.c: + ADC updates from Max. Also fixes some syntax errors that I introduced in + the last commit (2014-7-28). + * audio/pcm_decode.c: Fix a logic error in a DEBUG assertion (2014-7-28). + * configs/sama5d4-ek/src/sam_pmic.c, dram_main.c, sama5d4-ek.h, Makefile. + Add logic to disable the faulty PMIC. This must be done with JP23 open. + It is performed only from the DRAMBOOT loader (2014-7-28). + * drivers/audio/wm8904.c: Fix some compile problems with the WM8904 driver + due to recent audio subsystem changes (2014-7-28). + * arch/arm/src/sama5/sam_timerisr.c and configs/sama5d3*/include/board*.h: + Correct system timer frequency. Input clock is MCK/2, not MCK + (2014-7-29). + * fs/fs_automount.c and include/nuttx/fs/automount.h (plus hooks in other + files): Add support for an auto-mounter that will automatically mount + and unmount a file system a media is inserted and removed (2014-7-29 . + * configs/sama5d4-ek/src/sam_automount.c: Add automounter support for + HSMCI0 and HSMCI1 (2014-7-29). + * configs/sama5d4-ek/Kconfig and src/sam_hsmci.c: Minor warning/latent + bug clean-up of auto-mounter logic (2014-7-29). + * configs/sama5d4-ek/README.txt anand src/sam_nsh.c, fs/fs_automount.c, + and include/nuttx/fs/automount.h: Cosmetic updates to comments and + README files and some naming (2014-7-29). + * configs/sama5d4-ek/nsh/defconfig and nxwm/defconfig: The SAMA5D4-EK + NSH and NxWM configurations now have the auto-mounter configured to + automatically mount the FAT file system on HSMCI0 at /mnt/sdcard + (2014-7-29). + * arch/arm/src/sama5/sam_hsmci.c: Add method to do RX transfer without + DMA. The 8-byte SCR transfer was failing silently with the DMA + transfer, leaving the SD card in single bit mode (2014-7-29). + * arch/arm/src/sama5/sam_hsmci.c: Fix a problem on card insertion/removal + callback handling. Interrupts were being disable so that the callbacks + occurred with interrupts disabled. This resulted in loss of some + interrupts and some not-so-good behaviors. The solution is to perform + all callbacks on the work thread unconditionally (2014-7-30). + * nuttx/fs/fs_automount.c: Auto-mounter: Fix state setting. Not + harmful other than it can cause a debug assertion to fire if you + manually unmount the media before removing it which is, of course, + what you are supposed to do (2014-7-30). + * arch/arm/src/sama5/sam_hsmci.c and README files: Re-enable TX DMA and + verify that DMA writes to the SD card are functional. They are so now + TX DMA is re-enabled in the driver. This might affect the SAMA5D3 + platforms where the TX DMA problem was found. The SAMA4D3 and 4 use + the same HSMCI driver. Much has change since then and it is not + surprising that DMA is now functional. However, the has not be re- + verified on the SAMA5D3 which has a different DMA controller + (2014-7-30). + * arch/arm/src/sama5/sam_dmac.c, sam_pio.c, and sam_pioirq.c: Changes + needed for a clean SAMA5D3 build after all of the recent SAMA5D4 + changes (2014-7-31). + * configs/sama5d3x-ek/nsh/defconfig: Refresh configuration (2014-7-31). + * configs/sama5d3x-ek/Kconfig, README.txt, src/sam_wm8904.c, Makefile, + sam_nsh.c, and sama5d3x-ek.h: Add support for the WM8904 audio CODEC + (2014-7-31). + * configs/sama5d3x-ek/nxplayer: Add a configuration to support the + command line NxPlayer (2014-7-31). + * audio/audio.c: More debug output (2014-7-31). + * configs/sama5d3x-ek/README.txt: REAME update (2014-7-31). + * drivers/audio/wm8904.c: Was not saving I2S interface instance + (2014-7-31). + * sched/sem_wait.c: Use set_errno() and get_errno(). Direct access + inside the OS may not be supported in the future (2014-7-31). + * drivers/audio/audio_null.c, vs1053.c, wm8904.c, include/nuttx/audio/audio.h, + libc/audio/lib_buffer.c: Change how the end of the audio stream is + detected by the leaf audio component. This used to be done by looking + for the first partial buffer. That does not work with the in-place + sub-sampling performed by the PCM decoder: That always reduces the + size of the buffer so that all buffers only partially filled by the + time they get to the leaf. Now, a flag is set in the audio buffer + flags set to indicate the final buffer in the stream (2014-7-31). + * arch/arm/src/sama5/sam_ssc.c: Needs to account for data offset in + audio buffer (2014-7-31). + * drivers/audio/wm8904.c: Can't reset the WM8904 unless we also + reinitialize all registers. Try to get a saner timeout based on + sample rate, bits-per-sample, and buffer size (2014-7-31). + * arch/arm/src/sama5/Kconfig and sam_ssc.c: SCC Frame Synch Delay and + Start Delay are now configurable (2014-8-1). + * drivers/audio/wm8904_debug.c: Add logic to dump WM8904 registers + (2014-8-1). + * drivers/audio/wm8904.c: Fix an error in write logic. I am not sure + why this fixes the problem (2014-8-1). + * include/nuttx/audio/wm8904.h (and implementers of the interface): + the WM8904 driver needs to know the frequency of the MCLK in order + to set up the FLL to generate the correct bitrate (2014-8-1). + * WM8904: Add an option to control WM8904 register dumping (2014-8-2). + * WM8904: Add logic to program the FLL to achieve the bitrate + (2014-8-1). + * arch/arm/src/sama5/sam_ssc.c: Verify that the requested bit width + is supported. Correct some alignment tests that depend upon the data + bit width (2014-8-2). + * audio/pcm_decode.c: Correct the end of audio stream handling. It was + not being detected before so that logic was not examining the WAV + header in the first buffer of the next audio file (2014-8-2). + * configs/sama5d3x-ek/nxplayer/defconfig: Update with last WM8904 + settings (2014-8-2). + * drivers/audio/wm8904.c: Disable the FFL at the end of playing + (2014-8-2). + * include/nuttx/audio/wm8904.h: Fix wm8904_dump_registers macro: + Wrong number of parameters (2014-8-2). + * arch/arm/src/sama5/sam_pck.* and all SAMA5D board header files: + Add Main clock as an option for the PCK clock source (2014-8-3). + * configs/sama5d*-ek/Kconfig and src/sam_wm8904.c: Add option to + use MAINCK as source fort he WM8904 MCLK (2015-8-3). + * include/nuttx/audio/wm8904.h, configs/sama5d3x-ek/src/sam_wm8904.cm, + and sama5d4-ek/src/sam_wm8904.c: WM8904 interface enable method now + returns the previous interrupt state (2014-8-4). + * configs/sama5d3x-ek/src/sama5d3x-ek.h and sama5d4-ek/src/sama5d4-ek.h: + Correct the WM8904 interrupt configuration, active high level. Fix + that and don't pull-up (2014-8-4). + * configs/sama5d3x-ek/src/sam_wm8904.cm, and sama5d4-ek/src/sam_wm8904.c: + Correct ordering of some WM8904initialization: Need to provide MCLK + before initializing the WM8904, not after (2014-8-4). + * drivers/audio/wm8904.c and .h: Correct calculation of bitrate (I am + not sure why this is correct). LR clock divisor is now a constant 32- + bits per frame. Conditioned out interrupt logic; it is not being used. + Also added some FLL lock interrupt/poll logic (which was subsequently + disabled) (2014-8-4). + * SAMA5D3x-EK and SAMA4D4-EK: Add/update usage documents for media + players (2014-8-4). + * drivers/audio/wm8904.c and .h: Add reset logic to put the part back + in its initial state after playing each WAV file. Base samples per + second on frame length, not bits-per-sample. Use a different frame + length for 8-bit and 16-bit data (2014-8-4). + * arch/arm/src/sama5/sam_hsmci.c: TX DMA is again disabled for the + SAMA5D3 family. Although it works with the SAMA5D4 (which has a + different DMA subsystem), it does not work with the SAMA5D3 (2014-8-5, + see also 2014-7-30). + * audio/pcm_decode.c: Handle errors in the PCM WAV file in a way that + the Nxplayer can recover gracefully: Send and Audio Complete message + (2014-8-5). + * arch/*/src/*/*_timerisr.c, up_initialize.c, and up_internal.h: Re-name + up_timerinit() to up_timer_initialize() for compatibility with new + tickless OS interface name (2014-8-6). + * arch/*/src/*/Make.def: Don't build existing timer initialization + logic if CONFIG_SCHED_TICKLESS is defined (2014-8-6). + * include/nuttx/arch.h: First cut at platform-specific interfaces + needed to support tickless OS option (2014-8-6). + * sched/Kconfig: Add a new option CONFIG_SCHED_TICKLESS to enable the + tickless OS. This is a work in progress but should be relatively + safe since the new features are only enabled by this option (Safer + but not 100% safe since it does not protect from typos and other + dumb errors) (2014-8-6). + * arch/sim/src/Makefile, up_idle.c, up_internal.h, and up_tickless.c: + Add support for a simulated interval timer support verification of + the tickless OS (2014-8-6). + * include/nuttx/arch.h: Added another tickless OS interface to get + the timer remaining on the interval timer (2014-8-6). + * include/nuttx/clock.h, sched/clock_initialize.c and clock_internal.h: + If CONFIG_SCHED_TICKLESS is defined, then the global variable + g_system_timer does not exist (2014-8-6). + * sched/Makefile: Don't build in sched_processtimer.c if + CONFIG_SCHED_TICKLESS is selected (2014-8-6). + * sched/clock_gettime.c and clock_settime.c: Use the clock_systimer() + macro, do access the g_system_timer() global directly (2014-8-6). + * sched/clock_systimer.c: Uses interval timer interfaces to get the + time if CONFIG_SCHED_TICKLESS is selected (2014-8-6). + * sched/sched_timerexpiration.c, Makefile, os_internal.h, + sched_addreadytorun.c, sched_processtimer.c, sched_unlock.c, + wd_cancel.c, wd_internal.h, and wd_start.c: Implements the + tickless OS (2014-8-7). + * Many files: Remove CONFIG_DISABLE_CLOCK. Why? This option is not + really very useful and was only selected in a few unusable, mostly + unusable configurations anyway (m9s12/ostest, kl25z/minnsh, + z180/ostest, 8051, sh1, z80, and z8). The only real loss is probably + to the kl25z/minsh configuration . And with the addition of the + tickless OS, I just wanted to make the pain go away (2014-8-7). + * Many files: Change CONFIG_MSEC_PER_TICK to CONFIG_USEC_PER_TICK. + This gives more options for system timers in general, but more + importantly, let's us realize higher resolution for the case of + CONFIG_SCHED_TICKLESS=y -- of course, at the risk of some new + integer overflow problems 2014-8-7). + * Many files: Change all time conversions. Yech. New timer units + in microseconds breaks all existing logic that used milliseconds + in the conversions. Something likely got broken doing this, + probably because I confused a MSEC2TICK conversion with a TICK2MSEC + conversion (2014-8-7). + * arch/sim/src/up_tickless.c and sched/sched_timerexpiration.c: The + tickless OS now appears fully functional and passes the OS test + on the simulator with no errors (2014-8-7). + * sched/mqueue: Move POSIX message queue files from sched/ to + sched/mqueue (2014-8-8). + * sched/signal: Move signal-related files from sched/ to sched/signal + (2014-8-8). + * sched/pthread: Move all pthread files from sched/ to sched/pthread + (2014-8-8). + * sched/semaphore: Move POSIX counting semaphore files from sched/ to + sched/semaphore (2014-8-8). + * sched/environ: Move environment files from sched/ to sched/environ + (2014-8-8). + * sched/group: Move group logic from sched/ to sched/group (2014-8-8). + * sched/wdog: Move watchdog functions from sched/ to sched/wdog + (2014-8-8). + * sched/irq: Move interrupt dispatch logic from sched/ to sched/irq + (2014-8-8). + * sched/clock: Move clock functions from sched/ to sched/clock + (2014-8-8). + * sched/timer: Move POSIX timer files from sched/ to sched/timer + (2014-8-8). + * sched/paging: Move page fill sources from sched/ to sched/paging + (2014-8-8). + * sched/init: Move initialization functions from sched/ to sched/init + (2014-8-8). + * sched/errno: Move errno related files from sched/ to sched/errno + (2014-8-8). + * sched/task: Move task control files from sched/ to sched/task + (2014-8-8). + * sched/: Move a few files in sched/ that did not seem to have a home to + sched/signal and sched/task (2014-8-8). + * sched/sched: Move scheduler files from sched/ to sched/sched + (2014-8-8). + * (Many files): Replace os_internal.h with sched/sched.h in files that + actually reference something in sched.h (2014-8-8). + * sched/task/exit.c: Move sched/exit.c to sched/task/exit.c (2014-8-8). + * (Many files): Remove os_internal.h it has been replace by several new + header files under sched/. There have been some sneak inclusion paths + via os_internal.h, so expect a few compilation errors for some + architectures (2014-8-8). + * Documentation/NuttxPortingGuide.html, arch/sim/src/up_tickless.c, and + include/nuttx/arch.h: Fix errors in documentation and comments related + to the Tickless OS. From Vijay Kumar (2014-9-9). + * arch/arm/src/sama5/sam_tc.c and .h: Can now handle non-constant + BOARD_MCK_FREQUENCY. Also now supports methods to attach user + interrupt handlers (2014-8-9). + * drivers/audio/audio_null.c: Fix an error in a variable name + (2014-8-9). + * arch/arm/src/sama5/sam_oneshot.c, .h, Kconfig, Make.defs, sam_tc.c, + .h, and sam_adc.c: Add support for a one-shot timer wrapper around + the low-level timer/counter logic. This also involved several changes + that rippled into the ADC driver (untested) (2014-8-9). + * arch/arm/src/sama5/sam_freerun.c, .h, Kconfig, and Make.defs: Add + support for a free-running timer wrapper around the low-level + timer/counter logic (2014-8-9). + * arch/arm/Kconfig, src/sama5/sam_tickless.c, Kconfig, Make.defs: Use + the one-shot and free-running timers to implement tickless OS support + for SAMA5 (2014-8-9). + * arch/arm/src/sama5/sam_oneshot.c and sam_tc.c: Fix several bugs in + timer/counter interrupt logic and one-shot timer logic. Comments and + debug output updated in additional files (2014-8-10). + * sched/wdog/wd_start.c: Correct a bug in Tickless OS support: logic to + detect changes in head of timer list was wrong (2014-5-10). + * sched/sched/sched_timerexperation.c, sched.h, and wdog/wd_start.c: In + tickless mode, need to stop the interval timer before inserted a new + delay into the timer list. Otherwise, the time is incorrect on the + first entry of the list (2014-8-11). + * arch/arm/src/sama5/sam_freerun.c and sam_oneshot.c: Correct bad time + conversion, 1000000 not 1000 to convert seconds to microseconds + (2014-8-11). + * sched/sched/sched_timerexpiration.c: Fix inaccurate time conversion. + Remove MSEC_PER_TICK from calculation and convert uint32_t to uin64_t + (2014-8-11). + * libc/time/lib_localtime.c, private.h, tzfile.h and several header and + make-related files: Adds support for localtime. From Max Neklyudov + (2014-8-12) + +7.5 2014-09-28 Gregory Nutt + + * clock/clock_systimespec.c and sched/clock/clock_gettime.c: When + reading the system timer, don't read a struct timespec, convert it + to a fake tick count, then back to a timespec (2014-8-15). + * sched/clock/Make.defs, clock_gettime.c, clock_settime.c, include/time.h, + nuttx/clock.h, configs/vsn/src/sif.c: Remove CLOCK_ACTIVETIME. It is non- + standard, unused, and gets in the way of maintaining clocks (2014-8-15). + * libc/time/lib_localtime.c: Modified to that the coding style is much + closer to NuttX coding style. The local header files private.h and + tzfile.h were removed and incorporated into lib_localtime.c. All + conditional compilation within lib_localtime.c that unconditionally + evaluated to FALSE was removed (2014-8-15). + * drivers/net/Kconfig and include/nuttx/arch.h: Standardize a PHY + interrupt attachment interface (2014-8-16). + * configs/Kconfig, sama5d3-xplained, sama5d3x-ek, and sama5d4-ek: + Convert existing board specific PHY interrupt interfaces to use newly + defined standard interface (2014-8-16). + * include/net/slip.h: Move SLIP prototypes from net.h to slip.h + (2014-8-16). + * include/net/net.h and net/: Fix some missing function headers + (2014-8-16). + * drivers/net/phy_notify.c, include/nuttxarch.h, net/phy.h, and + ioctl.h: Add support for an ioctl that can be used to notify an + application when there is a change in the network status signalled + by a PHY interrupt (2014-8-16). + * drivers/net/phy_notify.c, include/net/if.h, ioctl.h, netdev.h, phy.h, + and net/netdev/netdev_ioctl.c: Finishes the ioctl definition to + subscribe to PHY events. Revamp network ioctl signature to support + arguments other than struct mii_ioctl_data (2014-8-16). + * arch/arm/src/stm32/stm32_eth.c: Modified to support the change to the + network ioctl signature changes. Also add support for new ioctl to + setup PHY event notifications (2014-8-16). + * arch/arm/src/sama5/sam_emaca.c, sam_emacb.c, and sam_gmac.c: Implement + all network ioctls, including the new ioctl to setup PHY event + notifications (2014-8-16). + * include/net/if.h: Add some helper macros to make the code that uses + the ioctls a little more compact (2014-8-17). + * libc/stdio/lib_sscanf.c: NuttX libc tried to guess how many characters + to parse, extracted them into a buffer, then ran strtol() on that + buffer. That guess is often wrong. A better approach would be to + call strtol() directly on the input data, using the endptr return + value to determine how many characters to skip after parsing. From + Kosma Moczek (2014-8-18). + * net/arp/arp_dump.c: Add missing configuration option to select + dumping of ARP packet headers. Move ARP dumping logic from + arp_inout.c to its own file (2014-8-18). + * net/arp/arp_out.c: Move arp_out() from arp_inout.c to its own file + (2014-8-18). + * net/arp/arp_arpin.c: Move arp_arpin() from arp_inout.c to its own file + (2014-8-18). + * net/arp/arp_ipin.c: Rename arp_inout.c to arpipin.c because that is + all that is left in the file (2014-8-18). + * net/arp/arp_format.c: Move the logic that formats an ARP packet into a + separate file where it can be re-used. (2014-8-18). + * net/arp/arp_out.c and net/pkt/pkt_send.c: Change how the IFF_NOARP + flag is handled. This should be set only when data is moved into the + buffer and cleared after tested by the ARP logic. Setting it globally + can cause packets to be sent with no valid MAC addresses (2014-8-18). + * net/arp/arp_send.c: Partial implementation of logic to send ARP + requests to assure that an IP address mapping is present in the ARP + table (2014-8-18). + * net/arp/arp_poll.c: Finished the implementation of logic to send ARP + requests. Complete, fully hooked into the networking logic, and ready + for test (but still untested) (2014-8-18). + * net/icmp/icmp_ping.c, net/socket/net_sendfile.c, sendto.c, + net/tcp/tcp_send_buffered.c, and tcp_send_unbuffered.c: If + CONFIG_NET_ARP_SEND is enabled, then all ICMP, TCP, and UDP send + operations will call arp_send() before attempting the real send + operation. arp_send() will check if the IP address mapping is in + the ARP table and, if not send ARP requests periodically until it is. + This eliminates losing the first outgoing message because there is not + mapping in the ARP table (2014-8-18). + * net/arp/arp_notify.c, arp_send.c, arp_arpin.c, and arp.h: Add + signalling logic so that we do not have to wait so long with the + network responses to ARP requests quickly (2014-8-19). + * include/nuttx/lcd/ili9341.h: Add a register definition header file + for the ILI9341 LCD (2014-8-19). + * net/arp/Kconfig: ARP request logic is no longer EXPERIMENTAL + (2014-8-20). + * net/arp/arp_send.c: ARP request logic needs to do the right thing if + (1) the address is a broadcast or multicast address, and (2) if the + IP address lies outside of the network. Problem noted by Manuel Stuehn + (2014-8-20). + * configs/sam4e-ek/src/Kconfig and src/sam_ili9341.c: Add ILI9341-based + LCD driver. Fully functional (2014-8-20). + * configs/sam4e-ek/nxwm: Add an NxWM configuration for the SAM4E-EK + (2014-8-21). + * configs/viewtool-stm32f107: Refresh some configurations (2014-8-20). + * nuttx/sched/wdog: If we run out of pre-allocated watchdog times, the + logic will allocate additional timers from the heap. A reserve of + pre-allocated watchdog timers is maintained so that there will always + be timers available for interrupt handlers (2014-8-21). + * include/nuttx/wdog.h (and many affected files): wdog.h does not + contain any application interface, only internal OS interface. + Further, it is non-standard. Move wdog.h from include/ to + include/nuttx (2014-8-21). + * Documentation/NuttxPortingGuide.h: For the same reason as above, move + the description of the watchdog timer interfaces from the Users Guide + to the Porting Guide (2014-8-21). + * arch/arm/src/stm32/stm32_uart.h: STM32 F401: Correct support for + USART6 on this chip. From Freddie Chopin (2014-8-22). + * nuttx/sched/wdog and include/nuttx/wdog.h: Add support for statically + allocated watchdog timer (also eliminate some unconventional typing) + (2014-8-22). + * configs/p112/ostest and tools/mkdeps.c: Changes to try to get P112 to + compile with latest SDCC (it still does not) (2014-8-22). + * sched/group/group_leave.c: Need to release the address environment when + the task group is released (2014-8-22). + * mm/mm_granreserve.c and and mm_granmark.c: gran_reserve(): Add a + new function to reserve unallocatable regions in the granule heap + (2014-8-23). + * include/nuttx/pgalloc.h and mm/mm_pgalloc.c: Add a simple page + allocator based on the existing NuttX granule allocator. I am not + certain if the granule allocator is sufficiently deterministic for + long range use, but it gets get a page allocator in place for testing + very quickly (2014-8-23). + * ARMv7-A: Add skeleton implementation and build support for process + address environments (2014-8-23). + * Many files: Change CONFIG_ADDRENV to CONFIG_ARCH_ADDRENV; change how + it is selected -- the architecture must first declare support + (2014-8-24). + * include/nuttx/addrenv.h, arch/arm/include/arch.h, armv7-a/irq.h, and + other files: Add addrenv.h; First cut at Cortex-A address environment + structures; Add configuration options to setup address environment + (2014-8-24). + * addrenv interface changes: up_addrenv_create() may need to create + .text and .bss/.data separately because of differing access privileges + (read/execute vs read/write). And, as a consequence, up_addrenv_vaddr() + needs to be split into up_addrenv_vtext() and up_addrenv_vdata(). + Affects several files (2014-8-24). + * arch/arm/src/armv7-a/arch_coherent_cache.c: New file. These cache + operations are called from the ELF loader in order to flush D-cache + and invalidate I-cache after an ELF module has been loaded into memory. + With this change, ELF modules work correctly on the SAMA5/Cortex-A + platform (2014-8-24). + * configs/sim: Add build support for ELF modules. Useless at the moment + because there is no x86 relocation logic support (2014-8-25). + * configs/sim: Update some sim/ defconfig files. This now automatically + switches them to x86_64 builds (2014-8-25). + * arch/arm/include/arch.h, armv7-a/irq.h, src/armv7-a/arm_addrenv.c, + armv7-a/arm_mmu.c/.h, sama5/Kconfig, Make.defs, sam_pgalloc.c, + include/nuttx/addrenv.h, arch.h, pgalloc.h, mm/Kconfig, mm_pgalloc.c, + sched/init/os_start.c: Cortex-A/SAMA5 address environment support is + code complete (untested) (2014-8-25). + * arch/arm/include/tiva and src/tive: Add support for the TI CC3200. + From Jim Ewing (2014-8-26). + * configs/cc3200-launchpad: Add support for the TI CC3200 Launchpad. + From Jim Ewing (2014-8-26). + * arch/*/*_blocktask.c, arch/*/*_unblocktask.c, and arch/*/*_exit.c: + Add address environment support to all implementation of up_block_task(), + up_unblock_task(), and _exit() (2014-8-31). + * arch/arm/src/stm32/stm32_flash.c and chip/stm32_flash.h, + include/nuttx/progmem.h, and configs/vsn/src/sif.c: STM32 FLASH fixes: + use size_t instead of uint16_t, make interface more generic. From + Freddie Chopin (2014-8-28). + * Kconfig, Makefile.unix, Makefile.win, syscall/Kconfig, + arch/arm/src/armv6-m/svcall.h, up_svcall.c, armv7-m/svcall.h, and + up_svcall.c: The system call library can now be built with + CONFIG_NUTTX_KERNEL. New selection: CONFIG_LIB_SYSCALL (2014-8-28). + * arch/arm/src/armv7-a/syscall.h: "Add an ARMv7-A system call definition + header file (2014-8-28). + * arch/arm/include/armv7-a/irq.h, arm_syscall.c, syscall/Kconfig, + syscall_funclookup.c, syscall_nparms.c, and syscall_stublookup.c: + ARMv7-A: Add SYSCALL handling logic (2014-8-28). + * nuttx/fs/, drivers/, and sched/: Remove explicit references to errno. + That is a problem from within the kernel for certain configurations + (there are still more references to be fixed) (2014-8-28). + * sched/clock/clock.h: In some configurations, g_system_tmer must be + extern'ed as a private variable in the OS (2014-8-28). + * include/errno.h and nuttx/clock.h: errno and g_system_timer must be + handled in a special way if there are external modules (2014-8-28). + * include/sys/syscall.h: System definitions should depend on + CONFIG_LIB_SYSCALL not CONFIG_NUTTX_KERNEL (2014-8-28). + * arch/arm/src/armv7-a: Rename syscall.h to svcall.h to work around + some include path name collisions; fix some compilation errors in + SYSCALL logic when debug is enabled (2014-8-29). + * arch/arm/include/arm/syscall.h and armv7-a/syscall.h: Fix ARM7/9 + and Cortex-A SYSCALLs: For threads in SVC mode, the SVC instructions + clobbers R14. This must be taken account in the inline assembly + (2014-8029). + * arch/arm/src/armv7-a/arm_syscall.c: Fix hard coded values in + dispatch_syscall() inline assembly. Back out/correct part of last + change; that was going the wrong direction. With this change, the + apps/examples/elf test works with address environments and call + gates! (2014-8029). + * Many, many files: Renamed CONFIG_NUTTX_KERNEL to CONFIG_BUILD_PROTECTED. + Added configuration CONFIG_BUILD_KERNEL that will be used to generate + a kernel (only) with full process support and will execute programs + only from a file system. This new configuration is defined but only + partially integrated (2014-8-29). + * tools/refresh.sh: Add a tool to make refreshing configurations easier + when you want to do a lot of them (2014-8-29). + * tools/mksyscall.c: Build syscalls that do not need header files (there + are none, however) (2014-8-30). + * include/nuttx/errno.h syscall/syscall.csv and syscall_funclookup.c: + Yet more issues with errno access via syscalls fixed (2014-8-30). + * Makefile.unix, Makefile.win, Directories.mk, FlatLibs.mk, ProtectedLibs.mk, + and KernelLibs.mk: Separate the common directory selection logic + into Directories.mk; add support for kernel build. Move library + selection logic in common *.mk files, one each for flat-, protected-, + and kernel- mode builds (2014-8-30). + * include/nuttx/syscall.h syscall/syscall.csv: clock_systimer needs the + same fix as for get/set_errno when used with system calls (2014-8-30). + * sched/Kconfig sched/init/os_bringup.c tools/cfgdefine.c: Add + configuration options to start the system from a program on a file + system (2014-8-30). + * mm/ and include/nuttx/mm.h: Remove CONFIG_MM_MULTIHEAP. Non-multiheap + operation is no longer supported (2014-8-31). + * configs/sama5d4-ek/kernel: Add a configuration for testing the + kernel build configuration (still a work in progress) (2014-8-31). + * include/nuttx/arch.h, kmalloc.h, mm.h, sched/init/os_start.c, + sched/sched_free.c, and arch/arm/src/sama5/sam_allocateheap.c: Clean + up some kernel build heap allocation issues. The Cortex-A kernel + build now compiles without errors (but cannot link until brk() and + sbrk() are implemented) (2014-8-31). + * mm/*mm_brkaddr.c, *mm_extend.c, Makefile, and include/nuttx/mm.h: Add + low-level memory management hooks that will be needed to support brk() + and sbrk() (2014-8-31). + * Rename krealloc() to kmm_realloc() and kmemalign to kmm_memalign() for + consistency with the rest of the naming (2014-8-31). + * Rename kurealloc() to kumm_realloc(), kumemalign to kumm_memalign(), + and kufree to kumm_free for consistency with the rest of the naming + (2014-8-31). + * Rename kumalloc() to kumm_malloc() and kuzalloc to kumm_zalloc() for + consistency with the rest of the naming (2014-8-31). + * Rename kmalloc() to kmm_malloc(), kzalloc() to kmm_zalloc(), and + kfree() to kmm_free() and kuzalloc to kumm_zalloc() for consistency + with the rest of the naming (2014-8-31). + * mm/mm_sbrk.c, kmm_sbrk.c, umm_sbrk.c, and include/unistd.h: Initial + implementation of sbrk() (2014-9-1). + * arch/arm/src/armv7-a/arm_pgalloc.c, mm/umm_malloc.c, and mm_zalloc.c: + Completes the implementation of sbrk() (untested) (2014-9-1). + * configs/cc3200-launchpad: Updates to the CC3200-Launchpad configuration + for better compatibility. From Jim Ewing (2014-9-1). + * Removed all support from the 8051 from the NuttX source tree. The + obsoleted code along with the removal patch can now be found at + misc/Obsoleted/ (2014-9-1). + * sched/sched/sched_releasetcb.c and task_setup.c, include/nuttx/arch.h + and sched.h, and arch/*/*/*/Make.defs: There used to be two ways to + pass parameters to new tasks, depending upon the configuration: Either + (1) argv[] as created as an array with each string strdup'ed. Or (1) + argv[] array and strings were created on the stack before the new task + was started. Now, there is only one way, way (1). Way (2) might be + slightly more compact, but this is not worth carry the complexity of + two different ways of doing the same thing (2014-9-1). + * sched/init/os_start.c: Fix error in initialize of IDLE TCB due to last + change. The argument list is no long in the TCB, but in the stack. + But not for the IDLE task. It needs its own mini-argv[] list so that + it looks more like other threads (2014-9-1). + * arch/arm/src/armv7-a/arm_addrenv.c, include/nuttx/addrenv.h, and + mm/umm_*.c: Space at the beginning of the process data space is now + reserved for user heap management structures. In the kernel build + mode, these heap structures are shared between the kernel and use + code in order to allocate user-specific data (2014-9-2). + * include/unistd.h, nuttx/mm.h, and kmalloc.h, sched/init/os_start.c + and sched/sched/sched_free.c, mm/kmm_sbrk.c and mm_sbrk.c, and + arch/arm/src/sama5/sam_allocateheap.c: Restructuring of build to + allow use of use-space allocators by kernel logic in the kernel + build (2014-9-2). + * arch/arm/include/armv7-a/irq.h, arm_syscall.c, crt0.c, + include/nuttx/addrenv.h, and mm/umm_*.c: Add support for delivery + of use-mode signals in the kernel build (2014-9-2). + * mm/mm_graninit.c: Granule allocator initialization uses wrong + allocator to setting aside kernel memory (2014-9-3). + * sched/init/os_start.c: IDLE TCB setup needs to indicate that the + IDLE thread is a privileged, kernel thread (2014-9-3). + * include/nuttx/sched.h: Add a flag to group structure: If the group + is created by a kernel thread, then all resources in the group must + be privileged (2014-9-3). + * sched/group/group_malloc.c, group_zalloc.c, group_free.c, + group_create.c, group.h: Group creation logic must use new group flag + when allocating resources so that the privileges on the resource are + set correctly (2014-9-3). + * sched/Kconfig and sched/init/os_bringup.c: Add capability to perform + initial board initialization on a separate worker thread (2014-9-3). + * tools/mkexport.sh: Fix 'make export'. Adding subdirectories to the + sched/ directory broke the header file collection logic (2014-9-4). + * Makefile.unix, Makefile.win, FlatLibs.mk, KernelLibs.mk, and + ProtectedLibs.mk: In the kernel or protected builds, only the user + libraries should be exported (2014-9-4). + * Makefile.unix, Makefile.win, and tools/mkexport.sh: In 'make export', + do not copy internal header files or build scripts if this is a + kernel or protected build (014-9-4). + * tools/mkexport.sh, arch/*/src/Makefile, arm/src/a1x/Make.defs, + sama5/Make.defs, armv7-a/crt0.c: The 'make export' target needs to + bundle up the user C startup file (crt0), not the kernel head object + for the kernel and protected builds (2014-9-4). + * tools/mkexport.sh: Add .config file to export package (2014-9-5). + * configs/16z: Support for this board has been removed from the NuttX + source tree (but still can be found in the misc/Obsoleted directory). + This port is not ready for usage but may return to the NuttX tree + at some point in the future (2014-9-5). + * tools/Makefile.export and mkexport.sh: The apps/ import build requires + that we extract more information from the platform Make.defs file + (2014-9-5). + * tools/Makefile.export and mkexport.sh: Need to export the setting of + WINTOOL as well (2014-9-5). + * SAMA5D4-EK kernel configuration now builds NSH instead of examples/elf + (2014-9-6). + * libc/pthread/pthread_attrinit.c, sched/pthread/pthread_create.c, and + include/nuttx/pthread.h: Fix some conditional compilation in kernel + build mode. And, while we are touching this logic, make + g_default_pthread_attr const (2014-9-7). + * arch/arm/src/armv7-a/arm_addrenv.c: Correct size comparison (pages vs. + sections) (2014-9-7). + * configs/sama5d4-ek/src/sam_bringup.c and sama5d4-ek.h: Need to call + elf_initialize() on bring-up before attempting to load ELF modules + (2014-9-7). + * arch/arm/src/armv7-a/arm_addrenv.c: Fix loop counter... was overrunning + a table on larger ELF files (2104-9-7). + * arch/arm/src/sama5/sam_memories.c, sam_pgalloc.c, and sam_pgalloc.h: In + kernel build with address environment, need logic to map user virtual + addresses to physical addresses, and vice versa (2104-9-7). + * SAM3X/Arduino Due: Fix typo in sam3x_periphclks.h; add SCLK + definitions to board.h header file. From Fabien Comte (2014-9-8). + * Several pthread interfaces: Add const storage class to the phthread + parameters. From Freddie Chopin (2014-9-8). + * libc/math: Corrected atan2 implementations from Denis Arnst (2014-9-8). + * sama5d4-ek/knsh: Rename the kernel configuration to knsh to better + match the naming used with other platforms (2014-9-8). + * configs/cc3200-launchpad/README.txt: Add README file for the CC3200 + Launchpad (2014-9-9). + * configs/sama5d4-ek/README.txt, Kconfig, knsh/defconfig.ROMFS, + src/sam_bringup.c, and sama5d4-ek.h: SAMA5D4-EK kernel config can now + boot from a ROMFS file system (2014-9-9). + * LibTargets.mk, Makefile.unix, and Makefile.win: Move common library + targets out of Makefile.unix and Makefile.win into a new LibTargets.mk + (2014-9-9). + * LibTargets.mk and configs/sama5d4-ek/knsh/Make.defs: Add logic that will + permit us to build user libraries with different CFLAGS than kernel + code. This is needed because we need the -fno-common option when + building ELF code to prevent SHN_COMMON relocations (2014-9-8). + * binfmt/libelf/libelf_symbols.c, libelf_bind.c, and all implementations + of up_relocate(): ELF relocations. Some relocation types do not have + a named symbol associated with them. The design did not account for + that case (2014-9-9). + * binfmt/binfmt_execmodule.c: When allocating a stack for a new process + using the user-space allocator, need to select the address environment + first (2014-9-9). + * arch/Kconfig, arm/src/armv7-a/pginline.h, arm_addrenv.c, and + arm_pgalloc.c and include/nuttx/addrenv.h: Add configuration to use + the fixed DRAM mapping for the page pool (if available) instead of + remapping dynamically to access L2 page tables and page data. Also, + add logic in address environment creation to initialize the shared + data at the beginning of the .bss/.data process memory region + (2014-9-10). + * configs/sama5d4-ek/elf and knsh: These configurations now use the + fixed DRAM mapping for manipulating the page memory pool (2014-9-10). + * arch/arm/include/arch.h and src/armv7-a/arm_addrenv.c, + nuttx/binfmt/binfmt_execmodule.c, libelf/libelf_addrenv.c, + libelf_load.c, libnxflat/libnxflat_addrenv.c, include/nuttx/arch.h, and + mm/umm_initialize.c: Add logic to initialize the per-process user + heap when each user process is started (2014-9-10). + * sched/clock/clock.h, clock_initialize.c, and clock_settime.c: Remove + vestiges of g_tickbias; apply bias instead to g_basetime (2014-9-10). + * include/nuttx/lib.h, sched/init/os_start.c, and + configs/ea3131/locked/mklocked.sh: Replace the empty lib_initialize() + function with a pre-processor macro (2014-9-11). + * libc/misc/lib_stream.c: When a privileged thread exits, we have to use + the kernel allocator to free memory; when an unprivileged thread exits, + we don't have to do anything... heap memory will be cleaned up when the + address environment is torn down (2014-9-11). + * arch/arm/src/stm32/stm32_serial.c and chip/stm32f20xxx_rcc.h: Fix for + UART7 and UART8 on STM32 clock enable from Aton (2014-9-11). + * arch/arm/src/armv7-a/arm_vectors.S: ARMv7-A: Exception register + save/restore needs to work a little differently if we support user + mode processes (2014-9-11). + * configs/cc3200-launchpad/src/cc3200_leds.c and other board files: Add + LED support for the CC3200 Launchpad. From Jim Ewing (2014-9-11). + * arch/arm/src/armv7-a/arm_initialstate.c: All tasks, even user mode + tasks, must start in supervisor mode until they get past the start-up + trampoline (2014-9-11). + * arch/arm/src/armv7-a/arm_vectors.S: Fix logic for returning from + exceptions to user-mode contexts. NuttX processes are now functional + on the Cortex-A (2014-9-11). + * arch/arm/src/armv7-a/arm_fullcontextrestore.S, arm_syscall.c, crt0.c, + and svcall.h: Modify up_fullcontextrestore() for CONFIG_BUILD_KERNEL. + It changed CPSR while in kernel. That will crash if the new CPSR is + user mode while executing in kernel space. Fixed by adding a + SYS_context_restore system call. There is an alternative, simpler + modification to up_fullcontextrestore() that could have been done: It + might have been possible to use the SPSR instead of the CPRSR and then + do an exception return from up_fullcontextrestore(). That would be + more efficient, but I never tried it (2014-9-12). + * binfmt/libelf/libelf_load.c: ELF: Critical bugfix.. BSS was not being + cleared (2014-9-12). + * configs/sama5d4-ek/knsh/defconfig and defconfig.ROMFS: Enable NSH + file applications in these configurations (2014-9-12). + * libc/Kconfig, unistd/lib_execsymtab.c, configs/sim/nsh/defconfig, and + stm32f4discovery/posix_spawn/defconfig: Having a symbol table is an + option. There are no symbol tables with CONFIG_BUILD_KERNEL, for + example (2014-9-12). + * syscall/syscall.csv and include/sys/syscall.h: exevc, execvl, + posix_spawn, and posix_spawnp were not properly integrated as system + calls (2014-9-12). + * syscall/syscall_lookup.h: Fix typos in the stub lookup table + (2014-9-12). + * configs/stm32f4discovery/netnsh, Kconfig, README.txt, and + include/board.h: Add the network enabled NSH configuration for the + STM32F4Discovery board with the STM32F4DIS-BB base board installed + (2014-9-13). + * nuttx/mm/umm_sbrk.c: Fix a typo in use of a configuration setting + (2014-9-13). + * configs/stm32f4discovery/README.txt: Add STM32F4DIS-BB GPIO pin + usage (2014-9-13). + * arch/Kconfig, arch/arm/include/arch.h, src/armv7-a/arm_addrenv.c, + sama5/sam_pgalloc.c, and include/nuttx/addrenv.h: Add a configuration + option for dynamic stack management (stack management not yet + implemented) (2014-9-13). + * arch/Kconfig arm/src/armv7-a/addrenv.h, arm_addrenv.c, and + arm_addrenv_utils.c, a1x/Make.defs, and sama5/Make.defs, + include/nuttx/addrenv.h and arch.h: Move static helper routines from + arm_addrenv.c and may them global so that they can be shared by + forthcoming stack address environment logic (2014-9-13). + * arch/arm/src/armv7-a/arm_addrenv_stack.c, arm_addrenv.c, + a1x/Make.defs, sama5/Make.defs, and include/nuttx/arch.h: Add logic + needed to manage a virtualized stack. Not yet incorporated into + base OS logic (2014-9-13). + * sched/task/task_posixspawn.c: Kernel proxy thread should be a kernel + thread, not a user task (2014-9-14). + * include/sched.h and spawn.h, libc/Kconfig, spawn/Make.defs, + lib_psa_getstacksize.c, lib_psa_init.c, and lib_psa_setstacksize.c, + sched/task/Make.defs, task_create.c, and task_spawn.c: Don't build + task_create() or task_spawn() interfaces if there is an address + environment (2014-9-14). + * arch/arm/src/armv7-a/arm_addrenv_ustack.c, include/nuttx/addrenv.h, + arch.h, and other files: Rename everything associated with the dynamic + process stack to ustack to make room in the name space for a kstack + (2014-9-14). + * arch/arm/src/armv7-a/arm_addrenv_kstack.c, include/nuttx/addrenv.h, + arch.h, and other files: Add the initial implementation of the process + kernel stack logic. Not yet integrated into the main OS logic nor + tested (2014-9-14). + * binfmt/binfmt_execsymtab.c and Makefile, sched/task/task_execv.c, + task_posixspawn.c, and Make.defs, include/unistd.h, + include/nuttx/binfmt/symtab.h, and libc/unistd/Make.defs: execv() is + a basic system interface. It should not be in libc/ but rather in + sched/task. Its symbol table helper logic also belongs in the kernel + but belongs in binfmt/ with the other symbol table logic (2014-9-15). + * include/sys/syscall.h, syscall/syscall.csv, syscall_lookup.h, and + syscall_stublookup.c: execl() is not a system interface. It belongs + in libc and should not have a system call associated with it + (2014-9-15). + * arch/arm/include/armv7-a/irq.h and src/armv7-a/arm_syscall.c: If we + are configured to use a kernel stack while in SYSCALL handling, then + we need to switch back to the user stack to deliver a signal (2014-9-15). + * arch/arm/src/armv6-m/up_svcall.c, armv7-a/arm_syscall.c, and + armv7-m/up_svcall.c: Fix a typo in system call when fetching parameter + from the stack: regs[REG_PC]+4 is the address, not regs[REG_PC+4] + (2014-9-15). + * sched/sched/sched_releasetcb.c: Don't release user stack in kernel + build. Already destroyed with all of the address environment + (2014-9-15). + * arch/arm/src/armv6-m/up_signal_dispatch.c, src/armv7-a/arm_signal_dispatch.c, + and arch/arm/src/armv7-m/up_signal_dispatch.c: Move + common/up_signal_dispatch.c to armv6-m, armv7-m, and armv7-a. The + armv7-a version needs to be different to handle the case where we + are dispatch kernel mode signals when running under a user mode group + (2014-9-16). + * arch/arm/src/armv7-a/arm_syscall.c: Correct stack handling if signal + deliver to user processes (2014-9-16). + * arch/arm/src/armv7-a/arm_physpgaddr.c, pgalloc.h, sama5/sam_pgalloc.c, + and sam_pgalloc.h: Move some share-able logic from sama5/sam_pgalloc.c + to armv7-a/arm_physpgaddr.c (2014-9-16). + * arch/arm/src/sam34/sam_rtt.c: Only SAM4 family has RTTDIS bit in the + MR register. SourceForge bug #33 from Fabien Comte (2014-9-17). + * arch/arm/src/stm32/stm32_can.c: At the end of the interrupt handler, + the interrupts were being disabled, if all packets have been + transferred when the interrupt handler was invoked. This is + problematic, because the interrupt handler calls can_txdone of the + upper half which can enqueue new packets to send. Removed the block + altogether, because can_txdone calls can_xmit which disables + interrupts if there are no new packets to send. From Daniel Lazlo + Sitzer (2014-9-17). + * drivers/can.c: In can_txdone, waiters on the semaphore should be + informed regardless of the return value of can_xmit. First it returns + -EIO if there are no new packets, and second the information of the + waiters is about the last transferred packet. From Daniel Lazlo + Sitzer (2014-9-17). + * SAMA5D4-EK: Add documentation/support for Rev E. board. Refresh NSH + configuration. Fix some build errors/warnings introduced with recent + work with the knsh configuration (2014-9-17). + * arch/sim/Kconfig, src/up_spiflash.c, Makefile, up_initialize.c, and + up_internal.h: Emulated SPI FLASH driver for the sim target from Ken + Pettit (2014-9-19). + * configs/stm32f4discovery/include/board.h, netnsh/defconfig, + src/Makefile, stm32_sdio.c, stm32_boot.c, stm32_nsh.c, + stm32_bringup.c, and stm32f4discovery.h: STM32F4Discovery: Add + support for the microSD card slot on the STM32F4DIS-BB base board + (2014-9-20). + * Change all occurrences of NxConsole to NxTerm (2014-9-20). + * include/sys/ipc.h, shm.h, mman.h, and types.h: Add shared memory + definitions, types, prototypes (2014-9-22). + * fs/smartfs/smartfs_smart.c: SMART FS update from Ken Pettit + (2014-9-22). + * mm/mm_gran/: Move granule allocator and page allocator from mm/. to + mm/mm_gran/. (2014-9-22). + * mm/kmm_heap/: Move kernel heap allocator from mm/. to mm/kmm_heap/. + (2014-9-22). + * mm/umm_heap/: Move user heap allocator from mm/. to mm/umm_heap/. + (2014-9-22). + * mm/mm_heap/: Move common heap logic from mm/. to mm/mm_heap/. + (2014-9-22). + * mm/shm/: Create a home for forthcoming shared memory logic + (2014-9-22). + * fs/procfs/fs_procfs.c: Fix some procfs breakage introduced by + reorganizing some un-reorganizable data structures. From Ken + Pettit (2014-9-22). + * drivers/mtd/smart.c, fs/smartfs/smartfs.h, smartfs_procfs.c, and + smartfs_utils.c, include/nuttx/fs/ioctl.h, and mtd/smart.h: Updated + SMART FS procfs support. From Ken Pettit + * configs/mikroe-stm32f4: Fix a few compile bugs and minor corrections + to the mikroe-stm32f4 configuration source. From Ken Pettit + (2014-9-22). + * mm/Kconfig, shm/Make.defs, shmat.c, shmctl.c, shmdt.c, shmget.c, and + Documentation/NuttxUserGuide.html: Add the documentation, build + framework, and skeleton files for the shared memory feature (no logic + yet provided) (2014-9-22). + * include/sys/syscall.h, syscall/syscall.csv, syscall_lookup.h, and + syscall_stublookup.c: Add system calls for shared memory interfaces + (2014-9-22). + * include/nuttx/shm.h, mm/shm/shm.h, and shm_initialize.c: Add shared + memory initialization logic (2014-9-23). + * include/nuttx/arch.h, Documentation/NuttxPortingGuide.html, and + NuttxUserGuide.html: Add platform-specific interface definitions + needed to support the shared memory feature (2014-9-23). + * arch/arm/include/arch.h, src/armv7-a/addrenv.h, arm_addrenv.c, + arm_addrenv_ustack.c, and arm_addrenv_utils.c: Add logic necessary + to handle remapping of shared memory on context switches (2014-9-23). + * include/nuttx/gran.h, mm/mm_gran/mm_granrelease.c, and Make.defs: Add + interfaces to support un-initializing a granule allocator (2014-9-23). + * arch/arm/src/armv7-a/arm_pgalloc.cm sched/group/group_addrenv.c, and + other files: Fix some inconsistent field name in struct task_group_s: + addrenv should be tg_addrenv (2014-9-23). + * arch/arm/src/armv7-a/pgalloc.h: Extend virtual/physical address + conversions to include addresses in shared memory (2014-9-23). + * include/nuttx/shm.h, sched.h, mm/shm/shm_initialize.c, + binfmt/binfmt_execmodule.c, sched/group/group_leave.c: Add support + for a per-process virtual page allocator. This is a new member of + the task_group_s structure. The allocator must be initialized when a + new user process is started and uninitialize when the process group + is finally destroyed. It is used by shmat() and shmdt() to pick the + virtual address onto which to map the shared physical memory + (2014-9-23). + * mm/shm/shmat.c and shmdt.c: Completes the implementation of the core + shared memory logic: shmget(), shmctl(), shmat(), and shmdt(). This + is still some unfinished platform-specific code that needs to be done + before we can begin testing (2014-9-23). + * include/nuttx/mm: Move mm.h, gran.h, and shm.h from include/nuttx to + include/nuttx/mm (2014-9-24). + * arch/arm/src/stm32/stm32_can.c: STM32 CAN correction suggested by Max + Holtzberg (2014-9-24). + * arch/arm/src/armv7-a/addrenv.h, arm_addrenv_shm.c, + arm_addrenv_utils.c, and pgalloc.h: This completes the implementation + of shared memory support for the Cortex-A platforms (2014-9-24). + * fs/fs_poll.c: Fix unnecessary delays and timing jitter in the + implementation of poll(): No delay if timeout is zero; If timeout is + greater than zero, first check if events are already pending events + before starting the delay. From Johannes Hampel (2014-9-25). + * drivers/mtd/at45db.c: In at45db_bwrite , the buffer is not increased + when writing more than 1 page. Sourceforge bug #34 (2014-9-25). + * crypto/cryptodev.c: Path segments reversed in include file path. + Noted by Brennan Ashton (2014-9-25). + * drivers/mtd/mtd_rwbuffer.c: The MTD Read-ahead/Write buffer layer + appears to be functional (2014-9-25). + * libc/stdio/lib_libdtoa.c: Change to lib_dtoa() to fix precision error + from trailing zeroes. From Bob Doiron (2014-9-26) + * fs/fs_poll.c: Re-implemented poll() delay using sem_timedwait() + (2014-9-26). + +7.6 2014-11-26 Gregory Nutt + + * fs/fs.h and other files: Rename fs/fs_internal.h to fs/fs.h (2014-9-28). + * include/nuttx/semaphore.h and fs/fs.h: Add data structures that will + allow us to move name semaphore support out of the OS and into the + VFS (not complete) (2014-9-28). + * fs/inode: Move inode and VFS utils from fs/. to fs/inode/. (2014-9-28). + * fs/driver: Move driver logic from fs/. to fs/driver/. (2014-9-28). + * fs/dirent: Move directory operations from fs/. to fs/dirent/. (2014-9-23). + * fs/mount: Move mount-related files from fs/. to fs/mount/. (2014-9-23). + * fs/vfs: Move renaming files in fs/. to fs/vfs/. (Don't all belong there) + (2014-9-23). + * fs/semaphore: Create a build structure that will (eventually) support + using the VFS to manage named semaphores (2014-9-23). + * configs/stm32f4discovery/include/board.h: STM32F4-Discovery: Fix some + backward conditional compilation (2104-9-29). + * nuttx/sched/init/os_start.c, semaphore/Make.defs, sem_initialize.c, + and semaphore.h: Semaphore initialization is now only required if + priority inheritance is enabled (2014-9-29). + * fs/Makefile and mqueue/: Add build support for messages queues as part + of the VFS (only build logic, no C files yet) (2014-9-29). + * fs/inode/inode.h and fs/driver/driver.h: Move fs/fs.h to fs/inode/inode.h + and some to fs/driver/driver.h (2014-9-29). + * sched/task/task_vfork.c: Fix vfork(). Now that arguments are kept on + the stack, the way that arguments are passed from parent to child in + vfork() must change. This bug has always been present, but was not + visible with the old strdup() way of passing arguments (2014-9-29). + * arch/arm/src/common/up_vfork.c: Another vfork() problem: If we get to + vfork() via system call, then we need to clone some system call + information so that the return form the cloned system call works + correctly (2014-9-29). + * fs/mqueue: Move mq_open(), mq_close(), and mq_unlink() logic from + sched/mqueue to fs/mqueue. Convert the logic so that it uses the VFS to + managed the message queue namespace (instead of custom logic). By + default, now message queues can be seen in /var/mqueue (2014-9-29). + * arch/sim/src/up_simuart.c, up_uartwait.c: Removed old, strange + up_stdio.c and implemented a simulated UART driver to provide the + console input. Starts a separate, Linux domain pthread to read + the console input in raw mode and provides the incoming data to + NuttX via standard NuttX domain IPCs (2014-9-30). + * arch/sim/src/up_setjmp32.S, up_setjmp64.S, Kconfig, Makefile, + up_initialstate.c, up_internal.h, up_stackframe.c, and include/irq.h: + Add support for 64-bit longjmp/setjmp in simulator platform. This + will permit operation of the simulation natively on a 64-bit platform + (2014-10-2). + * include/fcntl.h: Implement create() as a macro (2014-10-4). + * fs/vfs/Make.defs, fs_pread.c fs_pwrite.c, and include/unistd.h: Add + pread() and pwrite() (2014-10-4). + * include/sys/syscall.h syscall/syscall.csv, syscall_lookup.h, and + syscall_stublookup.c: Add pread() and pwrite() system calls + (2014-10-4). + * include/aio.h: Add aio.h header file (2014-10-4). + * libc/aio/lio_listio.c and Make.defs: Add empty skeleton file where + lio_listio() will eventually be implemented (2014-10-4). + * libc/Kconfig, aio/aio_read.c, aio_write.c, aio_return.c, aio_error.c + aio.h, and Make.defs: Initial implementation of aio_read(), + aio_write(), aio_return(), and aio_error() (2014-10-4). + * include/signal.h and sched/Kconfig: Add definitions for SIGPOLL + (2014-9-5). + * libc/aio/aio_signal.c, Make.defs, and aio.h: Move AIO signal logic + to a common location in aio_signal.c. Also fix several typos + (2014-9-5). + * libc/aio/aio_suspend.c, aio_cancel.c, aio_fsync.c, lio_listio.c and + Make.defs: Initial implementation of aio_suspend(), aio_cancel(), + lio_listio.c, and aio_fsync.c. This completes this implementation + of the asynchronous I/O interfaces but there are still untested + (2014-9-5). + * fs/aio/Make.defs, aio.h, aio_cancel.c, aio_fsync.c, aio_read.c, + aio_signal.c, and aio_write.c: Move all file operations from libc/aio + to fs/aio. These will need to be kernel routines in order to + handler issues with using file descriptors on worker thread + (2014-10-5). + * fs/aio/aio.h, Kconfig, aio_initialize.c, aioc_contain.c, Make.defs, + and include/aio.h: Add a AIO control container to increase the + payload with OS internal stuff (2014-10-6). + * fs/aio/aio_cancel.c, aio_fsync.c, aio_read.c, aio_signal.c, and + aio_write.c: Modify logic to use AIO control block container + (2014-10-6). + * fs/fs_initialize.c, Makefile, fs/inode/fs_inode.c, and inode.h: + Modify FS initialization logic to handle AIO container + initialization (2014-10-6). + * Too many files to list: Major structuring of file system functions + to better support asynchronous I/O. Repository should not be + trusted until I have a chance to verify everything (2014-10-6). + * include/nuttx/mm/mm.h: Fix a place in the memory manager where it + explicitly assumed that the size of a pointer is 4 bytes. That is OK + if the actual size is smaller but makes the heap unstable when used + with the x86_64 host simulation (2014-10-6). + * sched/wqueue, include/nuttx/wqueue.h, and libc/Kconfig sched/Makefile: + Add support for priority inheritance on the low priority worker queue + (2014-10-7). + * sched/Makefile and sched/*/Make.defs: Simplify how C source files are + selected in the build (2014-10-7). + * fs/aio/aio_queue.c, Make.defs, aio.h, aio_fsync.c, aio_read.c, and + aio_write.c: The asynch I/O implementation now satisfies POSIX + priority requirements; it uses the new low priority worker thread + interfaces to adjust the priority of the worker thread according to + the priority of the client thread (2014-10-7). + * arch/arm/src/stm32/chip/stm32_otghs.hstm32_otghs.c/h and + chip/stm32_otghs.h: Add files that implement true high speed support + for the STM32 OTGHS peripheral. From Brennan Ashton (2014-10-7). + * arch/arm/src/stm32/ (several files): Integrates OTGHS support into + the STM32; Eliminates the older OTGHS in FS mode logic. From Brennan + Ashton (2014-10-7). + * arch/arm/src/stm32/Kconfig, stm32_otgfsdev.c, chip/stm32f40xxx_pinmap.h, + configs/stm32f429i-disco/ (several files): Remove non-functional + vestiges of OTGHS in FS mode (including OTGFS2); try to convert the + stm32f429i-disco configuration to use OTGHS instead of OTFHS in F + mode (OTGFS2). But I don't have the boards and can't test (2014-10-7). + * include/syslog.h, debug.h, libc/libc.csv, misc/lib_dbg.c, + lib_dumpbuffer.c, stdio/lib_lowsyslog.c, lib_printf.c, lib_syslog.c, + and fs/driver/fs_syslog.c: Make standard syslog and vsyslog POSIX + compliant (also modify non-standard syslog functions for + compatibility). This will break a lot of things until ALL usage of + syslog is updated to use the modified interfaces (2014-10-8). + * drivers/: Correct everything under nuttx/drivers, nuttx/arch, nuttx/net, + nuttx/binfmt, and nuttx/configs to use the corrected syslog interfaces + (2014-10-8). + * libc/syslog and fs/syslog: Move syslog logic from libc/misc and + libc/stdio to libc/syslog and fs/syslog. Also move some syslog logic + from fs/driver to fs/syslog (2014-10-8). + * fs/syslog/fs_syslogmask.c: Implement syslogmask() (2014-10-8). + * include/sys/syscall.h, syscall/syscall.csv, syscall_lookup.h, and + syscall_stublookup.c: Add syslog system calls (2014-10-8). + * fs/Kconfig, syslog/fs_syslogenable, and include/syslog.h: Remove + non-standard, conditional syslog_enable(), instead only the + required, standard setlogmask() (2014-10-9). + * arch/arm/src/stm32/chip/stm32_exti.h: Correct STM32 RTC EXTI bit + definition. From Lazlo (2014-10-9). + * include/syscall.h, syscall/, and libc/: Remove syslog interfaces + from the set of system calls (2014-10-9). + * libc/syslog: Move syslog back out of the kernel into the C libary + (2014-10-9). + * arch/mips/src/pic32mx/pic32mx-devcfg.h: For PIC32MX7, DEVCFG0 bit + 2 must be set. Writing bit 2 as zero can brick the CPU on some + versions. From Cris Kvist (2014-10-9). + * sched/wqueue/, libc/wqueue, and include/nuttx/wqeueue.h: Separate + kernel- and user-mode work queue logic. Decouple work queue data + structures. This is part of the preparation to support multiple + low-priority worker threads (2014-10-10). + * include/nuttx/wqueue.h, libc/wqueue/Make.defs, work_usrthread.c, + work_usrstart.c sched/init/os_bringup.c wqueue/kwork_hpthread.c, + kwork_lpthread.c, and wqueue.h: Modularize starting of worker + threads to better isolate individual initialization characteristics + (2014-10-10). + * arch/arm/src/ stm32_iwdg.c, stm32_wwdg.c, and chip/stm32_dbgmcu.h: + Fix watchdog stop bit usage. From Lazlo (2014-10-10). + * sched/wqueue/, libc/wqueue, and include/nuttx/wqueue.h: Add support + for multiple low-priority worker threads. This is a necessary + piece of the support for asynchronous I/O (2014-10-10). + * sched/wqueue/work_inherit.c: Add logic for priority inheritance with + multiple worker threads. How should this work? Tentatively, the all + get reprioritized together. It would be best to just reprioritize the + single thread doing the high priority work, but we don't know which + that will be in advance (2014-10-10). + * fs/aio/ and include/aio.h: Add support for socket-based transfers + (2014-10-11). + * arch/arm/include/stm32/chip.h, /src/stm32/Kconfig, and + stm32_allocateheap.c: Support for the STM32 F411RE from Serg Podtynnyi + (2014-10-14). + * configs/Kconfig, README.txt, and nucleo-f401re: Extend this board + configuration to also support the Nucleo-F411RE. From Serg Podtynnyi + (2014-10-14). + * tools/Config.mk: Add a PRELINK macro to Config.mk. From Kriegleder + (2014-10-17). + * arch/arm/src/efm32 and arch/arm/include/efm32: Add a basic port for + the SiLabs EFM32 family. Includes many files contributed by Pierre-noel + Bouteville (2104-10-20). + * configs/efm32-gxxx-stk: Add board support for the EFM32 Gecko Starter + Kit (2014-10-20). + * configs/olimex-efm32g880f128-stk: Add board support for the Olimex + EFM32G8809128 STK (2014-10-20). + * drivers/lcd/Kconfig, ili9341.c, Make.defs, and include/nuttx/lcd/ili9341.h: + Add support for a generic ILI9341 driver. From Marco Krahl (2014-10-20). + * configs/stm32f429i-disco/Kconfig, src/ and lcd/: Add support for the + STM32F429i Discovery's LCD. From Marco Krahl (2014-10-20). + * arch/arm/src/lpc43xx/lpc43_gpioint.c, .h, lpc43_irq.c, and + chip/lpc43_gpio.h: Fixes to allow compile of lpc43_gpioint.c. It + likely doesn't work. From Brandon Warhurst (2014-10-21). + * arch/arm/src/stm32/chip/stm32f103r_pinmap.h: Add ADC pinmap + definitions for the STM32 F103R from Martin Lederhilger (2014-10-21). + * arch/arm/src/armv7-m/up_itm.c and itm.h: Add CMSIS ITM header file and + library. From Pierre-noel Bouteville (2104-10-21). + * arch/arm/src/armv7-m/dwt.h and tpi.h: Add CMSIS DWT and TPI header files. + From Pierre-noel Bouteville (2104-10-21). + * arch/arm/src/armv7-m/arm_item_syslog.c, itm_syslog.h, and Kconfig: Add + ARMv7 support to use ITM for SYSLOG debug output. Includes logic from + Pierre-noel Bouteville (2014-10-22). + * arch/arm/src/efm32/efm32_clockconfig.c, efm32_start.c, and Make.defs: + Add logic to initialize and use ITM for syslog. Includes logic from + Pierre-noel Bouteville (2014-10-22). + * sched/sched/sched_timerexpiration.c and include/nuttx/arch.h: Fixes + to tickless operation code, especially in alarm mode. From Brandon + Warhurst (2014-10-23). + * nuttx/arch/arm/src/lpc43xx/lpc43_rit.c, lpc43_rit.h, and related + files: Add support for tickless operation using the NXP LPC43xx. From + Brandon Warhurst (2014-10-23). + * arch/arm/src/efm32/efm32_gpio.c and efm32_gpioirq.c: EFM32 port and + pin decoding backward in every case. From Pierre-Noel Bouteville + (2014-10-23). + * arch/arm/src/armv7-m/up_itm_syslog.c: Correct file naming and fix + compilation errors in up_itm_syslog.c. From Pierre-Noel Bouteville + (2014-10-23). + * configs/sam4e-ek/src/sam_ethernet.c (and other files):SAM4E-EK: Add + support for PHY interrupt (2014-10-24). + * include/wchar.h: Add a mostly bogus wchar.h header file. This file + is mostly bogus because none of the wide character operations are + currently supported in the Nuttx C library (2014-10-27). + * include/termios.h, libc/termios/lib_isatty.c, and Make.defs: Add + isatty() function. From Alan Carvalho de Assis (2014-10-27). + * arch/arm/include/efm32, src/efm32, and configs/efm32-gxxx-stk: + The EFM32 Gecko Starter Kit port is now functional. At least + NSH is running over LEUART0 on the board (2014-10-29). + * arch/arm/src/sam34/sam_serial.c and Kconfig: Add support for SAM3/4 + basic TERMIOS and flow control. There are issues with IFLOW control: + PDC or DMAC support is required (2014-10-29). + * configs/sam4e-ek/src/sam4e-ek.h: Fix an error in a USART1 pin number + (2014-10-29). + * configs/efm32gg-stk3700: Board support for the SiLabs EFM32GG + Giant Gecko Starter kit. Current with basic NSH configuration only. + Testing is on hold until I receive hardware (2014-11-03). + * libc/Kconfig: Move CONFIG_NSH_TMPDIR to CONFIG_LIBC_TMPDIR (2014-11-05). + * libc/stdlib/lib_mkstemp.c, lib_mktemp.c, Make.defs and include/stdlib.h: + Add mktemp() and mkstemp() (2014-11-05). + * libc/stdio/lib_tempnam.c, lib_tmpnam.c, Kconfig, Make.defs and + include/stdio.h: Add tmpnam() and tempnam() (2014-11-05). + * drivers/rwbuffer.c: Fix typo that can cause compiler error (2014-11-05). + * drivers/mtd/m25px.c: Extend MTD support to M25P16. From Sébastien + Lorquet (2014-11-07). + * arch/arm/src/stm32/Kconfig, chip.h, and include/stm32/chip.h: Support + for the STM32F103RG. From Murilo Ponte (2014-11-10). + * configs/stm32f100rc_generic: Removed this generic board configuration. + I have decided to stop support of generic board configurations. Generic + board configurations do not provide support for any specific hardware + but can be useful only if there are not other examples for the setup + for a particular architecture. Not the case here (2014-11-10). + * include/nuttx/vt100.h: Add foreground and background color commands + (2014-11-10). + * sched/wdog/wd_create.c: Fix an important bug in the watchdog creation + logic (2014-11-10). + * include/unistd.h, libc/unistd/lib_access.c and Make.defs: From Lorenz + Meier: The implementation of access() as vararg macro has the issue that + any function call with the same name (even in a C++ class) will match + with it and result in a compile error. I have replaced it with a small + function, and tried to have decent documentation as well. This resolves + the compile issue, and shouldn’t have negative side effects for users + of the function (2014-11-11). + * mm/mm_gran/mm_granrelease.c: If the INTR granule allocator mode is + enabled, there is no semaphore to destroy. From Lorenz Meier (2014-11-12). + * fs/nxffs/nxffs_dump.c: Fix problems with redefinitions of fdb macro. + With the fix to the syslog prototype, a LOG priority must now be the + first parameter. Fixed by replacing all occurrences of fdbg with + syslog(LOG_DEBUG, and eliminating the macro redefinitions. Noted by + Sebastien Lorquet (2014-11-12). + * arch/arm/src/common/up_internal.h: Add protection from C++ name + mangling in the ARM up_internal.h. From Lorenz Meier (2014-11-12). + * include/nuttx/compiler.h: Defines inline functions as not + instrumented - this is relevant for anyone using instrumentation. From + Lorenz Meier (2014-11-12). + * libc/string/lib_strncpy.c: The definition of strncpy() is that empty + space should be zero-filled, the patch adds the zero filling (I didn’t + know this, see e.g. the POSIX spec here: + http://pubs.opengroup.org/onlinepubs/7908799/xsh/strncpy.html). From + Lorenz Meier (2014-11-12). + * arch/arm/include/limits.h: Remove the definition of INT_FAST32_MIN + which is already defined in stdint.h (the correct location). From + Lorenz Meier (2014-11-12). + * arch/arm/src/efm32/efm32_clockconfig.c, configs/efm32gg-stk3700/README.txt + and include/board.h: Fixes to get the EFM32GG-STK3700 basic NSH + configuration running. It works! (2014-11-12). + * drivers/bch/bchdev_driver.c: Add support for seeking in BCH. From + Sébastien Lorquet. (2014-11-13). + * sched/Kconfigs and configs/*/*/defconfig: Remove CONFIG_MAX_TASK_ARGS + (2014-11-13). + * binfmt/: Remove use of CONFIG_MAX_TASK_ARGS in exec() and unload_module() + (2014-11-13). + * libc/unistd: Remove use of CONFIG_MAX_TASK_ARGS in execl() (2014-11-13). + * sched/: Remove some misc. usage of CONFIG_MAX_TASK_ARGS in task_start(), + task_setup(), and vfork() (2014-11-13). + * arch/arm/src/stm32/chip/stm32_otgfs.h: Correct a typo in the STM32 OTGFS + register bit definitions (2014-11-13). + * drivers/lcd/st7565.c/.h and include/nuttx/lcd/st7565.h: Add driver for + ST7565 that works with NHD‐C12864KGZ display. From Pierre-noel + Bouteville (2014-11-13). + * net/route/net_router.c: I don't think that the net_route function has + ever worked correctly. The source ip was updated in the match struct + instead of the route ip. From Brennan Ashton (2014-11-14). + * net/Kconfig arp/Make.defs, arp_send.c, and drivers/net/slip.c: ARP: + Add support for the case where there are multiple networks: One being + Ethernet and the other not. Suggested by Brennan Ashton (2014-11-14). + * net/Kconfig, netdev/netdev_register.c, arp/arp_send.c, + include/nuttx/net/net.h, netdev.h and several network drivers in arch/ + and drivers/: Add a parameter to netdev_register() to indicate the + link protocol supported by the driver. Use this value to replace some + logic committed yesterday (2014-11-15). + * configs/stm32f4discovery/netnsh/defconfig: Needs to set MAC address + (2014-11-15). + * arch/ and drivers/: Remove use of NET_LL_HDRLEN from Ethernet drivers. + Use ETH_HDRLEN instead (2014-11-15). + * net/arp/: Remove use of NET_LL_HDRLEN from net/arp logic. Use + ETH_HDRLEN instead (2014-11-15). + * net/ and include/nuttx/net: All network logic will now handle + variable length link layer protocol headers within incoming packets. + This permits use of multiple network interfaces with differing data + links. For example, ETHERNET + SLIP (2014-11-15). + * arch/arm/src/sam34/sam4s_periphclks.h: Add missing SPI0 clock + configuration macro for the SAM4S. From spasbyspas (2014-11-16). + * arch/arm/src/efm32/efm32_lowputc.c: EFM32 USART setup: Computation of + BAUD includes shift; Eliminate additional shift. From Pierre-noel + Bouteville (2014-11-16). + * net/, include/, drivers/, arch/, various files: Rename + CONFIG_NET_BUFSIZE to CONFIG_NET_ETH_MTU; Add CONFIG_NET_SLIP_MTU. + Add data structures and logic to handle different MTUs when both + Ethernet and SLIP are enabled (2014-11-16). + * net/, include/, various files: Rename CONFIG_NET_RECEIVE_WINDOW to + CONFIG_NET_ETH_TCP_RECVWNDO and CONFIG_NET_SLIP_TCP_RECVWNDO. Add + data structures and logic to handler different TCP receive windows + when both Ethernet and SLIP are enabled (2014-11-16). + * configs/sama5d4-ek/bridge: Add a simple test for the dual EMACs on + the SAMA5D4 (2014-11-17). + * arch/arm/src/sama5/sam_emacb.c: Fix several typos that will prevent + EMAC1 from initializing properly (2014-11-17). + * include/nuttx/net/ip.h and tcp.h, net/icmp/icmp_send.c and + igmp/igmp_send.c: Move IP header flags from tcp.h to ip.h and rename + IP_FLAGS vs TCPFLAGS. The problem fixed here is that there IP flags + were not available when TCP was disabled. The IP flags are used in + ICMP and IGMP (2014-11-17). + * sched/clock/clock_abstime2ticks.c: Calling mq_timedreceived() with + immediate timeout was getting stuck and not timing out. Immediate + timeout is achieved by setting absolute timeout value to past time, + for example abstime={ .tv_sec=0, .tv_nsec=0 }. However absolute + time was converted to relative time using unsigned integer arithmetic + and resulted large ticks count by clock_abstime2ticks, instead of + expected negative ticks value. Change corrects clock_abstime2ticks() + to return negative ticks, if absolute time is in the past. From + Jussi Kivilinna (2014-11-19). + * fs/vfs/fs_poll.c: poll() was not waking up from signals (for example + mq_notify() events). From Jussi Kivilinna (2014-11-19). + * arch/arm/src/stm32/stm32_otghs.c, Make.defs, + configs/stm32f429i-disco/src/stm32_usb.c and Makefile: STM32 F4 OTGHS + device controller driver from Brennan Ashton (2014-11-20). + * configs/sama5d3-xplained/bridge: Add a simple test for the EMAC + and GMAC on the SAMA5D3 working together (2014-11-20). + * libnx/nxtk/nxtk_drawframe.c: Remove warnings when CONFIG_NXTK_BORDERWIDTH + is set to zero. From Pierre-Noel Bouteville (2014-11-20). + * fs/vfs/fs_poll.c: Add proper handling for sem_timedwait errnos. + From Jussi Kivilinna (2014-11-21). + * net/udp/udp_conn.c and udp.h: Extensions to UDP "connection" structure + for the case of multiple networks. In this case, assigned port numbers + only have to be unique with respect to the IP address. So, for + example, you could have multiple port 80's, one on each network + (2014-11-21). + * net/tcp/tcp_conn.c and tcp.h: Make tcp_listener static scope; it is + not used outside of tcp_conn.c (2014-11-22). + * net/udp/tcp_conn.c and tcp.h: Extensions to TCP connection structure + for the case of multiple networks. See the description of the similar + change for UDP above (2014-11-22). + * net/route/net_router.c: Refuse to perform routing table lookups for + the Broadcast IP address. From Brennan Ashton. + * net/netdev/netdev_findbyaddr.c and netdev: Add logic to netdev_findbyaddr() + to return the correct network device for the case where a broadcast + address is used. This change caused trivial ripples through other + files because additional parameters are required for netdev_findbyaddr() + when CONFIG_NET_MULTINIC. Those other file include net/netdev/netdev_rxnotify.c, + netdev_txnotify.c which, in turn, for changes to arp/arp_send.c, + icmp/icmp_ping.c, socket/net_sendfile.c, recvfrom.c, sendto.c, + tcp/tcp_send_buffered.c, and tcp_send_unbuffered.c (2014-11-23). + * arch/arm/src/kl/chip/kl_i2c.h: I2C header file for the Freescale KL + family. From Alan Carvalho de Assis (2014-11-23). + * include/nuttx/fs/fs.h: Fix typo in conditional compilation. From + Alan Carvalho de Assis (2014-11-23). + +7.7 2015-01-26 Gregory Nutt + + * nuttx/drivers/eeprom and include/nuttx/eeprom/: Add support for generic + EEPROM access via a character driver. Add also the EEPROM driver itself. + From Sébastien Lorquet (2014-11-26). + * libnx/nxfonts/nxfonts_pixel-lcd-machine.h and nxfonts_pixel-unicode.h, + include/nuttx/nx/nxfonts.h, graphpics/Kconfig, and build-related files + in libnx/nxfonts: Two new fonts from Pierre-noel Bouteville (2014-11-26). + * configs/lpc4357-evb, arch/arm/src/pc43xx/chip/, configs/Kconfig, and + and other related files: A port of NuttX to the LPC4357-EVB from + Toby Duckworth. This port is a leverage of the LPC3330-Xplorer port + and still have a some misinformation from that port that needs to be + updated for the LPC4357-EVB (2014-11-26). + * arch/arm/include/stm32/chip.h, src/stm32/Kconfig, chip.h, and + chip/stm32f102_pinmap.h: Enable support for the STM32 F102. From + https://github.com/PX4/NuttX/pull/28.diff (2014-11-27). + * drivers/loop.c: Loop device should return -EINTR is interrupt by a + signal (2014-11-27). + * drivers/input/djoystick.c and include/nuttx/input/djoystick.h. Also + drivers/input/Kconfig and Make.defs, and include/nuttx/fs/ioctl.h: Add + an interface definition and upper half driver for a discrete joystick + device (2014-11-27). + * arch/arm/src/efm32/Kconfig and efm32_serial.c: Add support for serial + termios TCGET and TCSET. For the moment, only set/get speed is + implemented. From Pierre-noel Bouteville (2014-11-27). + * drivers/wireless/ and include/nuttx/wireless/cc3000.h: A set of 11 + patches correcting issues with the CC3000 networking. All from Jussi + Kivilinna (2014-11-28). Among these: + 03/11: CC3000 driver was getting stuck at recv() when remote host + closed connection and application tried to read data from remotely + shutdown socket. This patch adds proper handling for remotely closed + socket event. + 07/11: Socket state initialization was done in 'register', while it + should be initialized in 'open' and deinitialized in 'close'. Old + way caused problems when device is closed, power-cycled and then + reopened as old socket state was left enabled. + 08/11: Select thread was getting stuck after 'close, power-cycle, + reopen', since selectsem was not properly setup and cleaned up. + 09/11: 'maxFD' was not properly reset in select worker and not checked + for before calling cc3000_select(). + 10/11: After wlan_stop()/cc3000_close(), irqsem was left with count + '-1'. Therefore on next wlan_start()/cc3000_open(), initial value + for irqsem was wrong. Additional repeated wlan_start()/wlan_stop() + decreased irqsem value further. Obviously this causes driver not to + function correctly and freeze. Patch moves initialization and + destruction of waitsem, irqsem and readysem to + cc3000_open/cc3000_close. + * include/cxx/cctype: Undefine macros defined ctype.h so that builtin + C++ implementations will be used intead. From Lorenz Meier + (2014-11-28). + * configs/stm3210e-eval/src/stm32_djoystick.c: Add a discrete Joystick + supportfor the STM3210E-EVAL (2014-11-28). + * drivers/input/djoystick.c include/nuttx/input/djoystick.h: Add a new + ioctl to get the supported joystick discrete signals (2014-11-28). + * drivers/input/ajoystick.c and include/nuttx/input/ajoystick.h. Also + drivers/input/Kconfig and Make.defs, and include/nuttx/fs/ioctl.h: Add + an interface definition and upper half driver for an analog joystick + device. Initial check-in is only a little more of a clone of the + discrete joystick driver and is as-of-yet untested (2014-11-27). + * libc/Kconfig, misc/Make.defs, misc/lib_ioctl.c, fs/vfs/fs_ioctl.c, + include/nuttx/fs/fs.h, include/sys/ioctl.h, syscall.h, and several + files in syscall/: Add support for a variadic ioctl() function. The + ioctl() interface is a non-standard, Unix interface. NuttX has always + used the older, three-parameter version. Most contemporary systems + now, however, use a variadic form of the ioctl() function. Added an + option to insert a shim layer to adapt the three-parameter ioctl() to + use the variadic interface form. Internally, the ioctl handling is + the same three-parameter logic. The only real complexity to the shim + is in how the system calls must be handled (2014-11-29). + * arch/arm/src/stm32/stm32_i2c.c: Port Tridge's I2C noise resilience + logic from the PX4 repository (2014-11-29). + * arch/arm/src/stm32/chip/stm32l15xxx_pinmap.h: Fix a typo in the + MCO pin definition. From Jussi Kivilinna (2014-12-02). + * arch/arm/src/stm32/stm32_rcc.h: Add missing MCO configuration for + the STM32L1xxx. From Jussi Kivilinna (2014-12-02). + * configs/sama5d3-xplained/src/sam_ajoystick.c: Add analog Joystick + shield support for the SAMA5D3 Xplained board (2014-12-3). + * configs/ucleo-f4x1re/src/sam_ajoystick.c and sam_adc.c: Add + analog Joystick shield support for the Nucleo F4x1RE boards. There + are still some ADC issues to be worke through as of the initial + commit (2014-12-3). + * /drivers/eeprom/spi_xx25xx.c and /include/nuttx/eeprom/spi_xx25xx.h: + Add support for ST Micro EEPROM device geometries. From Sebastien + Lorquet (2014-12-5). + * sched/mqueue: msg type should be char * not void * in mq_send, + mq_timedsend, mq_receive, and mq_timedreceive. Noted by Pierre-Noel + Bouteville (2014-12-05). + * fs/mqueue/mq_open.c and sched/mqueue/mq_msgqalloc.c: In message queue + creation return ENOSPC error if size exceeds the configured size of + pre-allocated messages; Use ENOSPC vs ENOMEM per OpenGroup.org. From + Pierre-Noel Bouteville (2014-12-6). + * Add sys/custom_file.h. Used when CUSTOM_FILE_IO is define and avoids + re-definition errors about the FILE define. From Thomas Gruber via + the PX4 repository (2014-12-06). + * tools/bfd-converter.c and mkdeps.c: Eliminate a warnging about + redefined strtok_r on some platforms (2014-12-8). + * arch/sim/Kconfig: Allow building the simulated framebuffer driver + even if NX is not enabled (12014-12-8). + * configs/sim/traveler and README.txt: Add a configuration build and test + the Traveler first person game using the simulator (2014-12-8). + * arch/arm/src/stm32/chip/stm32f20xxx_pinmap.h and stm32f40xxx_pinmap.h: + Set the GPIO_SPEED_50MHz on all F2 and F4 SPI pin configurations. + This is based on an F411 SPI1 errata but the fixed is generalized to + all SPI and all F2 and F4 (let me know if this introduces any other + issues). Discovered and fixed by Sebastien Lorquet after much + consternation (2014-12-8). + * libc/stdio/lib_avsprintf.c: avsprintf(): Fix a bug in usage of + va_list on x86. On x86, va_list is a pointer to a single copy on the + stack. avsprintf() calls lib_vsprintf() twice and so traverses the + va_list twice using va_start. va_start modifies that single copy on + the stack so that the second call to lib_vsprintf() fails. This appears + to be an issue with x86 only so far (2014-12-8). + * stdint.h: Don't use hex values to specify minimum values of fixed + width, signed values. Hex values are inherently unsigned and not + usable for this purpose in all contexts (2014-12-8). + * arch/arm/src/tiva/tiva_i2c.c, tiva_i2c.h, Kconfig, and Make.defs: Add + build framework and skeleton files for Tiva I2C driver. Initial + commit is just the STM32 I2C driver with name changes and STM32- + specific logic removed (2014-12-9). + * fs/procfs/fs_procfs.c: Add procfs write support. From Ken Pettit + (2014-12-9). + * include/crc8.h, libc/misc/lib_crc8.c, and Make.defs: Add CRC8 support. + From Ken Pettit (2014-12-9). + * drivers/mtd/smart.c, Kconfig, fs/smartfs/smartfs_smart.c, + smartfs_procfs.c, smartfs_utils.c, smartfs.h, Kconfig, + include/nuttx/fs/ioctl.h, smart.h, and mtd/smart.h: Implements wear- + leveling in the SmartFS. From Ken Pettit (2014-12-9). + * arch/arm/src/tiva/tiva_i2c.c: Driver is code complete but still + untested (2014-12-10). + * configs/tm4c123g-launchpad/src/tm4c_at24.c, tm4c_bringup.c, and other + files: Add initialization logic for an external AT24 EEPROM. This + is intended only to support testing of the Tiva I2C driver + (2014-12-10). + * libnx/Makefile, libnx/nxfonts/nxfonts_x11-misc-fixed-*.h, Make.defs, + Makefile.sources, nxfonts_bitmaps.c, graphics/Kconfig, and + include/nuttx/nx/nxfonts.h: Lots of fonts that derive from + X11-misc-fixed-* fonts. Converted for use by NuttX by Pierre-Noel + Bouteville (2014-12-10). + * nuttx/drivers/mtd/m25px.c; M25P serial flash driver: Add subsector + size of the M24P16 part. From Lazlo (2014-12-10). + * libc/string/lib_strncpy.c: Commit d0c76ccacf0dc8988f9617ad82bf4349f456bb08 + will trash a lot of memory if n == 0. From Yasuhiro Osaki (2014-12-11). + * arch/arm/src/stm32/stm32_otghsdev.c. Fix for OTGHS device driver + working in FS mode. From Ken Pettit (2014-12-12). + * libc/stdio/lib_sscanf.c: Accept %X as well as %x as a format + specifier. From Sébastien Lorquet (2014-12-12). + * libc/stdio/lib_sscanf.c: Also accept %F as well as %f (2014-12-12). + * arch/arm/src/stm32/stm32_otghsdev.c: For STM32 OTG HS DEV (in FS + mode): Disable ULPI clock enable in RCC AHB1 Register. If Both ULPI + and the FS clock enable bits are set in FS mode, then the ARM never + awakens from WFI due to a chip issue. This is only an issue if you + are using the internal PHY. From Ken Pettit (2014-12-13). + * drivers/serial/serial.c: In case a thread is doing a blocking + operation (e.g. read()) on a serial device, while it is being + terminated by pthread_cancel(), then uart_close() gets called, but + the semaphore (dev->recv.sem in the above example) is still blocked. + This means that once the serial device is opened next time, data will + arrive on the serial port (and driver interrupts handled as normal), + but the received characters never arrive in the reader thread. + The problem was fixed by re-initializing the semaphores on the last + uart_close() on the device. From Harald Welte (2014-12-13). + * sched/semaphore/sem_recover.c, Make.defs, seamphore.c, + sched/wdog/wd_recover.c, Make.defs, wdog.h, sched/task/task_recover.c: + Add logic to clean up after task_delete() or pthread_cancel() if the + task happens to be waiting on a semaphore when it is cancelled + (2014-12-13). + * arch/arm/src/kl/kl_gpioirq.c, Kconfig, Make.defs, and kl_irq.c: Add + GPIO interrupt capability for the KL architecture. The patch is + almost the same as kinetis_pinirq.c, just minor modifications and + rename kl_pinirq to kl_gpioirq to make it more generic to developers. + From Alan Carvalho de Assis (2014-12-13). + * arch/sim/src/up_ajoystick.c, Kconfig, Makefile, up_idle.c, + up_internal.h, up_x11eventloop.c, up_x11framebuffer.c, + configs/sim/src/Makefile, sim_boot.c, and traveler/defconfig: Add an + X11 mouse-based simulation of an analog joystick device (2014-12-14). + * drivers/sensors/adxl345*, include/nuttx/sensors/adxl345.h and other + files: Add driver support for the ADXL345 accelerometer. From Alan + Carvalho de Assis (2014-12-16). + * configs/freedom-kl25z: Add board support for the ADXL345 accelerometer. + From Alan Carvalho de Assis (2014-12-16). + * Kconfig, include/debug.h, drivers/sensors/*, and Qencoder logic in + arch/arm/src/stm32 and various QEncoder board support files under + config/: Unify sensor debug. ADX driver was using input debug; LM75 + and QENCODE that their own custom debug. Now all use + CONFIG_DEBUG_SENSOR, sndbg() (2014-12-16). + * configs/dk-tm4c129x: Initial board support for the Tiva DK-TM4C129x + Connected Development Kit. The initial commit is just the Tiva + TM4C123G-Launchpad board support with naming changes (2014-12-16). + * include/nuttx/sched.h, sched/Kconfig, sched/init/os_start.c, + sched/pthread/pthread_create.c, sched/task/task_prctl.c, + sched/task/task_setup.c: strncpy() will not copy the terminating \0 + into the destination if the source is larger than the size of the + destination. Ensure that the last byte is always zero and let strncpy + only copy CONFIG_TASK_NAME_SIZE bytes. The issue of unterminated names + can be observed in ps when creating a pthread while + CONFIG_TASK_NAME_SIZE is set to 8. From Daniel Willmann (2014-12-17). + * configs/*/*/defconfig: The previous change increased the task name + size allocation by one to hold a NUL terminator. This changes reduces + the configured name size by one so that no additional memory is used + (2014-12-17). + * drivers/wireless/cc3000/cc3000.c: CC3000 Fix: Data can be unaligned. + When dereferenced as an input ntosh(), a bad value is returned. + Reported by Alan Carvalho de Assis (2014-12-18). + * configs/freedom-kl25z: Update the Freedom KL25Z board CC3000 support + to use the current CC300 interfaces. From Alan Carvalho de Assis + (2014-12-18). + * arch/arm/src/tiva, include/tiva, and many configurations: Change + negative Tiva logic CONFIG_TIVA_DISABLE_GPIOx_IRQS to positive logic + CONFIG_TIVA_GPIOx_IRQ (2014-12-18). + * arch/arm/src/tiva/Kconfig: Fix configuration logic for IRQ interrupts. + The various parts support varying numbers of GPIO blocks and with varying + capabilities to support interrupts on the pins of different GPIO blocks + (2014-12-18). + * arch/arm/src/stm32/chip/stm32f40xxx_rcc.h: PLLSAI register name to + this one in the reference manual. From Marco Krahl (2014-12-19). + * arch/arm/src/stm32/chip/stm32_ltdc.h: Rename CFBLR register name to + the name used in the reference manual. From Marco Krahl (2014-12-19). + * arch/arm/src/stm32/chip/stm32_ltdc.h: Add missing clut register + definition. From Marco Krahl (2014-12-19). + * arch/arm/src/stm32/stm32f40xxx_rcc.c: Configure PLLSAI clock to + enable ltdc register access. From Marco Krahl (2014-12-19). + * configs/stm32f429i-disco/include/board.h: Update board definition for + the ili9341 LCD display. This configures all LCD settings for the RGB + interface. Also adds a customer LCD display template. From Marco Krahl + (2014-12-19). + * arch/arm/src/stm32/stm32_ltdc.h: Define a common layer description for + the ltdc and dma2d controller. From Marco Krahl (2014-12-19). + * arch/arm/src/stm32/stm32_dma2d.c/.h and related files: Add + infrastructure for dma2d support. From Marco Krahl (2014-12-19). + * arch/arm/include/stm32/ltdc.h: Add interface to perform hardware + accelerated layer operation. The following methods must be supported + by the implementation: gevideoinfo, getplaneinfo, getlid, setclut, + getclut, setcolor, getcolor, setcolorkey, getcolorkey, setalpha, + getalpha, setblendmode, getblendmode, setarea, getarea, and update. + And if DMA2D is supported: blit and blend. The method up_ltdcgetlayer + provides access to a reference of a specific ltdc layer. From Marco + Krahl (2014-12-19). + * arch/arm/src/stm32/stm32_ltdc.c: Implements ltdc frambuffer support + for the generic nuttx framebuffer interface, (see nuttx/video/fb.h). + This also implements the interface to perform hardware accelerated + layer operation by the ltdc controller and dma2d controller later + (see nuttx/video/ltdc.h). The following methods are supported by the + ltdc interface: getvideoinfo, getplaneinfo, getlid, setclut, getclut, + setcolor, getcolor, setcolorkey, getcolorkey, setalpha, getalpha, + setblendmode, getblendmode, setarea, getarea, and update. From Marco + Krahl (2014-12-19). + * include/nuttx/lcd/ili9341.h: Update interface control definitions. + From Marco Krahl (2014-12-19). + * configs/stm32f429i-disco/src/stm32_lcd.c: Add support for + initializing ltdc framebuffer and the configured lcd display. This + adds support for initializing of the ltdc controller and the lcd + device connected on the stm32f429i-disco. The following methods are + provided for the generic fb interface: up_fbinitialize, + up_fbgetvplane, and up_fbuninitialize. The following methods are + provided for the ltdc interface: up_ltdcgetlayer. From Marco Krahl + (2014-12-19). + * zrch/arm/src/stm32/Kconfig: Add configuration option for ltdc. This + adds the following ltdc configuration options: dither support, cmap + support, is this the right place for CONFIG_FB_CMAP?, support for + extended ltdc interface. From Marco Krahl (2014-12-19). + * nuttx/configs/stm32f429i-disco: Enable configuration of framebuffer + support for the ltdc controller. From Marco Krahl (2014-12-19). + * configs/stm32f429i-disco/src/stm32_boot.c: Initialize ltdc during + bootup. From Marco Krahl (2014-12-19). + * configs/stm32f429i-disco/ltdc: Add default platform configuration to + test framebuffer support for the ltdc. From Marco Krahl + (2014-12-19). + * libnx/nxfonts/nxfonts_getfont.c: A patch to add previous added font + into nxf_getfonthandle function. From Pierre-Noel Bouteville + (2014-12-19). + * arch/arm/src/tiva, include/tiva, and many configurations: Change + negative Tiva logic CONFIG_SSIx_DISABLE to positive logic + CONFIG_TIVA_SSIx. Add support for SSI2 and SSI3 (2014-12-21). + * arch/arm/src/efm32/efm32_pwm.c/.h, efm32_timer.c/.h, and related + build files: Add support for timer/PWM on the EFM32GG. From + Pierre-noel Bouteville (2014-12-26). + * drivers/serial/Kconfig, serial.c, serialirq.c, and + include/nuttx/serial/serial.h: Add watermark levels to the serial + RX flow control logic. Modify the rxflowcontrol method to accept + the number of bytes in the buffer and a boolean indication of which + watermark was crossed (2014-12-27). + * sched/semaphore/sem_waitirq.c must be built when signals are disabled. + That is because not handles not only the case of semaphore wait + being awakened by a signal, but also the case with sem_timedwait.c + when the semaphore wait is awakened by a timeout (2014-12-28). + * arch/arm/src/stm32/stm32_ltdc.c: stm32: Fix faulty access to non- + existing layer. This disables operation that requires double layer + support, when configured for single layer only. From Marco Krahl + (2014-12-29). + * arch/arm/src/stm32/stm32_ltdc.c: stm32: Fix wait upon vertical blank. + This should never have occurred before. From Marco Krahl (2014-12-29). + * configs/stm32f429i-disco/ltdc/defconfig and src/stm32_boot.c: + stm32f429i-disco: change ltdc initializing during boot up. This moves + initializing of the ili9341 lcd and ltdc driver to the board specific + initializing routine. From Marco Krahl (2014-12-29). + * arch/arm/src/stm32/stm32_ltdc.c: Clean up documentation, some + formatting improvements. From Marco Krahl (2014-12-29). + * arch/arm/src/tiva/chip/tiva_ethernet.h, lm3s_ethernet.c, and + tm4c_ethernet.h: Add logic to discriminate between LM3S class Ethernet + register definitions and TM4C129X class Ethernet register definitions. + Add TM4C129X Ethernet register definitions (2014-12-30). + * arch/arm/src/tiva/tm4c_ethernet.c, lm3s_ethernet.c, Kconfig, and + Make.defs: First cut at TM4C129X Ethernet driver. Initial commit is + basically just the STM32 Ethernet driver with modifications for a clean + compilation in the Tiva environment (2014-12-31). + * arch/arm/src/stm32/stm32_rtc.c, stm32_rcc.c, Kconfig: Add support for + the internal low speed clock (LSI) as a source of the RTC clock. Some + boards do not have the external 32khz oscillator installed, for those + boards we must fallback to the crummy internal RC clock. Turn on by + defining CONFIG_RTC_LSICLOCK. From Kevin Hester (2015-01-02). + * net/tcp/tcp_conn.c: Fix a logic error when CONFIG_NETDEV_MULTINIC is + selected: net_unlock(flags) will be called will an uninitialized + variable (2015-01-03). + * arch/arm/src/tiva/tiva_irq.c: Fix Tiva IRQ control logic; was limited + to only 64 IRQs. That is a problem for higher numbered IRQs on many + platforms (2015-01-06). + * arch/arm/src/stm32/stm32_sdio.c, drivers/mmcsd/mmcsd_sdio.c and Kconfig, + and include/nuttx/sdio.h: MMCSD SDIO: Add support for a new + SDWAIT_WRCOMPLETE condition. The previous logic used a busy-wait loop + to poll the card R1 status to determine when the card was ready for + the next transfer. That busy-wait can be quite long -- up to hundreds + of milliseconds. An alternative is to look the SD D0 pin which + will change state when the card is no longer busy. This change avoids + the busy-wait poll by reconfiguring the SD D0 pin as a GPIO interrupt, + then waiting for the card to become ready without taking up CPU + cycles. This change is conditioned on CONFIG_MMCSD_SDIOWATI_WRCOMPLETE + and is currently only implemented for the STM32 SDIO driver. From + David Sidrane (2015-01-08). + * arch/arm/src/tiva/tiva_timerlib.c and .h: Add a timer library for + generic support of Tiva timers (2015-01-08). + * arch/arm/src/tiva/tiva_timerlow32.c: Add a driver lower half for + drivers/timer.c. Only 32-bit periodic timers are supported. This + provides userspace access to timers. + * configs/px4-v2_upstream, Kconfig, README.txt: Remove the px4-v2_upstream + configuration. Moved to misc/Obsoleted/configs. This was not the + official configuration for the PX4 board and has led to confusion by + NuttX users. The board configuration also requires some ongoing + maintenance and customization to support ongoing PX4 testing and + evaluation. It is best retained the PX4 repositories where it can be + properly maintained and not in the upstream NuttX repository + (2015-01-14). + * net/netdev/netdev_ioctl.c and include/nuttx/net/ioctl.h: Add support + for IPv6 ioctls to manipulate IP addresses (2015-01-14). + * net/icmpv6: Create a future home for ICMPv6 (2015-01-14). + * net/icmp: Remove all logic conditioned on CONFIG_NET_IPv6 + (2015-01-14). + * net/, include/nuttx/net, and a few other files: (1) Copied all ICMP + sources files to net/icmpv6 with proper renaming and removal of IPv4 + logic, (2) remove IPv6 logic from files in net/icmp, (3) copied + include/nuttx/icmp.h to icmpv6.h and removed IPv4 specific logic, (4) + removed all IPv6 logic from icmp.h, (5) IP_HDRLEN became IPv4_HDRLEN + and IPv6_HDRLEN, (6) ip_chksum() became ipv4_chksum() and + ipv6_chksum(), and (7) added partial support for ICMPv6 statistics + (2015-01-14). + * arch/, drivers/net/, include/nuttx/net, and net/devif: (1) Rename + devif_input() ipv4_input(), (2) copy net/devif/devif_input.c to + ipv6_input.c, remove all IPv4-specific logic, (3) rename + net/devif/devif_input.c to ipv4_input.c, remove all IPv6-specific + logic, and (4) xplit IPv4 header structure out as net_ipv4hdr_s from + net_iphdr_s (2015-01-15). + * arch/ and drivers/net: All Ethernet drivers: Call ipv6_input() if + IPv6 is enabled and an IPv6 packet is received (2015-01-15). + * net/devif, net/tcp, net/ucp, include/nuttx/net: Separate tcp_input() + and udp_input() into separate functions tcp_ipv4_input(), + tcp_ipv6_input(), udp_ipv4_input(), and upd_ipv6_input() than can deal + will the data offsets caused by the differing sizes of the IP header + (2015-01-15). + * net/utils/net_ipv6_maskcmp.c: Add missing implementation of + net_ipv6_maskcmp() (2015-01-15). + * Networking: Drivers can have both IPv4 and IPv6 addresses, but a + socket can only only one or the other; The socket connection + structures need to include a union of IPv4 and IPv6 addresses for + the local address binding and for the remote address connections + (2015-01-16). + * Networking: Replace all references to net_ipaddr_t with either + in_addr_t on net_ipv6addr_t. The goal is to support both IPv4 and + IPv6 simultaneously. This requires that the two types be distinct + and not conditionally typedef'ed to net_ipaddr_t (2015-01-16). + * Networking: Replace all references to the macros net_ipaddr_copy, + net_ipaddr_hdrcopy, net_ipaddr_cmp, net_ipaddr_hdrcmp, and + net_ipaddr_maskcmp with the appropriate IPv4 or IPv6 version of the + macro (such as net_ipv4addr_copy). The goal is to support both + IPv4 and IPv6 simultaneously. This requires that the macros be + distinct and not conditionally defined to one on or the other + (2015-01-16). + * Networking: UDP and TCP MSS depends on the IP header size (as well + as the link layer header size) and cannot be represented with a + single value (2015-01-16). + * net/neighbor: Move net/ipv6 to net/neighbor (2015-01-16). + * include/net/if.h: Add a bit to the device flags to indicate if the + device packet buffer holds an IPv4 or an IPv6 domain packet. + Set/clear the flag along with the correct offset to the application + payload data as each packet is received (2015-01-17). + * net/socket, net/tcp, net/udp: Add logic to select the domain of the + outgoing packet before sending any UDP or TCP packet. This sets the + bit to indicate the IPv4 or IPv6 domain and the correct offset to the + output going payload data (2015-01-17). + * net/socket and net/tcp: When we are ready to receive data or when we + have outgoing data ready to be sent, we need to the notify the + appropriate device driver of this condition. The notifying socket + will be configured as either PF_INET or PF_INET6 and must look up the + correct driver using the correct IP domain (2015-01-17). + * net/socket/accept.c: Fix accept() so that it returns the correct IP + address for the selected socket IP domain (2015-01-17). + * Networking: Final detangling off IPv4 and IPv6 TCP/UDP send logic. + The networking subsystem now compiles with IPv6 enabled (2015-01-18). + * arch/arm/src/tiva/tm4c_ethernet.c: When calling into the stack + from the worker thread, it is necessary to have the stack locked + (2015-01-18). + * nuttx/arch/arm/src/stm32/stm32_serial.c: Fix declaration and + definition of up_receive() and up_dma_receive() to match fields of + uart_ops_s from nuttx/include/nuttx/serial/serial.h. From Freddie + Chopin (2015-01-19). + * drivers/pipes/pipe.c, drivers/usbdev/cdcacm.c, and + mm/mm_gran/mm_granalloc.c: Fixes some issues found by the PX4 team + using Coverity. From Pavel Krienko (2015-01-19). + * net/icmpv6/icmpv6_solicit.c, net/neighbor/neighbor_out.c, and other + files: Add logic to search the Neighbor Table and update the + destination address in the output Ethernet header OR to send an + ICMPv6 Neighbor Solicitation if there is no entry in the Neighbor + table for the IPv6 address (2015-01-20). + * arch/ and drivers/net: Add missing raw/packet socket support to + all Ethernet driverss (2015-01-20). + * arch/ and drivers/net: Networking: Modify all Ethernet drivers: + Do neighbor look-up on all outgoing IPv6 packs in order to properly + set the destination link layer address (2015-01-20). + * Networking: When sending ICMPv6 advertisements and solicitations, + set the NOARP bit so that we don't overwrite the destination MAC + address (2015-01-20). + * Many files: Correct name of fields in struct sockaddr_in6: sin6_port + and sin6_family, not sin_port and sin_family (2015-01-20). + * net/socket/accept.c: Correct the value returned by accept() in the + case where net_lockingwait() is called. It was returning -1 and + losing the errno value. Noted by Rony Xln (2015-01-22). + * net/: After some significant effort, ICMPv6 and TCP are both + functional when IPv6 is selected. UDP still requires testing + (2015-01-22). + * configs/dk-tm4c129x/ipv6: Add an IPv6-enabled NSH configuration + (2015-01-23) + * include/nuttx/net/icmpv6.h and net/icmpv6/icmpv6_ping.c: First cut + at ICMPv6 ping logic. It works in both directions! (2015-01-23). + * arch/arm/src/efm32/efm32_rmu.c and .h: Add support for the EFM32 + reset management unit (RMU). From Pierre-noel Bouteville + (2015-01-23). + * include/nuttx/math.h: Adds support for the expm1 functions: + http://pubs.opengroup.org/onlinepubs/009695399/functions/expm1.html. + From Brennan Ashton (2015-01-23). + * Many file: Add CONFIG_STACK_COLORATION that does the same thing as + CONFIG_DEBUG_STACK but without enabling debug. From David Sidrane + (2015-01-24). + * Remove CONFIG_DEBUG_STACK. Adding CONFIG_STACK_COLORATION makes + this configuration option pointless (2015-01-24). + * net/: Clean up network status collection for IPv6 (2015-01-24). + * arch/ and configs/: Changes to get USART 2 & 3 working on + lpc4357-evb. These changes are required to get USART 2 and 3 working + on the Embest development board. From Toby Duckworth. + +7.8 2015-02-11 Gregory Nutt + + * include/nuttx/math.h and libc/math: Add support for inverse + hyperbolic functions. From Brennan Ashton (2015-01-26). + * include/nuttx/math.h: Add math library definition for isfinite(). + From Brennan Ashton (2015-01-26). + * include/nuttx/math.h and libc/math/lib_erf*.c: Add error function + to math library. From Brennan Ashton (2015-01-26). + * include/nuttx/math.h and libc/math: Add math library defines for + nan(), copysign(), and trunc() functions. From Brennan Ashton + (2015-01-26). + * sched/wqueue/kwork_process and libc/wqueue/lib_usrthread.c: Fix + a backward calculation when determining the time to the next event. + This is a bug in the back-up, "fail safe", work queue timing so it + not as bad as it seems. From Liio Chen via the PX4 repository + (2015-01-27). + * arch/arm/src/stm32/stm32_exti_gpio.c: Disabling any of EXTI 5-9 + interrupts was disabling interrupts for all EXTI 5-9. Same issue with + EXTI 10-15. From Jussi Kivilinna (2015-01-27). + * arch/arm/src/stm32/stm32_rtcc.c and Kconfig: Recent changes to + stm32_rtcc.c do not compile with STM32L15XX configurations. From + Jussi Kivilinna (2015-01-27). + * net/local: Add initial support for local, Unix domain sockets. + Initial support is limited to SOCK_STREAM and is untested on + initial commit (2014-01-27). + * net/iob, net/tcp/tcp_callback.c, and include/nuttx/net/iob.h: There + were issues with the TCP write-ahead buffering if CONFIG_NET_NOINTS was + enabled: There is a possibility of deadlocks in certain timing conditions. + I have not seen this with the Tiva driver that I have been users but + other people claim to see the issue on other platforms. Certainly it + is a logic error: The network should never wait for TCP read-ahead + buffering space to be available. It should drop the packets + immediately. This was fixed by duplicating most of the IOB interfaces: + The versions that waited are still present (like iob_alloc()), but now + there are non-waiting versions of the same interfaces (like + iob_tryalloc()). The TCP read-ahead logic now uses only these non- + waiting interfaces (2015-01-27). + * net/tcp/tcp_send_buffered.c and tcp_wrbuffer.c: Fix another deadlock + condition. tcp_write_buffer_alloc() calls sem_wait() with network + locked. That worked if CONFIG_NET_NOINTS was not defined because + interrupts are automatically restored when the wait happens. But + with CONFIG_NET_NOINTS=y, the wait blocks with the network locked -- + bad style and also can lead to a deadlock condition (2015-01-28). + * arch/arm/src/armv7-a/arm_memcpy.S and arch/arm/src/armv7-m/up_memcpy.S: + ARM assembly language memcpy.S's were not returning a value in R0 they + are required to do. From David Sidrane (2015-01-29). + * net/local: Extend Unix domain socket support to include support + for datagram Unix domain sockets (2015-01-29). + * net/socket/accept.c: Fix a major TCP bug introduced with commit + e71c09ce9777ff732cb60bd07fb43d85522f79d6. Some connection logic was + reordered; setting the socket as 'connected' got moved to BEFORE the point + where the check was made if the socket was already connected. The + resulting behavior was odd: Telnet would connect, but then when you + exit and reconnect, it would fail to connect. But then if try again, it + would connect okay. So the symptom was connect-fail-connect-fail-... + (2015-01-29). + * net/socket/net_poll.c, recvfrom.c, and udp/udp_callback.c: Add UDP + read-ahead support. This enables support for for poll/select on UDP + sockets and also non-blocking UDP sockets. From Macs N (2015-01-30). + * net/local/local_netpoll.c, socket/net_poll.c, and udp/udp_netpoll.c: + Separate out UDP poll logic from net_poll.c into a new udp_netpoll.c; + Create a skeleton local_netpoll (2015-01-30). + * net/socket/net_poll.c and tcp/tcp_netpoll.c: Separate TCP poll logic + out of net_poll.c and move it into the new tcp_netpoll.c (2015-01-30). + * arch/arm/src/efm32/efm32_clockconfig.c: Logic to unconditionally enable + LE clocking. Even you don't use core clock LE as source for LFA or LFB, + to read are write any register not clocked by HFPERCLK or HFCORECLK, + HFCORECLKLE should be enabled. From Pierre-noel Bouteville (2015-01-30). + * drivers/net/slip.c: SLIP interface improvements. From Macs N + (2015-01-30). + * clock_systimespec(): Fixes for compilation errors in certain + configurations. From Macs N. + * drivers/pipes/fifo.c, include/nuttx/fs/ioctl.h, and net/local/local_fifo.c: + Fix a race condition between FIFO buffer operations and the opening and + closing of FIFOs which necessary when the FIFOs are used to support + Unix domain, datagram sockets. The default policy is the deallocate + FIFO buffering when the last client closes the pipe. When when used + for datagram communications, packets left in the FIFO will be lost. + Some like UDP read-ahead is needed: The buffered data in the FIFO + needs to be retained until the reader gets a chance to re-open the + FIFO. Added an ioctl (PIPEIOC_POLICY) to control the buffer policy. + Default (0) is the legacy behavior; Unix domain datagram logic sets + the alternative policy so that the packet data persists after the FIFO + is closed (2015-01-30). + * net/local: Add configuration options so that Unix domain stream and + datagram support can be separately enabled (2015-01-31). + * fs/vfs/fs_unlink.c and include/nuttx/fs/fs.h: Add an unlink method to + both the character and block driver interface. This is important + because if the driver inode is unlinked and there are no open references + to the driver, then the driver resources will be stranded. On the unlink + call, the driver has the opportunity (1) check if there an any open + references, and if not, (2) free the driver resources (2015-01-31). + * drivers/pipes: Implement the unlink method. If the pipe/FIFO is + unlinked, it will marked the pipe/FIFO as unlinked. If/when all open + references to the driver are closed, all of the driver resources will + be freed (2015-01-31). + * arch/avr: Added architecture support for the Atmel AVR ATMega1284P + MCU. From Jedi Tek'Unum (2015-01-31). + * configs/moteino-mega: Added support for the LowPowerLab MoteinoMEGA + that is based on the Atmel AVR ATMega1284P MCU. From Jedi Tek'Unum + (2015-01-31). + * EFM32 RTC: RTC driver using BURTC. From Pierre-Noel Bouteville + (2015-02-01). + * drivers/ramdisk.c, include/nuttx/fs/ramdisk.h, and other files: Add + logic to dispose of the driver and RAM buffer when the RAM disk has + been unlinked and all open references to the RAM disk have been + closed. Add new parameters to romdisk() to specify what should be + done with the RAM/ROM buffer -- Should it be freed or not? Changed + all calls to ramdisk() to use these new parameters (2015-02-01). + * net/icmpv6/icmpv6_neighbor.c, icmpv6_notify.c (and other files): Adds + basic logic to support verification that we have the IPv6 address in + the Neighbor Table. This feature is important because otherwise the + first packet sent to a remote peer will fail (it will be replaced + with a Neighbor Solicitation) (2015-01-02). + * net/arp/arp.h, arp_notify.c, and arp_send.c: Fixes another + CONFIG_NET_NOINTS issues. When called sem_timedwait() with the + network locked, the network stays locked while we wait which is not + what we want (without CONFIG_NET_NOINTS, interrupts are re-enabled + while we wait and all is well) (2015-02-02). + * net/icmpv6/icmpv6.h, icmpv6_neighbor.c, icmpv6_notify.c: Apply the + same fix as for ARP to the Neighbor Solicitation logic (2015-02-02). + * sched/sched/sched_timerexpiration.c, Kconfig, and include/nuttx/arch.h: + On my platform I have just 16-bit timer clocked at 32kHz. As result + oneshot timer max delay is 2s. The patch adds limit of maximum ticks + in sched_timer_start(). From Macs N (2015-02-03). + * arch/arm/src/sam34: Add support for Tickless mode of operation for + the SAM4CM platform. From Macs N (2015-02-03). + * include/nuttx/net/icmpv6.h and net/icmpv6/Kconfig: Add support for + sending ICMPv6 Router Solicitation and receiving Router advertisement. + This is a part of the ICMPv6 auto-configuration logic is still not + complete (2015-02-03). + * libnx/nxfonts/nxfonts_getfont.c and nxfonts_sans39x48.h: Fixes a + problem with one of the font files. From Pierre-noel Bouteville + (2015-02-03). + * arch/arm/src/efm32/efm32_rtc_burtc.c: Remove a misbehaving assertion. + From Pierre-noel Bouteville (2015-02-03). + * net/icmpv6: Implemented the ICMPv6 Autonomous Auto-Configuration + logic. This is an IPv6 alternative to DHCP. It obtains the IPv6 + addresses and masks using ICMPv6 Router Solicitation and + Advertisement messages (2015-02-03). + * arch/arm/src/stm32/stm32_aes.c, stm32_aes.h, and + chip/stm32l15xxx_aes.h: Add driver for STM32L162XX AES peripheral. + From Juha Niskanen (2015-02-04). + * net/icmpv6/icmpv6_radvertise.c, Kconfig, and other files: Add option + to send Router Advertisement Messages (2015-02-05). + * net/icmpv6/icmpv6_input.c, arch/arm/src/tiva/tm4c_ethernet.c, and + stm32/stm32_eth.c: Add logic to behave like a router (if so + configured): NuttX will not send the router advertisement message + in response to any router solicitation messages (2015-02-05). + * configs/stm32f4discovery/ipv6 and arch/arm/src/stm32/stm32_eth.c: Add + an IPv6 configuration for the STM32F4-Discovery board (with the + STM32-DISCO_BB base board). Verify that the STM32 Ethernet driver + works with IPv6 (2015-02-05). + * net/icmpv6/icmpv6_input.c and icmpv6_rnotify.c: With these two + changes both ICMPv6 autonomous autoconfiguration and router + functionality appear to be working with no problems (2015-02-05). + * arch/arm/src/tiva and configs/tm4c123g-launchpad: Adds support for + TM4C123G timers; integrates with the TM4C123G Launchpad. From Calvin + Maguranis (2015-02-05). + * arc/arc/src/tiva/tiva_adc.c and .h: Adds a Tiva ADC driver. From + Calvin Maguranis (2015-02-05). + * tmv4c123g-launchpad: Add Tiva ADC support to the TM4C123G-Launchpad. + From Calvin Maguranis (2015-02-05). + * arch/arm/src/stm32/stm32_spi.c: The source clock for SPI 4,5, and 6 + should be PCLK2, not PCLK1 (for F411, F427, and F429). Per David + Sidrane (2015-02-07). + * drivers/syslog/syslog_console.c, include/nuttx/syslog/syslog_console.h, + and the console device initialization logic for all architectures: Add + an option to use the syslog'ing device as the system console. This + option enables a low-level, write-only console device at /dev/console + (similar to the low-level UART console device). From Pierre-noel + Bouteville (2015-02-08). + * net/utils: Clean up and consolidate some clunky stuff in ARP and + ICMPv6 time waiting logic by adding new net_timedwait() function + (2015-4-09). + * arch/arm/src/stm32/stm32_eth.c: Add logic so that STM32 Ethernet + driver can avoid interrupt level processing and, instead, execute on + the work thread (2015-4-09). + * configs/stm32f4discovery/netnsh and ipv6: Convert all STM32F4- + Discovery configurations (with base board) to configure the Ethernet + driver to use the work queue (vs. interrupt level processing) + (2015-4-09). + * libc/unisted/lib_execl.c: Fix bad logic in counting the number of + arguments. This could never have worked. Noted by Pierre-noel + Bouteville (2015-4-09). + * arch/arm/src/sama5/sam_emacb.c: Add support for Multicast address + matching and IPv6 in the SAMA5D4 Ethernet driver (2015-02-09). + * configs/sama5d4-ek/ipv6: Add a configuration for testing IPv6 with + the SAMA5D4-EK (2015-02-09). + * arch/arm/src/armv7-a/arm_doirq.c: ARMv7-A interrupt handler should not + automatically re-enable interrupts on interrupt return. That + interferes with the driver's ability to manage interrupts (2015-02-09). + * arch/arm/src/sama5/sam_emacb.c: Add support for CONFIG_NET_NOINTS in + the SAMA5D4 Ethernet driver so that the driver can operate from the + work queue thread instead of doing everything from the interrupt level + (2015-02-09). + * SAMA5D4-EK: CONFIG_NET_NOINTS is now enabled in the nsh and ipv6 + configurations (2015-02-09). + * arch/arm/src/a1x, arm, c5471, common, dm320, imx, lpc2378, lpc31xx, + sama5, str71x, hc/src.common, sh/src/common, x86/src/common, + z16/src/common, z16f, z80/src/z8: Big, very risky change: Remove all + occurrences of up_maskack_irq() that disable and enable interrupts + with up_ack_irq() that only acknowledges the interrupts. This is only + used in interrupt decoding logic. Also remove the logic that + unconditionally re-enables interrupts with the interrupt exits. This + interferes with the drivers ability to control the interrupt state. + This is a necessary, sweeping, global change and unfortunately + to test (2015-02-09). + * mtd/ramtron.c: Table of parts is not terminated properly if + CONFIG_RAMTRON_FRAM_NON_JEDEC is not defined. Noted by David + Sidrane (2015-02-09). + * arch/arm/src/sam34/sam_emac.c, sama5/sam_emaca.c, and sama5/sam_gmac.c: + Clone the SAMA5D4 IPv6 support to the SAM4E EMAC and SAMAd3 EMAC and + GMAC drivers (2015-02-09). + * net/: Lots of build problems introduced into multiple NIC support. + Many places where conditional logic based on CONFIG_NETDEV_MULTINIC is + confused with CONFIG_NET_MULTILINK. Lots of code changed with IPv6 + that was never compiled with MULTINIC enabled. Still some problem + with parameter passing in the MULTINIC configuration(2015-02-09). + * net/iob/Kconfig: In IOB Configuration, the default number of IOB + chains must be more than zero is UDP read-ahead is enabled (2015-02-10). + * net/tcp/tcp_conn.c and udp/udp_conn.c: Fix several build errors/warning + with IPv4 + IPv6 + multiple networks are enabled (2015-02-10). + * arch/arm/src/sam34/sam_emac.c: SAM4 Ethernet driver bow supports + operation using the high priority work queue so that packet processing + can occur outside of interrupt level processing (2015-02-10). + * SAM4E-EK: The nsh configuration now configures the Ethernet driver + for execution on the HP work thread (2015-02-10). + * arch/arm/src/lpc17xx/lpc17_ethernet.c: Add IPv6 support to the LPC17 + Ethernet driver. Untested... I no longer have a proper environment + for LPC17 debug (2015-02-10). + * include/netinet/in.h and libc/net/lib_addrconfig.c: Some extensions + to netinet/in.h adding some Linux compatible definitions. From Macs N + (2015-02-11). + * arch/arm/src/kl: Add architectural support for the K26Z128VLH4 chip. + From Derek B. Noonburg (2015-02-11). + * configs/freedom-kl26z: Add board support for the Freedom KL26Z board. + From Derek B. Noonburg (2015-02-11). + +7.9 2015-04-14 Gregory Nutt + + * arch/arm/src/tiva: Add support for the TM4C1294. Contributed by + Frank Sautter (2015-02-11). + * configs/tm4c1294-launchpad: Add support for the TM4C1294 Launchpad. + Contributed by Frank Sautter (2015-02-11). + * gettimeofday(): Move gettimeofdady() from sched/clock to libc/time. + Remove gettimeofday() from NuttX system calls. It is only a wrapper + around clock_settime() and does not need a trap. gettimeofday() is + no longer treated as a core OS interface (2015-02-12). + * settimeofday(): gettimeofday has been decrecated in POSIX 2008. + settimeofday() was never part of POSIX, but I decided to add it to + libc as well just for symmetry (2015-02-12). + * drivers/sensors/mpl115a.c and include/nuttx/sensors/mpl115a.h: Add + driver for the Feescale MPL115A baramoter. From Alan Carvalho de + Assis (2015-02-12). + * configs/viewtool-stm32f107: Add support for an optional, add-on + Freescale MPL115A baramoter. From Alan Carvalho de Assis + (2015-02-12). + * sched/clock/clock_systimer.c: Fix a problem in clock_systimer64 that + occurs when (1) the 64-bit system time is enabled, and (2) the value + of CONFIG_USEC_PER_TICK is less than 1 milliseconds (such as when using + the tickless mode of operation). In that case, the conversion of time + to 64-bit millisecond value in clock_systmer64() causes some bad times + to be returned. Time was converted to milliseconds, then to configured + ticks. Precision was lost in the millisecond conversion. The fix is + to first convert time to a 64-bit microsecond value, then to the + configured tick value. Noted by David Sidrane (2015-02-13). + * include/nuttx/rtc.h, arch.h, and arch/*/src/*_rtc.h: Removed all of the + old, malformed RTC interface definitions from include/nuttx/rtc.h. The + necessary prototypes have been removed, renamed, scattered to the wind, + hidden under rocks, -- whatever it takes to make it clear that there is + no RTC interface callable from application code (2015-02-13). + * include/nuttx/rtc.h and fs/ioctl.h: Begin the definition of a proper, + driver based RTC interfaces that is better suited to the architectural + goals of nuttx (2015-02-13). + * drivers/timers/timer.c and watchdog.c: Move timer-related drivers from + drivers/ to drivers/timers (2015-02-13). + * drivers/timers/rtc.c: Add an RTC upper half driver. This is the driver + that is documented in include/nutt/rtc.h (2015-02-13). + * arch/arm/src/stm32/stm32_rtcc.c and stm32_rtc.h: Break out a new internal + interface, stm32_rtc_setdatetime(). This eliminates some un-necessary + time conversions. From Freddie Chopin (2015-02-13). + * arch/arm/src/stm32/stm32_rtc_lowerhalf.c, Make.defs, and stm32_rtc.h: Add + a skeleton implementation of the RTC lower half interface at + arch/arm/src/stm32/stm32_rtc_lowerhalf.c. This is just the framework for + the RTC lower half. None of the interface methods have yet been + implemented (2015-02-13). + * net/icmpv6/icmpv6_advertise.c and icmpv6_solicit.c: Add inclusion of + nuttx/net.h to two files. Without these there can be compilation errors + in certain configurations. From Max Neklyudov (2015-02-13). + * net/net_initialize.c, sched/init/os_start.c, and a few other files: + Divide net_intiialize() into net_setup() and net_initialize() to solve + a chicken-and-egg problem. net_setup() must be called before + up_initialize() is called so that networking data structures are ready + to register new network devices. net_initialize() now does only timer + related operations and is called AFTER up_initialize() where the timers + are configured. Problem note by Max Neklyudov (2015-02-14). + * include/time.h and sys/time.h: Move struct timeval from include/time.h + to include/sys/time.h where it belongs (2015-02-15). + * arch/arm/src/stm32/stm32_rtcc.c, stm32_rtc.h, and Kconfig: Extend the + RTC interface to support reading subseconds. From Jussi Kivilinna + (2015-02-16). + * arch/arm/src/efm32/efm32_usbdev.c: EFM32 USB Device is now basically + functional with this change. From Pierre-noel Bouteville (2015-02-16). + * include/nuttx/net/ip.h: Move macros and common logic for IPv4-mapped + IPv6 addresses from files in net/ to include/nuttx/ip.h. These are + currently only used for UDP, but will need to be be used in many places + in the future (2015-02-17). + * includes/nuttx/compiler.h: Add support for the restrict keyword + (2015-02-17). + * include/netdb.h: Add a mostly-commented-out version of the standard + netdb.h header file (2015-02-17). + * arch/arm/src/tiva/: Updated files to allow for ADC triggering by the + timer. I’ve cleaned up some parts of the ADC code, too, and fleshed + out the PWM triggering ioctl. From Calvin Maguranis (2015-02-17). + * configs/tm4c123g-launchpad: Add ADC support. From Calvin Maguranis + (2015-02-17). + * fs/fat/fs_mkfatfs.c: Use DMA memory for mkfatfs when needed. This makes + mkfatfs use fat_dma_alloc() when CONFIG_FAT_DMAMEMORY is set. This is + needed to ensure mkfatfs operates with boards that use DMA for microSD. + From Andrew Tridgell via the PX4/NuttX repository (2015-02-17). + * include/nuttx/rtc.h, fs/fs.h, drivers/ramdisk.c, pipes/, and + timers/rtc.c: The inode unlink method should not be support if + operations on the root pseudo-filesystem are disabled (2015-02-18). + * include/nuttx/sched timing functions: Fix some nanosecond comparisons. + Comparisons should be greate than OR EQUAL TO 1000000000 for maximum + value of nanoseconds in struct tm. From Juha Niskanen (2015-02-20). + * tm4c123g-launchpad: Add board button interrupt logic. From Calvin + Maguranis (2015-02-20). + * "Tiva: Move GPIO prototypes out of arch/arm/include/tiva/irq.h to + arch/arm/tiva/tiva_gpio.h where they belong (2015-02-20). + * arch/arm/src/tiva: Tiva GPIO clean-up by Calvin Maguranis (2015-02-20). + * arch/arm/src/stm32/stm32_pwr.c, stm32_pwr.h, and stm32_rtcc.c: Changes + to support fully write protecting the backup domain. N.B. + stm32_pwr_enablebkp did not account for the delay from enable to the + domain being writable. The KISS solution is a up_udelay. A more + complex solution would be a negated write test with restore. From + David Sidrane (2015-02-21). + * arch/arm/src/stm32/stm32_bbsram.c, stm32_bbsram.h, Kconfig, and + Make.defs: Adds the ability to use the STM32F2 and STM32F4 Battery + Backedup SRAM in the file system. With an option to Save Panic + context to one of the files. From David Sidrane (2015-02-21). + * configs/pic32mx-starterkit: Rename from pic32-starterkit to make + room on the namespace for a pic3mz-starterkit. Update src/ directory + file naming to match current standard. Refresh configurations. Move + linker scripts to a new scripts/directory. Make sure that it builds + using the Pinquino toolchain (2015-02-21). + * arch/mips/src/mips32/Toolchain.mk: Current Pinguino toolchain uses + the prefix p32- instead of mips- (2015-02-21). + * configs/pic32mz-starterkit: Add basic board support for the PIC32MZ + (can't build yet of course because there is not yet any PIC32MZ + support) (2015-02-22). + * arch/mips/src/pic32mz and include/pic32mz: Add some PIC32MZ header + file definitions and just enough logic in the source directory so + that we can run 'make menuconfig'. Still a very long way from being + complete (2015-02-22). + * libc/time/lib/lib_sfrtime.c: Missing implementation of %C in + sfrtime() C (was being treated as %y). From Freddie Chopin + (2015-02-23). + * drivers/can.c: In the can_open function: this line + 'dev->cd_ocount = tmp;' needs to be moved a few lines down otherwise + the open count will only be incremented from 0 to 1. This causes + problems when trying to open the can bus from two different tasks. + SourceForge Patch #46 from Anonymous (2015-02-23). + * Tiva TM4c1294: Updates from Frank Sautter (2015-02-24). + * fs/aio: correct some backward tests in aio_read() and aio_write(): + Socket descriptors have higher numbers than file descriptors. In + aio_contain(), Copy u.ptr (void *) when initializing aioc and not + the case specific u.aioc_filep. From Michal Ulianko (2015-02-24). + * include/pthread.h: Fix PTHREAD_COND_INITIALIZER (2015-02-24). + * sched/clock/clock_systimespec.c: When an RTC is used clock_systimespec() + must subtract the basetime from the returned time. It needs to + return the time since power up, no the current time. Issue noted + by Max Neklyudov (2015-02-25). + * fs/vfs/fs_select.c and sched/semaphore/sem_timedwait.c: Fix places + where the errno value was being overwritten by subsequent actions so + that the returned errno value was incorrect. From Max Neklyudov + (2015-02-25). + * include/sys/select.h: Extend the fd_set type definition so that it + can handle more than 32 descriptors (if so configured). From Max + Neklyudov (2015-02-25). + * net/netdev/netdev_unregister.c: Fix a list handling error in + netdev_unregister(). From Max Neklyudov (2015-02-27). + * net/netdev/netdev_register.c: Improve the network device registration + logic. When multiple link types are used, modify how each interface + number is assigned to the device name by incrementing the device + number individually for each interface link type. From Max Neklyudov + (2015-02-27). + * include/nuttx/board.h: Remove common board function prototypes from + other files and consolidate them in this new header file (2015-02-27). + * arch/mips/src/pic32mz/: Implement support IO port interrupts + (2015-03-01). + * configs/pic32mz-starterkit/src: Add support for on-board buttons + (2015-03-01). + * include/nuttx/spi/spi.h: Add an SPIDEV_USER so that there can be + board-specific definitions of SPI devices (2015-03-01). + * arch/arm/src/stm32 and arch/arm/src/stm32: Adds architecture support + for the STM32F372 and F373 (no board support yet). Only tested on + STM32F373CC, but should work on the rest. Contributed by Marten + Svanfeldt (2015-03-01). + * arch/mips/src/pic32mz/pic32mz-spi.c and chip/pic32mz-spi.h: Add + support for a basic SPI driver for the PIC32MZ (2015-03-03). + * include/nuttx/i2c.h: Add a user provided void * argument to the + I2C callback method for the I2C slave interface. Suggested by + Nate Weibley (2015-03-03). + * crypto/, include/nuttx/crypto, and arm/src/common/up_initialize.c: + Fix issues when AES support was added for the STM32L1. From Juha + Niskanen (2015-03-04). + * arch/arm/src/stm32/stm32_spi.c and .h: Add missing SPI callback + functions to the STM32 SPI driver. From Freddie Chopin (2015-03-04). + * arch/*/src/*/*_assert.c, configs/Kconfig, and include/nuttx/board.h: + Add support for dumping board-specific information on assertion. + From David Sidrane (2015-03-04). + * drivers/spi/Kconfig: Add missing CONFIG_SPI_CALLBACK selection. Noted + by Freddie Chopin (2015-03-04). + * arch/arm/src/samv7 and include/samv7: Add basic build directories + and configuration logic for the Atmel SAMV7 family (2015-03-05). + * arch/arm/src/Makefile, armv7-m/Toolchain.defs: Make ARM build system + Cortex-M7 ready (2015-03-05). + * arch/arm/src/sam34/sam_start.c: Leverage start-up logic from STM32 + to (1) Enable the FPU and (2) perform IDLE stack coloration + (2015-03-05). + * arch/arm/src/armv7-m/up_lazyexception.S, Kconfig and severl other + files: Add support for lazy FPU state saving. Not yet verified. + (2015-03-06). + * arch/arm/Kconfig, Make.defs, sam_start.c, configs/Kconfig, + samv71-xult: Add a bare bones framework that will do nothing more than + support configuration for the Atmel SAMV71 Xplained Ultra board. Very + much a work in progress (2015-03-06). + * sched/mqueue/mq_timedsend.c: Should not check for valid time if + there is space in the message queue. Noted by Freddie Chopin + (2015-03-10). + * arch/arm/src/tiva/tiva_timerlib.c: Fix a typo in peripheral wait + logic: gptm, not gpio. From Bradley Noyes (2015-03-10). + * drivers/net/tun.c, Make.defs, include/nuttx/net/net.h, tun.h, and + net/Kconfig: Add TUN device. From Max Neklyudov (2015-03-11). + * fs/fat/fs_fat32.c: fat_unbind() was accessing 'fs->fs_sem' after + freeing the 'fs' struct. From Juha Niskanen (2015-03-11). + * fs/procfs/fs_procfsproc.c: fs_procfsproc: Fix potential NULL pointer + dereference of 'node'. From Juha Niskanen (2015-03-12). + * sched/sched/sched_waitpid.c: Do not use uninitialized boolean in + waitpid(). From Juha Niskanen (2015-03-12). + * libc/stdio/lib_ungetc.c:Fix NULL pointer dereference in ungetc(). + If 'stream' was NULL, 'stream->fs_oflags' was evaluated. From Juha + Niskanen (2015-03-12). + * arch/arm/src/stm32/stm32_i2c.c: Add missing NULL check. From Juha + Niskanen (2015-03-12). + * drivers/usbdev/usbmsc_scsi.c: Add NULL pointer check. From Juha + Niskanen (2015-03-12). + * drivers/bch/bchdev_driver.c: Avoid NULL pointer dereference when + bch->refs == 255. From Juha Niskanen (2015-03-12). + * arch/arm/src/armv7-m/mpu.h: Bad syntax in ARMv7-M MPU logic would + cause failure to write the correct value to the MPU_RASR register. + From Juha Niskanen (2015-03-12). + * net/socket/net_dupsd.c: Do not call sockfd_socket() twice. From + Juha Niskanen (2015-03-12). + * arch/arm/src/stm32/stm32_usbdev.c: Fix stale initialization + invalidating later NULL check. From Juha Niskanen (2015-03-12). + * arch/arm/src/stm32/stm32_serial.c and chip/stm32f10xxx_dma.h: Fix + RX DMA setup for UART5. From Jussi Kivilinna (2015-03-13). + * arch/arm/src/stm32/stm32_serial.c: Make input hardware flow-control + work with RX DMA. From Jussi Kivilinna (2015-03-13). + * drivers/pipes/pipe_common.c: Fix zero-lenth writes to pipes/FIFOs. + From Jussi Kivilinna (2015-03-13). + * drivers/serial/serial.c: Report correct number of bytes free in + serial buffer with FIONWRITE. From Sami Pelkonen via Jussi Kivilinna + (2015-03-13). + * drivers/mmcsd/mmcsd_spi.c: Debugging and manuals (this one + https://www.sdcard.org/downloads/pls/simplified_specs/part1_410.pdf + and this one https://www.sdcard.org/downloads/pls/simplified_specs/part1_410.pdf) + shows that ACMD23 must be preceded with CMD55 command as any other + ACMD commands. Also, after the block reading wait loop must be + inserted before writing the next block of data to the sd card. From + Dmitry Nikolaev via Jussi Kivilinna (2015-03-13). + * arch/arm/src/efm32/efm32_i2c.c: Add I2C driver. From Pierre-noel + Bouteville (2015-03-14). + * fs/mount/, include.sys/mount, syscall/: Add umount2(). umount() is + now a macro that just calls umount2() with flags = 0 (2015-03-14). + * fs/mount/fs_umount2.c, all file systems, include/nuttx/fs/fs.h: Pass + the umount2() flags to every unbind() implementation. That is where + the decision to umount or not will be made (2015-03-14). + * fs/fat/fs_fat32.c: Fix a bug in the FAT unbind() logic. There were + problems with the way certain internal list handling was implemented. + The end result is that newly opened or cloned file structures were + never being added to the list of open files. So when the unmount() + happens, it always looked like there were not open files and a crash + could ensue (2015-03-14). + * fs/fat/fs_fat32.c and fs_fat32.h: Add support for umount2(target, + MNT_FORCE) in the FAT file system (2015-03-15). + * drivers/mmcsd/mmcsd_sdio.c: Fix some bad logic when file system debug + is turned on: Arguments to syslog were missing so that garbage was + being printed (2015-03-15). + * arch/arm/src/sama5/sam_hsmci.c: Fix a bug in SAMA5 HSMCI. The + bitfield mask and shift values were reversed resulting in a trashed + value for the number of blocks in the BLOCKR register. This was + sufficient to prevent DMA writes from working (2015-03-15). + * drivers/mtd/at24xx.c, Kconfig, and include/nuttx/fs/ioctl.h: Add + support for (1) the byte-oriented read() method, (2) devices that + have extended memory regions, and (3) devices that use 8-bit + addressing (2015-03-17). + * arch/mips/src/mips32/Kconfig, Toolchain.defs, and + configs/pic32mz-starterkit/nsh/Make.defs: Changes that will permit + building of the PIC32MZ Start Kit configuration using MPLAB and the + XC32 toolchain. From David Sidrane (2015-03-17). + * arch/arm/src/stm32/stm32_rtc_lowerhalf.c: Fix some errors in the + STM32 RTC lower-half driver that cause compilation failures. From + shilo.xyz (2015-03-19). + * arch/arm/src/sama5/chip/sam_tc.h: Fix typos in timer/counter header + file. From Bob Doiron (2015-03-20). + * configs/olimexino-stm32: Board support for the Olimexino STM32 board + from David Sidrane (2015-03-20). + * PIC32MZ: Incorporated a set of patches that makes the basic NSH + configuration on the PIC32MZ Starter Kit. From Kristopher Tate + (2015-03-22). + * arch/arm/src/tiva: (1) ADC driver has been re-organized; configuration + is now handled in code instead of Kconfig to help reduce bloat and + confusion. (2) Timer changed to remove ADC coupling in Kconfig to code + and moved configuration up from arch/arm/src/tiva to + configs/tm4c123g-launchpad/src. (3) GPIO driver needed small fixes in + the configuration routines and discovered false-positive bugs in + interrupt testing: interrupts are now verified to actually be working + reliably. (4) Attempt to apply some consistency in the tiva arch/ + level's interface to the config/board/ level driver configuration. + From Calvin Maguranis (2015-03-23). + * arch/mips/src/pic32mz: Various fixes for Ethernet support. Still + not fully functional. From Kristopher Tate (2015-030-29). + * arch/arm/src/armv7-m: Add configuration option and logic to support + the D-Cache in write-through mode (2015-03-29). + * arch/arm/src/stm32/Kconfig, stm32_lse.c, stm32_lsi.c, stm32_rtc.c/.h, + stm32_rtcc.c, stm32_rtcounter.c, and stm32f*_rcc.c: The + STM32F4Discovery board doesn't come with a Low speed external + oscillator so the default LSE source for the RTC doesn't work. In + stm32_rtcc.c the up_rtc_initialize() logic doesn't work with the LSI. + The check on RTC_MAGIC on the BK0R register lead to rtc_setup() call + that rightfully enables the lsi clock; but the next times, when the + rtc is already setup, the rtc_resume() call does NOT start the lsi + clock! The right place to put LSE/LSI initialization is inside + stm32_stdclockconfig() in stm32fxxxxx_rcc.c. Doing this I checked + the possible uses of the LSI and the LSE sources: the LSI can be used + for RTC and/or the IWDG, while the LSE only for the RTC (and to output + the MCO1 pin). This change is not verifed for any other platforms. + From Leo Aloe3132 + * Rename arch_nshinitialize() to board_app_initialize() (2015-03-30). + * ./*.mk, configs/.gitignore, Makefile, boardctl.c, include/nuttx/fs/ioctl, + include/sys/boardctl.h, syscall.h, and syscall/: Add a new non- + standard OS interface called boardctl(). This is similar to a driver + IOCTL call. But this is an IOCTL call directly on the board logic. + This function will eventually replace all of the ad hoc OS interfaces + that are current used to perform application specific initialization + and application driver test configuration. It essentially formalizes + and institutionalizes these rogue interface in to at least a single + crazy call (2015-03-31). + * configs/: Modify all configurations: Make sure that + CONFIG_LIB_BOARDCTL=y appears wherever CONFIG_NSH_ARCHINIT=y appears. + Remove support for CONFIG_NSH_ARCHMAC. It is not used and there are + better ways to do that operation (2015-03-31). + * configs/Kconfig, boardctl.c, all touchscreen driver setup functions, + include/board.h, include/sys/boardctl.h, and + include/nuttx/input/touchscreen.h: arch_tcinitialize() and + arch_tcunitinitialize() renamed to board_tsc_setup() and + board_tsc_teardown(). These are not long called directly by + applications but only indirectly throught the crappy boardctl() OS + interface (2015-03-31). + * configs/Kconfig, boardctl.c, include/nuttx/board.h, include/sys/boardctl.h, + and several ADC files in configs//src/: Rename adc_devinit() to + board_adc_setup(). Add support to the boardctl() interface so that it + can call board_adc_setup() on behalf of an application. Make sure that + the proper features are enabled in the defconfig files that have + CONFIG_EXAMPLES_ADC=y (2015-03-31). + * configs/*/defconfig: Make sure that all defconfig files that require + external graphics intiialization also enable the correct boarctl() + settings (2015-03-31). + * include/nuttx/board.h, include/sys/boardctl.h, nuttx/configs/Kconfig and + boardctl.c, and board configurations and PWM implementations: Rename + pwm_devinit() to board_pwm_setup(). Add CONFIG_BOARDCTL_PWMTEST that + will enable calling board_pwm_setup() from boardctl(). In all + configurations that enable the apps/examples/pwm test, make sure that + boardctl() support is properly enabled (2015-03-31). + * Move include/nuttx/timer.h, rtc.h and watchdog.h to include/nuttx/timers/. + (2015-04-01). + * drivers/timer/cs2100-cp.c and include/nuttx/timers/cs2100-cp.h: Add a + very basic driver for the CS2100-CP Fractional-N Multipler chip (2015-04-02). + * configs/, graphics/, include/nuttx: More renaming: up_lcdinitialize->board_lcd_initialize, + up_lcdgetdev->board_lcd_getdev, up_lcduninitialize->board_lcd_uninitialize + (2015-04-04). + * include/nuttx/nx, libnx/nx, libnx/nxtk: Add a new 'capped' parameter to + nx_drawline(), nxtk_drawlinetoolbar(), and nxtk_drawlinewindow() + (2015-04-05). + * libnx/nx/nx_drawline.c, libnx/nxtk/nxtk_drawlinetoolbar.c and + nxtk_drawlinewindow.c: Implement line caps by drawing a file circle at + the each endpoint of a line with a radius equal to half of the width + of the line (2015-04-05). + * include/time.h, nuttx/time.h, libc/time/lib_dayofweek.c and + lib_gmtimer.c: Implements CONFIG_TIME_EXTENDED as we discussed + relative to providing the last 3 members of the tm struct and support + for filling them in and even using the wday in the STM32 RTC. From + David Sidrane. + * arch/arm/src/sam34/sam_serial.c and samv7/sam_serial.c: A side-effect + of changing serial settings via TERMIOS (such as tcsetattr) is that + serial interrupts were being left disabled. This is not a problem if + the serial configuration is changed when there are no open references + to the serial device. In that case, serial interrupts are disabled and + will not be enabled enabled until the serial device is first opened. + But it is fatal if the serial device is already opened and if there is + a task waiting to receive data. In that case, the side-effect of + disabling interrupts is fatal: That task is then left hanging with + interrupts disabled (2015-04-08) + * arch/arm/src/sama5/sam_serial.c: Backport support for flowcontrol and + termios from SAM3/4 -- UNVERIFIED. (2015-04-08). + * arch/arm/src/sam34/sam_serial.c and samv7/sam_serial.c: The IMR + register is read-only. This means that sam_restoreints() did not + actually re-enable UART interrupts (2015-04-08). + * sigaddset() and sigdelset(): Need to set errno if a bad signal number + is received (2015-04-09). + * sighold(), sigrelse(), sigignore(), sigset() and sigpause(): New + signal handling functions (2015-04-09). + * Fixes to asinh(), atanh(), and sinh(): The 'basic' expansions all + exhibited bad cancellation errors near zero (<= 1E-10). This can be + easily seen e.g. with x = 1E-30, the results are all zero though they + should be extremely close to x. The cutoff values (1E-5, 1E-9) are + chosen so that the next term in the Taylor series is negligible (for + double). Functions could maybe be optimized to use only first term (x) + and a smaller cutoff, just bigger than where the cancellation occurs + (2015-04-09). + * syscall/syscall.csv: Last changes to message queue prototypes did not + make it into call gate logic (2015-04-09). + * syscall/syscall_stublookup.c: Fix some errors that crept in recently + (2015-04-09). + * libc/time/lib_localtime.c: Inconsistent configuration name: + CONFIG_LIBC_TZDIR vs CONFIG_LIBC_TZ_TZDIR. Former wins (2015-04-11). + * libc/time/lib_calendar2utc.c and lib_mktime.c: Fix an error in time + initialization when there is not RTC and the time is initialized from + a fixed configured value. The call to clock_calendar2utc() was + returning the time in units of seconds. The initialization logic, + however, was expecting to get time in units of days. This problem + has been there forever but obviously has not significant impact to + behavior in systems where time is not visible (2015-04-12). + * fs/fat/fs_fat32utils.c: Fix misthink when CONFIG_ENDIAN_BIG=y. From + Lwazi Dube (2015-04-12). + * include/nuttx/net/netdev.h, net/devif/ipv6_input.c, + icmpv6/icmpv6_rsolicit.c and net/icmpv6/icmpv6_solicit.c: Use common + macro(s) for calculating link layer header length. From Brennan + Ashton (2015-04-13). + * apps/netutils/pppd/Kconfig, pppd.c, and ntpv3.h (removed): Remove + ntpclient header file in and NTP client references from the pppd + dir. From Brennan Ashton (2015-04-13). + * configs/galileo: Remove all references to the Galileo board. That + port is not going to happen (I don't even have the hardware anymore) + (2015-04-13). + * drivers/input/max11802.c: Fix possible unmatched IRQ restore. Noted + by Juha Niskanen (2015-04-14). + * atexit(): Fix reference to undefined variable in certain + configurations. From Juha Niskanen (2015-04-14). + +7.10 2015-06-09 Gregory Nutt + + * configs/sim/src/sim.h, sim_zoneinfo.c, Makefile, and sim_boot.c: Add + logic to test localtime and TZ database. See apps/system/README.txt + for info (2015-04-15). + * libc/Kconfig: Fix defaults for timezone limits. They need to be much + larger (2015-04-15). + * Watchdog files: Fix repeated typo wachog.h in several watchdog + drivers (2015-04-15). + * configs/boardctl.c and Kconfig: Add missing causing that caused + failures of PWM test (2015-04-15). + * arch/arm/src/stm32: Defines a second interface for the dma2d controller. + Controlling both LTDC and DMA2D was unpractical from the programmers + view because both controllers are to different. LTDC only controls the + display visibility but the DMA2D controller changes the content of the + frame buffer (buffer of the layer). + + The main features are: + + 1. DMA2D interface + Supports the nuttx pixel formats: + - FB_FMT_RGB8 + - FB_FMT_RGB24 + - FB_FMT_RGB16_565 + Dynamic layer allocation during runtime for the supported formats + - The number of allocatable layer can be configured. + Supported dma2d operation: + - blit (Copy content from source to destination layer) also works + with selectable area. + - blend (Blend two layer and copy the result to a destination layer + which canbe a third layer or one of the source layer) also works + awith selectablerea. + - fillarea (Fill a defined area of the whole layer with a specific + color) + + As a result of that the dma2d controller can't transfer data from the + core coupled memory, CCM is disabled but usable by the ccm allocator. + Currently the ccm allocator is used for allocating the layer structure + only. For the dma memory (layers frame buffer) memory is allocated from + heap 2 and 3. + + 2. LTDC interface + I have changed the api for the currently non implemented operations: + - blit (Copy content from a dma2d layer to an ltdc layer) also works with + selectable area. + - blend (Blend two dma2d layer and copy the result to a destination ltdc + layer) also works with selectable area. + + Note! ltdc layer is a layer referenced by the ltdc interface. dma2d layer + is a layer referenced by the dma2d interface. + + One of the most important questions for me was, How can i flexible use an + ltdc layer with the dma2d interface, e.g. as source layer for dma2d + operations? + Get the layer id of the related dma2d layer by a special flag when using + getlid() function of the ltdc interface and use the layer id to reference + the specific dma2d layer by the dma2d interface. + + The ltdc coupled dma2d layers are predefined and can't be dynamically + allocated of freed. They use the same frame buffer memory and the same + color lookup table. + + Changes: + - layer internal format of the clut table + - interrupt handling for register reload (vertical vblank) instead using + waiting loop + - small fixes and refactoring + From Marco Krahl (2015-04-16). + * Add support for the new DMA2D features to the STM32F429i-Disco LTDC + configuration. From Marco Krahl (2015-04-16). + * stdlib.h: MAX_RAND should be RAND_MAX (2015-04-16). + * STM32F429i Disco: (1) Fix a bad return value if the LCD driver is already + initialized. (2) The LCD driver initialization is now performed during the + early boot sequence. (3) Increased the size of the message queue from 32 + to 64 in the lcd configuration. From Marco, ocram.lhark@yahoo.com + (2015-04-17). + * STM23 RTC: Fix an error introduced into stm32_pwr_enablebkp(). That + function must preserve the previous state of backup domain access on + return (2015-04-19). + * include/nuttx/usb/hub.h: Add USB hub header file from Kaushal Parikh + (2015-04-18). + * drivers/usbhost/usbhost_hub.c: Bring in USB hub-related files from + https://github.com/kaushalparikh/nuttx. This is the work of Kaushal + Parikh. This initial commit is incomplete. This is quite a bit more + hub logic that needs to come in before the port is complete + (2015-04-18). + * arch/arm/src/stm32/stm32_rtcounter.c: Now need to enable backup + domain write access when setting the time. From Darcy Gong (2015-04-19). + * include/nuttx/usb/usbhost.h: Bring in more logic from + https://github.com/kaushalparikh/nuttx (2015-04-19). + * drivers/usbhost/usbhost_enumerate.c: Last of USB hub logic from + https://github.com/kaushalparikh/nuttx (2015-04-19). + * include/time.h: Add prototypes for localtime() and localtimer_r() + (2015-04-21). + * include/assert.h: Wrap definitions of assertion macros in do while. + Suggested by orbitalfox (2015-04-22). + * sched/semaphore/sem_wait.c: Missing comma on debug statement caused + compile error with DEBUG on. Why hasn't that been noted before? + (2015-04-23). + * drivers/lcd and include/nuttx/drivers: RA8875 LCD driver contributed + by Marten Svanfeldt (2015-04-24). + * arch/arm/src/stm32/chip/stm32_pwr.c and .h: Adds support for STM32's + Programmable Voltage Detector (PVD) feature. Register access is behind + CONFIG_STM32_ENERGYLITE as the feature has not been verified for + F1/F2/F4 etc. manuals. Tested on STM32L1. PVD interrupt looks generic, + at least #defines it needs are in headers for every chip variant. By + Dmitry Nikolaev, submitted by Juha Niskanen (2015-04-28). + * arch/arm/src/stm32/chip/stm32_exti.h, stm32f30xxx_memorymap.h, and + stm32f37xxx_memorymap.h: Added missing EXTI definitions for the STM32 + F3; Correct an error the port D base address in the STM32 F30x and F37x + memory maps. From Greg Meiste (2015-05-01). + * arch/arm/src/lpc17xx/lpc176x_gpio.c: Reorder steps when an output + GPIO is configured in order to avoid transient bad values from being + output. From Hal Glenn (2015-05-02). + * arch/arm/src/stm32/stm32_otgfsdev.c and stm32_otghsdev.c: Add + protection in the event that out-of-bound endpoint numbers are + received. From David Sidrane (2015-05-02). + * USB host: Merged in the USB hub support that has been happening on + a separate branch up until this point. The interfaces are complete + and most platforms have been verified (still a little to be done + however). (2015-05-02) + * arch/arm/src/lpc31xx/lpc31_ehci.c, chip.h, sama5/sam_ehci.c, and + chip.h: Fix cache related problem in LPC31 and SAMA5Dx EHCI drivers. + All buffers are now aligned with the cache line size in both starting + address and in length. This cause major problems in unlucky builds + where the USB host buffers where unaligned and abutting other data. + The cache flush and invalidate operations could be subverted by + accesses to adjacent data or could have unexpected side effects. This + bug has been in the ECHI drivers forever, but was only revealed due to + unlucky memory allocations during the integration of the hub feature + (2015-05-03). + * arch/arm/src/lpc17xx/lpc17_usbhost.c: Correct some initialization of + data structures. When hub support is enabled, it would overwrite the + end of an array and clobber some OS data structures (2015-05-03). + * configs/olimex-lpc1766stk: Make stacks usage configurable for USB + host waiter. It needs to be a lot deeper when hub support is enabled + (2015-05-03). + * fs/vfs/fs_poll.c: Fix resource leak and memory corruption on poll + failure. From Jussi Kivilinna (2015-05-04). + * All USB host drivers in arch/ and all USB class drivers in drivers/usbhost: + Modify the transfer() and asynch() methods so that the actual size of + the transfer is returned. Unverified on initial commit (2015-05-05). + * drivers/usbhost/usbhost_cdcacm.c: Add initial implementation of a host- + side CDC/ACM driver. Completely untested on initial commit (2015-05-06). + * configs/, drivers/usbhost/usbhost_storage.c, and included/nuttx/usb/usbhost.h: + Rename usbhost_storageinit() to usbhost_msc_initialize(). Add calls + to usbhost_cdcacm_initialize() if CONFIG_USBHOST_CDCACM is selected + (2015-05-06). + * arch/arm/include/kl and src/kl: Add support for the KL25Z64. The + KL25Z64 is a lower memory variant of the KL25Z128 and is used on the + Teensy LC. From Michael as SourceForge patch 50 (2015-05-07) + * configs/teensy-lc and related board support files: Add board support + for the Teensy LC board. Support is based off the Freedom KL25Z board. + LED, PWM, and UART0 have been tested. The SPI pins are mapped + correctly but have not yet been tested. From Michael Hope as + SourceForge patch 51 (2015-05-07). + * arch/arm/src/kl/kl_pwm.c: Fix PWM debugging. TPM1 and TPM2 have two + channels instead of six and will hard fault if you try to read the + missing channels. From Michael Hope (2015-05-07). + * arch/arm/src/kl/kl_lowputc.c: enable the clocks to UART1 and UART2. + The previous version would cause a hard fault on startup due to the + modules not being clocked. Also drop the GPIO configuration as it's + done during kl_start(). From Michael Hope (2015-05-07). + * teensy-lc: remap UART0 to the standard pins. From Michael Hope + (2015-05-07). + * arch/arm/src/stm32 and include/stm32: Added support for STM32F302K8 + and STM32F302K6. From Ben Dyer via PX4/David Sidrane (2015-05-08). + * configs/compal_e86: Calypso Compal-E86: Updates for execution out of + FLASH on the C139 phone. From Craig Comstock (2015-05-08). + * STM32 F3: Add DBGMCU register definitions for the F3 family. From + Greg Meiste (2015-05-09). + * arch/arm/src/stm32/chip/stm32_exti.h: Add EXTI line definitions for + the STM32L family (2015-05-09). + * net/tcp/tcp.h: Correct failures in long Telnet sessions by increasing + the size of the number of bytes sent from uint16_t to uint32_t. This + avoids an integer overflow that causes a Telnet sessions to be closed + unexpectedly. From Rony XLN (2015-05-12). + * include/stdio.h, sys/statfs.h, cxx/cstdio, and syscall/syscall.csv: + Remove duplicate prototype of statfs from stdio.h. Belongs in + sys/statfs.h only. Note by Michael Hope (2015-05-12). + * arch/arm/include/kl/chip.h: Fix typo in header file. From Michael + Hope (2015-05-12). + * arch/arm/src/kl/chip/kl_tpm.h: Fix offset to the TPM status register. + From Michael Hope (2015-05-12). + * net/local/local_connect.c: Correct some network lock logic: Two + error conditions where the network was not being unlocked and one + where it was getting unlocked twice. From Jussi Kivilinna (2015-05-12). + * net/local/, fs/vfs/fs_poll.c, drivers/pipes/pipe_common.c/.h, + include/nuttx/fs/fs.h: Add poll support for Unix stream sockets. From + Jussi Kivilinna (2015-05-12). + * net/local/: Local stream sockets had problem of double releasing pipes + (both server and client attempt release), which causes wrong pipe pair + being closed in multi-client case. Solve by adding per connection + instance ID to pipe names. From Jussi Kivilinna (2015-05-12). + * drivers/usbdev/ all class drivers: There needs to be a check to make + sure that the size of a returned string does not exceed the size of + the allocated request buffer. Strings such as vendor names or product + names will be truncated to fit in the request buffer (2015-05-12). + * arch/arm/src/samv7/sam_twihs.c: Fix SAMV TWIHS logic that performs + multi-message transfers with and without repeated starts (2015-05-12). + * maXTouch Xplained Pro: The above TWIHS fix was the last barrier to + getting the touchscreen working in the maXTouch Xplained Pro LCD + (2015-05-12). + * net/route/ and net/netdev/netdev_ioctl.c: Complete implementation of + the IPv6 routing logic. From Max Neklyudov (2015-05-13). + * net/udp/: Add inclusion of assert.h in networking files where needed + to avoid compilation errors. From Max Neklyudov (2015-05-13). + * /net/route/netdev_router.c: Fix bug in IPv6 router from Max Neklyudov + (2015-05-13). + * sched/pthread/pthread_kill.c: Re-implemented pthread_kill(). It was + just a simple wrapper around kill() but since the correct dispatching + of signals for multi-threaded task groups has been implemented, + calling kill() does not do what pthread_kill() is supposed to do. The + corrected implementation of pthread_kill() will direct the signal + specifically to the specific pthread and no other (2015-05-13). + * arch/arm/include/samdl, arch/arm/src/samdl, configs/samd20-xplained: + Rename the samd/ directories and configuration varialbes to samdl to + all the same directory structure to support the SAML21 (2015-05-14). + * arch/arm/include/samdl and arch/arm/src/samdl: And chip definitions, + configuration framework, and placeholder memory map and pin + configuration files for SAML21 support. Still incomplete on initial + commit (2015-05-14). + * include/nuttx/wdog.h, sched/mqueue/mq_timed*.c, semaphore/sem_timed*.c, + signal/sig_timed*.c, timer/timer_settime.c, and wdog/wd_start.c: + Update the type passed to watchdog timer handlers. Using uint32_t is + a problem for 64-bit machines (2015-05-18). + * configs/saml21-xplained: Add a board build configuration for the + SAML21 Xplained Pro. Initial commit is just the SAMD20 Xplained Pro + board support with naming changed. Does not yet build (2015-05-18). + * libc/net/lib_inetntoa.c: Correct errors in printing IP address when + type char is signed. From Max Neklyudov (2015-05-19). + * arch/arm/src/efm32/efm32_rtc_burtc.c: Updated EFM32 RTC driver from + Pierre-noel Bouteville (2015-05-19). + * arch/arm/src/tiva/chip/tm4c_memorymap.h, tm4c_pinmap.h, and vectors.h. + configs/tm4c1294-launchpad/include/board.h and src/tm4c_autoleds.c: + Fixes for Tiva TM4C1294NCPDT. From Frank Sautter. (2015-05-20). + * configs/tm4c1294-launchpad/include/board.h: Added TM4C1294NCPDT + EN0_LED2 (10/100-Base-Tx); removed all booster pack pin definitions. + From Frank Sautter (2015-05-20). + * nuttx/arch/arm/src/sam34/sam_serial.c: In NONBLOCKING mode serial + does not receive bytes from UART. This happens because RX interrupt + was disabled in the setup routine. To fix this I save interrupt + configuration before UART shutdown and restore it after. From Max + Neklyudov (2015-05-21). + * arch/arm/include/lpc11xx and src/lpc11xx: Support for the LPC11xx + family (the LPC1115 MCU in particular). Contributed by Alan Carvalho + de Assis (2015-05-22). + * configs/lpcxpresso-lpc1115: Support for the LPCXpression LPC1115 + board. Contributed by Alan Carvalho de Assis (2015-05-22). + * arch/arm/src/sam34/Kconfig, sam_serial.c, and chip/sam_uart.h: Add + support for optical mode for the SAM4CM UART1. From Max Neklyudov + (2015-05-23). + * arch/arm/src/lpc11xx/: Add support for up_getc() which is needed + for NSH if there is no file system. From Alan Carvalho de Assis + (2015-05-23). + * LPCXpresso-LPC1115: Add a minimal NSH configuration that has the + file system disabled. Update README with OpenOCD instructions. + From Alan Carvalho de Assis (2015-05-23). + * Fix numerous typos in configuration variable names. Tracked down + by Alan Carvalho de Assis (2015-05-23). + * configs/teensy-2.0: Rename configs/teensy so that it is clearly + distinguished from teensy-lc and teensy-3.1 (2015-05-15). + * include/nuttx/mtd/mtd.h: Increase the size of the fields in the + geometry structure (again) to support larger FLASH sizes. Needed + by Sbastien Lorquet (2015-05-26). + * SAM4CM and SAMA5D Free-running timer: Logic that samples the free + running counter reads the pending interrupt status register and + can cause interrupts to be lost. So, if when the status register + is read, the logic must also handle the timer overflow event. + Found and fixed by Max Neklyudov (2015-05-26). + * arch/arm/include/kinetis and arch/arm/src/kinetis: Basic support + for the Kinetis K20 architecture. Taken from PX4. This is the + work of Jakob Odersky (2015-05-26). + * net/: Move some ICMP event lists to the device structure. That + allows for both device-specific event processing and also devices + to generate events like network down. From Max Neklyudov (2015-05-27). + * net/: Extend Macs logic to ARP and ICMPv6. Also found and fix + several IPv6-related compilation errors that have crept in. IPv6 + has been broken for awhile (2015-05-27). + * net/tcp: Fix an important TCP networking bug: 16-bit flags was + being converted to 8-bits in a few locations, causing loss of + status indications (2015-05-27). + * net/socket and net/tcp: net_startmonitor.c always returned OK. In + the case where a socket has already been closed, it correctly handled + the disconnection event but still returned OK. Returning OK caused + the callers of net_startmonitor to assume that the connection was + okay, undoing the good things that net_startmonitor did and causing + the socket to be marked as connected. This behavior was noted by + Pelle Windestam (2015-05-28). + * include/nuttx/net, net/arp, net/devif, net/icmp, net/icmpv6, + net/netdev, net/pkt, net/tcp, net/udp: Modify event list handling: + Now there are two event lists each device structure: (1) One is + for ARP and ICMP data related events, the other is for device + related events. Callback allocation/free routines no accept a + device parameter as well as a list: If the device parameter is + added, then the callback goes into both the connection-related + list AND the device event list. Thus each socket type can + received both custom data-related events as well as common + device related events (2015-05-28). + * net/socket and net/utils: setsockopt() fails when setting timeouts + to values less that an 100 msec. That is because the timeout is + limited to stops of 1 decisecond and because the conversion of + structure timeval was truncating the microsecond remainder. The + utility net_timeval2dsec now accepts and option to determine how it + handles the remainder: truncate, discarding the remainder, use the + remainder to round to the closed decisecond value, or use any non-zero + remainder to the next larger whole decisecond value. Bug discovered + by Librae (2015-05-29). + * configs/stm32f4discovery/src: Move up_cxxinitialize from + nuttx/configs/stm32f4discovery/src to apps/platform/stm32f4discovery + where it belongs (2015-05-29). + * net/sockets, net/tcp, net/udp: UDP Networking: Add support for + device event notification for UDP transfers (2015-05-29). + * net/sockets and net/tcp: TCP Networking: Add support for device event + notification for UDP transfers (2015-05-30). + * libc/Kconfig and stdio/lib_libvsprintf.c: Add an option to disable + support for long long formats in lib_vsprintf. From Alan Carvalho + de Assis (2015-05-30). + * net/net_initialize.c, net/detdev, and net/socket: The network device + list was protected by a re-entrant semaphore. With the recent change + to support network device callback, the network stack needs to access + the network device list too. Some drivers, however, run the network + stack from the interrupt level -- this is bad but a fact in the + current state. Of course, those drivers are unable to take the + semaphore and would assert. + The solution here is to eliminate the device devices semaphore + altogether. This eliminates netdev_semtake() and netdev_semgive() + and replace them with net_lock() and net_unlock() which have the + larger scope that is needed and will integrate properly with the + dinosaur interrupt driven stack (2015-05-31). + * net/socket/connect.c: In the TCP connection operation, it was trying + to setup the network monitor BEFORE the socket was successfully + connected. This, of course, has ALWAYS failed because the socket is + not yet connected and the TCP state is not yet correct for a connected + socket. However, because of other changes net_startmonitor() now + returns a failure condition that causes worse problems when trying to + connect. The fix is to move the logic that starts the network monitor + to AFTER the socket has been successfully connected (2015-05-31). + * tools/configure.c: Fix test for the existence of the apps/ directory. + Fix backward interpretation of options, -l was selecting Windows and + -w was selecting Linux. This was SourceForege Ticket #39 (2015-05-31). + * arch/include/stm32/chip.h and arch/src/stm32/Kconfig: Add basic + support for the STM32F205RG. From SourceForge Ticket 40 (anonymous, + 2015-05-31). + * arch/arm/src/lpc17xx: Review, update, and modify the Ethernet driver + so that it works better with CONFIG_NET_NOINTS=y (2015-06-01). + * configs/: Update all LPC17xx networking configurations so that they + have CONFIG_NET_NOTINTS=y selected (2015-06-01). + * /arch/arm/src/armv7-m, binfmt/libelf, configs/stm32f4discovery/scripts, + /include/nuttx/binfmt, and libxx: Add support uClibc++ exceptions. This + involves additional handling for relative relation types, additional + support for unwinding, as well as additional changes. The culmination + of a big effort from Leo Aloe3132 (2015-06-01). + * configs/olimex-lpc1766stk: Rename the thttpd configuration to thttpd-nxflat. + Add a new configuration, thttpd-binfs, that provides an example of how + to build apps/netutils/thttpd using binfs instead NXFLAT+ROMFS + (2015-06-02). + * tools/cfgdefine.c: Extend the mkconfig tool so that it can dequote a + quoted list of quoted strings. THTTPD uses such a configuration + setting to provide the list of index files (2015-06-02). + * mq_timedreceive(): move the location where the errno value is set; the + ETIMEDOUT errno setting was being overwritten by subsequent actions + before returning. Noted by Freddie Chopin (2015-06-03). + * Networking: Modify how callback structures are stored to avoid + another potential use of a stale pointer (2015-06-03). + * POSIX message queues: Move mq_setattr() and mq_getattr() from + nuttx/libc/mqueue to nuttx/sched/mqueue. Also add syscall support + for mq_setattr() and mq_getattr(). This is necessary in protected and + kernel builds because in those cases the message queue structure is + protected and cannot be accessed directly from user mode code (2015-06-03). + * drivers/net/tun.c: TUN driver bug fix. From Max Neklyudov (2015-06-03. + * drivers/net/Kconfig, include/nuttx/net/mii.h, and + arch/arm/src/lpc17xx/lpc17_ethernet.c: Add support for the Micrel + KSZ8041 PHY to the LPC17xx Ethernet driver (2015-06-03). + * configs/lincoln60/netnsh: Add a network enabled configuration for + the Lincoln60 board (2015-06-03). + * drivers/net/tun.c: Misc. improvements to the TUN driver, mostly related + to poll(). From Max Neklyudov (2015-06-04). + * fs/, fs/unionfs, include/nuttx, include/sys, Documentation: Add + support for a union file system that can be used to overlay and merge + the content of two mounted file systems (2015-06-05). + * arch/arm/src/efm32/efm32_spi.c: Add SPI GPIO pin initialization. From + Pierre-noel Bouteville (2015-06-05). + * configs/sim/unionfs: Add a configuration for testing the Union File + System (2015-06-05). + * configs/lincoln60/thttpd-binfs: Add a thttpd-binfs configuration for + the Lincoln60. That configuration still does not work on initial + commit (2015-06-06). + * arch/arm/src/sama5/sam_can.c: Fix SAMA5 CAN frame construction. From + Max Holtzberg (2015-06-07). + +7.11 2015-08-13 Gregory Nutt + + * arch/arm/src/efm32/efm32_spi.c: Correct write to incorrect register in + EFM32 SPI driver. From Pierre-noel Bouteville (2015-06-09). + * configs/teensy-3.x: Add board support for the PJRC Teensy-3.1 board + (2015-06-09). + * arch/arm/src/samdl, configs/samd20-xplained, and configs/saml21-xplained: + In the SAML21, SERCOM5 uses a different SLOW clock channel (and, hence, + also a different SLOW GCLK generator). This means that the channel + selection cannot be a global definition but must be a per SERCOM + configuration setting (2015-06-10). + * arch/arm/src/kinetis and include/kinetis: Add support for MK20DN--VLH5 + and MK20DX---VLH5. Needed for backward compatible support for + Teensy-3.0 (2015-06-10). + * configs/Kconfig and configs/teensy-3.x: Add support for Teensy-3.0 + (2015-06-10). + * arch/arm/src/stm32/stm32l15xxx_rcc.c: STM322 F15x stm32_stdclockconfig() + was calling stm32_pw_setvos() which accessed PWR_CR via an inactive APB + From Juha Niskaneni (2015-06-11). + * fs/mount: Add the ability to mount a file system on top of en existing + node in the pseudo-file system (2015-06-11). + * arch/arm/src/sam34/sam_clockconfig.c: Add default loop optimization if + EEFC_FMR is available in the configuration (i.e., for SAM4S and 4E). + From Marco Aurélio da Cruz (2015-06-11). + * include/time.h and libc/time: Add asctime(), asctime_r(), ctime(), and + ctime_r() (2015-06-12). + * include/ and arch/: Clean up and review of header files for conformance + to standards (2015-06-12). + * arch/arm/src/samdl: Add build framework for SAML21 DMA support. + Nothing there yet except for skeletal logic taken from SAM3/4 + (2015-06-12). + * include/pthread.h and nuttx/sched/pthread: Use -1 instead of 0 as PID + for unclaimed mutexes. From Juha Niskanen (2015-06-16). + * sched/pthread: Implement pthread_mutex_trylock() for recursive mutexes. + From Juha Niskanen (2015-06-16). + * libc/unistd/lib_getopt.c: Uninitialized variable can cause hardfault + from getopt if required argument is missing. From George McWilliams + (2015-06-18) + * arch/arm/include/samdl and arch/arm/src/samdl: Add architecture support + for the SAMD21 family (2015-06-19). + * configs/samd21-xplained: Board configuration for the SAMD21 Xplained + board (2015-06-21). + * arch/arm/src/sam34/sam_lowputc.c: Back out an error introduced with + commit 02c33f66c5a8be774034cd40e4125e9323c7b4d8. Causes an infinite + loop in up_lowputc(). From Max Neklyudov (2015-06-22). + * arch/arm/src/samv7/sam_lowput.c: Also back the bad change to sam_lowputc.c + for SAMV7 platform (2015-06-22). + * include/nuttx/fs/ioctl.h and power/relay.h: Add relay IOCTL definitions. + From Max Neklyudov (2015-06-22). + * sched/clock/clock_gettime.c: Use up_timer_gettime for CLOCK_MONOTONIC + in tickless mode. From Max Neklyudov (2015-06-22). + * crypto/ and SAM4CM: Add CFB and MAC AES modes. From Max Neklyudov + (2015-06-22). + * SAM4CM: Fix SUPC register definitions. From Max Neklyudov. Also + removed conditional logic form non-SAM4CM parts (Gregory Nutt) + (2015-06-22). + * SAM3/4: Add a TWI driver for the SAM4CM. From Max Neklyudov + (2015-06-22). + * SAMV7 Xplained: In clock configuration, divider was set to 25 to get + 25*12MHz=300MHz CPU clock. The correct multiplier is 24 because the + calculation if (24+1)*12MHz. So the board was running at 312MHz. + From Efim Monjak (2015-06-26). + * NFS client: Fix prototype of unbind method. The function prototype + was not updated for NFS after a recent change to the file system + interface. From Manuel Sthn (2015-06-25). + * Broke the NuttX GIT repository into several, smaller repositories. + Eliminated the misc/ directory and the content under misc/Obsoleted + and misc/sims (2015-06-27). + * Removed the Documentation/ directory. Replaced with a GIT submodule + that will bring in the new standalone Documentation directory + (2015-06-29). + * Removed the configs/ directory. Replaced with a GIT submodule + that will bring in the new standalone boards directory (2015-06-29). + * arch/arm/src/armv6-m/up_exception.S: Fix Cortex-M0 assembly error + when the interrupt stack is enabled. From Alan Carvalho de Assis + (2015-06-30). + * arch/arm/src/armv6-m/up_assert.c: Port some per-process stack + dumping logic from ARMv7-M to ARMv6-M. From Alan Carvalho de Assis + (2015-06-30). + * tools/testbuild.sh: Add a script that can be used to perform + building testing for several board configurations (2015-06-30). + * sched/pthread/pthread_create.c: Group binding needs to be cleared + before sched_releasetcb(), as otherwise group_leave() will be called + and group->tg_nmembers decremented or group being released. + group_leave() should be called only after group_join() is called, + not after group_bind(). From Jussi Kivilinna (2015-07-01). + * arch/arm/src/sama5/sam_ehci.c: Fix some bad conditional compilation + that left a function undefined if CONFIG_USBHOST_ASYNCH is not + selected (2015-07-01). + * arch/arm/src/common/up_vfork.c: Fix a Cortex-A compilation error + when system calls are enabled in modes other than CONFIG_BUILD_KERNEL + (2015-07-01) + * include/nuttx/net/netconfig.h: Fix some backward compilation that was + emitting #error in the wrong condition when SLIP was enabled (2015-07-01). + * drivers/net/slip.c: Fix a missed name change when many of network + interface names changed sometime back but were apparently never updated + for SLIP (2015-07-01). + * drivers/input/stmpe811_base.c: In stmpe811_instanciate() when + CONFIG_STMPE811_MULTIPLE is enabled, and the call to stmpe811_checkid() + fails, then the linked device list is not restored to its previous state. + From Sebastien Lorquet (2015-07-02). + * sched/sched/sched_waitpid.c: Implement WNOHANG for waitpid() only and + for the case of CONFIG_SCHED_HAVE_PARENT not selected. From Max + Neklyudov (2015-07-02). + * arch/sim/src/up_head.S: Implement board_power_off() for the simulation + platform (2015-07-04). + * libc/unistd/lib_gethostname.c: Add support for sethostname() (2015-07-05). + * libc/net: Add support for gethostbyname() and gethostbyaddr(). Also + support included for the non-standard gethostbyname_r() and + gethostbyaddr_r() (2015-07-08). + * drivers/ioexpander and include/nuttx/ioexpander: This commit adds: + - headers in nuttx/ioexpander to define the "generic" ioexpander + framework + - files in drivers/ioexpander for the implementation of the NXP + PCA9555 framework + - bindings in drivers/Kconfig and drivers/Makefile + From Sebastien Lorquet + * arch/arm/src/lpc43xx/chip/lpc4310203050_pinconfig.h: Correct some + LPC4350 GPIO pin configurations. From Alessandro Temil (2015-07-09). + * mm/umm_heap, include/nuttx/kmalloc.h, userspace.h, mm/mm.h, and all + configurations that support protected mode: Redesigned how the user + space heap is accessed from the kernel code in protected mode. It + used to call memory management functions in user space via function + pointers in the userspace interface. That is inefficient because the + first thing that those memory management functions do is to trap back + into the kernel to get the current PID. Worse, that operation can be + fatal is certain fragile situations such as when a task is exiting. + The solution is to remove all of the memory management function calls + from the interface. Instead, the interface exports the users pace + heap structure and then kernel size implementations of those memory + management functions will operate on the userspace heap structure. + This avoids the unnecessary system calls and, more importantly, + failures do to freeing memory when a test exits (2015-07-10). + * libc/netdb: Move netdb functions from lib/net to lib/netdb. Move + the DNS client logic from apps/netutils/dnscient to libc/netdb. + Add support to gethostbyname() so that it will attempt a DNS host + lookup before consulting the host table (if so enabled) (2015-07-10). + * arch/arm/src/samdl/chip/saml_usb.h: Several fixes to register + definitions and types. From Janne Rosberg (2015-07-10). + * include/nuttx/net/ and libc/netdb: Repartitioning of DNS client + logic in preparation for IPv6 support (2015-07-12): + - Rename include/nuttx/net/dnsclient.h to dns.h + - Move internal DNS prototypes from dns.h to libc/netdb/lib_dns.h + - Global standard DNS definitions from libc/netdb/dns_soccket.c to + dns.h + - Eliminate dns_gethostip(). This is now an internal part of + gethostbyname() + - Eliminate interface dns_whois(). Not needed in this new context. + * include/nuttx/net/ and libc/netdb: Modifications to DNS client logic + and to dns_get/setserver() interfaces to support DNS clients at IPv6 + addresses (still no support for resolution to IPv6 addresses) + (2015-07-12). + * include/nuttx/net/ and libc/netdb: Implement the low-level network DNS + packet protocol to request and receive IPv6 address mappings + (2015-07-12). + * libc/netdb: Add a default value for DNS server IP address. Make + sure that the IP address has been initialized before permitting DNS + queries (2015-07-13). + * libc/netdb: Add support for a DNS host name resolution cache. This + can save a lot of DNS name server lookups (but might also have the + negative consequence of using stale IP address mappings (2015-07-13). + * graphics/, libnx/, and include/nuttx/nx: Implement anti-aliasing in + order to clean the drawing of all edges (2015-07-14). + * drivers/lcd/ and include/nuttx/lcd: Modify the SSD1306 LCD driver to + support either the SPI or I2C interface. From Alan Carvalho de Assis + (2015-07-15). + * arch/src/stm32f7 and arch/include/stm32f7: Add architecture support + for the STMicro STM32 F7 (2015-07-15). + * drivers/can.c: Fix an issue in the CAN driver where the rx_sem + count can grow beyond bounds (2015-07-15). + * configs/stm32f762g-disco/: Add initialize support for the STMicro + STM32 F7 Discovery board. This is a work in progress and will be a + while before it is fully functional (2015-07-16). + * arch/../up_etherstub.c, arch/../up_initialize, and other files: Add + CONFIG_NETDEV_LATEINIT that can be used to suppress calls to + up_netinitialize() from early in initialization (2015-07-17). + * arch/arm/src/stm32: Extend STM32 Ethernet operating frequency to + 180MHz. From Sebastien Lorquet (2015-07-17). + * STM32 F7 Discovery: Basic NSH configuration is functional with a + serial console. I-/D-Caches and DTCM have been enabled. The delay + loop has been calibrated -- very fast (2015-07-19). + * drivers/sensor and include/nuttx/sensors: Add support to Bosch BMP180 + barometer. From Alan Carvalho de Assis (2015-07-20). + * configs/stm32f4discovery/: Add support to BMP180 driver on the + STM32F4Discovery. From Alan Carvalho de Assis (2015-07-20). + * arch/arm/src/stm32f7: Add an STM32 F7 Ethernet driver (2015-07-20). + * arch/arm/src/stm32f7: Port the STM32 F4 DMA driver. Untested on + initial commit (2015-07-20). + * arch/arm/src/sam34: Correct some problems with SAM3/4 watchdog driver. + Includes some small improvements. From Max Neklyudov (2015-07-21). + * arch/arm/src/stm32 and include/stm32: Add support for the STMicro + STM32 F446. From David Sidrane (2015-07-22). + * include/nuttx/sched.h, sched/, and fs/procfs: Increase the size of + the scheduling policy field from 1 to 2 bits to allow additional, + planned scheduling policies (2015-07-23). + * pthread_create: Fix an (unlikely) error in fallback value in the + event of a failure (which should never occur) (2015-07-23). + * include/, sched/, and libc/: Add support for sporadic scheduling + parameters in struct sched_param, posix_spawnattr_t, and pthread_attr_t. + Update all user interfaces to pass sporadic scheduling parameters. + (2015-07-23). + * sched/: Separate the round-robin logic into a separate file so that + it is symmetric with the sporadic stuff. Integrate the sporadic + scheduler into the time tick interrupt handling and into the tickless + operation (2015-07-24). + * arch/arm/src/moxart/: Add support for MoxaRT SoC found in the most + Moxa serial converters such as NP51x0, NP66xx, UC72xx. From Anton + D. Kachalov (2015-07-29). + * configs/moxa: Moxa NP51x0 series of 2-port advanced RS-232/422/485 + serial device servers. From Anton D. Kachalov (2015-07-29). + * drivers/net/ and include/nuttx/net: Add support for a Faraday + * FTMAC100 Ethernet MAC Driver. From Anton D. Kachalov (2015-07-29). + * 16550 UART Driver: Add a configuration option to indicate the + THR empty bit is inverted. This is the case for the moxART SoC. + Based comments from Anton D. Kachalov (2015-07-29). + * STM32 F4: Add DMA support to the ADC driver for STM32 F4. From + Max Kriegler (2015-07-30). + * sem_tickwait(): Added this function for internal use within the + OS. It is a non-standard but more efficient version of sem_timedwait() + for use in higher performance device drivers (2015-08-01). + * drivers/net/slip.c: Fix another compilation error (2015-08-02). + * drivers/can.c include/nuttx/can.h, and fs/fs.h: Add CAN IOCTL command + definitions to manage CAN message filtering (2015-08-05) + * drivers/Kconfig and can.c: Add configuration to support DLC to byte + conversions needed for CAN FD mode (2015-08-05). + * arch/arm/src/samv7: Add an MCAN driver for the SAMV7 platform + (2015-08-06). + * drivers/sensors/lm92.c and include/nuttx/sensors/lm92.h: Add a driver + for the LM92 temperature sensor. Contributed by Paul Alexander Patience + (2015-08-06). + * drivers/sensors/as5048b.c and include/nuttx/sensors/as5048b.h: Add + support for an AS5048B rotary magnetic sensor. From Paul Alexander + Patience (2015-08-07). + * include/nuttx/spi/slave.h: Add a definition of an SPI slave + interface (2015-08-08). + * arch/arm/src/samv7: Add the framework for an SPI slave driver. This + driver has a lot of missing logic on initial commit (2015-08-09). + * arch/arm/src/samv7: Basic, no-DMA SPI slave driver is in place + (2015-08-10). + * fs/vfs/epoll.c and include/sys/epoll.h: Add a very simple epoll layer + just around poll calls. To satisfy build app requirements. From Anton + D. Kachalov (2015-08-10). + * drivers/mtd/ramtron.c: Update to include supportf for newer + RAMTRON parts. From David Sidrane (2015-08-10). + * Networking: Allow receipt of empty UDP packets. From Max Neklyudov + (2015-08-11). + * drivers/sensors/mb7040.c and include/nuttx/sensors/mb7040.h: Add + support for a MB7040 sonar driver. From Paul Alexander Patience + (2015-08-11). + * net/udp: Add support for send() for connected UDP sockets + (2015-08-11). + * drivers/sensors/ms5805.c and include/nuttx/sensors/ms5805.h: Add + support for an MS5805 altimeter. From Paul Alexander Patience + (2015-08-12). + +7.12 2015-10-01 Gregory Nutt + + * fs/vfs/fs_poll.c: Use sem_tickwait() instead of sem_timedwait() + From Macs Neklyudov (2015-08-13). + * fs/vfs/fs_poll.c: If we fail to setup the poll for any file + descriptor, for any reason, set the POLLERR bit (2015-08-13). + * libc/stdlib: Add support for div() to the C library. From + OrbitalFox (2015-08-14). + * libc/stdlib: Might as well add ldiv() and lldiv() to since + these are equivalent to div() with long and long long types, + respectively, instead of int (2015-08-14). + * include/signal.h and files that include it: Add si_errno to + siginfo_t (2015-08-14). + * drivers/sensors/mx58xx.c and include/nuttx/sensors/ms58xx.h: + Generalize the MS5805 altimeter driver to support other family + members and rename to ms58xx. From Paul Alexander Patience + (2015-08-14). + * Network drivers. Fix bug in tun interface driver. From Max + Neklyudov (2015-08-17). + * STM32: Added definitions for STM32F303K6, STM32F303K8, STM32F303C6, + STM32F303C8, STM32F303RD, and STM32F303RE devices. From Paul + Alexander Patience (2015-08-17). + * include/nuttx/can.h and all CAN drivers: Add an error indication + bit to the CAN message report. This indication must then be cleared + in all existing drivers. More to come (2015-08-18). + * arch/arm/src/lpc17/lpc17_irq.c: Set NVIC vector address so that + code can execute with a bootloader or can execute from RAM. From + Pavel Pisa (2015-08-20). + * All ARMV7-M IRQ setup: Always set the NVIC vector table address + unconditionally. This is needed in cases where the code is running + with a bootload and when the code is running from RAM. It is also + needed by the logic of up_ramvec_initialize() which gets the vector + base address from the NVIC. Suggested by Pavel Pisa (2015-08-21). + * SAMV7 USBHS DCD: The device controller driver is (finally) functional + (2015-08-21). + * recvfrom(): Correct wait for new data when NET_UDP_READAHEAD is + enabled. Fix size accounting when recvfrom_udpreadahead() sets + state.rf_recvlen == -1. I have not checked if data are accumulated + to the right position in the buffer however. From Pavel Pisa + (2015-08-21). + * sched/wdog/wd_create.c: Correct a counting error in the number + of available watchdog timers. When the number of free timers is + low, the counter could be incremented below zero (2015-08-21). + * arch/arm/src/stm32: Add OTG support for STM32F44x. From David + Sidrane (2015-08-21). + * arch/arm/src/lpc17: Actually implement options to use external + SDRAM and or SRAM for the heap. From Pavel Pisa (2015-08-21). + * gethostbyname(): correct returned address format when DNS is used. + The hostent.h_addr_list should point to raw in_addr or in6_addr + as defined in the standard. Original implementation used that + for numeric addresses but for DNS lookup returned pointer to + whole sockaddr_in or sockaddr_in6. From Pavel Pisa (2015-08-21). + * tools/mksymtab: declare g_symtab array as const to occupy RO + section (Flash). From Pavel Pisa (2015-08-23). + * libc/libc.csv and syscalls/syscalls.csv: Define some symbol + export conditions, correct errno and add sleep and usleep. From + Pavel Pisa (2015-08-23). + * net/ and include/nuttx/net: Remove references to PPP as a + link layer protocol (2015-08-24). + * net/, drivers/net, and include/net: Add definitions to support + a local loopback device and link layer (2015-08-24). + * libc/netdb, net/loopback, include/nuttx/net: Add NetDB support + for the local loopback device (2015-08-24). + * drivers/net/loopback.c: Add basic prototype of a local loopback + device (2015-08-24). + * networking: Correct return value from psock_tcp_accept(). From + SaeHie Park (2015-08-25). + * drivers/mtd/s25fl1.c: Add a driver for ST25L1*K QuadSPI parts + (2015-08-25). + * include/nuttx/spi/qspi.h: Develop a new interface for QSPI, at + least the way that QSPI is implemented on the SAMV71. Originally + planned to use the SPI interface, but it is just now compatible + with the SAMV71 QSPI hardware (2015-08-25). + * drivers/rwbuffer.c: Fix some logic errors. From Dmitry Nikolaev + via Juha Niskanen (2015-08-26). + * net/socket and net/tcp: Fix a problem in when there are multiple + network devices. Polls were being sent to all TCP sockets before. + This is not good because it means that packets may sometimes be + sent out on the wrong device. That is inefficient because it + will cause retransmissions and bad performance. But, worse, when + one of the devices is not Ethernet, it will have a different MSS + and, as a result, incorrect data transfers can cause crashes. + The fix is to lock into a single device once the MSS is locked + locked down (2015-08-27). + * drivers/lcd and include/nuttx/lcd: Add SSD1351 OLED controller + support. Contributed by Paul Alexander Patience (2015-08-28). + * include/nuttx/mtd/mtd.h: Move MTD ioctl command definitions from + include/nuttx/fs/fs.h to include/nuttx/mtd.h. Add ioctl commands + to protect and unprotect memory (2015-08-29). + * binfmt/builtin.c: Fix a memory leak: File was not being closed. + From Bruno Herrera (2015-08-30). + * fs/romfs: One allocation was not being freed if there was a + subsequent failure to allocation I/O buffers resulting in a memory + leak on certain error conditions. From Bruno Herrera (2015-08-30). + * arch/arm/src/up_internal.h and several ARM Make.defs files: In the + original implementation, !defined(CONFIG_ARMV7M_CMNVECTOR) was a + sufficient test to determine if lazy floating point register saving + was being used. But recents changes added common lazy register as + well so now that test must be (!defined(CONFIG_ARMV7M_CMNVECTOR) || + defined(CONFIG_ARMV7M_LAZYFPU)) (2015-08-31). + * arch/arm/include/sama5 and src/sama5: Add basic chip description, + configuration support and interrupt definitions for the SAMA5D2 + (2015-08-31). + * LPC43xx: Fix NVIC_SYSH_PRIORITY_STEP define. From Ilya Averyanov + (2015-09-01). + * LPC43xx: Fix missing #define in eeprom. From Ilya Averyanov + (2015-09-01). + * libc/math/lib_asin.c: The function did not convert for some input + values. Asin did not convert for values which do not belong to the + domain of the function. But aside of that the function also did not + converge for some allowed values. I achieved a conversion of the + function by reducing the DBL_EPSION and by checking if the input + value is in the domain of the function. This is a fix for the + problem but the function should always terminate after a given + number of iterations. From Stefan Kolb (2015-09-01). + * arch/arm/src/lpc43xx/lpc43_spi.c: Fix SPI driver. From Ilya + Averyanov (2015-09-02). + * arch/arm/src/lpc43xx/lpc43_ethernet.c: Add Ethernet support. From + Ilya Averyanov (2015-09-02). + * net/tcp: The logic that binds a specific network device to + a connection was faulty for the case of multiple network + devices. On bind(), the local address should be used to associate + a device with the connection (if the local address is not INADDR_ANY); + On connect(), the remote address should be used (in case the local + address is INADDR_ANY). On accept(), it does not matter but the + remote address is the one guaranteed to be available (2015-09-02). + * configs/Board.mk and configs/*/src/Makefile: Simplify configs/ + Makefiles by combining common logic into a new Board.mk Makefile + fragment. From Paul Alexander Patience (2015-09-04). + * configs/sama5d2-xult: Add a very basic configuration for the SAMAD2 + Xplained Ultra board. This configuration is incomplete and only + intended to support the initial board bring-up (2015-09-05). + * up_initialize() all architectures: Automatically initialize all + the TUN device if it is in the configuration (2015-09-06). + * Change all references from avsprintf to vasprintf. From Sebastien + Lorquet (2015-09-07). + * net/tcp: Fix unbuffered send compilation error when Ethernet is not + enabled. From Alan Cavalho de Assis (2015-09-07). + * LPC31 and SAMA5D EHCI: Fix qh_ioccheck to move bp to next QH. From + Ilya Averyanov (2015-09-07). + * LPC31 and SAMA5D EHCI: Performance improvement: Do not disable the + asynchronous queue when adding a new QH structure. From Ilya + Averyanov (2015-09-07). + * arch/arm/src/sama5: Separate memory mapping tables for SAMA5D2, 3, + and 4 (2015-09-08). + * libc/net/lib_shutdown.c: Add an empty implementation of the + standard shutdown function. This provides only the framework for + the shutdown function; the internal logic is not included + (2015-09-09). + * configs/nucleo-f303re: Support for the STMicro Nucleo F303RE board + from Paul Alexander Patience (2015-09-10). + * arch/arm/src/lpc43xx/lpc43_ehci.c and .h: LPC43xx EHCI driver from + Ilya Averyanov (2015-09-10). + * ARMv7-M, all "lazy" interrupt stack logic. Assembly instruction + that fetches the saved value is incorrect; replace with more + traditional push and pop. This is an important fix. Noted by + Stefan Kolb (2015-09-14). + * All ARMV7-M: Force 8-byte stack alignment when calling from assembly + to C to interrupt handling (2015-09-15). + * drivers/power/battery_gauge.c and include/nuttx/power/battery_gauge.h: + battery.c/h renamed to batter_gauge.c/.h since it really only + implements a battery fuel gauge. From Alan Carvalho de Assis (2015-09-19). + * drivers/power/battery_charger.c and include/nuttx/power/batter_charger.h: + Add a new framework to support a batter charger interface. From Alan + Carvalho de Assis (2015-09-19). + * drivers/power/bq2425x.c and .h: Battery Charger: Add BQ24250 driver. + From Alan Carvalho de Assis (2015-09-20). + * fs/mqueue/mq_open.c: When message queue is opened, inode_reserve() + leaves the reference count at zero. mq_open() logic must assure + that the reference count of the newly created inode is one (2015-09-23). + * arch/sim/src/Kconfig, Makefile, up_setjmp64.S: Modern Cygwin X86_64 + machines follow the Microsoft ABI for parameter passing. The older, + Linux System 5 ABI will not work on X86_64-based Cygwin machines. Also, + the newer Cygwin tool chains do nor pre-pend symbol names with the + underscore character. With these changes the simulator agains works + with the newer Cygwin64 platform (2015-09-24). + * arch/arm/src/lpc43xx: Extensive I2C and clocking updates from Lok Tep + (2015-09-29). + * configs/lpc4370-link2: Support for the NXP LPC4370-Link2 development + board from Lok Tep (2015-09-29). + * configs/nucleo-f303re: Add SSD1351 SPI 4-wire interface. From Paul + Alexander Patience (2015-09-29). + * arch/arm/src/armv7-m/up_schedulesigaction.c: Fix logic that determines + if there is a pending signal action before scheduling the next signal + action. Both the test and the scheduling action need to be atomic + (2015-09-30). + * sched/wqueue/kwork_queue.c and libc/wqueue/work_queue.c: Logic that + sets the queued indication and the logic that does the actual queuing + must be atomic (2015-09-20). + +7.13 2015-12-05 Gregory Nutt + + * libc/stdlib/lib_bsearch.c and include/stdlib.h: Add the bsearch() + function from NetBSD (2015-10-02). + * libc/stdlib/lib_qsort.c and include/stdlib.h: Make coding style + more conformant, take description from OpenGroup.org, rename formal + parameters to match names used on OpenGroup.org (2015-10-02). + * drivers/lcd/st7565.c: Extend to include support for the ERC12864-3. + From Pierre-noel Bouteville (2015-10-07). + * fs/tmpfs: Created a directory that will eventually hold a trivial + temporary RAM file file system (2015-10-0i8). + * tools/: Add crappy style checking tool nxstyle.c. See thee tools/ + README file for more info (2015-10-08). + * stm32 F4: Fix some TIM12 pin mappings. From Max Kriegleder + (2015-10-9). + * fs/tmpfs: TMPFS file system is code complete and bascially functional + although it has not been heavily tested (2015-10-9). + * drivers/input/button_upper.c and include/nuttx/input/buttons.h: Add a + driver to support application access to board buttons (2015-10-12). + * drivers/input/button_lower.c: Add a generic lower half button driver. + This lower half driver is only usable in a limited number of + situations, but can still serve as a module for the lower half button + driver. (2015-10-13). + * drivers/sensors/zerocross.c and include/nuttx/sensors/zerocross.h: + Add Zero Cross device driver support. From Alan Carvalho de Assis + (2015-10-13). + * configs/stm32f4discovery/src/stm32_zerocross.c: Add low level support + for the Zero Cross driver for the STM32F4-Discovery. From Alan + Carvalho de Assis (2015-10-13). + * drivers/sensors/max6675.c and include/nuttx/sensors/max6675.h: Add + support to Thermocouple-to-Digital converter MAX6675. From Alan + Carvalho de Assis (2015-10-18). + * configs/stm32f4discovery/src: Add board config to support MAX6675. + From Alan Carvalho de Assis (2015-10-18). + * arch/arm/src/samv7/sam_lowputc.c: Reconfigure System I/O when using + USART1. From Frank Benkert (2015-10-20). + * fs/semaphore: Named semaphores: Bad cast in sem_close(). Fixed by + reordering fields of struct nsem_inode_s so that the cast will work + (2015-10-22). + * Many files: Rename board_led_* functions to board_autoled_* functions. + This makes room in the namespace to handler user LED functions + (2015-11-01). + * Many files: Standardize naming of the user LED interface functions. + The new user LED interface functions are now prototyped in only in + include/nuttx/board.h and have name like board_userled_* (2015-11-01). + * drivers/leds/usersled_upper.c and include/leds/usersled.h: Add + a generic character driver that may be used by applications to write + to board LEDs (2015-11-01). + * drivers/leds/usersled_lower.c: Add a generic lower-half user LED + driver that may be used by any board that supports the standard + board user LED interfaces (2015-11-01). + * sched/clock: Fix error in clock_timespec_subtract(). Found by Lok + (2015-11-03). + * drivers/can.c and include/nuttx/can.h: Fix a problem in the CAN + upper-half driver that occurs only for CAN hardware that support a + H/W FIFO of outgoing CAN messages. In this case, there can be a + hang condition if both the H/W and S/W FIFOs are both full. In that + case, there may be no event to awaken the upper half driver. Add a + new (conditional) CAN upper half interface called can_txready() that + can be used by the lower half driver to avoid this hang condition + (2015-11-03). + * arch/arm/src/samv7: Add a call to can_txready() to the MCAN driver + (2015-11-03). + * arch/arm/src/samv7: Add MPU and protected build support (2015-11-06). + * arch/arm/src/samv7: The QSPI FLASH driver is now functional. This + driver operates in the memory-mapped, Serial Memory Mode (SMM) + (2015-11-07). + * drivers/bch: Block-to-character (BCH) driver should forward ioctl() + calls to the contained block driver (2015-11-09). + * arch/arm/samv7/sam_qspi.c: The QuadSPI driver is now functional + (2015-11-10). + * drivers/mtd/s25fl1.c: The S25FL1xx QuadSPI FLASH driver is now + functional (2015-10-11). + * arch/arm/samv7: Add an on-chip FLASH driver (2015-11-12). + * drivers/mtd/mtd_progmem.c: Add an upper half MTD device that can + use the interfaces defined in included/nuttx/progmem.h to provide + a standard MTD interface (2015-11-12). + * drivers/serial/serial.c, serialirq.c and include/nuttx/serial/serial.h: + Implement high level DMA infrastructure for serial devices. From + Max Neklyudov (2015-11-12). + * arch/arm/src/samv7 and arch/arm/include/samv7: Add support for the + SAME70 family of chips (2015-11-14). + * configs/stm32f429i-disco: configs/stm32f429i-disco/src/stm32_nsh.c + file calculated partition boundries based on page block sizes but + mtd_partition() is expecting calculations based on erase block size. + From Alan Carvalho de Assis (2015-11-16). + * Move rivers/wireless/cc3000/security.c to crypto/aes.c; move + include/nuttx/wireless/cc3000/security.h to include/nuttx/crypto/aes.h + (2015-11-16). + * drivers/mtd/at24xx.c: Add support for multiple AT24xx EEPROM parts, + each with unique I2C addresses, but otherwise identical (2015-11-17). + * drivers/timers/ds3231.c: Add support for the DS3231 I2C RTC. Untested + on the initial commit (2015-11-17). + * arch/arm/src/stm32/stm32_tim_lowerhalf.c: Add a compatible lower-half + timer driver for use with drivers/timers/timer.c. From Wail Khemir + (2015-11-17). + * drivers/sensors/ms58xx.c: Fix some issues with initialization and with + CRC calculation. From Karim Keddam (2015-11-17). + * drivers/mtd/w25.c: Fix W25 FLASH driver page read/write logic. From + Ken Pettit (2015-11-18). + * drivers/mtd/smart.c: Fix a Smart wear-leveling bug. From Ken Pettit + (2015-11-18). + * arch/sim/src/up_spiflash.c: Add support for W25 FLASH simulation. + From Ken Pettit (2015-11-18). + * configs/boardctl.h, Kconfig, include/sys/boardctl.h, and nuttx/board.h: + Add a command to the boardctl() interface to obtain a board unique ID + (2015-11-18). + * drivers/timers/ds3231.c: Driver extended to include support for the + DS1307 RTC (2015-11-18). + * configs/same70-xplained: Add basic NSH configuration for the SAME70 + Xplained board. Initial commit is just the SAMV71-XULT files with + names changed appropriately (2015-11-18). + * drivers/mtd/smart.c: Fixed SmartFS wear level error that occurs when + the logical sector size is too small to save all wear level status + bytes in a single sector. Logical sectors 1 and 2 were simply not + being allocated and then the read_sector and write_sector routines + were failing. From Ken Pettit (2015-11-18). + * drivers/timers/ds3231.c: Untested support for DS1302 and DS3232. + Also definitions for the DS3234, but that is an unsupported SPI RTC + (2015-11-19). + * drivers/mtd/w25.c: Add support for byte write mode. From Ken Pettit + (2015-11-20). + * drivers/timers/pcf85263.c and include/nuttx/times/pcf85263.h: Add + a driver for the NXP PCF85263 I2C RTC. Untested on initial commit + (2015-11-20). + * fs/driver/fs_blockproxy.c: Add logic to create a temporary char driver + using drivers/bch to mediate character oriented accessed to a block + driver (2015-11-21). + * fs/vfs/open.c: If the use attempts to open a block driver, use + block_proxy() to insert a character driver conversion layer in front + of the block driver (2015-11-21). + * libc/stdio/lib_freopen.c and include/stdio.h: Add support for + freopen() (2015-11-22). + * include/sys/types.h and include/nuttx/mm.h: When building on a 64-bit + machine, the size of size_t should be 64-bits. In general, I believe + that sizeof(size_t) should be the same as sizeof(uinptr_t). mmsize_t + should always be 32-bits in any event. The last change to stddef has + been backed out. With these changes, the simulator builds without + * fs/hostfs and arch/sim/src: Add a special file system for use with + simulator that supports access to the host file system from the + simulation. From Ken Pettit (2015-11-25). + * libc/time/lib_strftime.c: Add day-of-week support. (2015-11-25). + * drivers/lcd/ili9432.c: Fixed errors in orientation. Portrait, + RPortrait, and RLandscript should work correly now. They were + displayed mirrored. From Marco Krahl (2015-11-25). + * drivers/mtd/mtd/mtd_procfs/c and include/nuttx/mtd/mtd.h: Add an + interface to un-register an MTD procfs entry. From Ken Pettit + (2015-11-25). + * drivers/mtd/filemtd.c: A new MTD conversion layer that will + convert a regular file (or driver file) to an MTD device. This is + useful for testing on the simulation using the hostfs. From Ken + Pettit (2015-11-25). + * drivers/loop: Add a loop character device. losetup() and + loteardown() should not be called directory from applications. + Rather, these functions are now available as IOCTL commands to the + loop driver (2015-11-25). + * include/nuttx/net/netdev.h and several Ethernet drivers in arch/: + Most network drivers do not support statistics. Those that do only + support them when DEBUG is enabled. Each driver collects an + architecture specific set of statistics and there is no mechanism in + place to view those statistics. Thus, the driver feature was mostly + useless. This change standardizes the driver statistics and puts the + definition in the common network device structure defined in netdev.h + where they can be accessed by network applications. All Ethernet + drivers that collect statistics have been adapted to use these common + statistics (2015-11-26). + * net/net_procfs.c: Add basic support for networking entries in the + procfs (2015-11-27). + * mtd/filemtd.c and smart.c: Add support for a /dev/smart loop device. + From Ken Pettit (2015-11-28). + * sched/pthread/: CRITICAL BUGFIX: Logic was wiping out the indication + that of the type of a pthread. Hence, it could be confused as a + task. Found because this was causing a crash when /proc/nnn/cmdline + was printed (2015-11-29). + * configs/same70-xplained/nsh: The NSH configuration now seems fully + functional: serial console, LEDs, buttons, SDRAM, and HSMCI SD card + (2015-11-30). + * configs/same70-xplained/netnsh: Added and verified a network-enabled + NSH configuration for the SAME70-Xplained board (2015-11-20). + * net/: Remove CONFIG_NET_PINGADDRCONF. This was a uIP way of assigning + IP addresses, but is not standard and not a appropriate feature in + general (2015-12-01). + * fs/procfs: The procfs file system can now be configured so that it + supports a runtime registration of procfs entries with + CONFIG_FS_PROCFS_REGISTER=y (2015-12-01). + * arch/arm/src/stm32/stm32_ccm_procfs.c: Is no longer a part of the + 'base' procfs entries and can now only be supported via run time + registration with CONFIG_FS_PROCFS_REGISTER=y (2015-12-01). + * arch/arm/src/samv7/sam_tc.c: Port the SAMA5 timer/counter driver + to the SAMV7 (2015-12-02). + * arm/arm/src/samv7/sam_tickless.c: Port the SAMA5/SAM4CM tickless + logic to the SAMV7 (2015-12-02). + * fs/semaphore: Named semaphores: Back out "fix" of 2015-10-22. It was + correct before. The change of 2015-10-22 probably broke named + semaphores (2015-12-02). + * arch/arm/src/samv7: Bring programmable clock logic from SAMA5 into + SAMV7 (2015-12-03). + * arch/arm/src/samv7: Add PCK6 as an optional source for the timer/ + counter clock (2015-12-04). + * configs/samv7-xult/: If Tickless mode is selected then enable PCK6 + as a timer/counter clock source (2015-12-04). + +7.14 2016-01-28 Gregory Nutt + + * arch/arm/src/samv7: Port the TRNG driver from the SAMA5D3/4 to the + SAMV7 (2015-12-06). + * arch/arm/src/samv7: Port the WDT driver from the SAMA5D3/4 to the + SAMV7 (2015-12-06). + * arch/arm/src/samv7: Add an RSWDT driver (2015-12-06). + * drivers/net/telnet.c: Move the Telnet driver from apps/netutils/telnetd + to drivers/net. It is a driver a belongs in the OS. There are still + some interface related issues, however (2015-12-07). + * configs/: Update all configurations that use the Telnet daemon; those + configurations now need to separately enable the Telnet drvier + (2015-12-07). + * drivers/net/telnet.c: Now works like the loop device. A new interface + called telnet_initialize() registers a telnet session "factory" + device at /dev/telnet. Via ioctl, the factory device can create + instances of the telnet character devices at /dev/telnetN to support + Telnet sessions (2015-12-07). + * arch/arm/src/samv7: In USBHS device driver, fix check if zero length + packet is needed (2015-12-08). + * sched/pthread/: CRITICAL BUGFIX: Logic was wiping out the indication + that of the type of a pthread. Hence, it could be confused as a + task. Same problem as fixed on 2015-11-29, but in different location + (2015-12-09). + * sched/module: Add support for kernel modules. Initial commit is + just the ELF module support with name changes (2015-12-10). + * configs/samv71-xult/module: Add configuration for testing OS + modules (2015-12-12). + * sched/module: Add an implementation of rmmod() (2015-12-12). + * sched/module and fs/procfs: Add some basic module procfs support + (2015-12-12), + * arch/arm/src/armv7-r: Add basic architecture support for the ARMv7-R + processor family (2015-12-13). + * drivers/led: Adds a driver for the PCA9635PW I2C LED driver IC which + can be used to control the intensity of up to 16 LEDs. From Alexander + Entinger (2015-12-15). + * configs/launchxl-tms57004: Add basic board support for TI LaunchXL- + TMS57004. Not much to see there yet (2015-12-15). + * waitpid: CRITICAL BUGFIX. Add a reference count to prevent waitpid + from using stale memory released by the waited-for task group + (2015-12-22). + * sys/time.h: Add timeradd(), timersub(), timerclear(), timerisset(), + and timercmp() as macros. These are non-POSIX interfaces, but + included in most BSD deriviatives, including Linux. From Manuel Sthn + (2015-12-23). + * arch/arm/src/stm32: Add timer input capture driver. From Pierre-Noel + Bouteville (2015-12-24). + * arch/avr: Add support for the Atmega2560. From Dimitry Kloper + (2015-12-19). + * configs/arduino-mega2560: Add support for the Arduino-Mega2560. From + Dimitry Koper (2015-12-29). + * sched/signal, sched/mqueue, sched/timer, include/signal.h, + include/nuttx/signal, fs/aio, libc/aio, and probably other + directories: Add support for the SIGEV_THREAD notification method in + struct sigevent. This initial implementation will only work in the + FLAT build. See the top-level TODO file for additional details + (2015-12-30). + * include/nuttx/compiler.h, include/nuttx/streams.h include/stdio.h + include/syslog.h libc/stdio/, and libc/syslog: introduce support for + Atmel toolchain in-flash strings. Atmel toolchain AVR compiler + provides a transparent in-flash object support using __flash and + __memx symbols. The former indicates to compiler that this is a flash- + based object. The later used with pointer indicates that the referenced + object may reside either in flash or in RAM. The compiler automatically + makes 32-bit pointer with flag indicating whether referenced object is + in flash or RAM and generates code to access either in run-time. Thus, + any function that accepts __memx object can transparently work with RAM + and flash objects. + For platforms with a Harvard architecture and a very small RAM like AVR + this allows to move all constant strings used in trace messages to flash + in the instruction address space, releasing resources for other things. + This change introduces IOBJ and IPTR type qualifiers. The 'I' indicates + that the object may lie in instruction space on a Harvard architecture + machine. For platforms that do not have __flash and __memx or similar + symbols IOBJ and IPTR are empty, making the types equivalent to, for + example, 'const char' and 'const char*'. For Atmel compiler these will + become 'const __flash char' and 'const __memx char*'. All printf() + functions and syslog() functions are changed so that the qualifier is + used with the format parameter. From Dimitry Kloper (2016-01-05). + * drivers/net/tun.c: Fix a compile time error in the TUN driver. From + Vladimir Komendantskiy (2016-01-05). + * Kconfig and include/debug.h: Add configuration to support an + architecture-specific debug.h header file. From Dimitri Kloper + (2016-01-09). + * arch/avr/include/debug.h: Add an AVR-specific header file used when + the AVR MEMX pointer is used. From Dimitri Kloper (2016-01-09). + * tools/cnvwindeps.c: Add a tool that will convert paths in + dependencies generated by a Windows compiler so that they can be + used with the Cygwin make (2016-01-09). + * tools/mkwindeps.sh: A script that coordinates use of cnvwindeps.exe + (2016-01-09). + * tools/mkdeps.c: Deleted mkdeps.sh and mkdeps.bat. The mkdeps + executable generated from mkdeps.c is now that the only supported + way to make dependencies (2016-01-09). + * tools/mkdeps.c: Extended/fixed support for --winpath option. + Dependencies now work under Cygwin with a native Windows toolchain + (2016-01-10). + * libc/netdb: Add support for the use of a DNS resolver file like + /etc/resolv.conf (2016-01-14). + * drivers/sensors/mcp9844.c and include/nuttx/sensors/mcp9844.h: Driver + for the MCP9844 I2C digital temperature sensor with a selectable + resolution. From Alexander Entinger (2016-01-15). + * arch/arm/src/lpc43xx: Numerous LPC43 improvements to SPIFI and ADC + from Lok Tep (2016-01-15). + * configs/lpc4337-ws: Support for the WaveShare LPC4337-WS board. From + Lok Tep (2016-01-15). + * drivers/wireless/pn532.c: Add driver for the NXP pn532 NFC-chip. From + Janne Rosberg and others at Offcode Ltd (2016-01-17). + * drivers/sensors/lsm9ds1.c: Add driver for the STMicro LSM9DS1 chip. + The LSM9DS1 is a system-in-package featuring a 3D digital linear + acceleration sensor, a 3D digital angular rate sensor, and a 3D + digital magnetic sensor. From Paul Alexander Patience (2016-01-17). + * configs/olimex-stm32-h407: Added a port to the Olimex STM32 H407 + board. This board features the STMicro STM32F407ZGT6 (144 pins). + Contributed by Neil Hancock. (2016-01-18) + * arch/arm/src/stm32/stm32_otgfs/hs/host.c: Fix some backward + arguments to stm32_putreg(). Note by Hang Xu (2016-01-18). + * include/nuttx/can.h and several CAN drivers: Add more extensive + error reporting capaibility to the CAN interface. From Frank + Benkert (2016-01-18). + * libc/misc/lib_tea.h and include/nuttx/crypto/tea.h: Add an + implementation of the Tiny Encryption Algorithm (2016-01-19). + * sim/include: Now supports a customizable startup script with a + read-only passwd file (2016-01-20). + * sim/nsh: Uses the custom start up script, includes hooks for + an MOTD message. (2016-01-20). + * include/clock.h and lots of other files: If the 64-bit timer is + selected, then use it whenever clock_systimer() is called rather + then chopping the 64-bit timer down to 32-bits. Add a new type, + systime_t to represent the 32- or 64-bit system timer (2016-01-21). + * sched/clock/clock_systimespec.c: Fix an error in a time + conversion (2016-01-21). + * include/nuttx/clock.h: Get rid of clock_systimer32() and + clock_systime64(). There is now only clock_systimer() (2016-01-21). + * arch/arm/src/kinetis: Numerous updates to the Kinetis ENET driver. + From Andrew Webster (2016-01-21). + * arch/arm/src/kinetis: Add support for the MK60N512VLL100 Kinetis part. + From Andrew Webster (2016-01-21). + * net/tcp and net/iob: Numerous fixes, mostly relate to TCP and IOB + buffering and race conditions. These were necessary for for the + NuttX networking later to be stable in some stress testing. From + Andrew Webster (2016-01-22). + * include/spi/spi.h: Add an optional hwfeatures() method to the + SPI interface (2016-01-23). + * drivers/spi/Kconfig and many other files: Remove CONFIG_SPI_OWNBUS: + Now its not just a good idea, its the law (2015-01-23). + * include/nuttx/math32.h and libc/misc: Add some utilities to support + 64-bit arithmetic operations for platforms that do not support long + long types. Not yet used anywhere (2015-01-25). + * arch/arm/src/samv7/chip: Add an AFEC header file (2016-01-25). + * net/iob: iob_alloc_qentry() has the same issues as did iob_alloc() + fixed on 2016-01-23. (2016-01-26). + * drivers/usbhost/hid_parser.c: Wrong size used in memcpy(). From Hang + Xu (2016-01-25). + * drivers/ioexpander/pca9555.c: Fixed a bug in the function pca9555_setbit + which occurs if someone tries to set one of the pins 8-15. The problem is + that after the check if the pin is greater than 7 the variable addr is + incremented and used in the Call I2C_WRITEREAD. But later in the call to + the I2C_WRITE buf[0] is used as address but this address is not incremented + as it should be. Note address does mean the address to the register in the + ioexpander and not the I2C address. From Stefan Kolb (2016-01-26). + * drivers/ioexpander/pca9555: Convert to use I2C_TRANSFER vs. I2C_WRITEREAD, + the former is thread safe while the latter is deprecated (2016-01-26). + * drivers/i2c/i2c_writeread.c: Create a wrapper that uses I2C_TRANSFER + to implement I2C_WRITEREAD functionality (2016-01-26). + * I2C: Eliminate the I2C_WRITEREAD method (2016-01-26). + * drivers/i2c/i2c_read.c and i2c_write.c: Convert to use I2C_TRANSFER vs. + I2C_READ and I2C_WRITE which are not thread safe (2016-01-26). + * SPI: Rename the STM32 up_spiinitialize() to stm32_spibus_initialize() + (2016-01-26). + * SPI: Rename the SAM up_spiinitialize() to sam_spibus_initialize() + (2016-01-26). + * SPI: Rename the Tiva up_spiinitialize() to tiva_spibus_initialize() + (2016-01-26). + * SPI: Rename the PIC32MX/MZ up_spiinitialize() to pic32mx/mz_spibus_initialize() + (2016-01-26). + * SPI: Rename EFM32's efm32_spi_initialize to efm32_spibus_initialize() + for compatibility with these other changes (2016-01-26). + * SPI: Rename the KL up_spiinitialize() to kl_spibus_initialize() (2016-01-26). + * SPI: Rename the Kinetis up_spiinitialize() to kinetis_spibus_initialize() + (2016-01-26). + * SPI: Rename the LPC31xx up_spiinitialize() to lpc31_spibus_initialize(), + Rename the LPC17xx lpc17_spiinitialize() to lpc31_spibus_initialize(), + Rename the LPC43xx up_spiinitialize() to lpc43_spibus_initialize() + (2016-01-26). + * SPI: Rename the AVR up_spiinitialize() to avr_spibus_initialize(), + Rename the LPC2148 up_spiinitialize() to lpc214x_spibus_initialize(), + Rename the Calypso up_spiinitialize() to calypso_spibus_initialize(), + Rename the eZ80 up_spiinitialize() to ez80_spibus_initialize(), + Rename the STR71xx up_spiinitialize() to str71_spibus_initialize(), + Rename the i.MX1 up_spiinitialize() to imx_spibus_initialize(), + Rename the LPC2378 up_spiinitialize() to lpc23_spibus_initialize(), + Rename the M9S12 up_spiinitialize() to hcs12_spibus_initialize(), + Rename the x86 up_spiinitialize() to i486_spibus_initialize(), + Rename the z16f up_spiinitialize() to z16_spibus_initialize(). + up_spiinitialize() has been completely eliminated. (2016-01-27). + * fs/vfs/fs_poll.c: Fix handling of sem_tickwait() return value + sem_tickwait() does not return an -1+errno, it returns a negated + errno value. Noted by Freddie Chopin. + +7.15 2016-03-27 Gregory Nutt + + * drivers/analog/ads1242.c and include/nuttx/analog/ads1242.h: Driver + for the 24-Bit Differential Input ADC ADS1242 that communicates via + SPI with a MCU. Reading the ADC conversion result as well as configuring + the ADC, setting the input channel, etc. is implemented via ioctl calls. + However, it does not yet implement the standard ADC interface. From + Alexander Entinger (2016-01-29) + * configs/board/src/xyz_cxxinitialize.c: Move C++ initialization logic + out of the RTOS and into the application space, specifically to + apps/platform/board, where it belongs (2016-01-29). + * drivers/modem/u-blox.c and include/nuttx/drivers/u-blox.h: Add an upper + half driver for the U-Blox Modem. From Vladimir Komendantskiy + (2016-01-30). + * arch/arm/src/lpc17xx: Backport lpc43xx I2C driver, replacing the + lpc17xx I2C driver. This gives us the I2C_TRANSFER method (2016-01-30). + * arch/arm/src/lpc11xx: Backport the lpc17xx I2C driver, replacing the + lpc11xx I2C driver. This gives us the I2C_TRANSFER method (2016-01-30). + * arch/arm/src/lpc2378: Backo the Lpc17xx I2C driver, replacing the + lpc2378 I2C driver. This gives us the I2C_TRANSFER method (2016-01-30). + * configs/u-blox-c027: Support for the u-blox GSM and GPS module evaluation + board with NXP LPCExpresso LPC1768. The GSM module is one of LISA-C200, + LISA-U200 or SARA-G350. The GPS module is one of MAX-M7 or MAX-M8. From + Vladimir Komendantskiy (2016-01-31). + * drivers/, arch/, include/, numerous files: Restructuring of the I2C + interface necessary to eliminate some thread-safety issues inherent in + the legacy I2C interface design. This effects the interface definition, + all I2C clients, and all low-level I2C drivers. I have used caution, + but I still expect a change of this magnitude to introduce some errors. + Any bug reports of bug fixes will be much appreciated (2016-02-01). + * drivers/i2c/i2c_driver.c: Add an I2C character drivers to support + raw I2C data transfers for test applications (2016-02-02). + * I2C_RESET: Eliminate up_i2creset(). It should not be a global function; + Now it is an I2C interface method (2016-02-02). + * I2C: Rename up_i2cinitialize and up_i2cuninitilize to follow the correct + naming convention. These are not common interfaces used by the OS; + these are MCU-specific interfaces used only be MCU-specific code. The + the correct naming is xyz_i2cbus_initialize and xzy_i2cbus_uninitialize + where xzy is the MCU mnemonic (2016-02-02). + * Networking drivers that support CONFIG_NET_NOINTS: Fix a race condition + that can cause the TX poll timer to stop running. From Manuel Stuhn + (2016-02-03). + * All Network drivers: Remove the hsec parameter from devif_timer(). + We can get better timing accuracy without it (2016-02-03). + * drivers/ioexpander/pca555.c: Add logic to make the PCA555 driver + thread safe (2016-02-03). + * sched/init/os_start.c and include/nuttx/init.h: Add a state variable + that provides the current level of OS initialization. This is needed by + some logic that may attempt to run early in the start-up sequence but + cannot run if a sufficient level of initialization has not yet occurred + (2016-02-05). + * libc/syslog/lib_syslog.c: If syslog timestamping is enabled, don't try to + get the time if the timer hardware has not yet been initialized + (2016-02-05). + * fs/procfs/fs_procfskmm.c: Add /proc/kmm entry that shows that state of + the kernel heap. Only useful in PROTECTED and KERNEL build modes where + there is a kernel heap (2016-02-06). + * sched/ and arch/: Replace explicit access to the OS internal data structure + g_readytorun() with the wrapper this_task() which hides the implementation + and will permit such things as more scalable representations of task queues + and SMP (2016-02-06). + * include/nuttx/net/arp.h, include/nuttx/net/ioctl.h, net/netdev/netdev_ioctl.c, + and ARP-related files: Add support for IOCTL commands to manage the + ARP table (2016-02-08). + * ARMv7-A, ARMv7-R, and ARMv7-A: Add test-and-set logic and definitions + needed to supports spinlocks (2016-02-09). + * include/nuttx/spinlock.h: Add basic definitions for spinlocks. Not yet + used by NuttX (2016-02-09). + * include/nuttx/arch.h, sched/sched/sched.h: Add some basic definitions + that may be needed for SMP support (2016-02-10). + * sched/init/os_start.c, sched/init/os_smpstart.c, and include/nuttx/arch.h: + Add some tentative SMP start-up logic (2016-02-10). + * arch/arm/sim/up_head.c and up_simsmp.c: Add multi-CPU support to the + simulation to support SMP investigation.. Currently crashes when CONFIG_SMP + is enabled as expected (2016-02-10). + * sched/sched.h and other files: Replace the bool 'prioritized' in the task + list table with a uint8_t bit set so that additional attributes of a task + list can be provided without adding more booleans (2016-10-11). + * Everywhere: Replace irqsave() with enter_critical_section(); replace + irqrestore() with leave_critical_section(). This is part of the onging + development of SMP support (2016-02-13). + * Conform to naming convention: Rename irqsave() to up_irq_save(); rename + irqrestore() to up_irq_restore(). These should no longer be used. If + your code still uses them, please switch to enter_critical_section() + and leave_critical_section() (2016-02-14). + * Also rename irqdisable() and irqenable() to up_irq_disable() and + up_irq_enable() (2016-02-14). + * sched/signal and include/nuttx/sched.h: Move the list of signal + actions from the TCB to the group structure. Signal handlers are not + per thread but, rather, per task group. I know, I preferred it the + other way too, but this is more compliant with POSIX (2016-02-18). + * fs/ procfs/fs_procfsproc.c: Add support for showing CPU if SMP is + enabled (2016-02-19). + * include/pthread.h, sched.h, sys/types.h and other files: Rename + cpuset_t to cpu_set_t which is the type used in some non-standard + Linux/GNU interfaces. Move definitions of cpu_set_t to include/sys/types.h. + Add prototypes for sched_setaffinity(), sched_getaffinity(), + pthread_attr_setaffinity_np(), pthread_attr_getaffinity_np(), + pthread_setaffinity_np(), and pthread_getaffinity_np(). No implementation + is yet in place (2016-02-19). + * sched/sched_cpuselect.c, include/nuttx/sched.h, and other files. Add + a CPU affinity set to the TCB if SMP is enabled and use this CPU set as + a mask for determining which CPUs the thread may run on (2016-02-19). + * libc/pthread, sched/pthread/pthread_start.c, and include/pthread.h: + Add an affinity field to the attrributes to permit controlling + which CPUs a pthread may run on. Implements pthread_att_setaffinity_np() + and pthread_attr_getaffinity_np() (2016-02-19). + * sched/pthread: Add pthread_setaffinity() and pthread_getaffinity() + (2016-02-19). + * sched/sched: Add sched_setaffinity() and sched_getaffinity() (2016-02-19). + * drivers/leds/rgbled.c: Add a driver to manage a RGB LED via PWM. From + Alan Carvalho de Assis (2016-02-22). + * arch/arm/src/stm32f4discovery: Add PWM support for the onboard RGB LED + From Alan Carvalho de Assis (2016-02-22). + * arch/arm/src/samv7: HSMCI driver can now be configured to handle unaligned + data buffers (2016-02-22). + * fs/fat: Add an option to force all transfers to be performed indirectly + using the FAT file system's internal sector buffers (2016-02-22). + * drivers/wireless/ieee802154: New directory. Nothing there yet (2016-02-25). + * wireless/: New top level directory. Nothing there yet (2015-02-26). + * wireless/ieee802154: Add an new directory to the build. Nothing there + yet (2016-02-26). + * include/nuttx/wireless/ieee802154: Add directory (and dummy header file) + (2016-02-16). + * arch/arm/include and src: Rename the imx directories to imx1 to make room + in the namespace for other members of the i.MX family (2016-02-27). + * arch/arm/include/imx6 and src/imx6: Evolving support for the NXP/Freescale + i.MX6Q (2016-02-28). + * configs/sabre-6quad: Placeholder that will eventually become board support + for the NXP/Freescale Sabre 6Quad board (2016-02-28). + * arch/arm/src/stm32: Support for STM32F46xx from Paul Alexander Patience + * sched/semaphore/sem_reset.c and include/nuttx/semaphore.h: Add an internal, + non-standard interface to reset a semaphore count. This is sometimes + needed by drivers in order to recover from error conditions (2016-03-05) + * AT24xx driver: Correct missing address calculation logic. From Frank + Benkert (2016-03-08). + * arch/ renaming: current_regs renamed to g_current_regs in all + architectures. For ARM which is slowly developing SMP capability, + g_current_regs is now an array of dimension 1 in most case but of higher + dimension of the architecuture supports multiple CPUs (2016-03-09). + * MTD: Increase block size in mtd_geometry_s to 32-bits (2016-03-09). + * include/nuttx/clock.h: Missing parenteses in MSEC2TICK macro can + cause wrong calculations. From Stefan Kolb (2016-03-09). + * Build system: Added a 'make olddefconfig' target that will refresh + a .config file without interaction. tools/refesh.sh now has a --silent + option so that it can be used in batch modes without human input + (2016-03-09). + * tools/testbuild.sh: .config files were not being updated because (a) + kconfig-conf was being called in the wrong directory and (b) apps/Kconfig + had not yet been created. Now uses 'make olddefconfig' (2016-03-09). + * arch/arm/src/stm32l4 and include/stm32l4: Add support for the STM32L4 + family. From Sebastien Lorquet (2016-03-10). + * configs/nucleo-l476: Add support for the Nucleo-L476 board. From + Sebastien Lorquet (2016-03-10). + * sched/tls and include/nuttx/tls.h: Basic definitions needed to support + thread local storage (TLS). Not used anywhere yet (and may not be used + in the near future either) (2016-03-10). + * sched/sched_note.c and include/nuttx/sched_note.c: Add a configuration + option to buffer RTOS instrumentation data in an in-memory buffer + (2016-03-17). + * drivers/syslog/note_driver.c: Add a character driver that will allow + an application to read buffered scheduler instrumentation data (2016-03-17). + * arch/arm/src/samv7/sam_usbdevhs.c: The USB driver has had some issue that + would occasionally cause loss of packets. Back last December, a fix was + put in for this but the fix apparently worsens the problem; now causing + hangs. The basic problem is that the number of busy banks (NBUSYBKS) + status is not real time but is delayed. This was fixed; now when the DMA + completes and NBUSYBKS > 0, the NBUSYBK is interrupt is enabled and the + operations are deferred until NBUSYBKS is truly zero (2016-03-17). + * net/tcp/tcp_timer.c: Fix some logic when there are multiple network + interfaces. In this case, TCP timeout events can really only being + processed when the poll from the correct device is received (2016-03-20). + * sched/wqueue/kwork_signal.c: Fix logic to find an IDLE worker thread; + the test for busy was backward. From Linfei Chen (2016-03-22). + * include/sys/boardctl.h, configs/boardctl.c, and many configurations: Add + boardctl() support that will permit applications to control USB devices + (2016-03-25). + * configs/stm32l476vg-disco: Add support for the STM32L476VG Discovery + board. From Dave (2016-03-25). + +7.16 2016-06-01 Gregory Nutt + + * PM: Add activity domain to all PM interfaces and driver callbacks. If + CONFIG_PM_NDOMAINS == 1, then the legacy behavior is preserved. If + CONFIG_PM_NDOMAINS > 1, then multiple PM domains are supported. This + will allow separate control for certain power management groups. For + example, a network can be shut down without affect an ongoing UI (and + vice versa) (2016-03-27). + * apps/configs/vsn: Removed the VSN configuration from the main NuttX + repository. The VSN can still be found in the Obsoleted repository + (along with a full explanation in the README file there) (2016-03-29). + * arch/arm/src/armv7-m and stm32: Add support for the IAR toolchain for + the limited case of the ARMv7-M architecture and the STM32 chip. From + Aleksandr Vyhovanec (2016-04-02). + * arch/arm/src/stm32/stm32f40xxx_rtc.c: Add a custom RTC driver. From + Neil Hancock (2016-04-02). + * include/nuttx/timer/rtc.h and drivers/timers/rtc.c: Simplify the RTC + interface. The old interface was way to complex and was not fully + implemented anywhere (2016-04-02). + * Moved NuttX repository to https://bitbucket.org/nuttx/nuttx (2016-04-06). + * arch/arm/src/armv7-m/iar: Convert more assembly language files for + use with the IAR toolchain. From Kha Vo (2016-04-08) + * Fix miscellaneous build issues for the IAR compiler. From Kha Vo + (2016-04-08). + * tools/ide_exporter.py: IDE exported Python script for use with the + IAR toolchain. From Kha Vo (2016-04-08). + * STM3220G-EVAL: Add support for both the IAR and uVision GCC IDEs + From Kha Vo (2016-04-08). + * STM32F429I Discovery: Add support for the uVision GCC IDE. From + Kha Vo (2016-04-08). + * libc/signal and include/signal.h: Rename sigset() to signal(). + sigset() is the System V function; signal() is the obsoleted POSIX + name. These seem to be equivalent. Neither are relevant in modern + POSIX programming but the name signal() probably has the better + credentials. sigset() is now relegated to a #define in signal.h that + makes it equivalent to signal() (2016-04-10). + * configs/nucleus2g: Removed the Nucleus2G configuration. There has + not been any activity with the commercial board in a few years and it + no longer appears to be available from the 2g-eng.com website. + Since the board is commercial and no longer publicly available, it + no longer qualifies for inclusion in the open source repositories. + The code as of this data is still available in the Obsoleted + repository at configs/nucleus2g (2016-04-12). + * arch/arm/src/stm32l4: Fix the STM32L4 SPI driver. That SPI driver is + quite different. They now handle frames of arbitrary size between 4 + and 16 bits. It was broken before a new bit has to be set (RX fifo + threshold) to handle <= 8-bit transactions. If not set, the default is + 16-bit packed >=8-bit frames and the RXNE bit is never set (it is set + when 16-bits are received). weird things as always. + This also add 8-bit access routines to the data register, because a + 16-bit access to the data register when the frame size is below 9 bits + is interpreted as a packed dual frame exchange. Sebastien Lorquet + (2016-04-13). + * net/sockets/listen.c and accept.c and include/nuttx/net: Separate + out psock_listen() and psock_accept() for internal OS usage + (2016-04-14). + * fs/inode/, fs/vfs/, and sched/task/: File and socket descriptors are + no longer allocated for kernel threads. They must use SYSLOG for + output and the low-level psock interfaces for network I/O. This + saves a little memory which might be important for small footprint + configurations (2015-04-14). + * Framebuffer driver: Add a display number to each interface in order + to support multiple display devices (2015-04-14). + * drivers/wireless/nrf24l01.c: Fix backward calculation of relative + frequency. Noted by Henry Zhang (2015-04-15). + * drivers/sensors/h1750fvi.c: Add a character driver for Rohm Ambient + Light Sensor BH1750FVI. From Alan Carvalho de Assis (2016-04-15). + * configs/stm32f4discovery: Integrate BH1750FVI driver in the + STM32F4Discovery board. From Alan Carvalho de Assis (2016-04-15). + * drivers/mtd: Add MTD support for Micron N25Qxxx family of QSPI flash. + From Dave dev@ziggurat29.com (2016-04-17). + * arch/arm/src/stm32l: Add a QSPI driver. From Dave dev@ziggurat29.com + (2016-04-18). + * configs/stm32l476vb-disco: Add support for QSPI based N25Qxxx flash. + From Dave dev@ziggurat29.com (2016-04-18). + * graphics/vnc: Add support for a VNC server. This logic is code + complete, but untested and so not ready for prime time (2016-04-18). + * configs/samv71-xult/vnc: Add a configuration that will be used to + verify VNC (also untested) (2016-04-18). + * drivers/ioexpander: Fix an error in the PCA9555 driver: Under certain + error conditions, interrupts were not being re-enabled. Sebastien + Lorquet (2016-04-20). + * arch/arm/src/stm32 and configs/stm32f429i-disco: Correct some bad + commits that broke the LTDC display example. From Marco Krahl + (2016-04-22). + * configs/samv71-xult/vncwwm: Add a more complex NxWM configuration + to support further VNC testing (particularly of VNC keyboard and + mouse inputs). Initial configuration is not functional (2016-04-23). + * arch/arm/src/stm32l4: Add support for QSPI DMA. From Dave + dev@ziggurat29.com (2016-04-24). + * configs/stm32l476vg-disco: Update stm32l4 disco board to reflect QSPI + DMA support. From Dave dev@ziggurat29.com (2016-04-24). + * arch/arm/src/stm32l4: Add configuration options to allow SRAM2 to be + used for heap, or not at all, and to zero-initialize it on OS start, + or not at all. From Dave dev@ziggurat29.com (2016-04-24). + * drivers/mtd/smart.c: Return code of smart_scan not checked, can + cause success result in failure case, leading to 'dev' pointer being + invalid. From Dave dev@ziggurat29.com (2016-04-27). + * arch/arm/src/stm32l4: Add support for QSPI memory mapped mode. From + Dave dev@ziggurat29.com (2016-04-27). + * configs/stm32l476vg-disco: Add board ioctls for allowing user + application to cause QSPI memory mapped mode to be engaged and + disengaged. Also partitioned QSPI flash for file system and other + (eventually xip). From Dave dev@ziggurat29.com (2016-04-27). + * fs/mount: Fix a backward debug assertion. Noted by David Sidrane + (2016-04-29). + * arch/arm/src/stm32l4: Add support for HSE and MSI clocks, and auto + trim of MSI to LSE (needed for USB). From Dave dev@ziggurat29.com + (2016-04-29). + * arch/arm/src/stm32l4: Add support for unique id function to arch; + modified board to support unique id boardctl. From Dave + dev@ziggurat29.com (2016-05-03). + * Makefile.unix and tools/mkexport.sh: Pass top-level make to the + script to allow -j greater than 1. From David Sidrane (2016-05-04). + * arch/arm/src/stm32, stm32f7, stm32l4: Fix typo in variable name in + serial BREAK logic. Review other serial implementations for similar + naming problems. (2016-05-05). + * arch/arm/src/samv7: Fix typo in MATRIX register definitions. From + Stefan Kolb (2016-05-06). + * arch/arm/src/stm32l4: Problem with resetting backup domain clears + clocking options set up before in *rcc.c use INITS flag to avoid magic + reg value to detect power up reset state of RTC correct a problem + clearing interrupt flags (they weren't) which prevented an alarm from + ever being used more than once per reset cycle. From Dave + dev@ziggurat29.com (2016-05-07). + * arch/arm/src/tiva: Fix a bug of GPIO falling-edge interrupt for tiva. + From Young (2016-05-07). + * drivrs/mtd: Add a driver for SST26F spi/qspi flash devices (SPI mode + only). From Sebastien Lorquet (2016-05-10). + * Several Makefiles: Add .PHONY definitions to prevent 'clean up to date' + message weirdness when 'make clean' is done with no .config or Make.defs + file (2016-05-10). + * include/nuttx/can.h and drivers/can.c: Improve CAN error reporting. + From Frank Benkert (2016-05-11). + * fs/Kconfig: Allow CONFIG_FS_WRITABLE to be manually selectable + (2016-05-11). + * Various file: Search for places where a stray semicolon following an + if condition cause the if body to be executed unconditionally. Fixes + in all SAM DMA logic, unionfs, OS signalling logic, + * configs/nucleo-144: Basic port for the Nucleo-144 board with the + STM32F746ZG MCU. From Kconstantin Berezenko (2015-05-12). + * arch/arm-src/armv7-a: Complete re-design of logic to initialize each + CPUn, n > 0, when CONFIG_SMP=y (2016-05-13). + * arch/arm/src/imx6 and configs/sabre-6quad: The basic i.MX6 port is + complete. This is a very minimal port at present and probably still + has some as-of-yet-undiscovered issues (2016-05-17). + * arch/*/Makefile: Add definitions that can be overrided to use GCC + instead of LD in the final link. From Paul Alexander Patience + (2016-05-18) . + * arch/arm/src/stm32, stm32l4, and stm32f7 serial: Add support for + compliant BSD-style breaks. From David Sidrane (2016-05-18). + * enter/leave_critical_section() may attempt to access task lists before + they have been initialized in the SMP configuration (2016-05-18). + * configs/stm32f103-minimum: Add support for this minimual STM32F103CBT6 + "blue" board. From Alan Carvalho de Assis (2016-05-18). + * arch/arm/src/sam* Watchdogs: Rename up_wdginitialize() to something + more appropriate for an internal, MCU-specific function (2016-05-18). + * configs/*/src/*_watchdog.c: Remove all implementations of + up_wdginitialize() which was only used by apps/examples/watchdog. + That internal OS function is no longer called from application code. + If you want to use the watchdog example, you will need to configure + the watchdog driver by calling the appropriate, MCU-specific driver + configuration function from your board initialization logic + (2016-05-18). + * arch/srm/src/stm32l4: Add CAN support for STM32L4. From Sebastien + Lorquet (2016-05-19). + * arch/arm/src/samv7: Adds a JTAG config and ERASE config to Kconfig to + set the CCFG_SYSIO SYSIO Pins. From David Sidrane (2016-05-19). + * arch/sim/src: Enhance networking support for the simulation under Linux. + Includes updated support for Linux TUN/TAP, and the addition of support + for Linux bridge devices. From Steve (2016-05-20). + * configs/stm32f411e-disco: Add basic configuration for stm32f411e-disco + board with STM32F411VE chip. From Konstantin Berezenko (2016-05-20). + * i.MX6 Sabre-6Quad: Basic SMP NSH configuration is now working. But + this is probably only because the SMP NSH case does not stress the + logic. There are know outstanding SMP issues as noted in the + Sabre-6Quad README.txt file (2016-05-22). + * configs/sabre-6quad: Add an SMP configuration; Enable procfs in all + configurations (2016-05-22). + * include/nuttx/crypto/aes.h: Modifications to the crypto API needed + for LPC43xx. From Alexander Vasiljev (2016-05-23). + * arch/arm/src/lpc43xx: Add AES support. From Alexander Vasiljev + (2016-05-24). + * configs/*/src/tiva_timer.c: Tiva boards: Fix a naming collision, + rename board-specific function from tiva_timer_initialize() to + tiva_timer_configure() to remove conflict (2016-05-23). + * arch/arm/src/sam*: Ensure that the TWIHS (i2c) hw get's its clock + set when the sequence of sam_i2cbus_initialize(), + sam_i2cbus_uninitialize(), then sam_i2cbus_initialize() or twi_reset() + is called. I found this a while back in the stm32 family, so there + may be more arch-es with this sort of bug. I suppose any driver that + has the notion of "do not set the freq if it is already set" could be + suspect. From David Sidrane (2016-05-23). + * arch/arm/src/samv7: Add the up_systemreset interface to the samv7 + arch. The approach is slightly different in that: 1) It enables + ARCH_HAVE_RESET and allows the user to set if, and for how long, to + drive External nRST signal. It also does not contain a default + board_reset, as that really should be done in the config's src if + CONFIG_BOARDCTL_RESET is defined. From David Sidrane (2016-05-23). + * arch/arm/include/lpc43xx and src/lpc43xx: Adds definitions for the + LPC4337jet100 chip. From Alexander Vasiljev (2016-05-24). + * Many files: board_app_initialize() now accepts an argument that may + be used to support initialization in different configurations + (2016-05-24). + * arch/arm/src/samv7: Remove disabling of whole USB on suspend of USBHS. + This fix removes the disabling of the whole USB peripheral on suspend + interrupt. Its enough to freeze the clock instead. When disabling the + whole peripheral, the next wakeup-interrupt comes up with an disabled + clocking. The unfreeze clock has no effect, because the master clock + is disabled. This makes all registers, including the IDR unwriteable + and the IRQ falls in an endless loop blocking the whole system. + Furthermore the disabling of the peripheral clock prevents hotplugging + or reconnecting the USB. From Frank Benkert (2015-05-25). + * drivers/lcd: Add support for PCF8574 LCD Backpack driver. This driver + supports an interface board that is based on the PCF8574 io expander + and supports the HD44780-based (or compatible) LCD modules. There + are a myriad of different vendors of such, but they are principally + the same, save wiring and minor features like jumpers for I2C + addresses. This driver supports known and unknown variants. From + Dave (ziggurat29, 2013-6-26). + * arch/arm/stm32: Add support for a custom 1-wire driver. The serial + driver already supports a 1-wire interface, but this driver uses the + same serial logic to implement a lower half driver much like the I2C + lower half driver. From Aleksandr Vyhovanec (2015-05-25). + * fs/: Add logic to detach a file structure from a file descriptor. + This is for use only within the OS. It permits an open file or driver + to be used across multiple threads (2016-05-26). + * arch/arm/src/stm32l4: Get I2C working for STM32L4. From Dave + (ziggurat29) (2016-05-25). + * fs/ and include/nuttx/fs: Add logic to detach a file structure from a + file descriptor. This is for use only within the OS. It permits an + open file or driver to be used across multiple threads. (2016-05-26). + * drivers/analog/adc.c, include/nuttx/analog/adc.h, and all ADC lower + half drivers: No longer uses global adc_receive() call. Added a new + bind() method to the ADC interface. Now the ADC upper half driver + will register its receipt-of-data callback. This change allows the + ADC lower half driver to be used with a differ ADC upper half + (2016-05-26). + * drivers/analog/ads1255.c: Must not do SPI access from interrupt + handler. Use the worker thread instead. Must also lock the SPI bus + before using it. (2015-05-26). + * drivers/: Several SPI-based drivers modified. All drivers that use + SPI must call SPI_LOCK and SPI_UNLOCK. This is not optional + (2016-05-26). + * drivers/sensors: Fix a bug in crc computation for ms583730. + Implement POSIX read (2016-05-27). + * arch/arm/src/samv7: This is a fix to a problem in the handling of the + oneshot timer. Due to a wrong assumption concerning the behavior + directly after the start of the timer/counter the function + sam_oneshot_cancel(…) calculates the wrong remaining time. The code + assumes that the counter register is zero directly after the start of + the timer, but this is not true. To start the time/counter a software + trigger is invoked, this trigger starts the timer/count and sets the + counter register to zero, but the reset of the counter register is not + performed instantly. According to the datasheet: "The counter can be + reset by a trigger. In this case, the counter value passes to zero on + the next valid edge of the selected clock." Thus the counter is set to + zero between 0 and USEC_PER_TICK microseconds after the clock was + started. + In my fix I use the freerun count value to determine if at least one + tick passed since the start of the timer and thus if the value of the + oneshot counter is correct. I also tried to use the function + up_timer_gettime(…) to achieve this but, at least if compiled with no + optimization the problem vanishes without using the value of the + function, the function call takes too long. + Another problem treated in the fix is that if the oneshot timer/counter + is canceled, we only know the remaining time with a precision of + USEC_PER_TICK microseconds. This means the calculated remaining time + is between 0 and USEC_PER_TICK microseconds too long. To fix this I + subtract one tick if the calculated remaining time is greater than one + tick and otherwise set the remaining time to zero. By doing so the + measured times are much more precise as without it. From Stefan Kolb + (2016-05-27). + * arch/arm/src/sama5: Stefan Kolb's change to the SAMV7 Oneshot Timer + should also be applied to the SAMA5 oneshot time since the drivers are + identical (2016-05-27). + * arch/arm/src/stm32l4: Add support for SPI 4 and 5 on stm32f411 chips. + From Konstantin Berezenko (2016-05-27). + * arch/arm/src/sam34: Stefan Kolb's change to the SAMV7 Oneshot Timer + should also be applied to the SAM3/4 oneshot time since the drivers + are identical (2016-05-29). + * arch/arm/src/stm32: Allow to not use all channel in a lower part of + PWM. From Pierre-noel Bouteville (2016-05-30). + * libc/math: Add a NAN test on 'x' in asin function of lib_asin.c. + Suggested by Pierre-noel Bouteville (2016-05-31). + * arch/arm/src/stm32: Fix logic in F4 RTCC driver that prevent ALARM + interrupt. From Neil Hancock (2016-05-31). + * arch/arm/src/stm32: Fix STM32 ValueLine ADC IRQ number selection. + From David Sidrane (2016-05-31). + * arch/arm/src/samv7: Fix missing unlock of device in MCAN + mcan_txempty(). From Frank Benkert (2016-06-01). + +7.17 2016-07-25 Gregory Nutt + + * drivers/mtd/flash_eraseall.c: Removed. This is no longer used + in the OS and is simply a wrapper around the MDIOC_BULKERASE + IOCTL command. It used to be called (only) from + apps/system/flash_eraseall, but that has been removed because it + violated the OS/application interface -- by calling flash_eraseall(). + The old code can be found in the Obsoleted' repository (and a revised + version can be found at apps/fsutils/flash_eraseall) (2016-06-03). + * arch/arm/src/stm32: STM32 Timer Driver: Change calculation of per- + timer pre-scaler value. Add support for all timers (2016-6-03) + * drivers/lcd: Correct conditional compilation in ST7565 driver. From + Pierre-noel Bouteville (2016-6-03) + * arch/arm/src/stm32: Correct conditional compilation in STM32 timer + capture logic. From Pierre-noel Bouteville (2016-6-03) + * arch/arm/src/efm32: Fix EFM32 FLASH conditional compilation. From + Pierre-noel Bouteville (2016-6-03) + * arch/arm/src/lpc43xx: Fix errors in GPIO interrupt logic. From v01d + (phreakuencies) (2016-06-04) + * arch/arm/src/kl and lpc11xx: rename xyz_lowputc to up_putc. Remove + all references to up_lowputc, everywhere (2016-06-04). + * configs/stm32f103-minimum: Add minnsh configuration. From Alan + Carvalho de Assis (2016-06-04). + * arch/arm/src/stm32: Add the up_getc() function to STM32 in order to + support the minnsh configuration. From Alan Carvalho de Assis + (2016-06-04). + * include/sys/boardctl.h: Needs to be usable with C++ files (2016-06-05). + * tools/tesbuild.sh will now build NxWM configurations (2016-06-05). + * arch/arm/src/stm32: In PWM driver, just update duty if frequency is + not changed and PSM started. This removeis glitch or blinking when + only duty is frequently changed. From Pierre-noel Bouteville (2016-06-05). + * arch/arm/src/kinetis: Add a USB device controller driver. Derived from + the pic32mx usb driver, which uses the same usb controller. From kfazz + (2016-06). + * configs/teensy-3.x: Add USB support and a usbnsh configuration. From + kfazz (2016-06). + * arch/arm/src/stm32: Add support for the STM32F105R. From Konstantin + Berezenko (2016-06-06). + * include/signal.h: Change type of SIG_ERR, SIG_IGN, ... to + _sa_handler_t. The type void does not work with the IAR toolchain. + From Aleksandr Vyhovanec (2016-06-07). + * configs/nucleo-144: Refactored configs/nucleo-144 sub-directories to + support additional nucleo-144 board. Add support for the Nucleo-F767ZI + board. From David Sidrane (2016-06-07). + * arch/arm/src/stm32f7 and include/stm32f7: Added STM32F76xxx and + STM32F77xx families. From David Sidrane (2016-06-08). + * Refactoring configs/nucleo-144 sub-directories to support additional + nucleo-144 board. Add support for the Nucleo-F767ZI board. From David + Sidrane (2016-06-08). + * include/assert.h: Check if NDEBUG is defined. From Paul Alexander + Patience (2016-06-08). + * arch/arm/src/stm32: Fix STM32 DMA code and configuration for STM32F37X + chips. From Marten Svanfeldt (2016-06-08). + * drivers/mtd: Add a driver of IS25xP SPI flash devices. From Marten + Svanfeldt (2016-06-09). + * arch/arm/src/Kconfig and configs/teensy-3.x: Teensy clock fixes. The + High Gain bit in MCG_C1 was preventing teensy from booting except + after a programming session. The second change doesn't appear to + change any functionality, but complies with restrictions in the k20 + family reference manual on FEI -> FBE clock transiions. From kfazz + (2016-06-09). + * configs/*/include/board.h: Fix timer input clock definitions. From + David Sidrane (2016-06-09). + * Networking: In both IPv6 and IPv4 incoming logic: (1) Should check + if the packet size is large enough before trying to access the packet + length in the IP header. (2) In the comparison between the IP length + and the full packet length, need to subtract the size of the link + layer header before making the comparison or we will get false + positives (i.e., the packet is really too small) (2016-06-09) + * configs/: All configurations that have both CONFIG_NSH_LIBRARY=y and + CONFIG_NET=y must now also have CONFIG_NSH_NETINIT=y (2016-06-09). + * arch/arm/src/kinetis: Kinetis pwm support, based on kl_pwm driver. + From kfazz (2016-06-09). + * arch/srm/src/stm32: Fix compilation errors in debug mode of + stm32_pwm.c. From Konstantin Berezenko (2016-06-09). + * arch/arm/src/kinetis: Support up to 8 channels per timer. From kfazz + (2016-06-09). + * lib/: crc16: Fix error. From Paul Alexander Patience (2016-06-10). + * lib/: Add crc64 support. From Paul Alexander Patience (2016-06-10). + * arch/arm/src/kinetis: Added kl_dumpgpio functionality as + kinetis_pindump. From kfazz (2016-06-10). + * arch/arm/src/sam34: Fix some errors in AFEC header file. From + OrbitalFox (2016-06-10). + * arch/arm/include/stm32: Correct the can2 rx irq number for stm32f10xx + chips. From Konstantin Berezenko (2016-06-10). + * drivers/include/input: Button upper half driver: Add definitions + needed for compilation with the poll() interface is not disabled + (2016-06-11). + * Kconfig/, include/debug.h, and many other files: (1) Debug features + are now enabled separately from debug output. CONFIG_DEBUG is gone. + It is replaced with CONFIG_DEBUG_FEATURES. (2) The macros dbg() and + vdbg() have renamed as err() and info(), respectively. This also + applies to all of the variants as well, lldbg(), llvdbg(), XXdbg(), + XXvdbg(), XXlldbg(), and XXllvdbg(). (3) Add a new debug level, + warn() (and all variants vwarn(), llwarn(), etc.). (4) Debug + assertions can now be enabled separately from debug output. (5) You + can now enable subsystem/device driver debug output at different + output levels. For example, CONFIG_DEBUG_FS no longer enables file + system debug output. It enables general file system debug logic and + enables selection of CONFIG_DEBUG_FS_ERROR, CONFIG_DEBUG_FS_WARN, + and CONFIG_DEBUG_FS_INFO (2016-06-12). + * strtoul() and strtoull(): Fix errno settings required by function + definition. Resolved Bitbucket Issue #1. From Sebastien Lorquet + (2016-06-13) + * arch/arm/src/stm32f7: Add SPI driver. DMA not yet supported. From + David Sidrane (2016-06-14). + * configs/nucleo-144: Add test for STM32 F7 SPI. From David Sidrane + (2016-06-14). + * alert(): New debug macro: alert(). This is high priority, + unconditional output and is used to simplify and stanardize crash + error reporting(2016-06-14). + * arch/arm/src/tiva: Bug Fix in tiva_serial.c - UART5, UART6 and UART7 + were not being configured as TTYS0 for printing over serial console. + From Shirshak Sengupta (2016-06-14). + * SAMV7: SPI: SPI-Freq. 40MHz; VARSELECT; hw-features + This change adds the following improvements: + - Increase the allowed SPI-Frequency from 20 to 40 MHz. + - Correct and rename the "VARSELECT" option + This option was included in the code as "CONFIG_SPI_VARSELECT" but + nowhere defined in a Kconfig file. The change renames it to + "CONFIG_SAMV7_SPI_VARSELECT" and corrects the implementation + according the datasheet of Atmel. In short, this option switches + the processor from "fixed peripheral selection" (single device) to + "variable peripheral selection" (multiple devices on the bus). + - Add a new Function to the interface to control the timing and delays + of the chip according the ChipSelect lines. This function can + control the delay between the assertion of the ChipSelect and the + first bit, between the last bit and the de-assertion of the + ChipSelect and between two ChipSelects. This is needed to tune the + transfer according the specification of the connected devices. + - Add three "hw-features" for the SAMV7, which controls the behavior + of the ChipSelect: + - force CS inactive after transfer: this forces a (short) + de-assertion of the CS after a transfer, even if more data is + available in time + - force CS active after transfer: this forces the CS to stay active + after a transfer, even if the chip runs out of data. + Btw.: this is a prerequisit to make the LASTXFER bit working at all. + - escape LASTXFER: this suppresses the LASTXFER bit at the end of the + next transfer. The "escape"-Flag is reset automatically. + From Frank Benkert (2016-06-14) + * Many CONFIG_DEBUG_* options did not have matching macros defined in + include/debug.h. Rather, there were various definitions scattered + throughout the sourse tree. These were collected together and + centralized with single macro definitions in include/debug.h + (2016-06-15) + * STM32F7: Add SPI, I2C, and ADC drivers. From Lok Tep (2016-06-15). + * err(), warn(), info(), and alert() renamed to include leading '_'. + This was done to avoid some naming collisions (2-06-16 + * STM32: Move backup domain reset to earlier in the initialization + sequence (stm32_rcc.c() in order to avoid disabling LSE during RTC + initialization. From Alan Carvalho de Assis (2016-06-16). + * SYSLOG: syslog() will now automatically redirect output to lowsyslog() + if called from an interrupt handler (2016-06-16). + * STM32: When configuring a GPIO via stm32_configgpio() the function + will first set the mode to output and then set the initial state of + the gpio later on. If you have an application with an externaly + pulled-up pin, this would lead to a glitch on the line that may be + dangerous in some applications (e.G. Reset Line for other chips, + etc). This changes sets the output state before configuring the pin + as an output. From Pascal Speck (2016-06-17). + * STM32 F7: Apply Pascal Speck's GPIO STM32 change to STM32 L4 + (2016-06-17). + * STM32 L4: Apply Pascal Speck's GPIO STM32 change to STM32 L4. + From Sebastien Lorquet (2016-06-17). + * Review all uses of *err(). These macro family should indicate only + error conditions. Convert *err() to either *info() or add ERROR:, + depending on if an error is reported (2016-06-17). + * STM32F7: Review, correct, and update I2C, SPI, and ADC drivers. From + David Sidrane (2016-06-17). + * LPC17 Ethernet: Needs to correctly ignore PHYID2 revision number + when comparing PHY IDs (2016-06-18). + * SYSLOG: Consolidate all SYSLOG logic in drivers/syslog. Add an + abstraction layer that supports: (1) redirection of SYSLOG outpout. + This is usually so that you can boot with one SYSLOG output but + transition to another SYSLOG output when the OS has initialialized, + (2) adds common serialization of interrupt output as a configuration + option. Without this configuration setting, interrupt level output + will be asynchronous. And (3) vsyslog is now a system call and is + usable with other-than-FLAT builds (2016-06-19). + * TCP Networking: While working with version 7.10 I discovered a + problem in TCP stack that could be observed on high network load. + Generally speaking, the problem is that RST flag is set in + unnecessary case, in which between loss of some TCP packet and its + proper retransmission, another packets had been successfully sent. + The scenario is as follows: NuttX did not receive ACK for some + sent packet, so it has been probably lost somewhere. But before + its retransmission starts, NuttX is correctly issuing next TCP + packets, with sequence numbers increasing properly. When the + retransmission of previously lost packet finally succeeds, tcp_input + receives the accumulated ACK value, which acknowledges also the + packets sent in the meantime (i.e. between unsuccessful sending of + lost packet and its proper retransmission). However, variable unackseq + is still set to conn->isn + conn->sent, which is truth only if no + further packets transmission occurred in the meantime. Because of + incorrect (in such specific case) unackseq value, few lines further + condition if (ackseq <= unackseq)is not met, and, as a result, we + are going to reset label. From Jakub Łągwa (2016-06-20). + * SYSLOG: Remove lowsyslog(), vlowsyslog(), and associated macros + *llinfo(), *llwarn(), and llerr(). In the redesigned syslog() logic, + these serve no purpose (2016-06-20). + * Make system: Need to build the drivers/ directory even it file + descriptors are not supported. There are things in the drivers/ + directory that are still needed (like SYSLOG logic) (2016-06-20). + * assert.h: Define static assert for C++ usage. From Paul Alexander + Patience (2016-06-21). + * arch/arm/src/stm32l4: Add ioctls to set/get bit timing in stm32l4. + Add ioctl hooks to allow future management of can id filters. From + Sebastien Lorquet (2016-06-21). + * drivers/can.c: Add support for poll. From Paul Alexander Patience + (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. Now 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). + * STM32L4: Fix incorrect clock setup for LPTIM1. From ziggurat29 + (2016-07-08). + * nucleo-l476rg and stm32lf76vg-disco: Define timer clock frequencies on + STM32L4-based boards. From ziggurat29 (2016-07-08). + * STM32L4: Add support for tickless OS, and incidentally timers, pwm, + oneshot, free-running.... From ziggurat29 (2016-07-08). + * SAM3/4 I2C: Fix reversed logic in twi_startmessage(). From Wolfgang + Reissnegger (2016-07-09). + * VFS ioctl(). Per comments from David Sidrane, file_ioctl() should not + return succeed if the ioctl method is not supported. It probably + should return ENOTTY in that case (2016-07-09). + * libm: This change should significantly improve the performance of + single precision floating point math library functions. The vast + majority of changes have to do with preventing the compiler from + needlessly promoting floats to doubles, performing the calculation + with doubles, only to demote the result to float. These changes only + affect the math lib functions that return float. From David Alessio + (2016-07-11). + * STM32F4 Discovery: Add FPU support for ostest for the STM32F4Discovery + platform. From David Alessio (2016-07-11). + * Build system: Remove the includes/apps link to apps/include. It is + no longer used. From Sebastien Lorquet (2016-07-11). + * printf(): If there are no streams, let printf() fall back to use + syslog() for output (2016-07-11). + * Qemu-i486: Fix qemu-i486/ostest/Make.defs test for M32. From Heath + Petersen (2016-07-12). + * UART 16550: Handle when CONFIG_SERIAL_UART_ARCH_IOCTL is not enabled. + From Heath Petersen (2016-07-12). + * Kinetis Ethernet: Add support for the KSZ8081 PHY (2016-07-12). + * SST26 Driver: Before accessing the sst26 flash, the "Global Unlock" + command must me executed, which I do in the sst26 driver. BUT re- + reading the datasheet, the WREN instruction is required to enable the + execution of this command. This was not done. I have no idea how the + driver currently works except by chance. The writes should never + happen at all, the flash is half-enabled! From Sebastien Lorquet + (2016-07-12). + * Freedom K64F: Add a networking NSH configuration. (2016-07-12). + * N25Qxx Driver: Alter the notion of 'blocksize' to be equivalent to + 'flash write page size' in order to align with assumptions in the + smartfs driver (at least, maybe other things do as well). Correct a + bug that was previously masked by having blocksize=eraseblocksize + which would cause buffer overflows and delicious hardfaults. Trivial + spelling changes in comments, etc. From ziggurat29 (2016-07-12). + * STM32L476 Discovery: Update stm32l476 disco to include init code for + smartfs and nxffs for cases where those fs are included in build. + From ziggurat29 (2016-07-12). + * Kinetis Ethernet and Freedom-K64F: Freedcom-K64F PHY address was + wrong. Modified Ethernet driver to try all PHY addresses and then + only fail if the driver cannot find a usable PHY address. MDIO pin + must have an internal pull-up on the Freedom-K64F (2016-07-12). + * Kinetis Ethernet: Add support for CONFIG_NET_NOINTS (2016-07-12). + * SmartFS: Fix a 32-byte memory leak. From Ken Pettit (2016-07-12). + * Freedom-K64F: SDHC is now enabled in the nsh configuration (but does + not work)Add hooks for automounter; Change NSH configuration to use + Windows (2016-07-13). + * SAMV7 USBHS Device: This change solves a problem which causes data + loss while sending data via USB. This problem is caused by an incorrect + handling of the endpoint state in the USB driver sam_usbdevhs. This + leads under some circumstances to situations in which an DMA transfer + is setup while a previous DMA transfer is currently active. Amongst + other things I introduced the new endpoint state USBHS_EPSTATE_SENDING_DMA + for the fix. To reproduce the problem, I used a program which send as + many data as possible via a CDC/ACM device and verified the received + data on the PC. From Stefan Kolb (2016-07-13). + * STM32: Fix bug in oneshot timer. From Max Neklyudov (2016-07-13). + * STM32L4: Port foward bugfix from stm32 of oneshot timer. From + ziggurat29 (2016-07-13). + * STM32 and EFM32: I'm using syslog through ITM. In this case + syslog_channel function is call before RAM initialization in + stm32_clockconfig. But syslog channel uses a global variable that is + reset to default by the RAM initialization. From Pierre-noel + Bouteville (2016-07-14). + * LPC43xx SPIFI: If CONFIG_SPIFI_SECTOR512 undefined, lpc43_bwrite + doesn't do actual write (probably copy/paste errors). Still not sure + about current state of lpc43_spifi implementation, but for me NXFFS + works with this patch. From Vytautas Lukenskas (2016-07-14). + * SMART MTD layer: Fixes freesector logic error when sectorsPerBlk=256, + adds DEBUGASSERT for invalid geometry and additional memory debug + logic. Also fixes the dangling pointer on error bug. From Ken + Pettit (2016-07-14). + * arch/arm/src/lpc43xx: Extend LPC43xx EMC code to support SDRAM on a + dynamic memory interface. From Vytautas Lukenskas (2016-07-19). + * arch/sim/src: Add the simulated QSPI (N25Q) flash to the simulation + and modify sim up_spiflash.c to enable it to run with different MTD + drivers based on config options (currently m25p, sst26 and w25). + From Ken Pettit (2016-07-19). + * drivers/pipe: Add support to allocating different sizes for pipe and + fifo buffers. Adds mkfifo2() and pipe2() which are just like mkfifo() + and pipe(), but allow control of the size of the underlying, in-memory + circular buffer . Move pipe() and mkpipe() to nuttx/libc, they are no + longer core OS interfaces. Capability currenty used only by PTY logic + to support, configurable, smaller buffers for PTYs (2016-07-19). + * include/nuttx/drivers: Move driver-related files from include/nuttx + to include/nuttx/drivers. Move driver related prototypes out of + include/nuttx/fs/fs.h and into new include/drivers/drivers.h + (2016-07-20). + * include /nuttx/lib: Move library-related files from include/nuttx to + include/nuttx/lib (2016-07-21). + * drivers/serial/serial.c: Fix a race condition noted by Stefan Kolb. + Between the test if the TX buffer is full and entering a critical + section, bytes may be removed from the TX buffer making the wait + unnecessary. The unnecessary wait is an inefficiency, but not really + a problem. But with USB CDC/ACM it can be a problem because the + entire TX buffer may be emptied when we lose the race. If that + happens that uart_putxmitchar() can hang waiting for data to be + removed from an empty TX buffer (2016-07-22). + * arch/arm/src/stm32 and stm32l4: STM32 F4/L4 RTC ALARM: were enabling + interrupts too early in the power-up sequence, BEFORE the interrupt + system was being initialized (2016-07-23). + * drivers/ioexpander: GPIO driver: Add support for receiving signals + from interrupt pins (2016-07-23). + * drivers/usbdev: USBMSC: Add locks when removing request from queue. + From Wolfgang Reissnegger (2016-07-23). + * drivers/usbdev: USBMSC: Fix reversed logic on waiting for SCSI thread + start. The scsi thread was waiting for the wrong condition. However, + this was masked by the fact that the code creating the scsi thread was + also holding usbmsc_scsi_lock(priv) while initializing data, hence + this lock synchronized the scsi thread start with init completion. + From Wolfgang Reissnegger (2016-07-23). + * arch/arm/src/sam34: SAM3/4 UDP: Fix handling of endpoint RX FIFO + banks. This fixes a race condition where the HW fills a FIFO bank + while the SW is busy, resulting in out of sequence USB packets + (2016-07-23). + * Freedom-K64F: Add PWM support. From Jordan MacIntyre (2016-07-25). + +7.18 2016-10-08 Gregory Nutt + + * drivers/serial/pty.c, serial.c, usbdev/cdcacm.c, include/nuttx/fs/ioctl.h: + Fix FIONWRITE and add FIONSPACE. All implementations of FIONWRITE + were wrong. FIONWRITE should return the number of bytes waiting in + the outgoing send queue, not the free space. Rather, FIONSPACE should + return the free space in the send queue (2016-07-25). + * lib_dumpbuffer: Now prints a large on-stack buffer first to avoid + problems when the syslog output is prefixed with time. From Pierre- + noel Bouteville (2016-07-27). + * sched/clock and sched/sched: Add standard adjtime() interface and + basic timekeeping support. Normally used with an NTP client to keep + system time in synchronizationi. From Max Neklyudov (Merged on + 20160-07-28). + * arch/arm/src/stm32: Add timekeeping support for the STM32 tickless + mode. From Max Neklyudov (Merged on 20160-07-28). + * Top-Level Makefiles. Fix a chicken-and-egg problem. In the menuconfig + target, the context dependency was executed before kconfig-mconf. + That was necessary because the link at apps/platform/board needed to + be set up before creating the apps/Kconfig file. Otherwise, the + platform Kconfig files would not be included. But this introduces + the chicken-and-egg problem in some configurations. + In particular: (1) An NX graphics configuration is used that requires + auto-generation of source files using cpp, (2) the configuration is + set for Linux, but (3) we are running under Cygwin with (4) a Windows + native toolchain. In this case, POSIX-style symbolic links are set + up but the Windows native toolchain cannot follow them. + The reason we are running 'make menuconfig' is to change from Linux + to Cygwin, but the target fails. During the context phase, NX runs + CPP to generate source files but that fails because the Windows native + toolchain cannot follow the links. Checkmate. + This was fixed by changing all of the make menuconfig (and related) + targets. They no longer depend on context being run. Instead, they + depend only on the dirlinks target. The dirlinks target only sets + up the directory links but does not try to run all of the context + setup; the compiler is never invoked; no code is autogeneraed; and + things work (2016-07-28). + * tools/refresh.sh: Recent complexities added to apps/ means that + configuration needs correct Make.defs file in place in order to + configure properly (2016-07-28). + * tools/kconfig2html.c: Update to handle absolute paths when sourcing + Kconfig files (2016-07-29). + * libc/math: This fixes the following libc/math issues: (1) asin[f l]() + use Newton’s method to converge on a solution. But Newton’s method + converges very slowly (> 500,000 iterations) for values of x close + to 1.0; and, in the case of asinl(), sometimes fails to converge + (loops forever). The attached patch uses an trig identity for + values of x > sqrt(2). The resultant functions converge in no more + than 5 iterations, 6 for asinl(). (2) The NuttX erf[f l]() functions + are based on Chebyshev fitting to a good guess. The problem there’s a + bug in the implementation that causes the functions to blow up with x + near -3.0. This patch fixes that problem. It should be noted that + this method returns the error function erf(x) with fractional error + less than 1.2E-07 and that’s fine for the float version erff(), but + the same method is used for double and long double version which + will yield only slightly better precision. This patch doesn't address + the issue of lower precision for erf() and erfl(). (3) a faster + version of copysignf() for floats is included. From David S. Alessio + (2016-07-30). + * I/O Expander: Remove hard-coded PCA9555 fields from ioexpander.h + definitons. Add support for an attach() method that may be used when + any subset of pin interrupts occur (2016-07-31). + * PCA9555 Driver: Replace the signalling logic with a simple callback + using the new definitons of ioexpander.h. This repartitioning of + functionality is necessary because (1) the I/O expander driver is the + lower-lower part of any driver that uses GPIOs (include the GPIO + driver itself) and should not be interacting directly with the much + higher level application layer. And (2) in order to be compatible + with the GPIO driver (and any arbitrary upper half driver), the + PCA9555 should not directly signal, but should call back into the + upper half. The upper half driver that interacts directly with the + application is the appropriate place to be generating signal + (2016-07-31). + * drivers/ioexpander/skeleton.c: Add a skeleton I/O Expander driver + (based on the PCA9555 driver) (2016-07-31). + * I/O Expander Interface: Encode and extend I/O expander options to + include interrupt configuration (2016-07-31). + * drivers/ioexpander: Add an (untested) TCA64XX I/O Expander driver + leveraged from Project Ara (2016-07-31). + * I/O Expander Interface: Add argument to interrupt callback. Add a + method to detach the interrupt (2016-08-01). + * drivers/ioexpander: Add a GPIO lower-half driver that can be used to + register a GPIO character driver for accessing pins on an I/O expander + (2016-08-01). + * drivers/ioexpander: Add PCF8574 I/O Expander driver. Some cleanup + also of other expander drivers (2016-08-01). + * drivers/ioexpander: GPIO driver: Add IOCTLs to get the pin type and + to unregister a signal handler (2016-08-01). + * configs/sim: Add simulator-based test support for apps/examples/gpio + 2016-08-01). + * drivers/sensors: Add KXTJ9 Accelerometer driver from the Motorola + Moto Z MDK (2016-08-02). + * arch/arm/sim: Add a simulated I/O Expander driver (2016-08-03). + * configs/sim: Add logic to set the simulated I/O expander for testing + with apps/examples/gpio (2016-08-03). + * fs/fat: FAT performance improvement. In large files, seeking to a + position from the beginning of the file can be very time consuming. + ftell does lssek(fd, 0, SET_CURR). In that case, that is wasted time + since we are going to seek to the same position. This fix short- + circutes fat_seek() in all cases where we attempt to seek to current + position. Suggested by Nate Weibley (2016-08-03). + * tools/sethost.sh: Add sethost.sh. This is a script that you can use + to quickly change the host platform from Linux to Windows/Cygwin. + Might save you a lot of headaches (2016-08-03). + * arch/arm/src/tiva: Add tiva PWM lower-half driver implementation. + From Young (2016-08-05). + * drivers/spi/spi_transfer.c: Add a helper function that encapsulates + and manages a sequence of SPI transfers (2016-08-05). + * drivers/spi: Add an SPI character driver that will permit access to + the SPI bus for testing purposes. This driver is a simple wrapper + around spi_transfer() (2016-08-05). + * drivers/wireless: Add MFRC522 RFID ISO14443 and Mifare transceiver + driver. From Alan Carvalho de Assis (2016-08-06). + * configs/stm32f103-minimum: Add board support to MFRC522 driver. From + Alan Carvalho de Assis (2016-08-06). + * arch/renesas: Rename arch/sh to arch/renesas (2016-08-06). + * arch/arm/src/efm32, stm32, stm32l4: STM32 and EFM32 SPI drivers + adopted an incompatible conventions somewhere along the line. The + set the number of bits to negative when calling SPI_SETBITS which had + the magical side-effect of setting LSB first order of bit + transmission. This is not only a hokey way to pass control + information but is supported by no other SPI drivers. This change + three things: (1) It adds HWFEAT_LSBFIRST as a new H/W feature. + (2) It changes the implementations of SPI_SETBITS in the STM32 and + EFM32 derivers so that negated bit numbers are simply errors and it + adds the SPI_HWFEATURES method that can set the LSB bit order, and + (3) It changes all calls with negative number of bits from all + drivers: The number of bits is now always positive and SPI_HWFEATURES + is called with HWFEAT_LSBFIRST to set the bit order (2016-08-08). + * arch/arm/src/stm32: Add missing SPI2 and SPI3 support for STM32F3F3. + Add STM32F37XX DMA channel configuration. For STM32F37XX, + SYSCFG_EXTICR_PORTE defined twice. From Alan Carvalho de Assis + (2016-08-08). + * arch/arm/src/stm32: Make stm32_pwr_enablebkp thread safe. From + Max Neklyudov (2016-08-09). + * arch/arm/src/stm32: SAM3/4 GPIO: Enable peripheral clock for GPIO port + when GPIO is configured as input. The value of a GPIO input is only + sampled when the peripheral clock for the port controller the GPIO + resides in is enabled. Therefore we need to enable the clock even when + polling a GPIO. From Wolfgang Reissnegger (2016-08-09). + * arch/arm/src/tiva: Fix two bugs of tiva pwm lower-half driver + implementation. From Young (2016-08-10). + * sched/group: Explicitly initialize the group tg_exitsem with + sem_init(). The existing logic worked because the correct + initialization value is all zero, but it is better to initialize the + semaphore explicitly (2016-08-10). + * arch/arm/stm32: Fix bad pllmul values for STM32F1XX connectivity line. + STM32F1XX connectivity line supports only x4, x5, x6, x7, x8, x9 and + x6.5 values. From Michał Łyszczek (2016-08-11). + * include/nuttx/timers: Add oneshot timer lower half interface + (2016-08-11). + * arch/arm/src/stm32: Add a experimental oneshot, lower-half driver for + STM32 (2016-08-11). + * arch/arm/src/samv7: Add option to support oneshot timer without free- + running timer. Add oneshot lower half driver (2016-08-11). + * arch/arm/src/sama5: Add option to support oneshot timer without free- + running timer. Add oneshot lower half driver (2016-08-11). + * arch/arm/src/sam34: SAM4CM: Add option to support oneshot timer without + free-running timer. Add oneshot lower half driver (2016-08-11). + * arch/arm/src/stm32l4: Add oneshot lower half driver (2016-08-11). + * libc/stdlib: strtod() was not returning endptr on error conditions + (2016-08-11). + * libc/math: floor(), floorf(), and floorl(): Fix logic error. Was not + correctly handling negative integral value (2016-08-11). + * configs/sim: Add a configuration useful for testing Mini Basic + (2016-08-12). + * drivers/timers: Add an upper-half, oneshot timer character driver + (2016-08-12). + * arch/sim/src: Add a simulated oneshot lowerhalf driver (2016-08-12). + * arch/arm/src/stm32: STM32F3 SPI: Fix the number of bit setting for + the F3. That and data packing work differently on the STM32F3 than + for other STM32 parts (2016-08-12). + * arch/arm/stm32 and stm32l4: Enabling SPI DMA loses other bits in CR2 + (2016-08-13). + * arch/arm/src/stm32: STM32F3 SPI: Cannot write always 16-bit value to + DR register because of how the F3 implements data packing (2016-08-13). + * Kinetis: Add support for I2C and RTC. From v01d (phreakuencies) + (2016-08-13). + * teensy 3.x i2c. From v01d (phreakuencies) (2016-08-13). + * SH1106 0.96 OLED module support (SSD1306 compatible) + I2C fixes. + From v01d (phreakuencies) (2016-08-13). + * Add support for SAMV7 DACC module. From iotr Mienkowski (2016-08-15). + * Add oneshot board initialization to stm32f103-minimum. From Alan + Carvalho de Assis (2016-08-15). + * drivers/audio/tone.c: Add Audio Tone Generator for NuttX. From Alan + Carvalho de Assis (2016-08-16). + * configs/stm32f103-minimum: Add board configuration to initialize Audio + Tone Generator. From Alan Carvalho de Assis (2016-08-16). + * STM32F411 and STM32F446 map i2c2_sda_4 to different alternate function + numbers. From Konstantin Berezenko (2016-08-17). + * STM32 DMA Fix: Change stm32 adc dma callback to send channel number + instead of index. From Konstantin Berezenko (2016-08-17). + * SAMA5: Add missing oneshot max_delay method (2016-08-18). + * configs/stm32bufferfly2: Add support for the Kamami stm32butterfly2 + development board with optional ETH phy. From Michał Łyszczek + (2016-08-19). + * libc/misc: Separate XorShift128 PRNG from /dev/urandom and make it + generally available (2016-08-20). + * sched/sched_cpuload_oneshot: Use the oneshot timer with optional + entropy to measure cPU load if so configured (2016-08-20). + * drivers/usbhost/usbhost_composite.c: An an EXPERIMENTAL prototype of + how USB host support for composite devices might be implemented. This + feature is EXPERIMENTAL because (1) it is untested and (2) has some + know design issues that must be addressed before it can be of use + (2016-08-28). + * CXXFLAGS: Add -fcheck-new whenever -fno-exceptions is used. From Beat + Küng (2016-08-23). + * tools/mkfsdata.pl was still generating the old-style apps/include + inclusion paths (2016-08-23). + * drivers/sensors: Add drvier for the LIS3MDL 3 axis magnetometer. From + Alexander Entinger (2016-08-23). + * drivers/sensors: Add driver for the MLX90393 3 axis magnetometer. + From Alexander Entinger (2016-08-23). + * drivers/mtd: Add Fujistu MB85RS256B ramtron support. From Beat Küng + (2016-08-23). + * drivers/sensors: Add driver for the LIS3DSH 3 axis accelerometer. From + Alexander Entinger (2016-08-24). + * drivers/sensors: Add driver for the Bosch BMG160 3 axis gyroscope. + From Alexander Entinger (2016-08-24). + * STM32: Add IAR-style STM32F1xx vectors. Tested on STM32F103RB and + STM32F107RC. From Aleksandr Vyhovanec (2016-08-24). + * libc/header files: Add POSIX type sig_atomic_t. From Sebastien + Lorquet (2016-08-24). + * libc/header files: isatty() should be prototypes in unstid.h, not + termios.h. From Sebastien Lorquet (2016-08-24). + * Documentation: Update to NuttX C coding style document with additions + discussing long comments on the right side of a statement or data + definition (2016-08-24). + * LPC43xx serial: Fix typos in LPC43 serial driver. Found by Vytautas + Lukenskas (2016-08-24). + * libc/time: This commit adds the difftime() function. The function + depends on the toolchain-dependent CONFIG_HAVE_DOUBLE so is not + available on tiny platforms. From Sebastien Lorquet (2016-08-24). + * libc/stdio: Add support for remove(). From Sebastien Lorquet + (2016-08-25). + * STM32 OTGFS device: Fix for lost first word from FIFO + + 1) Do not overwrite Reserved Bits in GINTSTS (per ref manual)* + 2) Acknowledge all pending int on entry to ISR that are Only rc_w1* + 3) Do not disable RXFVL* + 4) Loop until RXFVL is cleared* + 5) Only clear the NAK on the endpoint on the + OTGFS_GRXSTSD_PKTSTS_SETUPDONE to not loose the first WORD of + FIFO all the data (Bug Fix) + + Changed marked *are just driver clean up and ensure ints are not lost. + The bug fix is #5 + + Test case open putty and observer the Set/Get LineCoding. Without this + fix #5 the Get will not match the Set, and in fact the data might be + skewed by 4 bytes, that are lost from the FIFO if the + OTGFS_DOEPCTL0_CNAK bit is set in the OTGFS_GRXSTSD_PKTSTS_SETUPRECVD + as opposed to the OTGFS_GRXSTSD_PKTSTS_SETUPDONE + + Set Line Coding DATA1: 4B | 00 c2 01 00 00 00 08 | c8 1B + Get Line Coding DATA1: 4B | .. .. .. .. 00 00 08 c8 .. 00 00 07 | 7a 72 + + From David Sidrane (2016-08-25). + * Add system() to stdlib.h. Actual implementation is in + apps/system/system (2016-08-25). + * include/nuttx/input: Add missing prototype for btn_lower_initialize() + (2016-08-27). + * configs/stm32f103-minimum: Add board config support to SPI LCD module + JLX12864G-086. From Alan Carvalho de Assis (2016-08-28). + * net/tcp: tcp_ipvX_bind() not actually using the ported selected with + port==0. Also removes duplicate call to pkt_input(). Issues noted by + Pascal Speck (2016-08-30). + * STM32 F7: Remove duplicate call to pkt_input from Ethernet driver. + Issues noted by Pascal Speck (2016-08-30). + * STM32L4 OTGFS device: Apply stm32 fix to stm32l4. From Sebastien + Lorquet (2016-08-31). + * drivers/contactless: Remove contactless drivers from drivers/wireless + to drivers contactless. From Sebastien Lorquet (2016-08-31). + * USB host composite is at least partially functional. No longer depends + on CONFIG_EXPERIMENTAL (2016-09-02). + * MTD: Fixed cloned typos in several FLASH drivers. From Aleksandr + Vyhovanec (2016-09-02). + * MTD: SPI-based driver for Macronix MX25L3233F or MX25L6433F. From + Aleksandr Vyhovanec (2016-09-02). + * sched/: The TCB nchildren field should not be incremented when + pthreads are created (2016-09-06). + * sched/: Move fields related to parent/child task relationship out of + TCB into group structure (2016-09-06). + * STM32L4: Add support for USART3-USART5. For STM32L4 parts, the higher + number USART ports supported varies. Add the HAVE_USARTx definitions + to the configuration to allow enabling the higher numbered USART ports. + From Jim Wylder (2016-09-15). + * configs/stm32l476-mdk: Support basic booting and nsh on Motorola MDK. + The Motorola MDK is based off of an earlier version of NuttX. This + only provides a basic NSH shell. From Jim Wylder (2016-09-15). + * STM32 USB: Set USB address to avoid a failed assertion. From Pierre-noel + Bouteville (2016-09-15). + * STM32 L4 and L7 USB: Pierre's assertion-avoidance change should also be + applied to STM32 F7 and L4 (2016-09-15). + * sched/: mq_send() was not setting the errno value on certain failures + to allocate a message (2016-09-15). + * include/nuttx/modem: Move all modem-related IOCTL commands to a common + file to assure that they will be unique (2016-09-16). + * STM32 F4 Discovery: Add support for XEN1210 3D-board. From Alan + Carvalho de Assis (2016-09-17). + * drivers/sensors: Adds support for the Sensixs XEN1210 3D-board. This + sensor is used on NANOSATC-BR2 a Brazillian CUBESAT project. From + Alan Carvalho de Assis (2016-09-16). + * include/analog/dac.h: Make DAC structure packed. From Marc Rechté + (2016-09-20). + * All SAM Ethernet Drivers: Add support so that the drivers can be built + with CONFIG_NET_MULTIBUFFER=y (2016-09-20). + * Tiva Ethernet: Needs support for CONFIG_NET_MULTIBUFFER=y (2016-09-20). + * drivers/net: NET_TUN=y => NET_MULTIBUFFER=y. From Vladimir + Komendantskiy (2016-09-20). + * SAM3/4: Fix GPIO pull-up/down code. Enabling the pull-down resistor + while the pull-up resistor is still enabled is not possible. In this + case, the write of PIO_PPDER for the relevant I/O line is discarded. + Likewise, enabling the pull-up resistor while the pull-down resistor + is still enabled is not possible. In this case, the write of PIO_PUER + for the relevant I/O line is discarded. From Wolfgang Reißnegger + (2016-09-20). + * SAM GPIO: Apply Wolfgang's change for SAM3/4 to SAMA5 and SAMV7 + (2016-09-20). + * Tiva QEI: Add QEI lower-half driver impl. for Tiva series chip. From + Young (2016-09-21). + * STM32, L4, and F7: Remove GPIO_ETH_RMII_TX_CLK. TX_CLK is not present + in RMII. Mateusz Szafoni (2016-09-22). + * sched/: Define 'group' even if HAVE_GROUPID is not set. From Mateusz + Szafoni (2016-09-22). + * sched/: vector table should have dimension NR_IRQS, not NR_IRQS+1. + From Sagitta Li (2016-09-22). + * fs/mount: Corrects a bad assertion noted by Pierre-noel Bouteville. + Also fixes a reference counting problem in an error condition: When + the mountpoint inode is found but is not an appropriate mountpoint, + the reference count on the inode was not being decremented (2016-09-22). + * libnx/nxglib: Fix handling of near-horizontal lines of width 1 in + nxgl_splitline(). Missing handling for degenerate condition caused + width 1 lines such as (0, 0) - (100, 10) to have gaps in the drawing. + From Petteri Aimonen (2016-09-22). + * drivers/net/slip.c: Fix calculations using MSEC_PER_TICK. If + USEC_PER_TICK is less than 1000, then MSEC_PER_TICK will be zero. It + will be inaccurate in any case (2016-09-25). + * Tiva QEI: Add a new ioctl command (set MAXPOS) for tiva QEI. From + Young (2016-09-26). + * LPC43xx Serial: There are some small problems in LPC43xx RS485 mode + configuration. In particular: (1) UART0,2,3 do not have DTR pins + (different from UART1), so, Kconfig needs to be adjusted. (2) + lpc43_uart.c in RS485 mode only configures DIR pin, but doesn't enable + pin output for UART0,2,3. (3) should be option to reverse DIR control + pin output polarity. (4) lpc43xx/chip/lpc43_uart.h doesn't have USART3 + definitions. NOTE: I didn't modified and didn't tested USART1, as it + has different hardware. From Vytautas Lukenskas. From Vytautas + Lukenskas (2016-09-30). + * STM32 Ethernet: Correct typo in conditional logic. From Neil Hancock + (2016-10-01). + * sched/pthread and task: When a pthread is started, there is a small + bit of logic that will run on the thread of execution of the new + pthread. In the case where the new pthread has a lower priority than + the parent thread, then this could cause both the parent thread and + the new pthread to be blocked at the priority of the lower priority + pthread (assuming that CONFIG_PRIORITY_INHERITANCE is not selected). + This change temporarily boosts the priority of the new pthread to at + least the priority of the new pthread to at least the priority of the + parent thread. When that bit of logic has executed on the thread of + execution of the new pthread, it will then drop to the correct + priority (if necessary) before calling into the new pthread's entry + point (2016-10-01). + * configs/stm32f103-minimum: Add stm32_bringup support and userled + example to STM32F103 Minimum board. From Alan Carvalho de Assis + (2016-10-02). + * STM32 L4: Add support for quadrature encoders on STM32L4. Sebastien + Lorquet (2016-10-02). + * configs: Add support for qencoders on various nucleo boards. From + Sebastien Lorquet (2016-10-03). + * STM32 L4 USB Device: Fixed L4 USB Driver by avoiding SETUPDONE and + EPOUT_SETUP. From David Sidrane (2016-10-04). + * configs/olimex-stm32-e407: Add some networking configurations. From + Mateusz Szafoni (2016-10-06). + * STM32 SPI: stm32_modifycr2 should be available on all platforms if DMA + is enabled. (2016-10-06). + * STM32 DMA2D: Fix an error in up_dma2dcreatelayer where an invalid + pointer was returned when a certain underlying function failed. From + Jens Gräf (2016-10-07). + +7.19 2016-12-26 Gregory Nutt + + * include/nuttx/fs/nxffs.h: Needs forward reference to struct mtd_dev_s + and needs to include stdbool.h (2016-10-09). + * STM32F103 Minimum: Note in Kconfig that the board supports buttons. + From Alan Carvalho de Assis (2016-10-11). + * STM32F103 Minimum: Add button support. From Alan Carvalho de Assis + (2016-10-11). + * arch/arm/kinetis and configs/freedom-k64f: Add UID Unique ID. From + Neil Hancock (2016-10-13). + * arch/arm/src/stm32l4: (1) too many parentheses when calculating max + chan count and (2) channel 4 does not have a complementary output. From + Sebastien Lorquet (2016-10-14). + * arch/arm/src/stm32l4: Support Complementary PWM outputs on STM32L4. + From Sebastien Lorquet (2016-10-14). + * Support PWM testing on board nucleo-l476. From Sebastien Lorquet + (2016-10-14). + * arch/arm/src/stm32: Support oversampling by 8 for the STM32 F4. + From David Sidrane (2016-10-15). + * libc/stdio: Fixes sscanf %sn where strlen(data) < n. From David + Sidrane (2016-10-15). + * arch/risc-v: Add support for the RISC-V architecture and + configs/nr5m100-nexys4 board. I will be making the FPGA code for + this available soon (within a week I would say). The board support on + this is pretty thin, but it seems like maybe a good idea to get the base + RISC-V stuff in since there are people interested in it. From Ken + Pettit (2016-10-16). + * C library: Add a dummy setlocale() function to avoid drawing the + function from newlib (2016-10-17). + * libc/wchar: Add wcslen, wmemchr, wmemcmp, wmemcpy and wmemset to NuttX. + From Alan Carvalho de Assis (2016-10-17). + * syscalls: Add setlocale to libc.csv (2016-10-17). + * libc/locale: Add clocale header file (2016-10-18). + * libc/wchar: Add functions btowc, mbrtowc, mbtowc, wcscmp, wcscoll, + wmemmove. From Alan Carvalho de Assis (2016-10-18). + * usbhost/enumerate: Fix possible buffer overwrite. From Janne Rosberg + (2016-10-18). + * configs/Board.mk: Add extra clean operations (2016-10-18). + * usbhost/composite: Fix compile; missing semicolons. From Jann + Rosberg (2016-10-18). + * libc/stdio: Include wchar.h in lib_libvsprintf.c to fix compilation + error. From Alan Carvalho de Assis (2016-10-18). + * arch/arm/src/kinetis: Added missing headers. From David Sidrane + (2016-10-18). + * arch/arm/src/kinetis: Kinetis broke out SPI to kinetis/kinetis_spi.h. + From David Sidrane (2016-10-18). + * arch/arm/src/kinetis: Broke out DMA to use the modern Nuttx chip + inclusion - still STUBS. From David Sidrane (2016-10-18). + * arch/arm/src/kinetis: Kinetis Support ARMV7 Common Vector and FPU. + From David Sidrane (2016-10-18). + * arch/arm/src/kinetis: Kinetis Allow CONFIG_ARMV7M_CMNVECTOR, + CONFIG_STACK_COLORATION, CONFIG_ARCH_FPU. From David Sidrane + (2016-10-18). + * arch/arm/src/kinetis: Kinetis i2c driver offset swapped for value + in kinetis_i2c_putreg. From David Sidrane (2016-10-18). + * Add functions wcrtomb, wcslcpy, wcsxfrm, wctob, wctomb, wctype, + localeconv, strcoll, strxfrm. From Alan Carvalho de Assis + (2016-10-18). + * libc/wctype: Add wctype.h; Move lib_wctype.c to libc/wctype. + From Alan Carvalho de Assis (2016-10-18). + * include/: Modify locale.h to add localeconv() and lconv structure. + From Alan Carvalho de Assis (2016-10-18). + * include/sys/time.h: timersub macro modified per recommendations of + phreakuencies (2016-10-18). + * include/: Add isblank() macro to ctype.h. From Alan Carvalho de + Assis (2016-10-19). + * libc/wctype: Add iswctype, towlower, towupper and wcsftime functions. + From Alan Carvalho de Assis (2016-10-19). + * syslog: Fixes required for file syslog output. From Max Kriegleder + (2016-10-19). + * arch/arm/src/stm32: Add TIM8 to STM32F103V pinmap. From Maciej Wójcik + (2016-10-19). + * libc/locale: Allows c++ code to compile with or without + CONFIG_LIBC_LOCALE and will generate a link error if CONFIG_LIBC_LOCALE + is not defined and setlocale is referenced. With CONFIG_LIBC_LOCALE + defined setlocale will act as if MB string is not supported and return + "C" for POSIX. C and "". From David Sidrane (2016-10-19). + * Xtensa ESP32: Add vectors for interrupt levels 2-6 (2016-10-20). + * strtof(): Add strtof() as simply a copy of strtod with types and + limits changed (2016-10-20). + * arch/arm/src/stm32v7: Register the watchdog device at the configured + device path CONFIG_WATCHDOG_DEVPATH vs. hard-coded /dev/wdt. From Frank + Benkert (2016-10-21). + * configs/*/defconfig: The buttons example was changed to archbuttons. As + a result all of the button configurations are broken and need some + renaming in the defconfig files. Noted by Frank Berkert (2016-10-21). + * configs/stm32f103-minimum: Add support to PWM on STM32F103-Minimum + board. From Alan Carvalho de Assis (2016-10-21). + * include/ctype.h and cxx/cctype: Implement ctype.h functions as inline + if possible. cctype can then properly select namespace (2016-10-22). + * libc/unisted: Add strtold() (2016-10-22). + * sscanf: Use strtof() instead of strtod() if a short floating point + value was requested. The should help performance with MCUs with 32-bit + FPU support with some additional code size (2016-10-22). + * Remove support for software prioritization of interrupts (2016-10-23). + * drivers/net/tun.c: Fix bug in TUN interface driver. From Max + Nekludov (2016-10-24). + * arch/arm/src/stm32: A new implementation of the STM32 F4 I2C bottom + half. The commin I2C as this did not handled correctly in the current + implementation (see also https://github.com/PX4/NuttX/issues/54). The + changes almost exclusively affect the ISR. From Max Kriegleder + (2016-10-24). + * arch/arm/src/stm32l4: Fix I2C devices RCC registers. From Sebastien + Lorquet (2016-10-25). + * arch/arm/src/stm32l4: Enable and renames for 32l4 UARTs 4 and 5. + From Sebastien Lorquet (2016-10-25). + * configs/stm32f103-minimum: Fix Timers 2 to 7 clock frequencies. + From Alan Carvalho de Assis (2016-10-25). + * arch/arm/src/stm32: Initial implemention of the STM32 F37xx SDADC + module. There are also changes to ADC, DAC modules. SDADC has only been + tested in DMA mode and does not support external TIMER triggers. This + is a work in progress. From Marc Rechté (2016-10-25). + * Add logic to attach peripheral interrupt sources to CPU interrupts + (2016-10-25). + * CHxN channels are always outputs. From Sebastien Lorquet + (2016-10-26). + * sched/semaphore: Within the OS, when a thread obtains a semaphore + count it must call sem_addholder() if CONFIG_PRIORITY_INHERITANCE is + enabled. If a count is available, then sem_wait() calls + sem_addholder(), otherwise it waited for the semaphore and called + sem_addholder() when it eventually received the count. + + This caused a problem when the thread calling sem_wait() was very + low priority. When it received the count, there may be higher + priority threads "hogging" the CPU that prevent the lower priority + task from running and, as a result, the sem_addholder() may be + elayed indefinitely. + + The fix was to have sem_post() call sem_addholder() just before + restarting the thread waiting for the semaphore count. + + This problem was noted by Benix Vincent who also suggested the + solution (2016-10-26). + * configs/stm32f103-minimum: Add RGB LED support on STM32F103 Minimum + board. From Alan Carvalho de Assis (2016-10-26). + * arch/arm/src/stm32f7: stm32_i2c.c Dejavu. Fixes a bug previously + found in the F4. From David Sidrane (2016-10-26). + * arch/arm/src/stm32f7: stm32f76xx77xx_pinmap.h Missed one. From + David Sidrane (2016-10-26). + * LPC43xx serial: Fix a typo in ioctl TIOCSRS485 ioctl. From Vytautas + Lukenskas (2016-10-27). + * sched/clock: Correct clock initialization. The correct range for + the month is 0-11 but is entered as 1-12 in the .config file + (2016-10-27). + * arch/*/include: Add architecture-specific inttypes.h. From Paul + A. Patience (2016-10-27). + * sched/Kconfig: Add ranges to START_YEAR, MONTH, and DAY (2016-10-28). + * configs/nucleo-f303re: Add STM32 F303RE hello configuration; remove + duplicate setting from board.h. From Marc Rechté (2016-10-18). + * arch/arm/src/lpc43xx: Restore RS485 mode on serial port open (if + RS485 is enabled via menuconfig). From Vytautas Lukenskas (2016-10-28). + * arch/arm/src/stm32f7: otgdev fixed typo. From David Sidrane + (2016-10-28). + * arch/xtensa: Basic architectural support for Xtensa processors and + the Expressif. ESP32 added. Totally untested on initial release + (2016-10-31). + * configs/esp32-core: Basic support for Expressif ESP32 Core v2 board + added. The initial release includes an NSH and an SMP test + configuration. Totally untested on initial relesae (2016-10-31). + * configs/bambino-200e: Add basic support to Micromint Bambino 200E + board. This includes contributions from Jim Wolfman. From Alan + Carvalho de Assis (2016-11-01). + * drivers/mtd/at24xx.c: Added EEPROM timeout. Fromo Aleksandr + Vyhovanec (2016-11-02). + * arch/misoc: Adds basic support for the Misoc procoessors and the + LM32 in particular. From Ramtin Amin (2016-11-01). + * configs/misoc. Board support for testing Misoc LM32 with Qemu. + From Ramtin Amin (2016-11-01). + * arch/arm/src/stm32: I think, that Size is (highest address+1 - Base + address). Base address has been removed and if address+count >= size + we are outside of the Flash. From David Sidrane (2016-11-01). + * sched/semaphore, sched/phread/, libc/semaphore, libc/pthread: Add + pthread_mutexattr_get/set_protocol and non-standard sem_get/set_protocol. + These may use to enable or disable priority inheritance on a single + semaphore (2016-11-02). + * arch/arm/src/stm32: Fix ADC compilation error when DMA isn't enabled. + From Paul A. Patience (2016-11-02). + * drivers/ and drivers/spi: Fix Kconfig warning. This commit moves the + ARCH_HAVE_SPI options outside the check for SPI. Those options don't + depend on SPI, and Kconfig files in arch/ enable them even if SPI + isn't enabled. Source the driver's Kconfig in drivers/Kconfig only + if support for the driver is enabled prevents us from defining these + ARCH_HAVE options in the driver's Kconfig. We should probably remove + the other checks in drivers/Kconfig and check if the drivers are + enabled only in their Kconfig. From Paul A. Patience (2016-11-02). + * Move protoypes for the non-standard include/semaphore.h file to the + non-standard include/nuttx/semaphore.h with the other non-standard + semaphore interfaces (2016-11-02). + * include/semaphores.h: Provide macros for sem_setprotocol() and + sem_getprotocol() if priority inheritance is not enabled. More + SEM_PRIO_* definitions to include/nuttx/semaphore.h (2016-11-02). + * drivers/serial.c: Make sure that priority inheritance is not + enabled for the signaling semaphores used in the serial driver + (2016-11-03). + * arch/arm/src/stm32f7: Fix to SPI-Master driver. Without this the + chip select decoding feature will not work properly. From Michael + Spahlinger (2016-11-03). + * drivers/, net/, fs/, sched, arch/, graphics/, libnx,: Disable + priority inheritance on all semaphores used for signaling (2016-11-03). + * sched/semaphore: Handle a case of missing proxy for sem_setprotocol. + Reorder so that (1) this error is avoided, and (2) >No proxy is needed + if priority inheritance is not enabled (2016-11-03). + * config/*/defconfgs: More fallout from name change of + apps/examples/buttons to archbuttons (2016-11-03). + * configs/nucleo_f303re: Various fixes to get the adc configuration + building again after PR. Refresh all configurations (2016-11-03). + * arch/misoc/src/common: Add interrupting Misoc serial driver. From + Ramtin Amin (2016-11-04) + * Fix a number of header files with mismatched 'extern C {' and '}' + (2016-11-05). + * Provide do-nothing stubs for mutex attribute interfaces if features + ot enabled. pthread_cond includes a signaling semaphore and should + call sem_setprotocol (2016-11-05). + * arch/arm/src/armv7-r: Fix compilation error. This commit fixes + compilation errors on MPU support for ARMv7-R. From Heesub Shin + (2016-11-06). + * arch/arm/src/armv7-r: Fix invalid drbar handling. In ARMv7-R, + [31:5] bits of DRBAR is physical base address and other bits are + reserved and SBZ. Thus, there is no point in passing other than the + base address. From Heesub Shin (2016-11-06). + * arch/arm/src/armv7-r: Remove the redundant update on SCTLR. + mpu_control() is invoking cp15_wrsctlr() around SCTLR update + redundantly. From Heesub Shin (2016-11-06). + * arch/arm/src/armv7-r: Add new Kconfig entries for d/i-cache. + Unlike in ARMv7-A/M, Kconfig entries for data and instruction caches + are currently missing in ARMv7-R. This commit adds those missing + Kconfig entries. Actual implmenetation for those functions will be + added in the subsequent patches. From Heesub Shin (2016-11-06). + * arch/arm/src/armv7-r: Add cache handling functions. This commit + adds functions for enabling and disabling d/i-caches which were + missing for ARMv7-R. From Heesub Shin (2016-11-06). + * arch/arm/src/armv7-r: Fix typo in mpu support. s/ARMV7M/ARMV7R/g. + From Heesub Shin (2016-11-06). + * arch/arm/src/armv7-r: Fix CPSR corruption after exception handling. + A sporadic hang with consequent crash was observed when booting. It + seemed to be caused by the corrupted or wrong CPSR restored on return + from exception. NuttX restores the context using code like this: + + msr spsr, r1 + + GCC translates this to: + + msr spsr_fc, r1 + + As a result, not all SPSR fields are updated on exception return. + This should be: + + msr spsr_fsxc, r1 + + On some evaluation boards, spsr_svc may have totally invalid value at + power-on-reset. As it is not initialized at boot, the code above may + result in the corruption of cpsr and thus unexpected behavior. + + From Heesub Shin (2016-11-06). + * arch/arm/src/armv7-r: Fix to restore the Thumb flag in CPSR. Thumb + flag in CPSR is not restored back when the context switch occurs while + executing thumb instruction. From Heesub Shin (2016-11-06). + * sched/wqueue: When queuing new LP work, don't signal any threads + if they are all busy. From Heesub Shin (2016-11-06). + * sched/wqueue: Signal sent from work_signal() may interrupt the low + priority worker thread that is already running. For example, the worker + thread that is waiting for a semaphore could be woken up by the signal + and break any synchronization assumption as a result. It also does not + make any sense to send signal if it is already running and busy. This + commit fixes it. From Heesub Shin (2016-11-06). + * arch/arm/src/stm32f7: STM32F7 SD/MMC driver depends on + CONFIG_SDIO_DMA which is only defined in stm32/Kconfig. Changed to + CONFIG_STM32F7_SDMMC_DMA and defined in stm32f7/Kconfig (2016-11-07). + * arch/arm/src/stm32: Add PWM driver support for STMF37xx. The + changes have been tested successfuly for TIM4 and TIM17 (different + IPs). From Marc Rechté (2016-11-07). + * sched/semaphore: sem_trywait() no longer modifies the errno value + UNLESS an error occurs. This allows these functions to be used + internally without clobbering the errno value. From Freddie Chopin + (2016-11-09). + * arch/arm/src/stm32l4: Change the way to configure quadrature encoder + prescalers. From Sebastien Lorquet (2016-11-09). + * libc/unisted: Patch brings strtol() and related functions more + conformant with POSIX. Corner cases like strtol(-2147483648, NULL, 10) + now pass clang -fsanitize=integer without warnings. From Juha Niskanen + (2016-11-10). + * drivers/sensors and configs/stm32f103-minimum: Add Vishay VEML6070 + driver and support for STM32F103-Minimum board. From From Alan + Carvalho de Assis(2016-11-13). + * Misoc LM32: Corrects a bug that never occured in qemu on simulation or + real fpga. The error was that the r1 register was being modified out of + context switching and not restoring it. From Ramtin Amin (2016-11-14) + * arch/arm/src/samv71: A problem occurred with the SAMV7 USBDEVHS driver + if the USB cable is unplugged while a large amount of data is send over + an IN endpoint using DMA. If the USB cable is plugged in again after a + few seconds it is not possible to send data over this IN endpoint again, + all other endpoints work as expected. + + The problem occurs because if the USB cable is unplugged while an DMA + transfer is in flight the transfer is canceled but the register + SAM_USBHS_DEVDMACTRL is left in an undefined state. The problem was + fixed the problem by resetting the register SAM_USBHS_DEVDMACTRL to a + known state. Additionally all pending interrupts are cleared. + + From Stefan Kolb (2016-11-14). + * configs/esp32-core: ESP32 Core v2: Add configuration to supporting + linking NuttX for execution out of IRAM (2016-11-14). + * libc/unistd: sleep() was returning remaining nanoseconds (kind of), + instead the remaining seconds. From Eunbong Song (2016-11-15). + * sched/irq: Fixes for the SMP case: (1) Change order for SMP case in + enter_critical_section: (1) Disable local interrupts BEFORE taking + spinlock and (2) If SMP is enabled, if any interrupt handler calls + enter_critical_section(), it should take the spinlock. (2016-11-15). + * arch/xtensa: Add EXPERIMENTAL hooks to support lazy Xtensa co- + processor state restore in the future (2016-11-16). + * Add some experimental changes to enter/leave_critical_section to + deal with the case where interrupts are disabled only on the local + CPU (2016-11-16). + * sched/irq: Add logic to handled nested calls to + enter_critical_section() from interrupts handlers (with SMP) + (2016-11-16). + * drivers/timer: Remove the timer driver TIOC_SETHANDLER IOCTL call. + This calls directly from the timer driver into application code. That + is non-standard, non-portable, and cannot be supported (2016-11-17). + *drivers/timer: Add timer driver hooks to support signal notification + of timer expiration. Commented out because invasive interface changes + would also be required to complete the implementation (2016-11-17). + * arch/arm/src/armv7-m: Fix double allocation of MPU region in mmu.h + (2016-11-17). + * timer driver: Use signal to notify of timer expiration. Add generic + argument so that there can be additional usage. From Sebastien Lorquet + (2016-11-17). + * All timer lower half drivers. Port Sebastien's changes to all all + other implementations of the timer lower half. Many changes and + untested. Expect some problems. (2016-11-17). + * sched/irq: irq_csection() has a bad assumption in the SMP case. It + assumed that the state of certain variables. That was true on entry + into the interrupt handler, but might change to the execution of logic + within the interrupt handler (2016-11-18). + * config/ nucleo-l476rg: Add support for timers to nucleo l476. From + Sebastien Lorquet (2016-11-18). + * drivers/net: Add option to use low-priority work queue to all drivers + in drivers/net. Not yet added to all architecture-specific network + drivers (2016-11-18). + * sched/wdog: Most interrupt handling logic interacts with tasks via + standard mechanism such as sem_post, sigqueue, mq_send, etc. These all + call enter_critical_section and are assumed to be safe in the SMP case. + + But certain logic interacts with tasks in different ways. The only one + that comes to mind are wdogs. There is a tasking interface that to + manipulate wdogs, and a different interface in the timer interrupt + handling logic to manage wdog expirations. + + In the normal case, this is fine. Since the tasking level code calls + enter_critical_section, interrupts are disabled an no conflicts can + occur. But that may not be the case in the SMP case. Most + architectures do not permit disabling interrupts on other CPUs so + enter_critical_section must work differently: Locks are required to + protect code. + + So this change adds locking (via enter_critical section) to wdog + expiration logic for the case if the SMP configuration + (2016-11-18). + * SAM3/4: Add delay between setting and clearing the endpoint RESET bit + in sam_ep_resume(). We need to add a delay between setting and + clearing the endpoint reset bit in SAM_UDP_RSTEP. Without the delay the + USB controller will (may?) not reset the endpoint. If the endpoint is + not being reset, the Data Toggle (DTGLE) bit will not to be cleared + which will cause the next transaction to fail if DTGLE is 1. If that + happens the host will time-out and reset the bus. Adding this delay + may also fix the USBMSC_STALL_RACEWAR in usbmsc_scsi.c, however this + has not been verified yet. From Wolfgang Reißnegger (2016-11-18). + * SAM3/4: Remove unused 'halted' flag in UDP driver. From Wolfgang + Reißnegger (2016-11-18). + * SAM3/4: Remove 'stalled' flag in UDP driver. The flag is not necessary. + The state of the endpoint can be determined using 'epstate' instead. + From Wolfgang Reißnegger (2016-11-18). + * USBMSC: Fix length of mode6 sense reply packet. From Wolfgang + Reißnegger (2016-11-18). + * configs/dk-tm4c129x: Typo fix. From Wolfgang Reißnegger (2016-11-18). + * Typo fix in sam_udp.c. From Wolfgang Reißnegger (2016-11-18). + * STM32: STM32F303xB and STM32F303xC chips have 4 ADCs. From Paul A. + Patience (2016-11-19). + * vfork(): Fix a race condition in the SMP case. Existing logic + depended on the fact that the child would not run until waitpid was + called because the child had the same priority as the parent. BUT + in the SMP case that is not true... the child may run immediately on + a different CPU (2016-11-19). + * arch/: Add option to use low-priority work queue to all Ethernet + drivers in arch that support CONFIG_NET_NOINTS (2016-11-19). + * sched/clock: Correct calculation for the case of Tickless mode with + a 32-bit timer. In that case, the calculation was returning + millisecond accuracy. That is not good when the timer accuracy is < 1 + msec. From Rajan Gill (2016-11-19). + * sched/task: task_restart() test not supported on SMP systems. This is + not fully implemented (2016-11-19). + * This commit adds a new internal interfaces and fixes a problem with + three APIs in the SMP configuration. The new internal interface is + sched_cpu_pause(tcb). This function will pause a CPU if the task + associated with 'tcb' is running on that CPU. This allows a different + CPU to modify that OS data stuctures associated with the CPU. When the + other CPU is resumed, those modifications can safely take place. The + three fixes are to handle cases in the SMP configuration where one CPU + does need to make modifications to TCB and data structures on a task + that could be running running on another CPU. Those three cases are + task_delete(), task_restart(), and execution of signal handles. In + all three cases the solutions is basically the same: (1) Call + sched_cpu_pause(tcb) to pause the CPU on which the task is running, + (2) perform the necessary operations, then (3) call up_cpu_resume() to + restart the paused CPU (2016-11-20). + * task_restart: Make sure new task starts with pre-emption disabled and + not in a critical section (2016-11-21). + * Fix a typo in a spinlock macro (2016-11-21). + * Spinlocks: Added capability to provide architecture-specific memory + barriers. This was for i.MX6 but does not help with the SMP problems. + It is still a good feature (2016-11-21). + * Remove a assertion condition that appears to rarely cause false-alarm + assertions. Teported by Petteri Aimonen (2016-11-21). + * The examples/qencoder app was trying to init the encoder by a direct + call into the board, cheating in a local header to declare the normally + unavailable function prototype. From Sebastien Lorquet (2016-11-22). + * configs: All QE encoder files. Last change made timer hard-coded to 3. + Make configurable (2016-11-22). + * configs: Remove all traces of the no-longer existent ARCHBUTTONS + example. Remove all button configurations that depended on the + obsoleted ARCHBUTTON example (2016-11-22). + * nucleo-l476rg: Add better selection of timer (2016-11-22). + * implementation of dumpgpio for stm32l4, was required for pwm debug. + From Sebastien Lorquet (2016-11-22). + * SMP: Add logic to avoid a deadlock condition when CPU1 is hung waiting + for g_cpu_irqlock and CPU0 is waitin for g_cpu_paused (2016-11-22). + * Misoc: Add timer driver. From Ramtin Amin (2016-11-22). + * Misoc: Add commits and warnings about missing caculation of the timer + reload value (2016-11-22). + * SAM3/4: Name of method is now setcallback, not sethandler (2016-11-22). + * sam4s-xplained-pro/nsh: Configuration uses old, improper timer interface. + CONFIG_TIMER disabled in configuration. (2016-11-22). + * sam4s-xplained-pro: Remove obsolete timer initialization logic + (2016-11-22). + * Misoc LM32: Make system timer configurable via CONFIG_USEC_PER_TICK. + From Ramtin Amin (2016-11-23). + * LPC43xx: Add timer driver; configs/bambino-200e: Add support for timer + driver. From Alan Carvalho de Assis (2016-11-23). + * SMP: Fix backward condition in test (2016-11-23). + * ARMv7-A SMP: Add a little logic to signal handling (2016-11-24). + * Misoc LM32: Add signal handling logic. From Ramtin Amin (2016-11-24). + * SMP: Add spin_trylock(). Use this in conditions where other CPUs need + to stopped but we cannot call enter_critical_section (2016-11-24). + * Fix for F1 RTC Clock, tested on F103. From Maciej Wójcik (2016-11-25). + * SMP: Fix yet another potential deadlock (2016-11-25). + * Enable CONFIG_RTC in the hymini-stm32v/nsh2 (kitchensink) config. + From Maciej Wójcik (2016-11-26). + * This adds support for keeping i.MX6 inter-processor communication data + in a non-cached address region (2016-11-26). + * i.MX6: Disable non-cached region support. Add SCU register definitions + (2016-11-26). + * i.MX6: Add some controls to enable SMP cache coherency in SMP mode + (2016-11-26). + * ARMv7-A: Fix some SCU SMP logic (2016-11-26). + * ARMv7-A/i.MX6: Modify handling of the SMP cache coherency + configuration so that it is identical to the steps from the TRM. + Makes no differenct, however (2016-11-27). + * The Smoothie project needs to compile C++ inside config/boardname/src/ + to use with High Priority Interruption, then I modified the board + configs Makefile to support it. It works fine for the first time + compilation, but if we execute "touch config/boardname/src/Pin.cxx" + and execute "make" it will not detect that Pin.cxx was modified. I + think there is some other place I should modify, but I didn't find + it. From Alan Carvalho de Assis (2016-11-27). + * ARMv7-A/i.MX6 SMP: Move SMP coherent cache setup to earlier in + initialization of CPUn, n>0 (2016-11-27). + * ARMv7 GIC: SGIs are non-maskable but go through the same path as other, + maskable interrupts. Added logic to serialize SGI processing when + necessary (2016-11-27). + * sched_note: Extend OS instrumentation to include some SMP events + (2016-11-27). + * sched_note: Add spinlock instrumentation; In SMP configurations, + select to log only notes from certain CPUs (2016-11-28). + * Misoc LM3: Add Misoc Ethernet driver. Integrate network support into + configs/misoc/hello. Remove configs/misoc/include/generated directory. + I suppose the intent now is that this is a symbolic link? DANGER! + This means that you cannot compile this code with first generating + these files a providing a symbolic link to this location! From Ramtin + Amin (2016-11-28). + * Add tools/showsize.sh (2016-11-28). + * configs/misoc: Add a sample directory containing generated sources. + This is really only useful for performing test builds. You really + must generate the Misoc architecture for a real-life build. From + Ramtin Amin (2016-11-28). + * sched_note: Permit spinlock and critical section notes in in-memory + buffer iff sched_not_get() interfaces is disabled (2016-11-28). + * STM32 DAC: Fix shift value whenever there are is a DAC2 and, hence, + up to three interfaces. From Marc Rechté (2016-11-29). + * Back out a debug change that was included in commit (2016-11-29). + * i.MX6: Don't output the alphabet if CONFIG_DEBUG_FEATURES is not set + (2016-11-29). + * Misoc LM32: Add logic to flush/invalidate caches. From Ramtin Amin + (2016-11-29). + * drivers/net/: Adapt all Ethernet drivers to work as though + CONFIG_NET_MULTIBUFFER were set. Remove all references to + CONFIG_NET_MULTIBUFFER (2016-11-29). + * stm32_otghshost: if STM32F446 increase number of channels to 16. From + Janne Rosberg (2016-11-30). + * usbhost_composite: Fix end offset in usbhost_copyinterface(). From + Janne Rosberg (2016-11-30). + * usbhost_cdcacm: Add CDC_SUBCLASS_ACM and CDC_PROTO_ATM to supported + class and proto. From Janne Rosberg (2016-11-30). + * LPC43 SD/MMC: Correct some git definitions on SMMC control register + in lpc43_sdmmc.h. From Alan Carvalho de Assis (2016-11-30). + * STM32L4: Correct USART1/2 definitions. Use default mbed UART4 + settings. From Sebastien Lorquet (2016-12-01). + * boardctl: Add new boardctl() command ,BOARDIOC_NX_START, to start the + NX server as a kernel thread (2016-12-01). + * GPDMA driver for the LPC43xx. The GPDMA block is basically the same + as the LPC17xx. Only the clock configuration is different and LPC43xx + has four different DMA request sources, where LPC17xx has only two. + From Alan Carvalho de Assis (2016-12-01). + * Remove RGMP and RGMP drivers (2016-12-02). + * i.MX6: Add an untested SPI driver taken directly from the i.MX1 port + (2016-12-02). + * Eliminate CONFIG_NO_NOINTS. There is no longer any support for + interrupt level processing of the network stack. Lots of files changed + -> lots of testing needed (2016-12-03). + * Fix DEBUGASSERT() in group_signal.c. From Masayuki Ishikawa + (2016-12-04). + * Add support for the SAM5CMP-DB board. From Masayuki Ishikawa + (2016-12-04). + * SAM3/4: Add SMP support for the dual-core SAM4CM. From Masayuki + Ishikawa (2016-12-04). + * C Library: Allow option to enable IP address conversions even when the + IP address family is not supported (2016-12-04). + * SSD1306: Fix errors in SPI mode configuration. From Gong Darcy + (2016-12-04). + * SAMA5 does not build when executing from SDRAM before board + frequencies are not constant. Rather, the bootloader configures the + clocking and we must derive the clocking from the MCK left by the + bootloader. This means lots more computations. This is untested on + initial commit because I don't have a good PWM test setup right now + (2016-12-04). + * Olimex-LPC1766-STK: Enable procfs in NSH configuration. Automount + /proc on startup (2016-12-05). + * SAM4CMP-DB: Add hooks to auto-mount the procfs file system on startup + in board bring-up logic (2016-12-05). + * Remove all references to BOARDIOC_PWMSETUP and board_pwm_setup() + (2016-12-05). + * Remove all references to BOARDIOC_ADCSETUP and board_adc_setup() + (2016-12-05). + * Added Timers 2-5 and control of SAI and I2S PLLs. From David Sidrane + (2016-12-05). + * Added support for stmf469 SAI and I2S PLL configuration and STM446 + fixes. From David Sidrane (2016-12-05). + * Expanded otgfs support to stm32F469 and stm32f446. Added missing bits + definitions, Used stm32F469 and stm32f446 bit definitions, Removed + unsed header file. From David Sidrane (2016-12-05). + * Remove BOARDIOC_CAN_INITIALIZE. CAN initialization is now done in the + board initialization logic just like every other device driver + (2016-12-06). + * STM32F7: Allow the config to override the clock edge setting. From + David Sidrane (2016-12-06). + * For Cortex-A9, should also set ACTLR.FW in SMP mode to enble TLB and + cache broadcasts. Does not fix SMP cache problem (2016-12-07). + * sched notes: Add additional note to see if/when CPU is started in SMP + mode (2016-12-07). + * EFM32: Fix a compilation error. From Pierre-noel Bouteville + (2016-12-07). + * pthreads: Add pthread_cleanup_push() and pthread_cleanup_pop() + (2016-12-08). + * BUGFIX:STM32F427 was rebooting. Over reached family. From David + Sidrane (2016-12-08). + * Add pthread_setcanceltype() and pthread_testcancel() (2016-12-09). + * Added STM32F469 RAM size and deliberated STM32F446 size. From David + Sidrane (2016-12-09). + * Typo in stm32f76xx77xx_pinmap.h edited online with Bitbucket. From + David Sidrane (2016-12-09). + * stm32_allocateheap.c edited online with Bitbucket. From David Sidrane + (2016-12-09). + * LPC43xx SD card: Correct pin configuration options needed for SD card + pins. From Alan Carvalho de Assis (2016-12-09). + * pthread_mutex_destroy(): Fix an error in destroying a mutex which can + occur after a pthread has been canceled while holding the mutex + (2016-12-09). + * Add support for cancellation points (2016-12-09). + * Forgot to add some files in the last commit (2016-12-10). + * Correct some default font IDs. From Pierre-Noel Bouteville + (2016-12-10). + * task_delete() now obeys all cancellation point semantics (2016-12-10). + * Add task_setcancelstate(), task_setcanceltype(), and task_testcancel(). + These are non-standard interfaces analogous to the correponding pthread_ + interfaces that provide cancellation controls for tasks (2016-12-10). + * i.MX6 interrupt handling: Additional logic needed to handle nested + interrupts when an interrupt stack is used (2016-12-13). + * SAMV7 MCAN: Prevent Interrupt-Flooding of ACKE when not connected to + CAN-BUS. An Acknowledge-Error will occur every time no other CAN Node + acknowledges the message sent. This will also occur if the device is + not connected to the can-bus. The CAN-Standard declares, that the Chip + has to retry a given message as long as it is not sent successfully (or + it is not cancelled by the application). Every time the chip tries to + resend the message an Acknowledge-Error-Interrupt is generated. At high + baud rates this can lead in extremely high CPU load just for handling + the interrupts (and possibly the error handling in the application). To + prevent this Interrupt-Flooding we disable the ACKE once it is seen as + long we didn't transfer at least one message successfully. From Frank + Benkert (2016-12-13). + * i.MX6: Remove non-cached, inter-cpu memory region. Not a useful + concept (2016-12-13). + * minnsh Configurations: Remove minnsh configurations and support logic: + up_getc() and lowinstream. This was an interesting exercise to see + just how small you could get NuttX, but otherwise it was not useful: + (1) the NSH code violated the OS interface layer by callup up_getc and + up_putc directly, and (2) while waiting for character input, NSH would + call up_getc() which would hog all of the CPU. Not a reasonable + solution other than as a proof of concept (2016-12-13). + * Calypso Boards: Remove all Calypso board configurations (2016-12-13). + * Calypso: Remove Calypso architecture support and support for Calypso + SERCOMM driver (2016-12-13). + * ESP32 core v2: Two changes (1) flushes the UART TX buffer in the esp32 + serial shutdown routine. The ROM bootloader does not flush the FIFO + before handing over to user code, so some of this output is not + currently seen when the UART is reconfigured in early stages of + startup. And changes the openocd config file's default flash voltage + from 1.8V to 3.3V. This is not necessary right now, but may save some + hard-to-debug moments down the track (3.3V-only flash running at 1.8V + often half-works and does weird things...). From Angus Gratton + (2016-12-14). + * Xtensa ESP32: Add missing ENTRY() and RET() macros in C callable + assembly language. At one time I though the that the ESP32 support the + CALL0 ABI. I was mistaken so there may be a few more like this + (2016-12-14). + * Xtensa ESP32: Fix a couple of bugs associated with handling of CPU + interrupts (2016-12-14). + * Xtensa ESP32: Fix several build-related issues associated with vector + section (2016-12-15). + * Xtensa ESP32: Fix missing CALL0 ABI condition (2016-12-15). + * Xtensa EPS32: Make sure that all C callable assembly functions includes + ENTRY prologue and RET epilogue (2016-12-15). + * Xtensa ESP32: Fix windowspill register handling + Use r6, not r2 when + passing paramters with call4 (2016-12-16). + * Xtensa ESP32: Use r6, not r2 when passing paramters with call4 + (2016-12-16). + * Xtensa ESP32: Correct a logic problem the prevented dumping the IDLE + thread's stack on an assertion (2016-12-16). + * Xtensa ESP32: Fix some missing SMP logic (2016-12-16). + * Xtensa ESP32: Basically a redesign of the interrupt dispatch logic + (2016-12-16). + * Xtensa ESP32: Level 1 interrupts should return via RFE (2016-12-17). + * Xtensa ESP32: One register getting clobber on context save (2016-12-17). + * STM32 F7: Fix some STM32F7 copy paste errors. From David Sidrane + (2016-12-17). + * CDC/ACM Device Class: uart_ops_s portion of cdcacm will not be + initialized with correct functions if CONFIG_SERIAL_DMA is set + (2016-12-17). + * Xtensa ESP32: Using wrong register to disable interrupts (2016-12-17). + * Xtensa ESP32: Fix clobbered a9 in co-processor context save/restore + (2016-12-17). + * Xtensa ESP32: Need to clone some logic for synchronous context switch. + Window spill logic in the conmon restores logic is inappropriate in + this context (2016-12-17). + * sscanf(): Add scansets to the scanf function. Enabled + CONFIG_LIBC_SCANSET option. From Aleksandr Vyhovanec (2016-12-17). + * Xtensa ESP32: Fix context save logic when called in window ABI + configuration. Add an IDLE stack. Don't depend on the mystery stack + received from the bootloader (2016-12-18). + * Xtensa ESP32: Need to spill registers to memory as the last dying + action before switching to a new thread (2016-12-18). + * ESP32 Serial: Add logic to prevent infinite loops in interrupt handler + (2016-12-18). + * Xtensa ESP32: Automatically mount /proc at start-up (2016-12-19). + * Xtensa ESP32: Corrects timer initialization and timer input frequency + (2016-12-19). + * Tiva PWM: Support PWM_PULSECOUNT feature for TI tiva. From Young.Mu + (2016-12-20). + * Xtensa ESP32: Missing prologue/epilogue macros on C callable function + (2016-12-20). + * Xtensa ESP32: Update APP CPU startup logic to match current Expressif + example code. Fix errors APP CPU startup (2016-12-20). + * fs/procfs: Fix procfs status for SMP case (2016-12-20). + * Xtensa ESP32: Clock frequency is different if running from IRAM or is + booting from FLASH. This is a booltloader issue (2016-12-20). + * Xtensa ESP32: Basic port is function in both single CPU and dual CPU + SMP configurations. There is an NSH configuration for each CPU + configuration (2016-12-21). + * STM32 F4: Merge in support for the Olimex STM32 P407 board (2016-12-21). + * Xtensa ESP32: Add an OS test to verify the port (2016-12-22). + * Xtensa ESP32: Corrects a problem with dispatching to signal handlers: + Cannot vector directly to the signal handling function as in other ABIs + under the Xtensa Window ABI. In that case, we need to go through a + tiny hook when performs the correct window call (call4) otherwise + registers will be scrambled in the signal handler (2016-12-22). + * SAMV7 CAN: Make delete_filter functions more robust. From Frank + Benkert (2016-12-23). + * Xtensa ESP32: Add stack checking logic (2016-12-23). + * sched note: record ID enumeration now results on constant values; ID + values do not change with configuration. This makes writing + post-processing software much easier (2016-12-24). + * STM32 F3: Forgot to update chip.h for STM32F303x[BC]'s 4 ADCs + (2016-12-24). + * STM32 F4: Allow dma in 1 bit mode in STM32F4xxx. From David Sidrane + (2016-12-24). + * termios.h: Fix CRTSCTS define to include input and output flow. + From Lorenz Meier (2016-12-26). + * SMP: Enforce this rule: Tasks which are normally restored when + sched_unlock() is called must remain pending (1) if we are in a + critical section, i.e., g_cpu_irqlock is locked , or (2) other CPUs + still have pre-emption disabled, i.e., g_cpu_schedlock is locked. In + those cases, the release of the pending tasks must be deferred until + those conditions are met (2016-12-26). + +7.20 2017-03-08 Gregory Nutt + + * i.MX6 SMP/NSH configuration: Enable examples/smp test (2016-12-27). + * SMP: There were certain conditions that we must avoid by preventing the + release of the pending tasks while withn a critical section. But this + logic was incomplete; there was no logic to prevent other CPUs from + adding new, running tasks while on CPU is in a critical section. This + commit corrects this. This is matching logic in sched_addreadytorun to + avoid starting new tasks within the critical section (unless the CPU is + the holder of the lock). The holder of the IRQ lock must be permitted + to do whatever it needs to do (2016-12-27). + * i.MX6: Fix clearing GPT status register. From Masayuki Ishikawa + (2016-12-28). + * SMP: Make checks for CPU lock set more robust. There are certains + conditions early in initialization on during interrupt handling where + things need to be done a little differently (2016-12-28). + * sched_cpulocked: Avoid use of spinlock. That has been reported to + cause a deadlock (2016-12-28). + * SMP: Fix a gap where we may try to make modifications to the task lists + without being in a critical sections. That permits concurrent access to + the tasks lists and many subtle problems. This fix just remains in the + critical section throughout the operation (and possible until the task + is restore in the event of a context switch). Makes a big difference in + stability (2016-12-28). + * SMP: Move sharable function to common file as irq_cpu_locked(). Use + irq_cpu_locked() in sched_unlock(). Use irq_cpu_locked() in + sched_removereadytorun() and sched_setpriority(). Use irq_cpu_locked() + in sched_mergepending() (2016-12-29). + * Add configuration support for builds with Ubuntu under Windows 10 + (2017-01-01). + * Add support for Tom Thumb small mono-space font. From Alan Carvalho de + Assis (2017-01-03). + * Alternative way to encode font spacing for Tom Thumb font (2017-01-04). + * Graphics: Initial separation of font cache from graphics/nxterm. Now in + libnx/nxfronts where it can be shared with other grapics applications + (2017-01-05). + * Font cache: Fix a reference counting issue: count not be initialized + when font cache created. Fix initialization of a semaphore. Enforce + mutually exclusive access to the font cache Replace fixed-size array + with variable size link list. Font cache in libnx needs to use + context-specific memory allocators (2017-01-06). + * Add debug assertion in libdtoa to catch attempts to use floating point + output formats from within an interrupt handler. That will cause + assertions or crashes downstream because __dtoa will attempt to allocate + memory. From Pierre-noel Bouteville (2017-01-06). + * procfs: Correct to snprintf-related errors in fs_procfsproc.c. + Resolves issue #24 (2017-01-07). + * STM32F429i Discovery: Add support for NxWM on STM32F429i-Disco board. + From Alan Carvalho de Assis (2017-01-07). + * STM32F429i-DISCO: Enable keyboard input in nxwm configuration + (2017-01-07). + * STM32F429i-DISCO: Change NxWM cursor character from 137 (graphics + block) to 95 (underscore). NxWM is configured to use a 7-bit character + set so 137 is not a valid character code (2017-01-07). + * NX server: Correct message queue names. Should not be at /dev, but + rather relative to /var/mqueue (2017-01-08). + * NxWM configurations. If using a 7-bit character set, then the cursor + character cannot be 137 (graphic block). Use 95 (underscore) instead + (2017-01-08). + * packed_struct replaced by begin_packed_struct and end_packed_struct. + From Aleksandr Vyhovanec (2017-01-09). + * sched_note: Fix spinlock instrumentation. From Masayuki Ishikawa + (2017-01-12). + * SMP: Fix an error in critical section logic when performing a context + switch from an interrupt handler. The g_cpu_irqset bit was not being + set for the CPU so other CPUs did not know about the critical section + (2017-01-13). + * Kinetis: Added support for CHIP_MK60FN1M0VLQ12 chip. From Maciej + Skrzypek (2017-01-13). + * Kinetis: Fixed wrong MCG VDIV calculation on new NXP K60. From Maciej + Skrzypek (2017-01-13). + * Kinetis Serial: Fixed compile error when UART5 is selected. From Maciej + Skrzypek (2017-01-13). + * Kinetis: Need to set HAVE_UART_DEVICE when UART4 is selected. From + Maciej Skrzypek (2017-01-13). + * Kinetis MCG: Wrong FRDIV set in MCG_C1. From Maciej Skrzypek + (2017-01-13). + * Kinetis: New K60 has no Flex memory. From Maciej Skrzypek (2017-01-13). + * In all implementations of _exit(), use enter_critical_section() vs. + disabling local interrupts (2017-01-13). + * i.MX6: Corrects behavior of last SMP patch with i.MX6 (2017-01-13). + * SMP Signals: Fix some SMP signal delivery logic. Was not handling some + critical sections correctly and was missing logic to signal tasks + running on other CPUs (2017-01-14). + * STM32F103 Minimum: Add support for nRF24 on STM32F103-Minimum board. + From Alan Carvalho de Assis (2017-01-15). + * Kinetis: Add support for K64/K66 RTC lower half driver. From Neil + Hancock (2017-01-17). + * Networking: Fixed some issues that prevented ipv6 to work with ipv4 + enabled. From Pascal Speck (2017-01-18). + * STM32 Oneshot: Fix logic so that it can support multiple oneshot timers + (2017-01-18). + * STM32L4: Port fix for multiple oneshot timers from STM32. Also fixes a + few issues with original STM32 implementation (2017-01-18). + * SAM3/4: Add support for ATSAM4S4C. From Wolfgang Reißnegger (2017-01-18). + * Math library: Leverage optimized ARM functions from BSD license ARM file + (2017-01-19). + * Math library optimatizations for FPU only apply to ARMv8 which is not + yet supported (2017-01-20). + * Move optimized ARM memcpy functions from arch/arm/src/ to + libc/machine/. This is necessary for the PROTECTED and KERNEL build + modes. Otherwise, memcpy() will be built in to kernel space and not + accessible to applications (2017-01-20). + * libc: Fix ARMv7-A/R memcpy assembly (2017-01-20). + * ARM memcpy(): Use DWord vs. HWord offset. ARM 32-bit instructions must + be aligned to DWord boundaries and this gives us more range in the jump + tables (2017-01-20). + * Fix a compile error: in sched_cpuload.c:Line136, the variables ts and + secs are not defined if CONFIG_CPULOAD_ONESHOT_ENTROPY = 0. However, + these variables are used regardless of CONFIG_CPULOAD_ONESHOT_ENTROPY at + lines~180:onwards. From Rajan Gill (2017-01-22). + * CPU load: Correct computation of the nominal period to use when the + source is a oneshot timer (2017-01-22). + * Kernel Modules: Module initializer may now return a symbol table + (2017-01-22). + * Modules: Extend the module interface so that we can access symbols + exported by the module (2017-01-22). + * Shared Libraries: In the FLAT build mode, kernel modules may be used to + provide minimal shared library functionality (2017-01-22). + * Shared libraries: Add a non-standard dllfnc.h function to set the + symbol table (2017-01-23). + * Olimex-stm32-p407: Add a NSH protected build configuration; Enable + procfs/ in all configurations (2017-01-23). + * SMP: Fix timer related issues: Round robin and sporadic scheduling + were only being performed for tasks running on the CPU that processes + the system timer interrupt. Similary, CPU load measurements were only + be processed for running on the CPU that receives the sampling interrupt + (2017-01-23). + * STM32 F7: Added missing ARCH_HAVE_RESET for F7. From David Sidrane + (2017-01-23). + * STM32: Add missing STM32_BKP_BASE. From David Sidrane (2017-01-23). + * Configurations that enable OSTEST must not disable signals (2017-01-24). + * Add missing sched_note_*() calls to sam4cm SMP functions (2017-01-24). + * Fix return value if x is NaN. From Aleksandr Vyhovanec (2017-01-25). + * MMCSD_SDIO: Only wait for card ejected if card detection is supported. + From Alan Carvalho de Assis (2017-01-26). + * LPC43 pinset definitions: Add more 1 bit to pinset to reach + SFSCLK0-SFSCLK3. Remove PINCONFIG_DIGITAL. From Alan Carvalho de Assis + (2017-01-26). + * sched/modules: Add support for dependencies between modules (2017-01-27). + * Back out use on inline functions to access 16-bit registers. The inline + functions were a work-around for misbehaving compiler years and years + ago. The mon standard macro-ized version should work just fine + (2017-01-27). + * Olimex STM32 P407: Add support for on-board microSD slot. Does not + work... Currently all commands to the SD card timeout (2017-01-28). + * libc/modlib: Add build a configuration logic for a shared module + library (2017-01-29). + * Module names are not needed in libc/modlib when the module library is + used only for shared library support (2017-01-29). + * Shared Libs: Implement module based shared libraries for the PROTECTED + mode build (2017-01-29). + * Typos withim mtd/ with Macronix MX25L. In NuttX/drivers/mtd/Make.defs + letters X between M and 25 are missing. Noted by Oleg Evseev + (2017-01-x30x). + * SAME70-Xplained: Clone some recent SAMV71-XULT changes (2017-01-30). + * Add capabilities() method to SDIO interface. Remove + CONFIG_SDIO_WIDTH_D1_ONLY. That should not be a global propertie, but + rather a capability/limitation of single slot when there may be multiple + slots (2017-01-31). + * Removed dmasupported() method from the SDIO interface. That is now a + bit in the capability set (2017-01-31). + * STM32F7 SDMMC: Add support for single bit operation on SDMMC2 + (2017-01-31). + * STM32F103-Minimum: Fix a compile error. + CONFIG_STM32_TICKLESS_ONESHOT_TIMER is only defined in TICKLESS mode. + Somebody has been hand editing .config files (2017-01-31). + * Timer logic: Add private function prototypes to eliminate a warning; + Functions should not be inline because the may recurse (2017-01-31). + * STM32F7 SDMMC: Make sure that all SDMMC configuration variables begin + with STM32F7_; Eliminate CONFIG_SDMMC1/2_DMA altogether. Does not + appear to be used (2017-01-31). + * STM32F429-DISCO: Move some board initialization logic that is not + usable because it lacks the configuration options to make it so + (2017-01-31). + * Cancellation points: Fix some backward logic in conditional compilation + (2017-02-02). + * Soft links: Add an implementation of readlink() (2017-02-03). + * inode_find: Now takes struct inode_desc_s type as input. That + structure includes some data storage. It was used within inode_find(), + but that means that the life of the data was the life of inode_find(). + That data must persist longer. It is now provided by the caller so that + the life of the data persists for the entire life of the caller + (2017-02-05). + * tools/noteinfo.c: A hack tool that I use to analyze some sched_note + output. Needs a home and may be useful to others (2017-02-05). + * Pseudo File System: Add support for soft links in the top-level pseudo + file system (2017-02-05). + * Updates to Kinetis SDHC driver. From Marc Rechté (2017-02-06). + * SDIO interface: Handle all possible DMA combinations in all SDIO drivers + (2017-02-07). + * up_timer_initialize() is named incorrectly. The prefix should be the + architecture name, not up_ since it is private to the architecture. + up_timerisr() is similarly misnamed and should also be private since it + is used only with the xyz_timerisr.c files (2017-02-07). + * MCG defines are based on the MCG feature configuration. We define the + bits as a common set of names. This means that an index may be added to + a name i.e. LOCK is LOCK0 as that is the superset name. From David + Sidrane (2017-02-07). + * Fixes illdefined BOARD_FR_DIV with BOARD_FRDIV from MCG. Original + BOARD_FR_DIV was never used - that is a good thing because the value ws + defined shifted and the code also shifted it. From David Sidrane + (2017-02-07). + * Added MCG settings that are defiend on the K64 SoC. Added + BOARD_MCG_C2_FCFTRIM and BOARD_MCG_C2_LOCRE0 to configure the MCG_C2 + register cleanup of some comments. From David Sidrane (2017-02-07). + * Better granualarity and errno checking of the board's MCG settings. + Allow for complete MCG_C2 definition from the boart.h file. Moved + #ifdef out of code by setting default values. Allow for individule bit + setting in MCG_C2 for BOARD_EXTCLOCK_MCG_C2, BOARD_MCG_C2_FCFTRIM, + BOARD_MCG_C2_LOCRE0. Added range and sanity checking. From David + Sidrane (2017-02-07). + * Cosmetic changes from review of last PR (2017-02-07). + * C library: Remove comments blocks before empty sections (2017-02-08). + * C Library: Add a very limited, first step implementation of setvbuf(). + This is a collaborative effort. Alan Carvalho de Assis did the initial + prototype (2017-02-08). + * setvbuf: Add support for configuration of line buffering (2017-02-08). + * Bamboo-200E: Add netnsh configuration. From Alan Carvalho de Assis + (2017-02-08). + * USBMSC: Always set LUN readonly flag. From Wolfgang Reißnegger + (2017-02-08). + * drivers/lcd: ssd1306_configspi() must have global scope (2017-02-09). + * SIM: Add readlink and setvbuf to nuttx-names.dat (2017-02-09). + * setvbuf: Add support for disabling I/O bufferin (2017-02-09). + * setvbuf: Fix some compile errors in first build of logic to + enable/disable buffering (2017-02-09). + * C Library: Clean-up buffer selections in Kconfig (2017-02-09). + * sem_open(): Fix a compiler error introduced with the setvbuf() changes + (2017-02-09). + * MMC/SD SDIO: Some drivers need to start DMA before sending CMD24 and + some AFTER. From Alan Carvalho de Assis (2017-02-09). + * Kinetis SDHC driver fixes. From Marc Rechté (2017-02-09). + * Bambino-200E: Use .elf extension on all executables. From Alan Carvalho + de Assis (2017-02-09). + * Kinetis: Add support for K66 family. From David Sidrane (2017-02-09). + * Created a kinetis MCG versioning scheme pulled in by Kinetis chip.h + + The motivations is to version the IP blocks of the Kinetis K series + family of parts. + + This added versioning and configuration features for the Kinetis MCG IP + block. + + It is envisioned that in the long term as a chip is added. The author + of the new chip definitions will either find the exact configuration in + an existing chip define and add the new chip to it Or add the MCG + feature configuration #defines to the chip ifdef list in + arch/arm/include/kinetis/kinetis_mcg.h In either case the author should + mark it as "Verified to Document Number:" taken from the reference manual. + + The version KINETIS_MCG_VERSION_UKN has been applied to most all the + SoCs in the kinetis arch prior to this commit. + + The exceptions are the CONFIG_ARCH_CHIP_MK60FN1M0VLQ12, All K64 and K66 + which not have Verified MCG configurations. + + From David Sidrane (2017-02-09). + * Kinetis chip Adding K66 and including MCG versioning. This includes + arch/arm/include/kinetis/kinetis_mcg.h to bring in the MCG versioning + and defines the KINETIS_K66 family for the added SoCs: + + --------------- ------- --- ------- ------- ------ ------ ------ ----- + PART NUMBER CPU PIN PACKAGE TOTAL PROGRAM EEPROM SRAM GPIO + FREQ CNT FLASH FLASH + --------------- ------- --- ------- ------- ------ ------ ------ ----- + MK66FN2M0VMD18 180 MHz 144 MAPBGA 2 MB — — KB 260 KB 100 + MK66FX1M0VMD18 180 MHz 144 MAPBGA 1.25 MB 1 MB 4 KB 256 KB 100 + MK66FN2M0VLQ18 180 MHz 144 LQFP 2 MB — — KB 260 KB 100 + MK66FX1M0VLQ18 180 MHz 144 LQFP 1.25 MB 1 MB 4 KB 256 KB 100 + + From David Sidrane (2017-02-09). + * STM32: Fixes the bkp reference counter issue. From David Sidrane + (2017-02-09). + * STM32F7: Fixes the bkp reference counter issue. From David Sidrane + (2017-02-09). + * C Library: Add setbuf() which is a trivial wrapper around setvbuf() + (2017-02-09). + * tools/mkconfig.c: Add logic to keep all of the buffering options in sync + (2017-02-10). + * VFS rename: Fix issues with rename to subdirectories and some softlink + issues (2017-02-11). + * Add logic to VFS rename: If target of rename exists and is a directory, + then the source file should be moved 'under' the target directory. + POSIX also requires that if the target is a file, then that old file + must be deleted (2017-02-11). + * rename: An inode with no operations should be treated like a directory + for the purposes of rename (2017-02-12). + * rename(): Correct more issues. (1) Move to the root directory in the + pseudo file system, (2) Fix path naming calculation when the path is the + root directory of a mounted file system, and (3) dont't do the rename if + the source and destination of the rename are the same (2017-02-12). + * Add basic fstat() support (2017-02-12). + * Add fstat support to binfs (2017-02-12). + * fstat: Add fstat() support to romfs (2017-02-12). + * fstat: Add fstat() support to unionfs (2017-02-12). + * I found an issue inside the cp15_coherent_dcache function in file, + arch/arm/src/armv7-r/cp15_coherent_dcache.S. + + The "mcr CP15_BPIALLIS(r0)" instruction is used for invalidating entire + branch predictor. But the problem is, since this is the generic code + and can be called on any armv7-r architecture based CPU's. It is a + problem, if this instruction is called in uni processor configuration. + Because, BPIALLIS (c7, 0, c1, 6) instruction is only added as part of + the "Multiprocessing Extensions" (As per ARM® Architecture Reference + Manual /ARMv7-A and ARMv7-R edition) + + So in my opinion, this instruction should be under SMP configuration. In + non-SMP configuration this instruction could become undefined. + + From Manohara HK (2017-02-13). + * fstat: Add fstat() support to tmpfs (2017-02-13). + * fstat: Add fstat() support to nxffs (2017-02-13). + * fstat: Add fstat() support to nfs (2017-02-13). + * NFS: Use clock_gettime() instead of deprecated gettimeofday() + (2017-02-13). + * fstat: Add fstat() support to FAT. From Alan Carvalho de Assis + (2017-02-13). + * ROMFS: stat() and fstat() should always indicate that directories are + executable (2017-02-13). + * Kinetis SDHC - Enable clock after selected. From David Sidrane + (2017-02-14). + * Kinetis SPI and I2C are 0 based. The K whole family line has max 4 or + each. But the supported parts have the maximums listed below: + + K46 and K66 3 SPI SPI0-SPI2 + K46 and K66 4 I2C I2C0-I2C3 + + From David Sidrane (2017-02-10). + * Add support for NXP Freedom-k66f development board. From David Sidrane + (2017-02-14). + * Kinetis: Define Alternate addresses for IP blocks in both AIPS0 & + AIPS1. Added ALT version of RNGA, FTM2, DAC0 as a facility to later + define secondary access via AIPS1 to these peripherals. From David + Sidrane (2017-02-14). + * Kinetis: Add support for K66. From David Sidrane (2017-02-14). + * procfs: stat() left several fields in uninitialized state (2017-02-14). + * hostfs: Add support for fstat() (2017-02-14). + * procfs: Add support for fstat() (2017-02-14). + * smartfs: Add support for fstat() (2017-02-14). + * Kinetis Freedom K66F: Add Ethernet support. From David Sidrane + (2017-02-14). + * LPC43 serial: Correct conditional logic that selects /dev/ttySN. + Problem noted by Alan Carvalho de Assis (2017-02-14). + * Add usbnsh config to Bambino 200E board. From Alan Carvalho de Assis + (2017-02-14). + * procfs: Most stat() implementations were not initializating the + st_atime, st_ctime, and st_mtime fields (2017-02-15). + * Kinetis Support RMII clock source select. This defined the RMII clock + source select bits and allows the selection to be made via Kconfig. + From David Sidrane (2017-02-15). + * Kinetis PWM: Add FTM3 to PWM. From David Sidrane (2017-02-15). + * Kinetis:Freedom-K66F uses ENET_1588_CLKIN as RMII clock. From David + Sidrane (2017-02-15). + * Fix for SAMv7 SPI: DLYBS value was calculated, but never written to any + registers. This led to incorrect timings on the bus. From Michael + Spahlinger (2017-02-16). + * C library: Add swab() (2017-02-16). + * C library: Add strtoimax and strtoumax (2017-02-16). + * C library: Add ffs(), rindex(), an index(). Add strings.h. Move + strcasecmp, strncasecmp, bzero, bcmp, and bcopy to where they belong in + strings.h.h, not string.h. bzero, bcmp, and bcopy are legacy functions; + the contemporary counterparts should be used instead (2017-02-16). + * Allow board to configure HSE clock in bypass-mode. This is needed to + enable HSE with Nucleo-F746ZG board. From Jussi Kivilinna (2017-02-17). + * C library: Add fstatfs(); fix a reference counting error in fstat() + (2017-02-17). + * Update cwchar. Add cwctype (2017-02-17). + * Add setbuf and setvbuf to cstdio (2017-02-17). + * Port STM32L4 SAI driver from MDK (2017-02-17). + * STM32L4: Bring power management logic from Motrola MDK into NuttX + (2017-02-18). + * STM32L4: Bring LPTIM driver in from the Motorola MDK (2017-02-18). + * drivers/sensors: Add driver for the ST L3GD20 3 axis gyro. From + raiden00 (2017-02-19). + * config/stm32f429i-disco: Add support for the L3GD20 driver. From + raiden00 (2017-02-19). + * STM32L4 COMP: Port from Motorola MDK (2017-02-19). + * Add twr-k64f120m config and fix some ENET related problems. From Marc + Rechté (2017-02-19). + * STM32 F7: stm32_allocateheap: allow use DTCM memory for heap. STM32F7 + has up to 128KiB of DTCM memory that is currently left unused. This + change adds DTCM to main heap if CONFIG_STM32F7_DTCMEXCLUDE is not + enabled. From Jussi Kivilinna (2017-02-20). + * This should resolve issue #30: Audio Tone Generator and PWM Multiple + Output Channel options. I don't actually have a setup to verify it, + however (2017-02-20). + * drivers/tone.c: 50% duty needs to be expressed a a fixed precision + number (2017-02-21). + * Kinetis: Created a kinetis SIM versioning scheme pulled in by Kinetis + chip.h. + + The motvations is to version the IP blocks of the Kinetis K series + family of parts. + + This added versioning and configuration features for the Kinetis SIM IP + block. + + It is envisioned that in the long term as a chip is added. The author + of the new chip definitions will either find the exact configuration in + an existing chip define and add the new chip to it Or add the SIM + feature configuration #defines to the chip ifdef list in + arch/arm/include/kinetis/kinetis_sim.h In either case the author should + mark it as "Verified to Document Number:" taken from the reference + manual. + + The version KINETIS_SIM_VERSION_UKN has been applied to most all the + SoCs in the kinetis arch prior to this commit. + + The exceptions are the CONFIG_ARCH_CHIP_MK60FN1M0VLQ12, All K64 and K66 + which not have Verified SIM configurations. + + From David Sidrane (2017-02-21). + * Created a kinetis PMC versioning scheme pulled in by Kinetis chip.h. + + The motivation is to version the IP blocks of the Kinetis K series + family of parts. This added versioning and configuration features for + the Kinetis PMC IP block. It is envisioned that in the long term as a + chip is added. The author of the new chip definitions will either find + the exact configuration in an existing chip define and add the new chip + to it Or add the PMC fature configuration #defines to the chip ifdef + list in arch/arm/include/kinetis/kinetis_pmc.h In either case the + author should mark it as "Verified to Document Number:" taken from the + reference manual. + + The version KINETIS_PMC_VERSION_UKN has been applied to most all the + SoCs in the kinetis arch prior to this commit. + + The exceptions are the CONFIG_ARCH_CHIP_MK60FN1M0VLQ12, + CONFIG_ARCH_CHIP_MK20DXxxxVLH7 All K64 and K66 have been verified PMC + configurations. From David Sidrane (2017-02-22). + * Kinetis: kinetis_clockconfig uses the correct ACKISO. ACKISO is located + in the PMC_REGSC on the majority of the Kinetis SoCs. With the exception + of the MK40DXxxxZVLQ10 where ACKISO is located in LLWU_CS (2017-02-22). + * Kinetis: Refactor you use SIM_SOPT2_PLLFLLSEL, added warning. The + warning has been added because: SIM_SOPT2_PLLFLLSEL is a clock selection + that may feed many clock subsystem: USB, TPM, SDHCSRC, LPUARTSRC. + Therefore, there needs to be a global board level setting to select the + source for SIM_SOPT2_PLLFLLSEL and then derive all the sub selections + and proper fractions/divisors for each modules clock. From David + Sidrane (2017-02-22). + * Add support to QEncoder on STM32F103Minimum board. From Alan Carvalho + de Assis (2017-02-23). + * Olimex STM32 p407: Add external SRAM support. Unfortunately not usable + or testable unless you also disable the serial console (2017-02-23). + * drivers/spi/Kconfig: There is too much SPI in the configuration menu; + SPI Driver Support menu is empty. From Maciej Wójcik (2017-02-23). + * Kinetis: SIM add paramiterized SIM_CLKDIVx_xxFRAC|DIV macros. The makes + for cleaner board definitions. From David Sidrane (2017-02-23). + * kinetis_enet.c add #define for number of loops for auto negotiation to + complete. From Marc Rechté (2017-02-23). + * STM32F4 Discovery: Fix issues with QEncoder support. From Alan Carvalho + de Assis (2017-02-23). + * sigtimedwait: When timer expires, up_unblock_task() is called. This is + okay in the single CPU case because interrupts are disable in the timer + interrupt handler. But it is insufficient in the SMP case. enter_ and + leave_critical_section() must be called in order to manage spinlocks + correctly (2017-02-23). + * Fix QEncoder driver, based on STM32L4 driver. From Alan Carvalho de + Assis (2017-02-23). + * STM32 QEncoder. Enable clocking to the timer on QE setup; disable clock + on QE teardown (2017-02-23). + * Kinetis: Extend clockconfig to support SOPT2_PLLFLLSEL and + SIM_CLKDIV3. A board.h file can now specify the: 1) + BOARD_SOPT2_PLLFLLSEL to select the output of the SIM_SOPT2 MUX from: + MCGFLLCLK, MCGPLLCLK, USB1PFD, and IRC48MHZ. 2) If it defines + BOARD_SIM_CLKDIV3_FREQ then it must define BOARD_SIM_CLKDIV3_PLLFLLFRAC + and BOARD_SIM_CLKDIV3_PLLFLLDIV which wil be used to cpnfigure + SIM_CLKDIV3 [PLLFLLFRAC, PLLFLLDIV]. From David Sidrane (2017-02-23). + * Kinetis serial: Added configurable 1|2 stop bits. HAVE_SERIAL_CONSOLE + -> HAVE_UART_CONSOLE to be consistent with HAVE_LPUART_CONSOLE naming. + From David Sidrane (2017-02-23). + * Kinetis: Add LPUART serial driver and Clock configuartaion to + freedom-k66f board. Pin out LPUART0 for testing. Define + BOARD_SOPT2_PLLFLLSEL ti select MCGPLLCLK. Define + BOARD_SIM_CLKDIV3_FREQ etal to provide BOARD_LPUART0_FREQ. From David + Sidrane (2017-02-25). + * QEncoder: Add mechanism to assure that architecture-specific IOCTL + commands do not overlap (2017-02-25). + * include/nuttx/analog: Add an ioctl.h header file to coordinate analogic + driver IOCTL commands (2017-02-25). + * CAN: Add infrastructure to assure that all CAN IOCTL commands are + uniquely numbered (2017-02-25). + * Wireless and TSC: Add infrastructure to assure that all IOCTL commands + are uniquely numbered (2017-02-25). + * Add basic support for the STM32F334 and Nucleo F334R8 board. From + Mateusz Szafoni (2017-02-16). + * SAM3/4: GPIO bit numbering typo fixes. From Wolfgang Reißnegger + (2017-02-26). + * Add SDCard support over SPI on STM32F103-Minimum board. From Alan + Carvalho de Assis (2017-02-26). + * option to enable Memory Card debug output was hidden with SD cards + connected through SPI. From Maciej Wójcik (2017-02-27). + * Kinetis serial: Fixed up_rxint - did not disable the RX interuppts. + There was an OR where and AND NOT was needed. From David Sidrane + (2017-02-27). + * Kinetis:Add the configuring SIM_CLKDIV2[USBFRAC, USBDIV] in + kinetis_clockconfig. If a board.h provides BOARD_SIM_CLKDIV2_FREQ it + will configure the SIM_CLKDIV2 based on the additional provided + BOARD_SIM_CLKDIV2_USBFRAC and BOARD_SIM_CLKDIV2_USBDIV. The reason for + doing this globaly is that the output the SIM_CLKDIV2 divisor may be + also used for other IP blocks in future configurations (as is done for + SIM_CLKDIV3). From David Sidrane (2017-02-27). + * Kinetis: Refactor clocking in kinetis_usbdev. (1) Removed + SIM_CLKDIV2[USBFRAC, USBDIV] setting as it is now, done in + kinetis_clockconfig, (2) Use BOARD_USB_CLKSRC to select the clock source + to the USB block, (3) Removed CONFIG_TEENSY_3X_OVERCLOCK from the driver + as the board.h will now provide BOARD_SIM_CLKDIV2_USBDIV and + BOARD_SIM_CLKDIV2_USBFRAC to the kinetis_clockconfig. From David + Sidrane (2017-02-27). + * Kinetis: Use BOARD_xxxx to drive system clocking: (1) Shifted the clock + speed of MK20DX128VLH5 to 48 Mhz to be able to uses USB. (2) Set + BOARD_OUTDIV3 to 0 - there is no BOARD_OUTDIV3 on a MK20DX128VLH5 or + K20DX256VLH7, (3) Added BOARD_SOPT2_PLLFLLSEL and BOARD_SOPT2_FREQ along + with settings for BOARD_SIM_CLKDIV2_USBFRAC and BOARD_SIM_CLKDIV2_USBDIV + base on the BOARD_SOPT2_FREQ. From David Sidrane (2017-02-27). + * Kinetis: Define uart and lpuart versions of [early]serialinit. Add + serial init to centralize UART/LPUART management. Use kinetis_ not up_ + where arch specific. Defined kinetis_[lp]uart_[early]serialinit to + facilitate bring up both UARTs and LPUARTs as devices and a console. + Support ordering and merging of serial devices names. From David + Sidrane (2017-02-27). + * Adapt more drivers to utilize the IRQ argument feature (2107-02-28). + * irq_attach() and type xcpt_t. irq_attach now accepts a argument that + will be provided to the interrupt handler when the interrupt ocurrs. + This affects many files by replace ad hoc parameter passing logic with a + standardized approach. From Mark Schulte (2017-03-01). + * Fix open() a block device with CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y. + From Masayuki Ishikawa (2017-03-01). + * net/: Fixed a nullptr-dereference on iob_clone. From Pascal Speck + (2017-03-01). + * configs/: All functions that used to return an xcpt_t old handler value, + not return NULL. The oldhandler value is no longer useful with the + recent changes to the interrupt argument passing (2017-03-02). + * arch_phy_irq: Now returns int instead of xcpt_t oldhandler. The + oldhandler is useless after the changes to the interrupt argument. Also + access an argument for the PHY interrupt. phy_notify.c driver changed + to exploit new interrupt argument passing (2017-03-02). + * STM32/F7/L4: EXTI PVD function no longer returns the xcpt_t oldhandler. + There value is useless and dangerous after the recent changes to + interrupt argument passing (2017-03-02). + * STM3 L4: EXTI COMP function no longer returns the xcpt_t oldhandler. + There value is useless and dangerous after the recent changes to + interrupt argument passing (2017-03-02). + * STM32/F7/L4: EXTI ALARM function no longer returns the xcpt_t + oldhandler. There value is useless and dangerous after the recent + changes to interrupt argument passing (2017-03-02). + * Add support to USB Device on STM32F103-Minimum board. From Alan + Carvalho de Assis (2017-03-02). + * Kinetis GPIO: Pin IRQ logic no longer returns the xcpt_t oldhandler. + There value is useless and dangerous after the recent changes to + interrupt argument passing (2017-03-02). + * STM32 Ethernet: Need two work structures so that pending poll work is + not lost when an interrupt occurs (2017-03-02). + * Kinetis-L GPIO: Pin IRQ logic no longer returns the xcpt_t oldhandler. + There value is useless and dangerous after the recent changes to + interrupt argument passing (2017-03-02). + * PIC32MX: Pin IRQ logic no longer returns the xcpt_t oldhandler. There + value is useless and dangerous after the recent changes to interrupt + argument passing (2017-03-02). + * PIC32MZ: Pin IRQ logic no longer returns the xcpt_t oldhandler. There + value is useless and dangerous after the recent changes to interrupt + argument passing (2017-03-02). + * STM32 L4: Pin IRQ logic no longer returns the xcpt_t oldhandler. There + value is useless and dangerous after the recent changes to interrupt + argument passing (2017-03-02). + * Tiva: Pin IRQ logic no longer returns the xcpt_t oldhandler. There + value is useless and dangerous after the recent changes to interrupt + argument passing (2017-03-02). + * board_button_irq: Button IRQ logic no longer returns the xcpt_t + oldhandler. There value is useless and dangerous after the recent + changes to interrupt argument passing (2017-03-02). + * stm32_gpiosetevent: GPIO IRQ logic no longer returns the xcpt_t + oldhandler. This value is useless and dangerous after the recent + changes to interrupt argument passing (2017-03-02). + * Implements support for smaller interrupt tables as described at + http://www.nuttx.org/doku.php?id=wiki:howtos:smallvectors . This is + largely the work of Mark Schulte. However, I have made several changes + to match with the Wiki document. If you like the change, thanks go to + Marc. For any errors you can blame me (2017-03-03). + * Experimental change to STM32 Ethernet driver a success. Porting change + to all other Ethernet drivers (2017-03-03). + * FS: Don't build block driver proxy if PSEUDOFS_OPERATIONS are disabled + (2017-03-04). + * drivers/net: Add framework for serialization in the case where multiple + low-priority work queues are used (2017-03-04). + * net/drivers/skeleton.c: Back out serialization changes of the last + commit. They are not necessary in the skeleton.c example because the + calls to net_lock() at the beginning of each worker function will + enforce serialization (2017-03-04). + * STM32F33XX DAC, OPAMP, COMP and ADC headers. From Mateusz Szafoni + (2017-03-04). + * STM32 F7 SDMMC: Use new interrupt argument facility (2017-03-05). + * stm32f33xxx: Add HRTIM header file. From Mateusz Szafoni (2017-03-05). + * sendfile(): Fix error introduced with commit + ff73be870e38959b0aaee5961dc47b4b58dc2d86. Noted by Maciej Wójcik + (2017-03-05). + * Kinetis: Eliminate warning when USE_EARLYSERIALINIT is not defined + (2017-03-05). + * STM3210E-EVAL: Eliminte a warning. Return type of board_button_irq is + now type int (2017-03-05). + * dk-tm4c129x: Remove warning for variable that is set but not used + (2017-03-05). + * SAMA5D4-EK: Eliminate warning. Correct type of return value + (2017-03-05). + * STM32F103 Minimum: Eliminate warning stm32_usbdev.o givne twice in same + rule (2017-03-05). + * STM32 OTGHS host: stm32_in_transfer() fails and returns NAK if a + short transfer is received. This causes problems from class drivers + like CDC/ACM where short packets are expected. In those protocols, + any transfer may be terminated by sending short or NUL packet. From + Janne Rosberg. Adapt Janne Rosberg's patch to STM32 OTGHS host to + OTGFS host, and to similar USB host implementations for STM32 L4 and + F7 (2017-03-07). + * usbhost_cdcacm: Fix tx outbuffer overflow and remove now invalid + assert. From Janne Rosberg (2017-03-07). + +7.21 2017-06-05 Gregory Nutt + + * tools/kconfig2html: Need to increase the maximum number of default + values (2017-03-08). + * C library: Add strerror_r() (2017-03-08). + * C Library: Add wcstoull(), swprintf(), wcstod(), wcstof(), wcstol(), + wcstold(), wcstoul(), wcstoll() functions. Add mbsnrtowcs() and + wcsnrtombs() (just returning success). Add mbtowc() and wctomb() to + C++ std namespace. From Alan Carvalho de Assis (2017-03-08). + * Kinetis: Fixed GPIO _PIN_OUTPUT_LOWDRIVE swapped with + _PIN_OUTPUT_OPENDRAIN. From David Sidrane (2017-03-08). + * Ensure interrupts are back on BEFORE running code dependant on + clock_systimer. From David Sidrane (2017-03-08). + * Enable compilation of libc++ same way as uClibc++. From Alan + Carvalho de Assis (2017-03-08). + * Add LPC4337FET256. From Andreas Bihlmaier (2017-03-09). + * Change Kconfig type of ADC0_MASK from hex to int; add ADC driver + options to lpc43xx. From Andreas Bihlmaier (2017-03-09). + * Add missing PINCONF_INBUFFER in several places of + lpc4310203050_pinconfig.h. From Andreas Bihlmaier (2017-03-09). + * Rename LPC43_GPDMA_GLOBAL_CONFIG (already slipped previous commit C + file); fix GPDMA_CONTROL_SBSIZE_*, improve usability of + GPDMA_CONTROL_{S,D} macros. From Andreas Bihlmaier (2017-03-09). + * Fix errors in LPC43 SCT and SGPIO headers. From Andreas Bihlmaier + (2017-03-09). + * Fix logic error in lpc43_adc. From Andreas Bihlmaier (2017-03-09). + * Fix logic in preprocessor checks and correct arguments to + lpc43_pin_config initialization. From Andreas Bihlmaier (2017-03-09). + * Use correct macro for irqid (fortunately both point to + LPC43_IRQ_EXTINT+18). From Andreas Bihlmaier (2017-03-09). + * Actually write modified value to register. From Andreas Bihlmaier + (2017-03-09). + * Increase number of supported PWM channels from 4 to 6. From Andreas + Bihlmaier (2017-03-09). + * Fix as5048b by adding missing frequency parameter. From Andreas + Bihlmaier (2017-03-09). + * Kinetis: Allow Board to add Pullups on SDHC lines. From David + Sidrane (2017-03-09). + * EZ80F910200KITG: Missing support logic in configs/Kconfig (2017-03-09). + * Olimex-STM32-P407: Update USB host support (2017-03-09). + * Olimex STM32 P407: USB host support for USB FLASH sticks is now + supported in the base nsh configuration (2017-03-09). + * STM32, STM32 F7, and STM32 L4: Back out part of + 3331e9c49aaaa6dcc3aefa6a9e2c80422ffedcd3. Returning immediately in + the case of a NAK makes the Mass Storage Class driver unreliable. + The retry/timeout logic is necessary. This implementation tries to + implement a compromise: If a NAK is received after some data is + received, then the partial data received is returned as with + 3331e9c49aaaa6dcc3aefa6a9e2c80422ffedcd3. If if a NAK is received + with no data, then no longer returns the NAK error immediately but + retries until data is received or a timeout occurs. Initial testing + indicates that this fixes the issues the MSC. However, I have + concerns that if multiple sectors are read in one transfer, there + could be NAKs between sectors as well and, in that case, then change + will still cause failures (2017-03-09). + * STM32F2: Add USB OTG HS support for stm32f20xxx cores. From Simon + Piriou (2017-03-09). + * Remove all references to arch_usbhost_initialize(). That was + incorrectly called from apps/examples/hidkbd. That is violation of + the OS interfacing rules and will no longer be supported. USB host + should be initialized as part of the board bring-up logic was with + any other devices and should not involve illegal calls from + applications into the OS (2017-03-09). + * STM32, STM32 F7, STM32 L4: OTG host drivers: Do not do data toggle + if interrupt transfer is NAKed. Sugested by webbbn@gmail.com + (2017-03-09). + * apps/examples/usbterm is gone because it can be configured to perform + an illegal call into the OS. Remove all traces of + CONFIG_EXAMPLES_USBTERM* and all of the illegal device support + (2017-03-09). + * Save elapsed time before handling I2C in stm32_i2c_sem_waitstop(). + This patch follows the same logic as in previous fix to + stm32_i2c_sem_waitdone(). It is possible that a context switch + occurs after I2C registers are read but before elapsed time is saved + in stm32_i2c_sem_waitstop(). It is then possible that the registers + were read only once with "elapsed time" equal 0. When scheduler + resumes this thread it is quite possible that now "elapsed time" will + be well above timeout threshold. In that case the function returns + and reports a timeout, even though the registers were not read + "recently". Fix this by inverting the order of operations in the loop + - save elapsed time before reading registers. This way a context + switch anywhere in the loop will not cause an erroneous "timeout" + error. From Freddie Chopin (2017-03-10). + * pthreads: Fix pthread_mutexattr_init(). It was not initializing the + protocol field when priority inheritance is enabled (2017-03-10). + * Priority inheritance: When CONFIG_SEM_PREALLOCHOLDERS==0, there is + only a single, hard-allocated holder structure. This is problem + because in sem_wait() the holder is released, but needs to remain in + the holder container until sem_restorebaseprio() is called. The call + to sem_restorebaseprio() must be one of the last things the + sem_wait() does because it can cause the task to be suspended. If in + sem_wait(), a new task gets the semaphore count then it will fail to + allocate the holder and will not participate in priority + inheritance. This fix is to add two hard-allocated holders in the + sem_t structure: One of the old holder and one for the new holder + (2017-03-10). + * STM32, STM32 F7, and STM32 L4: Clone Freddie Chopin's I2C change to + similar STM32 I2C drivers. From David Sidrane (2017-03-10). + * Priority Inversion fixes: Initalization. From David Sidrane + (2017-03-10). + * configs: Add Particle Photon board support. From Simon Piriou + (2017-03-10). + * tools/testbuild.sh: Add debug option (-d) (2017-03-10). + * multiple fixes in nrf24l01 driver: (1) signal POLLIN if there is + already data in the FIFO, (2) send ETIMEDOUT to userspace after 2 + seconds if TX IRQ was not received, (3) handle FIFO overflow, (4) + handle invalid pipes/empty FIFO, and (5) multiple cosmetics (missing + static, duplicate define, missing \n). From Leif Jakob (2017-03-10). + * STM32 F33 ADC: Correct bad definitions of base addresses; Fix + naming collision by changing colliding STM32_ADC12_BASE to + STM32_ADC12_CMN_BASE (2017-03-10). + * photon: Add iwdg timer support. From Simon Piriou (2017-03-11). + * photon: Add usb otg hs support and usbnsh app. From Simon Piriou + (2017-03-11). + * photon: Add LEDs and BUTTONS support. From Simon Piriou (2017-03-11). + * As discovered by dcabecinhas. This fix assume the 8 byte alignment + options for size stack size or this will overwrite the first word + after TOS. See + https://github.com/PX4/Firmware/issues/6613#issuecomment-285869778. + From David Sidrane (2017-03-11). + * STM32F20xxx: Add BOARD_DISABLE_USBOTG_HSULPI flag. From Simon + Piriou (2017-03-11). + * STM32: Propagate STM32 F2 changes of last PR to STM32 F4 and F7 + OTGHS (2017-03-11). + * STM32 OTG HS: A little research reveals that only the F2 RCC + initialization set the OTGHSULPIEN bit and Photon is the only F2 + board configuration that uses OTG. Therefore, we can simplify the + conditional logic of the last PR. Negative logic was used (#ifndef + BOARD_DISABLE_USBOTG_HSULPI) to prevent bad settings in other + configurations. But giveh these facts, the preferred positive logic + now makes more sense (#ifdef BOARD_ENABLE_USBOTG_HSULPI) (2017-03-11). + * STM32: OTG host implementations of stm32_in_transfer() must obey the + polling interval for the case of isochronous and interrupt endpoints + (2017-03-12). + * Photon: Add basic support for wlan chip. From Simon Piriou + (2017-03-12). + * Networking: Add registration support for integrated ieee80211 + wireless drivers. Rename CONFIG_IEEE802154 to + CONFIG_WIRELESS_IEEE8021514 following the convention of including the + location of the configuration variable as a part of its name + (2017-03-12). + * If whence is SEEK_END, the file offset shall be set to the size of + the file plus offset. Noted by eunb.song@samsung.com (2017-03-13). + * Move IEEE 802.11 wireless IOCTLs from include/nuttx/net/ioctl to + include/nuttx/wireless/wireless.h. Add some Linux compatible + structures to use with the IOCTL commands. (2017-03-13). + * semaphore: sem_holder sem_findholder missing inintalization of + pholder. sem_findholder would fail and code optimization covered + this up. From David Sidrane (2017-03-13). + * Partial Fix priority inheritance CONFIG_SEM_PREALLOCHOLDERS=0. From + David Sidrane (2017-03-13). + * semaphore: sem_boostholderprio prevent overrun of pend_reprios. The + second case rtcb->sched_priority <= htcb->sched_priority did not + check if there is sufficient space in the pend_reprios array. From + David Sidrane (2017-03-13). + * Include C++ library to 'make export'. From Alan Carvalho de Assis + (2017-03-13). + * arch/arm/src/xmc4: Initial, partial support for Infineon XMC4xxx + (2017-03-14). + * photon: Porting wlan device. From Simon Piriou (2017-03-14). + * lp_worker: Guard from pend_reprios overflow. From David Sidrane + (2017-03-15). + * wireless/ieee802154: Renamed file ieee802154_device to + radio802154_device. From Anthony Merlino (2017-03-15). + * Add option to enable wireless debug output (2017-03-15). + * wireless/ieee802.15.4: Refactors ieee802154_dev character driver to + be radio802154_device. From Anthony Merlino (2017-03-15). + * Integrate use of new wireless debug macros. Replace ad hoc debug + macros. Convert obsolete dbg() macros to current info(), warn(), + err() macros (2017-03-15). + * sem_holder: Fixes improper restoration of base_priority in the case + of CONFIG_SEM_PREALLOCHOLDERS=0. The call to + sem_restorebaseprio_task context switches in the + sem_foreachholder(sem, sem_restoreholderprioB, stcb); call prior to + releasing the holder. So the running task is left as a holder as is + the started task. Leaving both slots filled thus failing to perform + the boost/or restoration on the correct tcb. This PR fixes this by + releasing the running task slot prior to reprioritization that can + lead to the context switch. To faclitate this, the interface to + sem_restorebaseprio needed to take the tcb from the holder prior to + the holder being freed. In the failure case where sched_verifytcb + fails it added the overhead of looking up the holder. There is also + the additional thunking on the foreach to get from holer to + holder->tcb. An alternate approach could be to leve the interface + the same and allocate a holder on the stack of sem_restoreholderprioB + copy the sem's holder to it, free it as is done in this pr and and + then pass that address sem_restoreholderprio as the holder. It could + then get the holder's tcb but we would keep the same sem_findholder + in sched_verifytcb. From David Sidrane (2017-03-15). + * ARM: Remove redundant interrupt stack coloring. From David + Cabecinhas (2017-03-16). + * ARM: Set EABI stack alignment for all ARM architectures (remove OABI + code). From David Cabecinhas (2017-03-16). + * Remove redundant interrupt stack coloring and OABI code. From David + Cabecinhas (2017-03-16). + * Fixed descritpions of NUC100/120. From no1wudi (2017-03-16). + * XMC4500 Relax: Add basic board support infrastructure of Infineon + XMC4500 Relax Lite v1 (2017-03-16). + * Fix mksyscall host binary name. From Alan Carvalho de Assis + (2017-03-16). + * sem_holder: The logic for the list version is unchanged. From David + Sidrane (2017-03-16). + * sem_holder: Fixes improper restoration of base_priority. From David + Sidrane (2017-03-17). + * C Library: printf: Fix precision for string formatting. Fixes use + of format precision to truncate input string. From Jussi Kivilinna + (2017-03-17). + * vsnprintf(): If size is zero, then vsnprintf() should return the + size of the required buffer without writing anything. This is same + fix that was done for snprintf in 2014 by commit + 59846a8fe928abb389e3776ebdbb52022da45be3. From Jussi Kivilinna + (2017-03-17). + * Adds driver support for the XBox One controller. Currently only the + latest version (XBox One X) controller works. The older XBox One + controllers do not enumerate correctly. From Brian Webb (2017-03-17). + * USB Host driver for the XBox One game controller. From Brian Webb + (2017-03-18). + * ARM: Fix off-by-one interrupt stack allocation in 8-byte aligned + architectures. From David Cabecinhas (2017-03-18). + * configs/nucleo_f334r8: Add ADC example. From Mateusz Szafoni + (2017-03-18). + * mtd/progmem: Fix incorrect target address calculation. + progmem_read/write() is incorrectly calculating the target address, + expecting the offset argument is given in a block number. This is + completely wrong and as a result invalid flash region is accessed. + Byte-oriented read/write interfaces of mtd device accept the target + address in a byte offset, not a block number. From Heesub Shin + (2017-03-18). + * STM32F33: Move DMA logic to a separate files + add ADC support. From + Mateusz Szafoni (2017-03-18). + * Nucleo-F334R8: Add COMP support. From Mateusz Szafoni (2017-03-19). + * STM32F3: Add COMP support. From Mateusz Szafoni (2017-03-19). + * XMC4xxx/XMC4500 Relax: First, clean build of basic NSH configurtion + (2017-03-20). + * XMC4500-Relax: Add LED support (2017-03-20). + * input/mxt: Prevent overriding i2c transfer return value. + put_reg/get_reg function was overriding i2c transfer error code with + i2creset return value, that lead to OK status although actual + transfer failed. From Juha Niskanen (2017-03-21). + * drivers/audio/wm8904: WM8904 has same problem as that fixed by Juha + Niskanen in the MaxTouch driver (2017-03-21). + * drivers/lcd/st7565.c: Extend to include support for the AQM_1248A. + From Masayuki Ishikawa (2017-03-21). + * Fixed wrong assert on udp dgram send. From Pascal Speck (2017-03-21). + * sem_holder: Indexing error. From David Sidrane (2017-03-21). + + if (sem->holder[0].htcb != NULL || sem->holder[**1**].htcb != NULL) + * sched/semaphore: Convert strange use of DEBUGASSERT to DEBUGPANIC + (2017-03-21). + * sched/semaphore: Fix a warning aout an unused variable when priority + inheritance is enabled (2017-03-21). + * Clicker2-STM32: Add support for Mikroelektronika Clicker 2 for + STM32. From Anthony Merlino (2017-03-21). + * Implement DMA support for the stm32f4 I2C. Max and I have verified + that it works on our systems. From Rajan Gill (2017-03-21). + * drivers/lcd/st7565.c: Use ST7565_POWERCTRL_INT instead of + ST7565_POWERCTRL_BRF. From Masayuki Ishikawa (2017-03-21). + * SMP Kconfig: Change the minimum SMP_NCPUS to 1. From Masayuki + Ishikawa (2017-03-21). + * SMP: Setting CONFIG_SMP_NCPUS=1 should only be permitted in a debug + configuration (2017-03-22). + * Clicker2-STM32: Create src/, kernel/, and scripts/ directories + (2017-03-22). + * Clicker2-STM32: Add an NSH configuration (2017-03-22). + * Clicker2 STM32: Add SPI support (2017-03-22). + * XMC4xxx: Add FPU support. From David S. Alessio (2017-03-22). + * Clicker2-STM32: Add definitions for remaining mikroBUS pins + (2017-03-22). + * STM32: Fix erase sector number for microcontrolers with more than 11 + sectors. Erase a sector from the second bank cause the bit 4 of SNB + being set but never unsed, so trying to erase a sector from the first + bank was acually eraseing a sector from the second bank. From José + Roberto de Souza (2017-03-22). + * STM32: Make up_progmem thread safe. Writing to a flash sector while + starting the erase of other sector have a undefined behavior so lets + add a semaphore and syncronize access to Flash registers. But for + the semaphore to work it needs to be initialized so each board needs + call stm32_flash_initialize() on initialization, so to avoid runtime + problems it is only using semaphore and making it thread safe if + initialized, after all boards starts to call stm32_flash_initialize() + we can remove the boolean and the check. From José Roberto de Souza + (2017-03-22). + * STM32: Add workaround for flash data cache corruption on + read-while-write. This is a known hardware issue on some STM32 see + the errata of your model and if you make use of both memory banks you + should enable it. From José Roberto de Souza (2017-03-22). + * Clicker2-STM32: Add framework for MRF24J40 support. Untested and + still some missing logic (2017-03-22). + * STM32 Flash fixes. From José Roberto de Souza (2017-03-22). + * STM32F7: In stm32_allocateheap.c There are 5 not 4 configurations. + From David Sidrane (2017-03-23). + * Clicker2-STM32: Add logic to register the MRF24J40 radio character + device (2017-03-23). + * Clicker2-STM32: Add some mostly bogus MAC initializatinon logic + (2017-03-23). + * STM32 I2C: Do not allow CONFIG_I2C_POLLED and CONFIG_I2C_DMA. From + Rajan Gill (2017-03-23). + * stm32_flash: Need conditinal on non F4 targets. From David Sidrane + (2017-03-23). + * stm32_i2c_alt: Duplicate non CS dev of regval. From David Sidrane + (2017-03-23). + * stm32f40xxx_i2c: Duplicate non CS dev of regval. From David Sidrane + (2017-03-23). + * stm32_i2c_alt: Move def of regval to top func def per CS. From + David Sidrane (2017-03-31). + * stm322_flash: Missing unlock on F1 HSI off path. From David Sidrane + (2017-03-24). + * Fix compile error when disabled the flash data cache corruption for + stm32 f1xx. From no1wudi (2017-03-24). + * The interrupt occurs over the counter overflow. From Aleksandr + Vyhovanec (2017-03-24). + * I needed to use DS3231, I remember that in past it worked ok, but now + for stm32f4xx is used another driver (chip + specific, stm32f40xxx_i2c.c) and DS3231 driver doesn't work. After + investigating a problem I found that I2C driver (isr routine) has a + few places there it sends stop bit even if not all messages are + managed. So, e.g., removing stm32_i2c_sendstop (#1744) and adding + stm32_i2c_sendstart after data reading helps to make DS3231 working. + From Alexander Oryshchenko; verified by David Sidrane (2017-03-24). + * wireless/ieee802154: Adds IOCTL definitions for accessing PHY + layer. From Anthony Merlino (2017-03-24). + * Add ffsl(), ffsll(), fls(), flsl(), flsll() and use GCC's + __builtin_ctz/__builtin_clz for faster implementation of these. From + Jussi Kivilinna (2017-03-24). + * MRF24J40/Clicker2: Add an MRF24J40 radio configuration to the + Clicker2 STM32 board. Fix a few errors discovered during build + (2017-03-24). + * configs/: Rename all stm32_wireless.c files to stm32_cc3000.c + (2017-03-24). + * configs/: Rename all xyz_wifi.c files to stm32_cc3000.c (2017-03-24). + * Clicker2-STM32: Add usbnsh configuration (2017-03-25). + * drivers/analog: Add basic COMP driver. From Mateusz Szafoni + (2017-03-25). + * STM32F33: Support for COMP character driver. From Mateusz Szafoni + (2017-03-25). + * Nucleo-F334R8: Use new COMP driver. From Mateusz Szafoni + (2017-03-25). + * stm32/Kconfig: Update COMP and OPAMP definitions. From Mateusz + Szafoni (2017-03-26). + * pthreads: Add more robustness characteristics: pthread_mutex_lock() + and trylock() will now return EOWNERDEAD if the mutex is locked by a + thread that no longer exists. Add pthread_mutex_consistent() to + recover from this situation (2017-03-26). + * pthread: Fix return value of pthread_give/takesemaphore(). Add + option to pthread_takesemaphore to ignore EINTR or not (2017-03-26). + * pthreads: Partial implementation of final part of robust mutexes: + Keep list of all mutexes held by a thread in a list in the TCB + (2017-03-26). + * when pthread exits or is cancelled, mutexes held by thread are marked + inconsistent and the highest priority thread waiting for the mutex is + awakened (2017-03-26). + * pthreads: Add a configuration option to disable robust mutexes and + revert to the traditional unsafe mutexes (2017-03-26). + * pthread mutexes: Add option to support both unsafe and robust + mutexes via pthread_mutexattr_get/setrobust() (2017-03-26). + * pthread mutexes: Finish logic to support configuration mutex + robustness (2017-03-27). + * Rename CONFIG_MUTEX_TYPES to CONFIG_PTHREAD_MUTEX_TYPES (2017-03-27). + * Make sure that CONFIG_PTHREAD_MUTEX_ROBUST=y is selected every + configuration that enabled pthreads (2017-03-27). + * Add syscall support for pthread_mutex_consistent() (2017-03-27). + * Include wcstold in C++ cwchar header file. From Alan Carvalho de + Assis (2017-03-27). + * AT86RF23x: Clean-up, standardize lower half interface. Take + advantage of new OS features for interrupt parameter passing + (2017-03-27). + * MRF24J40: Take advantage of new OS features for interrupt parameter + passing (2017-03-27). + * lcd/: PCF8574 backpack logic needs to include poll.h + CONFIG_DISABLE_POLL is not set (2017-03-27). + * drivers/analog: Add driver for the LTC1767L ADC. From Martin + Lederhilger (2017-03-28). + * realloc(): When realloc() has to fall back to calling malloc(), size + including overhead was being provided to malloc(), causing a slightly + larger allocation than needed. Noted by initialkjc@yahoo.com + (2017-03-28). + * Fix PTHREAD_MUTEX_INITIALIZER which was not updated with last mutex + changes. From Jussi Kivilinna (2017-03-28). + * STM32 F7: Add stm32 RNG support. This is copied from stm32l4. + Tested on STM32F746ZG board. From Juha Niskanen (2017-03-29). + * STM32 RNG: Fix semaphore initial value and disable priority + inheritance. From Juha Niskanen (2017-03-29). + * Fix an assertion noted by Jussi Kivilinna. This was a consequence of + the recent robust mutex changes. If robust mutexes are selected, + then each mutex that a thread takes is retained in a list in threads + TCB. If the thread exits and that list is not empty, then we know + that the thread exitted while holding mutexes. And, in that case, + each will be marked as inconsistent and the any waiter for the thread + is awakened. For the case of pthread_mutex_trywait(), the mutex was + not being added to the list! while not usually a fatal error, this + was caught by an assertion when pthread_mutex_unlock() was called: + It tried to remove the mutex from the TCB list and it was not there + when, of course, it shoule be. The fix was to add + pthread_mutex_trytake() which does sem_trywait() and if successful, + does correctly add the mutext to the TCB list. This should + eliminated the assertion (2017-03-29). + * 6LoWPAN: IEEE802.15.4 MAC driver will need a special form of the + network device structure to manage fragmentation of the large packet + into frames (2017-03-29). + * wireless/ieee802154: Adds MAC character driver structure. + Nonfunctional. From Anthony Merlino (2017-03-29). + * configs/clicker2-STM32: Adds logic to create an 802.15.4 MAC and + register a character driver. From Anthony Merlino (2017-03-29). + * net/local: connect: Fix warning with gcc-arm-none-eabi-5-2016q1. + Using compiler from gcc-arm-none-eabi-5-2016q1 toolchain: + + gcc version 5.3.1 20160307 (release) [ARM/embedded-5-branch revision 234589] (GNU Tools for ARM Embedded Processors) + + gives error: + + local/local_connect.c:188:7: error: '_local_semtake' is static but used in inline function 'local_stream_connect' which is not static [-Werror] + + this is due to compiler enforcing ISO/IEC 9899:1999 6.7.4.3: "An + inline definition of a function with external linkage shall not + contain a definition of a modifiable object with static storage + duration, and shall not contain a reference to an identifier with + internal linkage." Fix by making inlined caller to have internal + linkage as well. From Juha Niskanen (2017-03-30). + * Add entropy pool and strong random number generator. Entropy pool + gathers environmental noise from device drivers, user-space, etc., + and returns good random numbers, suitable for cryptographic use. + Based on entropy pool design from *BSDs and uses BLAKE2Xs algorithm + for CSPRNG output. Patch also adds /dev/urandom support for using + entropy pool RNG and new 'getrandom' system call for getting + randomness without file-descriptor usage (thus avoiding + file-descriptor exhaustion attacks). The 'getrandom' interface is + similar as 'getentropy' and 'getrandom' available on OpenBSD and + Linux respectively. From Jussi Kivilinna (2017-03-30). + * Change STM32 tickless to use only one timer. From Konstantin + Berezenko (2017-03-30). + * drivers/sensors: Add driver for ST HTS221 humidity sensor. From Juha + Niskanen (2017-03-30). + * HTS221 driver: Modify to use new interrupt parameter passing hooks + (2017-03-31). + * drivers/sensors: Add driver for ST LPS25H pressure sensor. From + Juha Niskanen (2017-03-31). + * drivers/usbmisc: Add driver for Fairchild FUSB301 USB type-C + controller. From Harri Luhtala . Tested + with earlier version of NuttX; with current version checked that it + compiles. Via Juha Niskane (2017-03-31). + * Add user-space networking stack API (usrsock). User-space networking + stack API allows user-space daemon to provide TCP/IP stack + implementation for NuttX network. Main use for this is to allow use + and seamless integration of HW-provided TCP/IP stacks to NuttX. For + example, user-space daemon can translate /dev/usrsock API requests to + HW TCP/IP API requests while rest of the user-space can access + standard socket API, with socket descriptors that can be used with + NuttX system calls. From Jussi Kivilinna (2017-03-31). + * STM32F7: Add support for LSE RTC and enable RTC subseconds. From + Jussi Kivilinna (2017-03-31). + * TCP/IPv6: Fix a compile issue when IPv6, but not IPv4 is enabled + (2017-03-31). + * net/: Fix MULTINIC/MULTILINK selection when 6LoWPAN selected + (2017-03-31). + * net/: Permit net/neighbor to build when IPv6 is defined, but not + Ethernet. Needs more work to support 6LoWPAN (2017-03-31). + * stm32f7: Serial fix for dropped data: (1) Revert the inherited dma + bug from the stm32. see + https://bitbucket.org/nuttx/nuttx/commits/df9ae3c13fc2fff2c21ebdb098c520b11f43280d + + for details. And (2) Most all CR1-CR3 settings can not be configured + while UE is true. Threfore we make all operation atomic and disable + UE and restore it's originalstate on exit. From David Sidrane + (2017-03-31). + * stm32f7: stm32_sdmmc removed stray semicolon. From David Sidrane + (2017-03-31). + * 6LoWPAN: Contiki 6LoWPAN port is now complete (but completely + untested) (2017-04-02). + * iee802154 loopback: Eliminate dependency on CONFIG_NET_LOOPBACK + (2017-04-02). + * drivers/sensors: Add driver for ST LIS2DH accelerometer. From Timo + Voutilainen et al. via Juha Niskanen + (2017-04-03). + * net/socket/accept: Fix building with CONFIG_NET_LOCAL_STREAM. From + Jussi Kivilinna (2017-04-03). + * STM32: Fix IWDG and WWDG debug mode stop for STM32L15XX. From Juha + Niskanen (2017-04-03). + * STM32: Add STM32L162VE to chip.h. From Juha Niskanen (2017-04-03). + * iee802154 loopback: Eliminate dependency on CONFIG_NET_LOOPBACK + (2017-04-02). + * sim: Add a configuration for testing 6LoWPAN (2017-04-03). + * wireless/ieee802154: Add initialization logic for loopback driver; + configs/sim: Add configuration for testing 6LoWPAN; net/sixlowpan: + Fix for compilation with debug output enabled (2017-04-03). + * 6LoWPAN: Updates/fixes from initial testing with the IEEE802.15.4 + loopback driver (2017-04-03). + * STM32: Add I2C3 SDA pin mapping for STM32F411. From no1wudi + (2017-04-04). + * sensors: lis2dh: Fix hardfault when reading from unconfigured + sensor. From Juha Niskanen (2017-04-04). + * STM32: stm32_flash: Add EEPROM writing for STM32L15XX. From Juha + Niskanen (2017-04-04). + * 6LoWPAN: Add option to dump buffers (2017-04-04). + * STM32: stm32l15xx_rcc: Add support for using MSI as system clock. + From Juha Niskanen (2017-04-05). + * STM32: stm32l15xxx_rcc: configure medium performance voltage range + and zero wait-state when allowed by SYSCLK setting. Zero wait-state + for flash can be configured when: (1) Range 1 and SYSCLK <= 16 Mhz, + (2) Range 2 and SYSCLK <= 8 Mhz, or (3) Range 3 and SYSCLK <= 4.2 + Mhz. Medium performance voltage range (1.5V) can be configured when + SYSCLK is up to 16 Mhz and PLLVCO up to 48 Mhz. From Juha Niskanen + (2017-04-05). + * wireless/ieee802154: Initial MAC char driver write functionality. + From Anthony Merlino (2017-04-05). + * photon: wlan support. From Simon Piriou (2017-04-03). + * Document set [{+|-}{e|x|xe|ex}] [ ]. From David Sidrane + (2017-04-05). + * STM32: Fix SYSCFG_CFGR1_I2C_PBXFMP_SHIFT value. From Alan Carvalho + de Assis (2017-04-06). + * STM32F7: Serial: Add interface to get uart_dev_t by USART number, + stm32_serial_get_uart. From Jussi Kivilinna (2017-04-06). + * STM32F7: Default CONFIG_STM32F7_DMACAPABLE to 'n'. STM32F7 does not + have CCM RAM but DTCM, so this option does not need to enabled. DTCM + RAM is DMA-able through CPU AHBS bus. From Jussi Kivilinna + (2017-04-06). + * STM32F7: Fix UART7 and UART8 IFLOWCONTROL options. From Jussi + Kivilinna (2017-04-06). + * STM32F7: Add warning for RXDMA + IFLOWCONTROL combination. + Combination of RXDMA + IFLOWCONTROL does not work as one might + expect. Since RXDMA uses circular DMA-buffer, DMA will always keep + reading new data from USART peripheral even if DMA buffer underruns. + Thus this combination only does following: RTS is asserted on USART + setup and deasserted on shutdown and does not perform actual RTS + flow-control. Data loss can be demonstrated by doing long up_mdelay + inside irq critical section and feeding data to RXDMA+IFLOWCONTROL + UART. From Jussi Kivilinna (2017-04-06). + * sim/sixlowpan: Now supports apps/examples/udpblaster too (2017-04-06). + * SAMV7: Watchdog: Fix Forbidden Window Value. According the Datasheet + the WDD Value is the lower bound of a so called Forbidden Window and + to disable this we have to set the WDD Value greater than or equal to + the WDV Value. This seems to be a bug in the datasheet. It looks + like we have to set it to a greater value than the WDV to really + disable this Thing. When triggering the Watchdog faster than the + (very slow) clock source of the Watchdog fires, this Forbidden Window + Feature resets the System if WDD equals to WDV. This Changeset + disables the Forbidden Window by setting the WDD Value to the Maximum + (0xfff) Value possible. From Frank Benkert (2017-04-06). + * RTC: Add interface for check if RTC time has been set. New interface + allows checking if RTC time has been set. This allows to application + to detect if RTC has valid time (after reset) or should application + attempt to get real time by other means (for example, by launching + ntpclient or GPS). From Jussi Kivilinna (2017-04-06). + * 6LoWPAN: Add network IOCTL support to set the node address + (2017-04-06). + * EFM32 I2C: Fix timeout calculation. From Masayuki Ishikawa + (2017-04-06). + * Disable serial console on stm32f103-minimum usbnsh example project + config. Devices enumerate after this change. From Bob Ryan + (2017-04-07). + * pthreads: Adding rwlock implementation. Adding an implementation for + read/write locks into the pthread library. These locks are writer + priority, such that if any writers come in they are given priority + for writing. From Mark Schulte (2017-04-07). + * pthread rwlock bugfixes. From Mark Schulte (2017-04-07). + * 6LoWPAN: Add calculation of TCP header size. It is not a constant + (2017-04-07). + * Restore TCP_HDRLEN to MSS calculation. Also add to UDP MSS + calculation where it never appearred. Add some missing MSS and + RDVWNDO definitions for 6loWOPAN (2017-04-08). + * pthread.h: Remove duplicate, possible erroneous definition of + PTHREAD_MUTEX_INITIALIZER that crept in with some recent changes + (2017-04-08). + * pthread.h: Fix rwlock initializer. From Mark Schulte (2017-04-08). + * Add configuration/build support for an IEEE802.15.4 network device + (2017-04-08). + * Fix some old-style interrupt handling logic in drivers/net/skeleton.c + (2017-04-08). + * wireless/ieee802154: Add a implementation of the IEEE802.15.4 + network driver. This is very incomplete on the initial commit + (2017-04-08). + * Buttons: Change return value of board_buttons() and the type of + btn_buttonset_t to uint32_t so that more than 8 buttons can be + supported (2017-04-09). + * Add support for NuttX controlled LEDS and for board_initialize. + Separate initialization logic to stm32_bringup.c so that in + initialization can occur either through board_initialize() or through + board_app_initialize(). Same as with most other newer board + configurations (2017-04-09). + * net procfs: Some long lines were being generated that cause + buffer-related problems and corrupted output (2017-04-09). + * stm32 COMP: Logic in stm32_comp.h must be configured on + CONFIG_STM32_COMP or otherwise it causes an error via #error on every + platform without COMP support (2017-04-09). + * Photon: Add logic to automatically mount the procfs file system on + startup. Fix some LED-related configuration conflicts (2017-04-09). + * Buttons: Correct some comments left after last button-related + change: 32- vs 8-bit bit set (2017-04-09). + * pthread: Use cancel cleanup handlers in rwlock. From Juha Niskanen + (2017-04-10). + * STM32F7: serial: disallow broken configuration combination of + CONFIG_STM32F7_FLOWCONTROL_BROKEN=y and + CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS not set. From Jussi Kivilinna + (2017-04-11). + * STM32F7: serial: do not stop processing input in SW flow-control + mode. From Jussi Kivilinna (2017-04-11). + * STM32XX: Fix Pending Register definition. From Alan Carvalho de + Assis (2017-04-11). + * Add logic to disable cancellation points within the OS. This is + useful when an internal OS function that is NOT a cancellation point + calls an OS function which is a cancellation point. In that case, + irrecoverable states may occur if the cancellation is within the OS. + From Juha Niskanen (2017-04-11). + * Fix LLVM libc++ undefined reference to __cxa_guard_*. From Alan + Carvalho de Assis (2017-04-11). + * libc/netdb: in dns_query_callback, ret != -EADDRNOTAVAIL condition + consumes error returns including EAGAIN in this case, dns query + retransmission doesn't work. From Ritajina (2017-04-12). + * STM32L4 DMA: Correct bad channel definition. From Sebastien Lorquet + (2017-04-12). + * TUN driver: Implement TAP (OSI layer 2) mode. Enable by setting the + IFF_TAP flag instead of the IFF_TUN flag in ifr_flags. From Thomas + Keh (2017-04-13). + * Adds USB host support to stm32f411-disco board. From Brian Webb + (2017-04-13). + * ieee802.15.4 radio: Add data structure definitions for Radio IOCTLs + (2017-04-13). + * ieee802.15.4 MAC: Add data structure definitions for MAC IOCTLs + (2017-04-13). + * ieee802154 radio: Implement IOCTL decode and dispatch in all radio + drivers (2017-04-13). + * drivers/net/skeleton.c: Add support for IOCTL handling (2017-04-13). + * ieee802.15.4 netdev: Add IOCTL support (2017-04-13). + * ieee802.15.4 radio: Remove interface methods that duplicate IOCTL + commands (2017-04-13). + * ieee802.15.4: de-couple MAC driver interface. Now works more like + other drivers (2017-04-13). + * sched: Fix tg_flags check with GROUP_FLAG_NOCLDWAIT. From Masayuki + Ishikawa (2017-04-14). + * Add basic support for STM32F0. From Alan Carvalho de Assis + (2017-04-14). + * Add stm32f0discovery board support. From Alan Carvalho de Assis + (2017-04-14). + * arch/arm/Kconfig: Add option for STM32F0 (2017-04-14). + * IEEE802.15.4: There is only one instance of the IEEE802.15.4 MAC + lower level. There is no need for the interface to be indirect via a + vtable. In this case, standard global functions should be used + (2017-04-14). + * ieee802.15.4: New global functions exported by the lower MAC layer + should be private to the MAC module. Function prototypes moved from + include/nuttx/wireless/ieee802154/ieee802154_mac.h to + wireless/ieee802154/mac802154.h (2017-04-14). + * radio802154_device.c now accesses the PHY layer via the IOCTL helper + functions (2017-04-14). + * photon: Add sdpcm + thread support for wlan. From Simon Piriou + (2017-04-13). + * Not a clean fix, but at least makes DHCP working with + CONFIG_NETDEV_MULTINIC. From Andreas Bihlmaier (2017-04-15). + * networking: IPv4 change of last PR should also be applied to + corresponding IPv6 logic (2017-04-15). + * 6LoWPAN: Add some checks for the case where there are multiple + network devices and multiple link layer protocols (2017-04-15). + * net/: Add IOCTL support for forwarding IEEE802.15.4 MAC and PHY + IOCTLs (2017-04-15). + * Argument of network device IOCTL should be unsigned long, just as + will all other IOCTL methods (2017-04-15). + * wireless/ieee802154: Adds ability to receive notifications from MAC + char driver. From Anthony Merlino (2017-04-05). + * wireless/ieee802154/mrf24j40: Added bind method. From Anthony + Merlino (2017-04-15). + * wireless/ieee802154: Starts adding MAC request data functionality. + From Anthony Merlino (2017-04-15). + * wireless/ieee802154: Starts defining interface between PHY layer and + next highest layer. From Anthony Merlino (2017-04-15). + * wireless/ieee802154: Skeleton code for request associate. From + Anthony Merlino (2017-04-15). + * wireless/ieee802154: Bind MAC phyif to radio. From Anthony Merlino + (2017-04-15). + * STM32: Provide TIM5 definition for STM32F429. From Matias v01d + (2017-04-15). + * photon: Add sdpcm tx basic support. From Simon Piriou (2017-04-16). + * photon: Request firmware version and MAC address. From Simon Piriou + (2017-04-16). + * 6LoWPAN network driver: Still only a skeleton but has some added + thought experimentation (2017-04-16). + * 6LoWPAN: Correct ordering of headers. fragmentation header was + coming out before FCF (2017-04-16). + * wireless/ieee802154: Continues development on transmit structure. + From Anthony Merlino (2017-04-17). + * STM32F0: Enable the clock for all GPIO ports. From Alan Carvalho de + Assis (2017-04-17). + * STM32F0: Fix HSI clock definition. From Alan Carvalho de Assis + (2017-04-17). + * STM32F0: Fix System Clock value to 48MHz and remove MCLK + definition. From Alan Carvalho de Assis (2017-04-17). + * Update coding standard document to discuss un-named structure fields + (2017-04-17). + * STM32F0: Add basic support for STM32F07x family (2017-04-17). + * STM32F0: Move enabling of GPIO peripherals form UART setup to + clockconfig. This is not a UART function. It is needed by all + peripherals (2017-04-17). + * STM32F0: Add logic to enable other USARTs. No UART4/5. Rather + USART4/5 (2017-04-17). + * STM32F7: Warn if no DMA2 configured when using ADC with DMA. Also + correct ADC channel numbers that DMA callback passes to upper half + driver. From Juha Niskanen (2017-04-18). + * STM32F7: stm32_adc: Do not override ADCPRE_DIV when measuring + internal voltage. From Juha Niskanen (2017-04-18). + * Move CONFIG_ADC_NO_START_CONV from drivers/adc/Kconfig to + arch/arm/src/stm32[f7]/Kconfig as STM32[F7]_ADC_NO_START_CONV. + Refresh all configurations with any reference to + CONFIG_ADC_NO_START_CONV (2017-04-18). + * STM32F0: The STM32F2 does not have use alternate function groupings + as does the F1. Rather, it is like other members of the STM32 family + with An alternate setting AF0-AF7 for each pin (2017-04-18). + * Nucleo-F072RB: Add board configuration (2017-04-18). + * wireless/ieee802154: Lots of small fixes to eliminate build issues. + Generally cleans things up and fixes lots of small issues preventing a + successful build. Does not completely build, but there are + significantly less errors. From Anthony Merlino (2017-04-18). + * Coding standard: Defining structures within the scope of another + structure is discouraged (2017-04-18). + * Nucleo-F072RB: Enable board_app_inititalize, procfs, and built-in + functions (2017-04-19). + * wireless/ieee802154: Simplifies MAC callback interface. Adds + missing data type definitions. From Anthony Merlino (2017-04-19). + * wireless/ieee802154: Renames mac802154_devwrapper_s to + mac802154_chardevice_s. From Anthony Merlino (2017-04-19). + * wireless/ieee802154: Changes radio interface to match MAC callback + design. From Anthony Merlino (2017-04-19). + * 6LoWPAN: Fix a missing source address in header. Correct + calculation of payload size (2017-04-19). + * SAMV7 EMAC: Add conditional logic to account the fact that the + SAMV71 has 6 rather than 3 queues after version 1. From Ian McAfee + (2017-04-19). + * wireless/ieee802154: Starts structuring transmission completion + handling. From Anthony Merlino (2017-04-19). + * 6LoWPAN: Add an IOCTL to set the IEEE802.15.4 PAN ID (2017-04-19). + * STM32 L1: stm32l15xx_rcc: Allow board to configure HSE clock in + bypass-mode. Allows using MCO output from ST-link chip (on Nucleo + and Discovery boards) as HSE input. From Juha Niskanen (2017-04-20). + * Add support for STM32L152CC, STM32L152RC and STM32L152VC. Update + some bits and comments for other STM32L1 parts in chip.h. From Juha + Niskanen (2017-04-20). + * UART 16550: Missing left parenthesis in function prototype. This is + Bitbucket Issue #41 (2017-04-20). + * procfs: Fix wrong member IDs are displayed when 'cat + /proc//group/status'. From Nobutaka Toyoshima (2017-04-28). + * STM32F0: Add support for HSI48 (2017-04-20). + * STM32F0: Add an untested port of the F1 USB device to the STM32F0 + (2017-04-20). + * Move include/nuttx/net/iob.h to include/drivers/iob.h; rename + CONFIG_NET_IOB to CONFIG_DRIVERS_IOB (2017-04-20). + * Move net/iob to drivers/iob so that the I/O buffering feature can be + available to other drivers when networking is disabled (2017-04-20). + * VFS poll(): Add some error handling logic (2017-04-20). + * Add support for the STM32F09X family. From Juha Niskanen (2017-04-21). + * clock: Add clock_resynchronize and use subseconds RTC. Add + clock_resynchronize for better synchronization of CLOCK_REALTIME and + CLOCK_MONOTONIC to match RTC after resume from low-power state. Add + up_rtc_getdatetime_with_subseconds under + CONFIG_ARCH_HAVE_RTC_SUBSECONDS to allow initializing (and + resynchronizing) system clock with subseconds accuracy RTC. From + Jussi Kivilinna (2017-04-21). + * clock: Add new type ssystime_t for relative 64-bit ticks, change + ticks<->time conversion functions to use ssystime_t. From Jussi + Kivilinna (2017-04-21). + * clock: add testing for 32-bit overflow of 64-bit system timer. From + Jussi Kivilinna (2017-04-21). + * wireless/ieee802154: Simplifies TX completion interface. Documents + and cleans up some functions. From Anthony Merlino (2017-04-21). + * Remove the 6LoWPAN PANID IOCTLs they are redundant (2017-04-21). + * 6LoWPAN: Remove the PAN ID from the 6LoWPAN data structure. This is + owned by the radio driver. Rather, use an IOCTL to obtain the PAN ID + from the downstream radio driver (2017-04-21). + * photon: Add basic wlan scan function. From Simon Piriou (2017-04-22). + * 6LoWPAN: Separate MAC-related definitions from sixlowpan.h. Put in + ieee802154.h (2017-04-22). + * net/: network drver now retains Ethernet MAC address in a union so + that other link layer addresses may be used in a MULTILINK + environment (2017-04-22). + * 6LoWPAN: Add IEEE802.15.4 Rime address to union of link layer + addresses in the network driver (2017-04-22). + * SAM3/4: Fixed configurations for TWI master. Obviously an + incomplete port from SAMA5 (2017-04-23). + * SAM3/4: Remove inappropriate semicolon. From kc_dtm (2017-04-23). + * configs/photon: Add DOWNLOAD function to upload firmware through + DFU. From Simon Piriou (2017-04-23). + * drivers/ieee80211/: Change all occurrences of _info, _warn, and _err + to wlinfo, wlwarn, and wlerr (2017-04-23). + * USBMSC: Fix a wrong lun number issue. From Masayuki Ishikawa + (2017-04-24). + * sched: Fix CHILD_FLAG_EXITED in include/nuttx/sched.h. From + Masayuki Ishikawa (2017-04-24). + * wireless/ieee80211: Add skeleton for a broadcom network driver + (2017-04-24). + * wiress/ieee80211: Broadcom network driver needs to register as an + ieee802.11 driver, not an Ethernet driver (2017-04-24). + * wireless/ieee80211: Add broadcom network device registration logic + (2017-04-24). + * drivers/wireless/bcmf: Register network driver + update defconfig + file. From Simon Piriou (2017-04-24). + * procfs: Fix incorrect uptime with CONFIG_SYSTEM_TIME64. From + Masayuki Ishikawa (2017-04-25). + * configs/photon/wlan: Minor config changes to get a clean build + (2017-04-25). + * STM32L4: Add support for the STM32L496XX family. From Juha Niskanen + (2017-04-25). + * configs/photon: Rename ld.script to photon_jtag.ld for symmetry + (2017-04-25). + * configs/photon/src/stm32_wlan.c: Remove unused, inappropriate + network driver registration (2017-04-25). + * netdev_register: If there is only one ieee80211 and both + CONFIG_ETHERNET and CONFIG_DRIVERS_IEEE8011, then use the wlan0 + naming, not the eth0 naming (2017-04-25). + * configs/nucle-f072rb/nsh: Correct amount of available SRAM in + defconfig (2017-04-26). + * CONFIG_DEBUG_HARDFAULT should be available for Cortex-M0 too + (2017-04-26). + * drivers/wireless/bcmf: Enable DMA for SDIO transfers. From Simon + Piriou (2017-04-26). + * configs: Remove all setenv.bat files. Remove all references to + setenv.sh and setenv.bat from all config README files (2017-04-26). + * drivers/syslog: Use monotonic clock for timestamp when available. + From Jussi Kivilinna (2017-04-26). + * Enable wireless IOCTL commands in photon/wlan configuration + (2017-04-26). + * Network IOCTLs: Correct a compilation error when wireless IOCTLs are + enabled (2017-04-26). + * binfmt/elf: Fix offset value when calling elf_read() in + elf_symname(). From Masayuki Ishikawa (2017-04-26). + * STM32, STM32F7, STM32L4: Remove incorrect comment about STM32L1 + LSE/RTC/LCD. From Juha Niskanen (2017-04-27). + * STM32L4: Add some defines for the new peripherals in STM32L496 + parts. From Juha Niskanen (2017-04-27). + * STM32F0: Fix some missing settings in the clock configuration logic + (2017-04-27). + * IOCTLS. Separate wireless character driver IOCTL commands from + wireless network driver IOCTL commands. Move from wireless.h to + ioctl.h (2017-04-27). + * IEEE 802.15.4: Move MAC character driver IOCTL commands from + ieee802154_mac.h to ieee802154_ioctl.h (2017-04-27). + * Wireless IOCTLs: Correct use of _WLIOC where _WLCIOC is required + (2017-04-27). + * net/socket: Fix cloning of local and raw sockets. From Jussi + Kivilinna (2017-04-28). + * STM32L4: stm32l4_i2c: Add I2C4 code. From Juha Niskanen (2017-04-28). + * STM32L4: I2C was not using current interrupt handling parameter + passing logic (2017-04-28). + * vfs/poll: round timeout up to next full tick. Calling poll() with + timeout less than half tick (thus MSEC2TICK(timeout) => 0) caused + returning error with EAGAIN. Instead of rounding timeout down, value + should be rounded up. Open Group spec for poll says: + "Implementations may place limitations on the granularity of timeout + intervals. If the requested timeout interval requires a finer + granularity than the implementation supports, the actual timeout + interval will be rounded up to the next supported value." From Jussi + Kivilinna (2017-04-28). + * In last change to poll(), converted timeout to unsigned to eliminate + the possibility of overflow of signed overflow (2017-04-28). + * drivers/wireless/bcmf: Add escan ioctls support + cleanup. From + Simon Piriou (2017-04-28). + * Add all network IOCTLs to include/sys/ioctl.h (2017-04-28). + * Add all ieee802.15.4 IOCTLs to include/sys/ioctl.h (2017-04-28). + * 6LoWPAN: Can't reuse same header on each fragment. DSN needs to + increment (2017-04-29). + * SPI: Add an instance argument to the SPIDEV definitions (2017-04-29). + * STM32F0: Add some protection. There is only one interrupt for + USART3-8. Current interrupt handling logic will support only one + interrupt in that range (2017-04-29). + * STM32F0 I2C: Initial cut at driver. Still a work in progress. From + Alan Carvalho de Assis (2017-04-29). + * STM32F33: Add OPAMP support. From Mateusz Szafoni (2017-04-30). + * drivers/analog: Add basic OPAMP driver. From Mateusz Szafoni + (2017-04-30). + * Nucleo-F334R8: Add OPAMP support. From Mateusz Szafoni (2017-04-30). + * Nucleo-F072RB: Add support for the I2C driver used by I2C tools + (2017-04-20). + * drivers/i2c: Fix compile issus if CONFIG_DISABLE_PSEUDOFS_OPERATIONS + is enabled (2017-04-30). + * STM32F0 I2C: Update driver to use the standard interrupt parameter + passing logic (2017-04-30). + * STM32F0 I2C: Pin definitions should specify open drain (and probably + 50Mhz) (2017-04-30). + * EFM32, STM32, and STM32 F7 I2C: Update to use the standard parameter + passing to interrupt handlers (2017-04-30). + * drivers/wireless/bcmf: Add netdev support for Broadcom FullMAC + driver. From Simon Piriou (2017-04-30). + * Tiva I2C: Update to use the standard parameter passing to interrupt + handlers (2017-04-30). + * ieee802.11: Bring some BSD licensed header files in from FreeBSD + (2017-04-30). + * Clicker2-STM32: Add protected build knsh configuration (2017-05-01). + * STM32F0: Fix I2C frequency table. From Alan Carvalho de Assis + (2017-05-01). + * STM32F0: I2C frequency quantization. Add logic to get closer if an + oddball frequency is used (2017-05-01). + * pthread: Fix compilation error on pthread_cond_wait when + CONFIG_CANCELLATION_POINTS and CONFIG_PTHREAD_MUTEX_UNSAFE are + enabled. From EunBong Song (2017-05-02). + * binfmt/elf: Fix offset value when calling elf_read() in + elf_sectname(). From Masayuki Ishikawa (2017-05-02). + * configs: Add nucleo-l496zg board files. From Juha Niskanen + (2017-05-02). + * configs: Add nucleo-f091rc board files. From Juha Niskanen + (2017-05-02). + * STM32L4: Don't think these chips have DPFPU, DTCM or ITCM. From + Juha Niskanen (2017-05-02). + * STM32L4: Add GPIO_PORTI definition. From Juha Niskanen (2017-05-02). + * STM32L4: Delete more references to DFPU, ITCM, and DTCM (2017-05-02). + * wireless/ieee802154: Changes transmit data path to use IOBs and + exposes function for getting size of MAC header. From Anthony + Merlino (2017-05-02). + * Extend wireless.h with definitions needed by wext. From Simon Piriou + (2017-05-02). + * drivers/wireless/bcmf: implement basic wext interface for + authentication. From Simon Piriou (2017-05-02). + * First attempt at a nucleo-l432kc board. From Sebastien Lorquet + (2017-05-02). + * STM32F7: Flash: macro naming errors, there is no FLASH_CONFIG_F for + F7. From Juha Niskanen (2017-05-02). + * STM32L4: stm32l4x6xx_pinmap: Update I2C4 and DCMI pins. From Juha + Niskanen (2017-05-02). + * 6LoWPAN: Add basic call path to interface with the MAC layer through + the MAC network driver. Logic has not yet been implemented. This is + just a structural change in preparation for additional changes + (2017-05-02). + * wireless/ieee802154: Sets up default PIB attributes. From Anthony + Merlino (2017-05-02). + * wireless/ieee802154: Finishes some IOCTL logic for MAC layer. From + Anthony Merlino (2017-05-02). + * 6LoWPAN: Changes to use new MAC interfaces. Incomplete and needs + some clean-up of dangling, unused definitions (2017-05-03). + * wireless/ieee802154: Starts work on setting PIB attributes. From + Anthony Merlino (2017-05-03). + * 6LoWPAN: Fixes hang in loopback test (2017-05-03). + * drivers/wireless/bcmf: Fix frame not freed when dropped + cleanup. + From Simon Piriou (2017-05-03). + * STM32L4: stm32l4_i2c: Change wrong macro to CONFIG_I2C_POLLED. From + Juha Niskanen (2017-05-04). + * STM32L4: modularize Kconfig to support different product + lines/families. This is modeled after STM32F7. Idea is to declare + each chip in Kconfig but allow for flash size override. Commit adds + many STM32L4_HAVE_XXX feature test macros. From Juha Niskanen + (2017-05-02). + * STM32L4: Changes needed for STM32L452 and Nucleo-L452RE board. GPIO + and UART seem similar across STMicro product matrix, so renamed files + accordingly. RCC is cloned just in case, while conflicting + differences there seem to be very minor. From Juha Niskanen + (2017-05-02). + * STM32L4: Flash: update override config macros and add + FLASH_CONFIG_B. From Juha Niskanen (2017-05-02). + * configs: Add nucleo-l452re board files. From Juha Niskanen + (2017-05-04). + * fixedmath: Add square root and b32_t conversion operators. From + Jussi Kivilinna (2017-05-04). + * Fix STM32F7 I2C interrupt handler. From Jussi Kivilinna (2017-05-04). + * STM32F7 serial: Allow configuring Rx DMA buffer size. From Jussi + Kivilinna (2017-05-04). + * 6LoWPAN: Replace Rime address naming with more consistent + short/exended address terminology (2017-05-04). + * 6LoWPAN: Remove all ieee802.15.4 MAC knowledge from 6LoWPAN. Now + relies on wires/ieee802154 for all MAC-related operations (2017-05-04). + * 6LoWPAN: Local address length is fixed by the configuration. The + remote address be with short or extended (2017-05-04). + * STM32L4: Separate SYSCFG into product line specific files for + clarity. From Juha Niskanen (2017-05-05). + * STM32L4: firewall for stm32l4x3xx. Not tested for any product + family, but now it at least compiles. L496 devices can have one bit + wider Volatile Data Segment. From Juha Niskanen (2017-05-05). + * STM32L4: Add more chips to Kconfig. This also removes + DPFPU/DTCM/ITCM features again, fixing a recent git history hickup. + From Juha Niskanen (2017-05-05). + * configs/nucleo-l496zg: Kconfig was copied from nucleo-144. Removed + as most options have not been tested. From Juha Niskanen (2017-05-05). + * nucleo-144: Default for choice in Kconfig was not one of the + possible choices (2017-05-05). + * Kinetis: Add TPM to K66 chip. From David Sidrane (2017-05-05). + * Kinetis: Fixed CLKSRC Bit Names. From David Sidrane (2017-05-05). + * Kinetis: Add OSC_DIV to the kinetis_osc header. From David Sidrane + (2017-05-05). + * Kinetis: Use optional BOARD_OSC_CR and BOARD_OSC_DIV in clock + configuration. From David Sidrane (2017-05-05). + * Kinetis: Added HW flow control and termios. From David Sidrane + (2017-05-05). + * wireless/ieee802154: Changes rxenable at radio layer. From Anthony + Merlino (2017-05-03). + * wireless/ieee802154: Finishes promiscuous mode IOCTL. From Anthony + Merlino (2017-05-03). + * wireless/ieee802154: Removes radio IOCTL. Starts bringing radio and + MAC closer with well-defined interface. From Anthony Merlino + (2017-05-05). + * STM32L4: Add support for many new MCUs from STM32L4X3XX product line + and Nucleo-L452 board. From Juha Niskanen (2017-05-05). + * 6LoWPAN: Use information in struct ieee802154_data_ind_s when + reassembling a packet (2017-05-05). + * ieee 802.15.4: Add a pool-based memory allocator for RX frame + meta-data (2017-05-05). + * kinetis k66, k64, k60, k40, k20: Pin mux configure all I2C signals as + Open Drain. The output structure of the GPIO for I2C needs to be + open drain. When left at the default, one can observe on a scope the + slave contending with the push-pull during the ACK. From David + Sidrane (2017-05-05). + * wireless/ieee802154: Removes msdu_length from meta-data since it is + intrinsically in the IOB. From Anthony Merlino (2017-05-06). + * wireless/ieee802154: Reworks data_ind allocation to include IOB + allocation/deallocation. Hides private data. From Anthony Merlino + (2017-05-05). + * wireless/ieee802154: Completes Rx data flow through MAC layer to + callback. From Anthony Merlino (2017-05-06). + * Kinetis: Add ARCH_HAVE_I2CRESET. From David Sidrane (2017-05-06). + * Reworks data_ind allocation to include IOB allocation/deallocation. + Hides private data. From Anthony Merlino (2017-05-06). + * STM32: Serial Allow configuring Rx DMA buffer size. From David + Sidrane (2017-05-06). + * 6LoWPAN: Minor cleanup and re-verification of all compression modes + after so many recent changes (2017-05-06). + * Update the C coding standard document (2017-05-06). + * IEEE 802.15.4 network driver. Remove support for multicast address + filtering; doesn't work that way on an IEEE 802.15.4 network + (2017-05-08). + * STM32: Serial DMA buffer round off not up. From David Sidrane + (2017-05-08). + * STM32 TIM: Add method to get timer width. Freerun timer: Use timer + width to get the correct clock rollover point (2017-05-08). + * wireless/ieee802154: Finishes MAC processing of received data frame. + From Anthony Merlino (2017-05-08). + * wireless/ieee802154: Finishes MAC char driver read functionality. + From Anthony Merlino (2017-05-08). + * wireless/ieee802154: MRF24J40: Finishes receive functionality, + supports promicuous mode, and rxonidle attributes. From Anthony + Merlino (2017-05-08). + * wireless/ieee802154: Completes basic receive functionality. From + Anthony Merlino (2017-05-08). + * Final fixes to get the nucleo-l432kc config build. Execution not + tested yet. From Sebastien Lorquet (2017-05-09). + * Adapt stm32l43x pin definitions. From Sebastien Lorquet (2017-05-09). + * More unbuilt stm32 -> stm32l4 changes. From Sebastien Lorquet + (2017-05-09). + * Restore settings for UARTs 4 and 5. From Sebastien Lorquet + (2017-05-09). + * IOBs: Move from driver/iob to a better location in mm/iob + (2017-05-09). + * STM32L4: Add dbgmcu header files. From Juha Niskanen (2017-05-09). + * wireless/ieee802154: Fixes missing handle of read/write being able to + be interrupted. From Anthony Merlino (2017-05-09). + * wireless/ieee802154: Starts implementing START.request primitive. + From Anthony Merlino (2017-05-09). + * drivers/serial: I discovered a problem in the file + drivers/serial/serial.c concerning the function uart_close(…). In the + case that a serial device is opened with the flag O_NONBLOCK the + function uart_close(…) blocks until all data in the buffer is + transmitted. The function close(…) called on an handle opened with + O_NONBLOCK should not block. The problem occurred with a CDC/ACM + device. From Stefan Kolb (2017-05-10). + * mtd/config: erase block between block read and write. From Juha + Niskanen (2017-05-10). + * Moved LIS3DSH from the I2C-dependent block to the SPI-block to make + Make.defs consistent with the driver (SPI only) and + drivers/sensors/Kconfig. From Floxx (2017-05-10). + * syslog: Add option to buffer SYSLOG output to avoid interleaving + (2017-05-10). + * syslog buffering: Use IOBs to buffer data, not an on-stack buffer + (2017-05-10). + * STM32L4: Add internal flash write support. From Juha Niskanen + (2017-05-11). + * When syslog message has addition characters after last new-line. With + buffering those now get lost as vsyslog does not flush output after + lib_sprintf. Additional trailing characters could be ANSI escape + sequence to reset state that message setups. For example, macro here + uses colors and resets state after actual message (including '\n'): + With flushing added to vsyslog, then there is problem that next + syslog line might come from other task before reset sequence, causing + wrong line getting color. This could be avoided by not flushing on + '\n' but only if IOB is full and/or at end of vsyslog. Would this + make sense?. From Jussi Kivilinna (2017-05-11). + * Syslog: Need inclusion of errno.h for fix building with + CONFIG_SYSLOG_TIMESTMAP=y (2017-05-11). + * mtd: Build RAMTRON and AT45DB drivers only if selected. From Juha + Niskanen (2017-05-11). + * mtd/config: Fix byte read interface test. From Juha Niskanen + (2017-05-11). + * mtd: Fix some unallocated and NULL pointer issues. rwb->wrflush and + rwb->wrmaxblocks in rwbuffer could get unallocated values from + ftl_initialize() in some configurations. Also fixes related assert: + + up_assert: Assertion failed at file:rwbuffer.c line: 643 + + that can happen with the following configuration: + + CONFIG_FTL_WRITEBUFFER=y + CONFIG_DRVR_WRITEBUFFER=y + # CONFIG_FS_WRITABLE is not set + + These problems are caused by CONFIG variable differences between the + buffer layers. TODO: This is not a perfect solution. readahead + support has similar issues. From Juha Niskanen (2017-05-11). + * STM32L4: port stm32l4_serial_get_uart function from STM32F7. From + Juha Niskanen (2017-05-12). + * syslog: Avoid flushing syslog_stream buffer, if possible, until + lib_vsprintf() completely parses the format. This assures that the + flush will flush the entire output, even data that may potentially + follow the linefeed. And, in that case, it cannot be interleaved + with other devug output. Suggested by Jussi Kivilinna (2017-05-12). + * syslog: There is yet another place where the output can get split. + That is in syslog_dev_write(): It will break up the stream to insert + a CR before the LF. This can that can be avoid be generating the + CR-LF sequence in the buffer and then detecting and ignoring valid + CR-LF sequences, rather than expecting syslog_dev_write() to insert + the CR in this case. I don't like the idea that syslog_dev_write() + still scans the entire output buffer to expand CR-LF sequence. This + seems really wasteful, especially in this case where we can be sure + that the is no CR or LF without a matching LF or CR. Bu, I think, + the existing behavior in syslog_dev_write() must be retained because + it is needed in other contexts (2017-05-12). + * Bitbucket Issue 47: Some of last syslog changes needed to be + condition on #ifdef CONFIG_SYSLOG_BUFFER in order to be built without + syslog buffering enabled (2017-05-12). + * Move CAN subsystem to its own directory and put device drivers + there. From Alan Carvalho de Assis (2017-05-12). + * locale.h: Add a bogus definition of locale_t. From (2017-05-12). + * kinetis K66: Fixed TMP2_CH1 definition. From David Sidrane + (2017-05-12). + * kinetis K66: Define ALT1 to match ref manual. From David Sidrane + (2017-05-12). + * kinetis K66: GPIO and pin mux cleanup. From David Sidrane + (2017-05-13). + * STM32F410: Add support for STM32F410. STM32F410 is a version of + STM32F4 with 32 KB of RAM and 62 or 128 KB of flash. From Gwenhael + Goavec-Merou (2017-05-13). + * Kconfig/deconfigs: Add CONFIG_ARCH_TOOLCHAIN_GNU to indicate that + the toolchain is based on GNU gcc/as/ld. This is in addition to the + CPU-specific versions of the same definition (2017-05-13). + * Remove CONFIG_ARM_TOOLCHAIN_GNU; replace with + CONFIG_ARCH_TOOLCHAIN_GNU (2017-05-13). + * Tiva I2C: Correct an error in conditional compilation (2017-05-13). + * Kconfig: Rename CONFIG_ARM_TOOLCHAIN_IAR to + CONFIG_ARCH_TOOLCHAIN_IAR (2017-05-13). + * Move prototype for up_cxxinitialize() from nuttx/include/nuttx/arch.h + to apps/include/platform/cxxinitialize.h (2017-05-13). + * libc/wchar: Versions mbrlen and mbsrtowcs taken and adapted from + FreeBSD code (at https://github.com/freebsd/freebsd/). From Matias + v01d (2017-05-13). + * tcp: wait for 3-Way Handshare before accept() returns. From Simon + Piriou (2017-05-14). + * configs/photon/wlan: disable network logs and add nsh over telnet. + From Simon Piriou (2017-05-14). + * TCP: Send RST if applicaiton 'unlistens()' before we complete the + connection sequence (2017-05-14). + * drivers: fix some bad NULL checks. From Juha Niskanen (2017-05-15). + * drivers: rename newly introduced up_i2creset to I2C_RESET. From + Juha Niskanen (2017-05-15). + * TCP: An RST received during the 3-way handshake requires a little + more clean-up (2017-05-15). + * STM32 CAN: I had the problem that the transmit FIFO size (= actual + elements in FIFO) was slowly increasing over time, and was full after + a few hours. The reason was that the code hit the line + "canerr("ERROR: No available mailbox\n");" in stm32_cansend, so + can_xmit thinks it has sent the packet to the hardware, but actually + has not. Therefore the transmit interrupt never happens which would + call can_txdone, and so the size of the FIFO size does not decrease. + The reason why the code actually hit the mentioned line above, is + because stm32can_txready uses a different (incomplete) condition than + stm32can_send to determine if the mailbox can be used for sending, + and thus can_xmit forwards the packet to stm32can_send. + stm32can_txready considered mailboxes OK for sending if the mailbox + was empty, but did not consider that mailboxes may not yet be used if + the request completed bit is set - stm32can_txinterrupt has to + process these mailboxes first. Note that I have also modified + stm32can_txinterrupt - I removed the if condition, because the CAN + controller retries to send the packet until it succeeds. Also if the + condition would not evaluate to true, can_txdone would not be called + and the FIFO size would not decrease also. From Lederhilger Martin + (2017-05-16). + * drivers/bch: BCH character driver bch_ioctl() always returns -ENOTTY + for DIOC_GETPRIV command. It should returns OK if DIOC_GETPRIV + command succeeds. From EunBong Song (2017-05-16). + * There can be a failure in IOB allocation to some asynchronous + behavior caused by the use of sem_post(). Consider this scenario: + (1) Task A holds an IOB.  There are no further IOBs.  The value of + semcount is zero. Task B calls iob_alloc().  Since there are not + IOBs, it calls sem_wait().  The value of semcount is now -1. (2) + Task A frees the IOB.  iob_free() adds the IOB to the free list and + calls sem_post() this makes Task B ready to run and sets semcount to + zero NOT 1.  There is one IOB in the free list and semcount is zero. + When Task B wakes up it would increment the sem_count back to the + correct value. (3) But an interrupt or another task runs occurs + before Task B executes.  The interrupt or other tak takes the IOB off + of the free list and decrements the semcount.  But since semcount is + then < 0, this causes the assertion because that is an invalid state + in the interrupt handler. So I think that the root cause is that + there the asynchrony between incrementing the semcount. This change + separates the list of IOBs: Currently there is only a free list of + IOBs. The problem, I believe, is because of asynchronies due + sem_post() post cause the semcount and the list content to become out + of sync. This change adds a new 'committed' list: When there is a + task waiting for an IOB, it will go into the committed list rather + than the free list before the semaphore is posted. On the waiting + side, when awakened from the semaphore wait, it will expect to find + its IOB in the committed list, rather than free list. In this way, + the content of the free list and the value of the semaphore count + always remain in sync (2017-05-16). + * stm32_serial: Fix freezing serial port. Serial interrupt + enable/disable functions do not disable interrupts and can freeze + device when serial interrupt is received while execution is at those + functions. Trivially triggered with two or more threads write to + regular syslog stream and to emergency stream. In this case, freeze + happens because of mismatch of priv->ie (TXEIE == 0) and actually + enabled interrupts in USART registers (TXEIE == 1), which leads to + unhandled TXE interrupt and causes interrupt storm for USART. From + Jussi Kivilinna (2017-05-17). + * STM32 Ethernet: Add support for KSZ8081 PHY interrupts. From + Sebastien Lorquet (2017-05-17). + * IPv6: Fix net_ipv6_pref2mask(). From Masayuki Ishikawa (2017-05-18). + * net procfs: Fix buffer corruption and refactor netdev_statistics.c. + From Masayuki Ishikawa (2017-05-19). + * binfmt: Fix .dtor memory allocation. From Masayuki Ishikawa + (2017-05-19). + * stm32_i2c: make private symbols static. From Juha Niskanen + (2017-05-19). + * network IOCTL commands: The only place in net/netdev/netdev_ioctl.c + where the interface state should change is for SIOCSIFFLAGS. The + other ones .. SIOCSIFADDR, SIOSLIFADDR, SIODIFADDR .. should not + change the link state. From Sebastien Lorquet (2017-05-19). + * drivers/wireless/ieee80211: Add support for AP scanning. From Simon + Piriou (2017-05-21). + * drivers/audio: Add cs43l22 audio driver STM32F4: Add I2S driver. + From Taras Drozdovsky (2017-05-21). + * This is based on a patch by Taras Drozdovsky. Basically, the delay + that was added during the integration of the CDC/ACM host driver was + interfering with streaming audio. That delay was put there to + prevent build endpoints from hogging the system bandwidth. So what + do we do? Do we hog the bandwidth or do we insert arbitrarity + delays. I think both ideas such (2017-05-21). + * Replace sprintf() with snprintf() in pipe.c. From Nobutaka Toyoshima + (2017-05-22). + * drivers/bch: Fix 'Missing Unlock' in bchdev_driver.c. From Masayuki + Ishikawa (2017-05-22). + * FAT: Fix 'Missing unlock' in fs_fat32.c. From Masayuki Ishikawa + (2017-05-22). + * netdb: Fix time info in lib_dnscache.c. From Masayuki Ishikawa + (2017-05-23). + * STM32L4: Add IWDG peripheral. This is the same as for STM32 except + that prescale and reload can be changed after watchdog has been + started, as this seems to work on L4. From Juha Niskanen (2017-05-23). + * drivers/can: Add Microchip MCP2515 CAN Bus controller driver. From + Alan Carvalho de Assis (2017-05-23). + * button_upper: Fix interrupt enabling for poll-events. From Jussi + Kivilinna (2017-05-24). + * netdb: Fix bugs in lib_gethostbynamer.c. This fix sets h_name in + struct hostent returned by gethostbyname(). From Masayuki Ishikawa + (2017-05-25). + * TCP: Fix tcp_findlistner() in dual stack mode. From Masayuki + Ishikawa (2017-05-25). + * TCP: tcp_input() now receives IP domain as an input parameter vs. + deriving from the IP header length (2017-05-25). + * Kinetis ADC: Various corrections and updates. From David Sidrane + (2017-05-25). + * drivers/lcd: Add driver for Nokia 5110 (Philips PCD8544). From Alan + Carvalho de Assis (2017-05-26). + * configs/stm32f103-miniumum: Add board support to use the Nokia 5110 + LCD display driver. From Alan Carvalho de Assis (2017-05-26). + * configs/pic32mx7mmb: Add support for the Pinquino toolchain + (2017-05-27). + * configs/pic32mx7mmb: Repartition files to match newer + configurations. Add support for PROCFS file system. Default is now + Pinguino toolchain. Verify networking (2017-05-27). + * pthread_trylock: Fixes a problem in pthread_trylock() noted by + initialkjc@yahoo.com. When CONFIG_PTHREAD_MUTEX_UNSAFE=y, the + special return value EAGAIN was not being detected due to differences + in reporting of returned values (2017-05-29). + * vfs: fdopen: Add missing file stream flags clearing. Clear file + stream structure regardless of config options. Structure clearing is + needed as previous use of stream list entry might leave fs_flags + set. From Harri Luhtala (2017-05-31). + * drivers/input: Add Cypress MBR3108 CapSense touch button driver. + From Juha Niskanen (2017-05-31). + * STM32L4: gpio: put back EXTI line source selection. From Juha + Niskanen (2017-05-31). + * mtd/smart: Fix use of uninitialized variable. From Jussi Kivilinna + (2017-05-31). + * drivers/mtd/w25.c: Erase sector only if it is not in erased state. + From Jussi Kivilinna (2017-05-31). + * stm32f7: Add SPI DMA support. From Jussi Kivilinna (2017-05-31). + * drivers/mtd/w25.c: Enable short delay after sector/chip erase. From + Jussi Kivilinna (2017-05-31). + * pthread robust mutexes: Fix memmory trashing problem: the main task + may also use mutexes; need to check thread type before accessing + pthread-specific mutex data structures. Problem noted by Jussi + Kivilinna (2017-05-31). + * STM32L4 RTC: store RTC MAGIC to backup reg, not to address zero. + From Juha Niskanen (2017-06-01). + * drivers/{sensors,usbmisc}: Fix uninitialized I2C frequency. From + Juha Niskanen (2017-06-01). + * mtd/config: Add some error checks for I/O errors. From Juha + Niskanen (2017-06-01). + * pthread mutex: Remove bogus DEBUGASSERT. Problem noted by Jussi + Kivilinna (2017-06-01). + * Tiva SSI: Resolves issue 52 'Copy-Paste error in + tiva_ssibus_initialize()' submitted by Aleksandr Kazantsev + (2017-06-01). + * nucleo-f4x1re User LEDS: Issue #51 reports compilation problems with + stm32_userled.c. Reported by Gappi92 (2017-06-01). + * tools/: Add initialconfig.c so that perhaps in the future we will be + able to use this to generate a new configuration from scratch (rather + than having to derive new configurations from existing + configurations). NOTE: Not yet intregated into the build system + (2017-06-02). + +7.22 2017-09-06 Gregory Nutt + + * Fix ELF loader up_checkarch on ARM arch. From Cristian Condurache + (2017-05-09). + * Kinetis: Disable MPU when not in protected mode. The hardware reset + state of the the MPU precludes any bus masters other then DMA access + to memory. Unfortunately USB and SDHC have there own DMA and will not + have access to memory in the default reset state. This change + disabled the MPU if present on system startup. From David Sidrane + (2017-06-02). + * Kinetis: teensy-3.x Define USBOTG-FS Read from FLASH access in board + config. Allow the board config to define the USBOTG-FS to have Read + access to FLASH. From David Sidrane (2017-06-02). + * Kinetis: usbdev clean up ensuring proper use of HW. Remove magic + numbers from code, documented the use of undocumented bits. Remove + comments and code that were not appropriate for this hardware. + Removed ifdef that's that were always compiled and removed code + blocks that were never compiled. Ensure proper access order to + hardware. Per the reference manual: disable endpoints prior to + configuring buffer descriptor, then enable endpoints Reorganize + interrupt processing order to offload data after processing errors. + Reorganize initialization so that there is a clear initialization + phase, reset phase for both the hardware and software structures. By + breaking the initialization into smaller pieces, the reset interrupt + only resets the resources within the controller that should be reset. + Rework suspend and resume logic so they perform properly. Made attach + and detach functions optional. As they do not make sense for a bus + powered device. Ensured the calls to up_usbinitialize + up_usbuninitialize do not violate the USB spec. From David Sidrane + (2017-06-02). + * WIP: wireless/ieee802154: More work on association/beacon-enabled + networks. From Anthony Merlino (2017-06-02). + * We developed a huge Changeset over a year ago to make USB Composite + configuration dynamical and be able to instanciate the CDCACM + multiple times inside this device. We use this feature to switch + between one in normal and up to three CDCACMs in maintenance boot. + The control path starts in boardctl.c where the configuration for the + device is constructed. There are still a few issues which I'll ask + you to have a look at before this beast can be merged. (1) To be + able to construct the data dynamically I have changed some + USB-Structs to be packed. Maybe there are additional structs to + change (just for completeness – not for current functionality). (2) + I've added the Macro COMPILE_TIME_ASSERTION two times (in + usbmsc_desc.c and in cdcacm_desc.c) to stay private. Maybe you’ll + find a better place. It’s used to check the size of the structs + against the assumptions. (3) I've changed the interface for some + USB-Functions to receive also the dynamic configuration. Maybe this + can be done more elegant. (4) The original NuttX (without the patch) + seems to have problems with a Composite device holding a CDCACM and + an MSC. The USB SET CONFIGURATION request does not to work at all. + This makes the test fail under Windows and under Linux. Applying this + patch doesn’t change anything – because it only changes the + configuration – not the behavior. Maybe you’ll have a look at + this problem before applying the patch. From Frank Benkert + (2017-06-01). + * power: battery_charger: add ioctl for charging input current. From + Juha Niskanen (2017-06-06). + * MTD FLASH drivers: The byte write method of several drivers had a + cloned error: It was not locking the bus while performing byte write + operations (2017-06-06). + * Kinetis:sim ensure isolation of clock dividers for 0 value case. + This fixes a bug were a SoC does not have a clockdivN register and + passes a 0 for the init value. This prevents overflow of the 0 + decremented to -1 (0xffffffff) spilling over to other clockdivN + feilds. From David Sidrane (2017-06-06). + * teensy-3.x:Removed call to khci_usbattach. The call is not need by + the driver if CONFIG_USBDEV_BUSPOWERED=y. The class register will + enable the soft connect pull up. The khci_usbattach call only set a + flag, and that flag is only tested in the class register. On a USB + powered device if we are running we are attached. From David Sidrane + (2017-06-06). + * teensy-3.x:Refreshed config and made board self powered. From David + Sidrane (2017-06-06). + * Kinetis:USB-FS driver. Removed the notion of attached. The + khci_usbattach is call early in the init either in board_initialize or + in board_app_initialize. In either case it is always done prior to the + the class register. Therefore the khci_usbattach call only set a + flag, and that flag is only tested in the class register. The class + register will enable the soft connect pull up. From David Sidrane + (2017-06-06). + * Kinetis:Fixed waning for kinetis_mpudisable. Missing header file + added. From David Sidrane (2017-06-06). + * STM32L4: Ad support for the STM32L475 family. Incomplete -- still + needs pinmap, rcc, otgfs, syscfg (2017-06-08). + * STM32L4: Add L475 syscfg register definitions (2017-06-08). + * STM32L4: Add STM32L475 RCC definitions/logic (2017-06-08). + * STM32L4: Add STM32L475 OTGFS header file. Not fully reviewed + (2017-06-08). + * STM32L4: Add STM32L475 pinmap. Initial cut is just the the L476 + pinmap with unsupported devices removed (2017-06-08). + * configs/stm32f103-minumum SPI: SPIDEV_WIRELESS used when this has + changed to SPIDEV_CONTACTLESS. From Nicolas Estibals (2017-06-08). + * stm32f103-minimum: Add GPIO device driver example for + STM32F103-Minimum. This chang eadds the initialization needed by + stm32f103-minimum board to support the NuttX GPIO Subsystem. From + Alan Carvalho de Assis (2017-06-08). + * STM32L4: Remove some C++ style comments (2017-06-08). + * configs/: a few more places where SPIDEV_WIRELELSS should be + SPIDEV_CONTACTLESS (2017-06-08). + * kinetis: lpserial fixed header inclusion. From David Sidrane + (2017-06-08). + * Kinetis: SPI driver. From David Sidrane (2017-06-08). + * Fix C++ __guard implementation for ARM. The standard C++ ABI that + most platforms follow defines __guard to be 64 bits. The existing + implementation of libxx_cxa_guard.cxx follows this. However, the + 32-bit ARM C++ ABI defines it as 32 bits instead, and changes the + meaning slightly so only the lowest bit is used. This matters because + GCC creates guard symbols without regards to what libxx_cxa_guard.cxx + says. So on ARM, gcc allocates 4 bytes, but __cxa_guard_release + writes 8 bytes, zeroing out another unlucky variable nearby. Fix it + by special-casing 32-bit ARM in libxx_cxa_guard. From Jim Paris + (2017-06-09). + * vfs/poll: fix timeout calculation. From Jim Paris (2017-06-09). + * stm32f103-minimum: Fix a small BUG when reading from output pin. We + need a different read_ops to read from output pin. This patch fixes + the issue. From Alan Carvalho de Assis (2017-06-09). + * testbuild:Added -x to fail build on errors for CI. On CI we want to + know ASAP of a failure. This adds the -x (exit on build failures) + option to faclitate that behavior. Use ${MAKE} ${MAKE_FLAGS} for + make invocation. When -x is provided change MAKE_FLAGS to --silent + --no-print-directory and set -e. Ignore exit status when using grep + for checking for CONFIG_NXWM=y. From David Sidrane (2017-06-10). + * stm32f103-minimum: Use separated read_ops for GPIO interrupt pins. + From Alan Carvalho de Assis (2017-06-11). + * STM32F33: Fix hrtim definitions, Add beginning of HRTIM driver. From + Mateusz Szafoni (2017-06-11). + * STM32 HRTIM: add character driver. From Mateusz Szafoni + (2017-06-11). + * nucleo-f334r8: add HRTIM initialization. From Mateusz Szafoni + (2017-06-11). + * i.MX6: Fix a wrong parameter passed when calling irq_attach() in + imx_serial.c. From Masayuki Ishikawa (2017-06-12). + * Based on the last PR, review all serial driver vector attachment. + Found one additional error and updated all relevant drivers to + current interrupt parameter passing (2017-06-12). + * gethostbyname_r: Fix check for space in buffer (2017-06-12). + * MTD M2PX: If we READ while a write/erase is pending, the command is + ignored and the write/erase continues. If we dont catch this + situation we will return garbage to the user because the flash will + not execute the command. So READ MUST wait for write completion, and + before that, the bus must be locked since it's a precondition to + calling waitwritecomplete(). From Sebastien Lorquet (2017-06-12). + * MTD FLASH driver: Clone Sebastien Lorquet's m25px change to at25, + is25xp, ramtron, and sst25xx (2017-06-12). + * STM32 HRTIM: GPIOs configuration + EEV and FAULT strucutres. From + Mateusz Szafoni (2017-06-12). + * stm32/stm32l4 PWM: While attempting to output a 70 MHz square wave + from the timer output of a STM32 clocked at 140 MHz (which works fine + in baremetal C), I stumbled on what I believe to be an error in + arch/arm/src/stm32/stm32_pwm.c. Line 1304 we are told that: reload = + timclk / info->frequency; which I belive to be incorrect, it should + be: reload = timclk / info->frequency - 1; since starting to count + from 0, if I want to output half of the TIM clock, I must count to 1 + and not to 2. Surely enough, the original code did output 140/3=47 + MHz, while this correction does allow the output up to 70 MHz. I am + not sure this affects most users generating slow PWM (e.g. PX4) but + for frequencies close to the PCLK, indeed the difference becomes + significant. From JM (2017-06-13). + * mtd/w25: add missing locking and fix SPI_SELECT usage for + w25_unprotect. From Jussi Kivilinna (2017-06-13). + * mtd/w25: wait for BUSY flag to clear in w25_readid and w25_unprotect. + W25Q128 datasheet says that all instructions expect 'Read Status + Register' and 'Erase/Program Suspend' are ignored when BUSY flag in + status register is '1'. Therefore wait for busy flag to clear in + w25_readid() and w25_unprotect(). From Jussi Kivilinna + (2017-06-13). + * freedom-k66f: Use SPI driver. Initalize SPI1 on connector J6. No + real use, as of yet. From David Sidrane (2017-06-13). + * pthreads: Move functions from sched/pthreads to libc/pthreads. + These functions just coordinate other OS interface calls but are not + a fundamental OS interfaces and, hence, do not belong within the OS: + pthread_yield(), pthread_once(), pthread_cond_init(), + pthread_cond_destroy(), pthread_barrier_init(), + pthread_barrier_destroy(), and pthread_barrier_wait() (2017-06-14). + * multiple fixes for stm32f1xx RTC clock: (1) compile issues because + of missing RTC_MAGIC #defines, (2) missing functionality based on + RTC_MAGIC in RTC based on stm32_rtcounter.c, (3) IRQ setup from + up_rtc_initialize was later reset in up_irqinitialize, (4) write + access to backup registers without enabling access to backup domain, + (5) possible races in set/cancel alarm. tested with STM32F103C8 + only. device now wakes up from forced STANDBY mode by alarm. From + Leif Jakob (2017-06-14). + * stm32f103-minimum: Fix compiler error in MCP2415 logic (2017-06-14). + * Fixed ARMv7-M Toolchain setting. Cortex-M4 only have Single + Precision FPU. From Hidetaka Takano (2017-06-14). + * wireless/ieee802154: Lots of fixes, cleanup, new functionality. + Functional. From Anthony Merlino (2017-06-14). + * Fixed ARMv7-M Toolchain definition for Cortex-M4. From Hidetaka + Takano (2017-06-15). + * Improve configure.sh behavior: (1) enable to call from top + directory. (2) enable to designate direct path for config. (3) + install .gdbinit if the target has. From Hidetaka Takano + (2017-06-15). + * Update tools/configure.c to same functionality as configure.sh. Add + an array of optional file names. Currently, .gdbinit is the only + optional file but other things like IDE-specific project files might + need to be copied as well (2017-06-15). + * STM32 HRTIM: outputs enable, period and compare functions, cosmetics. + From Mateusz Szafoni (2017-06-15). + * tool/configure will now copy Eclipse project files if they are + present in the board directory file (2017-06-15). + * configs/.gitignore: Make sure that any .gdbinit, .project, or + .cproject files are ignore so that they are less likely to be + included in a patch or PR (2017-06-15). + * wireless/ieee802154: Fixes issue with wrong information being sent in + a rejected association response frame. From Anthony Merlino + (2017-06-15). + * wireless/ieee802154: Fixes issue with wrong information being sent in + a rejected association response frame. From Anthony Merlino + (2017-06-15). + * Rename configs/mrf24j40-radio to mrf24j40-mac (2017-06-15). + * clicker2-stm32: Add a configuration that will, eventually, be used + for 6loWPAN testing (2017-06-15). + * Fix a typo. And typo in Kconfig file is reflect in all defconfig + files (2017-06-15). + * SAMv7: TWIHS driver add reference counting. From David Sidrane + (2017-06-15). + * STM32 HRTIM: structures for deadtime and chopper, cosmetics. From + Mateusz Szafoni (2017-06-16). + * Clicker2-STM32: Enable RAMLOG in mrf24j40-6lowpan configuration. + Update README (2017-06-16). + * STM32 F4 FLASH: Enable/disable the flash write protection on any + sector. I have verified it to work on the stm32f427. From Sebastien + Lorquet (2017-06-16). + * STM32 SPI/I2S: Back out a bad pin mapping change from + 4ab2a3661ea57211f4ae12fe21c5de3454ba0ef2. Try to staighten out some + I2C3 and SPI3 pin configuration stuff (2017-06-16). + * Clicker2-stm32: Allow both IEEE 802.15.4 MAC character and network + devices to be registered (2017-06-16). + * Clicker2-STM32: Enable networking and 6loWPAN in the + mrf24j40-6lowpan configuration. Fix a couple of new 6loWPAN compile + issues revealed by this new configuration (2017-06-16). + * Merge remote-tracking branch 'origin/master' into ieee802154 + (2017-06-16). + * clicker2-stm32: mrf24j40-6lowpan configuration needs to enabled the + ieee 802.15.4 MAC network device as well (2017-06-16). + * stm32:flash add CONFIG_STM32_STM32F469 to list defining OPTCR1. From + David Sidrane (2017-06-17). + * ieee802.15.4 loopback: Better simulation addressing: sort, extended, + panid, and IP address conversion (2017-06-17). + * ieee802154 MAC: Fix a warning when compiled for a target with 64-bit + addressing (2017-06-17). + * Update some 6loWPAN configurations based on changes to NSH Kconfig + (2017-06-17). + * wireless/ieee802154: Fixes ordering of strings associated with + changed enum. From Anthony Merlino (2017-06-17). + * wireless/ieee802154: Renames mac802154_poll to mac802154_radiopoll to + be more obvious. Merges shared logic for sending data request + commands. Minor improvements and simplified logic. From Anthony + Merlino (2017-06-17). + * STM32 HRTIM: Faults and events configuration, timers mode + configuration, add hrtim ops, ADC triggering and DAC synch events. + From Mateusz Szafoni (2017-06-18). + * Add RFC6775 header file (2017-06-18). + * rfc6775: Fix header, add references, correct naming. This is NOT + ICMPv6, but part of 6LoWPAN that acts like ICMPv6 (2017-06-18). + * wireless/ieee802154: Renames Kconfig option, adds option for + unimplemented receiver priority. From Anthony Merlino (2017-06-18). + * STM32 HRTIM: Fix initialization bug, minor changes. Remove unneeded + definitions. From Mateusz Szafoni (2017-06-18). + * IEEE 802.15.4 MAC: Add list management and prioritization logic that + will permit the MAC layer to support bound multiple clients + (2017-06-18). + * ieee 802.15.4: Need counting protection on the logic that releases + the notification resources. Otherwise, notification handlers may be + operating with a stale pointer (2017-06-18). + * IEEE 802.15.4 Network Driver: Add logic to setup the network mask, + update the MAC-based IPv6 addressing when the network is brought up. + The idea is that addressing changes are supposed to occur only while + the network is down but won't take effect until the network is up + again (2017-06-18). + * Swithches IEEE 802.15.4 based code to using byte arrays instead of + uint16_t values for short address and PAN ID. From Anthony Merlino + (2017-06-19). + * Throw error when error happens in the tcp_listen function. From + Roland Takacs (2017-06-19). + * Support listening sockets in the getsockname() function. From Roland + Takacs (2017-06-19). + * IEEE 802.15.4/6LoWPAN: Correct one more usage of saddr; also update a + README and the TODO list (2017-06-19). + * STM32 ADC: invalidate dma buffer before use. Missing invalidation + caused old samples being fetched from cache. From Jussi Kivilinna + (2017-06-19). + * Enable UDP example in clicker1-stm32/mrf24j40-6lowpan example, make + sure that CONFIG_EXAMPLES_UDP_NETINIT is set in all other + examples/udp configurations (2017-06-19). + * Use struct instead of pointer to the struct as sizeof argument in + memset in usbmsc.c. Otherwise it leads to error: argument to + 'sizeof' in 'memset' call is the same pointer type 'struct + usbmsc_lun_s *' as the destination. From Oleg Evseev (2017-06-19). + * /configs/clicker2-stm32/mrf24j40-6lowpan: Enables both client and + server UDP tests on the target; Update a README file (2017-06-19). + * wireless/ieee802154: Cleans up some endianness issues and fixes poll + request issue. From Anthony Merlino (2017-06-19). + * STM32 L4: Set I2C SDA and SCL pins to open drain mode. From Pekka + Ervasti (2017-06-20). + * STM32 L4: I2C4 was writing to wrong RCC registers. From Juha + Niskanen (2017-06-20). + * STM32 F7: Set I2C4 SDA and SCL pins to open drain mode. From Juha + Niskanen (2017-06-20). + * 6LoWPAN: Add debug statements; Update configuration, need to specific + 6LoWPAN compatible port numbers (2017-06-20). + * mac802154_req_data() can return without releasing the exclsem + (2017-06-20). + * STM32: Allow clock frequencies > 168 Mhz on stm32f427/429. We need + to enable the power overdrive for this case. This patch allows the + required bits to be set in proper sequence. It also modifies the + local register access operations to allow more than 16-bit registers. + From Sebastien Lorquet (2017-06-20). + * Kinetis:I2C driver added I2C3, reference counting and reset. + Refactored the driver to support reference counting and reset added + I2C3. From David Sidrane (2017-06-20). + * ieee802154 network driver now retries if ieee802154_req_data() + returns EINTR. In clicker2-stm32 6LoWPAN configuration, increased + the number of TX descriptors to match then number of IOBs + (2017-06-20). + * Kinetis:I2C fixed mis-placed kinetis_i2c_endwait. Fixed accedently + replaced post with wait. From David Sidrane (2017-06-20). + * ieee802154_req_data: Don't modify the IOB until we are certain that + no EINTR errors will occur. Otherwise, the retry will fail + (2017-06-20). + * ieee802154 MAC: Free allocated TX descriptor if an error occurs after + the descriptor has been allocated (2017-06-20). + * ieee802154: Adds some missing elements to start support for + beacon-enabled networks. From Anthony Merlino (2017-06-20). + * ieee802154: Fixes Kconfig naming for number of TX desc and number of + notifications. From Anthony Merlino (2017-06-21). + * pthread_mutex_unlock(): Missing check for the case where + pthread_mutex_lock() is called when the mutex is not locked. In that + case, it would increment the underlying semaphore avove 1. This is + the fix for a problem noted by initialkjc@yahoo.com (2017-06-21). + * Missing option to select CONFIG_MAC802154_NNOTIF in Kconfig + (2017-06-21). + * clicker2-stm32/mrf24j40-6lowpan: Network now runs on LP work queue + (2017-06-21). + * STM32 L4 DMA: Correct USART3_RX bad channel definition. From Juha + Niskanen (2017-06-21). + * 6LoWPAN: Correct an error in calculating the location of the UDP + header (2017-06-21). + * wireless/ieee802154: Minor naming change to align better with coding + guidelines. From Anthony Merlino (2017-06-21). + * mrf24j40: Fix a warning (which is actually an error) (2017-06-21). + * 6LoWPAN: Correct a few addressing issues. The apps/examples/udp test + now appears to be fully functional. Also reserve two bytes at the + end of the frame for the FCS (2017-06-21). + * Do not search net device when all-zeros address is used. From Roland + Takacs (2017-06-22). + * Fix problems in last commit noted by Jeongchan Kim: last change + returned -EINVAL vs EINVAL; Treat the case where the mutex is already + unlocked just like the case where the mutex is held by another thread + -- return EPERM (2017-06-22). + * Logic of a353602aa9cc50ed958df11af35e3972101b5f40 only applies if + CONFIG_NETDEV_MULTINIC (2017-06-22). + * 6LoWPAN: Fixes needed when extended addressing is enabled. Currently + breaks short addressing. Loopback driver needs to initialize the MAC + meta data; Address decompression logic must have the MAC address to + handle the most common compression cases. Fix a src/dest address + confusion. Fix yet another addressing problem. That does it. + Several recent, proper bugfixes unmasked a few errors in the 6LoWPAN + logic. But I think full functionality is restored (2017-06-22). + * ieee802154: Stubs out some SCAN.request code. From Anthony Merlino + (2017-06-22). + * drivers/net/tun.c: Use critical section instead of semaphore in + tun_ifdown(). From Masayuki Ishikawa (2017-06-23). + * netdb: Fixed buffer size used for sending DNS queries should depend + on the configured DNS name size. From Ritjaina (2017-06-23). + * 6LoWPAN: Add missing IPv6 address creation to HC1 decode logic. Fix a + typo in an index that prevented use with HC1 and extended addresses + (2017-06-23). + * clicker2-stm32/mrg24j40-6lowpan: Add apps/examples/nettest. Refresh + all configurations that enable the nettest (2017-06-23). + * configs/sim/sixlowpan: Disable I2C tool. Not so useful in a + simulation (2017-06-23). + * 6LoWPAN: TCP logic was not obeying MTU packet size limitations. + Other TCP-specific issues also fixed. There remains a major + outstanding issue with ACK handling. Handle case where the local + address is zero (listen socket). Major re-architecting of TCP logic + to properly handle TCP stuf like ACKs and TPC windowing which were + not properly covered in the initial design. Still does not work; + hangs waiting of ACKs.Various fixes for a clean build if either TCP + or UDP are disabled. Given the current state of TCP, it is + recommended that you disable TCP. HC06, copy TCP header as though it + were data. Modify the the way TCP headers are transferred -- yet + again. TCP packet reassembly now seems to work OK, but no there now + does not seem to be a listener on the port (2017-06-24). + * IEEE802.15.4: Update RX statistics in network driver (2017-06-25). + * 6LoWPAN TCP: Fix more ACK handling, fix some callback flag settings. + Now the TCP test appears fully functional on 6LoWPAN (2017-06-25). + * ieee802154: Finishes transmission of beacon frames, and performing a + passive scan. From Anthony Merlino (2017-06-25). + * ieee80215: starts adding support for beacon-enabled networking. From + Anthony Merlino (2017-06-26). + * STM32L4 serial: Allow configuring Rx DMA buffer size. From Juha + Niskanen (2017-06-26). + * stm32f33xxx_rcc: cleanup + move hrtim clock source selection. fix + typo in stm32f33xxx_rcc.h. From Mateusz Szafoni (2017-06-26). + * 6LoWPAN: Fix duplicate and bad memcpy in loopback driver + (2017-06-26). + * Beacon logic: Damage control. Looks like something went wrong with + the PR merge (2017-06-26). + * ieee802154: Renames mac802154_indalloc to ieee802154_indalloc since + the functions are ieee802154 scoped functions. Improves notification + freeing functionality. Each notification now has a number of + clients. When the last client calls free, the notification is freed + back to the pool. From Anthony Merlino (2017-06-26). + * Clicker2-STM32: Add support for the Telnet client to the + mrf24j40-6lowpan configuration. Useless at the moment because the + NuttX telnet daemon does not yet support IPv6 (2017-06-27). + * ieee802154: Supports get request for coordinator address. From + Anthony Merlino (2017-06-27). + * ieee802154: Finishes beacon association functionality. From Anthony + Merlino (2017-06-27). + * smart: fix wrong freeing of device structure and use-after-free + issues on error paths. From Jussi Kivilinna (2017-06-28). + * net/: IPv6 packet input, Improve checks that the packet is destined + for us. There might be some odd things that can happen in certain + forwarding scenarios (2017-06-28). + * Fix -Werror=implicit-fallthrough on gcc7. From Julien Lecoeur + (2017-06-28). + * Fix warning implicit-fallthrough with arm-none-eabi-gcc 7. From + Julien Lecoeur (2017-06-28). + * 6LoWPAN: Add configurable support for 6LoWPAN star topology. With + this change, the endpoints which are the 'points' of the star will + forward all traffic to the coordinator. The coordinator is assumed + to be the 'hub' of the star. This function also implements IPv6 + forwarding. That forwarding implementation is minimal, just enough + to support the forwarding requirements of the star hub node + (2017-06-28). + * Clicker2-STM32 + net/: Add configurations to support the endpoint + and hub roles in a star topology. Fix various things that broke when + IPv6 forwarding was enabled (2017-06-29). + * 6LowPan: Change how the destination node address is handled in the + star endpoint configuration. When the star endpoint sent the IPv6 + destination address, the HC06 compression logic elided the address -- + meaning that it could be reconstructed by the recipient based on the + receiver's assigned short address. However, when intercepted by the + hub, the uncompressed address does not know the short address of the + recipient and instead uses the short address of the hub. This means + two things: (1) it looks like the hub address is the destination + address, and (2) the uncompressed UDP packet has a bad checksum. + This change assures that the destination IPv6 address is not elided + in the case of the star endpoint configuration (2017-06-30). + * 6LoWPAN: Fix a misconception about HC06 16-bit IPv6 address + compression (2017-06-30). + * 6LoWPAN fix compile issue in star hub configuration (2017-06-30). + * This change backs out the 'misconception' fix of + 76e6dba2e4bfab9515bef2866c5c59fd2a2f0fa0 and reimplements it in a way + that actually seems to work (2017-06-30). + * ieee802154: Random fixes to get beacon-enabled networking more + stable. From Anthony Merlino (2017-06-30). + * 6LoWPAN: TCP send logic was returning a failure in one case when, in + fact, the send was successful (2017-06-01). + * include/nuttx/net and net/: Move private prototype of + netdev_foreach() from the public include/nuttx/net/net.h to the + private net/netdev/ndetdev.h header file where it belongs + (2017-07-01). + * ieee802154: Cleans up some wireless logging. Fixes resp_waittime + field in ieee802154_macattr_u. Supports multiple incoming superframe + events. From Anthony Merlino (2017-07-01). + * Initial clang compile. From Goran Mekić (2017-07-01). + * Add CLANG definitions in Kconfig and Toolchain.defs (2017-07-02). + * samv71-xult: Add support for the MRF24J40 radio and create a + mrf24j40-starhub configuration. A few fixes to IPv6 and 6LoWPAN were + required to have 6LoWPAN and Ethernet coexisting. Untested and + expect some complexity in the bring-up. Put the serial console on + UART3, i.e., on a Arduino serial shield. Add missing MRF24J40 + bring-up logic (2017-07-02). + * stm32f4 discovery: Add logic to register the button driver and the + user led driver if so configured. From Jan Pobrislo (2017-07-02). + * samv71-xult: Fix SP0 vs. TWHS0 in mrf24j40-starhub/defconfig; fix + copy-paste errors in SPI initialization logic. Fix a typo in + MRF24J40 initialization (2017-07-02). + * drivers/wireless/ieee802154: Moved radios to individual + sub-directories. From Anthony Merlino (2017-07-03). + * stm32f40xxx_rtcc ISR register and write protection fix. From Eetu + Nevalainen (2017-07-03). + * samv71-xult/mrf24j40-starhub: Disabled CONFIG_BOARD_INITIALIZE; + Correct MRF24J40 interrupt edge. Fix MRF24J40 interrupt pin. Should + have pull-ups on interrupting inputs. Reset pins backward. Add + reset logic (but comment out because it is not necessary) + (2017-07-03). + * Add some partial IP forwarding logic. Add some fragments of TCP + forwarding logic (2017-07-03). + * IPv6 forwarding logic must decrement the TTL and drop the packet if + the hop limit is exceeded (2017-07-04). + * IP forwarding. Adds a little more structure to handle passing + packets received on one network device to another network device. + Logic is still incomplete (2017-07-04). + * UDP networking: The TTL (time to live) was not being set in the IPv4 + or IPv6 header unless the UDP socket was bound (2017-07-04). + * SAME70-Xplained: Add MRF24J40 support (2017-07-04). + * I've found that the interrupts aren't enabled since nothing updates + them after btn_poll() marks the file descriptor structure as being + polling. I've managed to make it work with this change. From Jan + Pobrislo (2017-07-04). + * include/nuttx/input: Remove bogus, obsolete keypad.h header file + (2017-07-04). + * net/udp: Fix a copy-paste error that could effect networking when + both IPv4 and IPv6 are enabled (2017-07-05). + * configs/Board.mk: Remove comment form end of line. In windows native + build, it appears to be trying to make that an extra parameter to the + AR command. From Jeff (2017-07-05). + * IP Forwarding: Flesh out TCP, UDP, and ICMPv6 packet forwarding + logic. In checking if the Ethernet MAC address is in the + ARP/Neighbor table, add an additional check to skip in the case of + CONFIG_NET_MULTILINK and the devices is not an Ethernet device. Add + IPv4 packet forwarding logic. Initial commit is an untested clone of + the IPv6 forwarding logic with a few minor logic changes for IPv4 + (2017-07-05). + * IP forwarding: Add optional support to forward broadcast and + multicast packets. Add missing ICMP support (2017-07-06). + * FS: Remove DEBUGASSERT() in block_proxy() because the flags are + cleared later. From Masayuki Ishikawa (2017-07-06). + * Eliminate a warning with arm-none-eabi-gcc 7.1.0. From Julien + Lecoeur (2017-07-06). + * In arch/arm/src/stm32/Kconfig when the CPU is a STM32F4, some + STM32_HAVE_xx with xx = {OTGFS, TIM3, TIM4, SPI3, I2S3, I2C3} are + selected by default. But for F410 these peripherals are absent. This + change add tests to check if the target CPU is an F410 or not and + selects according to the situation. This also adds a select for + STM32_HAVE_DAC1 present on this STM32 flavor. From Gwenhael + Goavec-Merou (2017-07-06). + * Rename CONFIG_STM32_STM32F40XX to CONFIG_STM32_STM32FXXXX since it is + used by F4 parts other than F40x (2017-07-06). + * STM32 Kconfig: 'unfold' some of the dependencies to provide better + long term configuration support. This also effective reverts the + recent 15b85738e7b5b9df6377f56e2a6a629346f87964 (2017-07-06). + * ICMPv6: Fix so that ICMPv6 can be used with 6LoWPAN (2017-07-06). + * IPv6 Neighbor: Update table format to support IEEE 802.15.4 MAC + addresses (2017-07-06). + * configs/Board.mk: Remove quotes from CONFIG_ARCH_FAMILY. Causes + problems with Windows native build. From Jeff (2017-07-06). + * IP forwarding design simplication; might save some memory. Also fix + some compile issues introduce with last commit in MULTINIC + configration (2017-07-06). + * IP Forwarding: Another IP forwarding design simplification: Remove + an unnecessary field from state structure (2017-07-06). + * ICMPv6: Fix an address size calculation that was bungled in a recent + commit (2017-07-06). + * Networking: Improve naming and simplify some logic of previous + commit (2017-07-07). + * Networking: Correct some issues that prevent TCP from working + correctly when both IPv4 and IPv6 are enabled (2017-07-07). + * Add definitions that will permit TUN-only networking (2017-07-07). + * Move TUN ioctl commnd to include/nuttx/net/ioctl.h so that it will + always be unique. It a error in netdev_register: it was not handling + device names properly when TUN is the only network device + (2017-07-07). + * sim/ipforward: Add an IP forwarding configuration using TUN devices + and apps/examples/tun (2017-07-07). + * In TUN driver, do all polling on worker thread. Otherwise, the stack + gets very deep (2017-07-07). + * IP forwarding: Major rearchitecting of the outgoing portion of the + IP forwarding logic necessary into to properly received + device-related forwarding events (2017-07-07). + * ieee802154: Changes mac locking/unlocking to aid in debugging. From + Anthony Merlino (2017-07-07). + * IP forwarding: Remove some unnecessary data structure definitions + (2017-07-07). + * Makefile.unix: Add savedefconfig target. From Gwenhael Goavec-Merou + (2017-07-08). + * Add Gwenhael's change to Makefile.win and update README.txt to + described the new make target (2017-07-08). + * IP forwarding: Two bugfixes (1) IPFWD poll event must be unique and + different from other device poll events otherwise, some other waiting + task might get the poll, (2) Add logic necessary to forward 6LoWPAN + packets (2017-07-08). + * net/procfs: Fix some spacing when both IPv6 and IPv4 are enabled + (2017-07-08). + * Networking routing tables: Fix a compilation error when IPv6 and + routing are enabled (2017-07-08). + * ICMPv6: Add 6LoWPAN and IP forwarding support (2017-07-09). + * configs/b-l475e-iot01a: Add basic support for the STMicro + b-l475e-iot01a board. From Simon Piriou (2017-07-09). + * IP Forwarding: Fix a compile problem when IP forwarding of broadcast + messages is enabled (2017-07-09). + * ieee802154: mac802154_purge_timeout was not unlocking MAC before + returning. From Anthony Merlino (2017-07-09). + * ieee802154: Minor bug fix. Purging of indirect transaction was not + unlocking MAC. From Anthony Merlino (2017-07-09). + * Makefile.*: Add CONFIG_ARCH_CHIP_* definitions to defconfig in + savedefconfig target. Last of the conversions of defconfig files to + compressed format (2017-07-09). + * ieee802154: Improves internal timer logic to handle work serially. + Before, the MAC timer used a watchdog to schedule work with the high + priority worker queue. However, since everything in the MAC is + supposed to be serialized through the use of the high priority work + queue, but the timer uses a watchdog, there are some unintended + consequences. To simplify, we now use the delayed work feature of the + work queue. From Anthony Merlino (2017-07-09). + * Update configure.sh, configure.bat, configure.c: With compressed + format, part of the installation requires that we run 'make + olddefconfig' to restore the uncompressed defconfig format. Also, + while I was at it, I also added options to select host platform on + configure command line (2017-07-10). + * tools/refresh.sh: Now runs make savedefconfig before copying the new + defconfig file in place; Also, added a new option --defaults. Since + the number of defaults that you now have to answer is so large, the + option lets you just accept the default values. So it works just + like --slilent but still prompts you for the decision to save or + discard the new defconfig file (2017-07-10). + * tools/tesbuild.sh: Fix missing $ before variable name (2017-07-10). + * configs/clicker2-stm32: Adds support for per-function-call stack + checking. From Anthony Merlino (2017-07-10). + * drivers/wireless/ieee802154/mrf24j40: Minor timing fix. Matches + recommended value in datasheet. Splits up driver into multiple files + to make it easier to navigate. Fixes issue with non-beacon enabled + mode. From Anthony Merlino (2017-07-10). + * IP Forwaring. Fix some errors in ipforwar.h when + CONFIG_NET_STATISTICS is enabled, but CONFIG_NETDEV_MULTINIC is not. + Add some forward references that are needed when + CONFIG_NETDEV_MULTINIC is not enabled. ipfwd_dropstats needs to + include errno.h (2017-07-10). + * STM32 TIM3/4 are always 16-bits; never 32-bits. Noted by Eetu + Nevalainen. (2017-07-10). + * Build System: It is no longer necessary to have a unique Make.defs + file for each configuration. A board may share a common Make.defs + file in the scripts directory. Some duplicate Make.defs files + removed; Some common Make.defs file moved to the scripts/ + sub-directory (2017-07-10). + * configs/clicker2-stm32/mrf24j40-mac: Updates stack size to 2048 to + avoid random stack overflows when logging is enabled. From Anthony + Merlino (2017-07-10). + * Add small hello example for stm32f103-minimum board. From Alan + Carvalho de Assis (2017-07-10). + * ieee802154: Many small bug fixes clean-ups that help stabilize the + functionality. From Anthony Merlino (2017-07-10). + * SAML21 I2C driver. Developed for and contributed with permissin from + Filament company. From Alan Carvalho de Assis (2017-07-11). + * SAMD/L21 I2C: Another update... needs to use + enter/leave_critical_section vs. old irqsave/restore (2017-07-11). + * Remove duplicate Make.defs files in configs/. Move remaining, common + Make.defs files to board/scripts directory (2017-07-11). + * SAMD21: Fix some SPI-related issues. From Matt Thompson + (2017-07-11). + * ICMPv6 w/Autoconfiguration: Fix a compile issue introduced with + recent change for 6LoWPAN support (2017-07-11). + * sockets: Coding fix fix + minor structuring for forthcoming socket + interface logic (2017-07-11). + * drivers/wireless/ieee802154/mrf24j40/: Fixes bug causing radio to + cease transmitting. From Anthony Merlino (2017-07-11). + * ieee802154: Notify radio layer of changes in devmode. From Anthony + Merlino (2017-07-12). + * drivers/mrf24j40: Hook in setdevmode from newly added radio attribute + setting. From Anthony Merlino (2017-07-12). + * ieee802154: Set devmode to endpoint on MAC layer reset. From Anthony + Merlino (2017-07-12). + * I was having issues with the bus freezing up .. slaves holding SDL + low.. so I rewrote a good portion of the interrupt logic based on the + application notes from Atmel. One major improvement is using the + RXNACK flag in the STATUS register, which indicates that no device + responded to an address packet. Assuming that the chip will always + give an interrupt status, I believe it's possible to eliminate the + timer as well. From Matt Thompson (2017-07-12). + * SAMD/L21: Add a USB driver. Developed for Filament Inc. by Offcode, + LTD. From Janne Rosberg (2017-07-12). + * drivers/mrf24j40: Adds header guards to mrf24j40_reg.h. From Anthony + Merlino (2017-07-12). + * C library: Fix an error in mkstemp() the could result in an infinite + loop. From Alan Carvalho de Assis (2017-07-12). + * SAMD/L21: Need to preserve errno value across syslog() call + (2017-07-12). + * SocketI/F: Initial steps to add a socket interface to the + networking. Each address family will have an interface that + describes how to perform socket operations on that address family. + Currently only a couple of methods are defined in the table as a + proof of concept. More to come. Currently there are only tables for + the INET/INET6 family, the Unix LOCAL family, and the raw PACKET + family. Hopefully there will be AF_IEEE802154 and AF_BLUETOOTH + comming down the pike. Add recvfrom() method to interface + (2017-07-12). + * ieee802154: Fixes setting devmode logic. From Anthony Merlino + (2017-07-13). + * drivers/mrf24j40: Fixes issues with sleeping for beacon enabled + networking. From Anthony Merlino (2017-07-13). + * Fixes timing issues for beacon enabled coordinators and endpoints. + From Anthony Merlino (2017-07-13). + * Socket I/F: Added bind(), connect(), listen(), accept(), close(), + addref() and sockcaps() interfaces (2017-07-13). + * ieee802154: Fixes issue with association on beacon-enabled + networking. From Anthony Merlino (2017-07-13). + * drivers/wireless/mrf24j40: Fixes math error for calculating sleep + count values. From Anthony Merlino (2017-07-13). + * STM32 F7 Ethernet: Fix typo in header; Add memory sync barrier + between writing to DMA TX descriptor and restarting DMA TX. Avoid + calling work_queue on pollwork if it's already queued, just skip a + poll cycle instead. Nucleo-144: Fix RMII TXD1 signal, connected to + PB13 not to PG14. From savinz (2017-07-14). + * Socket I/F: Added getsockname() interfaces. Add address family + support for poll() and sendfile() (2017-07-14). + * tools/refresh.sh: Update so that it can find the Make.defs file in + the new location (2017-07-15). + * Numerous fixes, updates generalizations needed in order to merge + Frank Berkert's massive USB composite change of June 1 into master. + Too many changes to summarize adequately here (2017-07-16). + * Makefile.win would only create uboot images for ARM. MIPS support + also needed. From Lwazi Dube (2017-07-16). + * IEEE 802.15.4 MAC: Disable option to select interrupt-level meta + data allocator (2017-07-16). + * ieee802154: Adds retry count to tx descriptor. Renames ack_wait_dur + to ack_waitdur and removes it from private mac struct. From Anthony + Merlino (2017-07-16). + * STM32 F7: I2C4_SDA can also be on GPIO PB7. From Titus von Boxberg + (2017-07-16). + * STM32 F7: Definitions for I2C4, SDMMC2. Adapted RAM start / size to + internal SRAM. From Titus von Boxberg (2017-07-16). + * Networking: When upd_input() cannot process a packet, it returns + ERROR so that network drivers may try calling ipv4_input() later. In + this case, it must also set d_len to zero. Otherwise, all network + drivers will assume tht there is also an outgoing packet. This + results in a gratuitous ARP (2017-07-17). + * STM32 F7: do not enforce CONFIG_STM32_CCMEXCLUDE for + CONFIG_ARCH_CHIP_STM32F7, macro rename STM32 -> STM32F7, #include + corrections. renamed STM32_LCDTFT_BASE to STM32_LTDC_BASE for + consistency. macro rename STM32 -> STM32F7. initial + (dysfunctional) lcd configuration (from STM32). From Titus von + Boxberg (2017-07-17). + * STM32 F7: option for DSI output, inconsistency: the stm32f746 does + not feature a DSI interface. compileable with LTDC_INTERFACE and + LTDC_USE_DSI. From Titus von Boxberg (2017-07-18). + * ieee802154: Adds special attribute that can be used to perform a + regdump of the radio. Sets txdesc retrycount to the maxretries MAC + attribute when allocated. From Anthony Merlino (2017-07-18). + * STM32 F7: Added functions for DSI clock source selection. From Titus + von Boxberg (2017-07-18). + * Network poll: Remove logic conditioned on non-existent HAVE_NET_POLL + (2017-07-19). + * CDC/ACM. Fix several known problems resulting from merge of USB + composite device. That merge now breaks some of the non-composite + USB devices. These fixes are for CDC/ACM (2017-07-19). + * SAMD21: Changes needed to get USB working. From Matt Thompson + (2017-07-19). + * Initial port to STM32F769I-DISCO. From Titus von Boxberg + (2017-07-20). + * libc/math: Fix wrong output in modf() API. The sign of integral part + given by the modf() should be same as sign of input. But for inputs + between 0 and 1, the sign of integral part was not same as sign of + input. From Lokesh B V (2017-07-20). + * libc/math: Fix wrong output in ceil() API. Ex:for input x = 1.0, the + output should be 1.0, but the output was 2.0. From Lokesh B V + (2017-07-20). + * USB device: Rename usbdev_description_s to usbdev_devinfo_s to avoid + any more confusion of naming with device descriptions in the future. + Instances of usbdev_devinfo_s are now called devinfo vs devdesc when + is a bad naming collision (2017-07-20). + * USB MSC: Add missing logic to define endpoints. The composite + changes broke the the non-composite, USB MSC only case because it + omitted the critical setup when USB MSC was not part of the composite + (2017-07-20). + * libc/stdlib: (1) Fix an error in mkstemp() the could result in an + infinite loop. (2) Fix for wrong output in some cases. For + Example: (a) input: "FILEXX", output: "FILE00" and repeats same + output for further invocations of mkstemp(). But, the output has to be + FILE01, FILE02, ...., FILEZZ. (b) input: "FILEXXXXXX", output: + "FILE100000", for next invocation "FILE200000" and so on. But it's + good, if the output goes like FILE000001, FILE000002, ..., FILE000101, + ... From Lokesh B V (2017-07-21). + * configs: add stm32f334-disco basic support. From Mateusz Szafoni + (2017-07-21). + * USB composite: Remove references to CDC/ACM and USB MSC from + composite logic. They are no longer coupled (2017-07-21). + * nucleo-f334r8: UART2 is default serial port (STLINK Virtual Port). + From Mateusz Szafoni (2017-07-22). + * STM32 HRTIM: add slave timers private data, fix some bad definitions, + some assertions. From Mateusz Szafoni (2017-07-22). + * b-l475e-iot01a: Add initial, unverified support for the + SPSRGF/Spirit1 module. Add a configuration for testing sprit radio + (2017-07-22). + * epoll: fix epoll_wait function. From Simon Piriou (2017-07-22). + * sim arch: Add non blocking read to devconsole driver. From Simon + Piriou (2017-07-22). + * sim arch: poll for TX frames to speed up driver. From Simon Piriou + (2017-07-22). + * sim arch: fix mkdir issue in GNU target. From Simon Piriou + (2017-07-22). + * drivers: add generic upper-half driver for SMPS. From Mateusz + Szafoni (2017-07-23). + * Add power-related debug output (2017-07-23). + * Move SMPS driver to drivers/power (and header to + include/nuttx/power). Rename debug to IOCTLs to more general power + naming; create a separate file to coordinate power-related IOCTL + commands (2017-07-23). + * STM32 F7: enable APB2 DSI clock. From Titus von Boxberg + (2017-07-26). + * drivers/leds: Add support for inverted LEDS. See common anode RGB + LED discussion in the Yahoo group. From Jeff (2017-07-27). + * drivers/analog: Fix some data alignment issues in the ADC driver + (2017-07-27). + * STM32 F7: added missing config option for register value debugging. + From Titus von Boxberg (2017-07-27). + * STM32 F7: No FSMC, only FMC for STM32F7. From Titus von Boxberg + (2017-07-27). + * sig_timedwait: Pending signal structure used after it has been + releasd. From anonymous Bitbucket Issue 59 (2017-07-27). + * Add driver for LTC4151 current and voltage monitor. From Giorgio + Groß (2017-07-28). + * drivers/leds: Lightness correction for RGB LED driver. From Jeff + (2017-07-28). + * We discovered a problem with the samv7 mcan driver which results, + under some circumstances, in a very high CPU load. The problem + occurs, and is easily reproducible, if the device is connected to a + CAN network with a wrongly configured CAN speed (baud rate). In our + tests we set the CAN speed of the device to 1000000 and the speed of + the other CAN nodes to 500000. The device is restarted and sends a + CANopen "bootup message" to the CAN network. This results in huge + amount of errors messages on the CAN bus, probably because of the CAN + feature for acknowledging error messages. The error messages can’t + be read by the device because of the misconfigured CAN speed, instead + the CAN chip reports lots of errors, which are reported to the + application which uses the CAN driver (CONFIG_CAN_ERRORS is enabled). + The CAN errors are reported from the CAN chip via interrupts and thus + the interrupt load is very high in this scenario. To fix the problem + the driver now disables each RX error interrupt after it is occurred. + The RX error interrupts are turned back on if at least one CAN + message is received successfully. From Stefan Kolb (2017-07-28). + * tcdrain implementation based on a new term ioctl. From Sebastien + Lorquet (2017-07-28). + * Spirit Network Driver: Create build directories, Add radio + initialization, interrupt handling logic, packet transmissin and + reception logic. Add some hooks that will eventually support address + filtering (2017-07-28). + * STM32 F7: HEAP2 depends on CONFIG_ARCH_HAVE_HEAP2, not on particular + FMC RAM type. From Titus von Boxberg (2017-07-28). + * STM32 F7: No board specific dithering values used; corrected + dithering init. Corrected LIPOS/LIPCR calculation. Change only + polarity bits in LTDC_GCR. From Titus von Boxberg (2017-07-29). + * STM32_RCC_DCKCFGR2 has nothing to do with PLLI2S; PLLI2S is not + dependent on LTDC, instead on SAICLK1/2 generated from PLLI2S. From + Titus von Boxberg (2017-07-29). + * To use an external oscillator module (not just a crystal) with the + STM32F4, one needs to enable the HSEBYP bit in the RCC_CR register. + This change allows an integrator to define STM32_RCC_CR_HSEBYP in + their board.h file if they want this configuration. From Jeff + (2017-07-30). + * 6LoWPAN PktRadio: Some initial changes to support raw packet radios + without IEEE 802.15.4 with 6LoWPAN. Add missing MetaData-related + prototypes and initialization logic. Perform a major renaming to + make room in the 6LoWPAN name space for packet radios. Replace + metadata input parameter type from struct ieee802154_data_ind_s to + void*. This permits radios with different MAC metadata to interact + with 6LoWPAN. Includes many changes to handle variable length radio + addresses. No longer just short and exteneded; any length.Remove + explicit type struct ieee802154_frame_meta_s from derive interface + methods. Replace with a opaque void * type so that other radio meta + data structures may use the interfaces. Add a new radion interface + to get properties of the radio. Spirit: Finish packet I/O interface + with the network. Fix case where source and destination IP address + were backward. Fix some compile issues when star topology support is + enabled. Condition out some types that depend on definitions that are + only available with 6LoWPAN is enabled (2017-07-30). + * STM32L4 PWR: correct PWR_SR2 REGLPS and REGLPF bits, add port I + registers. Also remove duplicate section from Kconfig. From Juha + Niskanen (2017-07-31). + * STM32L1: Add base address for TIM11. From Juha Niskanen + (2017-07-31). + * net/local: fix accept for local stream sockets. From Jussi Kivilinna + (2017-07-31). + * network: Move USRSOCK specific code from from inet_sockif to + usrsock_sockif. Fix USRSOCK to work with recent changes to + networking layer. From Jussi Kivilinna (2017-07-31). + * PktRadio/6LoWPAN: Add a loopback driver for testing on the simulator. + Fix more issues related to single byte radio addressing. Some + initial fixes resulting for early testing with loopback device + (2017-07-31). + * Simulator: Protect a few more NuttX symbols from collisions with host + symbols (2017-07-31). + * STM32 F7: added function for reset. From Titus von Boxberg + (2017-07-31). + * IoT Board/Spirit: Fix a few issues that interfered with testing. + Move console to the VCOM port (USART) for all configurations. Rename + the spirit-mac configuration to spirit-6lowpan. Add lots of debug + output the spirit network driver (2017-07-31). + * drivers/serial/serial.c: Add support for TCFLUSH. From Sebastien + Lorquet (2017-08-01). + * Fixes for compilation of stm32f746g-disco. From Ivan Ucherdzhiev + (2017-08-01). + * stm32f746g-disco: Make the initialization logic identical to the + standard way that is done for all other board (2017-08-01). + * serial.c: Finish implementation of TCDRAIN. Based partly on logic + from Sebastien Lorquet (2017-08-01). + * serial.c: Use common TX drain logic when closing a driver as with + the TCDRAIN IOCTL (2017-08-01). + * Spirit network driver: Network driver needs to setup IP address + based on configured node address. If no node address is provided, + then it will use a default. Make sure device is in READY state after + reset and before changing to STANDBY. Add a function to wait for a + state change with a timeout (2017-08-01). + * network procfs: Fix so that PktRadio address are shown correctly + (2017-08-01). + * arch/arm/src/lc823450: Initial support for ON Semiconductor LC823450. + From Masayuki Ishikawa (2017-08-02). + * configs/lc823450-xgevk: LC823450-XGEVK board support. From Masayuki + Ishikawa (2017-08-02). + * b-l475e-iot91a: Add apps/examples/nettest and eamples/udp to Spirit1 + configuration. Add telnet support. fix driver statistics + configuration (2017-08-02). + * Networking: Add support for some packet radio IOCTL commands + (2017-08-02). + * b-l475e-iot01a: crude update to +CONFIG_BOARD_LOOPSPERMSEC. Not + precise but on assertions no flashes at approximately the correct + rate (2Hz) (2017-08-02). + * Fix for stm32f746g-disco board for button support with interrupt. + This change is tested with buttons app example and it is working with + interrupts (signals). I tried the test with polling but at this point + it doesn't work. From Ivan Ucherdzhiev (2017-08-02). + * configs/stm32f746g-disco: Remove inclusion of STM32-specific header + files from board.h (2017-08-02). + * Spirit1 network driver: Remove extra clear of pending interrupts, + could cause missing interrupts. Fix a deadlock. Also several other + design improvements to eliminate corner cases (2017-08-03). + * poll: fix poll for regular files and block devices. Open Group + documentation says that poll (and select) support regular files and + that 'Regular files shall always poll TRUE for reading and writing'. + From Jussi Kivilinna (2017-08-03). + * mm_mallinfo: do heap end debug assert check with heap semaphore held. + From Jussi Kivilinna (2017-08-03). + * Spirit1 network driver: Modify reg needs to toggle CS to get the + correct status. Make sprit_unlock an inline function. Tx timeout + should run on the HP work queue (2017-08-03). + * Simulator: x86 stack needs to be aligned to 16-byte boundaries + (2017-08-04). + * drivers: handle I2C_TRANSFER return value consistently. Some I2C + peripherals transfers return zero on success, others number of + completed transfers. Make drivers robust against this. From Juha + Niskanen (2017-08-04). + * syslog: Add option to use the CLOCK_MONOTONIC for time stamping. + From Jussi Kivilinna (2017-08-04). + * RAMTRON: Add support for splitting block writes in chunks. Some + Re-RAMs like MB85AS4MT have a write buffer size limitation. From + Boris Astardzhiev (2017-08-04). + * Spirit1 network driver: Correct setting of the length width field; + Add multicast and broadcast addresses to radio properties. Convert + network driver to use STack packets vs. Basic packets. We need to + use the STack packets in order to provide the source address + (2017-08-04). + * tools/mkdeps.c: Eliminate a warning. MAX_PATH may already be defined + in included system files. From Jeff (2017-08-04). + * Spirit1 network drvier: Increase number of retries if there is no + acknowledgement; Add interrupt handling for the case where the max + number of retries expires. Fix some badly implemented queue + management code. With these changes the basic UDP and TCP tests + work. Enable AutoACK, TX retries, and RX timeouts in the network + driver (2017-08-04). + * B-L475E-IOT01A: Make spirit-6lowpan configuration match what is + currently under test: Enable multicast, broadcast, but disable CRC + support. Currently CRCs are not working right (2017-08-04). + * b-l475e-iot01a: Add configurations to support a star topology + (2017-08-05). + * Spirit + 6LoWPAN: In STAR configuration, Spirit must use a + configured well known hub address. 6LoWPAN cannot assume that the + PAN coordinator is the STAR hub; it must ask the radio to provide it + with the address of the star hub (2017-08-05). + * IEEE 802.15.4 network driver: Fix more compile issues that only show + up when CONFIG_NET_STARPOINT is defined (2017-08-05). + * STM32F746-Disco: Add ADC3 support. From Ivan Ucherdzhiev + (2017-08-05). + * Spirit Network Driver: Attempts to eliminate RX FIFO errors. Reduce + max packet length to avoid an errata. Reducing the packet length had + no effect on eliminating RX FIFO errors. Add support for watermark + interrupts on RX FIFO. Restructure threading to reduce locking. + Still get a few RX FIFO errors (2017-08-06). + * STM32F103-Minimum: Add support for SmartFS on Winbond W25 SPI NOR + Flash. From Alan Carvalho de Assis (2017-08-06). + * MTD: Add driver for Macronix QuadSPI flash memory. From Simon Piriou + (2017-08-06). + * b-l475e-iot01a: add basic support for external Macronix QuadSPI flash + memory. From Simon Piriou (2017-08-06). + * Spirit radio: Dropping packet size to 94 seems to fix problem with + CRC failures (2017-08-06). + * STM32F103-Minimum: (1) Enable CONFIG_MTD_PARTITION in Kconfig if + flash partition is enabled and (2) Update the README.txt file with + info needed to get SmartFS working. From Alan Carvalho de Assis + (2017-08-06). + * 6LoWPAN: When obtaining the radio MAC address from the IP address, + handle the special case of broadcast and multicast address + (2017-08-06). + * Networking: Move INET socket interface out of net/sockets to its own + directory net/inet (2017-08-06). + * Spirit network driver: TX timeout was never being cancelled! Also + reviewed and cleaned up all error handling logic (2017-08-06). + * sched/: Fix return value in sched_setaffinity(). From Masayuki + Ishikawa (2017-08-07). + * Spirit bugfixes: Was hanging occasionally because there was no + mechanism to restart the poll timer if poll was not performed because + Spirit ws busy. Fixed by not checking if Spirit is busy. The TX + poll can be performed asynchronouly while spirit is busy; any + outgoing data will queued until Spirit is ready. Fixed handling of a + timeout condition. Failure to transmition to the TX state would fail + (timeout) if in a race condition Spirit already committed to the RX + state. The driver needs to recover the state properly and avoid + debug assertions in this event (2017-08-07). + * STM32 USB: I'm working on bringing up USB full-speed support on + STM32F405.  My board does not include a USB power switch, VBus + sensing, over current detection, or ID pin. This commit add a + config STM32_OTGFS_VBUS_ CONTROL which lets us selectively disable + VBus sensing and control.  I also sneaked in a change to disable the + configgpio call for the ID pin, which is only used in OTG mode which + isn't supported yet.  The only pins that need to be initialized + should be OTGFS_DP and OTGFS_DM. These changes let a USB mouse + enumerate on my platform if it's plugged in on power-up.  Plugging, + unplugging, clicking, or moving the mouse cause NSH to stop + responding.  Because I'm using the ramlog, I don't have useful debug + messaging yet, so there's a lot more work I have to do to + troubleshoot it or get my JTAG debugging set up, but these patches + shouldn't hurt anything.  I'm hoping my issue is something simple I + overlooked in configuration. From Jeff (2017-08-07). + * I discovered while working on the SAMV7 mcan driver that the + implementation of the CAN error handling is suboptimal. In the + current implementation the many errors are implemented as pending + errors. But those errors are not pending, the errors occurred and + are gone directly afterwards. This commit changes the described + behavior and simplifies the handling of CAN errors. From Stefan Kolb + (2017-08-07). + * IPv6: Remove comparisons to the address with all ones set. IPv6 + does not support broadcast addresses and certainly not in that form. + Replace with multicast addresses beginning with 0xff02 (2017-08-07). + * ICMPv6: Support source link-layer address option in RA. From + Masayuki Ishikawa (2017-08-08). + * libm: Port gamma() and lgamma() from FreeBSD to NuttX. From Alan + Carvalho de Assis (2017-08-08). + * B-L475-IOT01A: Enable UDP broadcast test in the spirit-starhub + configuration (2017-08-08). + * Spirit Radio: Add support for CSMA backoff count reached interrupt + (2017-08-08). + * STM32F4-Discovery: Add a configuration for testing libc++. From + Alan Carvalho de Assis (2017-08-08). + * Remove CONFIG_NET_MULTILINK. This increases code size by a little, + but greatly reduces the complexity of the network code (2017-08-08). + * Networking: Fix netdev_dev_lladdrsize(). In some configurations, it + could return the wrong size for the address of a packet radio + (2017-08-08). + * Fix IPv6 loopback driver that depended on the removed + g_ipv6_allonesaddr. Noted by Masayuki Ishikawa (2017-08-09). + * Networking: Fix typo for 802.11 devices in netdev_register(). Was + being masked before because depended on CONFIG_NET_MULTLINK + (2017-08-09). + * Networking: Fix a compilation issue with + CONFIG_NET_ICMPv6_AUTOCONF=y. From Masayuki Ishikawa (2017-08-09). + * Update NSH documentation to show new usage for addroute and delroute + (2017-08-10). + * cwchar: Use CONFIG_LIBC_WCHAR to only export the wc/mb functions. + When a build does not want to use wide or multibyte char + CONFIG_LIBC_WCHAR is not set. Therefore we should to only export the + wc/mb functions when defined. Regardless of the stat of + CONFIG_LIBC_WCHAR the non mb/wc definitions such as mbstate_t, + wint_t, wctype_t need to be exported. From David Sidrane + (2017-08-10). + * inet_ntop: Was printing negative values for fields >127 + (2017-08-11). + * procfs: Add support for routing tables at proc/net/route + (2017-08-11). + * Unify GCC/Clang config. From Goran Mekić (2017-08-12). + * procfs routing table: Don't print the IPv4 routing table header if + the table is empty. Fix a couple of places where CONFIG_NET_IPv4 was + used wehre IPv6 was intended (not noticed now because I am testing + with both enabled) (2017-08-12). + * C++: Compilation with recent C++ compiler needs an overloaded delete + operator that includes a size_t size argument (2017-08-12). + * ARM: The older ARM7 and ARM9 configurations were determining CFLAGS + based on the GCC version 4.x.x or not. That needx to be extended for + 5.x.x and 6.x.x which also behave like 4.x.x (2017-08-12). + * STM32F7: Some STM32F7 builds failed in build testing due to undefined + STM32_SRAM1_BASE. I think that is because stm32_allocateheap.c was + not including chip/stm32_memorymap.h (2017-08-13). + * Fix ESP32 gpio enable reg and default UART pin. Modify default uart + pin for ESP-WROOM-32. Fix gpio enable reg. From Sungki Kim + (2017-08-13). + * stm32/stm32f0: Fix some funny shifts in DAC header files. From Juha + Niskanen (2017-08-14). + * STM32L4 COMP: Input minus pin extended selection. From Juha + Niskanen (2017-08-14). + * STM32L4 DAC: Port from STM32. Add ADC register definitions. Note + that this does not address the somewhat confusing relation between + STM32L4_NDACS and DAC2 config macros that comes from original STM32 + code. From Juha Niskanen (2017-08-14). + * libxx: New sized delete operators are only for C++14 and above + (2017-08-14). + * Miscellaneous fixes from astyle tool. Noted by Arjun Hary + (2017-08-14). + * SAMv71-XULT: Fix MRF24J40 interrupt GPIO number (2017-08-15). + * Clicker2: Configure EDBG SPI CS just to make that it is disabled + (2017-08-15). + * STM32L476VG Discovery: Add a knsh configuration that may be used to + test the PROTECTED build mode (2017-08-17). + * stm32f7:DMA correct comments and document stm32_dmacapable. Updated + comment to proper refernce manual for STM32F7 not STM32F4. Added + stm32_dmacapable input paramaters documentation. From David Sidrane + (2017-08-17). + * STM32 F7: DMA add dcache alignment check in stm32_dmacapable. In the + case dcache write-buffed mode is used (not write-through) buffer + alignment is required for DMA transfers because a) + arch_invalidate_dcache could lose buffered writes data and b) + arch_flush_dcache could corrupt adjacent memory if the maddr and the + mend+1, the next next address are not on ARMV7M_DCACHE_LINESIZE + boundaries. From David Sidrane (2017-08-17). + * STM32 F7: SDMMC remove widebus limitation on DMA. There is no + documantation for the STM32F7 that limits DMA on 1 bit vrs 4 bit + mode. From David Sidrane (2017-08-17). + * dcache write-buffed mode is used (not write-through) buffer alignment + is required for DMA transfers because a) arch_invalidate_dcache could + lose buffered writes data and b) arch_flush_dcache could corrupt + adjacent memory if the buffer and the bufflen, are not on + ARMV7M_DCACHE_LINESIZE boundaries. From David Sidrane (2017-08-17). + * STM32 F7: SDMMC add dcache alignment check in dma{recv|send}setup. + In the case where CONFIG_SDIO_PREFLIGHT is not used. + * drivers/sensors: Add support to HC-SR04 distance sensor. From Alan + Carvalho de Assis (2017-08-17). + * PF_IEEE802154 address family: With this commit PF_IEEE802154 address + family is basically functional. More testing is needed, of course: + Finishes up socket interfaces connect() sendto(), recvfrom(), and + bind() logic. Special initialization, device lookup, driver poll, + and frame input logic. Add configs/sim configuration for testing + (2017-08-19). + * STM32 COMP: add default INM configuration and some missing + COMP1,3,5,7 code. From Mateusz Szafoni (2017-08-20). + * 6LoWPAN/PF_IEEE802154: Created radiodev.h and renamed various + structures to provide a better separation between 6LoWPAN networking + and PF_IEEE802154 address family (2017-08-20). + * STM32 DAC: fix some configuration logic. When STM32_NDAC is greather + than 1, then second channel is always DAC1OUT2. From Mateusz Szafoni + (2017-08-20). + * PF_IEEE802154 address family: IEEE 802.15.4 network device: Make + same changes as per loopback device so that it will build with + PF_IEEE802154 but without 6LoWPAN. More fixes to device registration + and to IEEE 802.15.4 loopback driver for PF_IEEE802154 without + 6LoWPAN. Changes to conditional compilation so that PF_IEEE802154 + can build without 6LoWPAN (2017-08-20). + * drivers/net/tun.c: Currently cannot support TAP mode unless Ethenet + is enabled (2017-08-20). + * PktRadio loopback driver: Fix compile problem by removing + inappropriate const storage class (2017-08-20). + * Networking: Remove driver based backlog support. This affects the + entire network, but is used by only one driver. The only supported + RX backlog is now via common read-ahead buffering (2017-08-21). + * PF_IEEE802154 socket family: (1) Improve some backlog counting + logic; add more assertions to catch cases where the backlog count + might deviate from the actual backlog. (2) Add a maximum backlog + option. This will prevent overrun of the RX frame queue if many + frames are received from the radio, but no application is receiving + the queued data. (3) On input, there may be a list of frames + provided, not just one. When closed() and connection is freed, also + need to free any frames remaining in the RX queue (2017-08-21). + * Network procfs: Add support for network procfs statistics when + nothing is enabled but PF_IEEE802154 (2017-08-21). + * STM32 DAC: Add support for HRTIM triggering. Separate dma buffer + configuration for channels. From Mateusz Szafoni (2017-08-21). + * ENCX24J600: Fix some warnings. Update interface to use newer + parameter passing to interrupt handlers (2017-08-21). + * ENC28J60: Update interface to use newer parameter passing to + interrupt handlers (2017-08-21). + * drivers/analog/comp: add poll support. From Pekka Ervasti + (2017-08-22). + * STM32L4 COMP: Bind to upper half comp driver. From Pekka Ervasti + (2017-08-22). + * STM32L4 ADC: correct EXTSEL macros. From Juha Niskanen + (2017-08-22). + * drivers/lcd: ssd1306: (1) Separate lcd_dev_s setup to separate + object. g_oleddev takes 1 KiB because framebuffer and was allocated + to .data section because of lcd_dev_s function pointer setup. Move + lcd_dev_s setup out, so that g_oleddev goes to .bss and avoid wasting + ROM. (2) Fix memory corruption caused by ssd1306_getrun(). + ssd1306_getrun was writing one extra byte (with value 0) past target + buffer when pixlen is multiple of 8. When pixlen was not multiple of + 8, last byte of buffer was fully cleared, instead of modifying only + the (pixlen % 8) bits of last byte. (3) Add support for board power + control. ThingseeOne has regulator for controlling display power + on/off. Patch adds support for board based power control to SSD1306 + driver. (4) Add DD-12864WO-4A/SSD1309 support to SSD1306 driver. + From Jussi Kivilinna (2017-08-22). + * Network procfs: procfs/net_procfs_route.c building error occur if + CONFIG_NET_ROUTE is enabled. Fix suggested by Aleksandr Kazantsev + (2017-08-22). + * Networking: Fix ompile error if Unix domain sockets selected + (2017-08-23). + * STM32L4 TIM: TIM15,16,17 are always in APB2. From Juha Niskanen + (2017-08-25). + * STM32L4 DAC: report transfer as completed in DMA callback. Without + this even O_NONBLOCK writes block the calling task if DAC was using + DMA. From Juha Niskanen (2017-08-25). + * STM32L4 COMP: comparators share RCC enable bit with SYSCFG. From + Juha Niskanen (2017-08-25). + * power: add driver for TI bq2429x battery charger. TODO: Untested. + Does not have poll() support. From Juha Niskanen (2017-08-25). + * 6LoWPAN: The original, Contiki-based design used only a single + buffer for reassemblying larger packets. This could be a problem + issue for hub configurations which really need the capability + concurrently reassemble multiple incoming streams concurrently. + These was also a design issue in that the reassembly buffer could be + corrupted by outgoing packets. The design was extended to support + multiple reassembly buffers, each associated with the reassembly tag + and source address. This assures that there can be be no corruption + of the reassembly once it has started (2017-08-26). + * Simulator: Adds necessary functionality to build Simulator under ARM + Linux. Tested only on Raspberry3. Currently setjmp/longjmp do not + save/restore floating point registers. From Nickolay Semyonov + (2017-08-26). + * fs: FS_AUTOMOUNTER should depend on SCHED_LPWORK. From Nickolay + Semyonov (2017-08-26). + * configs/lc823450-xgevk: Add eMMC/SD and USB support. From Masayuki + Ishikawa (2017-08-27). + * LC823450: eMMC/SD and USB support for LC823450. From Masayuki + Ishikawa (2017-08-27). + * drivers/analog/comp.c: Fix compilation errors when poll disabled. + From Mateusz Szafoni (2017-08-27). + * stm32_dac.c: conditional logic for timer triggering, fix TSEL + configuration when HRTIM, DMA request remapping, Add DMA buffers + initialization logic. From Mateusz Szafoni (2017-08-27). + * STM32 HRTIM: Fix DAC triggers configuration, Add missing master timer + logic, enable DAC triggering. From Mateusz Szafoni (2017-08-27). + * STM32F33: missing SYSCFG CFGR3 definitions. From Mateusz Szafoni + (2017-08-27). + * STM32 DAC: support external triggering for DMA transfer. From + Mateusz Szafoni (2017-08-27). + * ARM: Add support for STM32F433RC. From Alan Carvalho de Assis + (2017-08-27). + * STM32L4 RCC: Enable ADC clock source. From Juha Niskanen + (2017-08-28). + * drivers: analog: adc: Add poll support. From Juha Niskanen + (2017-08-28). + * STM32, STM32L4, STM32F7 ADC: fix channel 18 sample time. Frpm Juha + Niskanen (2017-08-28). + * STM32L4 ADC: implement peripheral. From Juha Niskanen (2017-08-28). + * work_queue() must cancel existing work prior to queuing new work, + otherwise the work queue list structure can become corrupted. + Problem noted by Pascal Speck (2017-08-28). + * STM32 HRTIM: Add DMA configuration. From Mateusz Szafoni + (2017-08-28). + * Networking: Move TCP specific files from inet/ to tcp/. There is + another TCP-specific logic in inet/ that should be moved sometime, + but those are more entangled (2017-08-29). + * Networking: TCP disconnection callbacks are not retained in a list. + This will support multiple callbacks per lower-level TCP connection + structure. That is necessary for the cae where a socket is dup'ed + and shares the same lower-level connection structure. NOTE: There + still needs to be a call to tcp_start_monitor() when the socket is + dup'ed (2017-08-29). + * Networking: Start the network monitor for a socket when a TCP socket + is dup'ed (2017-08-29). + * Networking: A placeholder for some missing logic in the previous + change related to monitoring network status for dup'ed sockets. If + one of the dup'ed socket's is closed, then network monitor resources + associated with that one socket must be recovered. Also, in the + event that socket is being used on one thread, but then closed on + another, any threads waiting for events from the socket should be + informed of the closure. That latter requirement is not implemented + because current data structures do not support it (2017-08-29). + * Networking: Clean up some naming that has bothered me for a long + time... There are no interrupts and no interrupt handlers in the + network. There are events and event handler (there used to be + interrupt logic in there years ago but that is long, long gone) + (2017-08-29). + * configs: update STM32L4 configs for ADC changes. From Juha Niskanen + (2017-08-30). + * configs: update STM32L4 configs for ADC changes. From Juha Niskanen + (2017-08-30). + * Porting Guide: Add usage tip for reading CAN messages from the CAN + driver without losing message (2017-08-30). + * Networking: socket dup() conditional operation was missing the test + for the condition (2017-08-30). + * ARMv7-M syscall logic: Clear bit 0 in PC settings. Bit 0 is the + thumb mode indication and should not be set in the PC. This extra + bit has not caused problems in the past, but seeing it set in the PC + is unnerving (2017-08-30). + * Networking: Fix a race condition. The accept() operation is + performed with the network locked. However, the network is unlocked + BEFORE the connected state is set. Therefore, a context switch may + occur and the socket may no longer be connected when it is marked so. + Noted by Pascal Speck (2017-08-31). + * Work queue: In a recent change for a problem noted by Pascal Speck, + it was noted (again by Pascal Speck) that the cancellation of + existing work and replacement with new work must be atomic. Thanks, + Pascal (2017-08-31). + * LPC43xx: Modify up_allocate_(k)heap() to support PROTECTED mode. + From Alan Carvalho de Assis (2017-08-31). + * STM32 Timer: Add the set counter function for stm32 timers. From + Sergey Ustinov (2017-08-31). + * configs/Bambino: Add protected mode configuration to Bambino board. + From Alan Carvalho de Assis (2017-08-31). + * STM32L4 DAC: add option for routing DAC output to ADC. Actually + write something to the DAC DMA buffer. From Juha Niskanen + (2017-08-29). + * STM32L4 DAC: separate DMA buffer configuration for channels. From + Juha Niskanen (2017-08-29). + * STM32L4 DAC: Fix naming so that DAC1 and DAC2 always refer to + channels 1 and 2. User should not be bothered by details like how + many IP blocks there are. As no current STM32L4 has second DAC block + (channel 3), remove support for such hypothetical hardware. DMA + channels corrected. From Juha Niskanen (2017-09-01). + * configs/nucleo-l496zg: add DAC and missing TIM frequencies. From + Juha Niskanen (2017-09-01). + * Networking: net_timedwait() and net_lockedwait() no longer return + errors via errno but returned negated errno values like other + internal OS functions (2017-09-01). + * Networking: Fix net_lock returning ERROR when instead of real error + code on failure. From Jussi Kivilinna (2017-09-01). + * net/local: Fix server lc_waitsem overflow. From Jussi Kivilinna + (2017-09-01). + * drivers/bch: Add poll support. From Jussi Kivilinna (2017-09-01). + * STM32 F7: do not enable read-modify-write on DTCM. "AN 4667 - + STM32F7 Series system architecture and performance" recommends to + disable read-modify-write on DTCM: "If the DTCM-RAM is used as data + location and the variables used are byte or/and halfword types, since + there is no ECC management in this RAM on the STM32F7 Series, it is + recommended to disable the read-modify-write of the DTCM-RAM in the + DTCM interface (inthe DTCMCR register) to increase the performance." + From Jussi Kivilinna (2017-09-01). + * Networking: IGMP: Remove special support for interrupt level + processing (there is none) and fix some timer cancellation logic. In + many files, correct comments. There is no interrupt level processing + in the networking layer (2017-09-02). + * stm32_dac.c: fix compilation when DMA disabled for channel. From + Mateusz Szafoni (2017-09-02). + * Extend the RTC framework with an alarm read ioctl (RTC_RD_ALARM). + Through it consumer could get configuration settings about previously + scheduled hardware alarms (active status, hours, minutes, seconds). + From Boris Astardzhiev (2017-09-03). + * STM32 F7: Port Boris Astardzhiev's RTC change for STM32L4 to STM32F7 + (2017-09-03). + * STM32: Port Boris Astardzhiev's RTC change for STM32L4 to STM32 + (2017-09-03). + * Kinetis: Unverified implementation of the alarm read function. + Pretty simple because the Kinetis RTC is just a 1Hz counter + (2017-09-03). + * STM32 HRTIM: add burst mode configuration, rename some definitions. + From Mateusz Szafoni (2017-09-03). + * Update net_timedwait() and net_lockedwait() call sites to handle + negated errno in return value. From Jussi Kivilinna (2017-09-04). + * stm32f7: Add new configuration option for enabling flash ART + Accelerator and flash prefetcher. From Jussi Kivilinna + (2017-09-04). + * Simulation: Fix building 32-bit simulation on 32-bit X86. From + Jussi Kivilinna (2017-09-04). + * waitpid(): Corrects two problems when + CONFIG_SCHED_HAVE_PARENT+CONFIG_SCHED_CHILD_STATUS are enabled: (1) + Was erroring out if the waited for task had already exited, and (2) + was not freeing resources when a wait was completed. From Boris + Astardzhiev (2017-09-04). + +7.23 2017-12-04 Gregory Nutt + + * STM32L4: ADC, Kconfig small changes: + - STM32L4 ADC: port analog watchdog ioctls from the Motorola MDK + - STM32L4: Kconfig: add some L486 and L496 chips, remove duplicates + From Juha Niskanen (2017-09-06). + * 6LoWPAN: Correct an error in uncompressing multicast address + (2017-09-08). + * sem_open() should return SEM_FAILED on any failures. This is change + in the POSIX specification since the original sem_open() was written + so many years ago (2017-09-08). + * STM32: Add logic for enabling wakeup pins. From Oleg Evseev + (2017-09-08). + * Update/fix last commit: On some STM32's, the CSR regiser is 18 vs. 16 + bits wide. Need to use 32-bit register accesses (2017-09-08). + * 6LoWPAN: I believe, based on RFC review, that with the last multicast + change, the NuttX 6LoWPAN is now compliant with RFC 6282 (2017-09-08). + * arch/arm/Kconfig: Add more classic ARM11 architecture selections + (2017-09-09). + * 6LoWPAN/Radio: Rename radio property sp_pktlen to sp_framelen. Add + 6LoWPAN utility to get the max frame length (not yet hooked in) + (2017-09-10). + * 6LoWPAN: Remove the option to disable fragmentation support. Two + reasons: (1) First fragementation is always required because IPv6 + requires an MTU of 1280 bytes. The is no application use case that can + work without fragmentation support. And (2) it greatly reduces the + complexity of the code (2017-09-10). + * net/sixlowpan: Remove CONFIG_NET_6LOWPAN_FRAMELEN. In this case where + multiple radios are supported, this may not be a constant. 6LoWPAN now + always queries the driver to get the maximum frame length (2017-09-10). + * drivers/smps.c: fix error messages. From Mateusz Szafoni (2017-09-10). + * configs/stm32f334-disco: beginning of lower half driver for high power + LED (powerled). From Mateusz Szafoni (2017-09-10). + * Misc STM32 fixes + - stm32f33xxx_hrtim.h: fix definition + - stm32_hrtim: fix pclk calculation + - stm32_hrtim.c: cosmetics + - add upper-half driver for high power LED driver (powerled) + From Mateusz Szafoni (2017-09-10). + * drivers/video/fb.c: Add framebuffer character device (2017-09-11). + * drivers/video/fb.c: Add support for LCD drivers that use a simulated + framebuffer and must receive explicit notification when there is an + update to a region in the framebuffer (2017-09-11). + * configs/lc823450-xgevk: Enable ADC and watchdog driver. From Masayuki + Ishikawa (2017-09-12). + * arch/arm/src/lc823450: Conform to the NuttX coding style, merge the + latest fix in lc823450_rtc.c, add ADC driver, add watchdog driver. From + Masayuki Ishikawa (2017-09-12). + * net/sock: recvfrom: Fix double leave_cancellation_point on error + path. From Jussi Kivilinna (2017-09-12). + * net/socket: Do not enter cancellation point in psock_send() as this + is already done in send(). From Jussi Kivilinna (2017-09-12). + * net/socket: send: verify that sockfd is valid, fixes assert when using + send on closed socket. From Jussi Kivilinna (2017-09-12). + * drivers/video/fb.c and include/nuttx/video.fb.h: Some improvements + and fixes from early testing sith the sim/fb cnofiguration (2017-09-12). + * sim/configs/fb: Add a configuration for non-graphical testing of the + frambuffer character driver using apps/example/fb (2017-09-12). + * Rename CONFIG_VIDEO_DEVICES to CONFIG_DRIVERS_VIDEO to conform better + to the evolving configuration naming standard (2017-09-12). + * Rename CONFIG_AUDIO_DEVICES to CONFIG_DRIVERS_AUDIO to conform better + to the evolving configuration naming standard (2017-09-12). + * stm32: stm32 alt I2C ensure proper error handling. Injecting data + errors would cause the driver to continually reenter the isr with BERR + an RxNE. This fix allows the error to be cleared and propagated to the + waiting task. From David Sidrane (2017-09-12). + * stm32x i2c fixes, stm32: Fix coding standard error, stm32f7 I2C: fixed + typo in comment. From David Sidrane (2017-09-13). + * STM32 Tickless: Fixes compilation error when timer info/debug messages + are enabled. From Rajan Gill (2017-09-13). + * net/: Fix some errors found by Coverity. + * STM32/STM32 F7: Fix some errors found by Coverity (2017-09-13). + * drivers/video/fb.c: File offset is in units of bytes, not pixels + (2017-09-14). + * drivers/lis3dsh.c: Added the argument parameter (FAR void *arg) to + the interrupt handler provided by the LIS3DSH driver to fit the + definition for ISRs in xcpt_t. Changed the check for working queue + availability in lis3dsh interrupt handler to use work_available() and + not crash in case of an overrun. From Florian Olbrich (2017-09-14). + * configs/stm32f4discover: Added initialization code and Kconfig entries + to set up the LIS3DSH accelerometer driver on STM32F4Discovery rev. C + boards and attach the associated interrupt callback. From Florian + Olbrich (2017-09-14). + * Added initialization code and Kconfig entries for LIS3DSH + accelerometer on STM32F4Discovery + associated changes to LIS3DSH + driver. From Florian Olbrich (2017-09-14). + * LPC31xx: Change naming of some global variables to match coding + standard (2017-09-14). + * wireless/ieee802154/: Moves MAC802154IOC from ieee802154_ioctl.h and + renames ieee802154_ioctl.h to ieee802154_device.h since it only contains + types relevant to the MAC char device now. From Anthony Merlino + (2017-09-15). + * wireless/ieee802154: Adds support for receiving MAC events via IOCTL + through socket interface. Other small fixes and cleanup. From Anthony + Merlino (2017-09-15). + * drivers/wireless: Adds XBee S2C (802.15.4 firmware) support. XBee + driver emulates mac802154 interface. From Anthony Merlino (2017-09-15). + * sched/waitpid.c: Eliminate a warning detected by GCC 6 (2017-09-15). + * drivers/xbee: Fixes a few warnings + - drivers/xbee: Fixes a few warnings + - configs/clicker2-stm32: Updates sections about i8sak usage in the + README + From Anthony Merlino (2017-09-15). + * STM32 Tickless: The attached patch removes the restriction to 16bit + counts when a 32bit timer is used for the new tickless on the stm32. As + it is now, the restriction is very limiting, especially if one wants + high granularity and large achievable intervals and has the hardware + (namely the 32bit timers) available. From Rajan Gill (2017-09-16). + * configs/open1788: Initialization now follows the pattern of other + boards. Add initialization of fb driver. Add a configuration for + testing the framebuffer driver (2017-09-16). + * drivers/video: fb driver now clears framebuffer initially. Eliminates + (or minimizes) initial garbage on the display (2017-09-16). + * SAMV71-XULT: Add support for fb_driver (2017-09-17). + * drivers/lcd: Add suppose for a generic front-end that will convert + any LCD driver into a framebuffer driver (2017-09-17). + * SAMv71-XULT: Add a configuration to test the LCD framebuffer driver. + Not quite yet working properly (2017-09-17). + * configs/stm3210e-eval: Rename stm32_appinit.c to stm32_bringup.c so + that the start up logic is compatible with other, new boards. Bring in + new stm32_appinit.c, add board_initialize(), add support for FB + character driver (2017-09-17). + * configs/stm3240g-eval: Rename stm32_appinit.c to stm32_bringup.c to + better match other architectures. Replace the old-style stm32_appinit.c + with tne new one from the STM32F4-Discovery. Add a configuration for + testing the FB character driver at drivers/video/fb.c using the LCD + frame driver front end at drivers/lcd/lcd_framebuffer.c. Appears to be + fully functional (2017-09-17). + * netinet/in.h: Add missing IN6_IS_ADDR_V4COMPAT macro (2017-09-18). + * configs/stm32f4discovery: Update README. Add summary of differences + with the newest STM32F407G-DISC1 part. Remove a lot of old discussion + that is really no longer helpful (2017-09-18). + * Networking: sockgetname() files need to include udp/udp.h and + tcp/tcp.h or otherwise NET_UDP_HAVE_STACK and NET_TCP_HAVE_STACK are + undefined and the logic is never compiled. Noted by Anthony Merlino + (2017-09-18). + * Add driver for APA102 LED controller. These LEDs are used on LED + Strips and are controlled over SPI (2017-09-18). + * configs/stm32f103-minimum: Add board support for APA102 driver. From + Alan Carvalho de Assis (2017-09-18). + * sched/env_dup.c: Fix an error in the duplication of the child tasks + environment in the special case where the parent's environment was + created, but then all of the variables were unset. In that case, there + is still an allocation in place but the size of the allocation is zero. + This case was not being handled correctly when a child task attempts to + create its environment and inherit the zero-size partent environment. + Noted by Anthony Merlino (2017-09-18). + * STM32L4 DFSDM: add peripheral, DAC, TIM: small changes + - STM32L4 DAC: do not configure output pin if it is not used + - STM32L4 TIM: fix compilation of timers with complementary outputs + when not PWM_MULTICHAN + - STM32L4 DFSDM: peripheral for digital filters for sigma-delta ADCs + Initial version. Timer trigger support is not completed and there is + some issue with DMA. + From Juha Niskanen (2017-09-19). + * stm3240g-eval: Remove some bad conditional compilation (2017-09-19). + * Networking: IPv4 getsockname(): Fix a typo that can cause a compile + error (2017-09-19). + * viewtool-stm32f107: Enable NSH arch-specific initialization. Rename + stm32_appinit.c to stm32_bringup.c for consistency with other boards. + Replace old stm32_appinit.c (now stm32_bringup.c) with 'standard' + stm32_appinit.c from the STM32F4-Discovery. Add CONFIG_BOARD_INITIALIZE + logic to stm32_boot.c. Add support to auto-mount the procfs file system + (2017-09-19). + * Networking: Add implementation of logic for SIOCGIFCONF and + SIOCGLIFCOF IOCTL commnds (2017-09-19). + * Networking: drivers/net/loopback.c: Eliminate a warning. + net/netdev/netdev_ifconfig.c: Was not returning all of the address info + (2017-09-19). + * STM32L4 ADC, DFSDM: add routing of ADC data to DFSDM filters. From + Juha Niskanen + - configs/nucleo-l496zg: add DFSDM initialization + - STM32L4 ADC: add option for routing ADC data to DFSDM, fix DFSDM + DMA (2017-09-20). + * SIOCGIFCONF and SIOCGLIFCONF IOCTL commands should only report on + network adatpors in the UP state (2017-09-20). + * In some cases, packets are still not sent behind the router. I found + that NuttX sends the ARP requests not to the router but to the target. + Mistake in file net/route/netdev_router.c. From Aleksandr Kazantsev + (2017-09-20). + * stm32: stm32f40xxx I2C ensure proper isr handling. Injecting data + errors that causes a STOP to be perceived by the driver, will + continually re-enter the isr with SB not set and BTF + and RxNE set. This changes allows the interrupts to be cleared and + propagates a I2C_SR1_TIMEOUT to the waiting task. From David Sidrane + (2017-09-21). + * include/nuttx/net/net.h: Add missing semicolon in prototype. Fixes + error in certain combinations of configuration options. From Pavel Pisa + (2017-09-21). + * drivers/pipes: pipe_common: Fix writing large buffers not triggering + POLLIN for reader poll. From Jussi Kivilinna (2017-09-21). + * drivers/usbdev: Add support for RX flow control to the CDC/ACM driver + (2017-09-22). + * STM32 Serial: Fix some incorrect conditional compilation (2017-09-23). + * drivers/usbdev: Add support for flow control TERMIOs in CDC/ACM + driver (2017-09-23). + * drivers/usbdev: CDC/ACM should reset all 'irregular' notifications to + zero after sending the SerialState packet (2017-09-23). + * drivers/usbdev: Fix some bad conditional logic (2017-09-23). + * Fixes several errors preventing icmpv6_radvertise.c from being + compiled. Fixes conversions to network byte order (namely vlifetime, + plifetime, mtu). IPv6 source address is set to link-local IP address + instead of the address in the netdev structure. This is in compliance to + RFC 4861. RA didn't work on Linux before this change. Finally, router + prefix and prefix length are derived from the IPv6 address and netmask + in the netdev structure. This seems to make more sense than using a + predefined, separate prefix from the config. From Sakari Kapanen + (2017-09-24). + * drivers/usbdev/usbdev: Add RNDIS-over-USB driver. From Sakari Kapanen + (2017-09-24). + * net/igmp/igmp_send.c: Fix incoming IGMP checksum calculation. From + Louis Mayencourt (2017-09-25). + * Fixes for problems found by Coverity in the nuttx repository: + - net/socket/recvfrom.c: Check fromlen integrity before using it. + - net/socket/net_sockets.c: Always check for valid psock before using. + - net/tcp/tcp_send_unbuffered.c: Avoid using psock beforing + checking its integrity. + - sched/timer/timer_create.c: Fix watchdog resource leak if cannot + allocate a new timer. + From Bruno Herrera (2017-09-25). + * drivers/usbdev/Kconfig: Add comments in regard to RNDIS selection + (2017-09-25). + * configs/nucleo-f410rb: Add support for the nucleo-F410RB board. From + Gwenhael Goavec-Merou (2017-09-25). + * STM32 L4: Add SDMMC driver. From Miha Vrhovnik (2017-09-26). + * Nucleo-L496ZG: Add support for SDMMC driver. From Miha Vrhovnik + (2017-09-26). + * drivers/usbdev/cdcacm.c: Avoid using priv before checking its + validity. From Juha Niskanen (2017-09-26). + * drivers/usbdev/cdcacm.c: Change design for queuing RX packets that + cannot be processed. Previous design had a logic problem that could + cause data loss (2017-09-26). + * drivers/usbdev/cdcacm.c: Add a failsafe time to assure that the RX + pending queue cannot stall indefinitely. I can imagine a corner case + where the serial driver's RX buffer is full and it stops accepting data + and where all of the read requests are queued and there is not event to + restart RX processing. I am not sure that that scenario can really + happen, but the failsafe timer gives me peace of mind (2017-09-26). + * Build break fix: define PWM_TIM2_CH1CFG for channel 1 PWM. From + Tomasz Wozniak (2017-09-26). + * Fixed directory unlocking in tmpfs_opendir. From Dmitriy Linikov + (2017-09-27). + * drivers/usbdev/cdcacm.c: Add some missing logic when flow control is + disabled. Also make sure that the flowcontrol and rxint can handle + being re-entered when cdcacm_release_rxpending() is called (2017-09-27). + * drivers/usbdev/cdcacm.c: Fix confusion between flow control being + enabled and being active. Different things (2017-09-27). + * drivers/usbdev/cdcacm.c: Change ordering of some operations to avoid + races; Add missing uppder watermark logic that is normally in + serial_io.c but must be duplicated in cdcacm.c (2017-09-27). + * net/route: Permit IPv4 and IPv6 routing tables to be of different + sizes (2017-09-27). + * ROMFS for STM32F4 Discovery board. From Tomasz Wozniak (2017-09-28). + * STM32 PWR: Adds stm32_pwr_getsbf and stm32_pwr_getwuf functions that + return the standby flag and the wakeup flag PWR power control/status + register. From Oleg Evseev (2017-09-28). + * net/arp/arp_out.c: Fix IGMP Ethernet address computation. From Louis + Mayencourt (2017-09-28). + * net/route: Adds support for read-only routing tables. Prior to this + change, routing tables were only support in RAM and had to be + initialized with explicit logic to add the necessary routes to the + routing table. With this change, routes may be defined in the + pre-initialized, read-only routing table provided by the board-specific + logic + + This would be particularly useful, for example, in the case where + there is only a single network adaptor and you want all output packets + to go to the single adaptor in all cases. So for that behavior you + could add a read-only routing table to the board-specific long that + contains a single entry, the default route: 0.0.0.0/0 (2017-09-28). + * fs/vfs: file_seek() is an internal OS interface and should not errors + via the errno (2017-09-28). + * fs/vfs: file_read() is an internal OS interface and should not errors + via the errno (2017-09-28). + * fs/vfs: file_write() and file_pwrite() are internal OS interfaces and + should not report errors via the errno (2017-09-28). + * STM32L4 FLASH, DFSDM: option bytes, JEXTSEL bits, ADC1 output to DFSDM + chips change + - STM32L4 FLASH: add function for modifying device option bytes + - STM32L4 DFSDM: add JEXTSEL bits, ADC1 output to DFSDM chips change + ST's documentation hints that ADC output can be routed to DFSDM on + some STM32L4X3 chips, but I got confirmation from tech support that + this is just a documentation error so remove this from Kconfig + From Juha Niskanen (2017-09-29). + * This commit adds support for routing tables in files in a file + system. This might be useful for customized, per-unit routing tables. + There are two issues with it however: + 1. Reading from file system on a per packet basis could be slow. I + think it probably should have a small, in-memory cache of most + frequently used routes for good problem. + 2. Currently the delroute logic is disabled due to a problem with + the design. NuttX does not currently support truncate(). + Therefore, it is not possible to delete entries from the routing + table file. + In this current implementation, that leaves the last entry intact at + the end of the file. An alternative design might include a tag on + each record to indicate if the record is valid or not. That would + work but would add complexity to the other routing table functions + (2017-09-29). + * net/route: Add support for an in-memory routing table cache in order + to improve performance when the routing table is retained in a file. + The cache holds the most recently used routing table entries and so can + eliminate some file access. Flush the in-memory cache when any entry is + deleted from the routing table. When a router matching an IP address is + found, add the routing table entry to the cache (2017-09-29). + * fs/vfs: null check for path on open and buf on write. Null path + check is depend on CONFIG_DEBUG_FEATURES and CONFIG_DEBUG_ASSERTIONS, + added null checking so it's always performed Added null checking on buf + for write(). From Xiao Qin (2017-09-29). + * net/route: File read/write logic should be able to handle short reads + and writes (2017-09-29). + * drivers/syslog: syslog internal functions should not set the errno + variable: ramlog_putc(), syslog_dev_putc(), syslog_dev_write(), + syslog_force() (2017-09-29). + * net/sockets: psock_sendto() is an internal OS interface an should not + set the errno variable (2017-09-29). + * net/sockets: psock_send() is an internal OS interface an should not + set the errno variable (2017-09-29). + * psock_send() no longer sets errno, so send() must now set it + (2017-09-30). + * net/: Versions of psock_send() and pock_sendto() should not set + errno. That is taken care of at a higher level in the send()/sendto() + implementation as appropriate (2017-09-30). + * net/: psock_accept() is an internal interface and should not set the + errno (2017-09-30). + * net/: psock_bind() is an internal interface and should not set the + errno (2017-09-30). + * net/: psock_connect() is an internal interface and should not set the + errno nor should it be a cancellation point (2017-09-30). + * net/: psock_listen() is an internal interface and should not set the + errno (2017-09-30). + * net/: psock_getsockopt() is an internal interface and should not set + the errno (2017-09-30). + * net/: psock_getsockopt() and psock_socket() are an internal interfaces + and should not set the errno (2017-09-30). + * net/: psock_accept() is not a cancellation point (2017-09-30). + * net/: psock_recvfrom() is an internal interface and should not set the + errno nor should it be a cancellation point (2017-09-30). + * net/ and fs/: net_vfcntl(), file_fcntl(), file_dup(), and file_dup2() + are all internal OS interfaces and should not modify the errno value + (2017-09-30). + * net_dupsd() and net_dupsd2() are internal OS functions and should not + set the errno variable (2017-09-30). + * psock_ioctl() and netdev_ioctl() are internal OS functions and should + not set the errno variable (2017-09-30). + * psock_close() and net_close() are internal OS functions and should not + set the errno variable (2017-09-30). + * SAMv7, STM32, STM32 L4: DAC and ADC drivers are not permitted to set + the errno (2017-09-30). + * SIM LPC31xx: Serial and console drivers are not permitted to set the + errno (2017-09-30). + * STM32, STM32 F7: LTDC and DMA2D drivers are not permitted to set the + errno (2017-09-30). + * drivers/serial: 16550 UART driver IOCTL method must not set errno; it + must return a negated errno value (2017-09-30). + * drivers/lcd: ILI9341 initialize method not permitted to set errno + (2017-09-30). + * drivers/sensors: LIS331DL driver not permitted to set errno + (2017-09-30). + * drivers/wireless: CC1101 driver not permitted to set errno + (2017-09-30). + * configs/z80sim and xtrs: Serial driver lower halfs ioctl methods + should return a negated errno value, not set the errno variable + (2017-10-30). + * compiler.h, limits.h, types.h: Update SDCC/z80 files to include + support for long long, inline, __FILE__, and __func__ (2017-10-01). + * z80 Make.defs: Fixes dependency generation with newest SDCC compiler + (2017-10-01). + * include/: Add stdnoreturn.h (2017-10-01). + * tools/configure.sh: Add special support so that you can start with a + windows native configuration and install on a different host (and vice + versa). (2017-10-01). + * stm32_hrtim: add support for capture, chopper, deadtime and dump + registers. From Mateusz Szafoni (2017-10-01). + * tools/configure.c: Duplicate new functionaity added to configure.sh + (2017-10-01). + * tools/configure.sh: Another fix for the script. The last change only + worked for Windows Cygwin; for Linux, it needed to remove some + additional things from the defconfig file (2017-10-01). + * configs/z80sim: convert other configurations to default to Linux + (2017-10-01). + * tools/: configure.sh and configure.c should redirect stdout to + /dev/null but should not suppress stderr output (2017-10-01). + * stdnoreturn.h: Add definitions for the C11 noreturn keyword. Also + Remove C++11 dependency. Applies to C too (2017-10-02). + * net/route: Add logic to mark a route as most-recently-used in the + route cache (2017-10-02). + * commit b2ea300b6fb7672cdb682a0957b5dd2cff63804d broke the STM32L4 port + for people not using the L496xx or L4A6xx. That was because + stm32l4_sdmmc.h is included from the stm32l4.h global header, and this + header fires an #error for other chips. I see that ALL stm32l4 have the + same SDMMC except the stm32l4x2, which has none. From Sebastien Lorquet + (2017-10-02). + * net/route: Fix an error in cache list management (2017-10-02). + * Add support for Micron MT25Q series MT25Q128. From Sebastien Lorquet + (2017-10-02). + * binfmt/: Don't schedule starthook if there are no constructors + (2017-10-02). + * binfmt/: exec_module(), load_module(), unload_module(), and + schedule_unload() are internal OS functions and must not alter the errno + variable (2017-10-02). + * stm32f103-minimum: Add ADC support on stm32f103-minimum board. From + Alan Carvalho de Assis (2017-10-02). + * syscall/: The non-standard interface exec() is now enshrined as a + official NuttX API. I really dislike doing this but I think that this + is probably the only want to load programs in the protected mode. It is + currently used by some example code under apps/ that generate their own + symbol tables for linking. Other file execution APIs relay on a symbol + table provided by the OS. In the protected mode, the OS cannot provide + any meaning symbol table for execution of code in the user-space blob so + that is they exec() is really needed in that build case. And, finally, + the interface is completely useless and will not be supported in the + KERNEL build mode where the contrary is true: An application process + cannot provide any meaning symbolic information for use in linking a + different process (2017-10-03). + * STM32L4 RTC, PM: small fixes to subseconds handling, ADC + power-management hooks + - STM32L4 ADC: add PM hooks from Motorola MDK + - STM32L4 RTC: add up_rtc_getdatetime_with_subseconds + - STM32 RTC: workaround for potential subseconds race condition. In + all recent STM32 chips reading either RTC_SSR or RTC_TR is supposed + to lock the values in the higher-order calendar shadow registers + until RTC_DR is read. However many old chips have in their errata + this silicon bug (at least F401xB/C, F42xx, F43xx, L15xxE, L15xVD + and likely others): "When reading the calendar registers with + BYPSHAD=0, the RTC_TR and RTC_DR registers may not be locked after + reading the RTC_SSR register. This happens if the read operation is + initiated one APB clock period before the shadow registers are + updated. This can result in a non-consistency of the three + registers. Similarly, RTC_DR register can be updated after reading + the RTC_TR register instead of being locked." + - STM32L4 RTC: correct RTC_SSR and RTC_TR read ordering. In all + recent STM32 chips reading either RTC_SSR or RTC_TR is supposed to + lock the values in the higher-order calendar shadow registers until + RTC_DR is read. Change the register read ordering to match this and + don't keep a workaround for a hypothetical race condition (not in + any L4 errata, lets for once assume ST's silicon works as it is + documented...) + - STM32L4 PM: remove useless #ifdefs and old non-L4 STM32 code + From Juha Niskanen (2017-10-03). + * sched/semaphore: Rename sem_reset() to nxsem_reset() so that it is + clear this is an internal OS function (2017-10-03). + * sched/semaphore: Rename sem_tickwait() to nxsem_tickwait() so that it + is clear this is an internal OS function (2017-10-03). + * libc/semaphore: Add nxsem_init() which is identical to sem_init() + except that it never modifies the errno variable. Changed all + references to sem_init in the OS to nxsem_init() (2017-10-03). + * sched/semaphore: Rename all internal private functions from sem_xyz + to nxsem_xyz. The sem_ prefix is (will be) reserved only for the + application semaphore interfaces (2017-10-03). + * libc/semaphore: Add nxsem_getvalue() which is identical to + sem_getvalue() except that it never modifies the errno variable. + Changed all references to sem_getvalue in the OS to nxsem_getvalue() + (2017-10-03). + * libc/semaphore and sched/semaphore: Add nxsem_getprotocol() and + nxsem_setprotocola which are identical to sem_getprotocol() and + set_setprotocol() except that they never modifies the errno variable. + Changed all references to sem_setprotocol in the OS to + nxsem_setprotocol(). sem_getprotocol() was not used in the OS + (2017-10-03). + * sched/semaphore: Add nxsem_destroy() which is identical to + sem_destroy() except that it never modifies the errno variable. Changed + all references to sem_destroy() in the OS to nxsem_destroy() (2017-10-03). + * sched/semaphore: Add nxsem_post() which is identical to sem_post() + except that it never modifies the errno variable. Changed all + references to sem_post in the OS to nxsem_post() (2017-10-03). + * sched/semaphore: Add the function nxsem_wait(). This is a new + internal OS interface. It is functionally equivalent to sem_wait() + except that (1) it is not a cancellation point, and (2) it does not set + the per-thread errno value on return. In all OS functions (not + libraries), change sem_wait() to nxsem_wait(). This will prevent the OS + from creating bogus cancellation points and from modifying the per-task + errno variable. This commit also backs out most of commit + b4747286b19d3b15193b2a5e8a0fe48fa0a8638c. That change was added because + sem_wait() would sometimes cause cancellation points inappropriately. + But with these recent changes, nxsem_wait() is used instead and it is + not a cancellation point (2017-10-04). + * sched/semaphore: sem_timedwait() is a cancellation point and, hence, + cannot be called from within the OS. Created nxsem_timedwait() that is + equivalent but does not modify the errno and does not cause + cancellation. All calls to sem_timedwait() change to calls to + nxsem_timedwait() in the OS (2017-10-05). + * sched/semaphore: sem_trywait() modifies the errno value and, hence, + should not be used within the OS. Use nxsem_trywait() instead + (2017-10-05). + * This change renames all internal, private NuttX signal-related + functions to use the prefix nxsig_ so that they cannot be confused with + application interfaces that begin, primarily, with sig_. This is + analogous to similar renaming that was done previously for semaphores + (2017-10-05). + * drivers/input/cypress_mbr3108: Add missing variable for nxsem_wait + return value. From Jussi Kivilinna (2017-10-06). + * fs/vfs and net/socket: fcntl() is not return success fail for + F_SETFL. Reported by Jussi Kivilinna (2017-10-06). + * This commit adds internal versions of the signal interfaces: + - sigtimedwait() -> nxsig_timedwait() + - sigwaitinfo() -> nxsig_waitinfo() + - nanosleep() -> nxsig_nanosleep() + Replace all usage of sigwaitinfo(), sigtimedwait(), and nanosleep() + with the OS internal counterparts nxsig_waitinfo(), nxsig_timedwait(), + and nxsig_nanosleep(). The internal OS versions differ from the + standard application interfaces in that they do not create + cancellation points and they do not modify the application's errno + variable (2017-10-06). + * Adds new OS internal functions nxsig_sleep() and nxsig_usleep. These + differ from the standard sleep() and usleep() in that (1) they don't + cause cancellation points, and (2) don't set the errno variable (if + applicable). All calls to sleep() and usleep() changed to calls to + nxsig_sleep() and nxsig_usleep() (2017-10-06). + * drivers/serial/tcdrain: tcdrain() was recently added to the NuttX C + library. But there is a problem. The specification of tcdrain() + requires that it be a cancellation point. In order to do this, tcdrain + was moved from the C library into the OS and the addition cancellation + point hooks were added. In non-FLAT builds, access via system calls is + also now supported (2017-10-06). + * net/Kconfig: Remove improper use of comma in syntax (2017-10-06). + * mm/: Heap semaphore logic needs to use nxsem_* interfaces when + available, but the standard semaphores only when implementing a + user-space heap. Not this does introduce and issue: the memory + management functions them become cancellation points because of the use + of sem_wait (2017-10-07). + * syscall/: Fix some backward conditional compilation (2017-10-07). + * sched/signal: Add nxsig_kill() which is functionally equivalent to + kill() except that it does not modify the errno variable. Replace all + usage kill() in the OS proper with nxsig_kill() (2017-10-07). + * graphics/vnc/server: Fix an error in the VNC server introduced with + recent big set of changes (2017-10-07). + * sched/signal: Add nxsig_queue() which is functionally equivalent to + sigqueue() except that it does not modify the errno variable. Replace + all calls to sigqueue() in the OS proper with calls to nxsig_queue() to + avoid accessing the errno variable (2017-10-07). + * sched/signal: Add internal OS interface nxsig_procmask(). This + internal interface is equivalent to the standard sigprocmask() used by + applications except that it does not modify the errno value. Also fixes + a problem in that the original sigprocmask() was not setting the errno. + Replace all calls to sigprocmask() in the OS proper with calls to + nxsig_procmask(). (2017-10-07). + * sama5d4-ek: Remove a really old defconfig example file that is so far + out of date that it can only be misleading (2017-10-07). + * Fix some build problems after recent separation of internal OS from + application interfaces. The build problem only occurs in the PROTECTED + and KERNEL builds where separate libraries are built for the + applications and for use within the OS. In these cases, the correct + interfaces must be used. This commit fixes a few of these, so I can get + through build testing, but there are many more that need fixin' + (2017-10-08). + * SDCC Fixes: Change some prototypes and some assumptions about the + size of unsigned int to get to a clean SDCC compile (2017-10-08). + * Fix some problems in the previous commits: Forgot to update sigset() + after change to prototype. Also there was a stray semicolon in the + change signal() (2017-10-08). + * libc/stdio: Build the lib_noflush() and lib_snoflush() stubs even if + CONFIG_FILE_DESCRIPTORS=0. They may still be needed (2017-10-08). + * configs/z80sim: Fix a naming problem. Also, don't try to build the + serial driver if CONFIG_NFILE_DESCRIPTOR=0 (2017-10-08). + * libc and libnx: When the libraries are built into two libraries, a + user space library and a OS space library (as in the PROTECTED and + KERNEL build). Then the user space library must not use the OS internal + interfaces; similarly, the OS must avoid using the userspace interfaces + so that it does not muck the errno value or create spurious cancellation + points (2017-10-08). + * Misc STM32 Fixes + - stm32_hrtim.c: fix burst mode prescaler update + - stm32f334-disco: add flash mode support for powerled driver + + cosmetics + From Mateusz Szafoni (2017-10-08). + * powerled.h: Add fault field to state structure. From Mateusz Szafoni + (2017-10-08). + * libc/termios: Adds tcflow() (2017-10-09). + * RNDIS: Use CONFIG_USBDEV_MAXPOWER instead of hardcoded value. Use + LPWORK for network operations by default. From Sakari Kapanen + (2017-10-09). + * sched/mqueue: Rename all OS internal functions declared in + sched/mqueue/mqueue.h to begin with nxmq_ vs. mq_. The mq_ prefix is + reserved for standard application interfaces. Rename all private static + functions for use the nxmq_ vs. mq_ naming (2017-10-09). + * task: Add new cancellation point interface, + check_cancellation_point() (2017-10-09). + * STM32, STM32L4 serial changes: + - stm32: serial: add interface to get uart_dev_t by USART number, + stm32_serial_get_uart + - stm32: serial: do not stop processing input in SW flow-control mode + - stm32l4: serial: do not stop processing input in SW flow-control + mode + - stm32l4: serial: suspend serial for Stop mode + From Juha Niskanen (2017-10-09). + * Misc STM32 Fixes + - stm32_powerled.c: cosmetics + - stm32_hrtim.c: cosmetics + - stm32/Kconfig: add HRTIM configuration and add DAC external + trigger configuration + - stm32f334-disco: Add powerled example configuration. From Mateusz + Szafoni (2017-10-09). + * drivers/power: Add powerled to Kconfig. From Mateusz Szafoni + (2017-10-09). + * BCM2708: Add enough infrastructrue (more stubs) to get a clean + compilation of the Pi Zero configuration (with many undefined things at + link time). This includes several register definition header files + (some from Alan Carvalho de Assis), basic interrupt handling logic, + boot-up files, GPIO support, build and configuration logic, basic board + support at configs/pizero (2017-10-09). + * sched/mqueue: Add internal function nxmq_send() and nxmq_timedsend() + that are equivalent to mq_send() and mq_timedsend() except that they do + not create cancellation points and do to not modify the errno variable. + Change all calls to mq_send() and mq_timedsend() in the OS to calls to + nxmq_send() and nxmq_timedsend(), making appropriate changes for + differences in return values (2017-10-10). + * sched/mqueue: Add nxmq_receive() and mxmq_timedreceive() which are + functionally equivalent to the standard mq_receive and mq_timedreceive() + except that (1) they do not create cancellation points, and (2) the do + not modify the application's errno variable. Change all calls to + mq_receive() and mq_timedreceive() in the OS to calls to nxmq_receive() + and nxmq_timedreceive(), making appropriate changes for differences in + return values (2017-10-10). + * Fix a few places where there was a semicolon following the 'if' + condition, making the following logic unconditional (2017-10-10). + * The INA219 is a combined voltage and current sensor that can measure + up to 26 volts and a current that depends on an external shunt + resistor. Connection happens via i2c/smbus and the chip features a + power supply rail that is independent from the measured voltage, so it + can measure low voltages. + + This commit adds a driver for this chip. Right now it measures bus + voltage and current, and does not use the internal calibrated current + reading, nor the available power measurement. From Sebastien Lorquet + (2017-10-10). + * configs/clicker2-stm32: Adds SD card, automount, and syslog file + support and fixes a few minor issues + - Moves defines for xbee from clicker2-stm32.h to stm32_xbee.h + - Adds support for uSD click boards and automount support + - Fixes minor guard clause + - Bring-up automounter before MMCSD + - MRF24J40 interrupt should only fire on falling edge. + - Adds file syslog support for logging to file on SD card + From Anthony Merlino (2017-10-11). + * Z80: Makefile fix for use with current SDCC (2017-10-11). + * fs/vfs: Change the return value of internal function fs_getfilep(). + It no longer sets the errno variable but, rather, returns errors in the + same manner as other internal OS functions (2017-10-11). + * Adds OS internal functions nx_send(), ns_recv(), and nx_recvfrom() + which are functionally equivalent to send(), recv(), and recvfrom() + except that they do not set the errno variable and do not cause + cancellation points (2017-10-11). + * Adds OS internal function nx_write() which is functionally equivalent + to write() except that it does not set the errno variable and do not + cause cancellation points (2017-10-11). + * sched/task: task_exithook.c fails to link if signals are disabled + because was unconditionally trying to send the SIGCHLD signal to the + parent in certain configurations. Noted by Jeongchan Kim (2017-10-11). + * arch/arm/src/samv7: Correct an error in RX DMA setup. From Manish + Kumar Sharma (2017-10-11). + * net/socket: psock_send/psock_sendto: remove assert check for null + psock and buf input pointers. Removes check as 'psock == NULL' + altogether because that checked for later in psock_send and + psock_sendto. Change null check for 'buf' so that it is handled same as + in recvfrom.c (return -EINVAL instead of assert). From Jussi Kivilinna + (2017-10-11). + * fs/vfs: Add new internal OS interface nx_read(). nx_read() is + functionally equivalent to read() except that it does not modify the + errno variable and it is not a cancellation point. Changed all + references to read() in the OS to nx_read() (2017-10-11). + * sched/signal: Add logic to wake up a thread that is waiting on a + signal if it is canceled (2017-10-12). + * nxsig_timedwait: Add logic to suppress the wait if there is a pending + cancellation (2017-10-12). + * stm32 SPI: Add missing include required when CONFIG_SPI_CALLBACK is + enabled. From Anthony Merlino (2017-10-12). + * STM32L4 RTC fixes: + - STM32L4 RTC: init mode was never exited because nested locking in + rtc_synchwait() disabled backup domain access + - STM32L4 RTC: Use backup register magic value instead of INITS + bit. The INITS (bit 4) of RTC_ISR register cannot be used to + reliably detect backup domain reset. This is because we can operate + our device without ever initializing the year field in the RTC + calendar if our application does not care about correct date being + set. Hardware also clears the bit when RTC date is set back to year + 2000. + - STM32L4 RTC: put back the SSR race condition workaround. ST has + confirmed that the issue has not been fixed, and that it applies to + STM32L4 too (was not in errata sheets due to documentation bug) See + discussion: https://community.st.com/thread/43710-issue-with-rtc-maximum-time-resolution + - STM32F4, STM32L4, STM32F7 RTC: add more CONFIG_RTC_NALARMS > 1 to + reduce code size + - STM32L4: rename stm32l4_rtcc.c to stm32l4_rtc.c to better match + STM32F7 + - STM32, STM32L4, STM32F7 RTC: stray comment and typos in + chip/stm32_rtcc.h + - STM32L4 RTC: change maximum alarm time from 24h to one month + From Juha Niskanen (2017-10-13). + * TCP Networking: When CONFIG_NET_TCP_WRITE_BUFF=y there is a situation + where a NULL pointer may be dereferenced. In this configuration, the + TCP connection's 'semi-permanent' callback, s_sndcb was nullified in + tcp_close_disconnect. However, other logic in tcp_lost_connection() + attempt to use that callback reference after it was nullifed. Fixed in + tcp_lost_connectino() by adding a NULL pointer change before the + access. This was reported by Dmitriy Linikov in Bitbucket Issue 72 + (2017-10-13). + * stm32f7 BBSRAM: stm32_bbsram: avoid assert in stm32_bbsram_savepanic. + If panic happens before stm32_bbsram is initialized, + stm32_bbsram_savepanic caused additional assert panic. Function has null + pointer check, so drop DEBUGASSERT. From Jussi Kivilinna (2017-10-13). + * FS FAT: Fix hard-fault when listing contents of FAT root. From Jussi + Kivilinna (2017-10-13). + * configs/stm32f4discovery: Add a USB MSC configuration. From Alan + Carvalho de Assis (2017-10-13). + * 6LoWPAN: Correct a bug in handling uncompressed frames (IPv6 + dispatch) (2017-10-13). + * 6LoWPAN: Fix a whole in the logic of the previous commit. It turns + out that g_uncomp_hdrlen has other usages so it cannot be modified as I + was doing. Instead, I needed to add a separate localt variable, + protosize, to keep track of the two usages of g_uncomp_hdrlen + (2017-10-13). + * configs/: The nx and nxtext examples no longer supports single user + mode (2017-10-14). + * The lcdrw example has been removed because it violates the portable OS + interface (2017-10-14). + * All configurations that use NXIMAGE or NXHELLO must select + NX_MULTIUSER. All configurations that use examples/nxterm must enable + CONFIG_LIB_BOARDCTL (2017-10-14). + * configs/stm32f103-minimum: Add support for LM75 in the + stm32f103-minimum board. From Alan Carvalho de Assis (2017-10-14). + * configs/: All configurations that use NXLINES must select + NX_MULTIUSER. All configurations that use the NX server need to have + larger POSIX messages (2017-10-14). + * boardctl(): Remove the BOARDIOC_GRAPHICS_SETUP command (2017-10-15). + * Initial ADC support for the STM32F33XX + - stm32_adc.h: add JEXTSEL definitions and hrtim trigger configuration + - stm32_adc.c: move STM32F33 ADC logic to a separate file + From Mateusz Szafoni (2017-10-15). + * configs/sim: Update touchscreen driver initialization to use only + multiple-user NX server logic (2017-10-15). + * configs/sim: Convert the traveler configuration so that it uses the + framebuffer driver (2017-10-16). + * task_delete(): Do not permit user applications to delete kernel + threads (2017-10-16). + * kthread_create(): Rename kernel_thread() to kthread_create() for + better naming consistency with task_create() and kthread_delete() + (2017-10-16). + * All other STM32: SHIFTR_SUBFS_MASK was correct in STM32F0 only + - STM32L1: use correct EXTI line definitions (2017-10-17). + * STM32 RTC fixes: + - RTC: canceling an alarm marks it as inactive + - STM32L4, STM32F4, STM32F7 RTC: fix reading alarm value that is + more than 24h in future + - STM32F0 RTC: fix backup register count in stm32_rtcc.h + From Juha Niskanen (2017-10-17) + * BCM2708: Add system timer register definitions and a partial + implementation of the tickless mode timer (2017-10-17). + * BCM2708: Add support for AUX interrupts. Add some build configuration + and support logic for low-level serial output (2017-10-17). + * drivers/usbdev: Correct input flow control logic when watermarks are + not enabled. Problem noedt by and change based on suggestion by Juha + Niskanen (2017-10-18). + * BCM2708: Add hooks to support both Mini- and PL011 UARTs (2017-10-18). + * BCM2708: Fleshes out GPIO interrupt logic (2017-10-18). + * fs/vfs: Fix after recent changes. write() was return negative values + in errno. Noted by Jussi Kivilinna (2017-10-18). + * drivers/usbdev: Move test for NULL pointer before the pointer is + deferences. Noted by Juha Niskanen (2017-10-18). + * net/: Fix some build issues noted when both IPv4 and IPv6 are + enabled. From Anthony Merlino (2017-10-18). + * photon: Support SPI1 and SPI3. From Anthony Merlino (2017-10-18). + * BCM2708: Allow pass parameters with AUX interrupts; Add mini-UART + break capability. BCM2708: Add Mini-UART logic. Still missing UART + configuration logic (2017-10-18). + * Alexey T, Bitbuck Issue 73: Lower part of STM32 CAN driver + arch/arm/src/stm32/stm32_can.c uses all three hw tx mailboxes and clears + TXFP bit in the CAN_MCR register (it means transmission order is defined + by identifier and mailbox number). + + This creates situation when order frames are put in upper part of CAN + driver (via can_write) and order frames are sent on bus can be + different (and I experience this in wild). Since CAN driver API + pretends to be "file like" I expect data to be read from fd the same + order it is written. So I consider described behaviour to be a bug. + + I propose either to set TXFP bit in the CAN_MCR register (FIFO + transmit order) or to use only one mailbox (2017-10-19). + * The timer frequencies (BOARD_TIMx_FREQUENCY) are incorrectly defined + in configs/stm3240g-eval/include/board.h. Since the APB prescalers are + set to divide by 4 and 2 respectively, the frequencies should be + "2xAPBx" as said in the comment.  The correct frequencies are already + defined but as STM32_APBx_TIMx_CLKIN. From Mattias Edlund (2017-10-19). + * drivers/ioexpander: The IRQ subsystem now supports passing a void * + parameter to IRQ handlers. Use that method to support multiple pc9555 + devices, by passing a pointer to the device to the board defined irq + handler. Now the CONFIG_ for multiple PCA devices just allocates device + structures dynamically instead of statically when not enabled. + + The same interrupt handler is entered with the device structure + parameter in all situations, multiple or single PCA. One should still + be careful if multiple PCA devices share the same IRQ. From Sebastien + Lorquet (2017-10-19). + * libc/match: Use of exp() vs expf() in logf() caused function to be + slow. From Alan Carvalho de Assis (2017-10-19). + * drivrs/mtd/filemtd.c: add block device MTD interface. Block MTD + interface allows using block device directly as MTD instead of having to + use file-system in between. NOTE that this provides the opposite + capability of FTL which will let you use an MTD interface directly as a + block device. From Jussi Kivilinna (2017-10-19). + * There was a reference counting problem in the TPC logic of + net_clone(). net_clone() which is the common logic underlying dup() and + dup2() for sockets. When net_clone() calls net_start_monitor() and + net_start_monitor() returns a failure (because the underlying TCP + connection) then net_clone() must back out the reference count on the + structure. Problem noted by Pascal Speck and this implementation of the + solution is based on his suggestion (2017-10-19). + * There was a possible recursion that could eventually overflow the + stack. The error occurred when closing the socket with inet_close() + while a socket callback was still queued. When the socket callback was + executed by devif_conn_event(), this resulted in a call to + psock_send_eventhandler() with TCP_CLOSE flag set which then called + tcp_lost_connection(). tcp_shutdown_monitor() then called + tcp_callback() again, which again called psock_send_eventhandler(), and + so on.... Noted by Pascal Speck. Solution is also similar to a + solution proposed by Pascal Speck (2017-10-19). + * nucleo-f334r8/adc: change serial console to USART2 (STLINK COM). From + Mateusz Szafoni (2017-10-19). + * stm32f33xxx_adc.c: fix some warnings and compilation error when extsel + not in use. From Mateusz Szafoni (2017-10-19). + * net/tcp: Same change to tcp_send_buffered.c probably also applies to + tcp_send_unbuffered.c (2017-10-19). + * net/tcp: Same change to tcp_send_buffered.c probably also applies to + tcp_sendfile.c (2017-10-19). + * tcp_lost_connection() is called from two places in tcp_sendfile.c + (2017-10-19). + * net/tcp: Same change to tcp_send_buffered.c probably also applies to + sixlowpan_tcpsend.c and inet_recvfrom.c (2017-10-19). + * drivers/sensor: Add driver for the APDS-9960 gesture sensor. From + Alan Carvalho de Assis (2017-10-20). + * include/nuttx/sensors/ioctl: deduplicate SNIOC_CFGR. From Jussi + Kivilinna (2017-10-20). + * drivers/sensors/hts221: power-on sensor for loading calibration data. + From Jussi Kivilinna (2017-10-20). + * arch/arm/src/stm32f7/i2c: fix I2C_M_NORESTART handling. From Jussi + Kivilinna (2017-10-20). + * drivers/sensors/apds9960.c: Use work_queue to read/process data when + receive an IRQ. From Alan Carvalho de Assis (2017-10-20). + * STM32L1, STM32L4 RTC: add periodic interrupts, update L1 RTC + implementation + - STM32L4 RTC: add support experimental CONFIG_RTC_PERIODIC + - STM32 RTC: separate STM32L1 RTC into a separate file + STM32L1 RTC is very close to F4 or L4 versions, with two alarms and + periodic wakeup support so backported L4 peripheral to L1. + - RTC: Add periodic alarms to upper and lower halves + From Juha Niskanen (2017-10-20). + * stm32_adc.c: clear pending interrupts. From Mateusz Szafoni + (2017-10-20). + * drivers/bch: The character driver to block device access now supports + an IOCTL to get the geomtry of the underlying block device (2017-10-20). + * fs/fat: Remove mkfatfs from the OS. This is a user-space application + and belongs in apps, not in the OS (2017-10-20). + * configs/nucleo-f334r8: add logic for zero latency high priority + interrupts example. From Mateusz Szafoni (2017-10-22). + * Misc STM32 chagnes + - STM32 HRTIM: Fix warnings related with RCC + - STM32F33xxx ADC: Add some publicly visable interfaces and some + code to support injected channels + - STM32F33xxx DMA: Add public interface to handle with DMA interrupts + From Mateusz Szafoni (2017-10-22). + * stm32f103-minimum: Add an ADPS-9960 example configuration. From Alan + Carvalho de Assis (2017-10-23). + * net/icmp: This change adds support for semi-standard IPPROTO_ICMP + AF_INET datagram sockets. This replaces the old ad hoc, nonstandard way + of implementing ping with a more standard, socket interface (2017-10-23). + * net/inet: Add check for protocol before handing out TCP and UDP + sockets (2017-10-23). + * arch/arm/common/up_checkstack: fix assert panic when both TLS and + interrupt stack are enable. From Jussi Kivilinna (2017-10-23). + * net/icmp: Correct some comments, typings, spacing problems from last + big ICMP socket change (2017-10-23). + * configs/: All defconfig filess that include + CONFIG_NET_ICMPv6_SOCKET=y need to select CONFIG_SYSTEM_PING6=y and + deselect CONFIG_DISABLE_POLL (2017-10-24). + * net/icmpv6: This commit adds support for semi-standard IPPROTO_ICMP6 + sockets. This is a replacement for the non-standard ICMPv6 ping support + that violated the portable POSIX OS interface (2017-10-24). + * mm/mm-heap: memalign: fix heap corruption caused by using unaligned + chuck size. Unaligned nodes generated by memalign later cause heap + corruptions when nodes are shrink further (for example, 24 bytes -> 8 + bytes, when alignment is 16 bytes). From Jussi Kivilinna (2017-10-24). + * lm3s8962: NX configuration needs CONFIG_NXSTART_EXTERNINIT=y + (2017-10-24). + * sched/: move POSIX thread specific data from pthread TCB to common + TCB structure. This change allows using + pthread_getspecific/pthread_setspecific from main thread. Patch also + enables using pthread data with config option CONFIG_DISABLE_PTHREAD=y. + From Jussi Kivilinna (2017-10-25). + * net/local: fix typo in config macro name. From Juha Niskanen + (2017-10-25). + * Olimex stm32-h407 serial support for the on-board UEXT connector + (fixed style & defconfig). Add USART6 for UEXT connector. Add + nsh_uext configuration and README update. From Jan Pobříslo (2017-10-26). + * configs/nucleo-l496zg/nsh: enable I2C4 bus with i2ctool. From Jussi + Kivilinna (2017-10-26). + * arch/arm/stm32f7: i2c: restore bus frequency after I2C reset. Copy + frequency restoration fix from STM32L4 I2C driver to STM32F7 I2C + driver. From Jussi Kivilinna (2017-10-26). + * arch/stm32l4: port STM32F7 I2C driver to STM32L4. STM32L4 I2C driver + is in work-in-progress state (plentiful of TODOs and #warnings) and lags + many features found in more up-to-date STM32 I2C drivers. The peripheral + on STM32F7 and STM32L4 are identical except for L4's 'wakeup from stop + mode' flag and STM32F7's I2C driver is in more 'ready to use' state. + + Commit ports the STM32F7 I2C driver to STM32L4. The I2C clock + configuration is kept the same as before (I2CCLK = PCLK1 80 Mhz) + instead of switching to STM32F7 arch default that is I2CCLK=HSI. + Further work would be to add configuration option for choosing I2C + clock source instead of current hard-coded default. From Jussi + Kivilinna (2017-10-26). + * drivers/sensors/lis2dh: fixes for self-test. From Jussi Kivilinna + (2017-10-26). + * include/nuttx/fs/: Move prototype of foreach_mountpoint out of + include/nuttx/fs/fs.h to fs/mount/mount.h (2017-10-26). + * fs/mount: Implements procfs /proc/fs/blocks and /proc/fs/usage files, + replacing the NSH df command. Also implements procfs /proc/fs/mount + file, replacing the NSH mount command when there are no arguments + (2017-10-26). + * Correct a problem that was causing an apparent directory to be + reported as a file instead of a directory by opendir. This happened + after adding these three new procfs entries: fs/block, fs/mount, and + fs/usage. Of course, there is no directory fs in this case, only three + files that have fs/ in their relative pathnames. The logic was + detecting that fs was the name of the enty to report, but it was then + declaring that fs was a file (because fs/block is of type file). This + was fixed by adding a check for matching lenghts. i.e., if strlen(fs) + != strlen(fs/block), then report fs as a directory instead of a file + (2017-10-26). + * fs/procfs: Missing some conditional logic for cases where mountpoint + procfd entries excluded (2017-10-27). + * drivers/can/mcp2515.c: Fix the MCP2515 Bit Rate Prescale + calculation. Fix BRP for SET_BITTIMING ioctl as well. From Alan + Carvalho de Assis (2017-10-27). + * sensors/lis2dh: Fix use of obsolete dbg macro. From Jussi Kivilinna + (2017-10-27). + * nucleo-f334r8: Add highpri example configuration. From Mateusz + Szafoni (2017-10-28). + * STM32 F33xx: Add ADC DMA support to STM32F33 configuration. From + Mateusz Szafoni (2017-10-28). + * drivers/net: Remove the old, unfinished Crystal LAN driver. I don't + even have the hardware that it goes with anymore (2017-10-28). + * configs/mx1ads: This commit removes board support for the mx1ads + board. That board support was never completed and I no longer even have + the hardware. The unfinished board support is still available in the + Obsoleted repository if anyone would ever like to resurrect it + (2017-10-28). + * STM32 ADC: Added support for ADC's IO_ENABLE_TEMPER_VOLT_CH ioctl on + STM32F10XX and STM32F20XX. From Dmitriy Linikov (2017-10-30). + * STM32 F2: Fixed build for STM32F20XX platforms when + CONFIG_STM32_DMACAPABLE is enabled. From Dmitriy Linikov (2017-10-30). + * fs/userfs: This completes coding of the UserFS client and of the + UserFS feature in general. This feature is being merged to main now + because I believe it is innocuous. It is, however, untesed. The next + step will be to develop a test case to verify the feature. Uses Unix + domain local sockets instead of message queues. Easier to transfer big + data in local sockets than message queues (2017-10-30). + * Fix DEBUGASSERT() issues with nxhello on lc823450-xgevk + - sched/task: Remove DEBUGASSERT in task_exitstatus() and + task_groupexit() + - graphics: Change DEBUGASSERT condition in nx_runinstance() + From Masayuki Ishikawa (2017-10-31). + * Fix GPIO operation of STMPE811 driver. + 1. STMPE811_GPIO_DIR was defined for register name and later was + redefined to be the pin direction mask for `stmpe811_gpioconfig`. I + decided to change register name to be STMPE811_GPIO_DIR_REG, and keep + pin direction mask STMPE811_GPIO_DIR, so that any external code that + already use this driver will be unchanged. + 2. The STMPE811 register GPIO_DIR uses bit value 1 for output and 0 + for input, but `stmpe811_gpioconfig` set the opposite. + 3. The call to `stmpe811_gpiowrite` from inside of + `stmpe811_gpioconfig` leaded to deadlock. + From Dmitriy Linikov (2017-10-31). + * sim/userfs: Add a configuration for testing the UserFS using + apps/examples/userfs (2017-10-31). + * Fixes a memory leak that is caused because the client message queue is + not unlinked after the client disconnects from the NX server. From + Masayuki Ishikawa (2017-10-31). + * drivers/wireless/ieee80211: Fix typos and spelling errors as needed + for Photon build. From Anthony Merlino (2017-11-01). + * net/icmpv6: Add some header file necessary for correct build. From + Anthony Merlinoo (2017-11-01). + * libc/userfs: Correct return value from dispatchers. Should return + zero on success, not the number of bytes sent (2017-11-01). + * net/ipforward: Fixes typo that caused build error when IP forwarding + was enabled with CONFIG_NET_ICMPv6_NEIGHBOR enabled as well. From + Anthony Merlino (2017-11-01). + * ieee802154: Simplifies notify() and rxframe() calls to a single + notify() call. dataind's and all other "notifs" are now "primitives" + which aligns with standard terminology From Anthony Merlino (2017-11-01). + * fs/userfs: Correct check for response type (2017-11-01). + * net/local: This commit modifies the Unix domain local socket design. + Local sockets are built on top of pipes. The Local socket + implementation maintained file descriptors to interrupt with the pipes. + File descriptors have the bad property that they are valid only while + running on the thread within the task that created the local socket. + + As a policy, all internal OS implementations must use "detached" files + which are valid in any context and do not depend on the validity of a + file descriptor at any point in time. This commit converts the usage + of file descriptors to detached files throughout the local socket + implementation (2017-11-02). + * fs/userfs: There are some deadlock issues that make the UserFS + un-usable at the current time. Added to the TODO list; also feature is + now marked EXPERIMENTAL (2017-11-02). + * drivers/serial/serial.c: Optimize wait time in tcdram() for buffer + emptying. According to the specification, the close function must wait + until all data has been written before it closes the file (except + O_NONBLOCK is set). The maximum waiting time for this is not specified. + + To be able to edit the file list of the process, the close function + has to lock the file list semaphore. After that the close function of + the serial driver is called. + + Waiting for the complete transmission of all data is done in the + serial driver. This causes the semaphore to remain locked until all + data has been sent. However, no other thread of the process can edit + the file list for that time (open, close, dup2, etc.). This is not + optimal in a multithreaded environment. Therefore, we have to keep + the waiting time within the driver as short as possible. From Frank + Benkert (2017-11-02). + * drivers/loop: Don't use file descriptors... Use the internal file + system interfaces so that the loop device can be shared across threads + (2017-11-02). + * drivers/mtd/filemtd.c: Don't use file descriptors... Use the internal + file system interfaces so that the loop device can be shared across + threads (2017-11-02). + * mac802154: Fixes a warning for unused variable and returns -1 from + macnet_notify() if event is not used. From Anthony Merlino (2017-11-03). + * drivers/lcd/max7219.c: Add support to MAX7219 LED Matrix as LCD + interface. From Alan Carvalho de Assis (2017-11-04). + * configs/stm32f103-minimum: Add board support for MAX7219 LED Matrix + controller. From Alan Carvalho de Assis (2017-11-04). + * stm32f334-disco, nucleo-f334r8: add missing ram_vectors configuration + in linker script. From Mateusz Szafoni (2017-11-04). + * Kconfigs: Add CONFIG_LCD_UPDATE that works like CONFIG_NX_UPDATE but + can be enabled without enabling the graphics subsystem (2017-11-04). + * SAMv71-XULT: Remove non-functional framebuffer configuration + (2017-11-05). + * stm32f103-minimum: Remove warning when selecting MMCSD support, Add + board_usbmsc_initialize to stm32f103-minimum. From Alan Carvalho de + Assis (2017-11-05). + * nucleo-f334r8/highpri: missing ADC trigger configuration. From + Mateusz Szafoni (2017-11-05). + * stm32f334-Disco: beginning of lower-half driver for SMPS (buck-boost + onboard converter). From Mateusz Szafoni + * Misc. STM32 Fixes: + - STM32 HRTIM: add helper macros + - STM32F33xxx ADC: injected channels support, fix some definitions, + add interface to disable interrupts + From Mateusz Szafoni (2017-11-05). + * fs/userfs: This commit converts the underlying IPC used by the + UserFS from Unix domain local sockets to UDP LocalHost loopback + sockets. The problem with the local sockets is that they do require + operations on the top level pseudo-file system inode tree. That tree + must be locked during certain traversals such as enumerate mountpoints + or enumerating directory entries. + + This conversion is unfortunate in the sense that Unix local domain + sockets are relatively lightweight. LocalHost UDP sockets are much + heavier weight since they rely on the full UDP stack. If anyone is + up for a complete redesign, then using some shared memory and a POSIX + message queue would be lightweight again. + + This commit also fixes several bugs that were not testable before the + inode tree deadlock. I cannot say that the logic is 100% stable but + it does not have basic functionality (2017-11-05). + * fs/userfs: Fix return value from dup method. In order to return a + pointer, the parameter must be a pointer to a pointer (2017-11-06). + * configs/stm32f429i-disco/ltdc: This configuration has been deleted + because it violated the portable POSIX OS interface. It used + apps/examples/ltdc and include ltdc.h and dma2d.h which were also + removed for the same reason (2017-11-06). + * arch/arm/include/stm32 and stm32f7: Remove ltdc.h and dma2d.h. + Those header files in that location permitted inclusion into + application space logic and, hence, facilitated and encouraged calling + into the OS and violating the portable POSIX OS interface. The + definitions in those header files were move the appropriate location in + the counterpart, architecture specific files at arch/arm/src/stm32 and + stm32f7 dma2d.h and ltdc.h (2017-11-06). + * lpc43xx Ethernet: Fix some backward logic setting full-duplex and + 100mbps when autoconfiguration is disabled. Noted by Anonymous in + Issue #76 (2017-11-06). + * sched/sched/sched_cpuselect.c: For SMP, In order to find the cpu + with the lowest priority thread, we have to remember the already found + lowest priority. Noted by Anonymous in Issue #75 (2017-11-06). + * Add IPL2 support for LC823450 + - arch/arm/src/lc823450: Add IPL2 support + - configs/lc823450-xgevk: Add IPL2 support + From Masayuki Ishikawa (2017-11-07). + * drivers/audio: Add WM8774 support. From Masayuki Ishikawa + (2017-11-08). + * lc823450-xgevk audio support + - arch/arm/src/lc823450: Add IPL2 support + - configs/lc823450-xgevk: Add IPL2 support + - libc/audio: Fix compilation error in lib_buffer.c + - arch/arm/src/lc823450: Add I2S support + - configs/lc823450-xgevk: Add WM8774 support + From Masayuki Ishikawa (2017-11-08). + * drivers/usbdev/rndis.c: fix packet receiving logic. The logic didn't + take single-byte termination frames in account. From Sakari Kapanen + (2017-11-08). + * net/icmpv6/icmpv6_radvertise.c: Add option to manually specify router + prefix. From Sakari Kapanen (2017-11-08). + * net/icmpv6/icmpv6_radvertise.c: set the prefix length to + preconfigured value (2017-11-08). + * STM32 L4 RCC: restore backup-registers after backup-domain reset. + From Jussi Kivilinna (2017-11-08). + * STM32 L4: Build stm32l4_idle.c only if CONFIG_ARCH_IDLE_CUSTOM is + not enabled. From Jussi Kivilinna (2017-11-08). + * drivers/power/bq2429x.c: Add BATIO_OPRTN_SYSON for enabling BATFET + after SYSOFF. From Jussi Kivilinna (2017-11-08). + * lc823450 auto LED support + - arch/arm/src/lc823450: Add auto LED for CPU activity + - configs/lc823450-xgevk: Add auto LED support + From Masayuki Ishikawa (2017-11-09). + * tools/configure.sh: This commit adds a -m option for macOS. For + anyone not aware, Apple renamed OSX to macOS recently; thus the 'm' + instead of 'o'. This does not change the other uses of *_OSX to macOS. + From jeditekunum (2017-11-09). + * tools/configure.c: Update functionality to match last change to + tools/configure.sh (2017-11-10). + * STM32L4 serial PM interface improvements: Check rx/tx buffers for + pending data in pmprepare. Remove adhoc PM interfaces and move serial + suspend functionality behind CONFIG_PM. From Jussi Kivilinna + (2017-11-10). + * procfs: Fix uptime being clse to maximum 32-bit value in certain + config. From Juha Niskanen (2017-11-10). + * libc: Add support for readv() and write(). Also includes some + cosmetic changes to some unrelated files (2017-11-11). + * libc/signal: Add support for sigwait() (2017-11-11). + * sched/signal/sig_nanosleep.c and libc/time/lib_nanosleep.c: + Implement clock_nanosleep(). nanosleep() is now reduced to a libc + wrapper around clock_nanosleep() (2017-11-11). + * Changes from review of clock_nanosleep(): Misplaced right bracket, + but return value in one failure case (2017-11-11). + * include/netinet/tcp.h: Add trivial standard tcp.h header file + (2017-11-12). + * Trivial re-ordering of socket option bit numbers to match order + presented on OpenGroup.org (2017-11-12). + * arch/arm/src/stm32/stm32f33xx_adc.c: Eliminate warnings about + cj_channels and j_chanlist being set but not used (2017-11-12). + * configs/stm32l476-mdk: Add support for the on-board LEDs (2017-11-12). + * include/netinet/tcp.h: Add trivial standard tcp.h header file + (2017-11-12). + * configs/stm32l476-mdk: Repartition bring-up logic so that it is more + like other board directories. Add support for USERLED driver. Add + bring-up initialization logic for the USERLED driver (2017-11-12). + * drivers/usbdev/rndis.c: Fix some issues in rndis.c Introduce + rndis_transmit() and change rndis_rxdispatch() to avoid packet + corruption. Introduce max packet size for dual speed whichis mainly + used for high speed mode. Fix adjusting MTU warning on Linux host. Fix + data corruption if a packet size excceds MTU. NOTE: Max packet size is + not configured dynamically. This should be fixed in the future + version. Change HPWORK to ETHWORK. NOTE: In the commit 07b98ccbb5, + max packet size of bulkout was assumed to be 64. In this commit, + priv->epbulkout->maxpacket is used instead. From Masayuki Ishikawa + (2017-11-13). + * configs/stm32f4discovery: RNDIS support on STM32F4Discovery + - Add RNDIS configuration. NOTE: STM32F4Discovery + DM-STF4BB + - Add stm32_netinit.c to avoid a compilation error + - Add RNDIS initialization in stm32_bringup.c + NOTE: MAC address for the host side starts 0xaa. This assignment + scheme should be fixed later. From Masayuki Ishikawa (2017-11-13). + * configs/: apps/system/free has been deleted because it violates the + portable POSIX OS interface. Remove CONFIG_SYSTEM_FREE=y from all + defconfig files (2017-11-13). + * fs/procfs/fs_procfsprogrem: Add /proc/progmem. This is an + alternative way to get the information that was previoulsy available in + apps/system/free. apps/system/free was removed beause it made illegal + calls into the OS violating the portable interface. This new procfs + entry provides the same information with no such violation (2017-11-13). + * Nucleo-F746ZG: Use the serial console over /dev/ttyACM0 by default. + The Nucleo-F746ZG doesn't come with Arduio RS-232 shield, then it is + better to use the serial over the /dev/ttyACM0 that is created + automatically when the board is plugged in the computer. From Alan + Carvalho de Assis (2017-11-13). + * SAMA5/SAMv7: It is necessary to disable pre-emption and interrupts + around a loop that copies TX data into the hardware in order to avoid a + TX data underrun condition. From Anthony Merlino (2017-11-13). + * fs/profcs: Add file to show user space heap. This replaces the NSH + free command (2017-11-13). + * fs/procfs: Optimization of previous commits. /proc/umm and + proc/progmem are deleted. /proc/kmm is renamed /proc/meminfo and + contains the output that was in all three files previously (2017-11-13). + * configs/stm32f439i-disco: Add an fb configuration (2017-11-13). + * configs/stm32f429i-disco/fb: Fix a compile issue. Disable all NX + features in the fb configuration. NX is not needed (2017-11-13). + * configs/stm32f429i-disco/fb: Refactor initialization logic so that + it is a little more like other boards. Remove double initialization of + framebuffer or LCD drivers (whichever is enabled) (2017-11-13). + * configs/stm32f429i-disco: Add logic to auto-mount procfs. Enable + procfs in all configurations that use NSH (2017-11-13). + * configs/stm32f429-disco/fb: Enable support for the STMPE811 + touchscreen controller and also for the apps/exmaples/touchscreen test + (2017-11-14). + * Remove CONFIG_GRAN_SINGLE. It adds no technical benefit (other than + some minor reduction in the number of interface arguments) but adds a + lot of code complexity. Better without it (2017-11-14). + * mm/mm_gran: Add a function to get information about the state of the + granuale allocator (2017-11-14). + * fs/procfs: Add logic to show the state of the page allocator in + /proc/meminfo (2017-11-14). + * mm/mm_gran: Fix some issues found during test of the new gran_info() + interface (2017-11-14). + * configs/stm32429i-disco/src: Fix a compile error when + CONFIG_BOARD_INITIALIZE is defined (2017-11-14). + * configs/lc823450-xgevk: Fix compilation errors on Cygwin. From + Masayuki Ishikawa (2017-11-15). + * mm/mm_gran: Combine some common logic into a function (also fixes a + subtle bug) (2017-11-15). + * Build system: Fix CONFIG_BUILD_KERNEL logic directories that have + ubin and kbin subdirectories. Conditional logic was fine for + CONFIG_BUILD_FLAT and CONFIG_BUILD_PROTECTED but generated useless + dependencies if CONFIG_BUILD_KERNEL (2017-11-15). + * arch/arm/src/lpc43: Add LPC43xx CAN driver. From Alexander Vasiljev + (2017-11-15). + * arch/arm/src/lpc43: UART_RX pins should be configured with input + buffers enabled. Otherwise it cannot be read. From Alexander Vasiljev + (2017-11-15). + * STM32F429i-Disco: Convert NxWM configuration to use LTDC framebuffer + driver instead of SPI serial. Also reduce number of layers from 4 to 1 + in fb configuration. Only one layer is used (2017-11-15). + * configs/stm32f429i-disco/ide: Remove the uVision IDE setup that goes + along with the ltdc configuration that was removed on 2017-10-28 + (2017-11-16). + * configs/stm3220g-eval/ide: Remove the uVision IDE setup. This has + not been used for years and it a maintenance problem for me (2017-11-16). + * arch/arm/src/xmc4: Fix XMC4xxx USIC UART sginal to be high level when + in idle. From Alan Carvalho de Assis (2017-11-16). + * arch/arm/src/xmc4: Kconfig was not selecting XMC4_USIC for USIC1. + From Alan Carvalho de Assis (2017-11-16). + * configs/xmc4500-relax: Add config for UART3 on RXD P0.0 and TXD P0.1 + pins. From Alan Carvalho de Assis (2017-11-16). + * STM32 F72xx and F73xx: Add register definition header files and + clocking logic. From Bob Feretich (2017-11-17). + * STM32F7: Fix typos in two RCC register definition header files. + From Bob Feretich (2017-11-17). + * STM32F7: Completes architecture support for the STM32 F72x and F73x + families. Adds support for the Nucleo-144 boards with STM32F722. From + Bob Feretich (2017-11-18). + * configs/sim: Disable NX graphics support in the fb configuration. + * libnx: Changes to allow the font subsystem to be built without + enabling the entire graphics system (CONFIG_NX). Adds CONFIG_NXFONTS + and CONFIG_NXGLIB. NX and NXFONTS are still pretty heavily entangled. + Needed to duplicate some Kconfig setting for NXFONTs if it can be + configured and built independently of NX. Also includes some + build-related fixes (2017-11-18). + * configs/mcb1700: Add support for Keil MCB1700 board. From Alan + Carvalho de Assis (2017-11-18). + * configs/open1788/pdcurses: Add a configuration for testing pdcurses + (2017-11-19). + * C library: Fix sscanf character conversion (%c): do not add '\0' at + the end as for strings, cause, for example, parsing one character will + fill two bytes: character itself and zero one '\0' after it, so will + overflow one byte variable argument and corrupt memory for variables + allocated after it. From Oleg Evseev (2017-11-19). + * arch/arm/src/xmc4:xmc4_uart_configure() expects the channel# not + uartbase as an input parameter. From Alan Carvalho de Assis + (2017-11-20). + * configs/open1788: Add support for the discrete joystick driver. + Update the pdcurses configuration to use apps/examples/djoystick + (2017-11-20). + * net/icmpv6: icmpv6_input() needs to set d_len to 0 after consuming + echo reply, otherwise, garbage will get sent out. From Anthony Merlino + (2017-11-20). + * configs/open1788: Enable discrete joystick input. This is + sufficient to get through all menuing that does not require text input + (2017-11-20). + * net/sixlowpan: Fix an endian-ness problem in 6LoWPAN address + decompression. From Anthony Merlino (2017-11-20). + * net/sixlowpan: The logic that extracts interface identifier from the + IP address needs to be generalized to handle cases where the address is + not a link local address. From Anthony Merlino (2017-11-20). + * arch/arm/src/xmc4 UART: Enable RX/TX status and small fixes. From + Alan Carvalho de Assis (2017-11-21). + * Various fixes for errors ound while debugging OTG on L496 + - STM32, STM32 L4, and STM32 M4: USB OTGFS DMA trace output fix + - STM32: Add dump buffer feature to stm32 F4 series + - STM32 and STM32 L4: Fix bad USB OTGFS register address + - STM32 L4: Fix typo in USB OTGFS register usage + - STM32 L4: Add check in USB OTGFS driver to assure that SYSCFG is + enabled + - Nucleo-L496ZG: Make HSE on Nucleo-L496ZG default to enable USB + From Miha Vrhovnik (2017-11-21). + * Two changes for STM32F7. + 1) The first enables building with CONFIG_ARCH_IDLE_CUSTOM enabled. + 2) The second allows changing voltage output scaling setting and + prevents enabling over-drive mode for low frequencies (STM32 F74xx, + 75xx, 76xx, 77xx) + From Jussi Kivilinna (2017-11-21). + * Replicate Jussi Kivilinna's change for the newly added STM32F2xx and + F3xx family members. This change allows selecting voltage output scale + mode and enable over-drive only when needed (2017-11-21). + * mm: Add a debug assertion to check for integer overflow in malloc + (2017-11-21). + * net/icmpv6: Fix an error in the poll logic. It was assume that the + input parmeter pvconn was valid. It was not. Instead, the poll logic + must work like the sendto() and recvfrom() logic: It must keep a copy + of the conn structure in the private data (2017-11-21). + * net/icmpv6: Remove the 'list' field from struct icmpv6_conn_s. It + is not used (2017-11-21). + * net/icmp: Ports the changes in ICMPv6 of commits + 4629cf9461e5ac6f5f01ef8c9bee3ec9a60ce081 and + 74a633ea94bc308cd2eca0ec6c2be798d5794e72 to ICMP. ICMP and ICMPv6 + sockets are nearly identical, bug-for-bug (2017-11-21). + * net/sixlowpan: Add htohs() in arguments to debug statements that + print IP addresses so that they are all shown in friendlier host + order. From Anthony Merlino (2017-11-21). + * stm32f33xxx_rcc: Fix CAN clock enable. From Mateusz Szafoni + (2017-11-22). + * drivers/lcd_framebuffer.c: If BPP is less then 8, then we need to + byte-align the update region (2017-11-22). + * configs/stm32f103-minimum: Add framebuffer driver initialization for + stm32f103-minimum board. From Alan Carvalho de Assis (2017-11-22). + * mm: Fix a typo in a debug assertion (2017-11-22). + * net/icmp and icmpv6: Fix some errors in debug assertions introduced + with last changes in this area. Also updates a REAME.txt file + (2017-11-22). + * net/: Fix some issues with regard to UDP broadcast handling. This + is Bitbucket Issue #77. This commit tentatively closes the issues, + subject to verification (2017-11-22). + * sixlowpan: Support sending to a router that is on-link and may be + able to forward the packet for us if the destination is not reachable + directly. From Anthony Merlino (2017-11-22). + * Pass header-payload offset to application for use when the MAC layer + is in promiscuous mode + - mac802154_device: When in promiscuous mode, the char driver sends + the entire frame, including the MAC header. This change adds an + offset field indicating the header-payload boundary. It is set to 0 + when not in promiscuous mode as the header is not passed to the + application + - mac802154: Adds support for getting promiscuous mode state + From Anthony Merlino (2017-11-22). + * USB RNDIS - Fixes minor build error while using USB RNDIS with USB + debugging information enabled. From Anthony Merlino (2017-11-22). + * clicker2-stm32: Adds support for USB RNDIS device. From Anthony + Merlino (2017-11-22). + * STM32 L4 USB OTGFS: Remove dumpbuffer feature added in the last + commit. I don't want in features that cannot be controlled be via + Kconfig files and I do not accept debug code in the upstream GIT. My + mistake for merging it in the first place (2017-11-22). + * include/nuttx/video/fb.h: Add definition for a Y2 color format. I + don't know if this standard but I do have 2-bit greyscale hardware so + the definition is needed (2017-11-22). + * sixlowpan: Fixes build error introduced by recent PR when routing + table is enabled. From Anthony Merlino (2017-11-22). + * sixlowpan: Fixes build error introduced by recent PR when routing + table is enabled. From Anthony Merlino (2017-11-22). + * net/netdev: Add support for the SIOCGIFBRDADDR ioctl() command + (2017-11-22). + * include/nuttx/audio: Remove CONFIG_SCHED_WORKQUEUE check in pcm.h. + From Masayuki Ishikawa (2017-11-23). + * sched/semaphore/spinlock.c: Disable local interrupts in spin_setbit() + and spin_clrbit() in order to avoid a deadlock condition. From + Masayuki Ishikawa (2017-11-23). + * configs/stm32f4disovery: Add support for JLX12864G display on STM32F4 + Discovery board. From Alan Carvalho de Assis (2017-11-23). + * configs: All NX configuration... Because of recent changes to + libnx/nxfonts, Supported bit per pixel must be separated specified for + NXFONTs too and need to match the select BPP for NX (2017-11-24). + * fs/procfs: Correct ordering of procfs entries. For consistency, use + alphabetical ordering (2017-11-24). + * configs/xmc4500-relax: Setup max. freq. 120MHz and setup pull-up to + UART RXD pin. From Alan Carvalho de Assis (2017-11-24). + * arch/arm/src/xmc4: Do not run at 144MHz unless BOARD_FCPU_144MHZ is + selected in the board.h header file. From Alan Carvalho de Assis + (2017-11-24). + * configs/xtrs: Removed the XTRS configuration This was an unverified + port of NuttX to a TRS-80 simulator. It was removed because (1) it is, + as I said, unverified as well as unsupported, and (2) the TRS-80 + simulation is a sub-optimal platform. That platform includes a 16-bit + ROM image and only a 48Kb RAM space (2017-11-24). + * arch/arm/src/xmc4: Remove hard-coded values in clock configuration. + USB will be fixed later. From Alan Carvalho de Assis (2017-11-25). + * drivers/lcd: Add support for external LCD initialization required by + some board logic. configs/zpa214xpa: Tried to get the LCD working + again unsuccessfully. Too much bit rot I suppose (2017-11-25). + * STM32F4 Discovery: Fix some errors due to missing inclusion of + stm32_gpio.h (2017-11-25). + * XMC4 Serial: The Alternative Receive Interrupt was not being + configured (2017-11-25). + * drivers/lcd: Make LCD driver configuration indepently selected from + NX graphics configuration. This makes things awkward and loses some + error checking but is a necessary step in order to make LCD drivers + usable when the NX graphics system is disabled (2017-11-25). + * STM3240G-EVAL: Mount procfs if enabled (2017-11-25). + * arm/src/xmc4: Include Alt. Interrupt Enable to RX_EVENTS and rename + serial GPIO configurations. From Alan Carvalho de Assis (2017-11-25). + * configs/: CONFIG_QENCODER was renamed to CONFIG_SENSORS_QENCODER: + update occurrences in several Kconfig files (2017-11-25). + * configs/stm3240g-eval: Add support for pdcurses and the pdcurses + demo programs in the 'fb' configuration (2017-11-26). + * arch/arm/src/stm32: Fix compile error when trace is enabled. + I2CEVENT_ERROR was used but never defined (2017-11-26). + * configs/lc823450-xgevk: Enable CONFIG_SMP for audio.Update README.txt + regarding SMP audio. From Masayuki Ishikawa (2017-11-27). + * lc823450 smp audio + - arch/arm/src/lc823450: Remove a workaround in up_cpu_paused(). + Introduce g_gpio_lock to improve write performance in SMP mode. + NOTE: This is a tentative solution and should be replaced with more + generic one. Add a workaround in up_txready() to avoid data + corruption. From Masayuki Ishikawa (2017-11-27). + * arch/arm/src/lpc43xx: lpc43_adc.c was being selected by the build + system wehn DAC was selected (2017-11-27). + * configs/lc823450-xgevk: Add RNDIS configuration. From Masayuki + Ishikawa (2017-11-28). + * drivers/input/nunchuck.c: Add Nintendo Wii Nunchuck driver. From + Alan Carvalho de Assis (2017-11-28). + * configs/stm32f4discovery/include/board.h: Remove only I2C pin config, + we can use PB6 and PB9. From Alan Carvalho de Assis (2017-11-28). + * configs/stm32f4discovery/src: Add stm32f4discovery board support for + Nunchuck joystick. From Alan Carvalho de Assis (2017-11-28). + * net/devif: Do not add link layer header size to d_len inside + devif_forward(). From Anthony Merlino (2017-11-29). + * Framebuffer Driver: Small modification convention for multi-planar + displays (of which there are none) (2017-11-29). + * configs/stm32f103-minimum: Add Nunchuck board support for + stm32f103-minimum board. From Alan Carvalho de Assis (2017-11-29). + * drivers/mtd: Add a driver for Macronix MX35LFxGE4AB serial NAND + flash. From Ekaterina Kovylova (2017-11-29). + * net/pkt: Eliminate a compile error due to missing include and also a + warning (2017-11-29). + * sched/task/task_exithook.c: Clear atexit() function pointer before + calling it. On most archs, up_assert() calls exit() so without this + change, if atexit() function triggers an assertion we are in endless + loop. From Juha Niskanen (2017-11-30). + * arch/arm/src/xmc4/Kconfig: Define user friendly SPI, I2C, LIN, and + I2S aliases to follow other arch names. From Alan Carvalho de Assis + (2017-11-30). + +7.24 2018-03-02 Gregory Nutt + + * drivers/pipes: poll: fix off-by-one error in calculation of bytes in the + buffer. Buffer calculation in pipe poll setup is off-by-one when read + index is larger than write index. This causes poll() not getting POLLIN when + buffer has one byte as calculation gives zero bytes in buffer. From Jussi + Kivilinna (2017-12-07). + * This adds basic architectural support for the LPC546xx family and + includes support for the LPCXpresso-LPC54628 board. The basic NSH port is + almost complete... still lacking GPIO support and LED support. There are + still no significant drivers available. + * SMP: Introduce spin_lock_irqsave() and spin_unlock_irqrestore(). These + APIs are simplified version of enter_critical_section() and + leave_critical_section() to protect data (e.g. registers) in SMP mode. By + using these APIs inside drivers, performance will be improved. From + Masayuki Ishikawa (2017-12-07). + * sixlowpan: Completes configuration options for specifying preloaded + address contexts for compression From Anthony Merlino (2017-12-07). + * configs/photon: Adds BOARD_TIMn_FREQUENCY macros From Anthony Merlino + (2017-12-07). + * arch/arm/src/lc823450 SMP improvements. (1) Apply irq_spin APIs to + modifyregXX, (2) Do not use modifyreg32() to enable Mutex, (3) Modify IRQ + control for i2s. Interrupt will be handled on CPU0 with this change. (4) + Apply irq_spin APIs to dma/syscontrol/usbdev. (5) Assign CPU1 to lpwork. + This change will improve load balancing for networking with RNDIS. From + Masayuki Ishikawa (2017-12-08). + * drivers/audio/wm8776.c: Improve stability in SMP mode. Apply irq_spin + APIs to improve performance. Repeat to process a message to avoid + deadlock. From Masayuki Ishikawa (2017-12-08). + * configs/lc823450-xgevk: Enable SPINLOCK_IRQ and NXPLAYER in RNDIS. From + Masayuki Ishikawa (2017-12-08). + * arch/arm/src/xmc4: Only setup USB clock when USB PLL is enabled From + Alan Carvalho de Assis (2017-12-08). + * arch/arm/src/lpc54628: LPCXpresso-LPC54628 NSH configuration is fully + functional. From Gregory Nutt (2017-12-10). + * arch/arm/src/lpc54xx: Add basic build support for EMC and external + SDRAM. From Gregory Nutt (2017-12-10). + * configs/lpcxpresso-lp54629: Add logic to configure EMC pins. + arch/arm/src/lpc54xx: Update pin configuration for EMC pins. All should + have the input file offset and fast slew rate. From Gregory Nutt + (2017-12-11). + * arch/arm/src/lpc54xx: Add skeleton of SPI driver just as a starting + point. From Gregory Nutt (2017-12-11). + * arch/arm/src/lpc54xx: SDRAM is now fully functional on this board! From + Gregory Nutt (2017-12-12). + * arch/arm/src/lpc54xx: Add the ported LPC1788 LCD driver to use the + LPC54xx pin definitions and SYSCON. From Gregory Nutt (2017-12-12). + * configs/lpcxpresso-lpc54628: Add the fb configuration testing the LCD. + From Gregory Nutt (2017-12-13). + * arch/arm/src/lpc54xx: Fix some LCD clocking. There is now recognizable + albeit corrupted data on the display. From Gregory Nutt (2017-12-13). + * arch/arm/src/lpc43xx: Adapt LPC176x RTC driver for the LPC43xx. From + Gintaras Drukteinis (2017-12-14). + *arch/arm/src/lpc54xx: LCD.. Fix some misconceptions about how the video + address lines are used. Fix some LCD BPP and BRG vs RGB settings. From + Gregory Nutt (2017-12-14). + * fs/fat: CONFIG_FAT_MAXFNAME may not exceed NAME_MAX (CONFIG_NAME_MAX) + From Gregory Nutt (2017-12-15). + * arch/arm/src/lpc54xx: Complete coding of the I2C driver. I2C now appears + to be functional. config/lpcxpresso-lpc54628: Add support for I2C2 and + for the I2C tool to the nsh configuration. From Gregory Nutt (2017-12-15). + * arch/arm/src/stm32f7: Completes support for the STM32F72x/73x family. + From Bob Feretich (2017-12-16). + * arch/arm/src/lpc54xx: Implement GPIO interrupt support. + configs/lpcxpress-lpc54628: Add support for the USER button. Enable the + apps/examples/button test in the NSH configuration. From Gregory Nutt + (2017-12-16). + * arch/arm/src/lpc54xx: Fix some GPIO interrupt configuration errors. Add + logic to acknowledge rising/falling edge events. + config/lpcxpresso-lpc545628: Add an intermediate interrupt handler to + support acknowledgment of rising and falling edge interrupts. From Gregory + Nutt (2017-12-16). + * configs/indium-f7: Adds support for the RAF Research Indium-F7 board. + From Bob Feretich (2017-12-16). + * configs/*/include; Remove prototype of xyz_boardinitialize() from + board.h files. The authoritative prototype is in + arch/arm/src/xyz/xyz_start.h From Gregory Nutt (2017-12-16). + * fs/nfs/nfs_vfsops.c: Correctly infer file type. The file type is in + struct nfs_statinfo_s's ns_type field, not in the ns_mode field. From + Michael Jung (2017-12-17). + * drivers/input/ft5x06.c: Add a driver for the FT5x06 capacitive, + multi-touch, touchscreen controller. configs/lpcxpresso-lpc54628: Add + support for the the FT5x06. Enable the driver as well as the apps/examples + touchscreen test. Untested on initial commit. From Gregory Nutt + (2017-12-17). + * fs/fat: Don't warn about the CONFIG_FAT_MAXFNAME being too large if long + file name support is not implemented. From Gregory Nutt (2017-12-17). + * configs: Still trying to get consistent name. button driver expects + board to define NUM_BUTTONS, not BOARD_NUM_BUTTONS. That was changed in + all board.h header files, but there are still references in configs/ C + files to BOARD_NUM_BUTTONS From Gregory Nutt (2017-12-17). + * Fixed build of PCF8574 driver when its interrupts aren't enabled by + config. From Dmitriy Linikov (2017-12-18). + * net/tcp: Introduce tcp receive window control based on I/O buffer. NOTE: + The algorithm is still experimental but useful for http streaming. From + Masayuki Ishikawa (2017-12-18). + * drivers/input/ft5x06: Fix a misconception.. WAKE is an output, not an + input. From Gregory Nutt (2017-12-18). + * drivers/power/bq2429x.c: Add trickle charging mode From Juha Niskanen + (2017-12-18). + * drivers/ft5x06: Add a polled mode of operation for the FT5x06 in attempt + to work around the fact that the LPCXpresso-LPC54628 chose a non-interrupt + pin for the FT5x06 interrupt. Driver is still not yet functional. From + Gregory Nutt (2017-12-18). + * drivers/ft5x06.c: Add additional configuration options: Optimize if + multi-touch capability is not used. Add options to swap X/Y and + thresholding to reduce the rate of false alarm reports (with no motion). + From Gregory Nutt (2017-12-18). + * configs/lpcxpresso-lpc54628: Add an NxWM configuration. Not yet + functional. From Gregory Nutt (2017-12-18). + * drivers/input/ft5x06.c: Fix a problem was was causing missing reports + when the touch ends. From Gregory Nutt (2017-12-18). + * arch/arm/src/lpc54xx: Bring in LPC43xx SD/MMC driver from + https://github.com/Smoothieware/smoothie-nuttx/tree/master/nuttx/arch/arm/src/lpc43xx + From Gregory Nutt (2017-12-19). + * arch/arm/src/lc823450: lc823450 http streaming improvements: (1) Use + spinlock APIs in lc823450_gpio.c. (2) In SMP mode, H/W interrupts should + be handled on CPU0 to avoid deadlocks. (3) Fix a potential race condition + in up_enable_irq(), (4) Use spinlock APIs instead of critical section APIs, + (5) Enable HRT_TIMER in lc823450_timerisr.c, (6) Call up_enable_irq() to + assign CPU0 for IRQ handling. (7) Use spinlock APIs instead of critical + section APIs. (8) Fix race conditions in dma/usbdev. (9) Enable HRT_TIMER, + LC823450_MTM0_TICK, SPINLOCK_IRQ, (10) Enable NET_TCP_RWND_CONTROL, + NXPLAYER_HTTP_STREAMING_SUPPORT (RNDIS only) From Masayuki Ishikawa + (2017-12-20). + * syslog: Fixes LOG_UPTO macro to include specified log level From Anthony + Merlino (2017-12-20). + * Rename the configs/stm32f0discovery board directory to + configs/stm32f051-discovery. There are others stm32f0discovery boards with + different MCUs and different peripherals on the board. From Alan Carvalho + de Assis (2017-12-20). + * This commit adds support for stm32f072b-disco board. This is the board. I + added the LEDs of this board and tested the compilation, more tests will be + needed. From Alan Carvalho de Assis (2017-12-20). + * drivers/sensors/hts221.c: Fix sensor reset with BOOT bit From Jussi + Kivilinna (2017-12-20). + * arch/arm/src/lpc54xx: Add support for card detect and write protect to + SDMMC driver. configs/lpcxpresso-lpc54628: Add logic to bring up SDMMC. + SDMMC pin configurations should have SLEW on and FILTER off. Add support + for power pin to SDMMC driver. In SDMMC driver, don't do DMA if the entire + transfer will fit in the FIFO. In SDMMC driver, add logic to transfer data + when TXDR or RXDR interrupts occur. Also, add logic to set the RX + watermark to 2 when receiving short, non-DMA data transfers. In SDMMC + driver, fix an error which was clobbering the interrupt mask register + (xfrmask). Also, add a kludge for the missing DTO interrupt. From Gregory + Nutt (2017-12-20). + * arch/arm/src/lc823450: Add SP_DMB() into lc823450_testset.c. In + lc823450, ldrex and strex are not supported. So we implemented up_testset() + with H/W Mutex. However, there was a bug in memory access order. This + change ensures correct memory access order in up_testset() for lc823450. + From Masatoshi.Tateishi (2017-12-21). + * sched/semaphore/spinlock.c: Add memory barrier operations in + spin_unlock(). In ARM document regarding memory barriers, SP_DMB() must be + issued before changing a spinlock state to SP_UNLOCKED. However, we found + that SP_DSB() is also needed to ensure that spin_unlock() works correctly + for network streaming aging test. From Masayuki Ishikawa (2017-12-21). + * arch/arm/src/lpc43xx: Add Windowed Watchdog Timer (WWDT) driver. Tested + on LPC4357 but should be compatible for all LPC43xx MCUs. From Gintaras + Drukteinis (2017-12-21). + * arch/arm/src/lpc54xx: SDMMC fixes.. DMA should not be enabled on non-DMA + transfers, the burst setting in FIFOTH is supposed to match the burst + setting in the BMOD reseters, Add DMA error interrupt support. With these + changes DMA now works on the LPC54xx. From Gregory Nutt (2017-12-21). + * fs/vfs: reopen should return NULL when oflags is less than 0, not equal + to 0. Because negative value is returned on failure of lib_mode2offlags + which converts the mode string into file open mode flag. From Gregory Nutt + (2017-12-21). + * tools/cvsparser.c: Add a check to avoid access past the end of a fixed + size array From Gregory Nutt (2017-12-21). + * arch/arm/src/arm/up_cache.S: Fix cp15_invalidate_dcache. In cases where + more than one dcache line was to be invalidated, a missing branch label + would result in a false branch target into cp15_flush_idcache. Also the + .size macro was fixed for both cp15_invalidate_dcache. From Michael Jung + (2017-12-22). + * Leverage the LPC54xx SD/MMC back to the LPC43xx (where it came from + originally). From Gregory Nutt (2017-12-22). + * arch/arm/src/lpc54xx/43xx: SDMMC driver: Need to disable DMA interrupts + at completion of DMA. From Gregory Nutt (2017-12-22). + * configs/bambino-200e: Add LPC43 SDMMC board support to Bambino-200E and + fix errors/warns From Alan Carvalho de Assis (2017-12-22). + * arch/arm/src/lpc43xx/lpc54xx SDMDC: Don't enable internal DMA in the + control register if not doing internal DMA. Clear pending DMA-related + interrupts before enabling them. From Gregory Nutt (2017-12-22). + * arch/arm/src/lpc43/54 SDMMC: DTO is a wait event, not a transfer event. + Defer enabling DMA transfer interrupts until after command has been sent. + From Gregory Nutt (2017-12-23). + * arch/arm/src/lpc43/lpc54 SDMMC: Add missing test for response errors in + interrupt handler. From Gregory Nutt (2017-12-23). + * arch/arm/src/lpc54xx: Add DMA driver ported from the LPC43xx GPDMA + driver. From Gregory Nutt (2017-12-24). + * arch/arm/src/lpc54xx: Bring in WWDT driver from LPC43. From Gregory + Nutt (2017-12-24). + * arch/arm/src/lpc54xx: Add an RTC driver and a RTC character driver lower + half. configs/lpcxpresso-lpc54628: Add logic to register the RTC + character driver if it is enabled. Enable the RTC and RTC character driver + in the NSH configuration. From Gregory Nutt (2017-12-25). + * arch/arm/src/lpc54xx: Add support for a random number generator. From + Gregory Nutt (2017-12-26). + * arch/arm/src/lpc54xx: Add an Ethernet driver. From Gregory Nutt + (2017-12-26). + * fs/nfs/nfs_vfsops.c: Fix buffer corruption. In case multiple read + requests to the NFS server are required to fill up the user provided + buffer, nfs_read might write behind the end of said buffer. This is fixed + with this change. From Michael Jung (2017-12-28). + * arch/arm/src/lpc54xx: Ethernet drivers ready for testing. + configs/lpcxpresso-lpc54628: Add a netnsh configuration that will be used + to test the Ethernet driver. From Gregory Nutt (2017-12-30). + * arch/arm/src/lpc54xx: Finishes open design issues with AVBTP + multi-channel operation. From Gregory Nutt (2017-12-30). + * net: Fix an error introduced when ICMP and ICMP6 socket support was + added in NuttX-7.3. A gratuitous ARP (or solicitation) was being sent + after receive of the ECHO replay (advertisement). From Gregory Nutt + (2018-01-01). + * arch/arm/src/lpc54xx: Correct handling of the Ethernet RBU error. With + this fix, Ethernet now appears to be fully functional. From Gregory Nutt + (2018-01-01). + * Add FPU to xmc4 ostest. Remove +x from makefiles, preserve .gdbinit + across make clean, add FPU support to ostest on xmc4, add FPU test to + ostest on xmc4 From David Alessio (2018-01-02). + * net/arp: Fix IGMP multicast address computation on Nuttx network stack. + This change fixes the IGMP address computation to allow multicast UDP + messages. The destination address was created with the incorrect bytes of + the given IPv4 address. From Louis Mayencourt (2018-01-02). + * stm32/chip.h: minor fixes for STM32F334 From raiden00pl (2018-01-03). + * net/route: Adding ftruncate() support eliminates an issue in file-based + routing table management system. From Gregory Nutt (2018-01-03). + * fs/userfs: Add truncate() support for userfs, fs/unionfs: Add truncate() + support to the unionfs, fs/tmpfs: Add ftruncate() support to tmpfs, + syscall/: Add system call support for ftruncate(). From Gregory Nutt + (2018-01-03). + * fs/vfs: Add support for truncate() and ftruncate(). The infrastructure + is complete. Now, however, the actual implementation of ftruncate() will + have to be done for each file. From Gregory Nutt (2018-01-04). + * fs/nxffs: Add partial implementation of the truncate method: It + extends files, but cannot yet shrink them. From Gregory Nutt (2018-01-04). + fs/smartfs: Add implementation of the truncate method, fs/fat: Add + implementation of the truncate method. fs/nfs: Add support for the + truncate method to the NFS file system. From Gregory Nutt (2018-01-04). + * net/route: Fix a couple of compile-related issues that have crept in + since the last time the file-based routing table was used. From Gregory + Nutt (2018-01-05). + * configs/sim: Add support for a RAM MTD driver and initialization for use + with SmartFS. From Gregory Nutt (2018-01-05). + * FAT. Effectively handles the situation when a new file position is + within the current sector. Accelerates the work of the FS with a multitude + of operations to write small pieces of data within the current sector. + From Aleksandr Vyhovanec (2018-01-05). + * configs/sim: Add support for testing NXFFS. From Gregory Nutt + (2018-01-06). + * configs/flipnclick-sam3x: Add board support for the Mikroe Flip&Click + SAM3X. From Gregory Nutt (2018-01-06). + * configs/stm32f103-minimum: Add AT24 EEPROM support on STM32F103-Minimum + board From Alan Carvalho de Assis (2018-01-06). + * arch/mips/include/pic32mz: Add architectural support for the PIC32MZEF + family. From Gregory Nutt (2018-01-08). + * configs/flipnclick-pic32mz: Adds board support for the Mikroe Flip&Click + PIC32MZ board. From Gregory Nutt (2018-01-08). + * drivers/net: Add support for telnet character mode From Masayuki + Ishikawa (2018-01-09). + * arch/arm/src/lc823450: Introduce DVFS. This version only supports + manual mode and Vdd1 is fixed to 1.2V. From Masayuki Ishikawa (2018-01-10). + * configs/lc823450-xgevk: Enable DVFS in lc823450_bringup.c. Enable DVFS + in audio and RNDIS. Add telnet character mode to RNDIS. From Masayuki + Ishikawa (2018-01-10). + * arch/arm/src/samdl: In sam_spibus_initialize(), the pinmux configuration + was smashing the previous CTRLA register configuration. There are also some + typos in samd_spi.h From Matt Thompson (2018-01-11). + * SAMDL fix g_spi2ops and g_spi2dev using incorrect values From Matt + Thompson (2018-01-11). + * SAMD External Interrupt Controller (EIC) support From Matt Thompson + (2018-01-11). + * fs/procfs: Fix an error in a common function that manages read data. + From Gregory Nutt (2018-01-12). + * sched/irq: Add a configuration option to show interrupt information via + a procfs file. From Gregory Nutt (2018-01-12). + * arch/arm/src/lpc54xx: The SPI driver is code complete but still + untested. This driver is 'basic' in that in only supports polled mode + operations. From Gregory Nutt (2018-01-14). + * arch/arm/src/stm32/stm32_hrtim: fix deadtime configuration. Add + interface to change outputs SET/RST configuration From Mateusz Szafoni + (2018-01-14). + * drivers/loop/losetup.c: If we want to open read-only in losetup.c, flags + should be O_RDONLY not O_RDWR From Fabio D'Urso (2018-01-14). + * sched/clock/clock_systimer.c: Replace critical section APIs with + spinlock APIs. (64bit only). If SMP=n or SMP=y && SPINLOCK_IRQ=n, this + works in the same way as before. If SMP=y && SPINLOCK_IRQ=y, performance + will be improved. From Masayuki Ishikawa (2018-01-15). + * sched/clock/clock_systimer.c: Change the way that the 64-bit time is + sampled. Previously, we disabled interrupts before sampling the 64-bit + timer since the uint64_t access is not atomic on most CPUs. However, + disabling (local) interrupts does not work in the SMP case. In that case, + the timer interrupt will be running on only one of the CPUs; disabling + interrupts on a different CPU will provide no protection from timer + rollover. To work around this, logic was added that samples 64-bit timer + is sampled twice and if 32-bit rollover was detected between samples, then + loops until there is no rollover. From Gregory Nutt (2018-01-15). + * configs/nucleo-l432kc/src: Fix some bogus logic noted by Fanda. From + Gregory Nutt (2018-01-15). + * fs/smartfs: Fix inverted ifdef for CONFIG_SMARTFS_USE_SECTOR_BUFFER in + smartfs_extendfile() From Jussi Kivilinna (2018-01-16). + * configs/nucleo-* and configs/stm32l476vg-disco: Fix more + stm32_userleds.c bogus logic From Juha Niskanen (2018-01-16). + * Fixes two bugs in multi-block SD-card operations on the STM32F7 + platform. arch/arm/src/stm32f7: DBLOCKSIZE must be the size of SD-card + block, not the total amount of transferred bytes. drivers/mmcsd: respect + SDIO_CAPS_DMABEFOREWRITE on CMD25. From Evgeniy Bobkov (2018-01-16). + * Fixed nucleo-l432kc broken build when CONFIG_USERLED_LOWER defined From + Fanda (2018-01-16). + * Remove the BOARDIOC_TSCTEST_TEARDOWN boardctl() command. Remove all + implementations of board_tsc_teardown() (they were all stubs anyway except + for the simulation). From Gregory Nutt (2018-01-16). + * SMP: Introduce spin_lock_wo_note() and spin_unlock_wo_note(). These APIs + are used in sched_note.c to protect instrumentation data. The difference + between these APIs to exsiting spin_lock() and spin_unlock() is that they + do not perform instrumentation to avoid recursive call when + SCHED_INSTRUMENTATION_SPINLOCKS=y. From Masayuki Ishikawa (2018-01-17). + * configs: Eliminates the BOARDIOC_TSCTEST_SETUP command. Each board now + initializes the touchscreen controller as a normal part of its board + bring-up. board_tsc_setup() is gone; the touchscreen controller is now + treated like any other on-board device. + * configs: Since the touch screen initialization is now called from + one-time board-initialization logic, it no longer needs protection from + re-entry. From Gregory Nutt (2018-01-17). + * configs: CONFIG_MAX_TASKS must be a power of 2. From Gregory Nutt + (2018-01-17). + * configs: There should be either CONFIG_LIB_BOARDCTL=y or + CONFIG_BOARD_INITIALIZE=y (but not both) in the defconfig of every + standalone NxWM configuration to assure that all of the board resources are + initialized... especially the touchscreen since it is now a part of the + board driver initialization. From Gregory Nutt (2018-01-17). + * arch/arm/src/samdl: SPI must be disabled before changing the mode bits in + CTRLA register From Matt Thompson (2018-01-17). + * arch/arm/src/lc823450: Explicitly assign I2S IRQ handling to CPU0. From + Masayuki Ishikawa (2018-01-18). + * drivers/input/ft5x06.c: Remove logic to disable polling when there there + is no client waiting for read data. That was a great idea to save CPU + cycles when there is nothing reading from the touchscrren but, + unfortunately, does not work with readers that open the driver in + non-blocking mode. So I think we just have to eat the CPUs even when there + is nothing waiting for touchscreen input. From Gregory Nutt (2018-01-18). + * configs/lpcxpresso-lpc54628/lvgl: Add LittlevGL graphics demo + configuration. From Gregory Nutt (2018-01-18). + * sched/semaphore: Add DEBUGPANIC() in nxsem_post() if no waiting task is + found. From Masayuki Ishikawa (2018-01-19). + * sched/sched/sched_sporadic.c: fix compiler error when priority + inheritance is enabled. Noted by eunb.song@samsung.com From Gregory Nutt + (2018-01-19). + * sched/sched: Fix some priority inheritance related issues noted during + review of logic. Also add some REVISIT comments for some issues noted in + the design. From Gregory Nutt (2018-01-20). + * Issue #85: /dev/userleds is not working for nucleo-l432kc fixed From + Fanda Vacek (2018-01-20). + * arch/arm/src/stm32/stm32_hritm.c: Add interface to get timer clock + frequency, fix timer freq calculation, add compare/capture registers + significant bits checking. From Mateusz Szafoni (2018-01-21). + * stm32f334-disco: add buck converter and boost converter logic From + Mateusz Szafoni (2018-01-21). + * fs/userfs: use correct req type in userfs_truncate, remove use of + undeclared buf From Juha Niskanen (2018-01-22). + * arch/arm/src/xmc4: Refactor pll setup, refactored PLL/CLK config, easier, + checks for correctness, call go_os_start if STACK_COLORIZED, smarter config + of EXTCLK output freq. From David Alessio (2018-01-22). + * net/: The existence of the network driver ioctl() method should depend on + CONFIG_NETDEV_IOCTL rather than CONFIG_NETDEV_PHY_IOCTL. The former + enables the method, the later enables a subset of possible driver IOCTLs. + This change should be basically a no-operation. The affected ioctl methods + only support those subset of driver IOCTLs selected by + CONFIG_NETDEV_PHY_IOCTL and the network logic will tolerate a nul ioctl + method. From Gregory Nutt (2018-01-22). + * net/tcp: Write buffering logic should not wait for a free buffer if the + socket was opened non-blocking. Also, rename the TCP write buffering + macros from WRB_* to TCPWB_* to make room in the namespace for write + buffering with other protocols. From Gregory Nutt (2018-01-22). + * net/udp: Remove some conditional logic that was true if there is only a + single network device, but not true in the multi-device context. From + Gregory Nutt (2018-01-22). + * net/udp: This commit adds an implementation of UDP write buffering. + From Gregory Nutt (2018-01-22). + * net/udp: In sendto(), return EHOSTUNREACH if the network is down. From + Gregory Nutt (2018-01-22). + * drivers/mtd/at24xx.c: Correct page size for AT24C02 part. From Alexander + Oryshchenko (2018-01-24). + * arch/arm/src/stm32: Make STM32 usable with an external RTC. + * drivers/timers/ds3231.c: Correct some debug statments. From Alexander + Oryshchenko (2018-01-24). + * arch/arm/src/stm32/stm32_spi.c: Removed unnecessary (and incorrect) speed + limitation From Alexander Oryshchenko (2018-01-24). + * arch/arm/src/stm32/stm32f40xxx_i2c.c: Correct some recent changes to + STM32F4 I2C that broke poll mode of operation. From Alexander Oryshchenko + (2018-01-24). + * arch/arm/src/samdl: Added SAMD DAC header file. Fixed SAMD EVSYS header. + Added SAMD TC header file. Fixed some minor typos. Added missing EVCTRL + register bits in TC. From Matt Thompson (2018-01-24). + * configs/flipnclick-sam3x (also Arduio-Due): Remove disabling of + environment, mountpoints, and poll. Add NSH arch initialization so that + procfs will be automounted. Increase task name size from 0 to 32. Update + README. From Gregory Nutt (2018-01-25). + * arch/arm/src/samdl: Added DMAC header for SAMD, fixed up sam_dmac to + compile with debugging enabled From Matt Thompson (2018-01-25). + * arch/arm/src/samv7/sam_lowputc.c: Fix undefined variable when using + USART1 for other purposes than UART (e.g. SPI). From Frank Benkert + (2018-01-26). + * arch/arm/src/stm32 and stm32f7: Remove confusing, redundant, and + misleading definitions of STM32_BKP_BASE from the F2, F3, and F4 memory + maps. Unlike the F1, these parts do not have a separate BKP address + region. The BKP registers are with the RTCC address regions. stm32_bkp.h + should only be used for STM32 F1. stm32_rtcc.h should be used to access BKP + registers on F2, F3, and F4. From Gregory Nutt (2018-01-26). + * stm32/Kconfig: fix COMP7 dependency. stm32_hrtim: add HRTIM push-pull + mode configuration. stm32f334-disco: add buck-boost converter mode From + raiden00pl (2018-01-27). + * arch/arm/src/samdl: Added Analog Comparator headers and basic + initialization From Matt Thompson (2018-01-28). + * arch/arm/src/stm32: I have a SPI bus with both Mode 0 and Mode 3 devices + on it. After performing SPI I/O to a Mode 0 device, switching to a Mode 3 + device locked up the SPI interface. Only zeroes would be read. I traced + the reason for the lock-up to arm/arm/src/stm32f7/stm32_spi.c function + spi_setmode(). Changing the mode causes a spurious SPI clock transmission + that confuses the stm32f7 SPI input hardware. This problem is solved by + (1) changing the SPI mode with SPI (and perhaps DMA) disabled, and (2) + flushing the receive FIFO if the mode change results in garbage in the + FIFO. From Bob Feretich (2018-01-29). + * drivers/sensors: Add support to MAX44009 ambient light sensor From Juha + Niskanen (2018-01-29). + * tools/logparser: Add a tool which (when it matures) will help me to + convert git logs to ChangeLog format. From Gregory Nutt (2018-01-29). + * tools/: Add #define _GNU_SOURCE to all C files that call asprintf() + From Gregory Nutt (2018-01-29). + * arch/arm/src/samdl: Added Timer Compare for Control registers header + From Matt Thompson (2018-01-29). + * sched/sched: Add new internal OS function nxsched_setaffinity() that is + identical to sched_isetaffinity() except that it does not modify the errno + value. All usage of sched_setaffinity() within the OS is replaced with + nxsched_setaffinity(). From Gregory Nutt (2018-01-30). + * sched/sched: Internal functions sched_reprioritize() and + sched_setpriority() no longer modify the errno value. Also renamed to + nxsched_reprioritize() and sched_setpriority(). From Gregory Nutt + (2018-01-30). + * sched/sched: Add new internal OS function nxsched_getscheduler() that is + identical to sched_getscheduler() except that it does not modify the errno + value. All usage of sched_getscheduler() within the OS is replaced with + nxsched_getscheduler(). From Gregory Nutt (2018-01-30). + * sched/sched: Add new internal OS function nxsched_setparam() that is + identical to sched_setparam() except that it does not modify the errno + value. All usage of sched_setparam() within the OS is replaced with + nxsched_setparam(). From Gregory Nutt (2018-01-30). + * sched/sched: Add new internal OS function nxsched_getparam() that is + identical to sched_getparam() except that it does not modify the errno + value (actually, the previous value erroneously neglected to set the errno + value to begin with, but this fixes both issues). All usage of + sched_getparam() within the OS is replaced with nxsched_getparam(). From + Gregory Nutt (2018-01-30). + * sched/: Fix several inappropriate accesses to get_errno() that were + missed in previous changes (some going back to nuttx-.23). Add new + nxsched_setscheduler() and nxsched_getaffinity() which are equivalent to + their counterparts without the nx on front. These versions do not modify + the errno value. Changed all calls within the OS to use these newer + versions of the functions. From Gregory Nutt (2018-01-30). + * binfmt/, configs/, grahics/, libc/, mm/, net/, sched/: OS references to + the errno variable should always use the set_errno(), get_errno() macros. + From Gregory Nutt (2018-01-30). + * arch/arm/src/stm32 and stm32f7: Architecture-specific code is not + permitted to modify the errno variable. drivers/ and libc/: OS references + to the errno variable should always use the set_errno(), get_errno() + macros. From Gregory Nutt (2018-01-30). + * SMP: Introduce a new global IRQ clearing logic and tasklist protection. + The previous implementation of clearing global IRQ in sched_addreadytorun() + and sched_removereadytorun() was done too early. As a result, nxsem_post() + would have a chance to enter the critical section even nxsem_wait() is + still not in blocked state. This patch moves clearing global IRQ controls + from sched_addreadytorun() and sched_removereadytorun() to + sched_resumescheduler() to ensure that nxsem_post() can enter the critical + section correctly. For this change, sched_resumescheduler.c is always + necessary for SMP configuration. In addition, by this change, task_exit() + had to be modified so that it calls sched_resumescheduler() because it + calls sched_removescheduler() inside the function, otherwise it will cause + a deadlock. However, I encountered another DEBUGASSERT() in + sched_cpu_select() during HTTP streaming aging test on lc823450-xgevk. + Actually sched_cpu_select() accesses the g_assignedtasks which might be + changed by another CPU. Similarly, other tasklists might be modified + simultaneously if both CPUs are executing scheduling logic. To avoid this, + I introduced tasklist protetion APIs. With these changes, SMP kernel + stability has been much improved. From Masayuki Ishikawa (2018-01-31). + * arch/arm/src/samdl: Added I2S register definitions. From Matt Thompson + (2018-01-31). + * drivers/sensors/lis2dh: Use realtime clock if monotonic is not + available From Juha Niskanen (2018-01-31). + * fs/aio: Fix one additional place where the errno variable is being + accessed inappropriately. From Gregory Nutt (2018-01-31). + * sched/wdog: wd_start() is an internal OS function and should not set the + errno value. Reviewed and updated every call to wd_start() to verify if + return value is used and if so if the errno value is accessed. From + Gregory Nutt (2018-01-31). + * sched/task: Add nxtask_create(). Kthread_create() and nxtask_create() + are internal OS functions and should not modify the errno variable. + configs/: threads started by board bringup logic should be kernel threads, + not user tasks. From Gregory Nutt (2018-01-31). + * drivers/: threads started by drivers should be kernel threads, not user + tasks. Review return values for all calls to kthread_start() because it no + longer returns an errno. From Gregory Nutt (2018-01-31). + * graphics/: Review return values for all calls to kthread_start() because + it no longer returns an errno. From Gregory Nutt (2018-01-31). + * sched/: Convert legitimate uses of task_create() to nxtask_create(). + Review handling of returned values from all uses of kthread_create() (as + well as nxtask_create()). From Gregory Nutt (2018-01-31). + * arm/src/kinetis: Correct some Ethernet PHY register bit tests for the + KSZ8081 PHY. From Stewart (2018-02-01). + * libc/stdio: in dtoa(), up_interrupt_context() is used in a debug + assertion. up_interrupt_context() is not available in the user-mode phase + of the PROTECTED or KERNEL build configurations. In those configurations, + enabling libc floating point support and debug assertions will result in an + undefined reference to up_interrupt_context(). From Gregory Nutt + (2018-02-01). + * binfmt/: Fix one more inappropriate access to the errno variable. From + Gregory Nutt (2018-02-01). + * configs/stm32f103-minimum: Add support to BMP180 on BluePill + (stm32f103-minimum) board. From Alan Carvalho de Assis (2018-02-04). + * armv7-a, armv7-r, armv7-m: Add atomic read-add-write and + read-subtract-write functions. From Gregory Nutt (2018-02-04). + * spin_lock_irqsave() and spin_unlock_irqrestore() are only valid if the + CPU supports global disabling of interrupts. From Gregory Nutt (2018-02-04). + * sched/sched: SMP: Fix this_task() to be an atomic operation. In the + previous implementation, this_task() was defined in sched.h by using just a + macro current_task(this_cpu()). However, I found that this is not atomic + and actually sometimes switching CPU happened in executing the macro when + we tested audio steaming plus executing commands via telnet. This change + resolves this issue by implementing atomic this_task()in sched_thistask.c + which is newly introduced. From Masayuki Ishikawa (2018-02-04). + * configs/stm32f429i-disco: Separate SPI4 from MTD init. I was trying to + attach a non-MTD peripheral to an STM32F429I Discovery Board's SPI4 port + and was hitting compilation problems, since CONFIG_MTD and thus 'struct + mtd_geometry_s' was not defined. This patch separates SPI4 initialization + logic from MTD initialization logic. From Michael Jung (2018-02-05). + * sched/sched: Implements a global scheduler lock capability as part of + SMP support. This allows the scheduler to be locked with no knowledge or + access to the TCB of the currently running task. This is necessary because + accessing the TCB of the currently running task is, itself, a non-atomic + operation. This global scheduler lock capability was add just to support + that atomic access to the TCB. From Gregory Nutt (2018-02-05). + * sched/sched: Extend the last global lock change to work with the + lc823450-xgevk which does not support the atomic fetch add but does support + disabling interprocessor interrupts. Disabling interprocessor interrupts + will also guarantee that the TCB address calculation is atomic. From + Gregory Nutt (2018-02-05). + * sched/irq: Fix a infinite recursion problem that a recent change + introduced into the i.MX6 SMP implementation. From Gregory Nutt + (2018-02-06). + * arch/arm/src/armv7-a: Found some additional places were the new + this_task() function cannot be called in the i.MX6 SMP configuration. From + Gregory Nutt (2018-02-06). + * sched/ and arch/arm/src/armv7-a: Replace a few more occurrences of + this_task() with current_task(cpu) in an effort to get the i.MX6 working in + SMP mode again. It does not yet work, sadly. From Gregory Nutt + (2018-02-06). + * sched/task: It is not appropriate for logic in task_exit() to call the + new version of this_task(). sched/irq: Remove redundant fetch of CPU + index; configs/sabre-6quad: update README. From Gregory Nutt (2018-02-06). + * arch/arm/src/lpc17xx: Disable LPC17 FDR when not used. If a boot loader + set the fractional divider (FDR) the baud rate in nuttx will be wrong + (multiplied by this fraction). So if it is not used, it should be + disabled. From hg42 (2018-02-08). + * arch/mips/src/mips32: In up_idle, the kludge that was conditionally + enabled if the work queue was enable appears to be needed even when he work + queue is not enabled on the PIC32MZ. + * arch/mips/src/pic32mz: Fix some typos in debug instrumentation in + pic32mz-gpio.c; fix some typos related to UART5 configuration in + pic32mz-serial.c. + * configs/flipnclick-pic32mz/nsh: Switch serial console to UART3. There + is some problem with the UART4 RX pin documentation or configuration. From + Gregory Nutt (2018-02-09). + * arch/arm/src/xmc4/: Fix USIC_BRG_SCLKCFG definition From Alan Carvalho + de Assis (2018-02-09). + * drivers/lcd: Add configuration support for HiletGo OLED. + configs/flipnclick-pic32mz: Add board support for HiletGo OLED. From + Gregory Nutt (2018-02-10). + * configs/flipnclick-pic32mz: Add an nxlines configuration for use in + testing the custom HiletGo Click board. From Gregory Nutt (2018-02-10). + * arch/arm/src/samdl: Added FDPLL clock support. Fixed sequence of OSC32K + calibration setup. From Matt Thompson (2018-02-10). + * arch/arm/src/samdl: Fix EIC interrupt edge sensitivity for pin numbers > + 8 From Matt Thompson (2018-02-10). + * arch/arm/src/samdl: Added loading factory USB calibration data from + NVRAM From Matt Thompson (2018-02-11). + * arch/arm/src/stm32/stm32_hritm: Add interface to set timer frequency, + fix slave timers reset configuration, change POWER_INFO to TIMER_INFO From + Mateusz Szafoni (2018-02-11). + * configs/stm32f103-minimum: Add zerocross support to STM32F103-Minimum + board From Alan Carvalho de Assis (2018-02-11). + * configs/flipnclick-sam3x: Adds basic board support for the HiletGo + OLED. From Gregory Nutt (2018-02-11). + * arch/arm/src/lpc17xx: DisableDisable LPC17 FDR when not used (second + fix). If a boot loader sets the fractional divider (FDR) the baud rate + in nuttx will be wrong (multiplied by this fraction). This also has to + be added to lpc17_lowputc.c. From Harald Gutsche (2018-02-11). + * arch/arm/src/samdl: Fix DMA controller support. From Matt Thompson + (2018-02-11). + * arch/arm/src/samdl: Added experimental DMA support to SPI driver. + spi_exchange() uses a pair of DMA channels for TX and RX. From Matt + Thompson (2018-02-11). + * configs/stm32f103-minimum: Add OLED SSD1306 support to + STM332F103-Minimum From Alan Carvalho de Assis (2018-02-11). + * drivers/lcd: Fix the default I2C address of SSD1306 OLED display (7- vs + 8-bit addressing) From Alan Carvalho de Assis (2018-02-11). + * net/tcp: Fixed bad return value handling in psock_tcp_send(). send() + expects psock_tcp_send() to return a negated errno value, not -1 with the + errno set (GN: I added same change for tcp_send_buffered.c which has the + same issue as tcp_send_unbuffered.c) From Pelle Windestam (2018-02-13). + * arm/arm/src/stm32: Corrections to STM32 F4 I2C to restore + functionality. From Alexander Oryshchenko (2018-02-13). + * arm/arm/src/stm32: Corrections to STM32 F4 I2C to fix the NORESTART + flag. From Alexander Oryshchenko (2018-02-13). + * drivers/sensors: Added support for LIS3DH accelerometer sensor. From + Matt Thompson (2018-02-13). + * drivers/eeprom: EEPROM driver for AT24xx compatible EEPROMs. From + Sebastien Lorquet (2018-02-14). + * configs/stm32f103-minimum: Add board support to MAX6675 Thermocouple + sensor From Alan Carvalho de Assis (2018-02-14). + * sched/signal: Remove SMP related logic in sig_dispatch.c. This change + prevents from a deadlock in up_schedulesigaction.c where inter-CPU signal + handling is actually implemented. arch/arm/src/armv7-m: Fix signal + handling for SMP. In previous implementation, signal handling for SMP was + incorrect. Thus, for example, if an inter-CPU signal happened an incorrect + tcb was signaled and caused ASSERT(). This change fixes the issues and + works for both inter-CPU signal handling and signal handling on the same + CPU. From Masayuki Ishikawa (2018-02-14). + * arch/arm/src/armv7-a: Port the SMP change by Masayuki Ishikawa to the + ARMv7-A family. From Gregory Nutt (2018-02-14). + * arch/xtensa/common: Port the SMP change by Masayuki Ishikawa to the + Xtensa family. From Gregory Nutt (2018-02-14). + * configs/stm32f103-minimum: Remove CONFIG_NX_LCDDRIVER dependence from + stm32_ssd1306.c From Alan Carvalho de Assis (2018-02-14). + * drivers//sensors: LIS3DH: Fix missing shift when writing output data + rate to register From Matt Thompson (2018-02-14). + * sched/clock: Replace critical section APIs with spin lock APIs in + clock_gettime.c. This change will improve performance for SMP systems but + nothing changes for non-SMP systems. In SMP mode, rtrtcb is not always at + the g_readytorun.head. This change removes DEBUGASSERT() to avoid this + condition. From Masayuki Ishikawa (2018-02-15). + * drivers/lcd: lcd_framebuffer.c does not need to include board-specific + board.h. From Gregory Nutt (2018-02-15). + * include/lcd: Eliminate a warning from an SSD1306 header file by adding a + forward reference to struct i2c_master_s. From Sebastien Lorquet + (2018-02-15). + * lcd/ft80x: This commit adds an FTDI/BridgeTek FT80x driver. It is + untested (I don't even have hardware yet and, hence, it is marked as + EXPERIMENTAL (2018-02-16). + * arch/arm/src/stm32/stm32f33xxx_rcc.c: A flash wait state configuration. + Flash latency must be fixed according to sysclk frequency. If this + operation is not done or done after PLL configuration, the STM32 fail to + continue boot operation if the frequency if greater than 24MHz according to + the board variable STM32_SYSCLK_FREQUENCY. Tested on stm32f334-disco + board. From Gwenhael Goavec-Merou (2018-02-17). + * configs/stm32f746g-disco: Add stm32f746g-disco Ethernet configuration. + Add USART1 support (connected to the USB virtual serial port) From Louis + Mayencourt (2018-02-19). + * drivers/mtd: mtd_config.c: Add still more error handling (to detect bad + underlying flash implementations). Remove MTD_ERASE that was erasing data + block instead of erase block. This is a partial revert of 4f18b4. + Reported-by: Pascal Speck + * arch/arm/src/stm32l4: stm32l4_flash: change flash programming to use + page buffer for unaligned writes. From Juha Niskanen (2018-02-19). + * arch/arm/src/stm32: stm32_flash.c: add progmem support for STM32L15XX + From Juha Niskanen (2018-02-20). + * Added ECANCELED condition to DEBUGASSERT-s checking sem_wait result From + Dmitriy Linikov (2018-02-20). + * net/tcp: Fixes hardfault when network goes done and network monitoring + is in place. From Gianpaolo Ferroni Ariani (2018-02-22). + * arch/arm/src/sam34: Fix a typo resulting in duplicate names in DMAC bit + definitions. From Gregory Nutt (2018-02-22). + * net/tcp: tcp_send_[un]buffered.c: Check routing table in + psock_send_addrchck(). Previously only ARP table was considered when + determining if the data will actually be sent. From Juho Grundstrom + (2018-02-22). + * net/tcp: Generalize Juho Grundstrom's IPv4 change for IPv6 as well. + From Gregory Nutt (2018-02-22). + * arch/arm/src/lc823450: Fix up_enable_irq() timing for I2S. In previous + commit, I2S IRQ might be sometimes assigned to CPU1 when CONFIG_SMP=y. + This change fixes this issue. Refactor timer driver. Introduce + lc823450_timer.h and move lc823450_timerisr.c to lc823450_timer.c Add MTM + timer APIs for DVFS. Introduce up_rtc_gettime() for CONFIG_RTC_HIRES. + Introduce idle time calculation in DVFS. Also, DVFS autonomous mode based + on CPU idle time is supported. NOTE: voltage control is still disabled. + From Masayuki Ishikawa (2018-02-23). + * configs/lc823450-xgevk: Update defconfigs. Enable RTC_HIRES instead of + RTC_DATETIME (audio/rndis). Disable TCP_WRITE_BUFFERS and change + SCHED_LPWORKPRIORITY (RNDIS). Update SMP and DVFS related part. From + Masayuki Ishikawa (2018-02-23). + * net/icmpv6/icmpv6: Eliminate warnings by correct the type uses to link + structure into lists. From SP (2018-02-23). + * configs/viewtool-stm32f107: Add support for FT80X initialization. Add + ft80x configuration that will eventually be used for testing the ft80x if I + ever receive hardware. From Gregory Nutt (2018-02-24). + * Fixed parsing of DNS response packets having compressed names ending with + pointer. There were troubles parsing response packets which have + compression of QNAME/NAME field when only trailing part of the name (not + the whole name) is replaced with pointer to another part of the packet. + This commit fixes parsing of such packets. Also I added checks to keep + parsing only in bounds of the read part of DNS response packet. From + Dmitriy Linikov (2018-02-26). + * arch/arm/src/stm32f7: Backport RTC alarm setting changes from STM32L4. + Most notably this fixes RTC getting stuck issue when both alarms were used. + Root cause was writing RTC ISR register contents to RTC CR register. From + Juha Niskanen (2018-02-27). + * stm32_hrtim: add repetition support and fix enum overflow From Mateusz + Szafoni (2018-02-27). + * drivers/i2c and drivers/spi: Fix compile if + CONFIG_DISABLE_PSEUDOFS_OPERATIONS, fix bad NULL checks From Juha Niskanen + (2018-03-01). + +7.25 2018-06-03 Gregory Nutt + + * arch/arm/src/stm32/stm32f33xxx_adc.c: Fix bug in RCC reset logic that + resets ADC1 configuration when both ADC1 and ADC2 are in use From Mateusz + Szafoni (2018-03-02). + * drivers/wireless/cc1101.c: Driver improvements from from lihaichen + (2018-03-03). + * Remove all usage of printf() from the OS. That is not an acceptable + context for the use of an application-oriented interface that depends on a + task-specific file descriptor and C buffered I/O. From Gregory Nutt + (2018-03-03). + * stm32_hrtim: fix capture_get function, add software capture trigger, add + software reset trigger, add outputs polarization configuration From + raiden00pl (2018-03-04). + * Per OpenGroup.org, syslog -- and, hence, nonstandard vsyslog, and debug + wrappers -- does not return a value. Rename _vsyslog to nx_vsyslog. Use + internal nx_vsyslog in the few cases where a return value is required. + From Gregory Nutt (2018-03-04). + * arch/srm/src/stm32f7: Add CONFIG_RTC_PERIODIC support. Also makes the + RTC lowerhalf more like in STM32L4. From Juha Niskanen (2018-03-05). + * drivers/i2c: Add support for the pca9540bdp i2cmultiplexer. From Giorgio + Groß (2018-03-05). + * arch/arm/src/stm32: Add support for the STM32F401xB and STM32F401xC + families. From Gregory Nutt (2018-03-05). + * drivers/power: Add pm_unregister From Juha Niskanen (2018-03-06). + * arch/srm/src/stm32f7: add PM hooks to ADC, I2C and SPI. From Juha + Niskanen (2018-03-06). + * Makefile.unix: Eliminate the spurious errors reported by 'make + savedefconfig' From Gregory Nutt (2018-03-07). + * drivers/net/phy_notify.c: Use phy debug macros instead of net debug + macros. ninfo() and nerr() are used a bit too much, so the console output + is difficult to read with network debug. From Sebastien Lorquet + (2018-03-09). + * drivers/lcd/ft80x: ACTIVE host command appears to be formatted + differently than other host commands; Fix ROM CHIPID. Appears to be + big-ending, BCD. Fix some compile issues when debug features are + enabled. From Gregory Nutt (2018-03-09). + * drivers/lcd/ft80x: Fix a typo that caused the driver to fail to recognize + the ft801 chip version. From Gregory Nutt (2018-03-11). + * drivrs/leds: Userled driver was using LCD debug output instead of LED + debug output. From Sebastien Lorquet (2018-03-11). + * net/tcp: Add support for TCP Keepalive, add SO_KEEPALIVE socket option. + Adds socket options needed to manage TCP-keepalive and TCP state machine + logic to detect if that the remote peer is alive. From Gregory Nutt + (2018-03-12). + * arch/arm/src/stm32/usb: skip recipient check for descriptor related + requests From Simon Piriou (2018-03-12). + * net/tcp: In tcp_input(), add the logic to detect, decode, and respond to + TCP Keep-Alive packets. In tcp_timer(), fix some problems with the way + that TCP Keep-Alive probes were being formatted. From Gregory Nutt + (2018-03-12). + * stm32f103-minimum: add support for DFU bootloader From Simon Piriou + (2018-03-12). + * arch/arm/src/stm32/lowputc: Fix uart glitch when lowputc is enabled.. + From Simon Piriou (2018-03-12). + * libc/time: Add an implementation of clock() From Gregory Nutt + (2018-03-13). + * drivers/sensors: Add support for Sensirion SHT2x humidity sensor From + Juha Niskanen (2018-03-13). + * drivers/serial/Kconfig: Kconfig is too big, divide into Kconfig, + Kconfig-uart, Kconfig-usart, Kconfig-sci, Kconfig-16550. More than one + MCU supports LPUARTs. Add Kconfig-lpuart and remove MCU-specific LPUART + definitions. Affects Kinetis and STM32L4. From Gregory Nutt (2018-03-14). + * libc/lzf: Add Marc Alexander Lehmann's LIBLZF3.6 library From Boris + Astardzhiev (2018-03-14). + * configs/stm32f4discover/posix_spawn: With recent changes, needs to enable + boardctl() w/symbol table support. From Gregory Nutt (2018-03-16). + * fs/craomfs: Add CROMFS file system. CROMFS is a commpressed, in-memory + read-only file system based on LZF. From Gregory Nutt (2018-03-19). + * sched/sched: Fix a deadlock in SMP mode. Two months ago, I introduced + sched_tasklist_lock() and sched_tasklist_unlock() to protect tasklists in + SMP mode. This change works well for HTTP audio streaming aging test with + lc823450-xgevk. However, I found a deadlock in the scheduler when I tried + similar aging tests with DVFS autonomous mode where CPU clock speed + changed based on cpu load. In this case, call sequences were as follows. + To avoid this deadlock, I added sched_tasklist_unlock() when calling + up_cpu_pause() and sched_addreadytorun(). Also, added + sched_tasklist_lock() after the call. Also added critical sections to + lib_filesem.c, mm_sem.c, and net_lock.c for SMP for SMP. From Masayuki + Ishikawa (2018-03-20). + * arch/arm/src/stm32l4: Port 1wire driver from stm32. From Juha Niskanen + (2018-03-20). + * mm/iob/iob_copyin.c: Fixed problem with send() ret value when using + nonblocking io over buffered tcp socket From Dmitriy Linikov (2018-03-20). + * tools/gencromfs.c: Adds tools/gencromfs.c, a tool that can be used to + generate CROMFS file system images. From Gregory Nutt (2018-03-20). + * |arch/arm/src/stm32l4: Add PM hooks to I2C, SPI and 1-wire From Juha + Niskanen (2018-03-21). + * drivrs/sensors/lis2dh: Clear INT1 at SNIOC_WRITE_INT1THRESHOLD ioctl + From Jussi Kivilinna (2018-03-21). + * drivers/sensors/sht21: Change I2C_TRANSFER return value so that it return + on zero on success, not the count of bytes transferred. From Juha + Niskanen (2018-03-22). + * i2c/i2c_master.h: Change incorrect comment about I2C_TRANSFER return + value to indicate that the method returns zero on success rather than the + number of bytes transferred. From Juha Niskanen (2018-03-22). + * configs/: Remove configurations using canutils/libuavcan and + examples/uavcan. libuavcan has not built for a year or so. The basic + problem is that as NuttX advances, the old frozen version of libuavcan has + become absolute because it violates the portable POSIX OS interface. No + one is maintaining the port so there is no alternative but to remove it. + From Gregory Nutt (2018-03-23). + * STM32, STM32L4: Add one bit read and write to 1-wire interface. This is + needed for devices that require single bit timeslot generation and for + 1-Wire search algorithm triplets. From Juha Niskanen (2018-03-23). + * arch/arm/src/imx6: Bring in a few i.MX6 fixes that were committed on the + i.MX RT branch. From Gregory Nutt (2018-03-23). + * configs/: Add definition of strip to many Make.defs files. From Gregory + Nutt (2018-03-25). + * arch/arm/src/nrf52: Initial support for the NRF52 include UART and GPIO + support. From Janne Rosberg (2018-03-26). + * Per Matias Edlund: I recently used the tcflush function and found that it + failed with ENOTTY. The reason is that the TCFLSH case in the function + uart_ioctl in the file drivers/serial/serial.c does not update the ret + value." On success, the TCFLSH IOCTL logic needs to explicitly set the + return value (ret) to zero. From Gregory Nutt (2018-03-26). + * netdb: Fix boundary conditions in dns_recv_response(). Fix typos in + include/nuttx/net/dns.h From Masayuki Ishikawa (2018-03-27). + * configs/nrf52-pca10040: Add support for the NRF52-PCA10040 board + including LEDs and buttons From Janne Rosberg (2018-03-27). + * arch/arm/src/stm32: In case of PHY failure, usually because of the lack + of 25/50 MHz REFCLK input, the Ethernet block would lock up in a while + loop waiting for readiness, which will never happened. This prevented the + board from starting at all in the case of a PHY failure. This commit adds + a retry loop to avoid bricking the board if the Ethernet block is unable + to start. From Sebastien Lorquet (2018-03-27). + * mac802154: Adds basic support for RX-ENABLE.request primitive From + Anthony Merlino (2018-03-28). + * mac802154: Adds ackreq flag to TX descriptor for use by radio driver. The + radio layer is responsible for a full "transaction". Because of + differences in radio capabilities, the radio must be responsible for the + handling of acks and retransmissions. This commit simply passes the ackreq + meta-data flag along to the radio. Also Fixes bug where primitive was + freed when it shouldn't have been, causing double free call. From Anthony + Merlino (2018-03-28). + * wireless/bluetooth: Bring in the Bluetooth stack from the Intel/Zephyr + arduino101_firmware_source-v1.tar package. + * drivers/bluetooth: Adds re-architected version of the Bluetooth UART + driver from the Intel/Zephyr arduino101_firmware_source-v1.tar package. + From Gregory Nutt (2018-03-29). + * wireless/bluetooth and include/nutt/net: Add support for Bluetooth IOCTL + commands. From Gregory Nutt (2018-03-30). + * net/bluetooth: Adds basic support for AF_BLUETOOTH sockets. From Gregory + Nutt (2018-03-31). + * arch/arm/src/tiva: Fix compilation errors on Tiva ADC code when ADC is + enable. From Vinicius Maciel (2018-04-01). + * drivers/wireless/bluetooth: Add a NULL device to support some very low + level testing on the Simulator. From Gregory Nutt (2018-04-03). + * configs/sim: Add a configuration that will support some limited testing + of the Bluetooth stack. From Gregory Nutt (2018-04-03). + * Change all Sony related copyright to conform with our company's internal + rules. From Masayuki Ishikawa (2018-04-04). + * drivers/wireless/cc3000: Eliminate support for the CC3000 wireless part + because it doesn't use the USRSOCKET. From Alan Carvalho de Assis + (2018-04-04). + * configs/spark: Removes Spark board configuration. Still available in the + Obsoleted repository. If there is no CC3000 support, then there is no + purpose in supporting the Spark either. From Gregory Nutt (2018-04-04). + * drivers/1wire: Add 1-wire subsystem and ds28e17 driver From Juha + Niskanen (2018-04-04). + * stm32/Kconfig: Add ADC injected channels configuration; stm32f334-disco: + Add buck/boost converter example configuration From Mateusz Szafoni + (2018-04-04). + * drivers/mtd/w25.c: Fix w25_cacheflush sector bug. From lihaichen + (2018-04-04). + * arch/arm/src/stm32 and stm32l4: In 1wire driver, do not write useless + WRITEBIT zero return value to const buffer From Juha Niskanen (2018-04-04). + * drivers/sensors: Add LSM330 SPI and ADXL372 drivers along with the + cluster driver infrastructure. From Bob Feratich (2018-04-07). + * drivers/power/motor.c: Add generic upper-half motor driver From Mateusz + Szafoni (2018-04-09). + * drivers/sensors/max31855: Add multiple max31855 sensors feature and + support for bambino-200e and stm32f4discovery From Tiago Almeida + (2018-04-09). + * arch/arm/include/tiva and configs/cc3200-launchpad: Remove all support + for the CC3200 and CC3200-Launchpad. This was a port that was started but + never completed. What good is partial CC3200-Launchpad board support with + no wireless support? From Gregory Nutt (2018-04-09). + * drivers/sensors/apds9960.c: Fix APDS9960 work queue BUG found by Kyle + Lei From Alan Carvalho de Assis (2018-04-10). + * tools/uncrustify.cfg: An initial cut at an uncrustify C formatting + script. From Gregory Nutt (2018-04-11) Updated, corrected, and verified. + From Bob Feretich (2018-04-11). + * tools/nxstyle.c;: Add check for blank lines before and after single line + comments. From Bob Feretich (2018-04-11). + * arch/arm/src/: Problem: stm32f30xx hangs waiting for LSE to initialize. + Reason for hang is that operation of setting LSE_ON does not take effect + because there is no clock on PWR peripheral. this is initialized later in + the code From Michał Łyszczek (2018-04-11). + * arch/arm/src/imxrt: Brings in basic support for the i.MX RT 1050 + 'crossover' SoC. Includes timer and UART support. This port was the + joint effort of Janne Rosberg, Ivan Ucherdzhiev, and myself. I give + credit to Ivan for the kill because he is the one to held on to the end. + From Ivan Ucherdzhiev (2018-04-12). + * sched/sched: Change ordering of round-robin time slice check + (sched_process_scheduler()) and processing of wdog timers (wd_timer()). + wd_timer()'s callback function can change current running task and, hence, + must be done after the time slice check. The time slice check will + decrement the currently running task's time slice allotment. If such a + context switch occurs, then the newly started task will lost one could of + that allotment before it even has a chance to run. From EunBong Song + (2018-04-13). + * arch/arm/src/stm32: Adds a Bluetooth HCI UART lower half driver for the + STM32. From Gregory Nutt (2018-04-13). + * configs/imxrt1050-evk: This commit adds support for booting from the on + board HYPER Flash. From Ivan Ucherdzhiev (2018-04-13). + * configs/stm32fdiscovery: Add support in bringup logic to initialize the + HCI UART and register the HCI UART network device. From Gregory Nutt + (2018-04-13). + * fs/smartfs: Fix a hardfault in SmartFS. Problem occurred when opening a + file with O_CREAT (only) when the file arelready exists but has a size of + zero. From Michał Łyszczek (2018-04-14). + * arch/arm/src/xmc4: Add SPI support for Infineon XMC45xx microcontroller + From Alan Carvalho de Assis (2018-04-14). + * fs/mount: Fix wrong size reported by df -h. Reason is that size in bytes + is calculated always on uint32_t types and cards bigger than 4GB will + overflow uint32_t type. Solution is to use uint64_t where possible. From + Michał Łyszczek (2018-04-14). + * tools/mkromfsimg.sh: Include an option in mkromfsimg.sh to ignore + FAT/RAMDISK. This permits you to build tiny systems with ROMFS but with + the rather large FAT FS support. From Alan Carvalho de Assis (2018-04-14). + * arch/arm/src/imxrt: Corrects error in serial interrupts and baud setup. + Now the basic IMXRT1050-EVK port is ready. The console is working. From + Ivan Ucherdzhiev (2018-04-17). + * arch/arm/src/imxrt: Add power management hooks From Gregory Nutt + (2018-04-17). + * net/sixlowpan: Fix a nasty, byte-ordering/endian-ness problem. The root + cause has been found and corrected. And a half dozen or so bandaid fixes + were reverted. From Gregory Nutt (2018-04-17). + * arch/arm/include/tms570, arm/src/armv7-r, and arm/src/tms570: Adds + support for the TMS570LS3137ZWT and corrects several ARMv7-R and TMS570 + issues From Gregory Nutt (2018-04-18). + * configs/tms570ls31x-usb-kit: Adds support for the TI Hercules TMS570LS31x + USB Kit From Ivan Ucherdzhiev (2018-04-18). + * drivers/ieee802154/xbee: Adds a timeout to send logic to handle case + where XBee module fails to respond to a Transmit request with a Transmit + Status From Anthony Merlino (2018-04-19). + * arch/arm/src/tiva: Allow building of Tiva platform with no serial + console. From Dmitry Sharihin (2018-04-19). + * drivers/net: Add TAP (network bridge) mode to tun.c. In previous + implementation, TAP mode did not handle a packet correctly. Also, the + driver did not set the link layer type and could not assign the interface + name. This change fixes such issues and supports TAP mode correctly. From + Masayuki Ishikawa (2018-04-20). + * arch/arm/src/nrf52: Add watchdog timer drivers. Includes significant + updates from Alan Carvalho de Assis From Levin Li + (2018-04-20). + * configs/nrf52-pca10040: Add support for starting the watchdog timer on + the nRF52. From Alan Carvalho de Assis (2018-04-20). + * net/tcp: Extended support for sending to non-blocking tcp sockets. From + Pelle Windestam (2018-04-20). + * configs/nrf52-pca10040: Add a configuration for testing the watchdog + timer. From Alan Carvalho de Assis (2018-04-20). + * arch/arm/src/nrf52: nrf52_wdt_initialize() should return a success/fail + indication. From Gregory Nutt (2018-04-20). + * arch/arm/src/stm32: Enable DMA for SPI on stm32f30xxx MCUs. From Michał + Łyszczek (2018-04-20). + * configs/imxrt1050-evk: Add logic to support user LED From Jake Choy + (2018-04-20). + * fs/vfs: Fix negative errno set in fs_open.c From Michał Łyszczek + (2018-04-20). + * /arch/arm/src/lpc17xx: Fix USB device endpoint allocation bookkeeping. + From Michael Jung (2018-04-21). + * configs/stm32f4discovery: Add MAX7219 support to STM32F4Discovery board + From Alan Carvalho de Assis (2018-04-21). + * configs: Review all implementations of board_lcd_initialize(). The NuttX + convention is that all internal functions that return errors as an 'int' + must return a negated errno value on failure and a non-negative value on + success. Most were right but eight of them had cloned logic that returns + 1 on success and zero on failure... both of which are interpreted as + success by the caller since they are non-negative. From Gregory Nutt + (2018-04-21). + * Makefile: Add support for nconfig frontend for 'make nconfig' From Michał + Łyszczek (2018-04-22). + * arch/arm/sc/lpc17xx: Freeing endpoints should be set the same allocations + as when endpoint was allocated. From Gregory Nutt (2018-04-23). + * configs/imxrt1050-evk: Add procfs auto-mount support in imxrt_bringup.c. + From Ivan Ucherdzhiev (2018-04-24). + * drivers/1wire: Add PM hooks and unlink support to sht21 sensor (allowing + hot-swappable I2C bus from 1-wire converter). Unlike most other unlink + implementations in NuttX drivers, this one does not allow any I2C + operations after unlink, making it possible to deallocate the I2C bus. + From Juha Niskanen (2018-04-24). + * configs/ stm32f746g-disco. Add clang support to stm32f746g-disco board + From Goran Mekić (2018-04-24). + * net/udp: Fix several issues using connected UDP sockets: sendto() should + not accept an address. Normally send() should be used with connect UDP + sockets instead. recvfrom() is no longer necessary. recvfrom() and + poll() should not reset to accept any addresses but should, instead, only + accept inputs and events from the connected remote peer. On of these + issues was noted by 李桂丁 . Changes were made as + summarized here: + http://www.masterraghu.com/subjects/np/introduction/unix_network_programming_v1.3/ch08lev1sec11.html + From Gregory Nutt (2018-04-25). + * include/nuttx/wireless: Add a setbaud() method to the HCI UART lower half + interface that can be used to change the default BAUD selection. + arch/arm/src/stm32: Implement the setbaud() method for the STM32 HCI + UART. From Gregory Nutt (2018-04-25). + * arch/arm/src/imxrt: Minor repartitioning to account for the fact that the + GPIO5 base address is not contiguous with the GPIO1-4 base addresses. + From Gregory Nutt (2018-04-25). + * arch/arm/src/imxrt/chip: Add some missing definitions for GPIO5 From + Gregory Nutt (2018-04-25). + * fs/vfs: Added support for checking if a descriptor is a socket in + fstat(). From Pelle Windestam (2018-04-26). + * drivers/wiresless/ieee80211: Correct some initialization problems with + BCM43362 chip. Adds BCM43428 support. arch/arm/src: Add support for SDIO + card to SDIO driver. From hhuysqt (2018-04-26). + * arch/arm/src/imxrt: Add LIBCXX test configuration for IMXRT. From + Gregory Nutt (2018-04-26). + * configs/photon: Configurations the use the SDIO card interface must + support CONFIG_STM32_SDIO_CARD. From Gregory Nutt (2018-04-26). + * arch/or1k/src and configs/or1k. Adds basic architectural support for the + OpenRISK mor1kx architecture. The initial commit was verified on a Qemu + simulation but is otherwise untested. From Matt Thompson (2018-04-26). + * configs/stm32f429i-disco: Add a LittlevGL configuration for + stm32f429i-disco From seyyah (2018-04-26). + * net/udp: Correct an error introduce in recent fixes for UDP connected + sockets. The interaction between psock_udp_send() and psock_udp_sendto() + was perverse: It should always pass a NULL destinatino address. From + Gregory Nutt (2018-04-26). + * Cosmetic changes to README and to comments. From Gregory Nutt + (2018-04-26). + * arch/arm/include/nrf52: All nRF52 IRQs above NRF52_IRQ_TEMP were wrong. + From Alan Carvalho de Assis (2018-04-26). + * net/udp: Fix a backward conditional test added in commit + 434da18cd71ae667c801f41291fbbc205b24320b. From Gregory Nutt (2018-04-27). + * arch/arm/src/imxrt: IMXRT LPUART Clock enable fix. From Ivan Ucherdzhiev + (2018-04-27). + * fs/vfs and net/udp: Repartition logic of commit + 0c963449d6e8f5f8b2dfe96e9de3116633a3749a, moving into net/udp. Add + support to handle connected UDP sockets. The correct 'optimal blksize' to + return is the MSS. The MTU is always too big. From Gregory Nutt + (2018-04-27). + * arch/arm/src/imxrt: Add IOMUX implemention for GPIO5. From Jake + (2018-04-27). + * net/udp: Remove an unused variable warning. Add some comments. From + Gregory Nutt (2018-04-27). + * arch/arm/src/kinetis: USB device fixes: Use correct CONFIG OTG control, + Fix interrupt storm when cable is disconnected. The DM, DP state were + incorrect because the pulldowns were not enabled. Also the pending + asynchronous resume interrupt needed to be re-armed after the suspend is + in effect. This is now done in the isr. From David Sidrane (2018-04-28). + * arch/arm/src/tiva: Add TERMIOS IOCTL support to the Tiva serial driver. + From Dmitry Sharihin (2018-04-28). + * configs/nucleo-l476rg: Add support to Nokia LCD PCD8544 on nucleo-l476rg + From Alan Carvalho de Assis (2018-04-28). + * configs/nucleo-l476rg: Add nxdemo configuration to nucleo-l476rg using + PCD8544 From Alan Carvalho de Assis (2018-04-28). + * Makefile.unix: There is a sort command in the 'make savedefconfig' file. + I found that sort behaves differently on different platforms based on the + environment variable LC_ALL. Now, Makefile.unix will force LC_ALL=C just + for the sort command so that we can all generate equivalent defconfig + files. From Gregory Nutt (2018-04-29). + * arch/arm/src/tiva: Implements an EEPROM driver in compliance with MTD + driver as provided by NUTTX for TM4C1294. The EEPROM driver currently + supports only two functionalities - read bytes(multiple of 4) and write + bytes (multiple of 4). From Shirshak Sengupta (2018-04-29). + * arch/arm/src/tiva: Implemented Flash CONFIG_MTD_BYTE_WRITE for TM4c1294. + Implemented the tiva_write function which will write an arbitrary number + of bytes to flash (in multiple of 4). From Shirshak Sengupta (2018-04-29). + * progmem interface: Discern r/w and erase page sizes. Introduce new + up_progmem_erasesize architecture API to be able to communicate the + read/write page size independently from erase page size. Implement + up_progmem_erasesize for all architectures that already support progmem, + assuming that for those architectures the sizes of both read/write and + erase pages are identical. From Michael Jung (2018-05-01). + * arch/arm/src/include/kinetis and src/kinetis: Add architecture support + for the Kinetis K28F. From Gregory Nutt (2018-05-01). + * arch/arm/src/imxrt: This commit fixes more issues with the i.MX RT GPIO + IRQ. Add check for interrupt mask register before dispatching ISR. The + GPIO_ISR bits are set independent of the GPIO_IMR bits. Fixed a range + check for extint in function imxrt_irqinfo(). From Jake Choy (2018-05-01). + * configs/imxrt1050-evk: This commit adds support for the imxrt button. + From Jake Choy (2018-05-01). + * arch/arm/src/lpc17xx: This commit adds a configurable option to allow + using a part of LPC17xx's internal flash memory as a Memory Technology + Device via NuttX' mtd_progmem infrastructure. Tested with LPC1769. From + Michael Jung (2018-05-01). + * arch/arm/src/imxrt: Add GPIO5 IRQ support. From Jake Choy (2018-05-02). + * configs/freedome-k28f. Adds support for the Kinetis Freedom-K28F board. + From Gregory Nutt (2018-05-02). + * fs/nfs/rpc_clnt.c: Commit 091e3f7 broke the NFS client. sendto() can + (correctly) no longer be used with a connected UDP socket. In that case, + send() must be used instead. From Michael Jung (2018-05-02). + * drivers/rgbled: Adds support for multichannel PWM (multiple PWM channels + on a single timer) From Anthony Merlino (2018-05-02). + * drivers/sensors: Adds support for INA3221 power sensor. This has a 3 + channel bus/shunt voltage pairs. From Anthony Merlino (2018-05-02). + * configs/photon: Adds RGB led support From Anthony Merlino (2018-05-02). + * arch/arm/src/nrf52: Add nRF52 Flash PROGMEM support From Alan Carvalho + de Assis (2018-05-04). + * configs/freedom-k28f: The NSH configuration is now functional on the + freedom-k28f board. Also fixes corrects the active logic level for the + RGB LED. arch/arm/src/kinetis/chip: Fixes an error in vector + configuration. From Gregory Nutt (2018-05-05). + * configs/freedom-k28f: If drivers/leds/rgbled.c is enabled, then treat the + board as though it had no discrete LEDs. From Gregory Nutt (2018-05-05). + * arch/arm/src/lpc17xx: Add support for ARMv7-M run time stack checking on + NXP LPC17xx MCUs based on CONFIG_ARMV7M_STACKCHECK. Basically copied from + stm32. From Michael Jung (2018-05-06). + * arch/arm/src: All ARM and MIPS architectures now support + CONFIG_ARCH_IDLE_CUSTOM From Gregory Nutt (2018-05-07). + * drivers/mtd/mtd_config.c: mtdconfig_register() returned OK instead of + -ENOMEM on failed malloc From Michał Łyszczek (2018-05-08). + * configs/teensy-3.x/usbnsh: Remove CONFIG_USBDEV_DUALSPEED from + configuration. Hardware supports only FS. From Gregory Nutt (2018-05-09). + * libc/unistd: Initial, minimal implementation of sysconf(). Only + sufficient to support the functionality of less standard + getdtabilesize(). From Michael Jung (2018-05-10). + * Documentation/NuttShell.html: Document the mkfatfs the -r option which + can be used to specify the number of entries in the FAT12/FAT16 root + directory. From Gregory Nutt (2018-05-11). + * LibTargets.mk, tools/Config.mk: Drop executable bit on installed + libraries. The rules to install libraries under lib/ were modified to use + mode 0644 instead of the default 0755. From Andrey Zabolotnyi (2018-05-12). + * arch/arm/src/stm32: Add internal pull-up option for SDIO pins (also picks + up an unrelated change to a README.txt file) From Alan Carvalho de Assis + (2018-05-12). + * arch/arm/src/kinetis + SDHC configs: Make Kinetis SDHC pullups work the + same as the STM32 SDIO pullups From Gregory Nutt (2018-05-12). + * net/udp: Resolve race condition in connection-less UDP sockets with + read-ahead buffering. In connection-mode UDP sockets, a remote address is + retained in the UDP connection structure. This determines both there + send() will send the packets and which packets recv() will accept. This + same mechanism is used for connection-less UDP sendto: A temporary remote + address is written into the connection structure to support the sendto() + operation. That address persists until the next recvfrom() when it is + reset to accept any address. When UDP read-ahead buffering is enabled, + however, that means that the old, invalid remote address can be left in + the connection structure for some time. This can cause read-ahead buffer + to fail, dropping UDP packets. Shortening the time between when he remote + address is reset (i.e., immediately after the sendto() completes) is not a + solution, that does not eliminate the race condition; in only makes it + smaller. With this change, a flag was added to the connection structure + to indicate if the UDP socket is in connection mode or if it is + connection-less. This change effects only UDP receive operations: The + remote address in the UDP connection is always ignored if the UDP socket + is not in connection-mode. No for connection-mode sockets, that remote + address behaves as before. But for connection-less sockets, it is only + used by sendto(). From Gregory Nutt (2018-05-13). + * include/sys: Add resource.h From Gregory Nutt (2018-05-13). + * rgbled: Fixes led issues caused by uninitialized memory with + CONFIG_RGBLED_MULTICHAN. The uninitialized pwm_info_s struct caused a + rogue channel to be started causing errors in the pwm driver From Anthony + Merlino (2018-05-14). + * arch/arm/src/imxrt/chip: Add pin multiplexing header files. From Gregory + Nutt (2018-05-14). + * configs/nucleo-l452re: Add buttons example From Juha Niskanen + (2018-05-15). + * arch/arm/src/imxrt/imxrt_serial.c: Fix some interrupt instabilities; must + be in a critical section when modifying serial interrupts. + configs/imxrt1050-evk/nsh/defconfig: Use the BASEPRI register to + enable/disable interrupts; enable the PROCFS file system. From Gregory + Nutt (2018-05-15). + * arch/arm/src/imxrt: Add missing support for the Cortex-M7 caches; + configs/imxrt1050-evk: Enable I- and D-Caches in the nsh configuration. + Calibrate the delay loop. Add support for the on-board LED. From Gregory + Nutt (2018-05-15). + * arch/arm/src/imxrt: Corrects some IOMUX controls. From Jake Choy + (2018-05-15). + * net/sixlowpan: Preserve big-endian (network order) when uncompressing + address. From Anthony Merlino (2018-05-15). + * arch/arm/src/imxrt/chip: Add DMA channel assignments. From Gregory Nutt + (2018-05-15). + * arch/arm/src/stm32f7: Add support for the second SDMMC device. The + second SDMMC device was already supported but the clock was never + enabled. This fixes that. From William Douglas (2018-05-15). + * arch/arm/src/imxrt: Add eDMA support (unverified). From Gregory Nutt + (2018-05-16). + * net/sixlowpan: TCP send should have PSH and ACK flags set when sending. + This matches the standard network (Ethernet) TCP send logic. From Anthony + Merlino (2018-05-17). + * net/udp: Recent changes to UDP in order to correct problems with UDP + connection mode introduced a new bug: The 'to' address passed to sendto() + must now be NULL in connection mode. But there are errors because there + was one place where the 'to' address was still being used. This commit + adds logic to first check for UDP connection mode. If the UDP socket is + connected, then the NULL 'to' address is ignored and saved connection + address is used instead. From Gregory Nutt (2018-05-17). + * arch/arm/src/stm32: Added Vbat measurement to adc driver for STM32F20xx + and STM32F4xxx. As with the MCU temperature and VREFINT measurement, this + change requires user to enable the corresponding channel first. For Vbat + channel the ioctl cmd is IO_ENABLE_DISABLE_VBAT_CH, and its arg should be + a pointer to bool which must be true to enable and false to disable the + Vbat channel. Moreover, since Vbat input contains a built-in voltage + divider, it is highly suggested to disable Vbat input channel after + measurement is done in order to prevent battery drain through the + divider. From Dmitriy Linikov (2018-05-18). + * configs/stm32l1discovery: Add support for the STM32L152RCT6 version. + From Gregory Nutt (2018-05-18). + * configs/stm32f4discovery/audio: Add board configuration for CS43L22 audio + example. From Alan Carvalho de Assis (2018-05-19). + * drivers/lcd and configs/olimex-lpc1766stk: Remove support for the + Nokia6100 LCD. That LCD uses a 9-bit SPI interface (the 9th bit being the + command/data bit that is normally a discrete). That communication was + never successfully integrated. I now believe that it would would require + some special support from the low-level, MCU SPI driver to manage that 9th + bit. The deleted code is still available in the Obsoleted repository in + the nuttx/drivers/lcd, nuttx/configs/olimex-lpc1766stk, and Patches + directories. From Gregory Nutt (2018-05-19). + * arch/arm/src/lpc17xx/lpc17_usbdev.c: Fix loss of RX initiatives. USB + bulk endpoints are double buffered on LPC17xx MCUs. This means that up to + two packets might be received on an OUT endpoint that can not be handled + immediately if the receive request queue is empty. Thus, rxpending must + be a counter not a boolean flag. From Michael Jung (2018-05-20). + * configs/imxrt1050-evk/src: Add support for on-board NOR FLASH boot. From + Ivan Ucherdzhiev (2018-05-21). + * fs/fat: In fs_stat(), when stat'ing the root directory, avoid calculating + the address of the root directory entry. The calculation is bogus (but + not harmful) because the root directory does not have a directory entry. + Noted by Boris Astardzhiev. From Gregory Nutt (2018-05-23). + * fs/fat: Avoid calculating the bogus directory entry address for the FAT + root directory (since it has no directory entry). This change should have + no effect, other than making the logic clearer. From Boris Astardzhiev + (2018-05-24). + * configs/indium-f7: Removes support for the Indium-F7 board. This was + done for two reasons: (1) The board support was just clone of the + Nucleo-144 board support with naming changes. There has been no support + and no further development for the board support. (2) There does not seem + to be any available Indium-F7 board available to the public anywhere on + the internet. There is not even a reference to the board on the + rafresearch.com web stie. Gotta go. Its in the way. From Gregory Nutt + (2018-05-24). + * arch/arm/src/imxrt: Add Ethernet driver. From Jake Choy (2018-05-25). + * arch/arm/src/imxrt: Add cache operations to permit the Ethernet driver to + work with the D-Cache enabled, at least in write-through mode. Add + support for PHY interrupts and PHY IOCTLs. + * configs/imxrt1050-evk/netnsh/defconfig: Disable LED support because pins + conflict with PHY. Enable device statistics. Enable NSH ifup and ifdown + commmands. Add an NSH configuration for testing Ethernet. From Gregory + Nutt (2018-05-25). + * configs/xmc4500-relax: Add board support for SPI From Alan Carvalho de + Assis (2018-05-26). + * configs/olimex-stm32-p407: Add a zmodem test configuration. From Gregory + Nutt (2018-05-26). + * drivers/serial: Add a timeout to uart_tcdrain(). Even if tcflush() is + used to discard buffered data, the close() can still hang if (a) hardware + flow control is enabled, (b) CTS == 1, and (c) there is data stuck in the + hardware Tx FIFO. tcflush() does not currently clear the MCU serial + drivers' hardware Tx FIFOs. This is a workaround for that. From Gregory + Nutt (2018-05-27). + * Build system: Remove fixed lib/ subdirectory and its content. Replace + with new directory called staging/ that is created dynamically when + building and removed when 'make clean' is done. This both improves the + name and eliminates a garbage directory from the repository. From Gregory + Nutt (2018-05-29). + * Build system: Move all build-related files (except the top-level + Makefile) into the tools/ sub-directory. This really cleans up the + top-level directory. From Gregory Nutt (2018-05-29). + * libs/: This commit moves all of the libraries under a common directory + called libs/ (libc, libnx, and libxx). This most certainly break libcxx + for now. From Gregory Nutt (2018-05-29). + * libs/libdsp: Adds DSP support library. From Mateusz Szafoni (2018-05-30). + * arch/arm/src/kinetis: In kinetis_lowputc.c, fix esBRFA calculation + effecting baudrate. Previous BRFA was not cleared and or-ed into new + BRFA, hence, buadrate was wrong. Where Baud Rate Fractional Divisor + (BRFD) UART baud rate = clock / (16 * (SBR + BRFD)) From David Sidrane + (2018-05-30). + * arch/arm/src/kinetis: In kinetis_lowputc.c, fixed parity settings. + Kinetis UART must be placed in 9 bit mode (M=1) with when 8 bit data with + parity is required. If left in 8 bit mode (M=0) with parity then D7 of the + TX/RX register becomes parity bit. Hence what is called 9-bit or 8-bit + Mode Select is a misnomer. 8 bit mode when parity is enabled is realy 7 + bit with parity. From David Sidrane (2018-05-30). + * arch/sim: Various fixes necessary to build the simulator under MSYS2. + From Gregory Nutt (2018-05-31). + * Makefile: The clean_context target needs to invoke a corresponding + clean_context target in the apps/Makefile in order to remove linkages + From Gregory Nutt (2018-05-31). + * configs/stm32f4discovery: Add Load Modules flags to STM32F4Discovery + board From Alan Carvalho de Assis (2018-06-01). + * libs/libc/modlib/modlib_verify.c: Fix backward test for an error. From + Gregory Nutt (2018-06-01). + * Change all references from OSX to macOS From Gregory Nutt (2018-06-01). + * tools/sethost.sh: Add support for macOS From Gregory Nutt (2018-06-01). + * configs/olimex-stm32-p407: Add the module configuration. From Gregory + Nutt (2018-06-01). + * configs/xmc4500-relax/src: Call xmc4_spidev_initialize() in xmc4_boot.c. + From Alan Carvalho de Assis (2018-06-02). + * configs/stm32f4discovery: Add a module configuration for testing the + kernel module example with the STM32F4Discovery board. From Alan Carvalho + de Assis (2018-06-02). + +7.26 2018-09-08 Gregory Nutt + + * tools/kconfig2html.c: Due to new usage, tool needs to be able to + handle configuration files with names other than Kconfig. From + Gregory Nutt (2018-06-03). + * arch/arm/src/stm32: Added progmem interface support for STM32F20XX + From Dmitriy Linikov (2018-06-05). + * arch/arm/src/stm32/chip/stm32_flash.h: Add register definitions for + F1 parts that have dual banked FLASH. From Dmitriy Linikov + (2018-06-05). + * arch/arm/src/stm32: STM32 FLASH logic has reached a limit in + complexity and, hence, needs to be divided into multiple C files of + lower complexity. From Gregory Nutt (2018-06-05). + * configs/lc823450-xgevk: Add loopback test for digital MIC on lc823450 + via i2schar driver. From Masayuki Ishikawa (2018-06-05). + * arch/arm/src/stm32: Implement support for STM32 F1 banked FLASH From + Gregory Nutt (2018-06-05). + * arch/arm/src: Change ASSERT macros to DEBUGASSERT. From Juha + Niskanen (2018-06-06). + * stm32f334-disco/buckboost: Use a PID controller from libdsp From + Mateusz Szafoni (2018-06-06). + * arch/: Make sure the up_irq_enable() is available on all + architectures. From Gregory Nutt (2018-06-06). + * Based on a change recommended by Mark Shulte: + Signal handlers maybe run with interrupts enabled or disabled, + depending on how the task the received the signal was blocked. (i.e.: + If sem_wait() is called, then we disable interrupts, then block the + currently running task). This could be dangerous, because user code + would be running with interrupts disabled. + This change forces interrupts to be enabled in up_sigdeliver() before + executing the signal handler calling up_irq_enable() explicitly. + This is safe because, when we return to normal execution, interrupts + will be restored to their previous state when the signal handler + returns. From Gregory Nutt (2018-06-06). + * arch/arm/src/stm32: Ports stm32 ltdc and stm32 dma2d to use the + framebuffer interface From Marco Krahl (2018-06-06). + * syslog: Enable a partial, crippled version of syslog_flush(); + arch/: Call syslog_flush() from assertion handling logic. From + Gregory Nutt (2018-06-07). + * libs/libc/net: Add inet_aton() From Juha Niskanen (2018-06-08). + * libs/libc/netdb: Add getaddrinfo() and friends. From Juha + Niskanen (2018-06-08). + * configs/imxrt1050-evk: Add knsh configuration.. PROTECTED mode NSH + build. From Gregory Nutt (2018-06-08). + * libs/libc/termios: Add lib_cfmakeraw.c From Masayuki Ishikawa + (2018-06-12). + * drivers/xbee: Fixes issue with timeouts. Timeouts were in ticks but + should have been in ms. This caused false triggers of timeout + causing redundant packets, etc. From Anthony Merlino (2018-06-13). + * arch/arm/src/lc823450: Add lc823450 Bluetooth support. From + Masayuki Ishikawa (2018-06-13). + * stm32f7: serial: Fix ioctl TIOCSSINGLEWIRE + The TRM notes that UE must be disabled in order to write HDSEL in + USART_CR3. This was not being done, so calls to TIOCSSINGLEWIRE were + silently failing. + This change checks the state of UE in USART_CR1, clears the UE bit + before writing HDSEL, then re-enables it if neccesary. From Kurt + Kiefer (2018-06-14). + * drivers/sensors: Add support for Telair T6713 carbon dioxide + sensor. From Juha Niskanen (2018-06-15). + * arch/arm/src/stm32f7: This change ports in Marco Krahl's STM32F4 + framebuffer overlays for the LTDC and DMA2D into the STM32F7. That + driver was same as the STM32F4 driver. From Gregory Nutt (2018-06-15). + * Eliminate use of the non-standard type systime_t and replace it the + equivalent, standard type clock_t From Gregory Nutt (2018-06-16). + * syscall/: clock_systimer() is no longer a system call. It has been + replaced with the equivalent, standard interface clock() as the + system call. + sched/clock: Move the implementation of clock() from libs/libc/time + to sched/clock. This is necessary because it calls the (now) + internal OS function clock_systimer. clock() is now accessed only + via a system call in certain configurations. From Gregory Nutt + (2018-06-16). + * /arch/arm/src/xmc4: Fix XMC4 SPI. It was working only for the first + transfer From Alan Carvalho de Assis (2018-06-16). + * configs/xmc4500-relax: Add support to MAX6675 on XMC4500-Relax + board. drivers/sensors/max6675.c: Increases SPI frequency from + 400Khz to 4MHz. From Alan Carvalho de Assis (2018-06-16). + * This commit brings in a partial STMicro STM32H7. From Simon Laube + (2018-06-16). + * configs/stm32f4discovery: Remove STM32F4BB dependence from RNDIS; add + RAMDISK support. From Alan Carvalho de Assis (2018-06-18). + * arch/arm/src/stm32l4: STM32L4 has fetchadd and testset From Juha + Niskanen (2018-06-18). + * libs/libc/netdb/lib_getaddrinfo.c: The 'port' argument to the static + alloc_ai() function is always in network byte order. However, that + static function was still calling HTONS() on the port, incorrectly + converting it back to host byte order. From Gregory Nutt (2018-06-18). + * arch/arm/src/: This commit removes support for the dedicated vector + handling from the many older architectures. Only common vectors are + now supported. From Gregory Nutt (2018-06-19). + * fs/smartfs: Fixed filesystem corruption when writing to small file + after open(... O_APPEND) From Dmitriy Linikov (2018-06-20). + * arch/arm/src/stm32f7: Port input capture from stm32 From Juha + Niskanen (2018-06-21). + * arch/arm/src/armv7a and imx6: Add support for per-CPU IRQ and FIQ + interrupt stacks (bugfix). Add support so that up_assert will print + the correct interrupt stack on an assertion (FIQ stack is still not + printed). From Gregory Nutt (2018-06-21). + * net/udp: When sending a broadcast (or multicast) packet do not + attempt to look up the device by the destination IP address. Rather, + use the locally bound address for these cases to select the correct + network device. From Gregory Nutt (2018-06-22). + * net/: There are many different checks for IPv6 multicast addresses. + Most of the checks are different. RFC 3513 clearly specifies how to + detect an IPv6 multicast address: they should begin with 0xffxx. I + did not change some of the checks in ipv6_input.c, however. In that + file, the comments indicate that the code should only pick of certain + multicast address that begin withi 0xff02. From Gregory Nutt + (2018-06-23). + * net/: Fix a sixlowpan typo bug recently introduced; Rename + g_ipv6_allzeroaddre with the more meaning g_ipv6_unspecaddr since the + all-zero address is the IPv6 unspecified address (sometime + IN6_ADDR_ANY). Replace more inline tests for IPv6 multicast with + common net_is_addr_mcast() macro. From Gregory Nutt (2018-06-23). + * net/: Rename CONFIG_TCP_REASSEMBLY to CONFIG_IPv4_REASSEMBLY. Add + some fixes to get a clean compile with CONFIG_IPv4_REASSEMBLY + enabled. There are several problems with the current + implementation: It is untested (and depends on + CONFIG_EXPERMIMENTAL). It uses some Ethernet specific definitions + (and depends on CONFIG_NET_ETHERNET). There is only a single + reassembly buffer. The last two issues prevent use of this feature + in any context where IPv4 packets may be reassembled for multiple + network devices concurrently). From Gregory Nutt (2018-06-24). + * net/tcp: Re-think CONFIG_NET_TCP_RWND_CONTROL TCP windowing + controls. From Gregory Nutt (2018-06-24). + * net/udp: Fix a hole in the address lookup logic. From Gregory Nutt + (2018-06-25). + * stm32f7: Fix compile error caused by intentional use of fall through + From Daniel Agar (2018-06-25). + * net/: Add driver interface index support. Add implementation of + if_nametoindex() and if indextoname(). Raw AF_PACKET sockets now + depend on CONFIG_NETDEV_IFINDEX. Add syscall support for + if_nametoindex() and if_indextoname(). + Includes an algorithm to prevent an interface index from being reused + until all network interfaces have by assigned once. The prevents + removable devices from being removed, unregistered and re-installed, + re-registered and keeping the same interface index. From Gregory + Nutt (2018-06-25). + * net/netdev: Fix.. Too many calls to net_unlock() From Gregory Nutt + (2018-06-25). + * net/udp: Add support for the UDP_BINDTODEVICE protocol socket + option From Sebastien Lorquet (2018-06-25). + * configs/stm32f746g-disco: Add support for STM32F746G-disco board + LCD From Marcin Wyrwas (2018-06-25). + * arch/arm/src/stm32f7/chip/stm32f72xx73xx_dma.h: Macros did not + account for the increase from 8 to 16 DMA channels. From Gregory + Nutt (2018-06-26). + * configs/nucleo-l476rg: Add support for an extern SPI-driver SD card + on the Nucleo-L476RG. From Gregory Nutt (2018-06-26). + * fs/mount/fs_automount.c: Ignore return values from work_cancel(). + From Gregory Nutt (2018-06-27). + * arch/arm/src/lc823450: Fix setintstack macro in chip.h. In case of + CONFIG_SMP=y, g_cpu0_instack_base and g_cpu1_instack_base are not + allocated just after g_instack_alloc but these values show the + addresses for interrupt stack of each CPU. So to set the stack + pointer based on these variables, temporal register has to be used. + From Masayuki Ishikawa (2018-06-27). + * arch/arm/src/imxrt: Add support for the i.MXRT RTC. This initial + commit is code complete (with limited features and options) but untested. + The HPRTC is functional. However, if the LPSRTC is enabled, then + there is a hang during LPSRTC initialization. It appears that there + is some problem in providing clocking and initializing the LPSRTC + domain. From Gregory Nutt (2018-06-27). + * tools/testbuild.sh: Add option to specify location of nuttx + directory. From Gregory Nutt (2018-06-27). + * stm32f7: I2C reset Configure I2C pins as GPIO output. Pins were + reset to inputs in the deinit. This resets them to outputs. From + David Sidrane (2018-06-27). + * Commit 0c963449d6e8f5f8b2dfe96e9de3116633a3749a, 'fs/vfs: Added + support for checking if a descriptor is a socket in fstat().', + changed sys/stat.h in way that breaks smartfs file-type stat flags. + CROMFS is similarly broken, as tools/gencromfs.c was not updated to + match the sys/stat.h changes. This commit fixes both issues. It + probably is not a good idea to use NuttX sys/stat.h bit-field values + directly in stored structure of filesystem. From Jussi Kivilinna + (2018-06-28). + * arch/arm/src/imxrt: Add trivial SNVS from Rev 1. of the Reference + Manual. From Gregory Nutt (2018-06-28). + * arch/arm/src/lpc43: Fix lpc43 CAN configuration. Configuration + settings were used and documented in README.txt files, but never in + any Kconfig file. From Gregory Nutt (2018-06-28). + * tools/refresh.sh: Add a --prompt option that will let you use + --silent but will prompt before overwriting the original defconfig. + From Gregory Nutt (2018-06-28). + * Update tools/link.sh per suggestions by Mark so that it can be used + with MSYS vs copydir.sh. From Gregory Nutt (2018-06-29). + * configs/pcblogic-pic32mx, sure-pic32mx, ubw32: Update configurations + so that either the MPLAB or Penguino toolchains may be used. From + Gregory Nutt (2018-06-29). + * net/tcp: Re-work of TCP receive window size algorithm. The new + logic is based only on the ability to buffer TCP read-ahead data. + From Gregory Nutt (2018-07-01). + * arch/arm/src/xmc4/xmc4_gpio.c: Add a specific bit encoding for + opendrain GPIO pin. From Alan Carvalho de Assis (2018-07-02). + * configs/stm32f746g-disco: Add support for STM32F746G-disco board + SDRAM Changed fb config to use SDRAM and fixed compilation From + Marcin Wyrwas (2018-07-02). + * arch/arm/src/lc823450: Add tx start threshold to lc823450_i2s.c In + addition, lc823450_i2s_send() now accepts byte-aligned stream. From + Masayuki Ishikawa (2018-07-03). + * drivers/usbhost/usbhost_max3421e.c: Add support for the Maxim M3421E + USB host driver. From Gregory Nutt (2018-07-03). + * net/udp: Restore some legacy behavior that was lost with the + implementation of CONFIG_NET_UDP_BINDTODEVICE: If no device has a + local address when the broadcast packet is sent and the UDP socket is + not bound to a device, there select some arbitrary device. This is + certainly lunacy in the case where there are multiple network devices + registered because the wrong device will probably be returned. It + works find, however, for the legacy case where only a single network + device is registered. From Gregory Nutt (2018-07-04). + * arch/arm/src/samv7: Add ability for CAN BUS_OFF autorecovery + according ISO11898-1:2015. With this change we added an ioctl for + triggering the autorecovery sequence for BUS_OFF to the CAN-driver + and the SAMV7 low-level driver. According the datasheet: If the + device goes Bus_Off, it will set MCAN_CCCR.INIT of its own accord, + stopping all bus activities. Once MCAN_CCCR.INIT has been cleared by + the processor (application), the device will then wait for 129 + occurrences of Bus Idle (129 * 11 consecutive recessive bits) before + resuming normal operation. At the end of the Bus_Off recovery + sequence, the Error Management Counters will be reset. During the + waiting time after the resetting of MCAN_CCCR.INIT, each time a + sequence of 11 recessive bits has been monitored, a Bit0 Error code + is written to MCAN_PSR.LEC, enabling the processor to readily check + up whether the CAN bus is stuck at dominant or continuously disturbed + and to monitor the Bus_Off recovery sequence. MCAN_ECR.REC is used to + count these sequences. From Frank Benkert (2018-07-04). + * This commit attempts remove some long standard confusion in naming + and some actual problems that result from the naming confusion. The + basic problem is the standard MTU does not include the size of the + Ethernet header. For clarity, I changed the naming of most things + called MTU to PKTSIZE. For example, CONFIG_NET_ETH_MTU is now + CONFIG_NET_ETH_PKTSIZE. + This makes the user interface a little hostile. People thing of an + MTU of 1500 bytes, but the corresponding packet is really 1514 bytes + (including the 14 byte Ethernet header). A more friendly solution + would configure the MTU (as before), but then derive the packet + buffer size by adding the MAC header length. Instead, we define the + packet buffer size then derive the MTU. + The MTU is not common currency in networking. On the wire, the only + real issue is the MSS which is derived from MTU by subtracting the IP + header and TCP header sizes (for the case of TCP). Now it is derived + for the PKTSIZE by subtracting the IP header, the TCP header, and the + MAC header sizes. So we should be all good and without the recurring + 14 byte error in MTU's and MSS's. From Gregory Nutt (2018-07-04). + * arch/arm/src/stm32f7/stm32_sdmmc.c: Add SDIO card support. From + Ramtin Amin (2018-07-05). + * net/tcp: Set the default TCP MSS to the value required by RFC 879 + and never change it under any circumstance unless the remote host + requests a larger MSS via an option the TCP header. From Gregory + Nutt (2018-07-05). + * configs/viewtool-stm32f107: Add a TCP performance test using + apps/examples/tcpblaster. From Gregory Nutt (2018-07-05). + * net/tcp: Fix a deadlock condition that can occur when (1) all + network logic runs on a single work queue, (1) TCP write buffering is + enabled, and (2) we run out of IOBs. In this case, the TCP write + buffering logic was blocking on iob_alloc() with the network locked. + Since the network was locked, the device driver polls that would + provide take the write buffer data and release the IOBs could not + execute. This fixes the problem by unlocking the network lock while + waiting for the IOBs. From Gregory Nutt (2018-07-06). + * stm32_dac.c: set OUTEN bit for DAC1CH2 and DAC2CH1 + power/motor: direction parameter is now int8 + add overload fault + libdsp: all floats with f-sufix + libdsp: add precision option for library + libdsp: add debug option for library and assertions in functions + libdsp: add current samples correction for SVM3 + libds: add some motor control specific functions + libdsp: add basic speed observer + libdsp: fix phase shift in SMO observer + libdsp: add more logic to FOC + config/sim/dsptest: add dsptest configuration + libdsp/lib_motor.c: remove unused comparation + libdsp/lib_observer.c: update some comments From Mateusz Szafoni + (2018-07-07). + * drivers/leds/pca9635pw.c and + configs/stm32f4discovery/src/stm32_pca9635.c: Fix pca9635pw LED + driver compilation From Alan Carvalho de Assis (2018-07-07). + * arch/arm/src/lpc54xx: The LPC54608 can only run at a maximum + frequency of 180Mhz. This configuration requires uses the clk_in, + external crystal clock, to drive the PLL. When that input was + selected, the board bootup failed waiting for the PLL to lock. After + referring the driver from NXP, we should turn on power sources for + the ext clock if system pll input select clk_in. NOTE that the + LPC54628 did not require this step... perhaps because the system + oscillator power was already enabled. From kxjiang (2018-07-08). + * tools/mkexport.sh: Save the System.map file in the export package so + that it can be used to extract addresses. From Gregory Nutt + (2018-07-08). + * tools/mkexport.sh: Save the User.map file in the export package if + available. From Gregory Nutt (2018-07-09). + * include/nuttx/fs/hostfs.h: Update duplicated definitions in HOSTFS + that must match NuttX values. From ligd (2018-07-09). + * arch/arm/src/stm32l4/chip/: Corrects some mistakes in pin definitions + for the STM32L4 family. According to datasheet of STM32L496xx, + STM32L475xx and STM32L443XX the AF2 of PE14 is TIM1_BKIN2 not + TIM2_BKIN. From Daniel Pereira Carvalho (2018-07-10). + * arch/arm/src/lc823450: Add lc832450 elf test From Masayuki Ishikawa + (2018-07-12). + * - arch/arm/src/stm32h7: After numerous changes, the basic STM32 H7 + NSH configuration is now functional From Mateusz Szafoni (2018-07-12). + * nucleo-h743zi/nsh: use Nucleo Virtual console as default serial From + Mateusz Szafoni (2018-07-12). + * STM32 F0, F1-F4, F7, L4, H7: Added Single Wire Kconfig variable. + From David Sidrane (2018-07-12). + * drivers/audio: Fix compile error in i2schar.c + (CONFIG_DEBUG_ASSERTIONS=y) From Masayuki Ishikawa (2018-07-13). + * configs/viewtool-stm32f107: Add support for the MAX3421E to the + viewtool-stm32107 board support From Gregory Nutt (2018-07-13). + * configs/lc823450-xgevk: Fix parallel build on lc823450-xgevk + This change fixes an archive file (*.a) corruption by locking + $(TOPDIR). Please note that locking the current directory is + insufficient because some archive files such as libapps.a are + specified with absolute path. From Masayuki Ishikawa (2018-07-14). + * configs/lc82345-xgevk: Add posix_spawn configuration From Masayuki + Ishikawa (2018-07-14). + * libs/libc/unistd/Kconfig: Fix backward conditional logic. From + Gregory Nutt (2018-07-14). + * configs/stm32f4discovery/src/stm32_rgbled.c: Krassimir Cheshmedzhiev + claims that sys/types.h needs to be included to avoid undeclared + 'OK' From Gregory Nutt (2018-07-15). + * arch/arm/src/stm32f7/chip/stm32f72xx73xx_pinmap.h: All of the SDMMC + pins were set to 50 MHz, but not the clock. This sets the clock to 50 + MHz also. This combined with turning on I/O compensation makes + intermittent failures go away. From Bob Feritich (2018-07-15). + * arch/arm/src/stm32f7: Port Bob Feritich's change to SDMMC2 and to + all other STM32F7 architectures. Also add a configuration option to + automatically enable I/O compensation. + arch/arm/src/stm32: Port Bob Feritich's change to STM32 F2 and F4 + which appear to have identical SD support and I/O compensation + requirements. From Gregory Nutt (2018-07-15). + * arch/arm/src/stm32l4: Added custom pin mapping for STM32L4X2XX + processors. From Daniel P. Carvalho (2018-07-16). + * stm32f746g-disco/nxdemo: Add a configuration to build working nxdemo + application From Fanda (2018-07-17). + * configs/nucleo-l432kc: Fix RAM size; STM31L4x2xx has only 64Kb of + RAM. Remove references to I2C and SDIO: There is no I2C2 or SDIO on + the STM32F4x2xx. From Daniel P. Carvalho (2018-07-17). + * net/udp/udp_finddev.c: Fix for network byte-order issue when + checking if an address is a multicast address. From Jake Choy + (2018-07-17). + * arch/arm/src/lc823450: Add SPI flash driver for lc823450. NOTE: Only + bus accelerator mode is supported. From Masayuki Ishikawa + (2018-07-18). + * net/ and include/nuttx/net: Add getpeername() support From ligd + (2018-07-19). + * syscall/: Add support for getpeername() and get_sockname() system + calls. From Gregory Nutt (2018-07-19). + * libs/libc/stdlib and include/stdlib.h: Add implementation of + random() and srandom(). From Gregory Nutt (2018-07-19). + * kinetis: USB0 fix interrupt storm on error. The ERROR bit of + USBx_ISTAT needed to be cleared once an error occurs. From David + Sidrane (2018-07-19). + * configs/lpcxpresso-lpc54628/lvgl: Update lvgl board config to use + the new version From Alan Carvalho de Assis (2018-07-19). + * arch/arm/src/lc823450: Add support for mpu and userspace + configs/lc823450-xgevk: Add kostest PROTECTED build + configs/lc823450-xgevk: Add knsh PROTECTED build From Masayuki + Ishikawa (2018-07-20). + * syscall/: Fix 6th parameter type of posix_spawnp in syscall.csv + From Masayuki Ishikawa (2018-07-20). + * libs/libc/unistd/: Add a crippled version of daemon(). From Gregory + Nutt (2018-07-20). + * arch/arm/src/stm32f7/: Fix data timeout errors with multiblock + transfers. From Bob Feretich (2018-07-20). + * drivers/mmcsd/mmcsd_sdio.c: Fix an error that was causing SDIO + multiple block transfers from achieving full performance. From Bob + Feretich (2018-07-20). + * drivers/leds/max7219.c: Add support to MAX7219 to control 7-segment + displays + configs/stm32f4discovery/src: Add board support to MAX7219 as + numeric display controller From Alan Carvalho de Assis (2018-07-22). + * Rename all usage of samdl/SAMDL to samd2l2/SAMD2L2 to make room in + the name space for the forthcoming samd5e5/SAMD5E5 From Gregory Nutt + (2018-07-22). + * syscall/: Fix parallel build in making context. This change avoids + running $(MKSYSCALL) and .context in parallel and ensures that + tools/mksyscall is built before it is actually used. From Masayuki + Ishikawa (2018-07-23). + * arch/arm/src/samv7/sam_mcan.c: Correct an error in the BUS_OFF + reporting. In case of BUS_OFF the old implementation was leading to + a package storm. Now it reports the error condition BUS_OFF only + once. From Frank Benkert (2018-07-23). + * arch/arm/src/kinetis: SDHC fix SDIO driver so that DMA works. + There were 2 problems. The first was that the interrupt did test DINT + and raise a completion events. But since DINT is just an indication + of DMA completion, TC is a valid way to determine that the transfer + is complete. The second problem is that Software Reset For DAT Line + SDHC_SYSCTL[RSTD] clears the bits 24-0 in SDHC_PROTO this looses the + wide bus setting DTW From David Sidrane (2018-07-23). + * arch/arm: Add CONFIG_DEBUG_MEMFAULT to Kconfig. Also, fix + src/armv7-m/up_memfault.c From Masayuki Ishikawa (2018-07-24). + * fs/tmpfs/fs_tmpfs.c: Correct logic in tmpfs_ioctl() that extracts + the priv state structure from the file system structures. It was not + getting the right value and causing mmap() to fail. Noted by Jesse. + From Gregory Nutt (2018-07-24). + * include/sys: Fix SYS_maxsyscall in syscall.h From Masayuki Ishikawa + (2018-07-25). + * libs/libc/netdb: Fix a link error in lib_gethostbynamer.c with + protected build. NOTE: g_lo_ipv4addr also exists in + net/loopback/lo_globals.c which can be linked with kernel build only. + From Masayuki Ishikawa (2018-07-25). + * arch/arm/src/imxrt/chip/imxrt_lpspi.h: IMXRT1050 LPSPI register and + bit definitions added. + arch/arm/src/imxrt/imxrt_serial.c: IMXRT1050 LPUART TERMIOS support + added. From Ivan Ucherdzhiev (2018-07-26). + * include/sys: Remove unused SYS_nnetsocket from syscall.h. Because + SYS_nnetsocket is not implemented so far, it should be removed so that + SYS_prctl can work correctly. From Masayuki Ishikawa (2018-07-26). + * binfmt/: Refactor binfmt_exec.c. This change also fixes an argv + issue for CONFIG_SCHED_ONEXIT=n or CONFIG_SCHED_HAVE_PARENT=n From + Masayuki Ishikawa (2018-07-26). + * arch/arm/src/imxrt: I finally got the Ethernet CRC32 to work + properly after the FAE pointed me in the right direction: (1) Added + CRC32 functions for multicast address filtering, (2) Do not reset PHY + settings when doing an ifup, (2) Use chip's unique id as the device + MAC, and (4) Enable discard enet frames with errors at PHY layer. + From Jake Choy (2018-07-26). + * arch/arm/src/samd5e5 and configs/metro-m4: Initial commit the port + to the SAMD5x/E5x MCU family and also support for the Adafruit Metro + M4 board. It port is untested and unfinished. It currently will not + even link due to some missing clock related logic. From Gregory Nutt + (2018-07-26). + * configs/stm32vldiscovery: Changed the status LED to be the green one + as mentioned in the README file. Removed the global array for buttons + and replace it with the only button. Improve defconfig for the nsh + configuration. From Ouss4 (2018-07-27). + * arch/arm/src/samd5e5: Completes XOSC32, XOSC0/1, MCLK, and GCLK + configuration logic. Still needs FDPLL and FDLL support. From + Gregory Nutt (2018-07-27). + * arch/arm/src/samd5e5/sam_clockconfig.c: Implement DFLL and DFPLL0/1 + support. This completes coding the the re-architected clock + configuration logic. From Gregory Nutt (2018-07-28). + * arch/arm/src/samd5e5: Bring in untested SPI and I2C drivers from + SAMD2L2. From Gregory Nutt (2018-07-29). + * arch/arm/src/samd5e5: Leverage the SAMD2L2 DMA controller. From + Gregory Nutt (2018-07-29). + * arch/arm: Introduce CONFIG_DEBUG_HARDFAULT_INFO to Kconfig + arch/arm/src/armv7-m: Introduce CONFIG_DEBUG_HARDFAULT_INFO to + up_hardfault.c + arch/arm/src/armv6-m: Introduce CONFIG_DEBUG_HARDFAULT_INFO to + up_hardfault.c From Masayuki Ishikawa (2018-07-30). + * sched/mqueue/mq_notify.c: Fix - only part of struct copied to + internal structure. As source address the address of the struct + member sigev_value was used, and it is not located the start of the + struct. This leads to invalid data being copied to internal + structure. Both source and destination should be of type struct + sigevent* . From Simon Liedl (2018-07-30). + * arch/arm/src/samd5e5/sam_usb.c: Bring the SAMDL2 USB driver into the + SAMD5E5 port. From Gregory Nutt (2018-07-30). + * drivers/usbhost/usbhost_max3421e.c: Fix several errors found in + early testing. + drivers/usbhost/usbhost_max3421e.c: Mutual exclusion semaphore must + be re-entrant. + drivers/usbhost/usbhost_max3421e.c: Fix unmatched SPI lock/unlock. + From Gregory Nutt (2018-07-30). + * configs/metro-m4: Correct SERCOM3 pin configuration From Gregory + Nutt (2018-08-01). + * stm32f746g-disco: touchscreen support: Fixed FT5x06 driver to + correctly close (previously it unregistered interrupt handler during + close). Also added LittlevGL demo for STM32F746G-DISCO From Marcin + Wyrwas (2018-08-01). + * drivers/analog: Add driver for digital to analog converted DAC7571. + configs/nucleo-l432kc: Add support for a connect DAC7571 converter. + From Daniel Pereira Carvalho (2018-08-02). + * drivers/sensors/adxl345: remove comment references to touchscreens + From Russ Webber (2018-08-02). + * arch/arm/include/armv7-m, arch/arm/include/armv7-m, + arch/arm/include/stm32f7: Add a configuration to enable workaround + for r0p1 Errata 837070: Increasing priority using write to BASEPRI + does not take effect immediately. + This update is required to be serialized to the instruction stream + meaning that after this update completes, it takes effect immediately + and no exceptions of lower priority than the new boosted priority can + pre-empt execution. Because of this erratum, the priority boosting + does not take place immediately, allowing the instruction after the + MSR to be interrupted by an exception of lower priority than the new + boosted priority. This effect is only limited to the next + instruction. Subsequent instructions are guaranteed to see the new + boosted priority. + This was raised in Bitbucket issue 113 from Vadzim Dambrouski. From + Gregory Nutt (2018-08-02). + * net/tcp: Remove g_netstats.tcp.syndrop++ from tcp_data_event() From + Masayuki Ishikawa (2018-08-03). + * include/nuttx/i2c/i2c_master.h: Add a definition to distinguish a + new START of messages from a repeated start. No lower-half I2C + drivers actually implement this new flag bit, however. + drivers/i2c/i2c_writeread.c: Use new repeated START definition where + appropriate. Rename I2C_M_NORESTART to I2C_M_NOSTART since it may be + used in other contexts than a repeated start. Add comments to + clarify setup for repeated start. From Gregory Nutt (2018-08-03). + * configs/nucleo-l432kc: Fix stm32_userleds. After change LD2 to LD3 + in board.h stm32_userleds.c was broken. From Daniel P. Carvalho + (2018-08-03). + * arch/arm/src/stm32f7: This commit ports the stm32f20xxf40xx_flash.c + driver to the STM32F7 platform and fixes some relevant problems in + the header files. From Evgeniy Bobkov (2018-08-03). + * net/netlink: This commit brings in a fragmentary, experimental + implementation of NETLINK sockets. There is not too much to that + socket support on this initial commit, just the netlink socket + framework. However, I decided to bring it into master because there + is a enough that I would not want to lose what is in place. And + since it is dependent on CONFIG_EXPERIMENTAL, its presence on master + should be innocuous. From Gregory Nutt (2018-08-03). + * configs/metro-m4: Add an option to build the Metro M4 image to run + out of SRAM. This ought to be a safer and quicker way to do the + initial bring-up (having bricked the first Metro M4 due to a bad + FLASH image). From Gregory Nutt (2018-08-03). + * Revise the Cortex-M7 workaround: That change had the subtle + side-effect of unconditionally enabling interrupts in the primask. + That may be what we want in most cases, but certainly not all. This + does increase the size of the inline function by about 48-bits per + instantiation. From Gregory Nutt (2018-08-04). + * configs/olimex-stm32-p407: Add kernel ELF (kelf) configuration. + From Gregory Nutt (2018-08-04). + * binfmt/ and sched/group: Re-architect the way that loadable ELF or + NXFLAT modules are unloaded. Memory resources must be recovered when + the task loaded into memory exits. The original implementation used + the death-of-child SIGCHLD signal to perform the unload. There are + several problems with this: It is overly complex, it requires that + the parent task stay resident while the loaded task runs, and it has + fatal logic flaws in the protected and kernel model builds because + the user signal handler attempts to run in the kernel address space. + This commit corrects with using a mindlessly simply BINFMT callback + when the task exits. From Gregory Nutt (2018-08-05). + * Kconfig files: Fix several errors noted by Alex Denisov in Bitbucket + issue 115. From Gregory Nutt (2018-08-05). + * configs/olimex-stm32-p407/kmodule: Add a configuration that can be + used for testing installation of kernel modules in the protected + build. From Gregory Nutt (2018-08-05). + * sched/group: Fix a deadlock when loading an ELF From Masayuki + Ishikawa (2018-08-06). + * arch/arm/src/lc823450: Change C-Buffer under-level control. The + under-level setting was changed from 1KB to 55KB. In previous + implementation, the setting can ben changed by the tx threshold but + it is fixed at startup. Also, check write size and adjust alignment + if needed. + configs/lc823450-xgevk: Change IOB related params for RNDIS. Since + TCP flow control scheme was changed, HTTP audio streaming has not + been working. These IOB params are not optimized but HTTP audio + streaming now works. From Masayuki Ishikawa (2018-08-06). + * arch/arm/src/stm32l4/chip/stm32l4x3xx_pinmap.h: Recent commit removed + some of the pin definitions for STM32L451xx, and probably some other + chips of the STM32L4x3 subfamily, breaking our builds. Some chips of + the subfamily don't have these peripherals, but some do, so that is + not a valid reason to remove them. From Juha Niskanen (2018-08-06). + * stm32f103-minimum: Add blackpill LED support From Russ Webber + (2018-08-07). + * Build System: This change extends support for the two-pass build. + Its primary purpose is to incorporate source logic generated by + applications into the kernel phase of the build. + In the two pass build, the application logic is built during the + first phase, pass 1. In that phase, the application may generate and + install source files in the pass1/directory. The operating system is + built during phase 2 of the build. At that time, those source files + in the pass1/ directory will be built and incorporated into the + kernel address space. + The primary purpose of the pass1/ directory is to such + application-generated kernel symbol tables. For an example of the + use of this feature, look at apps/examples/module/drivers/Makefile. + Kernel symbol tables are needed to support kernel modules. Of + course, addition board-specific logic in, say, configs//src + would have to be included to make use of the application-installed + symbol tables. From Gregory Nutt (2018-08-07). + * configs/olimex-stm32_p407: Add logic to support initialization of + the kernel module symbol table installed in the pass1/ directory + during the application phase of the build. The kmodule configuration + appears to be fully functional. From Gregory Nutt (2018-08-07). + * configs/nucleo-l432kc/include/nucleo-l432kc.h: Fix TIMx clock + configuration. Also removes definitions related to timers not + available in the STM32L432KC. From Daniel Pereira Carvalho + (2018-08-07). + * arch/arm/src/stm32l4: Fix ADC and COMP breakage caused by + CONFIG_STM32L4_STM32L4X2 separation in 9223123c From Juha Niskanen + (2018-08-08). + * configs/nucleo-l452re: Fix TIMx clock configuration. This is cloned + from 391f3715 for nucleo-l432kc. Also fixes DAC build failure. From + Juha Niskanen (2018-08-08). + * arch/arm/src/stm32, stm32f7, stm32l4, and related defconfig files: + The STM32 RTC driver was being selected by the global CONFIG_RTC + option. That is in correct. For example, if you want to disabled + the STM32 RTC and use an external RTC you cannot because the external + RTC also depends on the global CONFIG_RTC. The solution is to add a + new CONFIG_STM32xx_RTC configuration option the permits to you select + or deselect the STM32 RTC but still be able to selecte the external + RTC. From Gregory Nutt (2018-08-08). + * configs/stm32f4discovery/scripts/ld.script: Missing + EXTERN(_vectors) From Gregory Nutt (2018-08-08). + * arch/arm/src/stm32l4: Avoid using redundant + CONFIG_STM32L4_STM32L4X2. This is almost always same as + CONFIG_STM32L4_STM32L4X3. Avoid duplication to reduce macro clutter. + This patch limits CONFIG_STM32L4_STM32L4X2 usage to dependency + tracking and pinmap. Also enable ADC for CONFIG_STM32L4_STM32L4X5 + (untested, but same RM). From Juha Niskanen (2018-08-09). + * arch/arm/src/stm32l4/chip: Merged stm32l4x2xx and stm32l4x3xx pinmap + files. Removed references to stm32l4x2xx_pinmap.h From Daniel P. + Carvalho (2018-08-09). + * arch/arm/src/kinetis: PIT add Liftime and Chaining + arch/arm/src/kinetis: flexcan fix duplicate line and ordering + arch/arm/src/kinetis: kinetis_lowput.c LPUART data format with + parity fix. The 9-bit data mode is typically used with parity to + allow eight bits of data plus the parity + arch/arm/src/kinetis: lowputc LPUART_BAUD_INIT has to be defined. + Build fails with test case enable LPUART0 and make UART1 console. If + HAVE_LPUART_DEVICE is defined then LPUART_BAUD_INIT has to be defined + even if the lpuart is not the console From David Sidrane (2018-08-09). + * - arch/arm/src/kinetis: Add DMA support and use Circular DMA as an + option to augment the RX FIFOs in the Serial driver. From David + Sidrane (2018-08-10). + * fs/proc and sched/environ: Add support for a procfs entry that will + permit examining the environment of any task. From Gregory Nutt + (2018-08-10). + * tools/kconfig2html.c: Update tool to handle tristate types. Fix a + few errors detected in Kconfig files. From Gregory Nutt (2018-08-10). + * arch/arm/src/stm32l4: Add initial support to STM32L4+ chips From + Juha Niskanen (2018-08-13). + * configs/stm32l4r9ai-disco: Add stm32l4r9ai-disco support. From Juha + Niskanen (2018-08-13). + * arch/arm/src/stm32l4: stm32l4xrxx: allow board to override flash + wait states From Juha Niskanen (2018-08-14). + * configs/stm32l4r9ai-disco: Fix HSE clock config and clock board to + maximum 120 MHz From Juha Niskanen (2018-08-14). + * drivers/net/tun.c: Fixed custom tun devname formatting. From Dmitriy + Linikov (2018-08-14). + * net/: Remove all references to CONFIG_NET_USER_DEVFMT. That feature + is now unconditionally enabled. This was done because (1) the + feature does not require very much additional memory, and (2) it + causes confusion in the configuration due to the additional + complexity. Any network drivers that fail to zero the device + structure interface name field (d_ifname) because calling + netdev_register() will, however, get a nasty surprise. From Gregory + Nutt (2018-08-14). + * net/: Change order of logic: Select the user-defined interface name + format BEFORE determining the minor device number. Otherwise, the + default interface name will be used. From Gregory Nutt (2018-08-14). + * tools/Config.mk: Add function CATFILE definition. Currently only + used in apps/builtin/Makefile. From Gregory Nutt (2018-08-15). + * tools/Config.mk: Move the RWILDCARD function definition from + apps/builtin/Makefile to nuttx/tools/Config.mk. It may have a + broader usage than it does now. From Gregory Nutt (2018-08-15). + * arch/arm/src/stm32/stm32_adc.c: Allow multiple channels without DMA + on STM32L15XX From Juha Niskanen (2018-08-16). + * arch/arm/src/stm32, stm32f7, stm32l4: Make STM32F4XX RTC depend on + CONFIG_STM32_RTC. From Juha Niskanen (2018-08-16). + * arch/arm/src/stm32l4: Some updates to analog peripherals ADC, COMP + and DFSDM for STM32L4XR From Juha Niskanen (2018-08-16). + * drivers/usbdev/cdcecm.c: Adds USB Device Support for CDC/ECM From + Michael Jung (2018-08-16). + * include/stdio.h: Add prototypes for popen() and pclose(). Actual + implementation is in apps/system/popen() From Gregory Nutt + (2018-08-17). + * include/stdio.h: popen()/pclose() are not available in KERNEL mode + because they depend on task_spawn() which is not available in KERNEL + mode. From Gregory Nutt (2018-08-17). + * fs/procfs/: Add support for /self, a convenient way for getting + information about the currently running task. From Gregory Nutt + (2018-08-18). + * fs/procfs: Add a configuration option to disable environment + variable info. From Gregory Nutt (2018-08-19). + * include/endian.h and libs/libc/endian: Add support for endian.h. + From Gregory Nutt (2018-08-19). + * include/sys/param.h: Add a dummy sys/param.h header file. This is + not a standard file but is used by other systems and having the dummy + file may minimize some porting efforts. From Gregory Nutt + (2018-08-19). + * Remove CONFIG_ARCH_CALIBRATION. It is awkward to use and no longer + necessary now that we have apps/examples/calib_udelay. From Gregory + Nutt (2018-08-19). + * arch/arm/src/stm32f7/stm32_serial.c: Previous logic would invalidate + the data cache as each byte was read from the DMA buffer. This + change adds logic to invalidate the data cache less frequently by + monitoring the state of the Rx DMA buffer cache coherency and + invalidating only regions as necessary. From Evgeniy Bobkov + (2018-08-21). + * net/procfs/netdev_statistics.c: Was not handling the output correct + for the case of an IEEE 802.11 device. From Gregory Nutt (2018-08-21). + * fs/hostfs: Add support for open() append mode From anchao + (2018-08-22). + * fs/hostfs: Add ftruncate support. From Xiang Xiao (2018-08-22). + * sched/symtab: Reference default symtab name to binfmt From anchao + (2018-08-22). + * binfmt/elf: Set priority level to default if parent has no + priority. From anchao (2018-08-22). + * configs: Several applications in apps/ were calling elf_initialize() + nxflat_initialize(), or builtin_initialize() in violation of the + portable POSIX interface. Those calls were removed from the + applications and added to the appropriate board initialization with + this commit. From Gregory Nutt (2018-08-22). + * drivers/wireless/ieee80211/bcmf_netdev.c: Add missing logic to poll + for more Tx data after the last transfer completes. From Gregory + Nutt (2018-08-22). + * configs/: Change CONFIG_BOARD_RESET_ON_CRASH to + CONFIG_BOARD_RESET_ON_ASSERT, arch/: Implement call to board_reset() + if in all implementations of up_assert() when + CONFIG_BOARD_RESET_ON_ASSERT=y. From Xiang Xiao (2018-08-22). + * apps/system/system/system.c: Add 'const' to make function prototype + compatible with OpenGroup.org requirement From Xiang Xiao + (2018-08-23). + * arch/arm: (1) Add semihost support for syslog, (2) Add semihost + support for HostFS From Gregory Nutt (2018-08-23). + * binfmt: Add binfmt_initialize(). All binary formats are now + registered centrally vs. in board-specific logic. This simplifies + the usage of the binfmt subsystem. From Xiang Xiao (2018-08-23). + * mm/: add mm_heapmember function and reimplement kmm_heapmember base + on mm_heapmember since this function is very useful if multiple heaps + exist. From Xiang Xiao (2018-08-23). + * pthreads: Add support static pthread stack. Add standard + pthread_attr_setstack() and pthread_attr_getstack(). In all cases + where the stack is released, add check to see which allocator must be + used to free the stack: The user or the kernel allocator. From + xuanlin (2018-08-23). + * arch/arm/src/armv7-m: Implement SYSTICK timer driver From Xiang + Xiao (2018-08-23). + * configs/sim/loadable: Add loadable demo for arch sim + sched/init: Restore previously reverted option to mount block device + for INIT_FILEPATH case + configs/stm3240g-eval/knxwm: Fix build breakage. + configs: With recent changes to apps/ all configurations that build + applications as modules must now also select CONFIG_APPS_LOADABLE. + configs/sim/loadable: Add loadable demo for arch sim + Kconfig and tools/Makefile.unix and : add dynamic application + loadable support From anchao (2018-08-23). + * tools/nxstyle.c: Add capability to detect multiple blank lines. + Single spacing required by the coding standard. Also coding standard + fixes to server .c files for problems found during testing nxstyle. + From Gregory Nutt (2018-08-24). + * Replace non critical PANIC with DEBUGPANIC to save the code space + From Xiang Xiao (2018-08-24). + * Replace all ASSERT with DEBUGASSERT to save the code space From + Xiang Xiao (2018-08-24). + * arm syscalls: svcall/sycall logic needs to get the ucontext argument + from R4 instead of stack since all syscall parameters pass from + registers in syscall.h From Xiang Xiao (2018-08-24). + * arch/arm/armv7-m: MPU: mpu_log2regionceil needs take into account + the offset too From Xiang Xiao (2018-08-24). + * arch/ and task/sched: vfork operation needs to allocate and copy the + task argument too. Also correction of the address correction cannot + depend on the stack pointer since it is not available in all + architectures. Rather calculate the offset from the stack + allocation pointer From Xiang Xiao (2018-08-24). + * include/nuttx/arch.h: Add prototype for an architecture-specific + up_trigger_irq function From dongjianli (2018-08-24). + * include/nuttx/arch.h: Add prototype for an architecture-specific + up_trigger_irq function + arch/, include/nuttx, sched/sched: Add the garbage collection hook + so each architecture can do custom memory cleanup if necessary. + arch/Kconfig: Add configuration CONFIG_ARCH_GNU_NO_WEAKFUNCTIONS to + suppress use of weak functions. Some gnu derived toolchains do not + support weak symbols From Xiang Xiao (2018-08-24). + * include/nuttx/arch.h: Add architecture-specific prototypes for + conversions between physical and virtual address. From ligd (2018-08-24). + * net/arp: arp_find() now checks if the target IP belongs to one of the + local network devices. From Xiang Xiao (2018-08-24). + * net/netdev: add devif_loopback() to check the loopback case where + a packet is being sent to itself. Modify the net driver to call this + function in this case. This function will simply re-inject the + packet back into the network and the network driver will not put + anything on the wire. From Xiang Xiao (2018-08-24). + * include/nuttx/clock.h, sched/sched: Support the CPU load measurement + using timer_lowerhalf_s interface From Xiang Xiao (2018-08-24). + * drivers/timers: Add maxtimeout method to the struct timer_ops_s + interface From Xiang Xiao (2018-08-24). + * drivers/timers: Add a new method to the struct oneshot_operations_s + interface to get the current time from a oneshot timer driver (if it + is available from the lower half) From Xiang Xiao (2018-08-24). + * drivers/net: drivers/net: Add support for Microchip LAN91C111 + driver From Xiang Xiao (2018-08-24). + * arch/sim/src/up_netdriver.c: (1) Remove up_comparemac() check for + matching MAC address. Let's trust that the tap device just return the + packet which belong to us like other real network device hardware. + (2) Add network device statistics support. From Xiang Xiao + (2018-08-24). + * up_internal.h: Define out the prototype for up_netinitialize() if + CONFIG_NETDEV_LATEINIT is also defined From dongjianli (2018-08-24). + * sched/irq/irq_dispatch.c: Ensure vector never points to NULL since + interrupt may happen before irq_initialize() From Xiang Xiao + (2018-08-24). + * sched/irq: Add support interrupt chains in NuttX. IRQ chain is very + useful in these cases: (1) Multiple hardware connect to the same + request line(e.g. PCI), (2) Need multiple driver to support one + hardware block (like Linux MFD) From zhuguangqing (2018-08-24). + * sched/irq/irq_procfs.c: Fix occasional computation error when + fracpart >= 1000 From Xiang Xiao (2018-08-24). + * arch/: Fix an error found in build testing. The prototype of + mpu_log2regionfloor() changed; an additional parameter was added. + However, none of the calls to mpu_log2regionfloor() were updated to + pass the new, additional parameter. From Gregory Nutt (2018-08-24). + * net/arp: Make the function arp_find() thread-safe. It now returns a + copy of the MAC address from the ARP table entry, rather than a + potentially unstable reference to the ARP table entry. From Gregory + Nutt (2018-08-24). + * arch/arm/src/kinetis: I2C ensure timeout on bus error. The code had + a dead wait on I2C_S_BUSY. Noise on the bus would cause the driver to + hang. Add timeout on invalid states of I2C_S_BUSY to allow the upper + layers do deal with restart or abort. From David Sidrane (2018-08-25). + * sched/irq: Monitor the irq execution time. This is very useful for + measuring the interrupt latency. From Xiang Xiao (2018-08-25). + * drivers/sensors and configs/nucleo-l476g: Add support for LSM303AGR + and LSM6DSL sensors From DisruptiveNL (2018-08-25). + * arch/arm/src/armv7-m/up_trigger_irq.c: Add logic to trigger ARMv7-M + interrupts and exceptions. From Gregory Nutt (2018-08-25). + * arch/arm/src/armv-7m/nvic.h: Add definitions needed by + up_trigger_irq(). From Gregory Nutt (2018-08-25). + * drivers/wireless/ieee80211/bcmf_sdio.c: Bring in some fixes from the + 'Haywire' branch. From Gregory Nutt (2018-08-25). + * sched/wqueue: Modify high priority work queue to support multiple + threads. + sched/wqueue and libs/libc/wqueue: workqueues don't need set global + data to zero since .bss is cleared automatically. Removing this + unnecessary initialization also avoids the loss the work items queued + before initialization. From ligd (2018-08-25). + * sched/wqueue, libs/libc/wqueue, configs: Remove work queue polling + delay to simplify the code logic and save the power. From xuanlin + (2018-08-25). + * drivers/syslog: Channel configuration. Decouple + SYSLOG_SERIAL_CONSOLE and ARCH_LOWPUTC. Since some hardware can + output log to the special debug channel not serial. + drivers/syslog/vsyslog.c: Support pre-pending a prefix string to log + output if enabled. This very useful to identify which cpu send out + the log in AMP SoC. + drivers/syslog/vsyslog.c: Make timestamp output same as linux + kernel. It's very useful if NuttX syslog retarget to Linux syslog. + From Xiang Xiao (2018-08-26). + * libs/libc/syslog/lib_syslog.c: Fix syslog crash on 64bit simulation. + From anchao (2018-08-26). + * Write to a pipe when there are no readers from the pipe should return + -EPIPE. From ligd (2018-08-26). + * drivers/serial/pty.c: Add support so that a PTY can poll for both + IN/OUT event simultaneously. From ligd (2018-08-26). + * drivers/serial: Add Ctrl-C/Ctrl-X support. This is an initial + working implementation that still requires that several details be + resolved. + sched/task/task_start.c: Add default signal action to SIGKILL. From + ligd (2018-08-26). + * Send poll() notification when the Tx buffer is flushed From ligd + (2018-08-26). + * drivers/serial/serial.c: Support UART direct write for non console + device From xuanlin (2018-08-26). + * drivers/serial/serial.c: Don't overwrite nwritten unconditionally on + UART write failure. From Xiang Xiao (2018-08-26). + * drivers/serial: Move head/tail pointer reset to uart_recvchars_dma + since dma may be still transferring in the background. From Xiang + Xiao (2018-08-26). + * drivers/serial/serial.c: In DMA mode, the use of uart_disablexinit() + is insufficient to protect a critical section. + enter/leave_critical_section() must be used in those cases if + CONFIG_SERIAL_DMA=y From Xiang Xiao (2018-08-26). + * drivers/serial/uart_16550.c: Add a configuration, analogous to the + STM32 configuration option, to suppress the NuttX standard + re-ordering for /dev/ttySN for special case of the 16550 UART. + config/serial: UART 16550: Add CONFIG_SERIAL_UART_ARCH_MMIO option so + the a memory mapped device doesn't need to provide uart_getreg() and + uart_putreg() implementations. + u16550_txempty() should check UART_LSR_TEMT to avoid some data left + in the transmit FIFO From Xiang Xiao (2018-08-26). + * drivers/serial/uart_16550.c: Add stub implementations of DMA-related + methods in the 16550 UART v-table. From ligd (2018-08-26). + * drivers/serial/uart_16550.c: Add serial termios handling From + anchao (2018-08-26). + * drivers/serial/uart_16550.c: Support 16550 auto hardware flow control + drivers/serial/uart_16550.c: Add configuration option + CONFIG_16550_SUPRESS_INITIAL_CONFIG. This is identical to the + standard configuration in arch/Kconfig CONFIG_SUPPRESS_UART_CONFIG, + but with scope of only the 16550 driver. From Xiang Xiao (2018-08-26). + * fs/hostfs/Kconfig: Remove ARCH_SIM dependence since other + architectures (e.g., arm semihosting) could support hostfs too From + Xiang Xiao (2018-08-26). + * fs/hostfs/hostfs.c: Support remote directory names without a trailing + '/' From ligd (2018-08-26). + * fs/hostfs/hostfs.c: Ensure f_type is equal to HOSTFS_MAGIC. From + Xiang Xiao (2018-08-26). + * fs/hostfs/hostfs.c: Add re-try when hostfs mount() fails From ligd + (2018-08-26). + * fs/romfs/fs_romfsutil.c: Make romfs_devread32 more portable From + anchao (2018-08-26). + * fs/nfs: Update nfs mount to VER3 From zhangyuan7 (2018-08-26). + * fs/vfs/fs_select.c: Make select be more consistent with Linux man + page: 'The timeout ... Some code calls select() with all three sets + empty, nfds zero, and a non-NULL timeout as a fairly portable way to + sleep with subsecond precision.' From anchao (2018-08-26). + * fs/vfs/fs_fstat.c: Add file_fstat() function for internal OS use. + From ligd (2018-08-26). + * fs/vfs/fs_fcntl.c, net/socket/net_dupsd.c, and + net/socket/net_vfcntl.c: Add file_fcntl, psock_fcntl, and + psock_dupsd for use within the kernel. From Xiang Xiao (2018-08-26). + * fs/vfs/fs_poll.c: Add poll use in kernel space. From dongjianli + (2018-08-26). + * include/nuttx/compiler.h, include/poll.h: Add logic to determine if + the compiler supports anonymous structures and unions. From Gregory + Nutt (2018-08-26). + * Move psock check from [get|set]sockopt to psock_[get|set]sockopt + From Xiang Xiao (2018-08-26). + * net/Kconfig: Uncomment the prompt of NET_SLIP_PKTSIZE From Xiang + Xiao (2018-08-26). + * net/tcp/tcp_monitor.c: Fix net unlock issue when tcp close. This + bug could leave the net locked. From zhangyuan7 (2018-08-26). + * netdev_findby_ipv[4|6]addr return netdev_default() as last resort but + don't return loopback device if another network device is in the UP + state. From Xiang Xiao (2018-08-26). + * net/socket/getsockname.c: Add psock_getsockname function From Xiang + Xiao (2018-08-26). + * net/netdev/netdev_ioctl.c: Add si_ioctl callback and + net_ioctl_arglen so usrsock could forward the ioctl to the remote + end From dongjianli (2018-08-26). + * include/nuttx/net/ethernet.h: Remove CONFIG_NET_ETHERNET guard From + Xiang Xiao (2018-08-26). + * net/usrsock/: Correct of semaphore usage issues. From Gregory Nutt + (2018-08-26). + * net/usrsock: Combine some the duplicated logic. From Xiang Xiao + (2018-08-26). + * net/usrsock/usrsock.h: Fix re-definitions of struct iovec. From + ligd (2018-08-26). + * net/usrsock: Optimize option dependence From Xiang Xiao (2018-08-26). + * net/usrsock: Add the listen/accept/getpeername/ioctl support From + dongjianli (2018-08-26). + * net/icmp/icmp_conn.c and net/icmpv6/icmpv6_conn.c: Change the type + of id in icmpv[6]_findconn to uint16_t From Xiang Xiao (2018-08-26). + * net/icmp and icmpv6: Fix failure to poll ICMP socket issue. From + dongjianli (2018-08-26). + * include/nuttx/fs/fs.h: ... conflicting types for file_fstat(). From + Gregory Nutt (2018-08-26). + * include/crc64.h: fix warning: integer constant is too large for its + type From Xiang Xiao (2018-08-27). + * include/nuttx/fs/binfs.h: Fix warning: Type defaults to 'int' in + declaration of 'mountpt_operations' From Xiang Xiao (2018-08-27). + * include/nuttx/compiler.h: fix warning: __cplusplus is not defined. + Some gcc derived compiler do not define __cplusplus From Xiang Xiao + (2018-08-27). + * include/nuttx/kmalloc.h: Add {kumm/kmm}_calloc API. Add calloc API + for manage user memory and kernel memory in Flat Build/Kernel Build + without kernel heap. From zhuyanlin (2018-08-27). + * include/queue.h: Add dq_tail marco From zhuguangqing (2018-08-27). + * include/spawn.h: Fix posix_spawnattr_destroy warning: 'the address + of attr will always evaluate as true' From Xiang Xiao (2018-08-27). + * include/nuttx/i2c/i2c_master.h: Add the standard speed macros. From + dongjiuzhu (2018-08-27). + * Move clock_timespec_[add|subtract] to include/nuttx/clock.h From + Xiang Xiao (2018-08-27). + * include/nuttx/semaphore.h: don't include nuttx/fs/fs.h. (1) Avoid + nested loops if CONFIG_SIG_EVTHREAD enabled, (2) semaphore.h doesn't + depends on fs.h. From Gregory Nutt (2018-08-27). + * include/nuttx/semaphore: apply the semaphore wait function + nxsem_wait_uninterruptible(). The function + nxsem_wait_uninterruptible() is a wrapped version of nxsem_wait(), + which is uninterruptible and convenient for use. From liuhaiyang + (2018-08-27). + * include/nuttx/mutex.h: Add inline wrapper functions to more clearly + support semaphores when used as mutexs. From QianWenfa (2018-08-27). + * include/sys/types: Move wint_t and wctype_t from wchar.h to + types.h. This change is compatible as before since wchar.h include + types.h indirectly. This fixes a compilation error with newlib's + math.h: 'unknown type name wint_t' From Xiang Xiao (2018-08-27). + * include/nuttx/nuttx.h: Added nuttx.h header file which is analogous + to the linux.h header file. Currently, it contains on the definition + of the container_of() macro. From zhuyanlin (2018-08-27). + * Kconfig: Move 'option modules' from NSH_FILE_APPS to BUILD_LOADABLE + From anchao (2018-08-27). + * drivers/crypto: Move dev_urandom.c into new crypto folder. From + Xiang Xiao (2018-08-27). + * drivers/pwm: Move pwm.c into pwm folder From Xiang Xiao (2018-08-27). + * drivers/audio: Move the I2S character driver to a dedicated folder. + From Xiang Xiao (2018-08-27). + * arch/arm/src/stm32/stm32f30xxx_i2c.c: Fix compile error with I2C + reset From Juha Niskanen (2018-08-27). + * include/nuttx/audio/audio.h: Change member samp of apb to pointer so + driver can customize sample buffer allocation From ZhongAn + (2018-08-27). + * libs/libc/audio/lib_buffer.c: Call nxsem_destroy in apb_free From + Xiang Xiao (2018-08-27). + * include/nuttx/audio/audio.h: Add ioctl cmd 'AUDIOIOC_SETBUFFERINFO' + so user space could config the buffer From ZhongAn (2018-08-27). + * nuttx/audio: Add hardware format support From anchao (2018-08-27). + * include/nuttx/audio/i2s.h: Add i2s_rxchannels and i2s_txchannels + methods to the I2S lower half interface. From ZhongAn (2018-08-27). + * drivers/audio/audio_i2s.c: Add audio_i2s device driver. From + ZhongAn (2018-08-27). + * audio/audio_comp.c: Add the composite audio driver From Xiang Xiao + (2018-08-27). + * driver/ioexpander: Add gpio_pin_unregister function to GPIO driver + driver/ioexpander: Add pinset struct to GPIO driver for interrupt + pins larger than 64 + driver/ioexpander: Initialize pintype/inttype when registering + ioexpander device + driver/ioexpander: Add SETPINTYPE ioctl command to the GPIO driver + From zhuyanlin (2018-08-27). + * drivers/serial/Kconfig: It is no longer necessary to restrict Ctrl-C + handling to the FLAT build + sched/signal: Add a new configuration option to select signal + default actions, separate handling of signal default actions from + both task startup logic and from the serial TTY Ctrl-C logic. Add a + signal set in the group structure to keep track of what signals have + been set to the default action. In dispatching signals in PROTECTED + or KERNEL mode, use this signal set to determine if the default + signal handler is attached and dispatch the signal in kernel mode for + the default actions. From Gregory Nutt (2018-08-27). + * drivers/timers/arch_timer.c: implement timer arch API on top of timer + driver interface + drivers/timers/arch_alarm.c: Implement alarm arch API on top of + oneshot driver interface + drivers/timers/arch_rtc.c: Implement RTC arch API on top of RTC + driver interface + include/nuttx/timers/rtc.h: Extend struct rtc_time by adding + tm_nsec if RTC supports hiresolution time. From Xiang Xiao + (2018-08-27). + * sched/signals: Update the signal default action logic to support + sigaction(). signaction() must be able to handle and input action + of SIG_DFL to setup the default signal action; it mast also return + SIG_DFL it is replacing the default action. From Gregory Nutt + (2018-08-27). + * drivers/power: PM: Add pm_stay and pm_relax function so special + apps(e.g. mediaplayer) could disable suspend during playback much like + linux kernel counterpart From Xiang Xiao (2018-08-27). + * drivers/power: PM: Add pm_querystate function From zhuguangqing + (2018-08-27). + * drivers/power/: PM: Don't update the power state in work thread: + (1) Simplify the code logic and remove the work queue dependence, + (2) Power calculation is too simple to delay into the work queue + From Xiang Xiao (2018-08-27). + * drivers/pm: PM: Decrease the power state in the reverse order. + Since the child driver need power off before parent driver. From + zhuguangqing (2018-08-27). + * drivers/power: PM: Make power manager service available as soon as + possible: (1) Initialize g_pmglobals at the definition, (2) skip + hold the lock if OS isn't ready From Xiang Xiao (2018-08-27). + * drivers/pm: PM: Add PM_RESTORE to notify driver that device exit + WFI so the driver could restore state. For example, WDT may stop + counting before enter low power state and restore the counting again + in PM_RESTORE notification From zhuguangqing (2018-08-27). + * drivers/power: PM: Add timer to decrease PM level automatically + From ligd (2018-08-27). + * sched/signal: Default Signal Actions. Change some types to + superficially simplify. Add configuration options to enabled + default signal behaviors on a per-signal basis. I don't think users + are prepared for SIGALRM to terminate the task (which is the correct + default behavior if you don't change it). Extend the implementation + of default signals so that it is totally table driven and extensible + by simply mondifying the content of const tables. From Gregory Nutt + (2018-08-27). + * drivers/power/pm_register.c: Fix an error found in build testing. + From Gregory Nutt (2018-08-27). + * drivers/mtd: Add gd25 driver From wangyanjiong (2018-08-28). + * include/limits.h and include/sys/types.h: Fix warning about + 'SIZE_MAX' redefined. include/nuttx/usb/audio.h: Fix warnings due + to '-' used whete '_' intended. From Xiang Xiao (2018-08-28). + * drivers/mtd/mtd_partition.c: Copy the partition name to internal + buffer so that the caller can free the name argument From Xiang + Xiao (2018-08-28). + * drivers/mtd/ftl.c: Support initialization of an FTL block device + with a custom name From Xiang Xiao (2018-08-28). + * fs/partition/fs_partition.c: Add PTABLE parser + fs/partion: Add a partition parser framework + fs/driver/fs_blockpartition.c: Add register_blockpartition for + block partition From Xiang Xiao (2018-08-28). + * drivers/mtd/ftl.c: Reduce size of stack buffer from 64 to a maximum + size as determined from NAME_MAX From Gregory Nutt (2018-08-28). + * drivers/serial: Integrate new Ctrl-C logic with the ISIG flag in + the termios c_lflag. Fix several compiler errors resulting from + recently flurry of renaming. From Gregory Nutt (2018-08-28). + * sched/signal: Add support for SIGINT in addition to SIGKILL. + drivers/serial: Use SIGINT instead of SIGKILL when control-C is + pressed. From Gregory Nutt (2018-08-28). + * sched/signal: Add logic and an interface to determine if a signal + can be caught or ignored. sigaction now correctly returns EINVAL on + any attempt to catch or ignore such signals (only SIGKILL for now + and only if CONFIG_SIG_DEFAULT=y). From Gregory Nutt (2018-08-28). + * configs/boardctl.c: Add support for board_app_finalinitialize() + From ligd (2018-08-28). + * configs/metro-m4/nsh/defconfig: Correct RAM size From Gregory Nutt + (2018-08-28). + * arm/armv7-r: Add general interrupt controller. This is based on + armv7-a gic controller code. + arm/armv7-r: Add invalidate dcache in arm_head.S. + arm/armv7-r: Fix some wrong configuration of program status + register. PSR_E_BIT bit should be set for big endian system. + PSR_A_BIT bis is set automatically as arm cortex-r4 reference manual + 3.7.4. So we don't need to set this bit. + arm/armv7-r: Fix some wrong MPU register definition. Change + MPU_RBAR_ADDR_MASK and MPU_RACR_TEX_SHIFT mask as arm cortex-r4 + reference manual. Region Base Address Register 0-4 bits are + reserved. MPU Region Access control register type 3-5 bits. + driver/mtd: fix compilation error. From EunBong Song (2018-08-29). + * drivers/audio/audio_i2s.c: Fix bad NULL pointer check From Juha + Niskanen (2018-08-29). + * sched/group/group_killchildren.c: In some circumstances, + group_killchildren() could have called pthread_cancel() to kill a + task. Also, the behavior would not be as expected if a pthread had + cancellation disabled. sched/signal/sig_default.c: Correct signal + handling in the multiple threaded case. The SIGKILL signal may + actually be processed on a pthread, not the main thread of the + task. From Gregory Nutt (2018-08-29). + * drivers/serial/serial_dma.c: Fix typo error in uart_recvchars_dma() + From Xiang Xiao (2018-08-29). + * net/arp/arp_out.c: Fix some backward logic in an if condition. + From Gregory Nutt (2018-08-29). + * sched/signal/sig_default.c: Lock the scheduler while while killing + the children so that we do not lose priority and let the task group + continue to run in an indeterminate state. From Gregory Nutt + (2018-08-29). + * sched/signal: This adds support for default signal actions for + SIGSTOP, SIGSTP, and SIGCONT" + Add procfs support to show stopped tasks. Add nxsig_action() to + solve a chicken and egg problem: We needed to use sigaction to set + default actions, but sigaction() would refuse to set actions if the + default actions could not be caught or ignored. + Add configuration option to selectively enabled/disable default + signal actions for SIGSTOP/SIGSTP/SIGCONT and SIGKILL/SIGINT. Fix + some compilation issues. + sched/sched: If a task/thread was already blocked when + SIGSTOP/SIGSTP was received, it will restart in the running state. + It will appear that to the task/thread that the blocked condition was + interrupt by a signal and returns the EINTR error. From Gregory + Nutt (2018-08-30). + * arch/arm/src/lpc43xx: Make WWDT usable again. LPC43xx WWDT driver + was not updated when irq_dispatch grew an argument parameter. Also + fixes two typos and a naming inconsistency (WWDT vs. WWDG). From + Jakob Haufe (2018-08-30). + * arch/arm/src/samd5e5: Updates to clock configuration from initial + testing. With these changes the boot up gets through clock + configuration but hangs in the low-level USART configuration before + completing the boot. From Gregory Nutt (2018-08-31). + * arch/arm/src/stm32f7: Add up_stackcheck.c From Daniel Agar + (2018-08-31). + * stm32h7/stm32_serial.c: don't include stm32_dma.h From raiden00pl + (2018-09-01). + * drivers/sensors/dhtxx.c: Driver for DHTxx sensor. + configs/olimex-stm32-p407: Add board support for the DHTxx sensor. + From Ouss4 (2018-09-01). + * arch/arm/src/samd5e5/sam_lowputc.c: Only the console USART was + begin enabled. From Gregory Nutt (2018-09-01). + * arch/arm/src/samd5e5: Correct some bad addresses in the memory + map. From Gregory Nutt (2018-09-01). + * configs/metro-m4: Fix RxD PAD selection. Add a configuration + option to use OSCULP32K instead of XOSC32K. From Gregory Nutt + (2018-09-01). + * configs/metro-m4: Fix RxD interrupt pin selection. The number + SERCOM interrupts do not refer to PAD numbers, but to bit positions + in the INFLAG register (very tiny footnote in the data sheet). With + with final fix, the basic NSH configuration appears fully + functional. From Gregory Nutt (2018-09-01). + * configs/metro-m4: Verify the CMCC and enable it by default in the + NSH configuration. From Gregory Nutt (2018-09-01). + * configs/metro-m4: Fix problem with SysTick timer running too fast. + This turned out to be a dumb typo in board.h that was providing the + wrong CPU frequency to the SysTick setup logic. From Gregory Nutt + (2018-09-02). + * arch/arm/src/stm32h7: Remove old references to RXDMA. Add + configuration option to select the Rx FIFO threshold level. From + Gregory Nutt (2018-09-02). + * sched/: Update signal default STOP action. If waitpid was called + with the WUNTRACED then wake up waitpid(). From Gregory Nutt + (2018-09-02). + * drivers/serial: Add support for Ctrl-Z. This works just like the + recently added Ctrl-C support except that SIGSTP is sent when the + Ctrl-Z characters is encountered vs. SIGINT. From Gregory Nutt + (2018-09-02). + * configs/b-l475e-iot01a/src: Fix copy paste errors in names: + stm32_bringup->stm32l4_bringup. Noted by Freemans Goden. From + Gregory Nutt (2018-09-04). + * configs/b-l475e-iot01a/src: Add timer driver support. From Goden + Freemans (2018-09-04). + * arch/arm/src/stm32f7: Port the low-level PM functions to STM32F7. + From Juha Niskanen (2018-09-04). + * tools/Makefile.unix: Was not cleaning up export directory if it was + left from a failed export. configs/sama5d4-ek/README.txt: Update. + From Gregory Nutt (2018-09-04). + * tools/mkexport.sh: Save the name of the STRIP tool too. From + Gregory Nutt (2018-09-04). + * arch/arm/src/stm32l4: Add getstatus and getperiod() method to the + timer driver (includes coding standard changes made prior to + commit) From Goden Freemans (2018-09-05). + * configs/: apps/netutils/ping has been removed. Ping support is now + provided by apps/system/ping. Remove references to + -CONFIG_NETUTILS_PING or change them to CONFIG_SYSTEM_PING with + CONFIG_NET_ICMP_SOCKET=y From Gregory Nutt (2018-09-05). + +7.27 2018-11-14 Gregory Nutt + + * mm/iob: Add an IOB notifier that will send a signal to any registered + threads that want to be notified when an IOB has been freed. This is an + untested work-in-progress and is intended to be a part of a larger solution + to correctly handling network poll operations. From Gregory Nutt + (2018-09-08). + * sched/signal: Add a generic signal notification facility. Modify the + custom IOB available notifier so that it is now just a wrapper around this + generic signal notification. This generic signal notification facility + will, eventually, be used to support network polling. From Gregory Nutt + (2018-09-09). + * net/tcp and udp: Add logic to signal events when TCP or UDP read-ahead + data is buffered. From Gregory Nutt (2018-09-09). + * net/netdev: Add signal notification for the case where the network goes + down. From Gregory Nutt (2018-09-09). + * sched/signal: In signal notification facility, use sigqueue() to notify + vs. kill(). With sigqueue(), we can pass more info (but still not enough). + From Gregory Nutt (2018-09-09). + * Signals were not a good choice of IPC to implement the poll function for + several reasons: In order to handle the asynchronous poll-related event, a + substantial amount of state information is needed. Signals are only capable + of passing minimal amounts of data. There are also complexities with + performing kernel space signal handlers in kernel space code that is better + to avoid. So, instead of signals, the equivalent logic was converted to run + via a callback that executes on the high-priority work queue. From Gregory + Nutt (2018-09-09). + * net/TCP: Extend the TCP notification logic logic so that it will also + report loss of connection events. From Gregory Nutt (2018-09-09). + * arch/arm/src/lpc43xx: Fix Ethernet TX_EN pin definitions. TX_EN on + LPC43xx can be routed via P0.1 and PC.4 in both MII and RMII mode. Before, + P0.1 was hard-coded for MII and PC.4 was hard-coded for RMII. Also, the + definitions used inconsistent naming (TXEN vs. TX_EN). From Jakob Haufe + (2018-09-10). + * sched/wqueue: Notifier design cleanup. The original concept used + pre-allocated notification data structures. However, the notification data + must persist for an indeterminate amount of time. So the design was + modified to use dynamically allocated data structures. This commit + simplifies the design by removed some residual 'machinery' that is no longer + needed. From Gregory Nutt (2018-09-10). + * sched/sched/sched_waitpid.c: Remove a bad error check. From Gregory Nutt + (2018-09-10). + * mm/iob and sched/semaphore: Work around some issues with the IOB throttle + semaphore. It has some odd behaviors that can cause assertions in + sem_post(). Also, it seems to get outside of its range occasionally. Need + to REVISIT this. From Gregory Nutt (2018-09-10). + * sched/wqueue: Add an option to work queue notifier so that the + notification can occur on different work queues. From Gregory Nutt + (2018-09-11). + * This patch prevent heap corruption as in below case. + + TASK A TASK B + malloc() + mm_takesemaphore() + heap holder is set to TASK B + <--- preempt + ... + task_exit() + Set to current task to + TASK B + Try to release tcb, and + stack memory + free() + mm_takesemaphore() + - Successfully obtain + semaphore because current + task and heap holder is + same. + Free memory.... + Heap corrupt. + + This change forces all de-allocations via sched_kfree() and sched_ufree() + to be delayed. Eliminating the immediate de-allocation prevents the + above problem with the the re-entrant semaphore because the deallocation + always occurs on the worker thread, never on TASK B. + + There could be consequences in the timing of memory availability. We + will see. From EunBong Song (2018-09-11). + * mm/iob: IOB free notifier should accept the work queue ID as a + parameter. The notification may need to run on either the high- or low- + priority work queue. sched/work: Change the default priority of the + low-priority work queue to 100. From Gregory Nutt (2018-09-11). + * net/tcp and net/udp: In the POLLOUT poll logic, request an immediate Tx + poll from the network device bound to the socket. This obviously cannot + work if there is not single device bound to the network device. From + Gregory Nutt (2018-09-11). + * kinetis: i2c On failed reset re-init i2c and clocking. If a reset fails, + we still must reinitializes the i2c block so that subsequent transfers will + not cause a hard-fault due to the clock being off. If that transfer fails + it can try to reset again. From David Sidrane (2018-09-11). + * net/tcp/tcp_netpoll.c: Add logic to receive notifications when IOBs are + freed (Needs CONFIG_NET_TCP_WRITE_BUFFERS and CONFIG_IOB_NOTIFIER). At + present, does nothing because the logic in in psock_tcp_cansend() does not + check for the availability of IOBs. That will change. From Gregory Nutt + (2018-09-11). + * mm/iob: iob_navail() was returning the number of free IOB chain queue + entries, not the number of free IOBs. Completely misnamed. From Gregory + Nutt (2018-09-12). + * net/tcp/tcp_netpoll.c: Add logic to receive notifications when IOBs are + freed (Needs CONFIG_NET_TCP_WRITE_BUFFERS and CONFIG_IOB_NOTIFIER). At + present, does nothing because the logic in in psock_tcp_cansend() does not + check for the availability of IOBs. That will change. + + mm/iob: iob_navail() was returning the number of free IOB chain queue + entries, not the number of free IOBs. Completely misnamed. + + net/tcp/tcp_send_buffered.c: Extend psock_tcp_cansend() so that it also + requires that at least on IOB is also available. + + net/tcp/tcp_netpoll.c: tcp_iob_work() needs to free the allocated + argument when it is finished. + + sched/wqueue/kwork_notifier.c: Redesign some data structures. struct + works_s must appear at the beginning of the notifier entry structure. + That is because it contains the work queue indexes. This solves a + hard-fault issue. From Gregory Nutt (2018-09-12). + * net/udp/udp_netpoll.c: Port TCP poll changes to UDP. From Gregory Nutt + (2018-09-12). + * tools/Config.mk: Fix an error in RWILDCARD implementation From Anthony + Merlino (2018-09-12). + * mm/iob: Add a divider that can be used to reduce the rate of IOB + notifications. From Gregory Nutt (2018-09-13). + * tools/Directories.mk: Correct the path to the installed libcxx + directory. From Gregory Nutt (2018-09-13). + * fs/smartfs/smartfs_smart.c: Current sector should have a space for next + entry size. If not, we should move to next sector. From EunBong Song + (2018-09-14). + * task/task_restart.c: Restarted with sigprocmask set. Should have been + cleared. Noted by Jeongchan Kim From Gregory Nutt (2018-09-14). + * net/usrsock: Revert commit 'net/usrsock: Optimize option dependence'. + Re-allow combination of usrsock and NuttX TCP/IP stack. For example, in + case device has Ethernet and mobile connectivity and NuttX TCP/IP stack is + used when configured to use Ethernet connection and usrsock when + configured to use modem (modem TCP/IP stack through usrsock). From Jussi + Kivilinna (2018-09-14). + * libs/libc/wqueue/work_usrthread.c: Eliminate a race condition noted by + Xiang Xiao. Use sigprocmask() so that we do not lose a signal. From + Gregory Nutt (2018-09-14). + * fs/vfs/fs_open.c: Add nx_open() which is the same as open() except that + it does not create a cancellation point nor does it modify the errno + variable. + + many locations: Change occurrences of open() followed by file_detach() to + file_open(). Change most non-controversial calls to open() to nx_open(). + + fs/inode/fs_fileopen.c: Add file_open() implementation with some interim, + placeholder logic. From Gregory Nutt (2018-09-15). + * include/nuttx/fs/fs.h: Fix some backward parameters in a new macro + definition. From Gregory Nutt (2018-09-15). + * Replace calls to ioctl() in the OS to file_ioctl() From Gregory Nutt + (2018-09-15). + * configs/stm32l4r9ai-disco/src/stm32_adc.c: Replace calls to ioctl() in + the OS to file_ioctl() From Gregory Nutt (2018-09-15). + * Rename file_close_detached() to just file_close() for better consistency + in naming. From Gregory Nutt (2018-09-15). + * fs/inode/fs_fileclose.c: Move file_close() a separate file. It no + longer makes sense for it to cohabitate with file_detach(). From Gregory + Nutt (2018-09-15). + * configs/b-l475e-iot01a/include/b-l475e-iot01a_clock.h: Correct timer + source clock frequencies. From Freemans Goden (2018-09-16). + * tools/tesbuild.sh: No longer installs and builds the NxWidgets + libraries. They are now a port of apps/. From Gregory Nutt (2018-09-16). + * I2C support for STM32H7 + + - stm32h7/chip.h: Update peripherals + - stm32h7x3xx_rcc.h: Update definitions + - stm32h7x3xx_rcc.c: Remove some unused code and configure I2C clocks + - stm32h7: add lower half I2C driver (based on F7 I2C driver) + - configs/nucleo-h743zi: Add LSM303AGR and LSM6DSL configuration + - sensors/lsm303agr.c, sensors/lsm6dsl.c: add missing include, remove + whitespace From raiden00pl (2018-09-16). + * libs/libc/math: Add variable convergence in log() and logf() to avoid + hangs caused by failure to converge for very specific input values. + + libs/libc/math: Small change to log() and logf() that improves accuracy + and convergence time From Rajan Gill (2018-09-16). + * drivers/timers: RTC_PERIODIC is no longer EXPERIMENTAL, remove + unimplemented EXPERIMENTAL RTC configuration variables. From Juha + Niskanen (2018-09-17). + * C library: Add some new functions defined in POSIX.1-2017: stpncpy(), + strsignal(), psignal(), psiginfo(). From Gregory Nutt (2018-09-17). + * libs/libc/string/lib_stpncpy.c: Correct the return pointer value for the + case where the NUL terminator is transferred. From Gregory Nutt + (2018-09-18). + * drivers/usbdev: Fix buffer overrun check in rndis.c. The RNDIS driver has + been working since 13 Nov 2017. However, I finally found that it depends + on network and buffer configurations. If a receiving TCP packet is + divided into smaller ones based on USB max packet size, this condition + check works correctly. From Masayuki Ishikawa (2018-09-20). + * - mtd/progmem: change up_progmem_npages to up_progmem_neraseblocks + + page is a unit for read/write operation. + eraseblock is a unit for erase operation. + up_progmem_npages is a little bit confusing because it returns number of + erase blocks in flash memory. This patch changes up_progmem_npages to + up_progmem_neraseblocks. There is no logical change. + + - mtd/progmem: up_progmem_erasesize. + + Change argument name to be more readable. + + - mtd/progmem: up_progmem_eraseblock + + Change up_progmem_erasepage to up_progmem_eraseblock. + eraseblock is more readable name than erasepage. + + - mtd/progmem: change up_progmem_eraseblock's return value. + + up_progmem_eraseblock erase a block. so it's better to return the erase block + size than page size. + + - arm/cortex-r : fix wrong cp15_flash_dcache. + + change mcrne to mcr for unconditional dcache. From EunBong Song (2018-09-21). + * arch/arm/src/armv7-a: Replicate the same fix was previously committed for + the armv7-r. From Gregory Nutt (2018-09-20). + * arch/arm/src/lc823450: Fix up_allocate_heap() in + lc823450_allocateheap2.c. For lc823450, heap area in flat build mode must + start just after _eronly. Because bss/data area is allocated in lower + address than text area in SRAM. See ld.scripts for details. Also, this + change removes unused up_allocateheap.c From Masayuki Ishikawa + (2018-09-21). + * arch/arm/src/stm32f7: Remove adhoc PM interfaces and add CONFIG_PM serial + suspend. From Gregory Nutt (2018-09-21). + * arch/arm/src/kinetis: Remove all attempts to reprioritize interrupts. + From Gregory Nutt (2018-09-21). + * arch/arm/src: Correct all ARMv7-M architectures. Interrupts were not be + disabled correctly on power up. Writing zero to the NVIC SET-ENABLE + registers has no effect. In order to disable interrupts, it is necessary + to write all ones to the NVIC CLEAR-ENABLE register. Noted by David + Sidrane. From Gregory Nutt (2018-09-21). + * net/tcp/tcp_recvwindow.c: In order to receive data we must not only have + IOBs available, but we must also have at least one IOB chain qentry + available. Otherwise, we will advertise that we an buffer a lot of data + when, in fact, we cannot. This is an experimental fix to a performance + problem noted by Masayuki Ishikawa. From Gregory Nutt (2018-09-22). + * fs/driver: Add support for named MTD drivers in the pseudo file system. + This will, eventually, allow us to mount file systems that need MTD + drivers without having to fake an intervening block driver. + fs/driver and fs/mount: Add mount() support for file systems that require + MTD drivers (vs. block drivers). From Gregory Nutt (2018-09-22). + * include/sys/socket.h: Renumber the socket types. They must begin at 1, + not zero. Socket type zero has a special meaning for some interfaces. For + example, getaddrinfo() uses a socket type of zero to many any type of + socket. The is no standard name for the any-type-socket, but macOS uses + SOCK_UNSPEC. NuttX will do the same. Issue noted by Anthony Merlino. + From Gregory Nutt (2018-09-24). + * Brings in an initial port of version 0.3.7 of Peter Anderson's SPIFFS + flash file system into NuttX. From Gregory Nutt (2018-09-24). + * arch/arm/src/imxrt/imxrt_enet.c: The board would not come up if I ran + Nuttx from cold. I dumped the PHY registers to see what the differences + were and the PHY was coming up in NANDTree mode. This is a mode for + testing connectivity between the PHY and the MAC. Switching this mode off + in the PHY registers has fixed the problem. From Dave Marples (2018-09-25). + * net/tcp/tcp_wrbuffer.c: Fix buffer release handling on failed buffer + alloc. Attempt to release write buffer on failed TCP write I/O buffer + alloc and tryalloc failed to wrb->wb_iob assertion. From Harri Luhtala + (2018-09-25). + * drivers/net/enc28j60.c: Adjust debug trace levels. Correct typos in some + comments. From Harri Luhtala (2018-09-25). + * A few improvements to getaddrinfo: (1) Use the protocol and socktype + hints in returned address, (2) Ignore AI_PASSIVE argument if hostname is + not NULL From Anthony Merlino (2018-09-25). + * Fixes issue with libcxx build. This was changed multiple times, but + should be fixed now. From Anthony Merlino (2018-09-25). + * include/nuttx: Fix definitions used to access OS functions within the + libraries. In the FLAT build, we must always set the errno and/or create + cancellation points because the same library functions are used within the + OS as are used by applications. This could cause issues for the OS but + corrects some problems at the user interface. Noted by Federico + Braghiroli in Bitbucket issue 121. From Gregory Nutt (2018-09-26). + * arch/arm/src/imxrt: Add LPI2C driver. From Ivan Ucherdzhiev (2018-09-26). + * arch/arm/src/imxrt/imxrt_lpsrtc.c: SVNC LPCR register bits 0 & 1 are NOT + reserved and are, in fact, needed to enabled the SRTC. Now the SRTC is + working. From Ivan Ucherdzhiev (2018-09-26). + * arch/arm/src/imxrt/imxrt_enet.c: Fix a race condition in setting up the + Ethernet Tx transfer. From Dave Marples (2018-09-26). + * arch/arm/src/lc823450: MPU support for FLAT build From Masayuki Ishikawa + (2018-09-27). + * Corrections for the i.MXRT Ethernet: + + (1) Now the Ethernet is completely re-initialized when an error occurs by + means of taking the interface down and back up but the PHY is _not_ + renegotiated for that case because that is very time consuming and an + error in the Ethernet is no reflection on the state of the PHY anyway. + (2) Explicitly sets the expected PHY address to zero (this could be moved + into the config) rather than searching for it which takes ages, and + it's zero anyway for this board (that's the broadcast address, and + anything that cannot respond on that has multiple PHYs, so that would + be a new board). + (3) Allows for the renegotiation of the PHY to be optional when a reset is + needed. If a non-renegotiated reset doesn't result in good comms to + the PHY then it'll automatically be escalated to a renegotiated one. + (4) Only performs a reset for errors that need it (the CRITICAL_ERROR + define). The list of errors that need reset are somewhat arbitrarily + chosen based on my prejudices and might need to be revisited, but + certainly the jabber errors don't need reset, the partial packet is + thrown away by the layer above anyway. + (5) Re-loads the multicast table on reset. + (6) Adds a bit more logging into the imxrt Ethernet module. From Dave + Marples (2018-09-28). + * fs/spiffs: SPIFFS is basically functional although still immature. From + Gregory Nutt (2018-09-28). + * drivers/leds/max7219.c: Support all digits presented in the MAX7219 + datasheet. From Alan Carvalho de Assis (2018-09-29). + * fs/procfs/fs_procfsproc.c: Change output of the env file so that it looks + more like output from the 'env' command. Documentation/NuttShell.html: + Document the new NSH 'env' command. From Gregory Nutt (2018-09-30). + * sched/environ/env_unsetenv.c: Fix and error in unsetenv() when unsetting + the last of the environment variables. From Gregory Nutt (2018-09-30). + * Documentation/NuttShell.html: Update document to describe the 'export' + command, the CONFIG_NSH_VARS setting, and the effect of this setting on + the behavior of the 'set' and 'unset' commands. Add description of the + PATH environment variable. From Gregory Nutt (2018-10-01). + * EFM32, STM32 (FS/HS), STM32F7, and STM32L4 OTGFS/HS: Th epin_configure() + function used the same eptype as the TxFIFO number for all endpoints. + This should probably be the physical EP number, not the EP type. + Suggested by Key Two. From Gregory Nutt (2018-10-02). + * libs/libc/stdio/lib_sscanf.c: Fix conversion for format specifiers that + appear right after a floating point format specifier. When performing a + floating point conversion the parsing code could consume more than + required characters from the input buffer. This made impossible to convert + input of form "1.1K" using format "%f%c". Fix the issue by advancing the + input buffer with the actual characters converted as a float point + number. From Mihai Serban (2018-10-03). + * stm32h7/rcc: update rcc defs, add SPI clock configuration and some fixes + in rcc + stm32h7: initial defs for SPI + stm32h7: initial defs for MDMA, DMA, BDMA and DMAMUX + From raiden00pl (2018-10-04). + * stm32_tim.c: don't use hard-coded UIF interrupt in some functions From + raiden00pl (2018-10-04). + * configs: add support for nucleo-f302r8 board From raiden00pl (2018-10-05). + * libs/libc/stdio: Remove CONFIG_NOPRINTF_FIELDWIDTH. That option does, + indeed, make the printf family of functions much smaller. But it also + adds a lot of complexity and makes the functions non-standard. Removing + this might break some of the tinier platforms but it is the best thing to + do for long term maintenance for for OpenGroup.org compliance. + + libs/libc/stdio/lib_libvsprintf.c: Resolves the integer field width + problem if Issue 35 for the cases of integer, long and long long integer + types. The output now matches the output form glibc. From Gregory Nutt + (2018-10-05). + * configs/olimex-stm32-p407: Added a HID keyboard configuration. From + Gregory Nutt (2018-10-06). + * configs/olimex-lpc1766stk: Add support to initialize a USB HID keyboard. + Still don't have a working configuration. Seems to require a lot of + transfer descriptors. Also reorganized some logic. It has been a long + time since the Olimex LPC1766-STK has had any TLC. + + configs/olimex-lpc1766stk/hidkbd: Add a configuration for testing the HID + keyboard. From Gregory Nutt (2018-10-06). + * drivers/wireless/ieee802.11: Add capability for Broadcom chips to get + firmware and CLM data from a mounted file system vs. in-memory data + structures. From Ramtin Amin (2018-10-07). + * drivers/wireless/ieee802.11: Extend Add capability to get firmware from a + mounted file system to BCM43362. From Gregory Nutt (2018-10-07). + * arch/arm/src/stm32f7/stm32_serial.c: Force invalidation of data cache + after DMA re-enable when returning from low-power mode From Juha Niskanen + (2018-10-09). + * stm32f0, stm32f7, stm32h7, stm32l4 serial: Fix use of + CONFIG_SERIAL_IFLOWCONTROL where CONFIG_SERIAL_OFLOWCONTROL was intended. + From Juha Niskanen (2018-10-10). + * EFM32, Kinetis, BCM2708: Juha Niskanen's fix related to + CONFIG_SERIAL_OFLOWCONTROL also applies to cloned logic in BCM2708, EFM32, + and Kinetis. From Gregory Nutt (2018-10-10). + * arch/mips/include/mips32/cp0.h: Fix some copy-paste errors that cause + malformed comments and syntax errors when certain CP0 CONFIG1 bits are + referenced. Note in Issue 123 by Anonymous. From Gregory Nutt + (2018-10-12). + * arch/arm/src/lpc43xx/lpc43_serial.c: Fix copy-paste error: + g_usart1port->g_uart1port. From Dave Marples (2018-10-12). + * arch/arm/src/imxrt/imxrt_lpi2c.c: Fixes 2 bugs in the for IMXRT1050: (1) + I2C time out and did not send STOP condition when sending single byte, (2) + I2C could not receive bytes after repeated start. From Ivan Ucherdzhiev + (2018-10-13). + * Improvements in STM32 PWM low level driver + + stm32_pwm: remove some impossible PWM configurations + stm32_pwm: support for complementary outputs + stm32_pwm: deadtime configuration + stm32_pwm: output polarity and IDLE state configuration + + nucleo-f302r8: pwm support + stm32f429i-disco: pwm support From Mateusz Szafoni (2018-10-14). + * stm32_pwm: break and lock configuration and some cosmetics From Mateusz + Szafoni (2018-10-15). + * arch/mips/src/pic32mz/pic32mz-serial.c: Fix a typo in assignment of TTYS0 + to UART6 From Ouss4 (2018-10-15). + * arch/mips/src/pic32mz/pic32mz-head.S: Initialize the global pointer in + all shadow sets. From Ouss4 (2018-10-16). + * arch/mips/src/mips32/Toolchain.defs: Add toolchain flags for the pinguino + toolchain under Linux. From Ouss4 (2018-10-16). + * configs/pcblogic-pic32mx: Remove support for the PCB Logic PIC32MX + board. I do not find any references to PCB Logic on the web and I do not + believe that this breakout board is available any longer. From Gregory + Nutt (2018-10-17). + * drivers/mtd: Add support to Macronix MX25LF25635F serial NOR flash From + David Sidrane (2018-10-17). + * drivers/mtd/s25fl1.c: During a MTDIOC_GEOMETRY ioctl call, the driver was + incorrectly reporting the blocksize to be the same as the erasesize. The + blocksize should be 256 (the page size). This patch fixes that, and now + the SmartFS configration is working. From Ken Pettit (2018-10-18). + * configs/bambino-200e/include/board.h: Correct calculation of SDMMC clock + configuration. The LPC43 has no SDMMC source clock divider. Error noted + by Dave Marples. From Gregory Nutt (2018-10-18). + * stm32 enable separate DMA per SPI configuration From Daniel Agar + (2018-10-18). + * drivers/sensors/ina226.c: Add INA226 device driver. From Daniel P. + Carvalho (2018-10-19). + * configs/lpcxpresso-lpc54628/include/board.h: Update logic used to + calculate SDMMC input clock divider. From Gregory Nutt (2018-10-21). + * Fix the LPC4330 family SDMMC card access. Some of these fixes (e.g. DELAY + register) may also be applicable elsewhere. These are _NOT_ extensively + tested, but they are certainly better than the current state of the + driver. The fixes, specifically, are; + + - Clocks were wrongly configured - way too fast because there is no + primary divider on LPC4330 + + This is fixed by means of changing the definitions in the board.h file. + I've edited the one for the lpc4330-xplorer board because I'm actually + working with Versiboard and don't want to contribute that config just + yet while I've still got the drains up on it. + + - The LPC43_SDMMC_DELAY register was not being set + + I suspect, in the 'real world', it's possible to get away without + setting this, but I've added a register definition, default value and + register access macros into arch/arm/src/lpc43xx/chip/lpc43_scu.h and + then used them in arch/arm/src/lpc43xx/lpc43_sdmmc.c. + + - The LPC43_SDMMC_BLKSIZ and LPC43_SDMMC_BYTECNT registers had the wrong + values. + + The management have already implemented a rather nice block level + interface for the stm32 so I've just re-used that to write to these + registers as required. I'm slightly nervous that accessing the + configuration registers (SCR being the prime example) which has a much + smaller block size may not be being done in the right way but it does + seem to work correctly, so let's assume it's all OK until someone tells + me otherwise. + + These fixes have been tested with DMA-based read/write on a LPC4330. Speed + via nsh is pretty low but I'm assuming that's just a + buffering/implementation issue for now. From Dave Marples (2018-10-21). + * arch/arm/src/lpc54/lpc54_sdmmc: Port Dave Marple's LPC43 USB DCD fix to + the LPC54 with appropriate naming changes. From Gregory Nutt (2018-10-21). + * arch/arm/src/stm32f7/stm32_flash.c: Allow programming OTP blocks through + progmem interface From Jussi Kivilinna (2018-10-22). + * arch/arm/src/lpc54xx/lpc54_sdmmc.c: Tested Dave Marple's LPC43 fix with + the LPC54. The driver still does not work on the LPC54. This commit adds + support for and SDMMC errata and setting of the delay register which was + missing in the previous commit. It appears that now I can read the SD + card successfully, but I get CRC errors when writing to the card. From + Gregory Nutt (2018-10-22). + * arch/arm/src/lpc43xx/lpc43_sdmmc.c: This commit corrects a problem in + lpc43_dmasendsetup(). There was no linked DMA descriptor code on the send + side. The end result was stalls while sending multiple sectors. This + commit adds that in and the send code is working much better. From Dave + Marples (2018-10-23). + * arch/arm/src/lpc54xx/lpc54_sdmmc.c: This commit ports Dave Marple's DMA + fix for the LPC43 SD/MMC to the LPC54. From Gregory Nutt (2018-10-23). + * - imxrt: Fix typos bit# and names + - imxrt: wdog Registers are 16 Bits + - imxrt: wdog Update has to be within 255 clocks of unlock + - imxrt: clockconfig Fix comments + - imxrt1050-evk: board.h Fix comments + - imxrt: imxrt_ccm.h Define Mux Selects for board.h use + - imxrt: clockconfig Allow better control from board.h + + 1) Allows a board config clock setting to be defined + in terms of the /n values shown in Figure 18-2. + Clock Tree of the i.MX RT1050 Processor Reference + Manual, Rev. 1, 03/2018 + 2) Allows the clock multiplex selection to be made in + The board config. + + - imxrt1050-evk: Define board clocking based on divisor and muxes + From David Sidrane (2018-10-23). + * nuttx/drivers/usbdev/rndis.c: Account for CONFIG_NET_GUARDSIZE in + allocation of packet buffer + nuttx/drivers/usbdev/rndis.c: Make USB device parameters configurable + From Sakari Kapanen (2018-10-24). + * nuttx/net/tcp/tcp_input.c: Fix recovery when ackseq > unackseq. The + comment near this line says "reset the number of outstanding, + unacknowledged bytes". However, the code actually resets the whole TCP + connection. It was changed to the current form in commit f034d84ea1f with + no explanation of the intent. Recover the line to what it was before that + commit. From Sakari Kapanen (2018-10-24). + * libs/libc: Correct some errors in psignal() and stpncpy(). From Lokesh B + V (2018-10-24). + * configs/nucleo-l432kc/include/board.h: Fix SPI pin definitions. From + Daniel P. Carvalho (2018-10-24). + * With these changes the SDMMC card for LPC4330 is now working properly BUT + it needs more testing, especially with different cards etc. This code + should be applicable to all members of the lpc43xx family. + + In addition to the problems that were previously identified there were a + few other bits and pieces outstanding; + + - Timing was dependent on CPU speed rather than absolute time + - End of transfer handling was a bit mixed up + - It's possible for data to still be in the FIFO (i.e. not have reached + the card) when a next write is requested, so we need to wait for that to + complete + - Interrupt Status could be carried over from one transfer episode to the + next, corrupting progress + - Multi-descriptor DMA writing simply wasn't implemented, but there were no + indications ... it just failed silently From Dave Marples (2018-10-24). + * arch/arm/src/lpc54xx/lpc54_sdmmc.c: Ported the last of Dave Marples fixes + to the LPC54. Not yet verified. From Gregory Nutt (2018-10-24). + * drivers/wireless/ieee80211/bcmf_core.c: There were two functions that + have a address issue. In bcmf_read_sbreg and bcmf_write_sbreg, + SBSDIO_SB_OFT_ADDR_MASK should be used before map address space. Noted by + Shao Li in Bitbucket issue #126. From Gregory Nutt (2018-10-25). + * configs/nucleo-l432kc: Added support for AT45DB Serial Flash From Daniel + P. Carvalho (2018-10-25). + * drivers/wireless/ieee80211/bcmf_sdpcm.c: Remove incorrect OR condition. + Always true, would always cause allocation failure. Noted by Shao Li in + Issue 127. From Gregory Nutt (2018-10-26). + * arch/x86/src/qemu/qemu_head.S: Correct .bss, IDLE stack, heap + organization. From Gregory Nutt (2018-10-26). + * net/sixlowpan: Fixes bug in uncompress_addr handling of odd postfix. This + affected multicast compress/uncompress since it's the only logic that used + an odd postfix. The odd byte needs to be handled first, not last. From + Anthony Merlino (2018-10-27). + * Fixes logic in ipv6_input to handle more than ff02::/16 multicast + addresses. Don't forward mcast packets if scope is not appropriate From + Anthony Merlino (2018-10-27). + * Adds extern "C" guard in include/net/if.h From Anthony Merlino + (2018-10-27). + * Adds definitions for IPPROTO_IPV6 socket options to netinet/in.h Adds + missing fields to sockaddr_in6. Adds struct ipv6-mreq. These changes all + follow the opengroup standard for netinet/in.h From Anthony Merlino + (2018-10-27). + * include/sys/socket.h: With increased size of struct sockaddr_in6 of + commit 55f31f03f9cca55b8b94ebf31cef3f501d8d76cf, the size of struct + sockaddr_storage in include/sys/socket.h must also be increase so that it + can contain the new, larger sockaddr_in6. From Gregory Nutt (2018-10-27). + * libs/libc/misc/lib_crc8ccitt.c: Adds implementation of CRC8-CCITT. From + Alan Carvalho de Assis (2018-10-27). + * Add basic SPI support for H7 + + - stm32h7: basic SPI support (nodma, noirq) + - nucleo-h743zi: nrf24l01 support + - nrf24l01.c: fix compilation errors + - stm32h7x3xx_rcc.c: enable SYSCFG clock From Mateusz Szafoni (2018-10-28). + * arch/arm/stm32: add support for STM32F303xD/E; configs: add basic support + for nucleo-f303ze From Mateusz Szafoni (2018-10-28). + * include/netinet/in.h: Per OpenGroup.org, type of sin_port in struct + sockaddr_in must be in_port_t vs uint16_t. NOTE: in_port_t is typdef'ed + as uint16_t anyway. Plus additional cosmetic changes for things like long + lines. From Gregory Nutt (2018-10-28). + * include/netinet/in.h: Add IPv4 SOL_IP socket options for symmetry with + IPv6 definitions added in a previous commit. None of the socket options + have been implemented! From Gregory Nutt (2018-10-28). + * include/netinet/in.h: Add other definitions required by OpenGroup.org. + From Gregory Nutt (2018-10-28). + * drivers/sensors/mlx90614.c: Add support for the Infrared Thermometer + MLX90614 From Alan Carvalho de Assis (2018-10-28). + * configs/stm32f4discovery/src/stm32_mlx90614.c: Add MLX90614 support for + the STM32F4Discovery board From Alan Carvalho de Assis (2018-10-28). + * include/sys/sockio.h, net/netdev/netdev_ioctl.c: Fix a recently compile + error introduced with commit that added the semi-standard ip_msfilter + structure to netinet/in.h. However, there was a non-standard version of + that structure in sys/sockio.h. This commit removes the non-standard + version of struct ip_msfilter and adapts the IOCTL and device lookup logic + in net/netdev to work with the new, semi-standard version in + netinet/in.h. From Gregory Nutt (2018-10-29). + * This commit brings in support for the GAP8 architecture. The GAP8 is a + 1+8-core DSP-like RISC-V MCU. Also included is support for the Gapuino + GAP8 evaluation board. From hhuysqt (2018-10-30). + * Fixes Kconfig options to include all STM32F20XX processors, not just + STM32F207 + + - arch/arm/src/stm32: Fixes Kconfig options to include all STM32F20XX + processors, not just STM32F207 + - arch/arm/src/stm32: Removes redundant STM32_STM32F429 depends from + Kconfig. STM32F4XXX already does this + + From Anthony Merlino (2018-10-31). + * include/nuttx/net/mld.h: Add MLD header file based on RFC2710 and + RFC3810. From Gregory Nutt (2018-10-31). + * arch/arm/src/imxrt: Add full support for the LPSPI in poll mode; includes + a minor fix for LPI2C. From Gregory Nutt (2018-10-31). + * net/mld: Add basic build structure for Multicast Listener Discovery + (MLD). No yet functional. From Gregory Nutt (2018-10-31). + * Add new configuration CONFIG_NET_MCASTGROUP. This option is selected + automatically if either CONFIG_NET_IGMP or CONFIG_NET_MLD are selected. + Most conditional logic based on CONFIG_NET_IGMP replaced with conditioning + on CONFIG_NET_MCASTGROUP. From Gregory Nutt (2018-10-31). + * net/inet: Add framework to support IPv4 and IPv6 protocol socket options + (i.e., SOL_IP and SOL_IP6). Handling of these socket options is a + necessary step on the way to future ICMPv6 MLD support. From Gregory Nutt + (2018-10-31). + * net/inet/ipv4_setsockopt.c: Add implementation for all IPv4 socket + options that have implemented IOCTL command counterparts. From Gregory + Nutt (2018-10-31). + * configs/imxrt1050-evk/src: Previous committed implemented atypical + SPI-based MMC/SD card support conditioned on CONFIG_MMCSD. This is, of + course, incorrect and interferes with the implementation of correct MMC/SD + card support using the correct SDIO-based peripheral. This commit renames + that atypical support to *mmcsd_spi* and conditions using that atypical + support on CONFIG_MMCSD_SPI with should then not interfere with the + correct MMC/SD support that can be conditioned on CONFIG_MMCSD_SDIO. From + Gregory Nutt (2018-10-31). + * arch/arm/src/imxrt/imxrt_usdhc.c: Initial commit of the i.MXRT SDHC + driver. This driver is partially functional, working in PIO mode. DMA + support and additional testing are needed. From Dave Marples (2018-10-31). + * This change is needed specifically for the case where a boot loader sets + the SPE bit before starting NuttX. In that case, the test in the SPI + driver is bogus. This change fixes that by assuring that NuttX has booted + and initialized at least once (whether or not SPE is set) before the + driver starts refusing to initialize. + + arch/arm/stm32*: Don't rely on SPI_CR1_SPE to determine if peripheral has + been initialized yet. From Anthony Merlino (2018-11-01). + * Xbee getset txpwr + + - drivers/wireless/ieee802154/xbee: Minor improvements to debug facilities. + - drivers/wireless/ieee802154/xbee: Add support for setting/getting tx + power. + + From Anthony Merlino (2018-11-01). + * net/mld: Initialize implementation of MLD. From Gregory Nutt (2018-11-01). + * include/nuttx/net/ipv6ext.h: Create header file with all of the + definitions of IPv6 extension headers that I could find. + net/mld/mld_send.c: Correct the size and format of the Hop-to-hop, Router + alert extension header. From Gregory Nutt (2018-11-01). + * drivers/sensors/mlx90614.c: Fix MLX90614 to re-flash new device address + From Alan Carvalho de Assis (2018-11-02). + * net/inet/ipv6_setsockopt.c: Implement the IPV6_JOIN_GROUP and + IPV6_LEAVE_GROUP socket options. + + net/devif/ipv6_input.c and net/icmpv6/icmpv6_input.c: Add logic to skip + over the variable number of IPv6 extension headers that may be present + between the IPv6 header and the transport layer header. The extension + headers are simply ignored. This is necessary because with MLD, certain + incoming messages may have, at a minimum, a Router Alert Hop-by-hop + extension header. + + net/devif, net/tcp, and net/udp: Extend so that all support Transport + protocols supported by IPv6 can handle the presence of IPv6 header + extension options. From Gregory Nutt (2018-11-02). + * net/mld: Updates from comparison with roughly leveraged code and the MDL + RFCs 2710 and 3810. + + net/mld: Defer all timeout-related operations to the work queue vs. + handling within the timer interrupt. Need to notify the device driver for + an immediate poll when there are MLD packets waiting to be sent. From + Gregory Nutt (2018-11-03). + * net/igmp: Backport some MLD design improvements/fixes. From Gregory Nutt + (2018-11-04). + * net/mld: Implement MLDv1 compatibility mode. This completes coding of + MLD. MLD is, however, still completely untested. From Gregory Nutt + (2018-11-04). + * net/mld: Fix some compile errors fill debug info is enabled. Fix some + errors in formatting the Listener report. Still has a checksum error. + From Gregory Nutt (2018-11-04). + * tools/configure.c: Add missing '\n' in printf statement + + tools/configure.c: Add missed -g option to getopt() string + + tools/configure.c and tools/configure.sh: Fix Windows native pre-build + kconfig-conf incompatibility. Looks like pre-built Windows native + kconfig-conf interprets "..\apps" as "..apps" (possibly '\a' as + escape-sequence) so expand winnative path to double-backslashed variant + "..\\apps". + + tools/mkdeps.c: Fix '\0' missing in MinGW. Implicit bug. There are 2 + cases. + + 1. Under Linux. The code works as planned: '\n' is always replaced with + '\0' due to sprintf fills n-1 bytes and reaches buffer length limit. + + 2. Under Windows/MinGW. There is memory corruption. Seems like it`s a bug + inside MinGW/snprintf. Snprintf fills consecutively "oldbase",' + ',"str",'\n', but does not inserts trailing '\0' instead of '\n'. And + when next append() occurs, strlen() returns garbage-appended "oldbase". + + So the fix just removes '\n' and reserves space for '\0'. + + tools/link.bat: Fix .fakelink creation + + configs/Makefile and tools/Config.mk: Move single file copy to the new + function COPYFILE. This fixes the Windows native build case when there is + no cp or cp does not recognize Windows paths. From Anatol Ivanov + (2018-11-05). + * configs/nucleo-l432kc: Add support for the INA226. From Daniel P. + Carvalho (2018-11-05). + * tools/Config.mk and tools/Makefile.win: Force use 'cmd' for shell with + windows native build From Anatol Ivanov (2018-11-06). + * tools/Makefile.win/unix: Staging directory (and its libraries) should be + removed on 'make clean' (issue noted by Dave Marples). From Gregory Nutt + (2018-11-06). + * net/procfs: Add support to provide MLD stats at /proc/net/mld. net/mld: + Fix a couple more bugs found in further MLD testing. From Gregory Nutt + (2018-11-06). + * Adding imxrt 106x + + - imxrt: Fix comment in imxrt105x_memorymap + - imxrt: Add imxrt1060 memory map + - imxrt: Add imcrt106x to imxrt_memorymap + - imxrt: Add i.MX RT 106x to Kconfig + - imxrt: Moved IMXRT_GPIO_NPORTS to chip.h & fixed comments + - imxrt: 105x IRQ fix comment + - imxrt: gpioirq GPIO4,5 using wrong boundary + - imxrt: Add RT106x irq headers & Kconfig + - imxrt: Add rt106x GPIO chip headers + - imxrt: Extend Number of GPIO ports + - imxrt: Add 106x DMAMUX header + - imxrt: iomuxc add 106x + - imxrt: 106x iomuxc extend Indexes + - imxrt: pinmux Add 106x + - imxrt: clockconfig use imxrt_memorymap.h + - imxrt: allocateheap use OCRAM2 as BASE when available + + From David Sidrane (2018-11-06). + * net/mld: Implement 'Other Querier Present Timer'. This timer is used to + revert to Querier mode if there is no other querier on the network. Also, + fix some naming: The Done message is not just Version 1 but is used with + Version 2 as well. From Gregory Nutt (2018-11-07). + * Reported by Anonymous in Bitbucket Issue #129: When MIPS port is built + for microMIPS and then loaded as an application, the __start entry point + is entered in microMIPS mode, but the CPU core initialization code there + misses to set the config3ISAOnExc bit to 1. Subsequently, exceptions are + entered in MIPS32 mode, but the code base was built for microMIPS. From + Gregory Nutt (2018-11-07). + * sched/group/group_foreachchild.c: group_foreachchild iterate by reverse + order since the callback(e.g. group_killchildren) may remove the tcb from + list + + sched Kconfig and sched/task/exit.c: Add SCHED_EXIT_KILL_CHILDREN option + to kill all child threads when the main thread of a task exits. From + zhangyuan7 (2018-11-08). + * binfmt/ and libs/libc: Make exepath_*() more common: + + 1. Move exepath_*() related code to libc/misc + 2. Rename exepath_ to envpath_ + 3. Rename BINFMT_EXEPATH to LIB_ENVPATH + + libs/libc/modlib: Add pre module library symbol table support. + From nchao (2018-11-08). + * tools/csvparser.h: Extend MAX_PARMSIZE to 256. Fixes this issue: 70: + Parameter too long: ... From Xiang Xiao (2018-11-08). + * sched/signal/sig_suspend.c: sigsuspend() shouldn't eat the pending signal + but dispatch all instead From Xiang Xiao (2018-11-08). + * sched/signal and syscall/: Add support for pselect() and ppoll() + functions From dongjianli (2018-11-08). + * fs/aio, libs/libc/aio, sched/mqueue, sched/timer, and sched/signal: + Remove the code duplication for SIGEV_THREAD. From Xiang Xiao (2018-11-08). + * drivers/ioexpander: Support multiple registrations of GPIO signal + events. From Xiang Xiao (2018-11-08). + * libs/libc/netdb/lib_dnsbind.c: Make DNS receive timeout configurable. + From ligd (2018-11-08). + * libs/libc/string/lib_memrchr.c: Add memrchr() function From Xiang Xiao + (2018-11-08). + * libs/libc/stdio/lib_libvsprintf.c: Eliminate recursive in conversion + functions of lib_vsprintf(). From Xiang Xiao (2018-11-08). + * fs/partition: Try MTDIOC_GEOMETRY IOCTL before bops's geometry + fs/driver/fs_blockpartition.c: Support MTD IOCTL From Xiang Xiao + (2018-11-08). + * drivers/mtd and other MTD drivers: Remove mtd_procfsoperations since we + can now get the same information from inode From Xiang Xiao (2018-11-08). + * fs/mount/fs_mount.c mount: Add support for mounting a file system with + either a block or an MTD driver. From Xiang Xiao (2018-11-08). + * fd/dirent, fs/driver/, and fs/vfs: Make MTD device accessible via a + character driver proxy like block devices From Xiang Xiao (2018-11-08). + * fs/driver: Add register_mtdpartition() for MTD partition From Xiang Xiao + (2018-11-08). + * fs/procfs: Add /proc/version support to get version info From iuhaitao + (2018-11-08). + * drivers/serial/uart_16550.c: Fox UART flow control issue. UART_MCR_RTS + need be high even UART_MCR_AFCE is enabled From zhangyuan7 (2018-11-08). + * drivers/serial/uart_16550.c: Remove disabling of interrupts in + up_earlyserialinit. up_irqinitialize() already disable all interrupts + From ligd (2018-11-08). + * drivers/timers/arch_alarm.c: Fix alarm ISR error when no + CONFIG_SCHED_TICKLESS + drivers/timers/arch_alarm.c: Use uint64_t to avoid alarm 32-bit overflow + From ligd (2018-11-08). + * drivers/timers: Simplify the error handling in arch rtc/alarm/timer + wrapper From Xiang Xiao (2018-11-08). + * imxrt:Clock config fixes and board.h sets sources and divisors + + - imxrt:clockconfig bug fix & Board config set clocks + + Fixed logic that was not clearing bits as ~ was + missing in &= mask operations. + + Use values from the board.h file so set the Mux that + selects the clock sources. + + Use board defined PODF values to select clock. + + Only configure USDHC2 clocks when board defines clocks. + + - imxrt1050-evk: Board setting used to set LSPI and USDHC Clocks + From David Sidrane (2018-11-09). + * NuttX: Add DFU Runtime driver for activating boot-loader through USB + command. From Petteri Aimonen (2018-10-31). + * NuttX: USB Composite and DFU drivers: Add support for Microsoft OS + descriptors. + + These Microsoft-only descriptors help in loading the correct driver on + Windows. They are especially helpful to give libusb access to a custom + device without having to manually configure/install WinUSB driver. + + With this change DFU interface works automatically on Windows 10 with + dfu-util 0.9 and libusb 1.0.22. On Windows 7 it still appears to need + driver installation. From Petteri Aimonen (2018-11-02). + * NuttX: STM32F407VG has only one DAC. NDAC=2 causes compilation error when + trying to use e.g. STM32_DAC1_CR macro. From Petteri Aimonen (2018-11-09). + * RNDIS composite support + + - NuttX usb/composite.h: Forward-declare composite_devdesc_s. + + This avoids "error: conflicting types for 'composite_initialize'" + on some versions of GCC. Because of the cross-inclusion between + usbdev.h and composite.h, the full declaration is not always + available. + + - NuttX: USB Composite driver: Fix strid comparison + + The last string ID used by composite driver is 4, and + the number of IDs used is 5 (0..4). The comparison + strid <= COMPOSITE_NSTRIDS caused composite driver to + reply with -EINVAL for id 5, even though it should be + available for sub-devices to use. + + - NuttX: RNDIS USB driver: Add support for composite configuration. + From Petteri Aimonen (2018-11-09). + * FAT improvements + + - NuttX: Add CONFIG_FAT_LFN_ALIAS_HASH to speed up creating long filenames. + + Long filenames on FAT file systems have associated 8.3 character alias + short filenames. The traditional form of these is FILENA~1.EXT with + a running count of the number of similar names. However creating this + unique count can take several seconds if there are many similarly named + files in the directory. Enabling FAT_LFN_ALIAS_HASH uses an alternative + format of FI0123~1.TXT where the four digits are a hash of the original + filename. This method is similar to what is used by Windows 2000 and + later. + + - NuttX: Add CONFIG_FAT_LFN_ALIAS_TRAILCHARS alternative format for 8.3 + filenames. + + Traditional format for long filename 8.3 aliases takes first 6 + characters of long filename. If this option is set to N > 0, + NuttX will instead take first 6-N and last N characters to form + the short name. This is useful for filenames like "datafile12.txt" + where the first characters would always remain the same. + + - NuttX: FAT32: Fix file date corruption in fat_truncate(). + + - NuttX: if SD card wait seems to be a long one, give time for other + threads to run. From Petteri Aimonen (2018-11-09). + * max11802: Fix compilation errors and allow setting PULL and SAMPLE + registers. From Petteri Aimonen (2018-11-09). + * imxrt Add imxrt1060-evk + + - imxrt1050-evk: Fix typo + - imxrt1050-evk: Use naming for flash types that match documentation + - imxrt1050-evk: Fix typo + - imxrt:Add imxrt1060-evk board support + + From David Sidrane (2018-11-09). + * drivers/rwbuffer.c: Fix a lock issue From Xiang Xiao (2018-11-09). + * rivers/rwbuffer.c: Don't queue work to flush write buffer if + CONFIG_DRVR_WRDELAY == 0 From Xiang Xiao (2018-11-09). + * drivers/rwbuffer.c: Improve the rwb_read/write overlap performance From + zhuyanlin (2018-11-09). + * drivers/mtd/ftl.c: Support BIOC_FLUSH ioctl From Xiang Xiao (2018-11-09). + * drivers/mtd/ftl.c: Make READAHEAD and WRITEBUFFER work independently of + each other. There have cases we use writebuffer but not readbuffer, so + the write buffer must be flushed before read. Let rwb driver do it. From + zhuyanlin (2018-11-09). + * drivers/mtd/ftl.c: Allocate eblock only when it's really needed From + Xiang Xiao (2018-11-09). + * drivers/mtd/ftl.c: Add support support unlink operation to avoid the + memory leak From Xiang Xiao (2018-11-09). + * drivers/mtd/mtd_partition.c: Remove the hard code partition name length + From Xiang Xiao (2018-11-09). + * drivers/syslog/vsyslog.c: nx_syslog's return value should include the + timestamp length From Xiang Xiao (2018-11-09). + * drivers/syslog/syslog_flush.c: Uncomment the g_syslog_channel->sc_flush + call From Xiang Xiao (2018-11-09). + * drivers/syslog/syslog_putc.c: Call sc_force in idle task even interrupt + buffer enabled. The following cases may hang randomly in the bring up + phase: (1) boot up process and (2) suspend/resume process. Either case + runs in the idle task context, so it's difficult to debug the hang issue + if these output go through the interrupt buffer. From Xiang Xiao + (2018-11-09). + * drivers/syslog: Ensure interrupt log doesn't interlace in normal log. + Don't call syslog_putc in syslog_default_write because syslog_putc will + try to empty the interrupt buffer every time. From Xiang Xiao (2018-11-09). + * drivers/syslog: syslog_initialize initialize dev/syslog too and call + syslog to add the prefix and timestamp From Xiang Xiao (2018-11-09). + * include/netdb.h Add NO_ADDRESS definition From zhangyuan7 (2018-11-09). + * Fix typographical error in endian.h and resource.h From anchao + (2018-11-09). + * Fixes warnings from header files: + + - include/nuttx/clock.h: Fix uptime wrong if DEBUG_FEATURES and + SCHED_TICKLESS enabled + - iinclude/nuttx/arch.h: fix CONFIG_ARCH_INTERRUPTSTACK not defined warning + - iinclude/nuttx/audio/audio_i2s.h: Fix warning: struct i2s_dev_s declared + inside parameter list + + From Xiang Xiao (2018-11-09). + * arch/sim/src/up_hostfs.c: Support S_IFSOCK, DT_LNK, O_DIRECT and O_SYNC + From Xiang Xiao (2018-11-09). + * sched/wdog: improve accuracy of wd_gettime() in tickless mode From ligd + (2018-11-09). + * sched/wdog: Improve accuracy of wd_gettime() in tickless mode From ligd + (2018-11-09). + * include/nuttx/fs/fs.h: Register_mtddriver should depend on CONFIG_MTD not + CONFIG_MTD_PARTITION From Xiang Xiao (2018-11-09). + * drivers/net/lan91c111.c: Reuse lan91c111_reply for ARP case From Xiang + Xiao (2018-11-09). + * drivers/net/slip.c: Add IPv6 support and fix minor issue From Xiang Xiao + (2018-11-09). + * drivers/net/tun.c: Call ipv[4|6]_input dynamically by checking packet + header and remove the code duplication From Xiang Xiao (2018-11-09). + * arch/arm/src/stm32l4: Add initial support for STM32L412 and STM32L422 + chips From Juha Niskanen (2018-11-09). + * Remove deletion of Eclipse project files from make distclean target per + request of David Sidrane. From Gregory Nutt (2018-11-09). + * net/udp/udp_finddev.c: Fallback to netdev_default device if the device is + not found, rather than arbitrary using the device at the head of the list + of devices. From Xiang Xiao (2018-11-09). + * Fix compiler error and warning when CONFIG_NET_SENDFILE=y From Xiang Xiao + (2018-11-09). + * net/tcp/tcp_backlog.c: Add SOMAXCONN definition and implementation per + OpenGroup.org. From zhangyuan7 (2018-11-09). + * net/arp and net/icmpv6: don't call d_txavail directly since it may point + to NULL From Xiang Xiao (2018-11-09). + * net/: Add NET_ICMP[v6]_NO_STACK for usrsock case From Xiang Xiao + (2018-11-09). + * net/usrsock/usrsock_accept.c: Mark newconn ready before issue accept + request to avoid the event get discarded due to the socket in the invalid + state From Xiang Xiao (2018-11-09). + * libs/libc/net: Add basic implementation for recvmsg() and sendmsg() per + OpenGroup.org specification. From ligd (2018-11-09). + * include/netinet/in.h: Add Linux IP_PKTINFO and IPV6_PKTINFO definitions, + but not yet realized. From Gregory Nutt (2018-11-09). + * include/net and include/sys: Align the constant values with values in the + Linux kernel which makes targeting the usrsock server to Linux kernel + easier. From Xiang Xiao (2018-11-09). + * include/arpa/inet.h: Remove the dup INET[6]_ADDRSTRLEN from arpa.inet.h + already define in netinet/in.h From Xiang Xiao (2018-11-09). + * net/arp: Redesign ARP table aging to simplify the net initialization From + Xiang Xiao (2018-11-09). + * net/arp/arp_send.c: Check ifname match before sending packet. From Xiang + Xiao (2018-11-09). + * Remove duplicate definition in nuttx/net/arp.h and + include/nuttx/net/ioctl.h From Xiang Xiao (2018-11-09). + * net/: Remove the unnecessary arp.h inclusion From Xiang Xiao (2018-11-09). + * net/neighbor: Simplify the neighbor table aging process From Xiang Xiao + (2018-11-09). + * net/neighbor/neighbor_dumpentry.c: Simplify neighbor_dumpentry() + implementation From Xiang Xiao (2018-11-09). + * net/neighbor: neighbor_lookup() checks if the target IP belongs to one of + the local network devices. From Xiang Xiao (2018-11-09). + * net/neighbor: Support neighbor_out() for multiple link layer at the same + time From Xiang Xiao (2018-11-09). + * net/: Fix some compile errors introduce with recent networking patches. + Found in build testing. From Gregory Nutt (2018-11-09). + * net/icmpv6/icmpv6_neighbor.c: icmpv6_neighbor() shouldn't use the out of + scope variable(dripaddr) From Xiang Xiao (2018-11-09). + * net/icmpv6/icmpv6_conn.c: icmpv6_free() remove reference count operation + since it's already done in icmpv6_close(). From Xiang Xiao (2018-11-09). + * net/icmpv6/icmpv6_linkipaddr.c: Encapsulate the link scope address + generation into icmpv6_linkipaddr() From Xiang Xiao (2018-11-09). + * net/icmpv6: Remove the coupling between ICMPv6 and Ethernet by moving all + Ethernet stuff to neighbor_ethernet_out.c and make the mac address as + first field. From Xiang Xiao (2018-11-09). + * net/arp and icmpv6: Double the delay time on each iteration for ARP/ICMP + to fight work jitter better. From Xiang Xiao (2018-11-09). + * net/icmpv6, neighbor, and netdev: Rename netdev_dev_lladdrsize() to + netdev_lladdrsize() and move the prototype to include/nuttx/nex/netdev.h, + giving is global scope within the OS. Reviewer: This degrades the + integrity of the modular architecture by introducing a new coupling via C + function call. Not a good thing at all. From Xiang Xiao (2018-11-09). + * net/devif/ipv6_input.c: Fix a logic error when the received IPv6 srcaddr + is a multicast address. Exiting logic only supported UDP multicast. But + MLD and certain other ICMPv6 packets also require acceptance of multicast + packets. From Gregory Nutt (2018-11-09). + * drivers/timers/arch_rtc.c: up_rtc_set_lowerhalf call clock_synchronize() + for external RTC. From Xiang Xiao (2018-11-09). + * net/icmpv6/icmpv6_autoconfig.c and icmpv6_rnotify.c: Don't take the + network device down when reconfiguring only the IP address from within + ICMPv6 logic. Recommended by Xiang Xiao in order to avoid the long + delays of bringing some networks back up. + + Normally it is required that the network be in the "down" state when + re-configuring the network interface. This is thought not to be a + necessary here because. + + 1. The ICMPv6 logic here runs with the network locked so there can be no + outgoing packets with bad source IP addresses from any asynchronous + network activity using the device being reconfigured. + 2. Incoming packets depend only upon the MAC filtering. Network drivers + do not use the IP address; they filter incoming packets using only the + MAC address which is not being changed here. + + From Gregory Nutt (2018-11-10). + * drivers/power/pm_initialize.c: Fix pm_domain_s.stime uninitialize caused + time error. Bug detail: + + 1. open CONFIG_DEBUG_FEATURES CONFIG_SYSTEM_TIME64 CONFIG_CLOCK_MONOTONIC + ==> INITIAL_SYSTEM_TIMER_TICKS very big data, not zero + 2. close CONFIG_SCHED_TICKLESS + ==> use g_system_timer as system clock + 3. pm_domain_s.stime init to zero + 4. clock_systimer() - pm_domain_s.stime get big data, error + + From ligd (2018-11-10). + * drivers/power/pm: Use the start time of state btime to calculate thrcnt; + remove the loop whose count may be very big after the long idle From + ligd (2018-11-10). + * net/udp/Kconfig: Auto-select CONFIG_WQUEUE_NOTIFIER when + CONFIG_UDP_READAHEAD_NOTIFIER is selected. From Gregory Nutt (2018-11-10). + * /net/devif/ipv6_input.c: Correct handling of IPv6 extension headers. + The main confusion was that the payload length in the IPv6 header does + not include its extension headers. + net/icmpv6/icmpv6_input.c: Correct calculation of the ICMPv6 header + address + net/mld/mld_query.c: Correct back test for group found. + net/mld/mld_report.c: Fix host vs. network order problem. + net/mld/mld_send.c: Correct the address used in sending the General + Query. It should be the unspecified address in that case. + net/MLD: The MAS query should be sent on the group multicast address. + net/mld: There is an issue with the general query timer design. There + should be a single instance, not a per-group instance of the timer (ditto + for the v1 compatibility timer). Fall back for now and use the per-group + MAX query. + From Gregory Nutt (2018-11-10). + * arch/sim/src/up_netdriver.c: Fix error 'invalid operands to binary &' + From Xiang Xiao (2018-11-10). + * arch/arm/src/common/up_exit.c: Fix typo. Caused compiler error when + system debug enabled. From Xiang Xiao (2018-11-10). + * arch/: Add 'BOARD_ASSERT_RESET_VALUE' in config/Kconfig and replace + reboot status '0' to 'CONFIG_BOARD_ASSERT_RESET_VALUE'. From Gregory + Nutt (2018-11-10). + * net/mld: Resolve and issue with sending reports from multiple groups in + the same polling cycle. From Gregory Nutt (2018-11-11). + * The MLD implementation did not follow the RFC correctly when it is the + Querier. The Querier should use a general query and get query messages + from all members of all groups. This would be driven by a single timer + per sub-net since all groups are queried at once. Instead, the design + used a Multicast Address Specific Query with one timer per group and + ignores groups that we are not members of. + + Similarly, the MLDv1 compatibility timer should be a single, separate + timer, not a per-group timer. + + net/mld: Group may be NULL when sending a general query + + From Gregory Nutt (2018-11-11). + * net/mld: Fix logic error when testing for the case where all members + have left the group. From Gregory Nutt (2018-11-11). + * arch/arm/src: Remove general register dump from fault handler since the + same info already dump in PANIC From Xiang Xiao (2018-11-11). + * arch/ assertions files: up_registerdump capture the general register if + not yet saved and up_saveusercontext is implemented, the register dump is + very useful to find the cause of failure. From Xiang Xiao (2018-11-11). + * arch/ all assertion functions: up_stackdump() dump the full stack if + stack overflow the stack info is very useful to find the backtrace From + Xiang Xiao (2018-11-11). + * arch/ all assertion functions: up_assert() move the register dump to + first make the more important info first From Xiang Xiao (2018-11-11). + * net/procfs/netdev_statistics.c: Eliminate warning: array subscript is + above array bounds. From Gregory Nutt (2018-11-11). + * Move NETDEV_LATEINIT from drivers/net/Kconfig to net/Kconfig so that we + can select NETDEV_LATEINIT without enabling NETDEVICES since the net + driver in arch folder may need to initialize later too. From Xiang Xiao + (2018-11-12). + * sched/clock/clock_getres.c: Support CLOCK_MONOTONIC From Xiang Xiao + (2018-11-12). + * sched/clock/: Remove g_monotonic_basetime and g_clock_monotonic_time + since we don't need ensure monotonic time start from zero as state here: + http://pubs.opengroup.org/onlinepubs/009696899/functions/clock_getres.html + From Xiang Xiao (2018-11-12). + * sched/clock/: Don't call up_timer_gettime in clock_gettime() and + clock_systimer() to ensure the return value from them consistent with + clock_systimespec From Xiang Xiao (2018-11-12). + * sched/clock/clock_initialize.c: clock_inittime() needs to be done with + CONFIG_SCHED_TICKLESS and clock_initialize should skip clock_inittime() + for external RTC case since the RTC isn't ready yet. From Xiang Xiao + (2018-11-12). + * sched/clock/ timekeeping: Use clock_basetime() to initialize + g_clock_wall_time to get the best initial RTC value and initialize + g_clock_last_counter too since the hardware may not start counting from + zero. From Xiang Xiao (2018-11-12). + * libc libnx updates + + - NuttX: make strerror() return 'Success' for 0 + + - NuttX: fix strrchr() so that it considers null terminator as part of + string + + From strrchr(3) man page: "The terminating null byte is considered + part of the string, so that if c is specified as '\0', these functions + return a pointer to the terminator." + + - NuttX: mm_free(): Add DEBUGASSERT()'s to catch memory corruption early. + + It's easier to find the source when asserts fail already when freeing + an overflowed buffer, than if the corruption is only detected on next + malloc(). + + - MM_FILL_ALLOCATIONS: Add debug option to fill all mallocs() + + This is helpful for detecting uninitialized variables, + especially in C++ code. I seem to be forgetting to initialize + member variables and then they just get random values.. + + - NuttX: nxtk_bitmapwindow: Fix warning message when bitmap is fully + off-screen. + + - nxfonts_getfont: Avoid unnecessary warnings for other whitespace chars + also. + + - NuttX: Fix kerning of 'I' in Sans17x22 font + + The I character was running together with some other + characters, e.g. in sequence "IMI". + + - NXMU: Re-validate window pointer for mouse events. + + NXMU caches the previous window pointer so that further mouse + events can be sent to the same window. However, if the window + is destroyed while mouse button is held down, the pointer may + become invalid and cause a crash. This patch revalidates the + pointer before using it. + + From Petteri Aimonen (2018-11-12). + * stm32/stm32_adc: major refactor + + - stm32/stm32_adc: use STM32 ADC IP core version and ADC available + functions instead of chip family names in conditional compilation + + - stm32/chip: replace family specific ADC headers with STM32 ADC IP core + version headers + + - stm32/stm32_adc: configurable sample time supported for all chips, not + only L1 + + - stm32/stm32_adc: enable/disable interrupts supported for all chips, not + only L1 + + - stm32/stm32_adc: resolution configuration + + - stm32/stm32f33xxx_adc: remove wrong assertion + + - configs/nucleo-f303ze: support for ADC and ADC example + + - configs/stm32f429i-disco: support for ADC and ADC example + + From Mateusz Szafoni (2018-11-12). + * arch/arm/src/imxrt: This commit completes the interrupt driven USDHC1 + functionality for the IMXRT EVKB. There is more work to be done to + complete DMA mode and further changes will follow. From Dave Marples + (2018-11-12). + * arch/arm/src/imxrt/imxrt_usdhc.c: Improve SD card handling in the DMA + case. For now I think we can consider this complete for both Interrupt + and DMA transfers. There is other stuff to add (high speed, low voltage, + DDR etc.) later, From Dave Marples (2018-11-13). + +7.28 2019-01-19 Gregory Nutt + + * arch/arm/src/imxrt: Add PIT, GPT, and QIMER(TMR) header files From David + Sidrane (2018-11-13). + * libs/libc/netdb: Make DNS retries configurable From Juha Niskanen + (2018-11-14). + * drivers/input/button_upper.c: Fix two bad NULL checks From Juha + Niskanen (2018-11-14). + * Assertions: Identify the running task correctly when dumping task state + information. It takes time to switch to the target task after + g_readytorun has been modified. If panic/assert happen during this + period, the dump will contain the incorrect and confusing information due + to the difference between the real running task and the return value of + this_task(). This change resolve this problem by adding g_running_task to + track the real running task through the context switch. From Xiang Xiao + (2018-11-15). + * arch/arm/src/stm32: STM32F446 & STM32F469 correct PC1 SPI assignments + From David Sidrane (2018-11-15). + * arch/arm/src/imxrt: Add FLEXPWM From David Sidrane (2018-11-15). + * libs/libc/netdb/lib_dnsquery.c: Harden against DNS spoofing. This + commit implements most of the RFC 5452 guidelines for making DNS more + resilient. We now verify response matches against what was queried and + use unpredictable query IDs. It is also checked that response come from + correct DNS server. Also fixes a buffer overflow when querying hostnames + longer than CONFIG_NETDB_DNSCLIENT_NAMESIZE. From Juha Niskanen + (2018-11-16). + * fs/dirent: Corrects a problem with opendir() noted by Petteri Aimonen in + Bitbucket Issue 132: "opendir() fails for FAT filesystem with trailing + slash in path". I see the following behaviour on NuttX 7.26, where I + have SD card mounted on /flash and a directory called "frm" on it: + + opendir("/flash") returns (DIR *) 0x1000c580 + opendir("/flash/") returns (DIR *) 0x1000c5d0 + opendir("/flash/frm") returns (DIR *) 0x1000c620 + opendir("/flash/frm/") returns (DIR *) 0x0 + + From POSIX specs for opendir(): "A pathname ... that ends with one or + more trailing slashes shall be resolved as if a single dot character + ( '.' ) were appended to the pathname." + + So for mount points, opendir() works correctly, but for FAT32 filesystem + it fails to open directory if the path has a trailing slash... + + NOTE: You would not see this problem if you call opendir() indirectly in + NSH (like 'ls -R /') because NSH contains logic to remove trailing '/' + characters from paths. From Gregory Nutt (2018-11-16). + * arch/arm/src/max36xx: Brings in WIP port for the Maxim Integrated + MAX326xx MCU family. Not really very much in place yet so marked + EXPERIMENTAL in Kconfig file. From Gregory Nutt (2018-11-16). + * configs/stm32f429i-disco/lvgl/defconfig: Fix lvgl demo removing + STM32_FB_CMAP. From Alan Carvalho de Assis (2018-11-17). + * arch/arm/src/stm32/stm32_pwm.c: STM32 MOE is not being appropriately + handled for PWM for advanced timers. It is only ever reset and so no PWM + train is generated. This change addresses this. Noted by Dave Marples. + From Mateusz Szafoni (2018-11-17). + * arch/arm/stm32: stm32_flash_writeprotect supported the same for + STM32F20XX as STM32F4XXX From Anthony Merlino (2018-11-17). + * configs/max32660-evysy/: Add support for the Maxim Integrated + MAX32660-EVSYS board. From Gregory Nutt (2018-11-17). + * Improve LED handling #if~#endif in nrf52_autoleds.c and nrf52_userleds.c + - Add Adafruit Feather nRF52 board LED support + - Add Adafruit Feather nRF52 board + - Add nrf52-generic + - Replace 'pca10040' with 'generic' + - Copy from nrf52-pca10040 to nrf52-generic + From Zou Hanya (2018-11-18). + * arch/arm/src/tiva: After commit + 51b78034ac8d1fdf598107bf4093f0beccd5b80b, my tiva console does not work - + enter key produces garbage characters. This commit fixes the problem for + me. From Lwazi Dube (2018-11-18). + * tools/nxstyle.c: Add logic to detect long lines. From Gregory Nutt + (2018-11-19). + * arch/arm/src/stm32f7: Ported the QEncoder from F4 to F7 From Eduard + Niesner (2018-11-19). + * tools/nxstyle.c: Add -h for help. From Gregory Nutt (2018-11-19). + * arch/arm/src/imxrt: Add ADC chip header From David Sidrane (2018-11-20). + * configs/imxrt1050-evk: GPIO device driver support added and tested by + Pavlina Koleva and Ivan Ucherdzhiev From Pavlina Koleva (2018-11-20). + * arch/arm/src/armv7-m/arch_invalidate_dcache.c, + drivers/mmcsd/mmcsd_sdio.c, and other files in arch/: This commit adds a + new function arch_invalidate_dcache_by_addr(). It takes the same + parameters as arch_invalidate_dcache(), but performs invalidation of only + the lines in cache that need to be invalidated. This new function could + be used as a a direct replacement for arch_invalidate_dcache(). + + The user of this invalidation are mmcsd_sdio currently. The mmcsd_sdio + driver makes calls for dcache invalidation through the chip specific + architecture function SDIO_DMARECVSETUP(). I changed the arch/arm/stm32f7 + chips to use arch_invalidate_dcache_by_addr() instead of + arch_invalidate_dcache(). + + This commit includes additional changes to mmcsd_sdio.c. I created + SDIO_DMADELYDINVLDT() (DMA delayed invalidate) to invalidate store-into + mode dcaches after the DMA transfer. I have been using + SDIO_DMADELYDINVLDT() for several weeks now and it has fixed the problems + that I previously reported regarding non-cache aligned buffer + invalidation errors (for my store-through dcache). However, it does not + permit use of unaligned DMA buffers for store-into mode dcaches. + + SDIO_DMADELYDINVLDT() is a NoOp unless the chip specific Kconfig file + selects CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT. I have modified all the + stm32f7 chips to select it. From Bob Feretich (2018-11-20). + * All network drivers! Change pre-processor logic that selects the high + priority work queue or gives preferential treatment to the high priority + work. All network logic must run on the low priority work queue! Or + suffer the consequences. From Gregory Nutt (2018-11-21). + * configs/stm32vldiscovery/scripts/stm32vldiscovery.ld: Fix SRAM and FLASH + size in the linker script. There is STM32F100RB with 8KB RAM and 128KB + FLASH on the STM32VL Discovery kit. Invalid memory size could cause a + hard fault. From Matous Pokorny (2018-11-21). + * arch/mips/src/pic32m[x|z]/pic32m[x|z]-ethernet.c: Fix a comparison in a + debug assertion. Should be <= vs <. Noted by Anonymous in Bitbucket + Isue 134. From Gregory Nutt (2018-11-21). + * sched/signal/sig_timedwait.c: Remove unnecessary disable of + pre-emption. From Gregory Nutt (2018-11-23). + * libs/libc/netdb: Support multiple IP addresses per hostname From Juha + Niskanen (2018-11-23). + * configs/stm32vldiscovery: Fix memory size configuration and + documentation. There is STM32F100RB instead of STM32F100RC on the STM32 + VL Discovery kit. From Matous Pokorny (2018-11-23). + * Improvements in STM32 ADC, minor changes in STM32 PWM, DMA, HRTIM and add + some highpri ADC examples: + - arch/arch/src/stm32/stm32_adc: fix RCC reset logic + - arch/arch/src/stm32/stm32_adc: move sample time change functions to + low-level ADC ops + - arch/arch/src/stm32/stm32_adc: configurable ADC DMA mode (one shot + mode, circular mode) + - arch/arch/src/stm32/stm32_pwm: remove llops_get interface. We can use + structure casting to get pwm low-level ops + - arch/arch/src/stm32/stm32_pwm: add timer enable/disable and frequency + update to low-level ops + - arch/src/arm/stm32: remove redundant stm32f33xxx_dma.c + - arch/arm/src/stm32/stm32f40xxx_dma.c: add interfaces to interact with + highp priority DMA interupts + - arch/src/arm/stm32/stm32_hrtim: do not enable timers on startup if + option from Kconfig selected and add interface to enable/disable timers + - configs/nucleo-f334r8/highpri: update configuration due to changes in + stm32_adc + - configs/stm32f334-disco/buckboost: update configuration due to changes in + stm32_adc + - configs/nucleo-f334r8/highpri: add support for ADC injected sequence, + add triggering from TIM1 + - configs/nucleo-f302r8/highpri: add high priority ADC interrupts example + - configs/stm32f429i-disco/highpri: add high priority ADC interrupts + example + From Mateusz Szafoni (2018-11-23). + * fs/procfs/fs_procfsproc: Extended the process ID ProcFS output to show + per-thread maximum time for pre-emption disabled and maximum time within + a critical section. From Gregory Nutt (2018-11-24). + * sched/sched/sched_critmonitor.c: Adds data collection logic in support + of monitoring critical sections and pre-emption state. From Gregory Nutt + (2018-11-24). + * configs/stm32f4discovery: Add timing support for the critical section + monitor using the DWT CYCNT register. From Gregory Nutt (2018-11-24). + * fs/procfs/fs_procfscritmon.c and sched/sched/sched_critmonitor.c: Add + support for global pre-emption and global critical sections to monitor as + suggested by Xiang Xaio. From Gregory Nutt (2018-11-24). + * Critical Section Monitor: Add low level timer support for simulation. + From Gregory Nutt (2018-11-24). + * arch/: Update all _exit() implementations for all architectures so that + they correctly called the scheduler instrumentation layer for the new + task that runs when the old one exits. This missing instrumentation was + confusing the Critical Section Monitor logic with uses this + instrumentation to track the state of critical sections. From Gregory + Nutt (2018-11-24). + * drivers/lcd: Add support to Alphanumeric Sitronix ST7032i display From + Alan Carvalho de Assis (2018-11-24). + * configs/stm32f4discovery: Add board support to display ST7032i From + Alan Carvalho de Assis (2018-11-24). + * wireless/bluetooth/bt_conn.c: Fix uninitialized variable. From Lwazi + Dube (2018-11-25). + * sched/irq/Make.defs: Fix warning about irq_csection.o appearing multiple + times in the same rule. From Gregory Nutt (2018-11-25). + * sched/irq and sched/sched: Measurement of interrupt handler duration + used to be available only in Tickless mode since it used the high + resolution Tickless timer to measure interrupt time. This commit adds + CONFIG_SCHED_IRQMONITOR_GETTIME which, if enabled, will force the + interrupt duration calculation to use the same high-resolution, + platform-specific timer as is used with the Critical Section Monitor. + This leads to two improvements: (1) You can now measure interrupt + duration in non-Tickless mode, and (2) in either mode, the interrupt + duration and the critical section measures will use the same + high-resolution timer and should, therefore, never be any discrepancy due + to different clock sources. From Gregory Nutt (2018-11-26). + * wireless/bluetooth/bt_att.c: Fix uninitialized variable. From Lwazi + Dube (2018-11-27). + * net/socket/net_clone.c: On a failure to start the TCP monitor, the clone + socket is closed but is not properly freed, leaving it attached to a TCP + connection structure with the wrong reference count. From Gregory Nutt + (2018-11-27). + * arch/arm/src/max326xx: Fixes for GPIO configuration problems and serial + driver problems. I now get the NuttShell prompt (if I also band on ENTER + to force all of the characters out). Progress, but not yet ready. From + Gregory Nutt (2018-11-27). + * arch/arm/src/max326xx and configs/max32660-evsys/src: Fix some issues + with GPIO setup of output pins. Correct polarity of on-board LED + output. The on-board LED is now functional. From Gregory Nutt + (2018-11-28). + * arch/arm/src/max326xx: WFI instruction in IDLE loop seems to interfere + with stability. Commented out for now. Needs to be investigated + further. From Gregory Nutt (2018-11-28). + * arch/arm/src/max326xx: Fixes UART interrupt problems. With these + changes, the NSH configuration appears stable and is no longer + conditioned on EXPERIMENTAL. From Gregory Nutt (2018-11-29). + * fs/procfs: Remove the unnecessary critical section From Xiang Xiao + (2018-11-29). + * sched/sched_foreach.c: sched_foreach() should not have to hold the + critical section over the entire traversal. It should be acceptable to + simply only the critical section while one entry is being processed (the + caller can always call sched_foreach within a critical section is greater + stability is needed). From Gregory Nutt (2018-11-29). + * wireless/bluetooth/bt_hcicore.c: Add second RX work function From Lwazi + Dube (2018-11-30). + * include/nuttx/wireless/bluetooth/bt_gatt.h: Fix struct name. From Lwazi + Dube (2018-11-30). + * sched/: Add debug assertions before each call to up_block_task() to + assure that there is no attempt to block an IDLE task. From Dave Marples + (2018-11-30). + * arch/mips/src/mips32/Kconfig: Allow Penguino for windows for the + Windows Ubuntu platform as well (2018-11-30). + * arch/arm/src/max326xx/max32660/max32660_spim.c: SPI0 master mode support + is complete (sans DMA and completely untested). From Gregory + Nutt (2018-11-30). + * configs/max32660-evsys/src: Add framework for SPI support. From Gregory + Nutt (2018-11-30). + * configs/max32660-evsys: Added support for an SPI-based micro-SD card. + Does not yet work (SPI hangs with no data transferred). From Gregory + Nutt (2018-11-30). + * drivers/lcd/Kconfig and several other places: Rename CONFIG_LCD_CONSOLE + to CONFIG_SLCD_CONSOLE. The original name CONFIG_LCD_CONSOLE is + incorrect because it runs on SLCD display. This patch fix it and update + its dependences From Alan Carvalho de Assis (2018-11-30). + * configs/stm32f4discovery: If the Critical Section Monitor, modify the + ITM_LAR register to assure that the DWT cycle counter is enabled. + Suggested by Dave Marples. From Gregory Nutt (2018-11-30). + * arch/arm/src/armv7-m/itm.h: Fix missing space causing macro issues From + Alan Carvalho de Assis (2018-12-01). + * configs: Add support for nucleo-f103rb, nucleo-f207zg and nucleo-l152re + From Mateusz Szafoni (2018-12-01). + * tools/convert-comments.c: Add a tool to convert C++-style comments to + C89 C-style comments. From Gregory Nutt (2018-12-01). + * configs/nucleo-f207zg, configs/nucleo-f103rb: Add ADC and PWM examples; + arch/arm/src/stm32_adc.c: There is no DMA CFG bit for the basic IPv1 + ADC. From Mateusz Szafoni (2018-12-02). + * Use STM32 DMA IP core version instead of chip family names and some minor + improvements: + - arch/arm/src/stm32/chip/stm32_adc.h: raise error if two IP cores selected + - arch/arm/src/stm32/Kconfig: hide TIMER menu, HRTIM menu and USB Host + debug menu if peripherals not enabled + - configs/stm32f429i-disco/highpri/defconfig: fix configuration warning + From Mateusz Szafoni (2018-12-02). + * drivers/spi/Kconfig and include/nuttx/spi/spi.h: Extend the HW features + supported by SPI. It now supports a deferred DMA trigger hardware + configuration. arch/arm/src/stm32/stm32_spi.c: Implements the new + deferred DMA trigger feature. From Dave Marples (2018-12-02). + * include/nuttx/wireless/bluetooth and include/nuttx/wireless/bluetooth: + Add SIOCBTCONNECT and SIOCBTDISCONNECT ioctl commands From Lwazi Dube + (2018-12-02). + * arch/arm/src/stm32/stm32_adc.c: Refactor adc_reset. It should be easier + to maintain this code if it's divided into smaller functions From + Mateusz Szafoni (2018-12-02). + * arch/arm/include/tiva: Started integration of support for the CC13x0, + CC13x2, and CC26x2. From Gregory Nutt (2018-12-03). + * tools/detab.c: Add detab.c which will convert all tabs in a file to + spaces. From Gregory Nutt (2018-12-03). + * tools/lowhex.c: Add lowhex.c that will convert hexadecimal constants in + a file to use lower case representation. From Gregory Nutt (2018-12-03). + * STM32F7, STM32H7, and STM32L4: Port Dave Marples STM32 fix to other + STM32 SPI drivers From Gregory Nutt (2018-12-03). + * configs/launchxl-cc1312r1/: Add a configuration for the + LAUNCHXL-CC1312R1 board. This is a very stripped down configuration. It + was needed to support verification of the CC13xx configuration logic and + will be needed to support completion of the CC13xx port. From Gregory + Nutt (2018-12-03). + * arch/: In the current implementation we only use very high priority + interrupts (levels 0, 0x10 and 0x20 in CORTEX-M speak) but that means + there are loads of lower priority ones that are effectively unused. I + have *not* changed the semantics of these levels but have 'shifted' them + to be based around the midpoint of the available interrupts (0x80) rather + than at the top end....that allows for interrupts to be defined above + (or, indeed, below) them as needed by the application. This should have + no functional effect on existing code but adds in a clean capability to + define higher priority interrupts. From Dave Marples (2018-12-03). + * arch/arm/src/stm32f0/stm32f0_clockconfig.c: Fixes the problem in GPIO + port clocks. Only port A clock was enabled although the comment states + otherwise. From Juha Paalijärvi (2018-12-04). + * arch/arm/src/tiva: Remove option CONFIG_TIVA_BOARD_CLOCKCONFIG. It is + not used and unnecessary. Fix some naming. up_clockconfig() is + inappropriate. Change tiva_clockconfig() to tiva_clock_reconfigure() + then we can change up_clockconfig() to tive_clock_configure(). From + Gregory Nutt (2018-12-04). + * arch/arm/include/stm32/chip.h: Remove redundant STM32 family + definitions. It is already done in arch/arm/src/stm32/Kconfig From + Mateusz Szafoni (2018-12-05). + * stm32f7: I2C out of bounds access on priv->msgv. Error in if statement. + It was checking for msgc > 0. If message count is 1, only index 0 is + valid on priv->msgv. Therefore random values in memory were used to set + next_norestart. From David Sidrane (2018-12-05). + * STM32H7 and STM32L4: Applied David Sidrane's I2C to + arch/arm/src/stm32h7/stm32_i2c.c and arch/arm/src/stm32l4/stm32l4_i2c.c. + Those easy because F7 patch applied with no problem (after changing path + and file names appropriately). The patch could not be applied to the + following. The logic is different. I don't know if a similar change is + needed there or not. + - arch/arm/src/stm32/stm32f30xxx_i2c.c + - arch/arm/src/stm32/stm32f40xxx_i2c.c + - arch/arm/src/stm32/stm32_i2c.c + - arch/arm/src/stm32/stm32_i2c_alt.c + - arch/arm/src/stm32f0/stm32f0_i2c.c + From Gregory Nutt (2018-12-05). + * arch/arm/src/armv7-m: This commit changes the lazy and non-lazy + exception handler to remove a couple of cpsid instructions from them on + ARMv7-m. If my understanding is correct then these interrupt + manipulations aren't doing anything anyway because prioritization stops + secondary interrupts arriving and, even if they did work, they would have + introduced race conditions for the period of time between the interrupt + arriving and further interrupts being disabled. From Dave Marples + (2018-12-06). + * arch/arm/src: Remove all driver-specific logic to set the interrupt + priority. There is no good reason to change the interrupt priority + unless you just want to debug a difficult problem. OR if you want to use + high priority interrupts. In that case the specific interrupt priorities + will need to be set by board-specific logic. From Gregory Nutt + (2018-12-06). + * fs/cromfs/fs_cromfs.c: Fixes hardfault From David Sidrane (2018-12-06). + * libs/libc/stdio/lib_libfread.c: fread() should always set EOF if fewer + than the requested number of bytes was not read. Per Anthony Merlino. + From Gregory Nutt (2018-12-07). + * arch/mips/include/pic32mz/chip.h: Add a missing " in an error message. + From Ouss4 (2018-12-07). + * arch/mips/src/pic32mz: Add support for the I2C bus. From Ouss4 + (2018-12-07). + * arch/arm/src: In most I2C drivers, correct upper index value in I2C + trace dump. Eliminates the extra NONE event from the trace dump output. + From Ouss4 (2018-12-08). + * wireless/bluetooth and include/nuttx/wireless/bluetooth: Remove + unnecessary gatt ioctls From Lwazi Dube (2018-12-08). + * STM32F3 and STM32F4 I2C: Remove the extra NONE event from the trace dump + output. From Ouss4 (2018-12-08). + * STM32 I2C (alternate): Remove the extra NONE event from the trace dump + output. From Ouss4 (2018-12-08). + * Improvements in STM32 ADC: + - arch/arm/src/stm32/stm32_adc.c: Start conversion on startup is now + possible if TIM triggering selected. This can be useful to start ADC + TIM conversion for ADC IPv2 when opening ADC device. + - arch/arm/src/stm32/stm32_adc.c: Fix compilation errors for chips with + one ADV TIM + - configs/nucleo-f303re: Refresh ADC example + - configs/nucleo-f334r8: Refresh ADC example + From Mateusz Szafoni (2018-12-09). + * configs/nucleo-f334r8: Add example for the SPWM generation (custom STM32 + PWM usage). From Mateusz Szafoni (2018-12-09). + * arch/arm/src/stm32/stm32_pwm: Fix compilation errors if the upper-half + PWM logic is not enabled. From Mateusz Szafoni (2018-12-09). + * include/nuttx/drivers/pwm.h: Remove dependency on CONFIG_PWM for the + upper-half PWM header. This allows compilation for the lower-level PWM + drivers even if the upper-half PWM logic is not used. From Mateusz + Szafoni (2018-12-09). + * arch/arm/src/stm32/stm32_tim.c: Fix compilation error if there is no + TIM8. From Mateusz Szafoni (2018-12-09). + * configs/nucleo-f334r8/highpri: Remove the upper-half ADC from + configuration. From Mateusz Szafoni (2018-12-09). + * configs/nucleo-f302r8/highpri: Remove the upper-half ADC from + configuration. From Mateusz Szafoni (2018-12-09). + * configs/stm32f429i-disco/highpri: remove the upper-half ADC from + configuration From Mateusz Szafoni (2018-12-09). + * include/nuttx/net/arp.h: Fix whitespace after ARPHRD_IEEE80211 From + Daniel Agar (2018-12-09). + * fs/vfs: dup() and dup2() were broken some time back. fs_dupfd() was + return returning OK on success, not the file descriptor of the duplicated + fd. From David Sidrane (2018-12-10). + * drivers/wireless/bluetooth/bt_uart_cc2564.c: Add cc2564 driver. From + Lwazi Dube (2018-12-11). + * drivers/1wire/ds28e17.c: Optimize I2C write followed by read to same + address. From Juha Niskanen (2018-12-11). + * arch/arm/src/stm32/Kconfig: Simplify ARM core selection logic From + Mateusz Szafoni (2018-12-12). + * drivers/mtd/at25.c: Added support for AT25DF081A serial flash chip. + From Marc Rosen (2018-12-12). + * fs/nxffs/nxffs_ioctl.c: Pass unrecognized IOCTL commands to the + contained MTD driver. From Daniel P. Carvalho (2018-12-12). + * arch/arm/src/stm32/Kconfig: USB Host is an option. From David Sidrane + (2018-12-12). + * drivers/mtd/at25.c: Fixed missing opening parenthesis. From Marc Rosen + (2018-12-13). + * gencromfs.c:1171:3: warning: ignoring return value of 'asprintf', + declared with attribute warn_unused_result [-Wunused-result]. From David + Sidrane (2018-12-13). + * arch/arm/src/tiva/common/tiva_hciuart.c: Port bluetooth HCI uart + interface from stm32 to tiva From Lwazi Dube (2018-12-15). + * arch/arm/src/stm32f0l0: Rename stm32f0 to stm32f0l0 to make a space + for STM32 L0. Rename files, functions and defines, removing the f0_ + from the names in order to make them MCU agnostic. From Gregory Nutt + (2018-12-16). + * Numerous files: Fixes usage of CONFIG_BIG_ENDIAN; should be + CONFIG_ENDIAN_BIG From Anthony Merlino (2018-12-16). + * net/sixlowpan: Fixes decompression of ipaddr from MAC address. The + logic used to populate the IP from the radio address should match + sixlowpan_ipfromsaddr/sixlowpan_ipfromeaddr From Anthony Merlino + (2018-12-16). + * Fix lc823450 related: + - configs/lc823450-xgevk: Fix IOB params in rndis/defconfig. These + prameters work for HTTP audio streaming. + - arch/arm/src/lc823450: Fix up_allocate_heap() in + lc823450_allocateheap2.c. This change fixes heap size and also + implements up_addregion(). From Masayuki Ishikawa (2018-12-18). + * sixlowpan: Fixes logic surrounding the Universal/Local bit. This bit + represents whether the IID is locally/globally administered. The U/L + bit is bit 1 of the MSB of the EUI-64. It should only be inverted in + cases where there is a full EUI-64. In cases where the IID is derived + from say, a short address, this bit should be forced to 0, indicating + that it is locally administered. See: + - https://tools.ietf.org/html/rfc4291#section-2.5.1 + - https://tools.ietf.org/html/rfc4944#section-6 + - https://tools.ietf.org/html/rfc2464#section-4 + From Anthony Merlino (2018-12-18). + * sched/task/task_spawn.c: Correct description of input parameters to + task_spawn_exec(). Noted by: JeongchanKim From Gregory Nutt + (2018-12-18). + * sixlowpan/ieee802154: IEEE802.15.4 stores and uses addresses in little + endian order. From Anthony Merlino (2018-12-18). + * crypto/aes.c: This commit provides an improved AES cipher API in + addition to the existing routines. The reasons for this new API are: + 1) better performance, giving the possibility to avoid re-setting-up + the key for each AES block when the same key is used multiple times. + This is important for the current single user of AES, which is related + to storage and FTL. And 2) suitable for simultaneous use of multiple + AES keys, which will be required by the upcoming crypto framework. It + retains compatibility with the previous API, so there is no need to + change anything else right now. From Sebastien Lorquet (2018-12-18). + * arch/ assertions: Correct duplicated logic from commit + dbf01d12b7321d1b48b68d3b69842a853b049376. Checking for PID == zero is + not a valid way to test for the IDLE task in all configurations! This + is only true in the single CPU configuration. In multiple CPU + configurations, there will be a separate IDLE task for each CPU with a + different PID and an alternative check must be used. NOTE: The logic + fixed in somes places still lacks sufficient intelligence to find the + right stack for the CPU IDLE thread and could still show the wrong + stack. From Gregory Nutt (2018-12-18). + * Change RNDIS mac: + - configs/lc823450-xgevk: Change RNDIS MAC address assignment. In + previous implementation, mac[0] was assigned to 0xaa for RNDIS host + to avoid MAC address conflicts with RNDIS device.. However, I + noticed that this assignment causes a random MAC address generation + on ubuntu16.04 or later which is inconvenient to set up network + interface. This new assignment scheme fixes this issue. + - configs/viewtool-stm32f107: Change RNDIS MAC address assignment. + Same issue. + From Masayuki Ishikawa (2018-12-19). + * crtypo/: This change: + - Avoids the use of up_aesinitialize() entirely, which resolves + dependency problems, because this function does not make sure that an + actual hardware aes implementation was made available: each SoC is + now responsible to ensure the AES hardware is initialized before + first use. This applies to lpc43xx, stm32 and sam34. + - Remove definitions of the NEVER used aes_init and aes_update + operations. The new AES API will be more suitable. + - Change the unusual naming in stm32 (avoiding possible naming clashes) + - Change the unusual naming in sam34 (avoiding possible naming clashes) + - Add some FAR to pointers and enforce the 80 col limit in stm32 and sam + From Sebastien Lorquet (2018-12-19). + * arch/arm/src/stm32: Add support for DMA v1 CSELR support. From + Mateusz Szafoni (2018-12-19). + * Brings in initial WIP support for the STML0. This initial commit is + unverified and, hence it it marked "EXPERIMENTAL." From Mateusz + Szafoni (2018-12-19). + * configs/: Hook new STM32L0 boards into the configuration system. + nucleo boards use as default ST LINK MCO as clock input from MCU and + for this HSEBYP must be enabled + - configs/nucleo-l073rz: Add basic support for nucleo-l073rz + - configs/b-l072z-lrwan1: Add basic support for b-l072z-lrwan1. + From Mateusz Szafoni (2018-12-19). + * sixlowpan: Address comment regarding avoiding double lookup of address + context. From Anthony Merlino (2018-12-19). + * Revert "This patch prevent heap corruption as in below case." This + solution to the problem noted by EunBong Song results in major memory + fragmentation and and out-of-memory conditions on the PX4 platform. On + that platform the lower priority work queue is very low priority and + essentially never runs when the system is busy. As a result, the + systems gets slowly starved of memory until failures and bad behaviors + begin to occur. This reverts commit + 91aa26774b291fa553f701ce5222e56a6156c323. From Gregory Nutt + (2018-12-20). + * mm/mm_heap/mm_sem.c: This is a candidate replacement for the reverted + change 91aa26774b291fa553f701ce5222e56a6156c323. This change adds a + check to mm_trysemaphore() (the root implementation of both + kmm_trysemaphore() and umm_trysemaphore()). It checks if the that task + that is apparently executing is marked as RUNNING. If not, how could + the non-running task be trying to get the MM semaphore? I think only + in the exact scenario that Eunbong Song has described. So I think the + solution should provide the same protection as + 91aa26774b291fa553f701ce5222e56a6156c323 but without the horrific + consequences to memory usage. From Gregory Nutt (2018-12-20). + * sched/Kconfig and sched/init/os_bringup.c: Allow the init task + priority to be set. From David Sidrane (2018-12-20). + * arch/arm/src/stm32/chip/stm32_dma_v1.h: Add missing DMA channel + configuration. + * mm/mm_heap/mm_sem.c: Defer freeing if mm is held by a not running + task. When the holder is running we can add a holder count. If there + is no holder OR it is not running we want to try to take the semaphore. + There will not be a count if the task is the holder and not running + because it already holds the count. This will result it the deferred + free. We will take it when not held and do the free when we can get + the count because there was no holder. From David Sidrane (2018-12-20). + * Extends the MTD configdata device with the following features / + additions: + 1. Configurable option to use named config items instead of enumerated + ID/Instance numbers. + 2. Ability to iterate through the existing configdata items in the + /dev/config device. + 3. Ability to "unset" a configdata item. + 4. Ability to perform "flash_eraseall" on the /dev/config device. + From Ken Pettit (2018-12-20). + * drivers/analog/lmp92001.c: Add support for the TI LMP92001 device. + * arch/arm/src/samd2l2/sam_i2c_master.c: Corrects behavior of the + I2C_M_NOSTART flag. Also adds a release a bus on RXNACK and corrects + typo priv->flags to msg->flags as priv->flags is never set. From + Alexander Vasiliev (2018-12-22). + * arch/arm/src/samd5e5/sam_i2c_master.c: Alexander Vasiliev's fix to the + SAMD21 I2C Master (commit b1110ba91c549572e94c24ebed202643233deee3) + should probably also be applied to the SAMD51 I2C Master which is + identical. From Gregory Nutt (2018-12-22). + * Fix lc823450 start: + - arch/arm/src/lc823450: Use CONFIG_STACK_COLORATION instead of + CONFIG_DEBUG_STACK + - arch/arm/src/lc823450: Fix go_os_start() in lc823450_start.c. I + found a bug in go_os_start() that it returns immediately because it + does not compare r1 to zero. This commit fixes this bug. Also, this + commit fixes its description. + From Masayuki Ishikawa (2018-12-25). + * arch/arm/src: Masayuki Ishikawa's change to go_os_start() should be + applied to all MCU-specific start-up functions that support + go_os_start(). From Gregory Nutt (2018-12-25). + * configs/stm32f4discovery: Add loadable app build support in + Make.defs From Masayuki Ishikawa (2018-12-25). + * arch/arm/src/samd2l2/chip: Adds a complete ADC header file for SAMD21 + and a partially complete ADC header file for the SAML21. From + Alexander Vasiliev (2018-12-26). + * net/sixlowpan: Record and restore d_buf on entry/exit of + sixlowpan_input. This avoids an issue where d_buf gets set to NULL by + sixlowpan, and then is used by forwarding logic from another network + interface before getting set back to the drivers internal b From + Anthony Merlino (2018-12-26). + * tools/gencromfs.c: Fix build on macOS From David Sidrane (2018-12-26). + * sched/pthread: Implement pthread_key_delete(). This involves some + minor changes to the group data structure. From Gregory Nutt + (2018-12-28). + * arch/arm/src/imxrt/chip/imxrt106x_pinmux.h: Add FLEXCAN3 to pinmux. + From David Sidrane (2018-12-28). + * arch/arm/src/tiva/: Add support for LM3S9B92. From Lwazi Dube + (2018-12-28). + * Add some conditional compilation to logic added with commit + 1cf992ed04c230e639bf29e55f2ec110cb9c4340 to better 'idiot-proof' the + LM3S support. From Gregory Nutt (2018-12-28). + * arch/arm/src/samd2l2, configs/samd20-xplained, samd21-xplained, + saml21-xplained: Fix SAMD2L2 arch to use calibrated oscillator value. + Now SAMD20 and SAMD21 should work fine without external crystal. Note + that SAML21 Xplained board has an external crystal and doesn't need + this change, unless you don't want to use the crystal. From Alexander + Vasiliev (2018-12-29). + * drivers/mtd/smart.c: Fix smart_write_alloc_sector sector size + calculation. From Daniel P. Carvalho (2018-12-29). + * mm/mm_heap/mm_sem.c and sched/task/task_getpid.c: Commits + 43d37c866bdaefeff659dec20ed380389c4880d5 and + f37202cbc0f72526ecfa58e5d27c5b4973289140 resolved some problems with + the original fix of 91aa26774b291fa553f701ce5222e56a6156c323. However, + Those changes used an internal OS interface (sched_self()) which is not + available when the the user-space memory manager is built in the + PROTECTED or KERNEL builds and resulted in build failures. This commit + repartitions the logic by moving some of the changes from mm_sem.c into + task_getpid.c. The logic is equivalent for the case of + mm_trysemaphore(), but now has wider impact (since it potentially + affects all callers of getpid()). Hence, this change may also + introduce some other issues that will need to be addressed. From + Gregory Nutt (2018-12-30). + * arch/arm/src/samd2l2/sam_i2c_master.h: Export + sam_i2c_master_initialize(int bus) to be used by board config. From + Alan Carvalho de Assis (2018-12-30). + * drivers/eeprom/i2c_xx24xx.c and include/nuttx/eeprom/i2c_xx24xx.h: Add + support to Microchip AT24CM02 From Alan Carvalho de Assis (2018-12-30). + * configs/saml21-xplained/include/board.h: Fix removed MAXCOARSESTEP + from saml21-xplained board From Alan Carvalho de Assis (2018-12-30). + * arch/arm/src/tiva/common/lmxx_tm4c_gpioirq.c: Fix tiva gpio + interrupts From Lwazi Dube (2018-12-30). + * configs/: Commit fd68d74264c breaks all STM32 board configurations + that use STM32 USB host. That is because that commit requires + CONFIG_STM_USBHOST to be set to build in USB host support, but did not + update the necessary board defconfig files to add that required + configuration. From Gregory Nutt (2018-12-30). + * drivers/net/tun.c: Fixes a problem reported by Masayuki Ishikwawa: + Recently I noticed that ARP response packet is corrupted when I tried + to run bluekitchen with the latest tun.c in TAP mode. If I revert + commit 8193c28e9126c9cb89042e80d6ebab7485a831e4, then it works again. + From Xiang Xiao (2018-12-30). + * arch/arm/include/tiva and src/tiva: Improve GPIO interrupt support by + removing unnecessary, hard-coded per-MCU defines and using the existing + Kconfig configuration options instead. From Lwazi Dube (2018-12-31). + * drivers/power/mcp73871.c: Add support to Microchip MPC73871 Battery + Charger. From Alan Carvalho de Assis (2018-12-31). + * configs/tm4c1294-launchpad/src: Add IRQBUTTONS support to tm4c1294 + launchpad. From Lwazi Dube (2018-12-31). + * arch/arm/src/stm32: Unified naming for DAC interfaces From Mateusz + Szafoni (2019-01-02). + * drivers/usbdev/cdcacm.c: When implemented usb cdc on nrf52840, + I found some issues with cdc driver: + 1. Lost data when receiving buffer is full; + 2. Low-water mask implement issue; + 3. Re-flush cdc buffer when enabling + 4. Serial dma is conflict with cdc , modify the serial.h + From Levin Li (2019-01-02). + * drivers/mtd/mtd_config.c: Check return value mtdconfig_readbytes(). + From Jussi Kivilinna (2019-01-02). + * configs/pizero: Remove the partial support for the Raspberry Pi Zero. + This port was started with the best of intentions but was never + completed. The board support can still be found in the Obsoleted + repository. From Gregory Nutt (2019-01-02). + * arch/arm/src/bcm2708 and arch/arm/include/bcm2708: Remove all support + for the BCM2708/2835. This was added only for support of the Pi Zero + board which was previously removed. The support was minimal and + unverified. The removed files can still be found in the Obsoleted + directory. From Gregory Nutt (2019-01-02). + * arch/arm/src/stm32f7: stm32f7 enable separate DMA per SPI + configuration From Daniel Agar (2019-01-02). + * lc823450 spif boot: + - arch/arm/src/lc823450: Add support for SPI flash boot. Also, remove + unnecessary code for the SPI flash boot. + - configs/lc823450-xgevk: Add linker script for SPI flash boot + From Masayuki Ishikawa (2019-01-04). + * drivers/power/battery_gauge.c: Add missing initialization of + semaphore. From Alan Carvalho de Assis (2019-01-04). + * drivers/power/battery_charger.c: Add missing initialization of + semaphore. From Alan Carvalho de Assis (2019-01-04). + * tools/mkconfig.c: Add definitions to distinguish between tristate 'y' + and 'm' options. From Gregory Nutt (2019-01-05). + * drivers/power/mcp73871.c: Fix MCP73871 driver to register correctly as + a battery charger. The first element of a 'struct + battery_charger_dev_s' should be a pointer to operations structure. + From Alan Carvalho de Assis (2019-01-05). + * drivers/net/telnet.c: Add NAWS and poll interface to telnet for screen + size negotation used with termcurses. From Ken Pettit (2019-01-05). + * arch/arm/src/samv7/sam_serial.c: Fix case where TTYS0 is not defined. + From Ken Pettit (2019-01-05). + * arch/arm/src/armv7-a/arm_mmu.c: Fix end address calculation for + mmu_invalidate_region() API From Petro Karashchenko (2019-01-06). + * arch/arm/src/armv7-a/mmu.h: Use TLBIMVA vs TLBIMVAAIS to invalidate + the Cortex-A8 cache. From Petro Karashchenko (2019-01-06). + * Initial changes for BeagleBone Black board support (TI AM335x family + based on Cortex-A8): + - configs/beaglebone-black: Adds initial support for the BeagleBone + Black board. + - arch/arm/src/am335x: Adds initial support for the TI AM355x family. + From Petro Karashchenko (2019-01-06). + * drivers/telnet/telnet.c: telnet.c priv only used if + CONFIG_TELNET_SUPPORT_NAWS From Daniel Agar (2019-01-06). + * arch/arm/src/am335x/chip/am3358_memorymap.h: Code cleanup for + beaglebone black port. From Petro Karashchenko (2019-01-06). + * arch/arm/src/am335x/am335x_irq.c: Uncomment code for interrupt + enable/disable. From Petro Karashchenko (2019-01-06). + * drivers/timers/mcp7941x.c: Add support for the MCP741x external RTC. + From Ouss4 (2019-01-06). + * configs/lc823450-xgevk: Enable NFS client for RNDIS. Also, some stack + size were adjusted to work with NFS From Masayuki Ishikawa (2019-01-07). + * include/dsp.h: Fix missing semicolon error in dsp.h From MYAPICI + (2019-01-07). + * fix stm32 tim bug. From lihaichen (2019-01-07). + * drivers telnet common_ioctl() - inode only used with + CONFIG_TELNET_SUPPORT_NAWS From Daniel Agar (2019-01-07). + * mm/mm_heap/mm_calloc.c: Verify that the number of elements times the + size of an element will not overflow type size_t. This is required by + the SEI CERT C coding style and resolves anonymous Bitbucket Issue + #139 From Gregory Nutt (2019-01-07). + * Revert "arch/arm/armv7-m: MPU: mpu_log2regionceil needs take into + account the offset too". Masayuki Ishikawa reports that this commit + breaks ALL PROTECTED mode builds. It violates the basic requirements + of the use of the MPU in protected mode. Those basic requirements are: + 1. The MPU region must be aligned to the base address of the memory + region being mapped (it may NEVER extend before the memory region). + That is, the following MUST always be zero: + (base & ((1 << l2size) - 1)) + 2. The MPU region must never extend beyond the end of the memory + region. That is, the following must be true: size >= (1 << l2size) + This reverts commit 8b63d0230936bd7d6bd94f4c76b9402946f69b21. From + Gregory Nutt (2019-01-08). + * drivers/net/telnet.c: Add missing logic to set read event flags in + poll() method. From Ken Pettit (2019-01-08). + * drivers/timers/mcp794xx.c: Rename the module to mcp794xx. From Ouss4 + (2019-01-08). + * Revert "arch/: The protoype of mpu_log2regionfloor() changed; an + additional parameter was added. However, none of the calls to + mpu_log2regionfloor() were updated to pass the new, additional + parameter." Commit 8b63d0230936bd7d6bd94f4c76b9402946f69b21 was + reverted. This related commit must now also be reverted to avoid + compilation errors. This reverts commit + e8270defc9b26f7a7199288fa9ba203a96ed63d4. From Gregory Nutt + (2019-01-08). + * drivers/mtd/s25fl1.c: Minor change for the s25fl1 QSPI FLASH driver + which fixes additional sectorshift vs. pageshift confusion. From Ken + Pettit (2019-01-09). + * STM32F7 and L4 I2cC: Use clock_t for ticks instead of uint32_t to hold + system time. From Jussi Kivilinna (2019-01-09). + * Drivers for Sensirion SCD30, SGP30 and SPS30 sensors: + - drivers/sensors: add driver for Sensirion SCD30 CO2 sensor + - drivers/sensors: add driver for Sensirion SGP30 gas sensor + - drivers/sensors: add driver for Sensirion SPS30 particulate matter + sensor + From Jussi Kivilinna (2019-01-09). + * Adds the ARM mbed littlefs to NuttX: + - depends on !DISABLE_MOUNTPOINT && MTD_BYTE_WRITE + - register_mtddriver("/dev/w25", mtd, 0755, NULL); + mount("/dev/w25", "/w25", "littlefs", 0, NULL); + From lihaichen (2019-01-09). + * arch/arm/src/stm32f0l0: Add support for GPIO EXTI. From Mateusz + Sfafoni (2019-01-09). + * configs/nucleo-l073rz: Support for nrf24l01. From Mateusz Sfafoni + (2019-01-09). + * configs/b-l072z-lrwan1/include/board.h: Add note about onboard Murata + CMWX1ZZABZ-09 module and definitions for available peripherals. From + Mateusz Sfafoni (2019-01-09). + * include/nuttx/compiler.h: Correct support of C-version-specific + features. Cannot depend on GCC version because -std=c89 may be used on + command line. Need instead to use __STDC_VERSION__ to determine if a + feature is supported. Also add conditional support inline, depending + on C99. From Gregory Nutt (2019-01-09). + * With these changes, I am able to access NSH on Beaglebone Black. I + still observe data abort crash if I compile the code with optimization + enabled. The next steps are to investigate the optimization issue and + add Watchdog module. Currently, NSH does not run for a long time. + - arch/arm/src/am335x/am335x_irq.c: Correct interrupt processing routine + - configs/beaglebone-black/nsh/defconfig: Enable debug compilation + options. Otherwise data abort crash is observed + - arch/arm/src/am335x/am335x_timerisr.c: Make sure that Timer 1 + interrupts are disabled before any access to peripheral registers + From Petro Karashchenko (2019-01-09). + * drivers/mtd/smart.c: Fix for the SmartFS MTD layer size mapping + issue. With this patch, existing SmartFS drives should still mount and + work properly, plus the larger sector sizes are now supported + correctly. From Ken Pettit (2019-01-10). + * stm32f0l0: Fix GPIO EXTI lines assignment for STM32 M0. From Mateuz + Szafoni (2019-01-12). + * drivers/timers/mcp794xx.c: Fix MCP794xx driver to wait for OSCRUN and + fix tm_year. From Abdelatif Guettouche (2019-01-12). + * net/sixlowpan: sixlowpan_input should always return 0 if the incoming + frame was consumed. From Anthony Merlino (2019-01-13). + * configs/lc823450-xgevk: Fix overlapped memory settings in memory.ld + From Masayuki Ishikawa (2019-01-14). + * configs/stm32f4discovery: Update nsh configuration: (1) Add + CONFIG_BOARD_INITIALIZE=y, (2) Add CONFIG_EXAMPLES_HELLO=y From + Masayuki Ishikawa (2019-01-14). + * configs/stm32f4discovery: Update RNDIS configuration: + - Add NFS and adjusted stack size for usermain and telnetd client. + - Add support for loadable application and ping. + From Masayuki Ishikawa (2019-01-14). + * drivers/lcd/st7032.c: Fix seek method. Was not taking into account + the offset for the SEEK_END case. Did not account for negative + offsets. On errors, it was clobbering the filep->f_pos setting. From + Gregory Nutt (2019-01-14). + * drivers/lcd/pcf8574_lcd_backpack.c: Fix seek method. Had the same + problems as noted for st7032.c driver. From Gregory Nutt (2019-01-14). + * arch/arm/src/am335x: Add minimal wdog logic needed to disable the + watchdog timer. Otherwise, the board is rebooted after certain time + expires while NuttX is running. From Petro Karashchenko (2019-01-15). + * drivers/lcd/tda19988: This commit brings in a complete, but untested, + implementation of a driver for the TI TDA19988 HDMI Encoder. This + encoder is used on the Beaglebone Black board. Since this driver is + untested, it requires CONFIG_EXPERIMENTAL in the configuration. From + Gregory Nutt (2019-01-15). + * arch/arm/src/samd2l2/sam_i2c_master.c: Adds calculation of a timeout + and disables interrupts in case of error. From Alexander Vasiliev + (2019-01-15). + * include/nuttx/lcd/edid.h: Add EDID definitions From Gregory Nutt + (2019-01-15). + * nucleo-f767zi: Use on board USB UART as default console. Board is + powered by USB which can be used as UART link for upload and console. + Previously it was set to use Arduino shield which developer may not + have. From Phil Coval (2019-01-15). + * nucleo-144-f767-netnsh: Add ethernet config based on nsh configuration + plus stm32f769i-disco/nsh-ethernet. From Phil Coval (2019-01-15). + * stm32: Align ethernet config name to netnsh. nsh-ethernet was only + used for stm32f7*-disco, other configurations with network enabled are + commonly named netnsh or derived: (eg: nucleo-144/f7670-netnsh) From + Phil Coval (2019-01-16). + * arch/arm/src/am335x/am335x_timerisr.c: Switch to DMTimer2 for system + tick generation. U-Boot does not enable DMTimer1ms clocks hence it is + not possible to use it until implementation in am335x_clockconfig.c is + ready From Petro Karashchenko (2019-01-16). + * arch/arm/src/imxrt/chip/imxrt_flexpwm.h: Correct duplicated + definitions From David Sidrane (2019-01-16). + * arch/arm/src/imxrt/imxrt_serial.c: Fix TTYS0 defined definitions of + higher numbered ports From David Sidrane (2019-01-16). + * arch/arm/src/imxrt/imxrt_serial.c: Support independent input and + output flow control. From David Sidrane (2019-01-16). + * arch/arm/src/imxrt/imxrt_usdhc.c and related board.h files: Use single + define for USB pin definitions. From David Sidrane (2019-01-16). + * arch/arm/src/imxrt: ADD GPIO Support Input daisy selection From David + Sidrane (2019-01-16). + * arch/arm/src/imxrt/imxrt_lpspi.c: Removed unused clock, that borked + the build From David Sidrane (2019-01-16). + * arch/arm/src/imxrt/Make.defs: Include up_systemreset and + up_stackcheck.c From David Sidrane (2019-01-16). + * arch/arm/src/imxrt/imxrt_lpi2c.c: I2C Reset rework From David Sidrane + (2019-01-16). + * arch/arm/src/imxrt/imxrt_periphclks.h: Ensure C++ compatibility. From + David Sidrane (2019-01-16). + * arch/arm/src/tiva: Support for the CC13x0 and CC13x2 families is + basically code complete except for integration with ROM DriverLib. + And, of course, completely untested. Support for the CC26x2, which is + nearly identical to the CC13x2 is fragmentary. From Gregory Nutt + (2019-01-17). + * arch/arm/include/kinetis/kinetis_sim.h: Remove extra characters following + #undef. From Daniel Agar (2018-01-19). + +7.29 2019-03-25 Gregory Nutt + + * arch/arm/src/stm32/chip: Don't try including stm32l_gpio.h from within + chip/*.h header files. Not only is bad style for a layered inclusion + system, but it doesn't always work. From Gregory Nutt (2019-01-19). + * Initial support for sx127x radio From Mateusz Szafoni (2019-01-20). + * arch/arm/src/samd2l2: Add RS485 support to SAMD2L2 serial From Alan + Carvalho de Assis (2019-01-20). + * include/nuttx/lcd/edid.h: Add extended EDID block IDs From Gregory + Nutt (2019-01-20). + * Completes the CC13x2 AUX SYSIF header file. From Gregory Nutt + (2019-01-20). + * arch/arm/src/stm32f7/stm32_lse.c: Add configuration of LSE oscillator + drive capability From Jussi Kivilinna (2019-01-22). + * tools/convert-comments.c: Fix an error in handling of a blank C++ + comment before a comment block. For example, this testfile: + + 1 + 2 // + 3 // Multi-line comment + 4 // The second line + 5 + + Was generating this output: + + 1 + 2 + 3 * Multi-line comment + 4 * The second line + 5 */ + 6 + + Now correctly generates: + + 1 + 2 /* Multi-line comment + 3 * The second line + 4 */ + 5 From Gregory Nutt (2019-01-22). + * arch/arm/src/tiva/cc13xx: The trim files from the TI DriverLib now + compile successfully. This merge also brings in the ROM files from the + TI DriverLib which do NOT year compile correctly. This is still a work + in progress. There merge also adds unverified support for the + LaunchXL-CC1310. From Gregory Nutt (2019-01-22). + * arch/arm/src/samd2l2/sam_serial.c: Add missing RS-485 DIR pin write to + sam_serial.c From Alan Carvalho de Assis (2019-01-22). + * crypto/aes.c: When we upgraded our code to NuttX 7.28 crypto/aes.c + would no longer compile. Attached is a patch which fixes the + compilation errors. From Gregory Nutt (2019-01-23). + * arch/arm/src/tiva/cc13xx: Fixes to get a clean build of the + configs/launchxl-cc1312r1 configuration. Still untested. From Gregory + Nutt (2019-01-23). + * arch/arm/src/tiva/hardware: Add CC13xx SMPH and AUX SMPH header + files. Still need DDI0 OSC header file for CC13x0 compilation. From + Gregory Nutt (2019-01-23). + * Improvements for STM32 PWM + - arch/arm/src/stm32/stm32_pwm: fix polarity and IDLE state configuration + for advanced timer PWM + - include/dsp.h: raise error if math.h not present + From Mateusz Szafoni + (2019-01-23). + * arch/arm/src/tiva/hardware: Add CC13x0 DDI0 OSC header file. + arch/arm/src/tiva/cc13xx: Fix miscellaneous compilation issues. From + Gregory Nutt (2019-01-23). + * tools/.gitignore: Ignore new tool binaries. From David Sidrane + (2019-01-24). + * arch/arm/src/stm32l4/stm32l4_lse.c: Ports Jussi Kivilinna's recent + STM32F7 LSE change to STM32L4. From Juha Niskanen (Haltian) + (2019-01-24). + * fs/vfs/fs_open.c: Fix not returning failure for block_proxy() call. + From David Sidrane (2019-01-25). + * up_initialize(): As noted by Roland Takacs in Bitbucket issue 141, + there is a compilation error for STM32 if CONFIG_NET and + CONFIG_NETDEV_LATEINIT are selected. That was due in part to commit + 19e16cb which extended up_netinitialize() with a + !defined(CONFIG_NETDEV_LATEINIT) guard but did not add the guard to + concrete implementations. I say "in part" because I don't think that + the original intent of commit 19e16cb was to enable an alternative + initialization of MCU internal Ethernet support but rather to enable + support of external Ethernet devices that may have dependencies on, for + example, SPI. However, this is still a proper fix to avoid the + compilation error that can occur with this combination of configuration + options. From Gregory Nutt (2019-01-25). + * arch/arm/src/lpc17xx/lpc17_can.c: The name can_txready clashes with + Nuttx CAN core global function. LPC178x has only single + LPC17_SYSCON_PCLKSEL with only single divisor. From Pavel Pisa + (2019-01-25). + * arch/arm/src/tiva/cc13xx/cc13x2_v1_trim.c and cc13x2_cc26x2_v1_rom.c: + Review and modified for coding style. Now pass tools/nxstyle wihout + complaint. From Gregory Nutt (2019-01-25). + * arch/xxx/include/: Remove watchdog.h and arm-elf.h because they are + empty. The arm-elf header file was never used; the empty watchdog.h + header file was used in only one place. From Xiang Xiao (2019-01-26). + * arch/arm/include/armv-7m/irq.h and armv6-m/irq.h: Remove redundant + conditioning on CONFIG_BUILD_PROTECTED From Xiang Xiao (2019-01-26). + * mm/mm_heap/mm_sbrk.c: Fix backward conditional test. Should call + mm_initialize() when brkaddr equal zero From Xiang Xiao (2019-01-26). + * arch/Kconfig and arm/src/armv7-m/Kconfig: ARCH_HIPRI_INTERRUPT + shouldn't select ARMV7M_USEBASEPRI. First because that is a violation + of the layered nature of the Kconfig architecture, but also because + then Kconfig will generated errors when high priority interrupts are + used with other architectures. From Xiang Xiao (2019-01-26). + * mm/umm_heap/umm_sbrk.c: Pass ARCH_HEAP_VEND as maxbreak argument From + Xiang Xiao (2019-01-26). + * arch/xxx/src/common/up_initialize.c: Move up_pminitialize() after + timer_initialize() From ligd (2019-01-26). + * arch/arm/src/include/xxx/syscall.h: Align semi-hosting call style with + other syscalls From Xiang Xiao (2019-01-26). + * arch/arm/include/syscall.h: Add missing inclusion of + arch/armv7-r/syscall.h for CortexR. From Xiang Xiao (2019-01-26). + * mm/kmm_heap/kmm_kernel.c: Remove unused, duplicated kmm_heapmember(). + From Xiang Xiao (2019-01-26). + * mm/iob/iob_alloc.c: iob_allocwait should decrease semcount manually. + From Xiang Xiao (2019-01-26). + * drivers/sensors/ina3221.c: Fix errors in register field address. + Signed value was losing its signed-ness due to use of unsigned type for + register. From Ken Pettit (2019-01-26). + * mm/iob/iob_notifier.c: Don't check iob_navail in iob_notifier_setup to + avoid a potential race condition. From Xiang Xiao (2019-01-26). + * mm/iob/iob_dump.c: Format the whole line before log to avoid the + multiple timestamp prefix in each line From Xiang Xiao (2019-01-26). + * drivers/sensors/ina3221.h: Fix errors in register addresses and + bitfield values. From Ken Pettit (2019-01-26). + * mm/shm: Convert bytes to pages by MM_NPAGES instead of MM_PGALIGNUP + From Xiang Xiao (2019-01-26). + * mm/shm/shmget.c: Should call shm_extend to allocate the physical + memory From Xiang Xiao (2019-01-26). + * mm/mm_gran/mm_pgalloc.c: mm/pgalloc: shouldn't just allocate one page + always. From Xiang Xiao (2019-01-26). + * mm/mm_gran/mm_graninfo.c: Fix the wrong data in g_1bit_info and make + the internal function static From Xiang Xiao (2019-01-26). + * mm/umm_heap: Ensure all user allocation try sbrk before fail From + Xiang Xiao (2019-01-26). + * mm/iob/iob_copyin.c: iob_copyin() should wait for each buffer and + adjust the return value of iob_copyin_internal return to simplify the + code From Xiang Xiao (2019-01-26). + * arch/xxx/src/xxx/up_assert.c: Dump CPU0 IDLE stack only when PID + equals 0. IDLE threads of other CPUs do not need this special check + From Xiang Xiao (2019-01-26). + * binfmt/, binfmt/libelf/, include/nuttx, libs/libc/machine, + libs/libc/modlib, and others: Move elf related arch function to + include/nuttx/elf.h because the implementation is located in + libs/libc/machine and in order to avoid the conflict with the 3rd party + libraries and clean up the file inclusion: (1) Remove redundant + elf32.h, (2) Remove nuttx/binfmt/elf.h in libs/libc/machine, (2) Remove + nuttx/binfmt/elf.h in modlib, and (4) Rmove nuttx/module.h in modlib. + From Xiang Xiao (2019-01-26). + * Kconfig files, binfmt/libelf, libs/libc/machin, libs/libxx: Correct + libcxx exception handling by introducing the generic + config(CXX_EXCEPTION and CXX_LIBSUPCXX) From Xiang Xiao (2019-01-26). + * binfmt/: If there is an address environment (CONFIG_ARCH_ADDRENV), + binfmt/elf doesn't need to free ctor/dtor alloc since freeing the + address environment releases the heap automatically. From Xiang Xiao + (2019-01-26). + * binfmt/libelf, libs/libc/modlib: Optimize elf load speed: (1) Don't + zero out memory, (2) Reduce the initial buffer size to 32 bytes. From + Xiang Xiao (2019-01-26). + * binfmt/, binfmt/libelf: binfmt/elf: Call umm_initialize as soon as + possible otherwise elf_loadctors/elf_loaddtors will fail to allocate + memory. From Xiang Xiao (2019-01-26). + * libs/libc/dllfcn: Implement dlerror using strerror. From Xiang Xiao + (2019-01-26). + * libs/libc/dllfcn, sched/init: Add LD_LIBRARY_PATH environment variable + support. From anchao (2019-01-26). + * libs/libc/machine/arm/armv7-m/arch_elf.c: Add support for the + R_ARM_THM_JUMP11 relocation type. This relocation type may be + generated when LTO optimization is enabled. From anchao (2019-01-26). + * libs/libc/machine/arm: Fix the minor issue in libc arm machine folder; + MOVW/MOVT should use zero(not sign) extension. From Xiang Xiao + (2019-01-26). + * libs/libc/symtab/symtab_findorderedbyvalue.c: Remove unused + symtab_findorderedbyvalue. From Xiang Xiao (2019-01-26). + * arch/arm/src/samd2l2 serial: Fix SAMD2L2 serial driver it needs + sam_usart_enable() to work From Alan Carvalho de Assis (2019-01-26). + * Remove empty seria.h and all references From Xiang Xiao (2019-01-26). + * libs/libc/stdio/lib_libvsprintf.c: Correct justification for alternate + forms of %p and %P From ligd (2019-01-27). + * libs/libc/misc/lib_utsname.c: Add build date and time to uname output + (like Linux). From Gregory Nutt (2019-01-27). + * libs/unistd and other affected files: Hostname support no longer + depends on CONFIG_NET since the host name is also useful in the + non-network environment. CONFIG_NET_HOSTNAME changed to + CONFIG_LIB_HOSTNAME. From Xiang Xiao (2019-01-27). + * Remove the unused libs/libc/endian/Kconfig From Xiang Xiao (2019-01-27). + * libs/libxx/Kconfig: Automatically select CONFIG_LIBC_WCHAR and + CONFIG_TIME_EXTENDED when CONFIG_LIBCXX is selected since libcxx + compile fails if without these two option From Gregory Nutt + (2019-01-27). + * - drivers/timers/oneshot.c: Support signal notification through + SIGEV_THREAD + - drivers/timers/rtc.c: Support signal notification through + SIGEV_THREAD + - drivers/input/ajoystick.c: Support signal notification through + SIGEV_THREAD + - drivers/input/djoystick.c: Support signal notification through + SIGEV_THREAD + - drivers/input/button_upper.c: Support signal notification through + SIGEV_THREAD + - drivers/sensors/zerocross.c: Support signal notification through + SIGEV_THREAD + - drivers/wireless/ieee802154: Support signal notification through + SIGEV_THREAD + - drivers/lcd/ft80x.c: Support signal notification through SIGEV_THREAD + From Xiang Xiao (2019-01-27). + * drivers/net/phy_notify.c and all network drivers that support PHY + notifications: Support the signal notification through SIGEV_THREAD + From Xiang Xiao (2019-01-27). + * aio_cancel need signal caller after the succeed and fix minor issue in + the error handler From Xiang Xiao (2019-01-27). + * drivers/timers/watchdog.c: Support auto-monitor service From Gregory + Nutt (2019-01-27). + * drivers/timers/rtc.c: Protect the RTC state with a semaphore. From + Xiang Xiao (2019-01-27). + * drivers/timers/rtc.c: Protect the timer state with a semaphore. From + Xiang Xiao (2019-01-27). + * Critical Section Monitor (sched/ and fs/procfs: Remove + SCHED_IRQMONITOR_GETTIME to simplify the clock source selection: (1) + Use up_critmon_gettime if SCHED_IRQMONITOR, (2) Call clock_systimespec + if SCHED_TICKLESS, (3) Don't collect timing info for all other cases + and move up_critmon_* to arch.h avoid the duplicated declaration. From + Xiang Xiao (2019-01-27). + * drivers/timers/arch_alarm.c and arch_timer.c: Implement + up_critmon_gettime and up_critmon_convert and remove the critical + section from current_usec to infinite recursion. From Xiang Xiao + (2019-01-27). + * Improvements in STM32 ADC, PWM and TIM + - arch/arm/src/stm32/chip/stm32_adc_v2.h: missing T1TRGO2 for JEXTSEL + - arch/arm/src/stm32/stm32_adc: configure injected channels external + trigger when ADC enabled + - arch/arm/src/stm32/stm32_adc: update injected conversion queue of + context after configuration + - arch/arm/src/stm32/stm32_adc: fix sample time configuration for + channels. The array index for channels was missing + - arch/arm/src/stm32/stm32_adc: support for offset configuration + - arch/arm/src/stm32/stm32_pwm: fix TRGO/TRGO2 configuration + - arch/arm/src/stm32/stm32_pwm: support for advanced timers channel 5 + and 6 + From Mateusz Szafoni (2019-01-27). + * drivers/serial/serial.c: Initialize OPOST and ONLCR in uart_register + From Xiang Xiao (2019-01-27). + * drivers/serial/serial.c: Call pm_activity() when characters are + received on a console device. From Gregory Nutt (2019-01-27). + * drivers/serial/uart_16550.c: Fix error: 'g_uart0port' undeclared. + From Xiang Xiao (2019-01-27). + * drivers/serial/serial.c: Don't reset the circular buffer on close + since DMA may still be transferring data in the background if the user + closes the handle too quickly and the handle is opened with + O_NONBLOCK. From Xiang Xiao (2019-01-27). + * drivers/serial/uart_16550.c: Fix typo for UART1 flow field + initialization From Gregory Nutt (2019-01-27). + * sched/wqueue/kwork_notifier.c and several Kconfig files: Notifier + should work with either lpwork or hpwork and other minor typo fix. + From Xiang Xiao (2019-01-27). + * sched/Kconfig: Change SCHED_NOTE_GET type from int to bool + From Gregory Nutt (2019-01-27). + * sched/sched/sched_timerexpiration.c: Fix macro SEC2TICK() 32-bits + overflow by using uint64_t in calculation. From ligd (2019-01-27). + * drivers/power/pm_activity.c: Add pm_staycount API for get stay + numbers. This function is currently not used and a waste of FLASH + space. From ligd (2019-01-27). + * include/nuttx/irq.h: Fix enter_critical_section/spin_lock_irqsave + macro typo error and remove the duplicated inclusion of arch/irq.h + From Xiang Xiao (2019-01-27). + * include/stdbool.h: Define bool only when __cplusplus isn't defined. + From Xiang Xiao (2019-01-27). + * include/nuttx/fs/fs.h: Move the union inode_ops_u i_mtd field into the + mount section of inode_ops_u and remove the guard to simplify fs which + support both block and mtd. From Xiang Xiao (2019-01-27). + * include/nuttx/list.h: Added a Linux-compatible list implementation. + From zhuyanlin (2019-01-27). + * fs/mount and fs/romfs: Add support to mount a ROMFS volume using an + MTD driver interface using the standard mount() operation. From Xiang + Xiao (2019-01-27). + * fs/hostfs/hostfs.c: Remove the unnecessary use of host_stat() in + hostfs_bind() From ligd (2019-01-27). + * drivers/syslog/ramlog.c: Fix error: Conflicting types for + 'ramlog_addchar' From Xiang Xiao (2019-01-27). + * fs/littlefs: Fix a minor issue found in code review: (1) Replace + printf to finfo/fwarn/ferr, (2) Replace malloc/free to + kmm_malloc/kmm_free, (3) define LFS_NAME_MAX to NAME_MAX, (4) Check the + big endian using CONFIG_ENDIAN_BIG. From Xiang Xiao (2019-01-27). + * fs/littlefs: VFS wrapper improvement: (1) Support block device + interface, (2) support ioctl, stat and sync file operation, (3) support + forceformat and autoformat option, (4) update file->f_pos and + dir->fd_position, (5) remove the internal struct from dir, and (6) + remove mtd byte read/write requirement. From Xiang Xiao (2019-01-27). + * arch/arm/src/am335x/am335x_serial.c: Eliminate an error 'TIOCSBRK + undeclared. From Gregory Nutt (2019-01-27). + * Every file that uses serial IOCTLs (TIOC*) must explicity include + nuttx/fs/ioctl.h. This was included previously via sneak path in the + now deleted arch/serial.h. From Gregory Nutt (2019-01-27). + * arch/arm/src/lpc17xx/lpc176x_clockconfig.c: The code preserves + undocumented reserved bits only if board does not set them to keep + previous behavior for boards where developers (hopefully) know what + values should be set into these bits. From Pavel Pisa (2019-01-27). + * arch/arm/src/lpc17xx/: The enable of EMC clocks has to be preserved + when already enabled by loader. EMC and related pins configuration has + to be skipped if the system is run from SDRAM. A region of SDRAM which + is used by system must not be used for heap. From Pavel Pisa + (2019-01-27). + * configs/nucleo-l432kc/src/stm32_appinit.c: Add support for I2C driver + initialization. From Nikolay Semenov (2019-01-28). + * drivers/timers/timer.c: Support the signal notification through + SIGEV_THREAD From Gregory Nutt (2019-01-28). + * configs/nucleo-144/f767-netnsh/defconfig: Correct one location where + CONFIG_NET_HOSTNAME was not changed to CONFIG_LIB_HOSTNAME. From + Gregory Nutt (2019-01-29). + * arch/arm/src/imxrt: Add XBAR Support From David Sidrane (2019-01-29). + * arch/arm/src/imxrt/chip/imxrt_tmr.h: Fix addressing and restructure + using common offset From David Sidrane (2019-01-29). + * sched/sched/sched_processtimer.c: Add a configurable call out to a + user-provided function, 'timer hook', on each timer interrupt. From + Gregory Nutt (2019-01-30). + * - /arch/arm/src/samv7/sam_spi.c: DMA Tx/Rx timeout issue. + - /arch/arm/src/samv7/sam_qspi.c: Compile error when set + CONFIG_SAMV7_QSPI_DLYBCT + - Fix compiling error when set + CONFIG_BOARDCTL_IOCTL/CONFIG_BOARDCTL_UNIQUEID + From Kevin Liu (2019-01-30). + * arch/arm/src/imxrt/chip/imxrt_gpt.h: Correct register offsets. From + David Sidrane (2019-01-30). + * arch/arm/src/samv7/sam_emac.c: The logic for determining the number of + queues for SAMV71 must be extended. All SAMv7 parts increase the + number of queues from 3 to 6 at revision B, not just the SAMV71. From + Gregory Nutt (2019-02-01). + * arch/arm/src/samv7/sam_emac.c: Fix a compile problem introduced with + commit cf1e0f79762284da2df372fe80eb3eca09488e24. From Gregory Nutt + (2019-02-01). + * arch/arm/src/samv7/sam_emac.c: Fixes rxdesc index logic to handle + Buffer Not Available (BNA) condition. + + If a SOF is found, but no EOF, don't move past the frame. Instead, + keep the index at the SOF buffer until the rest of the data is written. + + This fixes a receiver lockup condition where the peripheral and this + driver get out of sync with there head pointers. In this case the + driver has moved past buffers it owns, without clearing ownership, + which results in the peripheral and driver in a deadlock with each + other. + + From Anthony Merlino (2019-02-02). + * arch/arm/src/sam34 and sama5: Port Anthony Merlino's fix to similar + Ethernet drivers for parts in other SAM families. From Gregory Nutt + (2019-02-02). + * arch/mips/src/pic32mz: Add support for the PIC32MZ timers (driver, + lowerhalf, freerun and oneshot) From Abdelatif Guettouche (2019-02-02). + * sched/signal/sig_deliver.c: Restructure nxsig_deliver() so that the + signal handler is not called with the pre-emption disabled (or, at + least no with pre-emption disabled by nxsig_deliver() itself). From + Gregory Nutt (2019-02-03). + * sched/sched: Rename all internal, static functions from sched_* to + nxsched_* to indicate that they are NuttX internal functions. This is + only a start. Eventually, need to rename all sched_ functions + prototyped in sched/sched/sched.h and in include/nuttx with nxsched_. + From Gregory Nutt (2019-02-03). + * arch/ Signals: The saved return register state is available on the user + stack. Thic commit reorders some logic so that certain, critical + registers are preserved in the TCB. This does not make the logic 100% + secure, but does prevent some obvious things. + sched/signal/sig_delivery: Add a flag to the TCB to indicate that we + are in a signal handler. Use this flag to assure that a there a never + attempts to nest signal handling operations on a thread. This was + guaranteed before but when locking of pre-emption during signal + delivering was eliminated in a previous commit, there was a remote + possibility of an attempt to do nested signal handling. This flag + assures that there is only one signal handled at a time. From Gregory + Nutt (2019-02-03). + * This commit renames all internal OS functions defined under sched/task + so that they begin with the prefix. For example, nxtask_exit() vs. + task_exit(). From Gregory Nutt (2019-02-04). + * - sched/init/nx_bringup.c: Fix a naming collision. + - sched/init: Rename os_start() to nx_start() + - sched/init: Rename os_smp* to nx_smp* + - sched/init: Rename os_bringup to nx_bringup + - sched/init: rename all internal static functions to begin with nx_ + vs os_ + From Gregory Nutt (2019-02-04). + * graphics/nxmu/nxmu_start.c: Fix a naming collision introduced with the + last commit. Ye olde nx_start that started the NX graphics is now + nxmu_start(). + include/nuttx/nxmu.h: Due the name change, the nxmu_start() belongs + more appropriately in nxmu.h than nx.h. From Gregory Nutt (2019-02-04). + * include/nuttx/nx/nxmu.h: This header file could be lethal; it declared + an #error if CONFIG_DISABLE_MQUEUE=y. From Gregory Nutt (2019-02-04). + * libs/libc/unistd/lib_getopt.c: Add logic to reinitialize the stale + context for the FLAT/PROTECTED builds. In these builds getopt() global + varriables may be shared by many tasks. If any task exits the getopt() + loop before all command line arguments have been parsed, then getopt() + global variables will be left in a bad state. The next time getopt() + is called, this logic should detect the bad state and force the state + of getopt() to be re-initialized so that it can be reused. This logic + is not full proof (it would fail, for example, if you tried to parse + the same command line twice) but should catch the typical misuse + cases. From Xiang Xiao (2019-02-05). + * drivers/ioexpander/tca64xx.c: Fix some errors in the TCA64XX driver. + From Bruno Schwander (2019-02-06). + * configs/stm32f769i-disco/src/stm32_appinitialize.c: Florian R. + Hölzlwimmer reports that stm32_appinitialize.c often has missing OK and + NULL definitions. This should be fixed by including sys/types.h where + they are defined. From GregoryN (2019-02-06). + * libs/libc/stdio: Add newlib-nano fprintf as an option. This fprintf + code was originally adapted from AVR libc and provides improved + floating point output support, including 'g' mode and making 'f' mode + include digits past the decimal by default. However, this version does + not have any long long support. On a demonstration cortex M4 build, + this version saves about 5kB of ROM. The newlib version can be found + here: https://salsa.debian.org/electronics-team/toolchains/newlib-nano + . That project is GPL overall, but the newlib-nano printf portions are + BSD licensed as described in the COPYING.NEWLIB file. From Keith + Packard (2019-02-06). + * - arch/misoc/src/minerva: Add support for the Minerva architecture + - configs/Kconfig and misoc/nsh/defconfig: Add support for the + Verilator board. + From Ramtin Amin (2019-02-07). + * tools/lowhex.c: Fix an initialization problem that was causing some + odd behavior at the beginning of lines. From Gregory Nutt (2019-02-07). + * tools/rmcr.c: Add a tools to remove carriage returns and dangline + whitespace at the end of lines. From Gregory Nutt (2019-02-07). + * tools/nxstyle.c: Can now detect if the C comment closing is not on a + separate line. From Gregory Nutt (2019-02-08). + * tools/nxstyle.c: Make sure that all files begin with a comment on line + 1 (which should be the file header). From Gregory Nutt (2019-02-08). + * include/: Correct naming of standard header file. Should be dlfcn.h, + not dllfcn.h. From Gregory Nutt (2019-02-09). + * configs/launchxl-cc1312r1: Add support for on-board LEDs and buttons. + From Gregory Nutt (2019-02-10). + * configs/launchxl-cc1310: Clone LED and button support from the + launchxl-cc1312r1. The number of LEDs and buttons as well as DIO usage + is identical. From Gregory Nutt (2019-02-10). + * drivers/usbhost/usbhost_cdcacm.c: Fixes to the IOCTL method in + recovery of UART pointer and in names of Termios-related field. From + xhbm (2019-02-11). + * CONFIG_NFILE_DESCRIPTORS=0 can no longer be used to disable the file + system. NuttX with no file system does not make sense and is no longer + supported. From Gregory Nutt (2019-02-11). + * configs/sama5d2-xult: Move console from FLEXCOM4 to UART1. FLEXCOM4 + does not work for the Arduino serial. UART1 is used with the VCOM + provided by the EDBG. From Gregory Nutt (2019-02-11). + * Fix conditional logic: The setup seems to support a network without + sockets (CONFIG_NSOCKET_DESCRIPTORS == 0). That is not the case; if + the network is enabled, sockets must be provided. From Gregory Nutt + (2019-02-11). + * configs/launchxl-cc1312r1: Correct DIOs used to provide the UART0 + serial console. Board boots to NSH prompt now. But I am not getting + serial input. Things are probably not very stable in general. From + Gregory Nutt (2019-02-12). + * sched/: Remove the option CONFIG_BOARD_INITTHREAD. Now, if + CONFIG_BOARD_INITIALIZE is selected, then the board_initialize() logic + will ALWAYS run on an internal kernel thread. This will prevent the + problems people have had doing inappropriate board_initialization on + the IDLE thread. From Gregory Nutt (2019-02-12). + * arch/arm/src/tiva: The LauchXL-CC1312R1 NSH configuration is now fully + functional. On to bigger and better things. From Gregory Nutt + (2019-02-13). + * - Move vscanf logic to lib_sscanf.c Switched to stream interface + (tricky, because the old implementation used massive read ahead, which + isn't suitable for streams, chars already read are gone). + - Added scanf and fscanf + - Added hh, h, and ll modifiers + - Fixes for standard compliance in scanf + - Fixes for standard compliance in strto... function family (don't + consume single '-' or '+', allow sign in strotul(l)) + From Johannes (2019-02-14). + * net/tcp/tcp_send_buffered.c: Fix assertion crash when window size is + zero. From Gregory Nutt (2019-02-14). + * net/: The value ERROR should never be returned from internal OS + functions. That is reserved for returning values to appliations with + the errno value set. Within the OS, errors are returned with a negated + errno value ALWAYS. From Gregory Nutt (2019-02-14). + * libs/libc/stdio/lib_libsscanf.c: Initialized the lastc pointer to avoid + the checks for NULL. Removed a bug in the floating point parsing which + allowed several signs after each other. From Johannes (2019-02-14). + * tools/nxstyle.c: Add check for multiple definitions of local variables + on a line. From Gregory Nutt (2019-02-14). + * libs/libc/stdio/lib_libvsprintf.c: No precision specifier resulted in + precision 0 but should be precision 6. From Johannes (2019-02-15). + * libs/libc/stdio: Add support for %g format which, for these purpose, + is equivalent to %f except that trailing zeroes are suppressed. From + Gregory Nutt (2019-02-15). + * libs/libc/stdio: In the recent changes we lost the implementation of + vsscanf(). This commit restores vsscanf(). sscanf() is not just a + front end for vsscanf(). From Gregory Nutt (2019-02-15). + * libs/libc/stdio: Remove unused, non-standard functions lib_sscanf() + and lib_sprintf(). From Gregory Nutt (2019-02-15). + * libs/libc/stdio/nano_libvsprintf.c: Add long long support. + CONFIG_LIBC_LONG_LONG needs at least CONFIG_NANO_PRINTLEVEL 2. Code + size for compile without CONFIG_LIBC_LONG_LONG shouldn't be affected. + From Johannes (2019-02-15). + * nuttx/sched/mqueue: Change 'int prio' to 'unsigned int prio'. + According to open group specification, priority field in mq_* functions + should have unsigned type: + http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/mqueue.h.html + From Michał Łyszczek (2019-02-15). + * arch/arm/src/tiva/hardware: Add CC13x0 and CC13x2 I2C header files. + From Gregory Nutt (2019-02-16). + * syscall/syscall.csv: Change to mqueue function protothypes must be + reflected in the KERNEL mode proxies as well. From Gregory Nutt + (2019-02-16). + * libs/libc/stdio/Make.defs: lib_dtoa.c is only used in the + LIBC_CONFIG_NANO_PRINTF=n case. From Johannes (2019-02-16). + * Restore lib_sprintf(). It was removed because I thought was not used. + But I was wrong; there is logic in drivers/syslog that depends on + lib_sprintf(). From Gregory Nutt (2019-02-16). + * arch/arm/src/tiva/hardware/tiva_wdt.h: Add WDT register definition + header file for all LM, Tiva, and CC13xx parts. From Gregory Nutt + (2019-02-16). + * - arch/arm/src/stm32f0l0: SPI support for F0 + - arch/arm/src/stm32f0l0/Kconfig: L0 parts should select + STM32F0L0_STM32L0 + - arch/arm/src/stm32f0l0/hardware: unify names for ADC/DAC/DMA/CAN + - drivers/wireless/lpwan/sx127x/sx127x.c: return immediately when ISR0 + is called but sx127x is not initialized + - configs/nucleo-f091rc: support for sx127x + - configs/b-l072z-lrwan1/include/board.h: use HSI as default clock + source and fix typo in SPI1 pins. + From Mateusz Szafoni (2019-02-16). + * libs/libc/stdio/lib_dtoa.c: Lots of risky turmoil to get this file + closer to the NuttX coding style. Seems to check out, but still + risky. libs/libc/stdio/lib_libdtoa.c: A fix for the %g format. The + algorithm will sometimes generate number greater than the precision of + type double. This adds a check if the precision has been exceeded and + logic to remove the least significant garbage. From Gregory Nutt + (2019-02-16). + * libs/libc/stdio/nano_libvsprintf.c: Added hh type modifier (without + extending the flag variable). From Johannes (2019-02-17). + * tools/nxstyle.c: Beef up logic that detects multiple variable + definitions per line. From Gregory Nutt (2019-02-17). + * libs/libc/stdio: This commits makes the nano-printf the defualt logic + for the printf family. The legacy printf is still available via + CONFIG_LIBC_PRINT_LEGACY. This commit also modifies the nano-prinf + configure: The PRINT_LEVEL is not long selectable. Instead, a not + CONFIG_LIBC_PRINT_MINIMAL boolean setting was added and the PRINT_LEVEL + is derived from a combination of CONFIG_LIBC_PRINT_MINIMAL, + CONFIG_LIBC_FLOATINGPOINT, and CONFIG_LIBC_LONG_LONG. From Gregory + Nutt (2019-02-17). + * libs/libc/stdio: Rename lib_dtoa.c to legacy_dtoa.c; rename + lib_libvsprint.c to legacy_libvsprintf.c From Gregory Nutt (2019-02-17). + * libs/libc/stdio: Rename all nano_*.c and nano_*.h files to lib_*.c and + lib_*.h to emphasize that these are now the defaults, not an optional + implementation. From Gregory Nutt (2019-02-17). + * arch/xtensa/src/esp32/esp32_timerisr.c: Fix backward comparison. From + Gregory Nutt (2019-02-17). + * libs/libc/stdio/lib_libvsprintf.c: Adds configurable support for + numbered arguments. From Johannes (2019-02-18). + * libs/libc/stdio/Kconfig: Need to guard LIBC_NUMBERED_ARGS against + LIBC_LEGACY_PRINTF From Johannes (2019-02-18). + * - sched/init/nx_start.c: Add support for + CONFIG_BOARD_DRIVER_INITIALIZE. If this option is selected then + nx_start() will call a board-provided function board_early_initialize() + immediately after calling up_initialize(). + - Rename CONFIG_BOARD_INITIALIZE to CONFIG_BOARD_LATE_INITIALIZE. + - Rename board_initialize() to board_late_initialize() + From Gregory Nutt (2019-02-18). + * include/nuttx/compiler.h: Important fix for C++ users. compiler.h was + using the value of __STDC_VERSION__ to determine if inline functions + are supported or not. If not then the keyword inline was defined out. + Good for C but bad for C++ because C++ does not defined + __STDC_VERSION__ at all. C++ applications may draw in compiler.h + indirectly via other head files and this can result in C++ compiler + problems since 'inline' is defined out. This fix is to ignore the + (undefined) __STDC_VERSION__ if __cplusplus is defined. From Gregory + Nutt (2019-02-19). + * include/nuttx/elf.h: Adds missing extern "C" __cplusplus guard. From + Anthony Merlino (2019-02-19). + * libs/libc/stdio/lib_libvsprintf.c: Cleaned naming and allow for leading + zeros in argument number (which doesn't make sense but should be). + From Johannes (2019-02-19). + * arch/arm/src/stm32f7/stm32_i2c.c: Fix another memory access issue on a + bus error. From David Sidrane (2019-02-19). + * arch/arm/src/stm32h7 and stm32l4: Apply David Sidrane's fix for the + STM32F7 to the STM32L4 and STM32H7. The same change might be + appropropriate to STMF0/LO and STM32, but the patch does not apply + cleanly. It would have to be manually checked. From Gregory Nutt + (2019-02-19). + * libs/libc/stdio/Kconfig: CONFIG_LIBC_NUMBERED_ARGS now depends on + EXPERIMENTAL. Per Johannes: I tested numbered arguments on i.mx rt + 1050, and it isn't working. Only on Linux/MSYS 64bit all relevant data + types are size 8 bytes, and therefore my loop through the arg list is + working. On 32bit systems, all is 4 bytes except floating point + variables which is implicit 8 byte double. From Gregory Nutt + (2019-02-20). + * libs/libc/stdio/lib_libvsprintf.c: Fix typo: PRINTF_LEVEL, not + PRINT_LEVEL. From Gregory Nutt (2019-02-20). + * - libs/libc/stdio/lib_vsprintf.c and Kconfig: Numbered arguments now + work by using two pass parsing and an argument list. The maximum + number of numbered args is determined by CONFIG_LIBC_NL_ARGMAX which + is then copied into NL_ARGMAX. Size of pointer argument ('p') is + determined before output. + - include/limits.h: Define NL_ARGMAX (as well as some of the other + 'invariant values' per + http://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html) + From Johannes (2019-02-21). + * libs/libc/lib_libvsprintf.c and Kconfig: Remove + CONFIG_LIBC_PRINT_MINIMAL. The output in that configuration is + unsatisfactory and inappropriate for use with NuttX. For example, the + output from many NSH commands become corrupted and useless. Doesn't + belong in this context. From Gregory Nutt (2019-02-21). + * libs/libc/stdio/Kconfig: Add 'range 9 999999' to + CONFIG_LIBC_NL_ARGMAX. Per OpenGroup.org, the minimum value for + NL_ARGMAX is 9. From Gregory Nutt (2019-02-21). + * include/poll.h: Remove un-named union from 'struct pollfd'. It is not + required by OpenGroup.org and violates the NuttX C coding standard + because it is not C89 compatible. From Gregory Nutt (2019-02-21). + * imxrt_adc: Error in offset From David Sidrane (2019-02-22). + * drivers/net/tun.c: Re-order all TUN/TAP driver state data. Not only + was was with wasting memory due to alignement requirements, it was also + causing network packet buffers to be improperly aligned causing + problems because the network requires 16-bit packet buffer alignment + for uint16_t accesses. This alignment problem was discovered by Alan + Carvalho de Assis. From Gregory Nutt (2019-02-24). + * drivers/net/tun.c: Packet buffer size should include the configured + GUARD_SIZE. And, given how the buffers are allocated, the allocation + size must be an even number of 16-bit values to preserve alignment. + From Gregory Nutt (2019-02-24). + * drivers/net/tun.c: Cosmetic changes from review for coding style + compliance. From Gregory Nutt (2019-02-24). + * SX127X improvements + - drivers/wireless/lpwan/sx127x/sx127x: Add TX power configuration + - drivers/wireless/lpwan/sx127x/sx127x: Discard RX packets with + unsupported length + - drivers/wireless/lpwan/sx127x/sx127x: Refactor some logic + - drivers/wireless/lpwan/Kconfig: Move some hardcoded sx127x + configuration to Kconfig + - drivers/wireless/lpwan/Kconfig: Remove EXPERIMENTAL flag + - configs/b-l072z-lrwan1/sx127x: Board-specific sx127x configuration + - configs/nucleo-f091rc/sx127x: Board-specific sx127x configuration + - configs/nucleo-l073rz/sx127x: Board-specific sx127x configuration + LORA and FSK look fine but there is something missing for OOK and + communication is not working yet. + From Mateusz Szafoni (2019-02-24). + * support for pthread_mutex_timedlock From Leif Jakob (2019-02-24). + * sched/pthread/pthread_mutexlock.c: Fix an error in last PR. The + abs_timeout value as not being passed from pthread_mutex_timedlock() to + pthread_mutex_take(). From Gregory Nutt (2019-02-24). + * Missing definitions and better organistaion for STM32H7 DMA + - arch/arm/src/stm32f0l0/hardware/stm32_dma_v1.h: rename DMA channel + definitions + - arch/arm/src/stm32h7/chip/stm32_dma: separated files for MDMA, DMA, + BDMA and DMAMUX + - arch/arm/src/stm32h7/chip/stm32_dma: missing definitions for MDMA, + BDMA and DMAMUX + From Mateusz Szafoni (2019-02-25). + * Add some sx127x demo configurations + - configs/b-l072z-lrwan1/sx127x/defconfig: add configuration for sx127x + demo app + - configs/nucleo-f091rc/sx127x/defconfig: add configuration for sx127x + demo app + - configs/nucleo-l073rz/sx127x/defconfig: add configuration for sx127x + demo app + From Mateusz Szafoni (2019-02-25). + * arch/arm/src/imxrt/chip/imxrt_usb_analog.h: Add USB analog header + file. From David Sidrane (2019-02-25). + * libs/libc/pthread, syscall/, and include/sys/syscall.h: Support for + pthread_mutex_timedlock() was added recently, however no new system + call was added for the API make is usable only in the FLAT build. With + a pthread_mutex_timedlock() system call, there is no reason for a + pthread_mutex_lock() system call since it is now nothing more than an + wrapper around pthread_mutex_timedlock(), passing NULL for the time + value. The pthread_mutex_lock() syscall was removed and the + pthread_mutex_lock() implemented was moved from /sched/pthread to where + it now belows in libs/libc/pthread. From Gregory Nutt (2019-02-25). + * configs/nucleo-l073rz/src/stm32_buttons.c: By default button support + is enabled. This causes errors because button support was not + implemented for this configuration. Solution: Port button logic from + nucleo-f072 which appears to be the same. From Gregory Nutt + (2019-02-26). + * arch/arm/src/imxrt: Added OCOTP Support. From David Sidrane + (2019-02-27). + * tools/.gitignore: Ignore rmcr binary From David Sidrane (2019-02-27). + * include/pthread.h and libs/libc/pthread/pthread_spinlock.c: Add a very + preliminary implementation of the new POSIX pthread_spinlock_* + interfaces. This feature is marked EXPERIMENTAL. There are usage + model issues to be examined and there are also architectural issues + that currently limit the implemantion to the FLAT build (that is, + however, fixable when the APIs are needed. From Gregory Nutt + (2019-02-28). + * - arch/xtensa/src/esp32/esp32_serial.c: Fix some backward arguments. + Correct 2-stop bit setting. + - sched/sched/sched_waitid.c: Could exit without leaving critical + section on some error conditions. + From Gregory Nutt (2019-02-28). + * imxrt: ocotp Fixed call to undefined function. From David Sidrane + (2019-02-28). + * armv7-m: stackcheck allow faulting stack calculation to make it to the + up_assert reg dump From David Sidrane (2019-02-28). + * tools/nxstyle.c: Fix logic that detects if an operator is correctly + delimited with spaces. sched/: Various changes because sched/ C files + were used as Guinea Pigs to test nstyle.c. From Gregory Nutt + (2019-03-01). + * Improvements for H7 towards the DMA support + - arch/arm/include/stm32h7/stm32h7x3xx_irq.h: fix typos and rename + DMA1/2 irq names to match those from other STM32 + - arch/arm/src/stm32h7/chip/stm32_bdma.h: add auxiliary definitions + - arch/arm/src/stm32h7/chip/stm32_dmamux.h: add auxliary definitions + and fix some typos + - arch/arm/src/stm32h7/chip/stm32_mdma.h: add auxliary definitions and + fix some typos + - arch/arm/src/stm32h7/chip/stm32h7x3xx_dmamux.h: add DMAMAP + definitions for MDMA, DMA1, DMA2 and BDMA + - arch/arm/src/stm32h7/chip/stm32h7x3xx_memorymap.h: fix AHB1 base + adresses and add some address blocks + - arch/arm/src/stm32h7/chip/stm32h7x3xx_rcc.h: fix some definitions to + match other STM32 ports + - arch/arm/src/stm32h7/stm32_allocateheap.c: use SRAM from D2 domain + (SRAM123) for now + - arch/arm/src/stm32h7/stm32h7x3xx_rcc.c: enable clock for MDMA and BDMA + From Mateusz Szafoni (2019-03-01). + * drivers/wireless/nrf24l01.c: Fix uninitialized irq_work which was + causing a hard_fault on interrupt handler whenever something was sent + from nrf24l01_term From Petri Ahonen (2019-03-02). + * arch/arm/src/stm32h7/stm32_timerisr.c: H7 appears to ignore the + SysTick CLKSOURCE bit and use the CPU clock in all cases. From Mateusz + Szafoni (2019-03-02). + * Initial DMA support for STM32H7 + - arch/arm/src/stm32h7: SPI DMA mode + - arch/arm/src/stm32h7/chip/stm32h7x3xx_memorymap.h: add base addresses + for D1, D2 and D3 domain; use 2 bytes to specify memory region + - arch/arm/src/stm32h7/stm32h7x3xx_rcc.c: add D1 domain core prescaler + configuration + From Mateusz Szafoni (2019-03-03). + * tools/Makefile.unix, .win, and all defconfig files: Modify + tools/Makefiles to add warning on defconfig files From Alan Carvalho + de Assis (2019-03-03). + * arch/arm/src/imxrt and configs/imxrt1050-evk: Adds framebuffer support + for thje i.MXRT 1050. Includdd DCD initialization for SDRAM to provide + space for the framebufer. External code I used/ported is from NXP and + is BSD 3-clause license. From Johannes (2019-03-04). + * - libs/libc/pthread/pthread_spinlock.c: Resolve several TODO issues by + accessing up_testset() via the boardctl() interface rather than + attempting to call it directly. + - configs/boardctl.c, include/sys/boardctl.h: Add access to + architecture-specific up_testset() via boardctl(). + - arch/Kconfig's, sched/Kconfig, and include/nuttx/spinlock.h: + Spinlocks are not available unless the architecture supports the + up_testset() operation. + From Gregory Nutt (2019-03-04). + * tools/nxstyle.c: Add capability to detect CamelCase identifiers. From + Gregory Nutt (2019-03-05). + * configs/boardctl.c and include/sys/boardctl.h: Add support for + BOARDIOC_NXTERM which can be used to create an NxTerm terminal. From + Gregory Nutt (2019-03-06). + * graphics/nxterm: Remove the nxterm_unregister interface. The correct + way to unregister a device is to unlink it. From Gregory Nutt + (2019-03-06). + * configs/open1788/knxterm: Add a configuration to test NxTerms in the + PROTECTED mode. This configuration does not yet link correctly because + a few NxTerms interfaces are improperly exported from the OS: + nxterm_redraw() and nxterm_kbdin(). From Gregory Nutt (2019-03-06). + * configs/boardctl.c: Add boardctl() commands to replace direct calls to + nxterm_redraw() and nxterm_kbdin(). From Gregory Nutt (2019-03-06). + * configs/open1788/knxterm/defconfig: Add missing MPU configuration + option. From Gregory Nutt (2019-03-06). + * configs/open1788: Re-arrange PROTECTED mode link map to make more + space for large kernels with debug enabled. From Gregory Nutt + (2019-03-06). + * graphics/nxterm and configs/open1788: Various fixes to get the NxTerm + example working in PROTECTED mode with the Open1788 knxterm + configuration. Basically works until the screen becomes full and it + starts scrolling. Then characters are missing from the display. Needs + more debug and test. From Gregory Nutt (2019-03-07). + * drivers/sensors/mpu60x0.c: Initial support for TDK InvenSense MPU6000 + and MPU6050 6-axis gyroscope and accelerometers. This commit supports + SPI media only. From Bill Gatliff (2019-03-07). + * configs/stm32f429i-disco/nxhello/defconfig: Add an + apps/examples/examples/nxhello configuration. From Gregory Nutt + (2019-03-07). + * configs/omnibusf4: Initial support for the OmnibusF4 family of flight + management units. "OmnibusF4" is not a product name per se, but rather + a design spec that many product vendors adhere to. The spec defines the + major components, and how those components are wired into the + microcontroller. Airbot is one such vendor, and they publish a + schematic here: http://bit.ly/obf4pro. Other software that supports + the OmnibusF4 family include Betaflight, iNAV, and many others. PX4 + recently added support as well, using their own, non-upstreamed, + bespoke port of NuttX. No code from those resources is included in this + port. From Bill Gatliff (2019-03-08). + * libs/libnx/nxfonts: Fix a memory leak in the font cache. With a busy + NxTerm display, this could drain off all the memory pretty quickly! + From Gregory Nutt (2019-03-08). + * configs/stm32f429i-disco/src/stm32_lcd.c: Handle multiple calls to + up_fbinitialize() From Gregory Nutt (2019-03-08). + * arch/arm/src/stm32/stm32_otgfsdev.c/stm32_otghsdev, + stm32f7/stm32_otgdev.c, and stm32l4/stm32l4_otgfsdev.c: Fix a warnings + due to a function prototype mismatch. From Gregory Nutt (2019-03-08). + * tools/nxstyle.c: Was confusing hex constants with strings staring with + 'x'. Added logic to complain about hex constants containing upper case + characters. From Gregory Nutt (2019-03-09). + * - graphics/nxterm: Needs to clear display initially. Otherwise, + garbage from previous display may still be present from preceding + NxWM window. + - graphics/nxterm: Back out most of the preceding NxTerm changes + related to window size. apps/examples/nxterm passed the complete + NxTK window size. Those changes were needed to make + aps/examples/nxterm work. But NxWM passes the the size of the NxTK + main sub-window. So I needed to back out the changes and then change + the applications so that they passed the same value (the size of the + NxTK sub-window). + From Gregory Nutt (2019-03-09). + * Initial OTG support for STM32H7 and some minor improvements + - arch/arm/src/stm32h7/stm32h7x3xx_rcc.c: add support for HSI48 clock + - configs/nucleo-f207zg: add support for USB and initialize CDCACM if + configured + - configs/nucleo-h743zi: add support for USB and initialize CDCACM if + configured + - drivers/usbdev/Kconfig: fix type for USBDEV_TRACE_INITIALIDSET + - configs/teensy-3.x/usbnsh/defconfig: update config according to + change in USBDEV_TRACE_INITIALIDSET + From Mateusz Szafoni (2019-03-10). + * arch/arm/src/imxrt/imxrt_clockconfig.c: If SDRAM is actived it was + only running at 40MHz. This was becaus imxrt_clockconfig.c changed the + SEMC clock divider after the DCD was configured. This commit corrects + that. From Johannes (2019-03-10). + * configs/omnibusf4/README.txt: Add README file for OmnibusFS target. + From Bill Gatliff (2019-03-10). + * tools/nxstyle.c: Add logic to detect a blank line following a left + brace or a blank line preceding a right brace. From Gregory Nutt + (2019-03-10). + * graphics/nxmu/nxmu_start.c: Extend nxmu_start so that receives a + display number as an argument. This makes it possible to have multiple + instances of the NX server running on boards that support multiple + displays. Also includes updates to boardctl() to accept display number + paramters. From Gregory Nutt (2019-03-10). + * Add three patches about STM32 intherupts and network loopback files + - Add the missing macro STM32_IRQ_NIRQS used by + ./arch/arm/src/stm32f7/stm32_irq.c + - The struct in_addr doesn't have the member sin_addr. + - The function lib_lo_ipv6match() is for IPv6. Correct the function it + calls from lib_lo_ipv4matchto() to lib_lo_ipv6match(). Also add + CONFIG_NET_IPv6 for configuration. + From Kejun ZHOU (2019-03-11). + * arch/arm/src/stm32h7: initial support for protected build mode. Not + functional yet. It compiles without errors and passes initialization + but after entering the user app strange things happen. From Mateusz + Szafoni (2019-03-11). + * tools/nxstyle.c: Fix logic error that prevent detecion of '/' and '/=' + as operators. net/: Minor updates resulting from testing + tools/nxstyle. From Gregory Nutt (2019-03-11). + * arch/arm/include/nrf52/ and arch/arm/src/nrf52: 1. Added 52840 family + support 2. Use common irq and memory layout header file for 52832 & + 52840. From Levin Li (2019-03-12). + * binfmt/nxflat.c: Correct a double free debug assertion. This occurs + when groups are enabled: (1) once via binfmt_exit and unload_module, + and (2) once via sched_releasetcb(). this was corrected by adding + logic to free/unload the memory once and nullify the pointer so that + cannot be freed a second time. This commit resolves Bitbucket issue + #145. From Valmantas Palikša (2019-03-12). + * binfmt/nxflat.c: Update to last NxFLAT change: The logic must respect + the reference count before freeing the dspace memory region. From + Gregory Nutt (2019-03-12). + * tools/nxstyle.c: Don't complain about certain lowercase characters in + otherwise uppercase pre-processor identifers: IPv6, IPv4, ICMPv6, + IGMPv2, p as a decimal point, d signifying a divisor. It was a bad + idea to let the door open a crack for there. While they improve + readability, the inconsistently also causes other problems. From + Gregory Nutt (2019-03-12). + * arch/arm/src/nrf52: 1. added RNG device driver 2. added errdata to + correct temp which will be used by RNG module 3. use general + task_trigger / event_clear inline api for all driver. From Levin Li + (2019-03-13). + * include/nuttx/nx/nxmu.h: Remove prototype of non-existent function. + From Gregory Nutt (2019-03-13). + * This commit removes naming associated with and naming for the now + non-existent NXFE graphics layer. + - graphics/: Rename nxfe_reportposition to nxmu_reportposition. The + is no longer an nxfe layer. + - graphics/: Rename nxfe_redrawreq to nxmu_redrawreq. The is no + longer an nxfe layer. + - graphics/nxmu/nxmu.h: Rename nxfe.h to nxmu.h. There is no long an + nxfe layer. + - graphics/: Rename nxfe_state_s to nxmu_state_s. There is no longer + an nxfe layer. + - graphics/: Rename nxfe_conn_s to nxmu_conn_s. There is no longer an + nxfe layer. + From Gregory Nutt (2019-03-13). + * - graphics/: nx_openwindow() and nxtk_openwindow() now accept an + additional 'flag' parameter. This argument is not used at present but + will, eventually enable a RAM backed, per-window framebuffer. + - graphics/Kconfig: Add configuration to support a rambacked + framebuffer. Current marked as EXPERIMENTAL because this is a work in + progress. + From Gregory Nutt (2019-03-13). + * A little more progress toward the implementation of per-window + framebuffers. + - graphics/: Add logic to allocate the per-window framebuffer. + - graphics/: A few fragmentary thoughts on how a per-window + framebuffer could be represented and allocated. + Still missing: + - Logic that generates the low lever framebuffer renderers for the + per-window framebuffers, + - The logic that picks off the per-window framebuffer updates from + normal graphics device updates. This logic must update both the + per-window framebuffer and the graphics device (from the framebuffer). + From Gregory Nutt (2019-03-14). + * graphics/nxflig/pwfb: Clone logic for new bit blitters for per-window + framebuffers. From Gregory Nutt (2019-03-14). + * configs/teensy-3.x/usbnsh/defconfig: Fix a mismatch in types. From + Gregory Nutt (2019-03-14). + * graphics: Extend NXBE data structures to include the per-window + framebuffer (pwfb) vtable. Add logic to initialize the pwfb vtable. + From Gregory Nutt (2019-03-14). + * fs/procfs/fs_procfsuptime.c: Fix procfs typo. From Sebastien Lorquet + (2019-03-14). + * arch/arm/src/armv7-a/mmu.h: pdating the cp15_wrttb and cp15_wrdacr + functions to use inline assembly in the correct way. The incorrect + method was generating errors as ARMv7-a expects the MCR/MRC + instructions to provide registers as an argument(MRC p15, 0, , c2, + c0, 0) and the code was providing a constant value(and hence the build + error). From Bilal Wasim (2019-03-14). + * This commit brings the per-framebuffer logic to code-complete. Still + untested. + - graphics/nxbe: The moverectangle renderer now supports updates to + the per-window framebuffer (unclipped) as well as the graphics device + memory (clipped). + - graphics/nxbe: The filltrapezond renderer now supports updates to + the per-window framebuffer (unclipped) as well as the graphics device + memory (clipped). + - graphics/nxbe: The getrectangle method now returns data from the + per-window framebuffer if available. + - graphics/nxbe: The fillrectangle renderer now supports updates to + the per-window framebuffer (unclipped) as well as the graphics device + memory (clipped). + - graphics/nxmu: If a window supports a per-window framebuffer, then + redraw callbacks are suppressed and the device content is updated + from the shadow, per-window framebuffer. graphics/nxbe: The + copyrectangle renderer now supports updates to the per-window + framebuffer (unclipped) as well as the graphics device memory + (clipped). + - graphics/nxbe/nxbe_setsize.c: Reallocate the per-window framebuffer + when the window size changes. + From Gregory Nutt (2019-03-15). + * configs/nucleo-f446re: Add support for the Nucleo F446RE. From + Sebastien Lorquet (2019-03-15). + * Fix defconfigs. A few people have been lazy or are perhaps ignorant of + the procedures. But the have been committing .config files as though + they were defconfig files. Wrong, wrong, wrong. defconfig files are + specially formatted files that you create through 'make defconfig'. + From Gregory Nutt (2019-03-15). + * configs/open1788/nxlines/defconfig: Enable anti-aliasing. From + Gregory Nutt (2019-03-15). + * configs/open1788/pwfb: Add an example for testing per-window frame + buffers. arch/arm/src/lpc17xx: Add a configuration option to skip + over the framebuffer when adding DRAM to the heap. graphics: Early + fixes from testing per-window framebuffer. Still lots of problems. + From Gregory Nutt (2019-03-16). + * include/fixedmath.h: Add macros for conversion between types b16_t and + type double From Gregory Nutt (2019-03-16). + * app/graphics/nxbe/nxbe_setsize.c: Fix backward source/destination in + memcpy() in new per-window framebuffer logic. From Gregory Nutt + (2019-03-16). + * - graphics/nxbe/nxbe_bitmap.c: Fix another coordinate system problem. + - graphics/: Review use of device coordinate system with window + frambebuffer and make fixes accordingly. + - graphics/nxbe/nxbe_fill.c: Fix a coordinate system bug. Was trying + to update the window fraembuffer using the device coordinate system. + Need to use the relative coordinate system. + - graphics/: Use DEBUGASSERT instead of return an error since the is + no user to handle the errors within the NX server. Use + CONFIG_DEBUG_GRAPHICS instead of CONFIG_DEBUG_FEATURES in most cases. + - graphics/: Nothing under graphics/ should set the errno. + From Gregory Nutt (2019-03-17). + * libs/libnx/nxtk/nxtk_setsize.c: Add logic to redraw NXTK borders for + the case of per-window framebuffers. There are no redraw callbacks in + this case, so we cannot rely on the callbacks to redraw the borders. + From Gregory Nutt (2019-03-17). + * configs/lc823450-xgevk: Remove -nostdinc to avoid build error From + Masayuki Ishikawa (2019-03-18). + * libs/libc/libc.csv: Should be locale.h not local.h. From Joao Matos + (2019-03-18). + * libs/libnx/nxtk: Add logic to re-draw the frame when the toolbar is + added or removed. From Gregory Nutt (2019-03-18). + * libs/libc/libc.csv: Needed logic for correct compilation if not using + CONFIG_LIBC_WCHAR From Joao Matos (2019-03-18). + * libs/libnx/nxtk: Fix more cases where we were using the wrong + coordinate system. From Gregory Nutt (2019-03-18). + * binfmt/libnxflat/libnxflat_init.c: File descriptor leaks when nxflat + loading fails From Valmantas Palikša (2019-03-19). + * configs/lpcxpresso-lpc54628/pwfb: Add per-window framebuffer + configuration. From Gregory Nutt (2019-03-19). + * fs/littlefs/lfs_vfs.c: Lookahead should use bit unit not byte unit. + From Xiang Xiao (2019-03-19). + * libs/libc/string/lib_strsep.c: Add strsep BSD/Linux function. From + Xiang Xiao (2019-03-19). + * fs/mount and fs/unionfs: Support mount unionfs from nsh command. From + Xiang Xiao (2019-03-19). + * binfmt/libelf and libs/libc/modlib: Add relocation buffer table to + reduce filesystem access. From anchao (2019-03-19). + * binfmt/libelf/ and libs/libc/modlib: Add symbol buffer table to reduce + filesystem access. From anchao (2019-03-19). + * net/usrsock: Add mutual exclusion so that only user can perform a + socket request From zhangyuan7 (2019-03-19). + * net/icmp and icmpv6: Bind icmp callback from device to connection. + Resolves the issue that bind() could not be called before send() From + anchao (2019-03-19). + * net/udp/udp_callback.c: Initialize address structure to avoid random + values in padding. From anchao (2019-03-19). + * net/local/local_connect.c: Initialize lc_result before giving + lc_waitsem From zhangyuan7 (2019-03-19). + * net/local: Fixed deadlock issue by replacing nxsem_wait() with + net_lockedwait() so that we do not wait with the network locked. From + zhangyuan7 (2019-03-19). + * libs/libc/netdb: Support the nameserver change notification then we + can pass dns info from server to client in usrsock case. From Xiang + Xiao (2019-03-19). + * include/nuttx/compiler.h: Assume inline support if __STDC_VERSION__ + not defined. From Xiang Xiao (2019-03-19). + * libs/libxx/Makefile: Always add libxx_cxa_guard.cxx for uclibcxx. + From zhangyuan7 (2019-03-19). + * ibs/libc/Makefile, libs/libnx/Makefile, and mm/Makefile: Remove + obj-path MKDEPS option since make dependency target (MT) is not + supported by some toolchains. From anchao (2019-03-19). + * include/nuttx/userspace.h: Add add a new field (us_heapend) to struct + userspace_s that labels the end of the heap. From Xiang Xiao + (2019-03-19). + * arch/Kconfig: Move FPU options to a common place and unify the usage + by removing ARCH_CORTEXRxF. From Xiang Xiao (2019-03-19). + * arch/: Unify the cache interface for all architectures From Xiang + Xiao (2019-03-19). + * arch/armv7-m: Make the default NVIC_VECTAB_TBLOFF_MASK safer. The + base address of the new vector table must be aligned to the size of + the vector table extended to the next larger power of 2. From Xiang + Xiao (2019-03-19). + * arch/arm/armv7-a: Support thumb mode and fix interworking issue. + From zhangyuan7 (2019-03-19). + * arch/arm/src/armv7-a: Remove inclusion pg_macros.h for armv7-a since + this header file does not exist. From zhangyuan7 (2019-03-19). + * arch/arm/src/armv7-a: Guard some assembly files if configuration not + selected. From zhangyuan7 (2019-03-19). + * arch/arm/src/armv7-a/arm_head.S: Add weak attribute to + arm_data_initialize so platform could provide the new implementation as + needed. From zhangyuan7 (2019-03-19). + * arch/arm/src/armv7-a: Fix assemble error when including gic.h From + Xiang Xiao (2019-03-19). + * arch/arm/src/armv7-a/arm_gicv2.c: Don't use GIC_ICDDCR_ENABLEGRP1 for + NONSECURE since this bit doesn't exist in this mode. From liuzhuang + (2019-03-19). + * arch/arm/src/armv7-a/sctlr.h: Add SCR bit definitions. From Xiang + Xiao (2019-03-19). + * arm/armv7-a: Add mmu_l1_map_regions() to remove the code + duplication. From Xiang Xiao (2019-03-19). + * arch/arm: Add the initial cortex-a7 architecture support From + zhangyuan7 (2019-03-19). + * arch/arm: The last big change that unified the cache interfaces had a + bad side-effect: It also removed the memory barrier definitions that + were also in the removed architecture-specific cache.h header files. + Fixed by adding a new barriers.h header file that provides these + definitions. From Gregory Nutt (2019-03-19). + * ARMv7-A/R: Add barriers.h header file for consistency with ARMv7-M. + From Gregory Nutt (2019-03-19). + * arch/arm: Fix more errors resulting from universal cache interfaces. + The old cache-specific head file also provided a sneak way to include + other necessary header files. With the old cache.h removed, those + files all fail to build. From Gregory Nutt (2019-03-19). + * arch/arm/src/armv7-a/arm_scu.c: Another place where universal cached + control change borked a compile due to missing ARM_DSB() definition. + From Gregory Nutt (2019-03-19). + * arch/arm/src/stm32f7/stm32_tim.c: Add OUTTOGGLE mode for STM32f7 + timer From Valmantas Paliksa (2019-03-20). + * arch/arm/src/stm32f7/stm32_tim_lowerhalf.c: Add timer lowerhalf + driver for stm32f7. From Valmantas Paliksa (2019-03-20). + * drivers/can/mcp2515.c: Use kmm_zalloc to allocate device state + structure. From Valmantas Paliksa (2019-03-20). + * arch/arm/src/stm32f7/stm32_can.c: Add CAN driver with support for + three bxCAN interfaces. From Valmantas Paliksa (2019-03-20). + * arch/arm/src/stm32f7: Add ITM syslog support. From Valmantas Paliksa + (2019-03-20). + * arch/arm/src/stm32f7/stm32_can.c: Fix bittiming calculation. From + Valmantas Paliksa (2019-03-20). + * drivers/eeprom/spi_xx25xx.c: Add configurable SPI eeprom frequency. + From Valmantas Paliksa (2019-03-20). + * arch/arm/src/stm32f7/stm32_qspi.c: Added stm32f7 Quad SPI support. + From Valmantas Paliksa (2019-03-20). + * drivers/can/mcp2515.c: Fix MCP2515 compile errors. From Valmantas + Paliksa (2019-03-20). + * drivers/can/Kconfig: Add MCP2515 clock input config to KConfig. From + Valmantas Paliksa (2019-03-20). + * sched/sched and include/nuttx/arch.h: Rename sched_process_cpuload + to nxsched_process_cpuload. All internal sched_ functions should be + prefixed with nx. From Valmantas Paliksa (2019-03-20). + * arch/arm/src/armv7-a/Toolchain.defs: Correct conditional logic. Was + mixing C preprocessor and Makefile semantics. From Gregory Nutt + (2019-03-20). + * arch/arm/src/stm32/stm32_allocateheap.c: Change 'if + CONFIG_STM32_HAVE_CCM' to 'ifdef CONFIG_STM32_HAVE_CCM' to avoid a + warning when CONFIG_STM32_HAVE_CCM is not defined. From Gregory Nutt + (2019-03-20). + * binfmt/libelf/libelf_bind.c: Make naming of internal type compliant + with coding standard. Yes, the ELF32 types do not follow the standard + for historical reasons (and will be fixed someday), but let's not + perpetuate the naming violation. From Gregory Nutt (2019-03-20). + * arch/arm/src/stm32f7/stm32_qspi.c: Update for new universal cache + conrols. From Gregory Nutt (2019-03-20). + * arch/arm/src/armv7-m/up_ramvec_initialize.c: Correct bad + NVIC_VECTAB_TBLOFF_MASK definitions in previous commit. Were missing + bits in the mask. Raised DEBUGASSERT in + armv7-m/up_ramvec_initialize.c line: 144. From Mateusz Szafoni + (2019-03-20). + * libs/libnx/nxmu/nx_filltrapezoid.c: Fix a coordinate system error. + When no clipping rectangle is falls, it falls back to use the entire + window as for the clip. However, that window must then then be in + window relative coordinates, not in absoute device coordinates. From + Gregory Nutt (2019-03-20). + * configs/lpcxpresso-lpc54628: Add a configuration for + apps/examples/pwlines. From Gregory Nutt (2019-03-20). + * configs/stm32f769i-disco/netnsh/defconfig: Remove + CONFIG_STM32F7_QUADSPI=y from the configuration. This was apparently + set before the implementation was added. Now that the implementation + was added, the configuration will not build because it requires that + QSPI GPIO pin definitions be provided in the board.h header file. + From Gregory Nutt (2019-03-20). + * arch/arm/src/stm32f7/stm32_qspi.c: Fix a warning about QSPI_DMA_PRIO + being redefined. From Gregory Nutt (2019-03-20). + * arch/arm/src/stm32f7/stm32_qspi.c: Fix a warning about ARM_DSB() + being implicitly defined. From Gregory Nutt (2019-03-20). + * arch/ and configs/: Fix more errors related to cache interface + changes. From Gregory Nutt (2019-03-20). + * arch/arm/src/armv7-a/arm_addrenv_utils.c: Fix a new cache interface + related warning. From Gregory Nutt (2019-03-20). + * Backs out part of a commit. When CONFIG_SCHED_CPULOAD_EXTCLK is + defined, the prototype must still be available in nuttx/arch.h From + Gregory Nutt (2019-03-20). + * Rename sched_process_timer to nxsched_process_timer. That is the + appropriate name for an internal sched/ function (still many named + incorrectly). From Gregory Nutt (2019-03-20). + * Rename sched_timer_expiration to nxsched_timer_expiration. That is + the appropriate name for an internal sched/ function (still many named + incorrectly). From Gregory Nutt (2019-03-20). + * Rename sched_alarm_expiration to nxsched_alarm_expiration. That is + the appropriate name for an internal sched/ function (still many named + incorrectly). From Gregory Nutt (2019-03-20). + * arch/arm/src/stm32f7/stm32_qspi.c: Fix QuadSPI priority constants. + From Valmantas Paliksa (2019-03-21). + * drivers/ioexpander/gpio.c: Support reading and writing gpio pins + using cat and echo. From Valmantas Paliksa (2019-03-21). + * arch/arm/src/stm32/stm32_dfumode.c: Add logic to reboot the STM32 in + DFU mode. Current implementation only works for STM32F2 and F4. From + Bill Gatliff (2019-03-21). + * drivers/ioexpander/gpio.c: Return EINVAL if written value is not 0 + nor 1. From Valmantas Paliksa (2019-03-22). + * arch/arm/src/stm32/stm32_oneshot.c: Corrects error introduced by + and earlier commit: Also affects stm32_oneshot.c (I noticed that ps + on my STM32F4 did not show any CPU load in nuttx-7.27 onward). From + Maximilian Kriegleder (2019-03-22). + * arch/arm/src/stm32/stm32_tickless.c and + arch/arm/src/stm32/stm32_freerun.c: Apply Max's stm32_oneshot.c fix + to the tickless implementation and to the freerunning time. From + Mateusz Szafoni (2019-03-22). + * drivers/video/max7456.c: Support for the Maxim MAX7456 + on-screen-display chip. From Bill Gatliff (2019-03-24). + * configs/omnibusf4: Add MAX7546 support. From Bill Gatliff (2019-03-24). + * arch/arm/src/stm32/stm32_pwm.c: Set CCPxP and CCPxNP bits if polarity + is negative. From Mateusz Szafoni (2019-03-24). + * arch/arm/src/stm32/stm32_pwm.c: Missing commas in initializers can + break compilation in certain configurations. From Mateusz Szafoni + (2019-03-24). + +7.30 2019-05-19 Gregory Nutt + + * arch/ and config/ files: All board interfaces (those starting with + board_) must be defined in board-specific logic. Otherwise, they cannot + be customized for specialized usage by different boards. The + board_reset() interface was defined in architecture-specific logic that + only called up_systemreset(). That is useless! This change removes the + board_reset() implementation from the architecture-specific code and + re-implements it in the src/ directory of each board that has + CONFIG_BOARDCTL_RESET enabled. That is the correct functional + partitioning. From Gregory Nutt (2019-03-25). + * configs/omnibusf4/src/stm32_reset: Add boardctl() reset logic. From + Bill Gatliff (2019-03-25). + * arch/arm/src/stm32f7/stm32_qspi.c: Fix QuadSPI interrupts. This commit + essentially replaces wrongly named configuration variables + STM32F7_QSPI_INTERRUPTS into CONFIG_STM32F7_QSPI_INTERRUPTS. Also fixes + some getreg/putreg where register addresses were used instead of + register offsets From Pierre-Olivier Vauboin (2019-03-25). + * graphics/nxmu, include/nuttx/nx/nxmu.h, libs/libnx: Add new + server->client callback to notify the window client of server events. + Remove the old 'blocked' callback and just make it one case of an 'event' + callback. From Gregory Nutt (2019-03-25). + * graphics/ and libs/libnx: Implement new interfaces nx_synch() and + nxtk_synch(). This are used to synchronize the NX server with the window + client. Currently most of the logic is equivalent to nx_block() and + nxtk_block(), but with slightly different semantics. They are separate + now because they are likely to diverge in the future. From Gregory Nutt + (2019-03-25). + * configs/stm32f103-minimum/src/: USB reset was not working appropriately + since the pin connected to D+ was incorrectly defined and the pullup/down + logic was reversed. From Matias N (2019-03-25). + * configs/omnibusf4: Add board_ioctl() which is needed only if + CONFIG_BOARDCTL_IOCTL=y is selected; Update NSH configuration to enable + board IOCTLs and DFU mode reset. From Bill Gatliff (2019-03-26). + * include/limits.h: Remove the duplicate TMP_MAX definitions. The + standard requires that TMP_MAX defines be in stdio.h. From Xiang Xiao + (2019-03-26). + * include/sys/select.h: Fix compiler error when CONFIG_NSOCKET_DESCRIPTORS + is undefined. From Xiang Xiao (2019-03-26). + * arch/arm/src/armv7-a/Toolchain.defs: Fix 'cc1: warning: switch + -mcpu=cortex-a7 conflicts with -march=armv7-a switch' From Xiang Xiao + (2019-03-26). + * drivers/usbdev/cdcacm.c: This fixes a problem where the host sent a "get + descriptor" message of type "standard" with a recipient of type + "interface". Since the composite driver would only pass messages to the + child interfaces when a message was not "standard", this message was not + handled. I changed the condition so that the composite driver checks not + only if this is a "standard" message but if it is also directed to the + device. Otherwise, the handling is delegated to the children of the + composite device. From Matias N (2019-03-26). + * drivers/video/max7456.c: Adds a read-only (for now) /dev/osd0/CM + interface for obtaining the chip's onboard NVM character map data. Use + seek() to position the cursor over a desired subset of bytes, or request + a large read to obtain the entire EEPROM memory contents. Values are + returned in binary form. Use hexdump, etc. to format them for viewing. + From Bill Gatliff (2019-03-26). + * configs/nucleo-l476rg/src/stm32_gpio.c, + configs/stm32f103-minimum/src/stm32_gpio.c, and + drivers/sensors/zerocross.c: Fix some errors when debug assertions are + enabled. From Matous Pokorny (2019-03-29). + * configs/boardctl.c, include/sys/boardctl.h: Add a command to start the + VNC server. From Gregory Nutt (2019-04-02). + * drivers/syslog/syslog_stream.c: In syslog buffered mode, avoid IOB alloc + lock-up with heavy network activity. This change alters the buffered + syslog logic to use 'iob_tryalloc' instead of blocking 'iob_alloc' to + avoid syslog printing from getting stuck when all IOBs are depleted by + network activity. An issue was seen when large incoming TCP transfer + uses free IOB buffers and processing threads try to use syslog which then + block at iob_alloc. From Jussi Kivilinna (2019-04-03). + * arch/stm32f7: Support bypassing the input clock divider on the SDMMC + interface. This enables using the full clock speed provided to the SDMMC + interface with no dividing. From Anthony Merlino (2019-04-03). + * arch/arc/stm32f7: Add support for using the HSE in bypass mode, + configured by board.h From Anthony Merlino (2019-04-03). + * arch/arm/stm32f7: Fixes some macros related to OTGFS/OTGHS preventing + OTGHS from working. From Anthony Merlino (2019-04-03). + * arch/arm/src/nrf52/nrf52832_errdata.c: Fix compiler error when following + C89. From Erik Englund (2019-04-03). + * PIC32MZ: The commit corrects the gpioirq when mismatch mode is selected + and add support for edge detect mode. Slew Rate was also added for + completeness. From Abdelatif Guettouche (2019-04-03). + * libs/libc/stdio/lib_libvsprintf.c: Restore support for printing NULL + string as "(null)". Legacy printf supported printing "(null)" in place + for NULL string: printf("null: %s\n", NULL); => null: (null). This + commit restores this functionality for new printf library. From Jussi + Kivilinna (2019-04-04). + * fs/littlefs/lfs.c: Fix lfs_format bug. In superblock disk root-block + assignment, the second must be root[1]. From YanLin Zhu (2019-04-04). + * sched/pthread: Added non-standard pthread_get_stackaddr_np() and + pthread_get_stacksize_np(). From Joao Matos (2019-04-04). + * include/pthread.h and libs/libcpthread: Fixed + pthread_attr_get/setstacksize param type to size_t. From Joao Matos + (2019-04-04). + * Fixed R_OK/X_OK definitions to match POSIX. From Joao Matos (2019-04-04). + * libs/libc/locale/lib_setlocale.c: Improved error handling in + setlocale(). From Joao Matos (2019-04-04). + * libs/libc/misc/lib_utsname.c: Fixed return code in uname(). From Joao + Matos (2019-04-04). + * include/sys/syscall.h and syscall/: Added support for munmap() syscall. + From Joao Matos (2019-04-04). + * include/alloca.h: Add alloca.h. Included limited implementation of + alloc() that is only available for GCC versions 3 and above. From Joao + Matos (2019-04-04). + * configs/nucleo-144/include/board.h: Added STM32_RCC_DCKCFGR2_DSISRC + definition. From Joao Matos (2019-04-04). + * include/signal.h: Add commented out definition of the si_addr field. + From oao Matos (2019-04-04). + * arch/arm/src/stm32f7/stm32_fmc.h: Updated stm32_fmc.h with more FMC + definitions. From oao Matos (2019-04-04). + * Added support for KSZ8081RNA PHY to LPC17xx Ethernet driver. From + jjlange (2019-04-04). + * Refresh configurations. Remove CONFIG_NXWM_UNITTEST=y, no longer in + Kconfigs. From Gregory Nutt (2019-04-04). + * syscall/syscall.csv: Fix a warning due to inconsistencies in return + type. From Gregory Nutt (2019-04-04). + * syscall/syscall.csv: Correct an error in creating the munmap() proxy if + CONFIG_FS_RAMMAP is not defined. From Gregory Nutt (2019-04-04). + * graphics/, lib/libnx, include/nutt/nx: Add support for modal windows. + From Gregory Nutt (2019-04-05). + * drivers/contactless/mfrc522.c: Fixes for MFRC522. In mfrc522_read + uid.sak must be different from 0x04 not as before from 0x00. SAK == 0x00 + is a valid PICC type. Add interface to read MIFARE Ultralight data From + Mateusz Szafoni (2019-04-05). + * configs/nucleo-l073rz: add mfrc522 support From Mateusz Szafoni + (2019-04-05). + * graphics/nxbe: Implement hooks that will eventually support software + 'sprites', i.e., things like OSD functionality, a software cursor, + selection rectangles, window resize preview, etc. From Gregory Nutt + (2019-04-05). + * Added support for Ethernet PHY ioctl() on LPC17xx. From jjlange + (2019-04-05). + * include/nuttx/nx/nxcursor.h: Add a header file describing the + implementation of an NX cursor interface. From Gregory Nutt (2019-04-06). + * libs/libnx/nxmu: Add front-end, client, message handling needed for + cursor support. Still actual cursor logic yet, just message handling. + graphics/nxmu and graphics/nxbe: Add back-end message handling needed + for cursor support. No actual cursor logic yet, just message handling. + From Gregory Nutt (2019-04-06). + * graphics: Extend the definition of the cursor image structure. From + Gregory Nutt (2019-04-07). + * arch/arm/src/stm32f7: USB High speed for STM32F7 series From Ramtin + Amin (2019-04-07). + * I2C1 config on stm32f746g-disco. Typo in stm32f7/stm32_i2c.c From + Matthew Koch (2019-04-08). + * Kconfig warnings: defaults for choice values not supported From Matthew + Koch (2019-04-08). + * arch/arm/src/stm32f7: Ported the PWM from F4 to F7. From Eduard Niesner + (2019-04-08). + * graphics/nxbe: Correct some experimental cursor drawing algorithms. + From Gregory Nutt (2019-04-08). + * grahics/nxglib/nxglib.h: Move internal function prototypes from + include/nuttx/nx/nxglib.h to graphics/nxglib/nxglib.h. From Gregory Nutt + (2019-04-08). + * Support for STM32L071X and a few improvements for STM32F0L0: + arch/arm/src/stm32f0l0: add peripherals configuration for STM32L0 + arch/arm/src/stm32f0l0: a few fixes for USART + arch/arm/include/stm32f0l0/stm32f0_irq.h: use names as in other STM32 + arch/arm/include/stm32f0l0/chip.h: use names as in other STM32 + From Mateusz Szafoni (2019-04-09). + * Adds support for software cursors with differing pixel depths on multiple + displays. This bring the software cursor to code complete. Still + untested. From Gregory Nutt (2019-04-09). + * graphics/nxbe: Add some missing checks: Don't permit the software + cursor to be enabled until it has been assigned an image; don't perform + any cursor operations while the cursor is disabled. From Gregory Nutt + (2019-04-10). + * include/nuttx/usb/hid.h: The usbhid_descriptor_s struct defined in hid.h + included some optional fields that should not be hard-defined as part of + that structure. An arbitrary number of optional entries could be + included in the descriptor, but that is not properly represented. No + code on NuttX currently depends on the structure definition with an + optional descriptor so it is safe to remove. From Matias N (2019-03-30). + * arch/arm/src/stm32f7/stm32_otgdev.c: Correct hard-coded FIFO size that is + wrong for OTG FS. From Ramtin Amin (2019-04-11). + * /graphics/nxglib/cursor: Correct two locations where y was used but + where x was intended. From Gregory Nutt (2019-04-11). + * Documentation/NXGraphicsSubsystem.html: Update documentation to describe + blocking, synchronization, and cursor interfaces. From Gregory Nutt + (2019-04-11). + * arch/arm/src/stm32f: Added support for TICKLESS mode. From Valmantas + Paliksa (2019-04-12). + * arch/arm/src/stm32f7/stm32_spi.c: Add SPI DMA threshold configuration. + From Valmantas Paliksa (2019-04-12). + * arch/arm/src/stm32f7/stm32_ethernet.c: Auto-generate Ethernet MAC + address from device unique ID. From Valmantas Paliksa (2019-04-12). + * arch/arm/src/stm32f7/stm32_flash.c: Add flash block mapping support for + progmem. From Valmantas Paliksa (2019-04-12). + * arch/arm/src/stm32f7/stm32_uid.c: Add UID access. From Valmantas + Paliksa (2019-04-12). + * drivers/can/can.c: Support multiple readers of the same port From + Valmantas Paliksa (2019-04-12). + * drivers/can/mcp2515.c: mcp2515 driver optimizations. From Valmantas + Paliksa (2019-04-12). + * arch/arm/src/stm32f7/stm32_can.c: CAN fixes. From Valmantas Paliksa + (2019-04-12). + * graphics/nxbe: More work cursor coordinates. Still at least one big bug + in the logic. From Gregory Nutt (2019-04-13). + * arch/arm/src/stm32: As noted by Matias N, the FLASH base address used + was incorrect. It was using the address of the FLASH data, not the + address of the FLASH registers. From Gregory Nutt (2019-04-13). + * arch/arm/src/stm32/stm32f10xxf30xx_flash.c: RCC register access should + not be offset by FLASH register base. From Matias N (2019-04-13). + * graphics/nxbe: This seems to fix the last of software cursor bugs. On + the LPC54, it looks pretty clean. Not flickery as I feared. Probably + not so good on low end displays. Possible transient artifacts? Not + sure, maybe. Or maybe my eyes are playing tricks from staring at this + too long. From Gregory Nutt (2019-04-13). + * configs/stm32f103-minimum/src: Add PROCFS automount support From Alan + Carvalho de Assis (2019-04-14). + * net/utils: net_lock() and net_restorelock() now return a value. That + values is the standard zero on success; negated errno value on failure. + This return value is only needed for -ECANCELED. That cancellation + indication needs to ripple all the way back to the highest levels where + the cancellation can be acted on. This commit only adds the return + value; it does not add checking for the return values of net_lock() and + net_restorelock() at higher levels. That is required too. From Gregory + Nutt (2019-04-14). + * configs/stm32ldiscovery/src: Add support for board_late_initialize(), + Move common initialization logic out of board_app_initialize() into new + file stm32_bringup.c From Gregory Nutt (2019-04-15). + * drivers/leds/userled: Fix ledset validity check in ULEDIOC_SETALL + ioctl. From Jussi Kivilinna (2019-04-15). + * arch/arm/src/stm32/Kconfig: It seems one option in the timer + configuration was lost at some point. From Matias N (2019-04-15). + * stm32f7: I2C Interrupt storm fix From David Sidrane (2019-04-16). + * arch/arm/src/stm32l4/stm32l4_pwm.c Fix register addr, en_bit and resetbit + for pwm timers From Fabian Justi (2019-04-17). + * configs/nucleo-l476rg/src/nucleo-l476rg.h Fixed naming stm32l4_pwm_setup + configs/nucleo-l476rg/src/stm32_appinit.c Fixed naming stm32l4_pwm_setup + From Fabian Justi (2019-04-17). + * stm32f7: I2C track bad state. The previous commit was true draconian. + Now we track bad state and so the SW reset only when it occurs. From + David Sidrane (2019-04-17). + * arch/arm/src/stm32f7: stm32f76xx77xx_pinmap.h: Adds additional pin + alternate function for SPI2 From Anthony Merlino (2019-04-17). + * include/cxx/cstdlib: Add std::random() From Gregory Nutt (2019-04-21). + * arch/arm/src/cxd56xx and arch/arm/include/cxd56xx: Add initial CXD56xx + chip sources. From Nobuto Kobayashi (2019-04-22). + * configs/spresense: Add Spresense board support. From Nobuto Kobayashi + (2019-04-22). + * drivers/usbhost/usbhost_storage.c: Correct typo "const const" to "const". + arch/arm/src/stm32/stm32_i2s.c: In debug assertions, it on a sample rate + of 0, but based on other code comments this value implies disabling the + i2s master clock. + arch/arm/src/stm32/stm32_usbhost.h and arch/arm/src/stm32/Kconfig: Allow + vbus monitoring for the OTG_HS host driver. + From Jason Harris (2019-04-23). + * drivers/serial: The upper half serial driver configuration + CONFIG_SERIAL_DMA used to enable DMA on both RX and TX streams. This was + replaced with CONFIG_SERIAL_RXDMA and CONFIG_SERIAKL_TXDMA which will + permit supporting DMA on only one or both streams. From Gregory Nutt + (2019-04-24). + * configs/stm32f103-minimum/src/stm32_mcp2515.c: Patch up more breakage + found in build testing. Looks like fields were added and removed by + commit eb7373cedfa, but the implementation that uses the structure were + not updated. From Gregory Nutt (2019-04-24). + * arch/arm/src/stm32h7/stm32_start.c: Inclusion of nvic.h should not be + conditioned on CONFIG_ARCH_FPU. From Mateusz Szafoni (2019-04-25). + * arch/arm/src: Remove dependency on CONFIG_ARCH_FPU for inclusion of + nvic.h in all other *_start.c files. From Gregory Nutt (2019-04-25). + * nucleo-144: Regenerate f767-netnsh/defconfig. It appear that + CONFIG_NET_SOCKOPTS, is no more explicitly needed. From Phil Coval + (2019-04-25). + * configs/nucleo-h743zi/nsh/defconfig: Enable the FPU. From Jason Harris + (2019-04-25). + * Revert "sched/clock/clock_initialize.c: clock_inittime() needs to be + done with CONFIG_SCHED_TICKLESS and clock_initialize should skip + clock_inittime() for external RTC case since the RTC isn't ready yet." + This reverts commit 2bc709d4b99447f8decdc7580fdabab6dd8939b1. Commit + 2bc709d4b99447f8decdc7580fdabab6dd8939b1 was intended to handle the case + where up_timer_gettime may not start from zero case. However, this + change has the side-effect of breaking every implementation of tickless + mode: After this change the tickless timer structures are used before + they are initialized in clock_inittime(). Initialization happens later + when up_initialize is called() when arm_timer_initialize(). + + Since the tickless mode timer is very special, one solution might be to: + (1) Rename xxx_timer_initialize to up_timer_initialize, (2) Move + up_timer_initialize to include/nuttx/arch.h, and (3) Call it from clock + subsystem instead up_initialize. Basically, this change make timer + initialization almost same as rtc initialization(up_rtc_initialize). For + now, however, we just need to revert the change. From Gregory Nutt + (2019-04-26). + * nucleo-144: Mount sysfs for ifconfig for f767-netnsh/defconfig. Even if + ifconfig is working to set IP, it will not work to display NICs (without + args) From Phil Coval (2019-04-26). + * nucleo-144: Update mbed URL and fix mistakes From Phil Coval (2019-04-26). + * stm32f7: Add basic PWM support to nucleo-144 board. More PWMs and multi + channels support may be investigated and added later. Tested on + nucleo-f767zi. From Phil Coval (2019-04-27). + * configs/nucleo-h743zi: Add support for I2C devices: ssd1306, pca9635, + i2ctools From Mateusz Szafoni (2019-04-28). + * Documentation/NuttxPortingGuide.html & drivers/syslog/README.txt: vsyslog + returns nothing. From Mateusz Szafoni (2019-04-28). + * configs/same70-xplained/twm4nx: Add a configuration for test Twm4Nx + using VNC. From Gregory Nutt (2019-04-28). + * configs/nucleo-l476rg/src: Make naming of functions consistent: + stm32l4_ no stm32_. Inconsistency noted by Phil Coval in Bitbucket PR + 864. This commit takes a different approach to resolving the naming + inconsistency, however. From Gregory Nutt (2019-04-29). + * arch/arm/src/stm32l4: Add USB FS device support. From Juha Niskanen + (2019-04-29). + * configs: Update all configurations to account for the configuration + changes resulting from the separation of network initialization logic + from NSH. From Gregory Nutt (2019-04-29). + * configs/same70-xplained/twm4nx/defconfig: Updated to correctly + initialize network. I am getting a VNC display. It is incomplete and + crashes thereafter. But that is a start. From Gregory Nutt (2019-04-29). + * In many files: Remove references to CONFIG_DISABLE_SIGNALS. Signals can + no longer be disabled. From Gregory Nutt (2019-04-29). + * net/socket/getsockname.c: Fix addrlen check in socket debug features. + Getsockname checked erroneously a pointer agains 0, where the intention + was to dereference the pointer and to check the length. This causes also + a compilation failure if the code is compiled with CONFIG_DEBUG_FEATURES + and with -Werror flag set. From Jukka Laitinen (2019-04-30). + * drivers/net/phy_notify.c: Change sprintf to strncpy in phy_notify. On + some platforms, the sprintf doesn't accept a const char* as a format + argument. From Jukka Laitinen (2019-04-30). + * arch/arm/src/stm32h7: Add STM32H7 SDMMC driver. This is the initial + SDMMC driver for STM32H7. It is mostly copied from STM32F7, with + modified register addresses and bits, and IDMA added. This is still WIP; + it only works with IDMA. From Jukka Laitinen (2019-04-30). + * configs/nucleo-h743zi/include/board.h: Add default clock configuration + for SDMMC for nucleo-h743zi. From Jukka Laitinen (2019-04-30). + * arch/arm/src/stm32h7/chip/stm32h7x3xx_rcc.h: Fixes for STM32H7 RCC + definitions: (1) Fix compilation for UART7, UART8 and I2C4, (2) Add + backup domain control registers. From Jukka Laitinen (2019-04-30). + * arch/arm/src/stm32h7/stm32h7x3xx_rcc.c: Set the STM32H7 default HSI + pre-divider to 4. The I2C driver currently assumes HSI clock to be + 16MHz. From Jukka Laitinen (2019-04-30). + * arch/arm/src/stm32h7/chip/stm32h7x3xx_memorymap.h: Add the STM32H7 + SYSTEM_UID and DEBUGMCU_BASE register definitions. From Jukka Laitinen + (2019-04-30). + * arch/arm/src/stm32h7/chip/stm32h7x3xx_pinmap.h: Add the + GPIO_ETH_RMII_RXD1 pinmap definition for STM32H7. From Jukka Laitinen + (2019-04-30). + * arch/arm/src/stm32h7/stm32_i2c.c: Fix I2C4 compilation for STM32H7. From + Jukka Laitinen (2019-04-30). + * arch/arm/src/stm32h7/: Add stm32h7 Ethernet driver. This is the initial + push for the Ethernet driver. The driver has been tested to be working + on a nucleo board. This is still WIP, it doesn't for example do MAC + filtering on HW level, but just receives all ethernet packets. From + Jukka Laitinen (2019-04-30). + * arch/arm/src/stm32h7/: Add timer devices driver for STM32H7. This is + mostly a forklift from stm32f7 with some h7 specific modifications. From + Jukka Laitinen (2019-04-30). + * - Mostly arch/arm/src/imxrt and include/imxrt: This commit gets imx1020 + family support started. It is pretty similar, but subtly different, to + 1050/60 (less PLLs, less GPIO banks, differently numbered ports etc. + etc.). I think it's time to at least look at what needs to be done + before we can get these into the mainline kernel even though they're not + properly mature yet. Core memory functions, PLLs, serial and networking + are all working, but there's no stress-testing or similar been done...I'm + not aware of anything broken, but there again I haven't looked too hard. + + I want to go through and start moving each of the imxrt family-specific + files into its own subdirectory to tidy things up a bit, and remove the + vast majority of ifdefs from the mainline code...but I think it's + appropriate to separate the cleanup steps from the new-chip-support + steps to keep things a bit more compartmentalized. Next week is a travel + week so it's possible I'll get time on the cleanup side of the house. + + I can't be 100% certain I didn't inflict casualties on the imxrt1050/60 + code in the process of doing this, but nsh for 1050 and netnsh and nsh + for the 1060 both compile correctly, so if I did break anything it's + going to be properly evil and difficult to find. + + - Directory re-arrangement and splitting of each imxrt family variant + - Prevent intermittent SDCard timeouts by increasing timer in line with + spec. + - Support data dump on Hardfault + - Fix missing ccm definitions and wrong iomux offset + - Prevent hardfault when can't read from ENET PHY + - More consistent Ethernet pinmux. + From Dave Marples (2019-04-30). + * include/nuttx/usb/hid.h: The usbhid_descriptor_s struct defined in + hid.h included some optional fields that should not be hard-defined as + part of that structure. An arbitrary number of optional entries could be + included in the descriptor, but that is not properly represented. No + code on NuttX currently depends on the structure definition with an + optional descriptor so it is safe to remove. + * Documentation/NuttShell.html: Command date is misspelled as data in + chapter 2.12 Show or set the date and time (date). From Michał Łyszczek + (2019-05-01). + * configs/same70-xplained/twm4nx/defconfig: Increase packet MTU to 1500. + From Gregory Nutt (2019-05-03). + * Fix build for battery gauge From Tom Kopriva (2019-05-03). + * configs/same70-xplained/twm4nx/defconfig: Switch to 8BPP. That is the + negotiated size requested by the VNC client anyway. From Gregory Nutt + (2019-05-03). + * graphics/vnc/server/vnc_color.c: Fix an error in color conversion. From + Gregory Nutt (2019-05-03). + * configs/lpcxpresso-lpc54628: Add a Twm4Nx configuration. From Gregory + Nutt (2019-05-04). + * arch/arm/src/common/up_initialize.c: up_initialize.c needs to know about + ramlog_consoleinit() From Jason Harris (2019-05-04). + * NX graphics: This commit adds support for hiding windows. This features + is needed by Twm4Nx: When a window is iconified, the icon should appear + on the background and the window should disappear (i.e., be hidden). The + windows needs to remain healthy and to be updated in all ways, but it + cannot affect the display content. + + Conversely, when the icon is clicked, the icon needs to be hidden on + the background and the window needs to be restored in its current state + (which may be different than the state of the window at the time it + was iconified. + From Gregory Nutt (2019-05-05). + * arch/arm/src/stm32h7: Add missing parts for timer driver: Add the + missing header files, add the driver Kconfig, and add it to make + system. From Jukka Laitinen (2019-05-05). + * configs/nucleo-h743zi/include/board.h: Add the input clock frequency + definitions for all the drivers. Assumes internal clock source for all + the timers. From Jukka Laitinen (2019-05-05). + * arch/arm/src/stm32h7/stm32_tim.c: don't use hardcoded UIF interrupt + From Mateusz Szafoni (2019-05-06). + * Add missing files of BMP180 example for nucleo-l476rg From Fabian Justi + (2019-05-06). + * drivers/sensors/apds9960.c: Initial state of allocated structure was not + being set. Noted by Leif Jacob. From Gregory Nutt (2019-05-06). + * graphics/nxbe/nxbe_setvisibility.c: Fix a missed redraw command in last + NX visibility changes. From Gregory Nutt (2019-05-06). + * graphics/: Windows can now be created in the hidden state. This can be + used to clean up initial window presentation which may involve several + steps. This makes those steps all invisible until nx[tk]_setvisibility() + is called to make the windows visible. From Gregory Nutt (2019-05-07). + * libs/libnx/nxtk/nxtk_events: Fix an error in handling mouse events for + framed windows. When drawing, NX may report mouse positions outside of + the Window. The is only for NX windows, but the outside-the-side + positions were being discarded by nxtk_events(). From Gregory Nutt + (2019-05-07). + * net/sixlowpan/sixlowpan_hc06.c: Correct an endian-ness problem in HC06 + decompression. From Ivan Ucherdzhiev (2019-05-08). + * arm/src/lpc54xx/: Bring in the USB FS OHCI driver from LPC17. This is a + quick'n'dirty port that I will finish sometime later (I hope). + Currently, it is missing hardware clocking setup and is not even hooked + into the build system yet. Needless to say it does not yet even + compile. From Gregory Nutt (2019-05-08). + * Documentation/NXGraphicsSubsystem.html: Add documentation for new + nx[tk]_modal() and nx[tk]_setvisibility() interfaces. From Gregory Nutt + (2019-05-08). + * arch/arm/src/stm32f0l0: Initial ADC support and some improvements for + the STM32 M0 From Mateusz Szafoni (2019-05-09). + * configs/b-l072z-lrwan1: add ADC example From Mateusz Szafoni (2019-05-09). + * graphics/: Add new NX interfaces to query if a window is hidden or not. + From Gregory Nutt (2019-05-09). + * libs/libnx/nxtk/nxtk_opentoolbar.c: Refuse to open a toolbar of height + zero or less. From Gregory Nutt (2019-05-10). + * graphics/nxbe/nxbe_getrectangle.c: Fix an error in coordinate system + usage. Expected rectangle in device coordinate frame, but was passing + the rectangle in window-relative coordinate frame. From Gregory Nutt + (2019-05-10). + * nrf24l01: don't block in read if file descriptor is O_NONBLOCK. Add + support for "multicast" TX mode - no waiting for ACK (needs to be enabled + with fcntl SETTXPAYLOADNOACK) From Leif Jakob (2019-05-11). + * libs/libnx/nxmu/: Add a few bad input parameter checks. + configs/lpcxpresso-lpc54628/twm4nx/defconfig: Need to enable the NX + library. From Gregory Nutt (2019-05-12). + * libs/libnx/nxglib/nxglib_intersecting.c: Correct bogus logic in + nxgl_interesting. Good to know I was stupid then too and that is it not + just a recent thing. From Gregory Nutt (2019-05-13). + * arch/arm/src/stm32l4/stm32l4_usbdev.c: Add missing PWR USBV enable, + correct two USB register bits From Juha Niskanen (2019-05-14). + * arch/arm/src/stm32l4: Port HSI48 and CRS from STM32F0L0 From Juha + Niskanen (2019-05-14). + * arch/arm/src/stm32 and arch/arm/src/stm32f0l0: Port STM32F7 I2C to + STM32F3 and STM32F0L0 From Mateusz Szafoni (2019-05-15). + * configs/b-l072z-lrwan1: Add nxlines_oled example (ssd1306). Add support + for the I2C tool From Mateusz Szafoni (2019-05-15). + * configs/nucleo-f303ze: nxlines_oled example (ssd1306) From Mateusz + Szafoni (2019-05-15). + * graphics/: Fix an oversight in the implementation of per-window + framebuffers. It is true that redraw callbacks can be suppressed for all + cases ... EXCEPT ONE: When the window is resized to a larger size, then + the newly exposed territory must be drawn for the first time. From + Gregory Nutt (2019-05-16). + * graphics/nxterm and configs/boardctl.c: Replace specific interfaces + between boardctl and nxterm with a generalized IOCTL interface. From + Gregory Nutt (2019-05-16). + * graphics/nxterm: Add a new IOCTL that can be used to inform NxTerm that + the size of a window has changed. From Gregory Nutt (2019-05-16). + * configs/stm32f4discovery: Keep c++ global constructor symbols From + Masayuki Ishikawa (2019-05-17). + * arch/arm/src/stm32/Kconfig: simplify ARCH_HAVE_FPU selection and remove + redundant options for F207 From Mateusz Szafoni (2019-05-17). + * drivers/usbmisc: Add FUSB303 driver From Juha Niskanen (2019-05-17). + * sched/signal/sig_default.c: The abnormal termination handler was just + calling exit() conditionally when, for example, Ctrl-C is sent to a + task. The abnormal termination handler must obey the rules of + cancellation points: If cancelation is disabled, then the abnormal + termination logic must wait for cancelation to be re-enabled; If + cancellation is deffered then the abnormal termination logic may have to + wait for the victim task to enter or exit a cancellation point. From + Gregory Nutt (2019-05-17). + * arch/arm/src/stm32f0l0: Add support for AES, RND, and HS148 for L0. + Move HSI48 enable from stm32_usbdev.c to stm32xx_rcc.c From Mateusz + Szafoni (2019-05-17). + +7.31 2019-07-21 Gregory Nutt + + * drivers/net/telnet.c: Handle ctrl events (SIGINT, SIGSTP). From + Valmantas Paliksa (2019-05-21). + * arch/arm/src/stm32/Kconfig: Correct some typos in conditional logic. + From Maximilian Kriegleder (2019-05-21). + * configs/stm32l476vg-disco and configs/stm32l4r9ai-disco: Fix an error in + defconfig files because a line in the rcS file was longer than the + configured NSH command line. From Juha Niskanen (2019-05-21). + * arch/arm/src/stm32l4: Make STM32L4 CRS synchronization source board + configurable. + configs/nucleo-l432kc: Add new configuration settings to board.h + configs/nucleo-l452re: ditto + configs/nucleo-l496zg: ditto + configs/stm32l476vg-disco: ditto From Juha Niskanen (2019-05-21). + * configs/lpcxpresso-lpc54628: Add another Twm4Nx configuration for + working out the new CONTEMPORARY theme. From Gregory Nutt (2019-05-21). + * Removed all references to CONFIG_DISABLE_POLL. The standard POSIX poll() + can no longer be disabled. From Gregory Nutt (2019-05-21). + * Documentation/: Applies a stylesheet to static HTML files. I've also + tried to put the TOC of each document to the side, where it made sense + (in some documents the TOC was actually inside a section so it wasn't + possible). In some cases the TOC is built with a table, in others with a +
    element, so I had to accommodate for this. I also didn't go into + collapsing, although this could really help for some long TOCs. From + Matias N (2019-05-21). + * configs: Change CONFIG_NSH_MACADDR to CONFIG_NETINIT_MACADDR From + Masayuki Ishikawa (2019-05-22). + * drivers/net/telnet.c: I/O thread now offloads reading from socket from + client thread to the I/O thread. From Valmantas Palikša (2019-05-22). + * arch/mips/src/mips32/up_vfork.c: Fix a copy-paste error. On vfork, the + GP register was being set to the new SP value vs. the context GP value. + NOTED in Bitbucket issue 155. From Gregory Nutt (2019-05-22). + * graphics/nxbe/nxbe_raise.c: Fix a critical list handling bug in the + graphics system. When a lower-level window was raised while a model + window was in place, then list corruption could occur. From Gregory Nutt + (2019-05-23). + * Rename all arch//src//chip to + arch//src//hardware. This eliminates a name collision that + is usually harmless but does cause problems at the time. The problem is + because the include path includes '.' and 'chip/.', therefore an + inclusion like '#include /src//chip + and at arch//src/chip/chip From Gregory Nutt (2019-05-24). + * arch/mips/src: Previous commit used CP0 register definitions that were + not defined in the cp0.h header file. Probably these were from the + Microchip hacked up GCC toolchain but are not generally available. Fix: + Add definitions to NuttX cp0.h header file. From Gregory Nutt + (2019-05-25). + * mm/iob: Eliminate some warnings about testing the value of an undefined + pre-processor variable. From Gregory Nutt (2019-05-25). + * STM32F7 DTCM add procfs register From Daniel Agar (2019-05-25). + * fs/procfs/fs_procfs.c: procfs_initialize() is used only within + fs/procfs/fs_procfs.c and, hence, should be marked 'static'. From + Gregory Nutt (2019-05-25). + * configs/lpcxpresso-lpc54628: Modify the TWM configurations to properly + inject keyboard data. This way, in the case of multiple NxTERMs, only + the NxTerm at the top of the hierarchy gets the keyboard input. + Otherwise, it is not possible to use multiple NxTerms with each the + keyboard input going to a different NxTerm window. From Gregory Nutt + (2019-05-26). + * arch/arm/src/stm32f0: Initial support for STM32G0. From raiden00pl + (2019-05-27). + configs/: initial support for nucleo-g071rb. From raiden00pl (2019-05-27). + * Here's a patch to split the STM32 FMC/FSMC functionality (FSMC = flexible + static memory controller, FMC = flexible memory controller = FSMC + sdram + support). This commit makes FMC it's own thing rather than piggy backing + on the FSMC code. The peripherals have a few utility functions and this + commits lets you have a common function in the arch/arm/src/stm32 rather + than having duplicate functions in the board code. From Jason Harris + (2019-05-27). + * Rename STM32F0L0 to STM32F0L0G0 since it now also supports the STM32G0 + thanks to Mateusz Szafoni's contribution From Gregory Nutt (2019-05-27). + * arch/arm/src/stm32/stm32_fsmc.h: Fix the include file guarding name in + stm32/stm32_fsmc.h. From Jason Harris (2019-05-27). + * Improvements for STM32 PWM + arch/arm/src/stm32/stm32_pwm: add support for all PWM modes + arch/arm/src/stm32/stm32_pwm: add interface to change PWM mode + arch/arm/src/stm32/stm32_pwm: refactor pwm_mode_configure() + arch/arm/src/stm32/stm32_pwm: STM32_PWM_CHANx corresponds to the timer + channel and STM32_PWM_OUTx corresponds to the timer channel output + arch/arm/src/stm32/stm32_pwm: add CHAN5 and CHAN6 to PWM_TIMx_NCHANNELS + arch/arm/src/stm32/stm32_pwm: calculate the PWM_TIMx_NCHANNELS if + CONFIG_STM32_PWM_MULTICHAN is selected From raiden00pl (2019-05-28). + * arch/arm/src/stm32l4/stm32l4xrxx_rcc.c: Use Range 1 Boost mode if SYSCLK + is higher than 80 MHz From Juha Niskanen (2019-05-28). + * arch/arm/src/stm32l4/stm32l4_i2c.c: Add support for 16 and 120 MHz + timings, board can use HSI16 clock for I2C From Juha Niskanen + (2019-05-28). + * configs/stm32l4r9ai-disco: Add ksh config, some updates for I2C, SPI and + DFSDM support. From Juha Niskanen (2019-05-28). + * This commit implements RS485 RX/TX switching and RTS/CTS flow control for + the IMXRT family. It has been tested on 1020 but I don't see any reason + for issues on any other family member. From Dave Marples (2019-05-30). + * Make sure sections are aligned to 32-bits in all LD linker scripts. This + fixes and issues noted specifically for the SAMD21 by Bernd Walter, but + should be applicable to all other LD scripts as well. + configs/: Add . = ALIGN(4); before every .data section + configs/: Add . = ALIGN(4); before every ARM.extab section + configs/: Add . = ALIGN(4); before every definition of __exidx_start + configs/: Add . = ALIGN(4); before every .init_section. + configs/: Convert TABs to spaces in all ld linker scripts. This just + makes things easier to modify with scripts because the files are more + consistent. From Gregory Nutt (2019-05-30). + * arch/arm/src/stm32l4/stm32l4_hsi48.c: Enable CRS_CR_CEN with + CRS_CR_AUTOTRIMEN From Jussi Kivilinna (2019-05-29). + * arch/arm/src/stm32l4/stm32l4_pwr.c: Enable PWR peripheral for setting + USV From Jussi Kivilinna (2019-05-29). + * arch/arm/src/stm32l4/: Fix USB device PMA accesses. USB PMA accesses are + done as 16-bit words on STM32L4 instead of 32-bit words on STM32L1. From + Jussi Kivilinna (2019-05-29). + * net/tcp/tcp_send_buffered.c: Fix deadlock in iob_copyin when iob buffers + are exhausted and network lock is taken. From Valmantas Paliksa + (2019-05-29). + * arch/arm/src/stm32/Kconfig: Add MEDIUM_DENSITY selection. From Dave + Marples (2019-05-31). + * arch/arm/src/stm32/stm32_adc.c: The attached patch fixes a compilation + error when verbose analog debugging is enabled for the stm32 adc: not all + stm32s have an SQR4 register. From rajan gill (2019-05-31). + * configs/lpcxpresso-lpc54628: Enable DATE command in twm4nx1 and twm4nx2 + configurations. From Gregory Nutt (2019-06-01). + * Integrate support for the newest eZ80 ZDSII 5.3.0 toolchain. From + Gregory Nutt (2019-06-02). + * include/nuttx/net/bluetooth.h: Ignore content if CONFIG_NET_BLUETOOTH is + not set. This is necessary because bt_hci.h content was previously + commented out because it uses several compiler specific things include + zero-dimensioned arrays and uint64_t. Neither are supported by the C89 + ZiLOG ZDS-II compiler. From Gregory Nutt (2019-06-02). + * configs/axoloti: Adds initial support for the Axoloti sound/music + synthesizer board. Board is based on STM32F427 SoC. See + http://www.axoloti.com/. From Jason Harris (2019-06-02). + * arch/z80/src: Fix eZ80 compile problems due to New ZDS-II toolchain and + ongoing bit rot due to non-C89 code creeping into the core OS. From + Gregory Nutt (2019-06-02). + * configs: Fix included path used in all arch/z80 XDS-II builds (eZ80 and + z8). From Gregory Nutt (2019-06-02). + * arch/z16/src: Replicate build changes make for eZ80 and z8 for zneo. + From Gregory Nutt (2019-06-02). + * arch/z16/src/z16f/Kconfig and configs/z16f2800100zcog/scripts/Make.defs: + Add support for the latest 5.2.1 version of the ZDS-II toolchain. From + Gregory Nutt (2019-06-02). + * net/usrsock: Fix debug logs and remove DEBUGASSERT from + usrsockdev_do_request(). In a client mode, socket() will be the first + request for usrsockdev_do_request(). However, in a server mode, the + first request to accepted sockets will be recv() or others which depend + on applications. So I think we should remove this DEBUGASSERT from + usrsockdev_do_request(). From Masayuki Ishikawa (2019-06-03). + * arch/arm/src/STM32H7: Port PWM from STM32 From raiden00pl (2019-06-03). + * arch/arm/src/common/up_lwl_console.c: Add support for a 'Lightweight + Link' protocol between a target and debugger for use when you need a + console but the target doesn't have a spare serial port or other + available resource. From Dave Marples (2019-06-03). + * include/nuttx/signal.h: Fix a C89 compliance problem that cause the eZ80 + build to fail. Empty structure and unions are not accepted by the + compiler. From Gregory Nutt (2019-06-03). + * drivers/net/telnet.c: Fix a C89 non-compliance that was breaking the + eZ80 build. From Gregory Nutt (2019-06-03). + * libs/libc/stdio: Fix long long usage in all of the newer printf-related + logic: The selection CONFIG_LIBC_LONG_LONG must be ignored if the + architecture does not support long long types. From Gregory Nutt + (2019-06-03). + * mm/mm_heap/mm_sem.c: Fix error that occurs when CONFIG_CPP_HAVE_VARARGS + is not defined. In that case, the arguments to the debug macro will all + be evaluated even though they are not used any variables that are + references must at least be defined. From Gregory Nutt (2019-06-03). + * udp\udp_callback.c: Fix another C89 compatibility problem. Empty + initializers are not permitted. Caused eZ80 build failure. From Gregory + Nutt (2019-06-03). + * configs/: Update configurations for changes to apps/netutils/netinit + configuration. MAC address configuration was represented by type long + long. That is a problem for architectures that do not support type long + long. Replaces by two long configuration items. From Gregory Nutt + (2019-06-03). + * Fix several ZNeo compile issues. There are more. Pthreads: Fix a could + of places where FAR was added when it is not appropriate. This matters to + ZNeo which depends on definitions of NEAR and FAR points. From Gregory + Nutt (2019-06-03). + * include/nuttx/wqueue.h: Allow definitions even if work queues are not + enabled. This solves build failures when work queues are not enabled. + From Gregory Nutt (2019-06-03). + * More ZNeo compile fixes: include/stdio.h: Another place where misuse of + FAR makes a difference. include/nuttx/sched.h: Be consistent in use of + WDOG_ID type. ZDS-II doesn't like auto-conversions of struct wdog_s * to + WDOG_ID (which is type struct wdog_s *). From Gregory Nutt (2019-06-03). + * Various fixes to get a clean compile with the SDCC compiler. Compile is + 'almost' clean. From Gregory Nutt (2019-06-03). + * Add initial support for the MakerLisp eZ80 board. Ref: + https://makerlisp.com/ From Gregory Nutt (2019-06-04). + * arch/arm/src/cxd54xx: Adds (1) the HW pin configuration, (2) GPIO + support for cxd56xx, (3) GPIO interrupts, (4) clock support, (5) PMIC + (Power management integrated circuit) support (6) add a simple FIFO + scheduler that minimizes overhead, (6) Inter Core Communication. From + Alin Jerpelea (2019-06-05). + * arch/arm/src/cxd54xx: Add Package Configuration. The CXD56xx can come in + FCBGA 185 pin or WLCSP 100 pin package. For each package we have to pick + the right pin setup. The default configuration is set to FCBGA 185 pin + package From Alin Jerpelea (2019-06-05). + * drivers/sensor, include/nuttx/sensors: Add support for AS726X spectral + sensor From Fabian Justi (2019-06-05). + * configs/nucleo-l476rg/src/stm32_appinit.c: (1) Add I2C tool to board + init, (2) Add support for AS726X spectral sensor From Fabian Justi + (2019-06-05). + * arch/arm/src/cxd54xx: (1) Add basic support for USB connectivity, (2) add + SDHCI driver for the cxd56xx From Alin Jerpelea (2019-06-05). + * configs/makerlisp/src/ez80_spi.c: Add hooks needed by SPI driver. Move + SPI MMC/SD chip selected configuration from ez80_lowinit.c to here as is + done in other NuttX architectures. This enables support for multiple + devices on the SPI bus. From Gregory Nutt (2019-06-05). + * configs/: Rename ZDS-II start files from xxx_lowinit.c to xxx_boot.c; + rename board initialization logic from xxx_lowinit() to + xxx_board_initialize(). These changes make the ZDS-II configurations + more similar to board initialization conventions to used for other + architectures. From Gregory Nutt (2019-06-05). + * Documentation/NuttXCCodingStandard.html: Add a brief section summarizing + the major differences between the NuttX C and C++ coding standards. This + is a stop-gap measure in lieu of having a real C++ coding standard. From + Gregory Nutt (2019-06-05). + * drivers/sensors/as726x.c Fix little change from tools/indent.sh From + Fabian Justi (2019-06-06). + * arch/z80/src/eZ80/Make.defs: Fix some backward conditional logic From + Gregory Nutt (2019-06-07). + * arch/z80/src/eZ80: Integrate and verify the RTC driver From Gregory + Nutt (2019-06-08). + * nuttx/arch/z80/src: To properly follow the coding standard, the z80 + architecture common should up_mmuinit should be called + z80_mmu_initialize; the z80 architecture common should up_loweserialinit + should be called z80_lowserial_initialize; the z80 architecture common + should up_serialinit should be called z80_serial_initialize; the z80 + architecture common should up_doirq should be called z80_doirq. From + Gregory Nutt (2019-06-08). + configs/z80sim/src/z80_serial.c: Remove unused function + up_earlyserialinit(). From Gregory Nutt (2019-06-08). + arch/z80/src/common: up_addregion() must be prototyped in + nuttx/mm/mm.h, not up_internal.h. From Gregory Nutt (2019-06-08). + * arch/z80/src: Rename up_doirq.c and up_internal.h to z80_doirq.c and + z80_internal.h for better consistency with the naming conventions From + Gregory Nutt (2019-06-09). + * arch/arm/src/stm32/hardware/stm32f1xxx_pinmap.h: fix names for + complementary PWM outputs From raiden00pl (2019-06-10). + * libs/libc/time/lib_gmtimer.c: Spurious reorganization of a loop to work + around and ZDD-II internal compiler error. Might be a little bigger now, + but is also probably a more structured use of C. From Gregory Nutt + (2019-06-10). + * arch/arm/src/cxd56xx: add Power Management support From Alin Jerpelea + (2019-06-10). + * configs: Fix mac address settings for RNDIS. Recently + CONFIG_NETINIT_MACADDR_2 and CONFIG_NETINIT_MACADDR_1 were newly + introduced instead of CONFIG_NETINIT_MACADDR. This PR conforms to this + change. From Masayuki Ishikawa (2019-06-11). + * arch/arms/src/cxd56xx: (1) Add syscontrol, (2) Add the function to change + the clock speed, (3) Add pinctrl and clock ctrl functionality. From Alin + Jerpelea (2019-06-11). + * stm32/stm32_pwm.c, STM32H7/stm32_pwm.c: fix pulsecount for the number of + counts greater than 128 From raiden00pl (2019-06-12). + * configs/spresense: (1) We are using the framework to initialize the CPU, + (2) Enable PowerManager on spresense board, (3) Initialize the UART + interfaces, (4) Enable clock management using the cxd56 framework, (5) + Use timerisr on the spresense board, (6) Enable USBDEV on Spresense + board, (7) Enable SD Card support on spresense board, (8) Enable Mass + Storage on Spresense board From Alin Jerpelea (2019-06-12). + * configs/makerlisp: Add Smart Flash Programmer project. From Gregory + Nutt (2019-06-12). + * ina3221: Adds INA3221_I2C_ADDRx macro helpers. From Anthony Merlino + (2019-06-13). + * drivers/mmcsd: Fixes bug where thread gets deadlocked due to recursive + call and addresses comment regarding events. When initializing the + MMCSD, if we are being told there is a card, but we fail to initialize + it, we should not re-register for an insertion event as this will + immediately cause us to call in again. Instead, we should register for a + removal event and wait for the card to be removed and re-inserted. From + Anthony Merlino (2019-06-13). + * arch/arm/src/cxd56xx: Fix ep0 out packet handling in cxd56_usbdev.c. This + change fixes to handle ep0 out packet which exceeds EP0_MAXSIZE. For + example, 76 bytes of out packet is sent from RNDIS host during RNDIS + negotiation and finally the packet is split into two out packets (64 + bytes out packet + 12 bytes out packet). To handle these packets, actual + ep0reqlen is stored during ep0 out setup stage, and if all out packets + are received, it dispatches to cxd56_ep0setup(), otherwise, it sets up + the internal USB DMA to receive remaining out packets. From Masayuki + Ishikawa (2019-06-13). + configs/spresense: Add support for RNDIS configuration. From Masayuki + Ishikawa (2019-06-13). + * arch/arm/src/cxd56xx: Add SPI, DMA, and RTC support + configs/spresense: Enable RTC functionality on spresense board From + Alin Jerpelea (2019-06-13). + * arch/arm/src/stm32l4: if SRAM3 is used as heap, do not power it off in + stop 2 mode. From Juha Niskanen (2019-06-13). + * configs/nucleo-l432kc: Shorten some long lines, fix i2c pinout in + l432kc, add support for testing the ina219 current sensor. From + Sebastien Lorquet (2019-06-13). + * configs/spresense: Enable SPI Flash + arch/arm/src/cdx56xx: (1) Group all CXD56xx Options in one menu, (2) Add + Storage Options menu and Peripheral Support comment, (3) Add SPI Flash + support From Alin Jerpelea (2019-06-13). + * configs/stm32f4discovery/src/stm32_romfs_initialize.c: Missing colon in + declaration of local variable. From Phil Coval (2019-06-13). + * configs/nucleo-144: Add ROMFS support. Image was generated using + genromfs tool. Tested on Nucleo-f767zi. From Phil Coval (2019-06-13). + * STM32H7 Serial: Fix error when SINGLEWIRE or + CONFIG_STM32H7_SERIALBRK_BSDCOMPAT defined. From David Sidrane + (2019-06-13). + * STM32H7 Timer: Fixed compile errors with TIM13, TIM14, TIM7. From David + Sidrane (2019-06-13). + * STM32H7 ADC: Added ADC Driver, ADC clocking. From David Sidrane + (2019-06-13). + * STM32H7x3: Added ADC pins to pin map. From David Sidrane (2019-06-13). + * configs/nucleo-h743zi: Add ADC support. From David Sidrane (2019-06-13). + * drivers/serial/serial.c: Limit the number of times that the poll + semaphore is incremented. From Dave Marples (2019-06-13). + * arch/arm/src/cxd56xx: Change cxd56_gpioint_config to handle argument. + From Masayuki Ishikawa (2019-06-14). + * configs/spresense: Apply API change of cxd56_gpioint_config(). From + Masayuki Ishikawa (2019-06-14). + * arch/arm/src/cxd56xx: Add support for PWM. Add Power Management PROCFS + support. Add Timer driver. Add watchdog timer support.. From Alin Jerpelea (2019-06-14). + * configs/spresense: Add SPI configuration for spresense board. Enable PWM + support on spresense board; The powermanager procfs is disabled by + default and need to be enabled by the CONFIG_CXD56_PM_PROCFS option. + Timers can be used on the spresense board. Watchdog timer support also + added. From Alin Jerpelea (2019-06-14). + * configs/omnibusf4/src/stm32_bringup.c: Correct naming of a configuration + variable for ROMFS. From Phil Coval (2019-06-15). + * configs/stm32f4discovery/src/stm32_bringup.c: Correct naming of a + configuration variable for ROMFS. From Phil Coval (2019-06-15). + * stm32f4discovery/scripts/Make.defs: Fix .ARM.exidx section overlap + Source: https://stackoverflow.com/questions/30778614/arm-none-eabi-ld-section-arm-exidx-overlaps-section-data + From Alan Carvalho de Assis (2019-06-15). + * configs/Board.mk: Cannot call $(AR) directly. That works only with + GCC. It must, instead use the ARCHIVE command from Config.mk as do other + Makefiles. From Gregory Nutt (2019-06-15). + * configs/makerlisp: Use .ztgt files from MakerLisp. From Gregory Nutt + (2019-06-15). + * tools/ocdconsole.py: Fix small typo on ocdconsole.py script From Alan + Carvalho de Assis (2019-06-15). + * arch/arm/src/stm32f0l0g0: Fix STM32G0 error when SINGLEWIRE or + SERIALBRK_BSDCOMPAT defined (it reflects previous changes in STM32H7) + From raiden00pl (2019-06-16). + * arch/z80/src/eZ80/ez80_vectors.asm: Fix a logic error in vector + initialization From Gregory Nutt (2019-06-16). + * configs/makerlisp/nsh/defconfig: Enable Procfs, RTC, SPI-based SD + support, task name, NSH data command. Various fixes under + arch/z80/src/eZ80 for a clean compile. From Gregory Nutt (2019-06-16). + * arch/arm/src/cxd56xx: Fix cxd56_wdt.c in debug build From Masayuki + Ishikawa (2019-06-17). + * include/nuttx/wireless: Fix NRF24L01_NCMDS in ioctl.h. The last one in + nrf24l01.h is _WLCIOC(NRF24L01_FIRST + 15) From Masayuki Ishikawa + (2019-06-17). + * arch/z80/src/eZ80/ez80_spi.c: Fix to SPI baud rate calculation. Driver + now has timeouts so that at least it does not hang the system on + startup. From Gregory Nutt (2019-06-17). + * configs/makerlisp/nsh/defconfig: Enable STACKDUMP on assertion. From + Gregory Nutt (2019-06-17). + * configs/makerlisp/src/ez80_bringup.c: Fix an error that was causing + MMC/SD to fail to initialize. From Gregory Nutt (2019-06-17). + * arch/z80/src/eZ80: Add an RTC lower half driver. From Gregory Nutt + (2019-06-17). + * configs/pnev5180b: Minimal support for NXP Semiconductors' PN5180 NFC + Frontend Development Kit. This board is based on the NXP LPC1769 MCU. + At the moment there is just support for a minimal nsh configuration via + UART0. From Michael Jung (2019-06-17). + * arch/arm/src/cxd56xx: Add support to be able to read the HW UID. From + Alin Jerpelea (2019-06-17). + * configs/spresense: Add USERLED for spresense board. From Alin Jerpelea + (2019-06-17). + * drivers/wireless: Add support for Telit GS2200M Wi-Fi module From + Masayuki Ishikawa (2019-06-18). + * arch/arm/src/cxd56xx: Add Sensor Control Unit (SCU); Add I2C support; + Add ADC interface support; Use DMAC for reading sensing data from SCU on + cxd56xx chip, + configs/spresense: Enable I2CDEV for spresense board. Add useful + diagnostic LEDs on the speresense board. From Alin Jerpelea (2019-06-18). + * tools/ocdconsole.py: OCD TCL interface changed after version 0.10 of + OpenOCD. This change allows the script to work with both the older and + newer TCL interface. From Dave Marples (2019-06-18). + * arch/z80/src/eZ80: Correct setting of RTC time. From Gregory Nutt + (2019-06-18). + * arch/z80/src/eZ80/ez80_spi.c: Fix a poorly constructed loop that would + lead to hangs. From Gregory Nutt (2019-06-18). + * configs/spresense: Add support for Tilt GS2200M Wi-Fi module From + Masayuki Ishikawa (2019-06-18). + * configs/spresense: Remove SPI MMC/SD support and enable ADC support for + spresense board, From Alin Jerpelea (2019-06-19). + * drivers/usbhost: Remove duplicate const in usbhost files. From Adam + Porter (2019-06-20). + * STM32,F7,H7,L4 OTG FS/HS: Fix constant using in comparison to determine + endpoint is interrupt type. From Adam Porter (2019-06-20). + * drivers/sensors: Add driver support for the Bosch BMI160 Inertial + Measurement sensor. This driver can be used with the BMI160 sensor + connected over SPI or I2C bus + configs/spresense: enable BMI160_I2C sensor over I2C on spresense board. + From Alin Jerpelea (2019-06-20). + * drivers/usbhost/usbhost_composite.c: I'm working on a CDC/ECM driver + and in my driver's usbhost_cfgdesc() function I need access to the + class-specific descriptors. Currently these are not available if the + interface is part of a composite device, since only interface and + endpoint descriptors are copied by usbhost_copyinterface(). This commit + will also copy any class-specific interface descriptors for use in + downstream class drivers. NOTE: There's one change that might be + incorrect, where I skip interfaces with zero endpoints. I did this + because my device has two consecutive interface descriptors with the same + interface number, one for altsetting 0 with no endpoints, and another for + altsetting 1 with 1 endpoint. The loop was aborting due to finding two + interface descriptors back-to-back. From Adam Porter (2019-06-21). + * STM32F7 GPIO: Add GPIO driver. Code is inspired from stm32f3discovery + and nucleo-l476rg platforms. Tested on Nucleo-F767ZI. From Phil Coval + (2019-06-21). + * drivers/usbhost/usbhost_composite.c: The cfgdesc pointer was initialized + after the buffer had been advanced, so it was not pointing where it + should. The totallen operations at the end of the function ended up + overwriting memory belonging to the first copied interface descriptor. + From Adam Porter (2019-06-22). + * configs/pnev5180b: Add usbnsh configuration. This is basically the same + as the 'nsh' defconfig, but uses CDC/ACM as the NuttShell console + device. From Michael Jung (2019-06-22). + * STM32 USB OTG FS/HS Host: In stm32_ctrlout() in the HS and FS host + drivers, the data buffer isn't sent. This patch passes the buffer and + buflen to the stm32_ctrl_senddata() function. With this change, I am + able to send MBIM control messages to my USB modem, and read the + response. From Adam Porter (2019-06-23). + * configs/makerlisp/src/sd_main.c: Add a tiny FLASH-resident loader that + will load and start applications in Intel HEX format from an SD card. + From Gregory Nutt (2019-06-23). + * configs/spresense: Add I2CTOOL support and extend GPIO for future use; + add delay support for cxd56xx chip; for development is useful to + register I2C busses when the I2CTOOL is built; Enable GPIO interface on + spresense board. From Alin Jerpelea (2019-06-24). + * arch/arm/src/efm32/efm32_usbhost: Apply Adam Porter's STM32 fix to EFM32 + which has the same IP. From Gregory Nutt (2019-06-24). + * arch/arm/src/cxd56xx: Add I2C character driver support. For testing + purposes, we use the CXD56_I2C_DRIVER to register the /dev/i2c[] + character devices. Add battery gauge and battery charger drivers. Add + SPI-based SP card support. From Alin Jerpelea (2019-06-25). + configs/spresense: Add use o the CXD56_I2C_DRIVER to register the + /dev/i2c character devices. Enable battery gauge and battery charger + support. From Alin Jerpelea (2019-06-25). + * configs/makerlisp/src/sd_main.c: Correct some backward conditional + compilation. From Gregory Nutt (2019-06-25). + * configs/lc823450-xgevk: Remove CPU assignment for lpwork. This change + will reduce audio underrun when running dvfs auto mode. From Masayuki + Ishikawa (2019-06-26). + * configs/spresense: Enable UID functionality. To enable the UID + functionality for spresense board set BOARDCTL_UNIQUEID in menuconfig. + From Alin Jerpelea (2019-06-26). + * configs/spresense: Add USBDEV_SETNOTIFYSIG signal ID. Set signal ID for + notify USB device connection status and supply current value. From Alin + Jerpelea (2019-06-26). + * configs/makerlisp: Bring in a new configuration to support execution + entirely out of external SRAM. From Gregory Nutt (2019-06-26). + * arch/arm/src/samd2l2/hardware/samd_tc.h: Correct register bit field + definitions used with TC_CTRLBCLR and TC_CTRLSET registers. From Bernd + Walter (2019-06-26). + * libs/libc/misc/Make.defs: For platforms whose CPP tool does not support + a variable number arguments to pre-processor macros, we may still need to + build the debug functions even when CONFIG_DEBUG_FEATURES is not + selected. For example, __alert() may be needed if CONFIG_ARCH_STACKDUMP + is set. From Gregory Nutt (2019-06-26). + * configs/makerlisp: Add an sdboot configuration that will load .hex files + from the SD card. From Gregory Nutt (2019-06-26). + * configs/spresense/wifi: App config for gs2200m has been changed From + Masayuki Ishikawa (2019-06-27). + * arch/arm/src/cxd56xx: Add EMMC support for cxd56xx chip From Alin + Jerpelea (2019-06-27). + * arch/arm/src/STM32H7: Ported the QEncoder from F7 to H7. From Eduard + Niesner (2019-06-27). + * configs/makerlisp/scripts: Add a linker script to support copying the + NuttX image from FLASH into external SRAM. From Gregory Nutt (2019-06-27). + * configs/pnev5180b/nsh-cdcecm: Adds NSH configuration with UART0 and eth0 + via CDC/ECM on USB device. From Michael Jung (2019-06-28). + * arch/arm/src/STM32H7/hardware/stm32_ethernet.h: Correct ETH_MACMDIOAR. + Correct the physical layer address bits in ETH_MACMDIOAR register. From + Jukka Laitinen (2019-06-28). + * arch/mips/src/pic32mz/pic32mz-gpio.c: Use LAT instead of PORT when + writing. From Ouss4 (2019-06-28). + * arch/mips/src/pic32mz: Add DMA support. From Abdelatif Guettouche + (2019-06-28). + * configs/olimex-stm32-e407/src: Change initialization to match the way it + is done with other boards. From Gregory Nutt (2019-06-28). + * sched/semaphore/sem_holder.c: Fix a bad assertion. The comments state + correctly that we cannot make any assumptions about the number of holders + of the semaphore, yet the code asserts if there are any holders. This + makes the code behave closer to what the comments say. From Gregory Nutt + (2019-06-28). + * configs/pnev5180b/nsh-cdcecm/defconfig: CDC/ECM requires SCHED_LPWORK + From Gregory Nutt (2019-06-29). + * Various Kconfig files: Kconfig files should not select SCHED_WORKQUEUE + since that is really only is only the logical OR if SCHED_LPWORK and + SCHED_HPWORK. Selecting it has no effect other than to produce an + erroneous configuration. From Gregory Nutt (2019-06-29). + * nrf24l01: Fix PIPENO/PKTLEN bitmask in rx fifo header. In RX fifo + header, the first byte should use 5 lsb to store PKTLEN and 3 msb to + store PIPENO. However, FIFO_PIPENO_SHIFT was set to 4 which causes the + lsb of pipe number to interfere with the received packet size stored in + the fifo. This fix rx corruption when using pipe number > 0. From + Federico Braghiroli (2019-06-29). + * configs/pnev5180b/usbnsh-cdcecm: This new configuration includes a USB + Composite Device with both CDC/ACM and CDC/ECM. NuttShell provides a + terminal via CDC/ACM. A network interface (eth0) is provided via + CDC/ECM. From Michael Jung (2019-06-29). + * tools/nxstyle.c: Tool depends on the file under test containing "Private + Functions" or "Public Functions" block comments. Emit an error is + neither are present in a C source. From Gregory Nutt (2019-06-29). + * tools/nxstyle.c: Bandaid-up logic that detects left brackets on the same + line in global structure/enumeration types and initializers. From + Gregory Nutt (2019-06-29). + * arch/arm/src/imxrt/imxrt_ehci.c: Add i.MXRT ECHI driver. From Dave + Marples (2019-06-29). + * include/nuttx/net/netconfig.h: Fix warning '__MAX_UDP_MSS macro + redefined' From Adam Porter (2019-06-30). + * configs/stm32f4discovery/kernel/Makefile: Fix a problem with undefined + symbol 'abort' from GCC library. Fix by moving libgcc into recursive + archive group between --start-group and --end-group. Other + kernel/Makefiles suffer from this same issue From Gregory Nutt + (2019-06-30). + * tools/nxstyle.c: Fix error in conditional logic that was preventing + detection bad brace alignment. Add logic to handle alignment of braces + in data initializators which following slightly different indentation + rules. From Gregory Nutt (2019-06-30). + * tools/nxstyle.c: No warning for declarations that begin in column 1 + within 'extern "C"'. This is because the 'extern "C"' is conditioned on + __cplusplus so the declarations are not normally indented. From Gregory + Nutt (2019-06-30). + * libs/libc/netdb: Implemented the netdb functions getnameinfo(), + getservbyport(), and getservbyport_r(). From Michael Jung (2019-06-30). + * configs/pnev5180b/src/lpc17_romfs: pnev5180b/src/lpc17_romfs: Automount + baked-in ROMFS image. Includes support for linking a binary ROMFS image + into the nuttx executable and for mounting it during board bringup. From + Michael Jung (2019-06-30). + * drivers/usbdev/usbmsc: Fix usbmsc_exportluns declaration. Fixes the + following error "...undefined reference to `usbmsc_exportluns'". From + Alin Jerpelea (2019-07-01). + * configs/spresense: Register the procfs in the NSH configuration. This + is a configuration change in sync with the other ones. Enable + READLINE_CMD_HISTORY, enable by default SPI 4 and 5, and enable SPI to + keep all configurations in sync. From Alin Jerpelea (2019-07-01). + * net/inet: Fix tcp active close in inet_close.c. In previous + implementation, FIN packet was not sent when a socket is actively closed + (e.g. telnetd or webserver) without SO_LINGER. This issue happens + because the socket closing sequence waits for the status.cl_sem only if + lingering timeout is set. However, in many server use-cases, SO_LINGER is + not usually set and even in these cases, FIN packet must be sent + correctly. This changes the logic in inet_close.c so that it can wait + for status.cl_sem regardless of SO_LINGER. Instead, if SO_LINGERis set, + it waits for the semaphore with timeout option. From Masayuki Ishikawa + (2019-07-01). + * net/inet/inet_close.c: Last change removed SO_LINGER socket option + functionality. SO_LINGER was always enabled is CONFIG_NET_SOLINGER was + selected. This change implements a proper version of SO_LINGER. It is + based on new logic to drain the buffered TX data, integrated with network + event notification system. Supports notification when UDP or TCP write + buffer becomes empty. From Gregory Nutt (2019-07-01). + * configs/spresense: Add support for MSC and USB Composite device. Adds + usbmsc configuration. Spresense board does not have buttons and but a + template for gpio buttons that can be connected on the external header + From Alin Jerpelea (2019-07-02). + * drivers/wireless: Fix a passive close when sending a packet in gs2200m.c + From Masayuki Ishikawa (2019-07-03). + * arch/arm/src/tiva: Add a workaround for tiva with qemu. With qemu, + tiva_ifup() hangs because ethernet link status can not be set correctly. + This PR is a workaround to avoid this issue. From Masayuki Ishikawa + (2019-07-03). + * arch/arm/src/cxd56xx: Add driver for hardware image processor device to + enable the hardware image processor set CXD56_GE2D=true. From Alin + Jerpelea (2019-07-03). + * drivers/lcd: Add ILI9340 LCD Single Chip Driver. Required LCD driver + settings: LCD_MAXCONTRAST should be 255, but any value >0 and <=255 will + be accepted. LCD_MAXPOWER should be 1: 0=off, 1=on. From Alin Jerpelea + (2019-07-03). + * drivers/lcd: Add JDI LPM013M091A LCD Driver. From Alin Jerpelea + (2019-07-03). + * configs/spresense: Add support for lpm013m091a LCD, add support for + ili9340 LCD, add a new configuration to support an LCD. From Alin + Jerpelea (2019-07-03). + * arch/arm/src/stm32f7/stm32_serial.c: This adds the ability to invert and + swap RX/TX on STM32F7 UARTs. I added the TIOCGINVERT as well to reserve + the IOCTL number, but did not implement it. This is the same as for + TIOCGSINGLEWIRE. From Beat Küng (2019-07-03). + * arch/arm/src/imxrt/imxrt_usdhc.c: Implements SDIO and Multi-card support + for i.MX RT. From Dave Marples (2019-07-03). + * STM32H7 Serial: Add TIOCSINVERT and TIOCSSWAP ioctls. Ensure + TIOCSSINGLEWIRE is atomic and UE disabled. From Beat Küng (2019-07-03). + * STM32L4 Serial: Add TIOCSINVERT and TIOCSSWAP ioctls + * i.MX RT: Add TIOCSINVERT ioctls. From Beat Küng (2019-07-03). + * arch/arm/src/am335x: Add clock module registers definition. Switch to + DMTIMER1 for systick. From Petro Karashchenko (2019-07-03). + * arch/arm/src/cxd56xx: Fix DMA initialization in cxd56_dmac.c. + up_dma_initialize() must be used instead of up_dmainitialize(). From + Masayuki Ishikawa (2019-07-04). + * drivers/wireless: Introduce CONFIG_WL_GS2200M_SPI_FREQUENCY. Also, + changed usleep(100) to up_udelay(100) to avoid invalid response. From + Masayuki Ishikawa (2019-07-04). + * configs/spresense/wifi: Improve performance for webserver: (1) Enable + SPI DMA for both TX and RX, (2) Increase SPI clock speed from 4MHz to + 10MHz, (3) Increase buffer size for sendfile() from 512B to 1KBm abd (4) + Enable sendfile() for webserver. From Masayuki Ishikawa (2019-07-04). + * tools/mkexport.sh: The mcu sub-directory chip/ was renamed to hardware/ + in late May of 2019. The mkexport.sh script that copies these files was + not updated, however, until now. Noted by Alin Jerpelea. From Gregory + Nutt (2019-07-04). + * drivers/video: Add basic Video Stream and Capture implementation based + on the spresense SDK code release From Alin Jerpelea (2019-07-04). + * drivers/video: Add support for ISX012 Image sensor. + arch/arm/src/cxd56xx: Add cisif support to be able to use cameras. From + Alin Jerpelea (2019-07-04). + * arch/arm/src/imxrt: Fix serial TIOCSINVERT From David Sidrane + (2019-07-04). + * arch/arm/src/imxrt: USDHC Stopgap Fix for build breakage From David + Sidrane (2019-07-04). + * configs/spresense: add mpy defconfig From Alin Jerpelea (2019-07-05). + * arch/arm/src/STM32H7/stm32_spi.c: Correct a typo in condition + compilation. From Jonathan Richner (2019-07-05). + * arch/arm/src/kinetis: Add uart signal inversion support From Beat Küng + (2019-07-05). + * Documentation/NuttXCCodingStandard.html: Update requirements for + indenting C pre-processor statements. From Gregory Nutt (2019-07-05). + * arch/arm/src/am335x/hardware: Add register description files for DCAN + and LCD. From Petro Karashchenko (2019-07-06). + * net/icmpv6/icmpv6_autoconfig.c: Use ntohs() to convert IPv6 address from + network to host order int network debug output. From Bernd Walter + (2019-07-06). + * configs/spresense: Update defconfigs RNDIS and wifi. Enable RTC and + webserver with directory listing support. Also, changed start + year/month/day for NuttX 2019. From Masayuki Ishikawa (2019-07-06). + * arch/arm/src/am335x/hardware: Add register description files for I2C + (plus various improvements to the WDOG register definitions) From Petro + Karashchenko (2019-07-06). + * arch/arm/src/am335x/hardware: Add register description files for MCSPI. + From Petro Karashchenko (2019-07-06). + * Documentation/NuttXCCodingStandard.html: Another small change + discouraging the practice of enclosing the value argument of 'return' + statements in parentheses. From Gregory Nutt (2019-07-06). + * configus/nucleo-144: Add reset feature. Code is derives from + configs/stm32f4discovery/src/stm32_reset.c. It can be enabled using + CONFIG_BOARDCTL_RESET From Phil Coval (2019-07-07). + * video/edid/: Add some initial EDID logic ported from FreeBSD. From + Gregory Nutt (2019-07-07). + video/: Add basic configure and build support for a video subsystem. + From Gregory Nutt (2019-07-07). + * arch/arm/src/am335x/hardware/am335x_cm.h: Fix a typo in a macro name. + From Gregory Nutt (2019-07-07). + * arch/arm/src/imxrt: Implements USDHC1 & 2 selection on the imxrt. If + only one port is active (either 1 or 2) it will always be numbered as 0, + if both are active then USDHC1 will be number 0, USDHC2 will be 1. From + Dave Marples (2019-07-07). + * video/edid/edid_sort.c: Add logic to sort video modes by how close they + are to the preferred mode. This is part of the logic to pick the best + possible video mode. From Gregory Nutt (2019-07-07). + * tools/: Add spk binary format. The .spk binary format is used on + spresense and other boards based on the cxd56 arch. to enable this + binary format please set in your config CONFIG_CXD56_BINARY=y. From Alin + Jerpelea (2019-07-08). + * config/spresense: Build nuttx.spk images. Enable nuttx.spk binary image + that can be flashed on spresense board. From Alin Jerpelea (2019-07-08). + * configs/spresense: Add entry point for mpy. The entry point is needed + for the downstream projects based on spresense. From Alin Jerpelea + (2019-07-08). + * configs/nucleo-h743zi/src/stm32_spi.c: Correct typos in function + naming. From Jonathan Richner (2019-07-08). + * arch/arm/src/am335x/hardware/am335x_lcd.h: Fix a few typos. Add things + needed by the LCDC driver. From Gregory Nutt (2019-07-08). + * This change brings in an initial LCD driver sof the AM335x architecture. + This is a work in progress and so depends on EXPERIMENTAL. The code is + nearly compete, missing some clock configuration settings. It does yet + even compile properly. From Gregory Nutt (2019-07-08). + * arch/arm/src/am335x: Add logic to map the framebuffer to a non-cached, + non-buffered memory region. From Gregory Nutt (2019-07-08). + arch/arm/src/am335x: Remove struct am335x_fbinfo_s. Replaced with + configuration settings that provide the same information. From Gregory + Nutt (2019-07-08). + * arch/arm/src/am335x/am335x_sysclk.c: Add a function to return a + frequency of the system clock. From Gregory Nutt (2019-07-08). + * arch/arm/src/am335x/am335x_lcdc.c: Add logic to get/set the module + reference clock. Still one more clocking interface to do. From Gregory + Nutt (2019-07-08). + * configs/beaglebone-black/lcd/defconfig: Add a configuration for bringing + up the LCDC driver. From Gregory Nutt (2019-07-08). + * tools/: Add flash_writer for cxd56 boards. This flash writter is using + the xmodem for firmware transfer for flashing please use: + 'tools/flash_writer.py -s -c /dev/ttyUSB0 -d -b 115200 -n nuttx.spk' + From Alin Jerpelea (2019-07-09). + * Update COPYING file. Tools in the tools/ directory are not intended for + binary redistribution and may not all conform to BSD licensing. From + Gregory Nutt (2019-07-09). + * On the LPC1769 there are two 16 KiB AHB SRAM blocks, which are mapped + back to back at physical address 0x2007C000 and 0x20080000 (i.e. right + below and right above a 512 KiB boundary). Memory from those two blocks + is considered continuous when assigned to a heap. In the protected build + mode, when the memory protection unit is used, though, it must be split + into two MPU regions. This is because MPU regions must be naturally + aligned, and the 32KiB continuous address space of the two 16KiB AHB SRAM + blocks does not start at an address divisible by 32KiB. The only other + configurations that use protected build mode on lpc17xx are currently + open1788/knsh and open1788/knxterm. The LPC1788 has the AHB SRAM blocks + mapped more sanely (from an MPU region point of view), which is probably + why no problems emerged here. Both still compile with my change and + other than wasting an MPU region (which would otherwise remain unused) + should work fine. That said, I have no hardware to confirm. From + Michael Jung (2019-07-09). + * configs/pnev5180b/knsh: Add PROTECTED mode configuration with + NuttShell. From Michael Jung (2019-07-09). + * configs/beaglebone-black/src/am335x_lcd.c: Framework (only) for TDA19988 + and LCD support for Beaglebone Black. Can't use TDA19988 yet because + there is no I2C driver. In the mean time, support LCD initialization + using a fixed, configurable video mode. From Gregory Nutt (2019-07-09). + * arch/arm/src/am335x/hardware/am335x_prcm.h: Rename am335x_cm.h to + am335x_cm.h. From Petro Karashchenko (2019-07-09). + * arch/arm/src/am335x: Changes related to Control Module From Petro + Karashchenko (2019-07-09). + * arch/arm/src/am335x/Kconfig: Remove unused configuration settings left + over from original copy-paste. From Gregory Nutt (2019-07-09). + * drivers/wireless: Add channel parameter for AP mode in gs2200m.c From + Masayuki Ishikawa (2019-07-10). + * drivers/sensors: Add Bosch BMP280 Barometic pressure sensor connected + over I2C bus + drivers/sensors: Add Asahi AK09911/AK09912 compass sensor over I2C bus + From Alin Jerpelea (2019-07-10). + * syscall/: Adapt the conditional compile logic on when to include the + vfork() syscall proxy and stub to the logic used for vfork() itself. + From Michael Jung (2019-07-10). + * configs/olimex-stm32-e407/src/stm32_spi.c: Add SPI initialization + logic. From uan Flores (2019-07-10). + * drivers/sensors/vl53l1x.c: Added support for VL53L1X TOF sensor. From + Juan Flores (2019-07-10). + * drivers/lcd/tda19988.c: Now uses the new common videomode structure of + include/nuttx/video/videomode.h as do other video components. From + Gregory Nutt (2019-07-10). + * video/, include/nuttx/video/videomode.h: Separate EDID and from + videomode management. They really are separate things. From Gregory + Nutt (2019-07-10). + * video/edid: Add debug functions to dump the EDID and videomode content. + From Gregory Nutt (2019-07-10). + * viedo/videomode: Rename video/edid to video/videomode. There is more + there than just EDID but it is all basically videomode stuff. From + Gregory Nutt (2019-07-10). + * video/videomode/vesagtf.c: Bring VESA Generalized Timing Formula (GTF) + from FreeBSD. From Gregory Nutt (2019-07-10). + * video/videomode/videomode_lookup.c: At some additional lookups from + FreeBSD. Not currently used in NuttX so ifdef'ed out for now. From + Gregory Nutt (2019-07-10). + * configs/spresense: Enable internal flash storage for spresense boards. + The smartfs flash is mounted under /mnt/spif folder. From Alin Jerpelea + (2019-07-11). + * configs/spresense: For compatibility with SDK we need to change the + USER_ENTRYPOINT in all configurations to spresense_main(). From Alin + Jerpelea (2019-07-11). + * include/cxx/cstddef: Add C11++ std::nullptr_t From junmin-kim + (2019-07-11). + * configs/olimex-stm32-e407: Added BMP180 initialization and a + configuration to test the BMP180. From Juan Flores (2019-07-11). + * include/nuttx/spi/spi.h: Added standard definitions for ADC SPI device + ID. From Daniel P. Carvalho (2019-07-11). + * arch/arm/src/lpc17xx_40xx and configs/: Add support for LPC40xx family + chips. Renamed LPC17XX to LPC17XX_40XX in directory, configuration, file + names, etc., as appropriate. Corrected a few peripheral definitions and + pin functions for the LPC17xx family. Added configuration options, chip + definitions, and additional pin functions for the LPC40xx family. + configs/lpc4088-devkit/: Added board configuration for Embedded Artists + LPC4088 Developer's kit. From jjlange (2019-07-11). + configs/lpc4088-devkit/: Added board configurations for Embedded Artists + LPC4088 Quickstart board. From jjlange (2019-07-11). + * include/fixedmath.h: Regarding the single precision float to/from fixed + point conversions in fixedmath.h, I believe the floating point literals + should be appended with the letter 'f' to avoid (expensive) conversions + from single to double precision, and thereby also avoid (expensive if + done in SW) double point arithmetic (which is what is happening upon + inspection of my disassembly). From rajan gill (2019-07-11). + * arch/arm/src/lpc11xx, arch/arm/include/lpc11xx, + configs/lpcxpresso-lpc1115: Support for the LPCXpresso-LPC1115 and for + the LPC1115 architecture in general was removed after NuttX-7.30. The + LPC11 port was never really used (to my knowledge) and was no longer + supported. A snapshot of the port is still available in the Obsoleted + repository. It can be brought back into the main repository at any time + if anyone is willing to provide support for the architecture. From + Gregory Nutt (2019-07-11). + * configs/spresense: Fix and refactor cxd56_leds.c From Masayuki Ishikawa + (2019-07-12). + * arch/arm/src/cxd56xx: Add GNSS device, add Geofence Support, add UART0 + interface. UART0 is an interface with hardware flow control in the + application subsystem. From Alin Jerpelea (2019-07-12). + * configs/spresense: path correction. From Alin Jerpelea (2019-07-12). + * configs/olimex-stm32-e407: Add DAC support, add IN219 support, add timer + driver support. From Juan Flores (2019-07-12). + * arch/arm/src/stm32/Kconfig: Add the missing STM32 LCD Clock Source + Selections. From Alan Carvalho de Assis (2019-07-13). + * include/sys/syscall.h: Fixed SYS_mount syscall define when + CONFIG_FS_READABLE is undefined. From Joao Matos (2019-07-13). + * configs/stm32f769i-disco/src/stm32_pwm.c: Enable PWM support for + stm32f769i-disco board. From Gregory Nutt (2019-07-13). + * arch/arm/src/imxrt: Fix compiler error for CONFIG_IMXRT_USDHC1 && + !CONFIG_IMXRT_USDHC2 From David Sidrane (2019-07-13). + * arch/arm/src/STM32H7/stm32_ethernet.c: Fix typo in define. From + Pierre-Olivier Vauboin (2019-07-16). + * tools/flash_writer: license change. license update for project + compliance From Alin Jerpelea (2019-07-17). + * configs/stm32ldiscovery/: Add button support for stm32Ldiscovery. Add + chronometer board config. From Alan Carvalho de Assis (2019-07-17). + * configs/olimex-stm32-e407: Add support for MRF24J40 radio. From Gregory + Nutt (2019-07-18). + * configs/makerlisp/src/ez80_boot.c: The VGA display controller and + keyboard controller come up by default emulating a terminal with 'newline + mode' on. That is newlines expance to carriage-return, newline. This + patch turns that mode off. From Gregory Nutt (2019-07-20). + * configs/tm4c1294-launchpad/tools/oocd.sh: Fix syntax error. From Nathan + Hartman (2019-07-20). + * sched/sched/sched_waitpid.c: In waitpid, remember to grab the exited + child ptr. After being unblocked in waitpid, the child pointer might be + NULL. Modify to use group_exitchild to get the pointer of recent exited + child. From Yang ChungFan (2019-07-20). + +8.1 2019-09-14 Gregory Nutt + + * arch/arm/src/sam34/Kconfig: Add missing DMA configuration setting. + From Bernd Walter (2019-07-21). + * arch/mips/src/pic32mz/pic32mz-spi.c: Fix SPI Mode selection. CKE is + the inversion of the CPHA. From Ouss4 (2019-07-21). + * drivers/mtd/sst26.c: Accept the 16MBit Flash when reading the JEDEC-ID + at init. From Ouss4 (2019-07-21). + * arch/mips/src/pic32mz/pic32mz-config.h: Make the PLL input clock + configurable. From Ouss4 (2019-07-21). + * STM32F7: Fixes bad preprocessor logic preventing USB OTG HS to work + when used without external ULPI. From Anthony Merlino (2019-07-22). + * arch/arm/src/imxrt/imxrt_lpi2c.c: Slave addresses are now correctly + shifted when sending start. TX/RX FIFOs now discarded on error to + prevent FIFO underflow errors. Fixes error checking to use priv + structure and removes checking of BBF flag as it is not an error. From + Nicholas Chin (2019-07-23). + * configs/nucleo-l432kc/src/stm32_gpio.c: Added GPIO drivers for use + with /apps/examples/gpio. From Daniel P. Carvalho (2019-07-23). + * configs/nucleo-l432kc: Added Zero Cross sensor to nucleo-l432kc. From + Daniel P. Carvalho (2019-07-23). + * drivers/usbdev/rndis: Fixes issue with DEBUGASSERT when using composite + device and endpoint numbers not being the default. From Anthony + Merlino (2019-07-23). + * libs/libc/stdio/lib_libvsprintf.c: Add support for the size_t integer + qualifier 'z'. This is kind of tricky due the variety of + sizeof(size_t) on different platforms. From David Sidrane (2019-07-24). + * gs2200m with udp + - include/nuttx/wireless: Add udp support to gs2200m.h + - drivers/wireless: Add WL_GS2200M_DISABLE_DHCPC to Kconfig + - drivers/wireless: Add udp support to gs2200m.c + - configs/spresense/wifi: Enable smartfs and udp support + From Masayuki Ishikawa (2019-07-25). + * arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c: Abort I2C transfers if a + timeout has occurred. If a timeout has occurred in the middle of a I2C + transfer, the next I2C interrupt should abort any transfers and send a + stop condition to the corresponding I2C bus. Failure to do so will result + in memory corruption / undefined behavior as priv->msgs points to a + region of memory it doesn't owns anymore after lpc17_40_i2c_start + returns. From Augusto Fraga Giachero (2019-07-25). + * configs/tm4c1294-launchpad/src/tm4c_bringup.c: Enables /dev/userleds + for tm4c1294-launchpad by calling userled_lower_initialize() in + tm4c_bringup(). From Nathan Hartman (2019-07-25). + * arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c: Calculate the appropriate + timeout for I2C transfers. Depending on the bus frequency and transfer + size, I2C transactions can take quite a bit, so a fixed timeout is not a + good solution. Calculating the timeout at run time poses some overhead + but still better than aborting long transactions. From Augusto Fraga + Giachero (2019-07-25). + * net/udp: Remove net stack dependency from CONFIG_NET_BROADCAST. This + change allows us to use CONFIG_NET_BROADCAST without network stack. (i.e. + usrsock application can use broadcast) From Masayuki Ishikawa + (2019-07-26). + * STM32F7: If there is only one SDMMC it is slot 0 From David Sidrane + (2019-07-26). + * drivers/mtd/mx25rxx.c: add support for 512B sectors + - Fix for mx25rxx driver as it does not work properly + - Add mx25rxx memory chip and smartfs support in b-l475e-iot01a/nsh + config + - Update smartfs smart_scan() function From Simon Piriou (2019-07-26). + * configs/nucleo-l432kc: ADC: Change analog pins definitions and + correct DMA related issue. From Daniel P. Carvalho (2019-07-27). + * net/tcp and udp: Fix errors in the new implementation of SO_LINGER. + The tcp_drain() and udp_drain() functions were casting the working + argument to the wrong type, resulting in hangs and abnormal behavior. + There is a complexity in the tcp drain logic when the remote peer + closes the socket before all Tx data has been flushed. Sometimes we + are not notified of this case and wait the entire timeout + unnecessarily. There is a workaround in place in tcp_txdrain(), but + this really should be revisited. From Gregory Nutt (2019-07-27). + * arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c: Set speed back to + 10Mbps if 10Mmbps link negotiated. From Augusto Fraga Giachero + (2019-07-27). + * i.MXRT USDHC: This change completes SDIO support for IMXRT, and also + adds support for WiFi using the AP6212A module based on Simon Piriou's + rather excellent work. The patch should also address DavidS's concern + about width setting for USDHC1 and 2. Testing of the WiFi is minimal + so far but functionality is proven. I'm specifically not happy that + the driver doesn't recover elegantly from a DMA data checksum failure, + but that is an issue that can be dealt with in due course ... I'm + trying to get the rest of the interfaces fleshed out and the hardware + proven so it can go for pre-production build. I _think_ there's only + Bluetooth and USB-device left to implement now. From Dave Marples + (2019-07-28). + * arch/arm/src/imxrt/imxrt_clockconfig.c: Enable TRACE clocks if the + divider has been defined in the board's board.h file. From Dave + Marples (2019-07-28). + * net/udp/udp_txdrain.c: Add missing header file. From David S. Alessio + (2019-07-29). + * sched/semaphore/sem_holder.c: Fix a race in telnet with + PRIORITY_INHERITANCE and SCHED_HPWORK. Sometimes causes an assertion + to fire incorrectly. From David S. Alessio (2019-07-29). + * include/netinet/in.h: Rename __pad member to sin_zero in struct + sockaddr_in. Libwebsockets initializes the 'sin_zero' member of + sockaddr_in objects to zeros. Apparently, judging from mailing list + entries, there are platforms on which not doing this causes undefined + behavior. On NuttX compiling respective code is broken, as the + corresponding member variable is called '__pad'. Neither in the + 'nuttx' nor in the 'apps' repository did I find any reference to this + identifier. Thus, I believe its a safe bet to just rename it. UNIX + Network Programming states in this regard: "The POSIX specification + requires only three members in the structure: sin_family, sin_addr, and + sin_port. It is acceptable for a POSIX-compliant implementation to + define additional structure members, and this is normal for an Internet + socket address structure. Almost all implementations add the sin_zero + member so that all socket address structures are at least 16 bytes in + size." From Michael Jung (2019-07-29). + * arch/arm/src/tiva: Rename TM4C123GH6PMI identifiers to TM4C123GH6PM. + Rationale: In terms of firmware programming, there is no functional + difference between these parts: TM4C123GH6PMI7, TM4C123GH6PMI7R, + TM4C123GH6PMT7, and TM4C123GH6PMT7R. From a programming standpoint, + all of the above parts are TM4C123GH6PM, which means it doesn't make + sense to differentiate between PM and PMI. (The PM means 64-LQFP. The I + means temperature range -40C to +85C. It could be T meaning -40C to + +105C. The R means it ships in Tape and Reel packaging as opposed to + Tray.) From Nathan Hartman (2019-07-29). + * Only use PCLKSEL0 for ADC on LPC176x family. From jjlange (2019-07-29). + * arch/arm/src/tiva: Rename TM4C1294NC identifiers to TM4C1294NCPDT. + Rationale: TM4C1294NC is ambiguous: TM4C1294NCPDT is a 128-TQFP, + TM4C1294NCZAD is a 212-NFBGA. The TM4C1294NC part currently supported + by NuttX is the TM4C1294NCPDT used on the TI EK-TM4C1294XL "Connected + LaunchPad" (see configs/tm4c1294-launchpad). To ensure the correct + part is fully specified, this commit updates all TM4C1294NC identifiers + to TM4C1294NCPDT. From Nathan Hartman (2019-07-29). + * libs/libc/machine/arm/armv7-m: Add Cortex M4F mach optimized fabsf and + sqrtf. From David S. Alessio (2019-07-29). + * gs2200m with dhcp: + - include/nuttx/wireless: Add GS2200M_IOC_IFREQ to gs2200m.h + - drivers/wireless: Add GS2200M_IOC_IFREQ to gs2200m.c + - configs/spresense/wifi: Enable NuttX's DHCP client instead of GS2200M's + - configs/spresense: Add descriptions on wifi in README.txt + From Masayuki Ishikawa (2019-07-30). + * libs/libc/machine/arm/armv7-m: Fix build error for elf From Masayuki + Ishikawa (2019-07-30). + * Documenation/, configs/: Fix typos and one HTML syntax error. Fix + HTML syntax error in Documentation/NfsHowto.html: -> + html tag. From Nathan Hartman (2019-07-30). + * fs/dirent/fs_opendir.c: Fix typo and style. opendir() did set errno + to a negative value in one error case. Fixed some coding style issues + found by nxstyle. From Michael Jung (2019-07-31). + * libs/libc/dirent/: Added alphasort() implementation, scandir() + implementation and DT_* definitions to include/dirent.h. Apparently + those definitions are not required by POSIX, but are part of 4.3BSD and + available in glibc as well. From Michael Jung (2019-07-31). + * libs/libc/dirent/lib_scandir.c: Do not build in PROTECTED or KERNEL + mode builds. Add FAR to some pointers. Minor comment updates. From + Gregory Nutt (2019-07-31). + * STM32F7: Serial add HW HS on UART 4 & 5 From David Sidrane + (2019-08-01). + * sched/task/task_exithook.c: nxtask_signalparent() in task_exithook.c + may invalidate the group's parent task ID (tg_ppid) too soon. The + tg_ppid field is use only to remember the parent tasks ID so that it + can send the SIGCHLD signal to it. So it must stay valid until SIGCHLD + has been sent. In nxtask_signalparent(), it calls nxtask_sigchild() to + send SIGCHLD to the parent, then invalidates tg_ppid. That would be + okay, except that the SIGCHLD is only sent when the last member of the + group terminates. That is incorrect; tg_ppid can be invalidated too + soon and, as a consequence, SIGCHLD would never be sent. Noted by + Jeongchan Kim in the Google group: + https://groups.google.com/forum/#!topic/nuttx/SXd8fVwVKBk From Gregory + Nutt (2019-08-01). + * confgs/z80sim/src/z80_serial.c: Fix uart_dev_t initializer: pollfds + is a array of pointers and, hence, the NULL initializer must be + included in braces. Noted by Paul Osmialowski in Issue #160. From + Gregory Nutt (2019-08-01). + * z80sim/src/z80_irq.c: Missed a name change + up_irqinitialize->z80_irq_initialize. From Gregory Nutt (2019-08-01). + * - STM32{L4|F4|H7}: Serial add HW HS on UART 4 & 5 + - STM32: Serial add HW HS on UART 4 & 5 + - STM32F7: Serial update copyright date + - STM32H7: Serial add HW HS on UART 4 & 5 + - STM32L4: Serial add HW HS on UART 4 & 5 + From David Sidrane (2019-08-01). + * STM32H7 RCC: Fix RCC register definitions and typos in ADC/UART + STM32H7 ADC: Fix internal channel numbers + STM32H7 UART: Fix typo in UART8 configuration From Markus Bernet + (2019-08-02). + * sched/: Correct some naming. The NuttX task groups have been using + the acronym 'gid' and also the type 'gid_t' for the the task group ID. + That is incorrect. Than naming is reserved for use with group + permissions. So these were all named to grpid and grpid_t so that it + is clearer that these refer to NuttX task group IDs, and not to group + permissions. From Gregory Nutt (2019-08-02). + * arch/arm/src/tiva, include/nuttx/sensors: Reinstate TM4C qencoder + driver and expand its ioctls. + arch/arm/src/tiva/Kconfig: + - Add TIVA_HAVE_QEI0, TIVA_HAVE_QEI1 as applicable to each + ARCH_CHIP_TM4C12*. + - Add config TIVA_QEI, TIVA_HAVE_QEI0, TIVA_HAVE_QEI1. + - Add config TIVA_QEI0, config TIVA_QEI1. + arch/arm/src/tiva/common/tiva_qencoder.c: + - Rewrite tiva_qe_setup(). + - Replace tiva_qe_ppr() with tiva_qe_resetatppr(). + - Add tiva_qe_resetatmaxpos(), tiva_qe_resetatindex(). + arch/arm/src/tiva/hardware/tiva_qencoder.h: + - Add missing definitions: SIGMODE_QUADRATURE, SIGMODE_CLK_AND_DIR, + SWAP_NO_SWAP, SWAP_PHA_PHB. + arch/arm/src/tiva/tiva_qencoder.h: + - Rename TIVA QEI ioctl QEIOC_PPR to QEIOC_RESETATPPR. + - Add TIVA QEI ioctl identifiers QEIOC_RESETATMAXPOS, QEIOC_RESETATINDEX. + include/nuttx/sensors/qencoder.h: + - Increase QE_TIVA_NCMDS from 3 to 5. From Nathan Hartman (2019-08-02). + * libs/libc/grp: Added stubbed implementations of getgrgid, getgrgid_r, + getgrnam, getgrnam_r, and initgroups. These functions are essentially + stubs pretending that NuttX supported groups and that the only + configured group in the system was 'root' with gid 0. The intend is + not to provide meaningful new features, but to ease porting of foreign + source code to NuttX. From Michael Jung (2019-08-03). + * libs/libc/grp/lib_grp.c: Fix a warning when compiling on a 64-bit + simulation. Cannot cast a pointer to unsigned in that case because + unsigned (int) is only 32-bits, but the pointer is 64-bits. From + Gregory Nutt (2019-08-03). + * configs/sim/include/etc.tar.gz, nsh_romfsimg.h: Improve the format of + the /etc/passwd format. It is now a little more similar to other + systems. Add an /etc/group file to support future testing. From + Gregory Nutt (2019-08-03). + * libc/pwd: Added stubbed implementations. Added stubbed implementations + of getpwuid, getpwuid_r, getpwnam, and getpwnam_r. These functions are + essentially stubs pretending that NuttX supported users and that the + only configured user in the system was 'root' with uid 0. The intend + is not to provide meaningful new features, but to ease porting of + foreign source code to NuttX. From Michael Jung (2019-08-04). + * Rename the arch/risc-v/src/gap8/gap.h to arch/risc-v/src/gap8/gap8.h + From Kejun ZHOU (2019-08-04). + * libs/libc/pwd and libs/libc/grp: Modify to get user/group data from + /etc/passwd and /etc/group if so configured. + libs/libc/pwd/lib_find_pwdfile.c: Add logic to look up user + information in /etc/passwd file, if available. + libs/libc/grp/lib_find_grpfile.c: Add logic to look up group + information in /etc/group file, if available. + From Gregory Nutt (2019-08-04). + * arch/arm/src/tiva: LM3S, LM4F, TM4C: Fix GPIO IRQ error, ports R, S, + T. Preprocessor logic for CONFIG_TIVA_GPIOx_IRQS was setting/clearing + port Q defines when it should act on ports R, S, T. gpioport2irq() was + missing handling for port T. From Nathan Hartman (2019-08-04). + * Move board-related files to new boards/ folder. This effectively + renames the configs/ directory to boards/. This is the first step in a + much larger effort. This is the proposed layout after all of the change: + + boards/: - folder containing board folders + : - name of each board + drivers/: - extra drivers specific for platform + include/: - header files for the boars + scripts/: - extra scripts specific for platform + src/: - board specific code + tools/: - extra tools specific for platform + configs/: - board specific configuration(s) + + Replaced configs/ with boards/ in: Kconfig, Makefile, tools/Makefile.*, + all Make.defs, tools/*.sh, tools/*.bat, tools/*.mk, .c and .h files + under boards/ From Alin Jerpelea (2019-08-05). + * Change naming configs/ to boards/ in comments, Documentation, etc. + From Gregory Nutt (2019-08-05). + * net/udp/udp_psock_sendto_buffered.c: Fixes a copy-paste error in the + new SO_LINGER code: CONFIG_TCP_NOTIFIER to CONFIG_UDP_NOTIFIER. From + Juha Niskanen (2019-08-05). + * Move board/ configuration directories to configs/ folder. This effects + all board directories under boards/. From Alin Jerpelea (2019-08-05). + * tools/configure.sh and configure.c. Update to preserve backward + compatibility in usage after the move of board configuration + directories under board/configs/. From Gregory Nutt (2019-08-05). + * tools/testbuild.sh: Fixes needed for changes to boards/ directory + structure. From Gregory Nutt (2019-08-05). + * Change references to boards// to + boards//configs/ in comments, Documentation, URLs. From + Gregory Nutt (2019-08-05). + * tools/refresh.sh: Fix the configuration refresh script for changes to + configuration paths. From Gregory Nutt (2019-08-05). + * boards/: Fix more comments related to the reorganization of the board + configuration directories. From Gregory Nutt (2019-08-05). + * kinetis: i2c transfer ensure correct result returned. + kinetis_i2c_transfer released the mutex then fetched the state, this + resulted in returning the correct results. From David Sidrane + (2019-08-05). + * tools/configure.sh and .c: When dumping available configurations, omit + the 'config/' in the path. From Gregory Nutt (2019-08-05). + * tools/: Change preferred argument of configurations tools to use ':' + as the delimiter between and . This is to + emphasize that this is not a path; it is configuration specification. + The legacy '/' delimiter is still supported but not recommend and not + advertised. Updated configurations instructions in README.txt files to + show ':' delimiter vs '/' delimiter. Update all configuration-related + tools to accept ':' separator between board and configuration name. + From Gregory Nutt (2019-08-05). + * sched/mqueue/mq_desclose.c: Add a test to verify that message queue is + closed by the same task group that opened it. If not, then list + corruption would result. This test is only performed if + CONFIG_DEBUG_FEATURES is enabled since it should not normally be an + issue: It would be a strange programming practice to open a message + queue in open task group, then close it in another. From 김정찬 + (2019-08-05). + * libs/libc/unistd: Stubs for setuid and setgid. Added stubbed + implementations of setuid and setgid. These functions are essentially + stubs pretending that NuttX supported users and groups and that the + only configured user and group in the system were both 'root' with a + uid and a gid of 0, respectively. The intent is not to provide + meaningful new features, but to ease porting of foreign source code to + NuttX. From Michael Jung (2019-08-06). + * drivers/pipes: Use inode reference counter instead of device reference + counter to handle dup(). I found that if I dup() a pipe, the reference + counter d_refs is not increased. If I close any of the fd, backed by + the same pipe, the pipe will be freed. This causes any further usage + on the fd referencing a non existent pipe. This change uses the inode + reference counter, which is properly maintained during dup(). From + Yang ChungFan (2019-08-06). + * arch/arm/src/stm32h7: Fix UART7/8 typos. Fix bug in ETH_MACQTXFCR + configuration. From Markus Bernet (2019-08-06). + * tools/configure.sh: Restore support for custom, out-of-tree + configurations that was broken in a previous commit. From Gregory Nutt + (2019-08-06). + * Group boards by architecture. All boards that share the same + architecture are moved to the same arch folder following the SoC + layout. For example, all ARM board configurations moved from + boards/board to boards/arm/board. From Alin Jerpelea (2019-08-06). + * tools/: Update configuration-related tools for last change to boards/ + directory organization. From Gregory Nutt (2019-08-06). + * tools/configure.sh: Needs to be able to run from the tools + sub-directory. From Gregory Nutt (2019-08-06). + * defconfigs: paths assigned to CONFIG_PASS1_BUILDIR must now include + the architecture. From Gregory Nutt (2019-08-06). + * boards/arm: Update paths to linker scripts in kernel/Makefile files. + From Gregory Nutt (2019-08-06). + * libs/libc/unistd.h: Add getuid() and getgid() to match Michael Jung's + setuid() and setgid(). From Gregory Nutt (2019-08-06). + * sched/group and syscall/: Implement 'real' setuid, getuid, setgid, and + getgid interfaces. These will be inheritance by all child task + groups. From Gregory Nutt (2019-08-06). + * arch/arm/src/armv7-m: Add ARMv7-M setjmp/longjump functions. From + David S. Alessio (2019-08-06). + * arch/arm/src/tiva/common/tiva_timerlib.c: Fix minor errors in + tiva_timerlib + Fix incorrect preprocessor conditionals related to Kconfig defines: + - CONFIG_TIVA_TIMER32_EDGECOUNT -> CONFIG_TIVA_TIMER16_EDGECOUNT + - CONFIG_TIVA_TIMER32_TIMECAP -> CONFIG_TIVA_TIMER16_TIMECAP + - CONFIG_TIVA_TIMER32_PWM -> CONFIG_TIVA_TIMER16_PWM + From Nathan Hartman (2019-08-06). + * Tiva: Fix errors in low-level timer support + arch/arm/src/tiva/common/tiva_timerlib.c: + - tiva_gptm_configure() and tiva_gptm_release(): Fix error: Was calling + tiva_emac_periphrdy() instead of tiva_gptm_periphrdy(). + arch/arm/src/tiva/tiva_timer.h: + - Fix error in "abcde" description of bit flag defines. + From Nathan Hartman (2019-08-07). + * arch/arm/src/lpc17xx_40xx/Kconfig: Add missing + LPC17_40_PHY_CEMENT_DISABLE config to the lpc17xx Kconfig file. For + some reason this config wasn't referenced anywhere else except in + arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c. From Augusto Fraga + Giachero (2019-08-07). + * arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c: Follow the procedure + listed in the LPC176x/5x User Manual when reading from and writing to + the PHY's registers (section 10.11.14). I couldn't see any behavioral + change after this commit, but nonetheless is a good practice to follow + the manufacturer's recommended procedure. From Augusto Fraga Giachero + (2019-08-07). + * arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c: Fix the initialization + for DP83848x PHYs. The DP83848x requires the RMII mode to be manually + enabled through the MII_DP83848C_RBR register. Before querying the + speed and mode it should wait for the link to be established. From + Augusto Fraga Giachero (2019-08-07). + * Group boards based on chip. All boards based on the same chip are + moved to the same folder. For example, all STM32 configurations moved + from boards/arm/board to boards/arm/stm32/board. From Alin Jerpelea + (2019-08-07). + * Add defconfig files must include CONFIG_ARCH_CHIP= to break and + chicken-and-egg problem. From Gregory Nutt (2019-08-07). + * arch/sim: Even though the simulation has no "chips", it needs to have + CONFIG_ARCH_CHIP and chip sub-directories. Otherwise, we would have to + treat it as a special case in the build system. From Gregory Nutt + (2019-08-07). + * tools/: Update and verify all configuration related tools with new, + boards directory layout. From Gregory Nutt (2019-08-07). + * defconfigs: All paths assigned to CONFIG_PASS1_BUILDIR must include + the chip name. From Gregory Nutt (2019-08-07). + * arch/arm/src/tiva/common/tiva_timerlib.c: Fix one code error and some + comment errors. tiva_timer16_setinterval(): Was DEBUGASSERTing on mode + != TIMER16_MODE. Fixed to DEBUGASSERT on mode == TIMER16_MODE. From + Nathan Hartman (2019-08-07). + * boards/Board.mk: Correct a simulator inclusion path problem introduced + by reorganization of arch/sim/src. From Gregory Nutt (2019-08-08). + * drivers/sensors/sht3x.c: Add Sensirion SHT3x driver. From Markus + Bernet (2019-08-08). + * Beginning to update comments to reflect new organization of the boards/ + sub-directory. From Gregory Nutt (2019-08-08). + * After restructuring the boards/ directory, it is time for code style + cleanup: hc, mips. From Alin Jerpelea (2019-08-08). + * Update more comments and README.txt files to reflect new organization + of the boards/ sub-directory. From Gregory Nutt (2019-08-08). + * Documentation: Update some documents affected by the change in the + organization of the boards/ sub-directory. From Gregory Nutt + (2019-08-08). + * boards/arm/lpc17xx_40xx/u-blox-c027/configs/nsh/defconfig: Remove + stray character in defconfig file. From Gregory Nutt (2019-08-08). + * STM32F7: Ethernet add timeout on MAC reset From David Sidrane + (2019-08-08). + * tools/testbuild.sh: Remove some recently introduced echo's that + clutter the build test output From Gregory Nutt (2019-08-08). + * Documentation/README.html: Update for new boards/ sub-directory + layout. From Gregory Nutt (2019-08-08). + * README.txt: Update for new boards/ sub-directory layout. From Gregory + Nutt (2019-08-08). + * arch/arm/include/armv7-m/nvicpri.h: In the 'normal' case, the priority + of the SVCALL interrupt was the same as the priority of the high + priority interrupt. This means that SVCALL interrupt processing can + defer the high priority interrupt and result in the jitter in that + interrupt response. Fix is to raise the priority of the high priority + interrupt above the priority of the SVCALL interrupt. Suggested by + Nathan Hartman. From Gregory Nutt (2019-08-09). + * After restructuring the boards/ directory, it is time for code style + cleanup: misoc, or1k, renesas, risc-v, sim, x86, xtensa, z16, z80 From + Alin Jerpelea (2019-08-09). + * Documentation/NuttX.html: Adjust URLs to board README.txt files to + account for changes in boards/ sub-directory reorganization. From + Gregory Nutt (2019-08-09). + * This commit removes CONFIG_ARCH_INT_DISABLEALL. In the normal course + of things, interrupts must occasionally be disabled using the + up_irq_save() inline function to prevent contention in use of resources + that may be shared between interrupt level and non-interrupt level + logic. Now the question arises, if we are using BASEPRI to disable + interrupts and have high priority interrupts enabled + (CONFIG_ARCH_HIPRI_INTERRUPT=y), do we disable all interrupts except + SVCall (we cannot disable SVCall interrupts). Or do we only disable + the "normal" interrupts? If we are using the BASEPRI register to + disable interrupts, then the answer is that we must disable ONLY the + "normal interrupts". That is because we cannot disable SVCALL + interrupts and we cannot permit SVCAll interrupts running at a higher + priority than the high priority interrupts (otherwise, they will + introduce jitter in the high priority interrupt response time.) Hence, + if you need to disable the high priority interrupt, you will have to + disable the interrupt either at the peripheral that generates the + interrupt or at the NVIC. Disabling global interrupts via the BASEPRI + register cannot effect high priority interrupts. From Gregory Nutt + (2019-08-09). + * Tiva GPTM timers: Implement 16-bit PWM mode + arch/arm/src/tiva/Kconfig: + - Remove EXPERIMENTAL dependency on TIVA_TIMER16_PWM. + arch/arm/src/tiva/common/tiva_timerlib.c: + - Fix wrong 32/16-bit ifdef checks. + - Add tiva_pwm16_sel_event() to choose GPTMCTL.TnEVENT value. + - Implement tiva_pwm_mode16(). + - tiva_timer16_setinterval(): Fix wrong check for TIMER16_MODE_ONESHOT + and TIMER16_MODE_PERIODIC. Was comparing to config->cmn.mode which + can never have those values. This prevented interrupts being enabled. + Compare to timer->mode instead. + - Add tiva_timer16pwm_setperiodduty() to set initial period, duty + cycle, and enable interrupts if requested in GPTM peripheral. + Interrupts are not enabled in NVIC until tiva_timer16_start() is called. + - Add tiva_timer16pwm_setduty() to update duty cycle at any time. + arch/arm/src/tiva/hardware/lm/lm3s_timer.h, + arch/arm/src/tiva/hardware/lm/lm4f_timer.h, + arch/arm/src/tiva/hardware/tm4c/tm4c123_timer.h, + arch/arm/src/tiva/hardware/tm4c/tm4c129_timer.h: + - Add missing defines; make surrounding defines consistent. + arch/arm/src/tiva/tiva_timer.h: + - Add new TIMER_FLAG_* configuration flags to enable configuring + the16-bit PWM feature. Extend type of "flags" in tiva_timer32config_s + and tiva_timer16config_s from 8- to 32-bits to allow more flags. + From Nathan Hartman (2019-08-09). + * boards/arm/efm32/olimex-efm32g880f128-stk/src/.gitignore: Restore + .gitignore file that was lost in the boards/ directory reorganization. + From Nathan Hartman (2019-08-09). + * STM32F7: USART1_RXDMA is dependent on STM32F7_DMA2 not STM32F7_DMA1 + From Anthony Merlino (2019-08-09). + * arch/arm/include/cxd56xx/chip.h: The NVIC priority correction of + commit c300f271303e04d5a7a1e42973a02115ed062cb0 must be applied to the + CXD56xx too. From Gregory Nutt (2019-08-10). + * - arch/arm/src/{stm32/stm32f7/stm32h7/stm32l4}/stm32_pwm.c: Configure + multi-channel duty only if channel specified. This allows you to + update duty cycle for a single channel + - nucleo-f303re/configs: add basic NSH configuration + - nucleo-f303re/configs/pwm: enable console on UART2 and set entry + point to nsh_main + From raiden00pl (2019-08-10). + * Change all occurrences of /bin/(ba)sh to /usr/bin/env bash which + appears more portable From Manuel Stühn (2019-08-10). + * sched/group/group_setuid.c and group_setguid.c: Verify that the + UID/GID is within range. From Gregory Nutt (2019-08-10). + * wireless/ieee802154/mac802154_netdev: Allow 64-bit prefix to be + configurable when auto-configuring the IPv6 address during bring-up. + Previously, the link-local prefix fe80::/64 was used. Also, put the + network in the DOWN state at the end of initialization. From Anthony + Merlino (2019-08-10). + * wireless/ieee8021254: Adds support for energy detect. Adds support + for energy detect by introducing a new radio call/callback, as the PHY + layer is required to perform the energy detect. From Anthony Merlino + (2019-08-10). + * MAC attributes + - wirelesss/ieee802154/mac802154: Makes comment more clear that it's + related to an outbound frame, not an incoming frame. + - wireless/ieee802154: Adds support for getting/setting + macMaxFrameRetries via IOCTL + - wireless/.ieee802154/mac802154: Add get support for rxonidle + attribute + From Anthony Merlino (2019-08-10). + * wirelesss/ieee802154/mac802154: Moves iobuffer into macnet struct so + that more than one macnet dev can exist. From Anthony Merlino + (2019-08-10). + * drivers/usbdev/rndis: Expose option to change number of write requests + that can be in flight. From Anthony Merlino (2019-08-10). + * net/ipforward: Check if interface is up early on when forwarding to + avoid extra work. As noticed in a previous wireless commit, when + forwarding is enabled and a packet comes in, the packet is attempted to + be sent on each other netdev without regard for whether it is in the UP + state. Of course this is eventually caught, but it can be caught + earlier to avoid unnecessary work, especially in the 6LoWPAN case where + a useless packet conversion will occur. From Anthony Merlino + (2019-08-10). + * clock.h: Copies in missing function documentation from C file. From + Anthony Merlino (2019-08-10). + * ieee802154: Support dynamic FCS length. Adds + IEEE802154_ATTR_PHY_FCSLEN. This change introduces + IEEE802154_ATTR_PHY_FCSLEN which the radio layer can support to set/get + the FCS length that's added to the end of the frame. One use case, in + promiscuous mode, is to add back in the FCS of the received frame by + increasing the iob->io_len by the FCS length. From Anthony Merlino + (2019-08-10). + * wireless network devices: Attach radio to d_buf before registering + device to handle forwarding case. When CONFIG_NET_IPFORWARD is + enabled, and CONFIG_NET_6LOWPAN is being used, a packet that attempts + to get forwarded on the 6LoWPAN interface will require that the radio's + buffer be attached to d_buf. Otherwise the below exception will be + hit. ~line 542 of sixlowpan_framelist.c: + + ... + /* Recover the reassembly buffer from the driver d_buf. */ + + reass = (FAR struct sixlowpan_reassbuf_s *)radio->r_dev.d_buf; + DEBUGASSERT(reass != NULL); + ... + + The underlying "radio" in this case is the mac802154_netdev. This + behavior has probably not been observed because the buffer is normally + attached in the periodic txpoll worker. However, in my case, the + 6LoWPAN interface was not UP yet, and therefore the worker hadn't run + yet. From Anthony Merlino (2019-08-10). + * mac802154: Fixes issues with extended address. 1) Extended address + should be read-only. 2) Extended address should be placed in frame in + "reverse-canonical" order. The extended address is a read-only + attribute and thus an attempt to write the extended address should be + denied. Instead, the extended address should really be either set by + the PHY/radio itself, or provided at board bring-up time to the radio + layer. The MAC layer now pulls in the extended address from the radio + any time the MAC is reset. The extended address is also supposed to be + sent in the frame in reverse-canonical order. This is very confusing in + the standard and it wasn't until I realized it was backwards in + Wireshark that I researched this further. Searching online I find + documents from the committee for suggestions/feedback on the future + standard. It isn't in the 2015 standard but a newer version of the + standard will presumably clarify this. It says that the extended + address should be written in reverse-canonical form, meaning the OUI + comes last, not first inside the frame. From Anthony Merlino + (2019-08-10). + * mac802154: Fixes issue where the txdesc's ackreq flag was not being + set, despite the frame containing a Frame Control field with ACKREQ bit + set. From Anthony Merlino (2019-08-10). + * arch/arm/src/stm32f7: Exposes stm32_flash_xxx functions. From Anthony + Merlino (2019-08-10). + * libs/libc/grp and pwd: Revisit file locks. Use uintptr_t vs void * to + encode mixed pointers and integer values. From Gregory Nutt + (2019-08-11). + * After restructuring the boards/ directory, it is time for code style + cleanup: ARM part I From Alin Jerpelea (2019-08-12). + * This commit brings the initial files for a port to the NXP S32K1xx + family. This is very much a work in progress and is little more that a + partial configuration/build environment and some S32K1xx register + definition header files + - Basic configuration logic for the S32K1 family. + - arch/arm/src/s32k1xx: Add initial Make.defs files. + - arch/arm/src/s32k1xx/hardware/s32k1xx_scg.h: Add SCG register + definition file. + - arch/arm/src/s32k1xx/hardware/s32k1xx_pcc.h: Add PCC register + definition file. + - arch/arm/src/s32k1xx/hardware/s32k1xx_cmu.h: Add CMU register + definition file. + - arch/arm/src/s32k1xx/hardware/s32k1xx_memorymap.h: Add memory map + definition file. + - arch/arm/src/s32k1xx/hardware/s32k1xx_mcm.h: Add MCM register + definition file. + From Gregory Nutt (2019-08-12). + * boards/arm/timva/tm4c123g-launchpad: Update paths for boards/ + restructuring. Update paths to board directories in documentation and + scripts. From Nathan Hartman (2019-08-12). + * arch/arm/src/s32k1xx/hardware/s32k1xx_sim.h: Add SIM register + definition file. From Gregory Nutt (2019-08-12). + * arch/arm/src/s32k1xx/hardware/s32k1xx_port.h: Add PORT register + definition file. From Gregory Nutt (2019-08-13). + * libs/libc/math.csv: Correct format of some function entries. From + Pavel Pisa (2019-08-13). + * libs/libc/libc.csv: Correct dependency of setlocale on + CONFIG_LIBC_LOCALE. From Pavel Pisa (2019-08-13). + * symtab/, tools/: NuttX provides lists of available syscalls and + library functions and tools to process them. The lists can be used to + build symbol table which allows runtime program loading which can reuse + functions already compiled into NuttX system image. List processing, + compilation and linking to the final system image has been possible + only under manual control until now. Provided changes add option + (CONFIG_EXECFUNCS_GENERATE_SYSTEM_SYMTAB) to build complete list of + available functions and syscalls automatically. The symbolic table is + generated in form libsymtab.a which can be reused by application or + directly pull in when "g_symtab" and "g_nsymbols" variables are + requested by EXECFUNCS configuration. I have tried to follow + mechanisms for library compilation in different kernel protection modes + but tested only flat no-MMU build. The basic assumption is that this + library and libraries providing syscall stubs and C-library functions + are available in user-space context and initial application (usually + NSH) registers the symbol table through IOCTL. The table can be reused + then by another applications in their address space as kernel allows. + Simple for flat or protected mode, I am not sure if really support in + MMU mode. It is highly probable that I have made some mistake, + overlooked something, but functionality is optional (should not cause + troubles in any mode if disabled) and main purpose is to lower memory + overhead when more applications are loaded on memory constrained system + which usually use direct kernel calling without protection or address + space separation. If the table should be provided by kernel to + applications then makefiles has to be adjusted. From Pavel Pisa + (2019-08-13). + * symtab/Makefile: The OS symbol table should not be generated in the + PROTECTED and KERNEL build modes. In those modes, the applications + should link with libproxy which will provide symbol-compatible access + to OS functions via a call gate. From Gregory Nutt (2019-08-13). + * arch/arm/src/s32k1xx/hardware/s32k1xx_gpio.h: Add GPIO register + definition file. From Gregory Nutt (2019-08-13). + * After restructuring the boards/ directory, it is time for code style + cleanup: ARM part II From Alin Jerpelea (2019-08-13). + * arch/arm/src/s32k1xx/hardware/s32k1xx_dmamux.h: Add DMAMUX register + definition file. From Gregory Nutt (2019-08-13). + * arch/arm/src/s32k1xx/hardware/s32k1xx_wdog.h and s32k1xx_ewm.h: Add + WDOG and EWM register definition file. From Gregory Nutt (2019-08-13). + * arch/arm/src/s32k1xx/hardware/s32k1xx_crc.h: Add CRC register + definition file. From Gregory Nutt (2019-08-13). + * arch/arm/src/s32k1xx/hardware/s32k1xx_rcm.h: Add RCM register + definition file. From Gregory Nutt (2019-08-13). + * arch/arm/src/imxrt: Fix some errors in the LPUART register definition + files. Correct naming of a function: up_earlyserialinit() should be + imxrt_earlyserialinit(). Remove prototypes for non-existent serial + initialization functions. From Gregory Nutt (2019-08-13). + * arch/arm/src/s32k1xx: Bring in the LPUART from i.MXRT. It is the same + IP. From Gregory Nutt (2019-08-13). + * symtab/Makefile: Fix an error in the clean target. From Gregory Nutt + (2019-08-13). + * include/sys/syscall.h: Correct some typos. From Pavel Pisa (2019-08-13). + * arch/arm/src/lpc17xx_40xx/lpc17_40_can.c: If BOARD_CCLKSEL_DIVIDER is + not equal to 1 on LPC178x or LPC40xx then base clock rate is calculated + incorrectly because CCLK frequency does not correspond to PLL0 clock + which is used for PCLK. This is partially workaround solution. It + would be probably better to define BOARD_PCLK_FREQUENCY even for + LPC176x targets and use that to replace divisor by base_clock in + up_dev_s. From Pavel Pisa (2019-08-13). + * arch/arm/src/s32k1xx: Fix some sub-directory names. From Gregory Nutt + (2019-08-13). + * arch/arm/src/s32k1xx: Bring in Cortex-M0+ Systick and interrupt + handling from samd2l2; bring in Cortex-M4F Systick and interrupt + handling from LPC54xx. From Gregory Nutt (2019-08-13). + * After restructuring the boards/ directory, it is time for code style + cleanup: ARM part III From Alin Jerpelea (2019-08-14). + * After restructuring the boards/ directory, it is time for code style + cleanup: ARM part IV From Alin Jerpelea (2019-08-14). + * This commit adds initial board support for the NXP S32K118EVB. This + configuration is intended, initially, to support development of the + architecture support. This is VERY much a work in progress and you + should not use this configuration unless you are interested in + assisting with the bring-up. + - boards/arm/s32k1xx/s32k118evb: Add initial support for the NXP + S32K118EVB. + - boards/: Hook the S32K118EVB board into the configuration system. + - boards/arm/s32k1xx/s32k118evb/scripts: Add linker scripts and + Make.defs. + - boards/arm/s32k1xx/s32k118evb/configs/nsh: Add a basic NSH + configuration. From Gregory Nutt (2019-08-14). + * Flesh out a few more things needed to compile and build the S32K118EVB + board configuration. + - arch/arm/include: Add interrupt IRQ numbers. + - tools/: Add support for the S32K1XX family. + From Gregory Nutt (2019-08-14). + * symtab/Makefile: When system wide locale is set (i.e. en_US.UTF-8) + then 'read' is ordered after 'readdir' even if separator is set to + quotation mark and key set to 2. When C locale is used result is + correct. From Pavel Pisa (2019-08-14). + * arch/arm/src/lpc17xx_40xx/Make.defs: Cortex-M system reset is + applicable to LPC17_40 too. From Pavel Pisa (2019-08-14). + * arch/arm/src/s32k1xx: A few fixes. The build progresses further but + still fails. From Gregory Nutt (2019-08-14). + * boards/arm/s32k1xx/s32k118evb: More build fixes. From Gregory Nutt + (2019-08-14). + * - stm327f: Kconfig add depends on BBSRAM + - STM32H7: memorymap fix BBSRAM name + - STM32H7: Add BBSRAM support + From David Sidrane (2019-08-15). + * After restructuring the boards/ directory, it is time for code style + cleanup: ARM part V From Alin Jerpelea (2019-08-15). + * arch/arm/src/s32k1xx/s32k1xx_clockconfig.h: Add data structures that + will eventually be used to configure clocking. From Gregory Nutt + (2019-08-15). + * arch/arm/src/tiva, arch/arm/include: Add support for Tiva + TM4C123AH6PM. From Nathan Hartman (2019-08-15). + * libs/libc/libc.csv: Add some missing C library functions. From Pavel + Pisa (2019-08-15). + * binfmt/: Change debug macro from berr() to binfo() when dumping module + data. The report of problems is important during development but when + it enables complete informative output about load binaries then the + important information can be easily overlooked. The huge output sent + to serial terminal slows loading significantly as well. From Pavel + Pisa (2019-08-15). + * Serial single-wire: add possibility to specify pull-up instead of open + drain From Beat Küng (2019-08-15). + * boards/arm/s32k1xx/s32k118evb/src/s32k118_clockconfig.c: Add clock + configuration data for the S32K118EVB. From Gregory Nutt (2019-08-15). + * arch/arm/src/tiva/common/tiva_irq.c: Add handling for IRQs 128 thru + 159. Handling was missing for these IRQs, resulting in compiler + warning(s) for 'Missing logic' and/or 'Missing output.' From Nathan + Hartman (2019-08-15). + * arch/arm/src/s32k1xx/Kconfig: Break out some feature configurations + instead of relying on MCU selections for conditional logic. From + Gregory Nutt (2019-08-15). + * arch/arm/src/s32k1xx/s32k1xx_clockconfig.c: First feeble fragments of + clock configuration logic. From Gregory Nutt (2019-08-15). + * arch/arm/src/tiva: Modify preprocessor logic to support configs with + no UART. Now similar to logic for other archs, such as + arch/arm/src/a1x/a1x_lowputc.c and + arch/arm/src/am335x/am335x_lowputc.c. This change eliminates compiler + errors and warnings that were breaking the build with "No + CONFIG_UARTn_SERIAL_CONSOLE Setting" when no UARTs / console were + configured. From Nathan Hartman (2019-08-15). + * ieee802154/sixlowpan: Removes unnecessary conversions that were + happening due to a misunderstanding of byte ordering with EUI-64. + Conflicts: drivers/wireless/ieee802154/xbee/xbee_netdev.c From + Anthony Merlino (2019-08-16). + * Mac802154 fixes + - wireless/ieee802154/mac802154: Frame Version should have been 1, but + was being set to 3 when payload exceeds version 0 capabilities. + - wireless/ieee802154/mac802154: Corrects function reference in warning + print-out + - wireless/ieee802154/mac802154/sixlowpan: Adds warning to build to + indicate what is noted in the menu for CONFIG_MAC802154_NTXDESC + From Anthony Merlino (2019-08-16). + * After restructuring the boards/ directory, it is time for code style + cleanup: ARM part VI From Alin Jerpelea (2019-08-16). + * drivers/wireless/ieee802154/xbee: Fix logic to prevent deadlock + scenario when there are no available IOBs From Anthony Merlino + (2018-12-21). + * drivers/wireless/ieee802154/xbee: Change assumption about destination + address mode for incoming frames. If a short address has been assigned + to our radio, then assume we were addressed using that. Otherwise we + were addressed using our extended address. From Anthony Merlino + (2019-01-10). + * drivers/wireless/ieee802154/xbee: Initialize the short address to the + unspecified address and query for the extended address on init. From + Anthony Merlino (2019-01-10). + * drivers/wireless/iee802154/xbee: Support "WR" AT command for writing + parameters to non-volatile memory. From Anthony Merlino (2019-01-10). + * drivers/wireless/ieee802154/xbee: Adds CONFIG_XBEE_LOCKUP_WORKAROUND + option and corresponding logic to workaround an issue where the XBee + locks up and stops responding. This typically happens when there is a + lot of data being received over the link. When the XBee stops + responding, many times, querying the XBee kicks it out of this state. + However, occasionally the XBee is completely locked up and the XBee has + to be reset. This change handles these conditions by periodically (if + not naturally occurring) querying the XBee. If during any query, the + XBee does not respond within a certain number of attempts, the XBee is + reset. From Anthony Merlino (2019-01-10). + * drivers/wireless/ieee802154/xbee: Cancel query timeout upon receiving + the expected response. Add protection for race condition that can + cause association timeout to continue firing repeatedly From Anthony + Merlino (2019-01-11). + * drivers/wireless/ieee802154/xbee: Detect lockup and reset XBee in + xbee_req_data From Anthony Merlino (2019-01-16). + * - arch/arm/src/s32k1xx/s32k1xx_clockconfig.c: Finishes the + implementation of the core clock configuration logic. + - arch/arm/src/s32k1xx/hardware/s32k1xx_smc.h: Add SMC register + definition header file. + - arch/arm/src/s32k1xx: Bring in GPIO logic from Kinetis. Looks like + the same IP. + From Gregory Nutt (2019-08-16). + * IOB instrumentation + - mm/iob: Introduces producer/consumer id to every iob call. This is + so that the calls can be instrumented to monitor the IOB resources. + - IOB instrumentation - Merges producer/consumer enumeration for + simpler IOB user. + - fs/procfs: Starts adding support for /proc/iobinfo + - fs/procfs: Finishes first pass of simple IOB user statistics and + /proc/iobinfo entry + From Anthony Merlino (2019-08-16). + * arch/arm/src/s32k1xx/hardware/s32k1xx_pmc.h: Add PMC register + definition header file. From Gregory Nutt (2019-08-16). + * boards/README.txt: Update for changes to the organization of the + boards/ directory. From Gregory Nutt (2019-08-16). + * stm32h7 RTC and friends support + - STM32H7: Removed f7 in file path + - STM32F7: Fix overwritten IRQ enabled. System boot order calls + clock_initialize then up_initialize. clock_initialize was setting up + the alarm IRQ up_initialize is initializing the NVIC. This most likely + worked in the past due to a bug in the NVIC init code that failed to + clear the Interrupt enables. That was fixed in 510b0f7e + arch/arm/src: Correct all ARMv7-M architectures. Interrupts were + not be disabled correctly on power up. + - STM32H7:Ported over F7 RTC + - nucleo-h743zi:Add RTC + From David Sidrane (2019-08-17). + * Finishes peripheral clock initialization: + - arch/arm/src/s32k1xx/s32k1xx_clockconfig.c: Add SIM clock + configuration. + - arch/arm/src/s32k1xx/s32k1xx_periphclocks.c: Add logic to initialize + peripheral clocking. + - boards/arm/s32k1xx/s32k118evb/src/s32k118_periphclocks.c: Provides + initial clocking for for the S32K118EVB + - arch/arm/src/s32k1xx/s32k11x/s32k11x_clockmapping.c and + arch/arm/src/s32k1xx/s32k14x/s32k14x_clockmapping.c: Provide + MCU-specific mapping of clock names to PCC control registers. + From Gregory Nutt (2019-08-17). + * - arch/arm/src/s32k1xx: Add peripheral feature arrays. + - arch/arm/src/s32k1xx/: Add logic to look up the peripheral clock + frequency. Fix baud calculation logic in s32k1xx_lowputc.c: In no + longer tries to enable clocking. That must be done with board + logic. Now gets the peripheral functional clock frequency to + determine the baud rate. + From Gregory Nutt (2019-08-17). + * arch/arm/src/s32k1xx/s32k1xx_edma.c: Leverage eDMA logic from i.MXRT + to S32K1XX. Appears to be the same IP but with fewer channels and + features than the i.MXRT implementation. From Gregory Nutt (2019-08-17). + * - arch/arm/src/s32k1xx/s32k1xx_pin.c and .h: The device does not + support slew rate controls or open drain (on all the pins). Only + pins that are configured for a protocol that requires open-drain + (e.g;, LPI2C, LPUART single-wire) will work in open-drain mode. + - arch/arm/src/s32k1xx/s32k1xx_pin.c and .h: Add support for PIDR + register that disables a general purpose pin from acting as an input. + - arch/arm/src/s32k1xx/hardware: Add pin mux definitions for S32K116, + 118, 142, 144, 146, and 148. + - boards/arm/s32k1xx/s32k118evb/include/board.h: Add LPUART0 pin + disambiguation. + - boards/arm/s32k1xx/s32k118evb: Implement board support for LEDs and + buttons. This is taken from the Freedom-K66f with has the same LED + and button configuration as the S32K116EVB and uses the same GPIO + IP. From Gregory Nutt (2019-08-18). + * This commit brings the S32K118EVB board to code complete and ready for + testing. This commit adds some minor initialization fixes (like + disabling the WDOG, enabling the I-cache, and initializing the MPU. It + brings more files in from the Kinetis port for the IDLE loop and for + GPIO functionality. This also address register definition header file + for LMEM and MPU. From Gregory Nutt (2019-08-18). + * This commit adds support for the S32K146EVB + - arm/s32k1xx/s32k146evb: Initial support for the S32K146EVB. Starting + point is just the S32K118EVB with name changes. + - boards/arm/s32k1xx/s32k146evb/src/s32k146_periphclocks.c: Update + peripheral clocking for the S32K146. + - s32k146_clockconfig.c: Add S32K146 clock configuration. + - boards/: Hook the S32K146EVB into the configuration and build system. + - s32k1xx/s32k146evb/scripts/flash.ld: Update the linker script for + the S32K146. + From Gregory Nutt (2019-08-19). + * After restructuring the boards/ directory, it is time for code style + cleanup: ARM part VII From Alin Jerpelea (2019-08-19). + * mac802154: Defers handling of extracting association response to LPWORK + queue. From Anthony Merlino (2019-08-19). + * arch/arm/src/s32k1xx/s32k14x and boards/arm/s32k1xx/s32k146evb/src: + Numerous fixes to get a clean build of the S32K146EVB. From Gregory + Nutt (2019-08-19). + * arch/arm/src/imxrt/imxrt_usdhc.c: uSDHC typo fixes and command transfer + error handling modified. From Ivan Ucherdzhiev (2019-08-19). + * Kconfig, include/debug.h, and drivers/contactless: Add debug macros + for contactless. The various contactless device drivers currently + define device specific debug macros within their local header files. + This patch adds generic ctls[info|warn|err] macros for the overall + contactless subsystem to be used in future drivers. Ported the two + currently available contactless device drivers (mfrc522.c and pn532.c) + to these generic logging macros and fixed some logging bugs along the + way. From Michael Jung (2019-08-19). + * mm/iob/iob_statistics.c: Fix an error found in build testing. Must + include nuttx/mm/iob.h. From Gregory Nutt (2019-08-19). + * - Save CONFIG_ARCH_BOARD_CUSTOM when running 'make savedefconfig' + - Made grep search expression more specific. + From jjlange (2019-08-19). + * fs/procfs/fs_procfsiobinfo.c: Fix error found in build testing. + Needs to include nuttx/mm/iob.h. From Gregory Nutt (2019-08-19). + * arch/arm/src/s32k1xx/s32k1xx_clockconfig.c and related files: Fix + confusion about who decrements the register value. Some dividers may + have a function range of 1..8 but the register value is 0..7. There + were several places where values were getting decremented twice: Once + by higher up logic and once by the register access logic. A such + dividers were reviewed and, hopefully, all were fixed. From Gregory + Nutt (2019-08-19). + * boards/arm/stm32h7/nucleo-h743zi/src/nucleo-h743zi.h: Correct logic + that determines if the RTC driver is available. Find in build + testing. From Gregory Nutt (2019-08-19). + * - Added a missing '=' in the second grep statement + - Save CONFIG_ARCH_BOARD_CUSTOM when running 'make savedefconfig' + From jjlange (2019-08-19). + * STM32H7: Port DTCM from F7 From David Sidrane (2019-08-19). + * STM32H7: Ported UID from F7 From David Sidrane (2019-08-19). + * drivers/ieee802154/xbee: Add configuration option for setting the + default prefix to use when bringing up the network and setting the IP + address. Conflicts: drivers/wireless/ieee802154/xbee/xbee_netdev.c + From Anthony Merlino (2019-08-19). + * xbee: Fixes one instance of the use of IOBUSER_WIRELESS_MAC802154 + which isn't available without the software MAC layer. Instead we use + IOBUSER_WIRELESS_RAD802154 throughout the whole driver since it is + always available when IEEE 802.15.4 support is enable. From Anthony + Merlino (2019-08-19). + * - STM32H7: DMA Fix compiler warning + - STM32H7: DMA Fix coding style + - STM32H7: Serial fix undefined with TERMIOS + From David Sidrane (2019-08-20). + * - STM32H7: SPI allow more clock sources + - STM32H7 has ARCH_HAVE_I2CRESET + From David Sidrane (2019-08-20). + * With these changes the S32K146EVB minimal NSH is functional. Only + verified while running from SRAM. + - boards/arm/s32k1xx/s32k*evb/configs/nsh/defconfig: Create Motorola + SREC output format. + - arch/arm/src/s32k1xx/s32k1xx_wdog.h: Fix a typo in a register name. + - arch/arm/src/s32k1xx/s32k1xx_clockconfig.h: Remove crystal + frequency, it is not used. + - boards/arm/s32k1xx/s32k118evb: Add support for execution out of + SRAM. This is helpful for bringup when you want to avoid putting a + lethal image in FLASH. + - arch/arm/src/s32k1xx/s32k1xx_clockconfig.c: Clean up some bad + conditional logic. Precedence of operators problem. + - arch/arm/src/s32k1xx/s32k1xx_clockconfig.c: Fix another problem + related to whether a divider is pre-decremented or not. The answer + must be the divder values are never pre-decremented. They are + decremented just before being written to hardware. + - arch/arm/src/s32k1xx/s32k1xx_periphclocks.c and related files: Fix + yet another case of confusion between pre-decremented and + non-decremented divider values. Enforce the rule that dividers are + not decremented until the moment they are written into registers. + - arch/arm/src/s32k1xx/s32k1xx_lowputc.c: Fix a typo that prevented + LPUART1 from working. + From Gregory Nutt (2019-08-20). + * This commit adds support for the NXP S32K148EVB + - boards/arm/s32k1xx/s32k148evb: Initial S32K148EVB. Initial commit + is just clone of S32K146EVB with file name changes + - boards/arm/s32k1xx/s32k148evb: Change all occurrences of 146 to 148. + - boards/arm/s32k1xx/s32k148evb: Correct LED and button pin number + for the S32K148EVB. + - arm/s32k1xx/s32k148evb: Verify core and peripheral clocking. It is + the same as the S32K146EVB. Fixed one-too-many copy-paste error in + both. + - boards/arm/s32k1xx/s32k148evb: Correct linker scripts for the + S32K148, Update README files, Hook the S32K148EVB into the + configuration and build system. + From Gregory Nutt (2019-08-20). + * - boards/: Add stub drivers folder for later use. In this folder we + should place drivers that are platform specific and depend on HW + that is present only on a specific platform. NOTE: All shared + drivers should go to the regular driver folder + - tools: Shift BOARD_DIR one level up. In preparation for drivers + and common folders we are moving the BOARD_DIR path up one level. + - tools: Add drivers/platform symlink. Link the + boards///drivers dir to drivers/platform + - drivers: Add platform specifc drivers extension. There are + platforms that use specific drivers and we should be able to include + those drivers in the build. + - board: cxd56xx: drivers: add AK09912 driver for SCU. This is a + platform specific driver connected on the SCU unit. From Alin + Jerpelea (2019-08-21). + * Register a character driver for UUID of AT24CSxx chips. Allows the + UUID to read as a file or displayed from an nsh prompt with: hexdump + /dev/eeprom.uuid From David Alessio (2019-08-21). + * drivers/mmcsd: Added support for MMC(eMMC) bigger than 2 GB (Tested + with IMXRT1050EVKB and samsung eMMC 16GB). + * arch/arm/src/imxrt: IMXRT uSDHC driver cmd line reset logic modified. + From Ivan Ucherdzhiev (2019-08-21). + * drivers/mmcsd/mmcsd_sdio.c: Copy/paste error fix for MMC. From Ivan + Ucherdzhiev (2019-08-21). + * arch/arm/src/s32k1xx: This commit brings in the LPSPI and LPI2C + peripheral drivers from the i.MXRT which used the identical IP. + - arch/arm/src/s32k1xx: Clone i.MXRT LPSPI and LPI2C support. i.MXRT + uses the same IP as S32K1XX. + - arch/arm/src/s32k1xx: Clean up LPSPI and LPI2C naming for S32K1XX. + Using S32K1XX clock functions to get peripheral input clock. + - arch/arm/src/s32k1xx: Update peripheral input clocking for the way + that things are done for the S32K1XX. Fix other misc. + compilation/configuration issues. + From Gregory Nutt (2019-08-21). + * drivers/mmcsd/mmcsd_sdio.c: Correct a misplaced #endif. From Gregory + Nutt (2019-08-21). + * - tools/Makefile.unix: Add support for common board folder. This + patch adds support for a common board folder and simplifies the code + and maintenance on boards that share the same code + - cxd56xx: Migration to a common folder. This is the first platform + to be migrated to the new common folder structure. + From Alin Jerpelea (2019-08-21). + * Add support for 4-byte addressing on >128Mb Macronix flash parts From + jjlange (2019-08-21). + * drivers/mtd/mx25lx.c: Minor changes to conform to coding standard + detected by tools/nxstyle. From Gregory Nutt (2019-08-21). + * arch/arm/src/s32k1xx: This is a rough port of the i.MXRT Ethernet + driver to the S32K1xx. The i.MXRT uses the same IP. Completely + untested at this point. From Gregory Nutt (2019-08-21). + * arch/arm/src/tiva/hardware/tm4c: Fix wrong description on define + TIVA_1WIRE_BASE: Was "EEPROM and Key Locker" (same as the item above). + Now "1-Wire Master Module." Make DMACTL symbols visible for TM4C123: + Remove "#ifdef CONFIG_ARCH_CHIP_TM4C129" guard around UART DMA Control + (DMACTL) symbols. These bits are valid on TM4C123 devices, as well as + on TM4C129. Also, improve the comment on UART_DMACTL_DMAERR. From + Nathan Hartman (2019-08-21). + * arch/arm/src/s32k1xx/Kconfig: Add Ethernet configuration options that + were supposed to have been included in a previous commit. From + Gregory Nutt (2019-08-21). + * Fixed CONFIG_ARCH_BOARD_CUSTOM based builds. Essentially reverts + Added a missing '=' in the second grep statement it was not missing it + was deliberately not in the second grep. Adding a '=' in the second + grep statement caused the "children" of CONFIG_ARCH_BOARD_CUSTOM, + namely: CONFIG_ARCH_BOARD_CUSTOM_DIR, + CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH, CONFIG_ARCH_BOARD_CUSTOM_NAME to + be lost on a savedefconfig. To see the issue run make oldconfig; make + savedefconfig; make oldconfig From David Sidrane (2019-08-22). + * boards/arm/cxd56xx: Add sensors connected to the SCU on Spresense board + - Add Avago APDS9930 Proximity and Ambient light Sensor + - Add Rohm BH1721FVC Ambient Light Sensor + - Add Rohm BH1745NUC Color Sensor + - Add Rohm BM1383GLV/BM1383AGLV Pressure Sensor + - Add Rohm BM1422GMV/BM1422AGMV Magnetic Sensor + - Add Bosch BMI160 Sensor support + - Add Bosch BMP280 Barometic Pressure Sensor + - Add Kionix KX022/KX122 Acceleration Sensor + - Add Murata LT1PA01 Proximity and Ambient light Sensor + - Add Rohm RPR0521RS Proximity and Ambient light Sensor + - BMI160: add optional I2C address + From Alin Jerpelea (2019-08-22). + * Add the sensor initialization for cxd56xx boards in the common board + folder (part 1/2) + - boards: cxd56xx: apds9930: typo fix + - boards: cxd56xx: add cxd56_ak09912 initialization. + - boards: cxd56xx: move cxd56_bmi160 initialization. + - boards: cxd56xx: add cxd56_apds9930 initialization + - boards: cxd56xx: add cxd56_apds9960 initialization + From Alin Jerpelea (2019-08-22). + * - All S32K1xx flash.ld configurations: Do not write into FLASH + configuration field. + - Extend s32k146 and s23k148 NSH configurations so that they support + more features. + From Gregory Nutt (2019-08-22). + * arch/arm/src/s32k1xx/Kconfig: Remove a duplicate configuration + setting. Noted by Fabio Balzano. From Gregory Nutt (2019-08-22). + * arch/arm/src/s32k1xx: Clocking logic was including the wrong 'clock + name' files for the S32K11x family. From Gregory Nutt (2019-08-22). + * boards/arm/s32k1xx/s32k118evb, s32k146evb, and s32148evb: Correct the + 'sense' of the LED discrete output. A high level illuminates the + LED. From Gregory Nutt (2019-08-22). + * Add the sensor initialization for cxd56xx boards in the common board + folder (part 2/2) + - Add cxd56_bh1721fvc initialization + - Add cxd56_bh1745nuc initialization + - Add cxd56_bm1383glv initialization + - Add cxd56_bm1422gmv initialization + - Add cxd56_bmi160 initialization + - Add cxd56_bmp280 initialization + - Add cxd56_kx022 initialization + - Add cxd56_lt1pa01 initialization + - Add cxd56_rpr0521rs initialization + - Add cxd56_sensors initialization + - Add Backup Log driver + - Add crashlog driver + - Move gs2200m initialization + - Move ili9340 initialization + - Move lpm013m091a initialization + From Alin Jerpelea (2019-08-23). + * arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h: Add an incomplete + FlexCAN register definition header file. Still missing some bitfield + definitions. Also updates some README files. From Gregory Nutt + (2019-08-23). + * This commit moves shared builtin information out of binfmt/libbuiltin + and into libs/libc/builtin where it can be shared. This should permit + builtin application in the PROTECTED build where binfmt/libbuiltin is + not available in user space. + - Move binfmt/libbuiltin to libs/libc/builtin. There are calls made + directly from apps/nshlib into this logic and hence, must be part of + a library that can be shared between the OS and applications. + - Move include/nuttx/binfmt/builtin.h to + include/nuttx/lib/builtin.h. Move + apps/builtin/lib_builtin_forindex.c to + libs/libc/builtin/lib_builtin_forindex.c. + - Correct some additional compile-related issues. + From Gregory Nutt (2019-08-23). + * In order to support builtin in function in protected mode, a + task_spawn() system call must be supported. task_spawn() and + posix_spawn() are NuttX OS interfaces. In PROTECTED and KERNEL build + modes, then can be reached from applications only via a system call. + Unfortunately this is overly complex because there is a (soft) limit + of 6 parameters in a system call; task_spawn has seven parameters. + This is a soft limit but still difficult to extend because it involves + assembly language changes to numerous architectures. Better to get + more creative. Rather than extend the maximum number of parameters + across all architectures, I opted instead to marshal the seven + parameters into a structure and pass only a signle parameter: A + pointer to the structure containing the seven marshaled parameters. + From Gregory Nutt (2019-08-23). + * STM32H7: Memory Map DBGMCU is @ 0x5c001000 From David Sidrane + (2019-08-23). + * tools/refresh.sh: Fix some remaining breakage from the boards/ + directory reorganization. From Gregory Nutt (2019-08-24). + * boards/arm/s32k1xx: Add CONFIG_NSH_ARCHINIT=y to all NSH + configurations. From Gregory Nutt (2019-08-24). + * boards/mips/pic32mx&z/drivers/Kconfig: The drivers folder was one + level above where it should be. From Ouss4 (2019-08-24). + * boards/: Move more drivers directories at were placed too high in the + hierarchy. From Gregory Nutt (2019-08-24). + * fs/procfs/fs_procfsiobinfo.c: Correct use of C11 features in common + code. From Gregory Nutt (2019-08-24). + * binfmt/: Fix FLAT build with BUILTIN support. Fixes problems + introduced in a recent commit. From Michael Jung (2019-08-25). + * arch/arm/src/stm32: PLLI2S support for F427/F437. Enable support of + the I2S Phase Locked Loop on STM32F427 and STM32F437 MCUs. From + Michael Jung (2019-08-25). + * arch/arm/src/stm32/stm32_spi.c: TI Synchronous Serial Frame Format. + The SPI macros on STM32 MCUs do support the Texas Instruments + Synchronous Serial Frame Format protocol (TI protocol). Defined a new + SPIDEV_MODETI and add support for it in stm32_spi.c. From Michael + Jung (2019-08-25). + * boards/boardctl.c and libs/libc/builtin: The BINFS file system uses + the same builtin library and builtin arrays as does NSH. The builtin + arrays are simple name-value pairs that map builtin function names + with the user-space entry point. In the FLAT build, the builtin + arrays are available everywhere via the backdoor left open by the FLAT + address space. In the PROTECTED build, however, the kernel must + maintain its own reference to the user-space builtin array. This + commits adds those kernel globals and a new + boardctl(BOARDIOC_BUILTINS) that can be used by applications to the + provide the builtin list reference to the kernel. From Gregory Nutt + (2019-08-25). + * libs/symtab: move symtab/ to libs/symtab. Let's no clutter up the + top level directory. Shorten CONFIG_EXECFUNCS_GENERATE_SYSTEM_SYSTAB + to just CONFIG_EXECFUNCS_SYSTEM_SYMTAB. Some items in + syscall/syscall.csv are only valid when CONFIG_LIB_SYSCALL is + defined. That is always defined when really building the system + calls, but causes errors in libs/symtab because they are not valid in + the normal, FLAT build context. From Gregory Nutt (2019-08-25). + * arch/arm/src/samd2l2/sam_i2c_master.c: Correct time calculation. + From Bernd Walter (2019-08-26). + * Migrate CXD56xx common code to the common/ directory + - Move boot to common + - Move flash to common + - Move I2C driver to common + - Move uid to common + - Add SPH. The SPH is used by the ASMP implementation from the SDK. + From Alin Jerpelea (2019-08-26). + * Report git info on /proc/gitrev + - Report git info on /proc/gitrev. git info reported: branch, + version, git hash, hostname, usr, build date + - Use existing .version and procfs for git info + - Reduce script's coupling + From David Alessio (2019-08-26). + * drivers/power/pm_update.c: Fix g_pmcount 16-bits overflow + when CONFIG_PM_XXENTER_COUNT set big value. From ligd (2019-08-26). + * drivers/timers/rtc: If the RTC time is successfully set, then update + the current system time to match. From ligd (2019-08-26). + * net/tcp/tcp_send.c: Fix RST packet with wrong ack number. From + biantao (2019-08-26). + * sched/Kconfig, sched/signal/sig_notification.c: Add configuration + option to select either the high-priority or low-priority work queue + for SIG_EVTHREAD notifications. From ligd (2019-08-26). + * net/tcp/Kconfig, include/nuttx/net/netconfig.h: Make RTO and + WAIT_TIME configurable. This fix is not really correct: TCP RTO + really should be calculated dynamically for each TCP connection: + http://sgros.blogspot.com/2012/02/calculating-tcp-rto.html. From + zhangyuan7 (2019-08-26). + * tools/Makefile.unix: Remove some unnecessary conditional logic. From + Gregory Nutt (2019-08-26). + * - STM32H7: bbsram issues causing no writes and hardfaults + - stm32_pwr: Ensure data is flushed on backup domain access changes + - STM32H7: bbsram convince compiler to perform 32 bit write + From David Sidrane (2019-08-26). + * tools/Makefile.unix: Simplify dependencies. From Gregory Nutt + (2019-08-26). + * Add missing LF to cpuload procfs output From David Alessio + (2019-08-26). + * arch/sim/src/Makefile: Fix dependency problem due to reorganization of + some directories. From Gregory Nutt (2019-08-26). + * All function pointer types should be prefaced by the qualifier CODE + (unless the callable function is known to reside in RAM, then it + should be FAR). From Gregory Nutt (2019-08-26). + * arch/arm/src/imxrt: Adds quadrature encoder driver for IMXRT. From + Nicholas Chin (2019-08-27). + * syscall/ and related: Fix an error found in build testing. + Inconsistent conditional compilation led to link errors in certain + configurations. From Gregory Nutt (2019-08-27). + * sched/clock/clock_timekeeping.c: Fix cases in time conversion that + must be >= NSEC_PER_SEC, not > NSEC_PER_SEC. Similar to fix of + f9e80c4a1e2da24d402fa51affc59fd43b694a12. From Gregory Nutt + (2019-08-27). + * arch/arm/src/stm32f7/stm32_sdmmc.c: Fix warning when DMA is not + enabled. From David Sidrane (2019-08-28). + * drivers/analog/dac7554.c: Add support to the DAC7554 + digital-to-analog converter. From Augusto Fraga Giachero (2019-08-28). + * libs/libc/libc.csv: Add ioctl() to fs_ioctl() wrapper for varidic + case. From Pavel Pisa (2019-08-28). + * tools/mkexport.sh: Export all variables to support architecture + independent build against NSH. From Pavel Pisa (2019-08-28). + * tools/mkexport.sh: The export of gnu-elf.ld at least is required to + build ELF loadable binaries. Option to link system into different + memory locations (boot, application after boot-loader, RAM) without + need to rebuild/reexport NuttX is useful as well. From Pavel Pisa + (2019-08-28). + * arch/arm/src/stm32h7/stm32_ethernet.c: Fix some errors in Ethernet + MAC configuration. From Markus Bernet (2019-08-28). + * arch/arm/src/imxrt/hardware/imxrt_enc.h: Fix some errors in register + bit definitions. Noted by Arie de Muijnck. From Gregory Nutt + (2019-08-28). + * arch/arm/src/stm32h7/stm32_ethernet.c: Correct stm32h7 mac address + filtering. Correct the MAC address 0 register definition and remove + the 'receive all' flag. Now the Ethernet driver only receives packets + addressed to correct MAC. From Jukka Laitinen (2019-08-28). + * arch/arm/src/stm32h7/stm32_ethernet.c: Correct memory corruption + error. The Ethernet driver initialization incorrectly wrote to + DMACRXCR instead of DMACSR when trying to clear the stopped flags. + This caused invalid buffer length in the DMACRXCR, causing DMA to + overflow the RX buffers when large packets are sent to the device. + From Jukka Laitinen (2019-08-28). + * drivers/sensors/adt7320.c: Add support for the ADT7320 temperature + sensor. From Augusto Fraga Giachero (2019-08-28). + * The non-standard, non-portable type cpu_set_t was created specifically + to support the NuttX internal, SMP implementation. Any resemblance to + any other cpu_set_t would be purely coincidental. However it appears + that that coincidence has occurred. cpu_set_t has an equivalent, + non-standard, non-portable type in the GNU C library. Compilation of + libgnat expects this non-standard type to be defined. Who am I to + stand in the way of progress? This commit removes the conditioning on + CONFIG_SMP so that cpu_set_t is typed (as a uint8_t) even if + CONFIG_SMP is not defined. Reference: Bitbucket issue 164. From + Gregory Nutt (2019-08-29). + * arch/arm/src/stm32/stm32_adc.c: Add ADC calibration procedure for + IP_ADC_V1. Tested on STM32F100, and it magically increased result + accuracy. STM32F103 has the same calibration procedure. I am not + sure about others. From Matous Pokorny (2019-08-29). + * net/inet and net/tcp: Fix tcp close flow; free the connection after + all tcp close process finished. From zhangyuan7 (2019-08-30). + * tools/Makefile.* and tools/mkexport.sh: This change allows to export + builtin applications registry into temporarily created directory where + export archive content is prepared. If the Makefile in apps directory + does not define export: target then error is print but export + continues without interruption. It would be more logical to print + warning but there is no way instruct apps make to not print error. + From Pavel Pisa (2019-08-30). + * boards/arm/lpc17xx_40xx/lx_cpu: Add support for the PIKRON LX_CPU + board. From Pavel Pisa (2019-08-30). + * board/Kconfig and board/README.txt: Add configuration support for the + LX_CPU board. From Gregory Nutt (2019-08-30). + * README.txt and Documentation/README.html: Update README file + references to include the LX_CPU board README file. From Gregory Nutt + (2019-08-30). + * boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_ulan.c: Provides for + separate, non-standard, PiKRON uLAN registration at build-/run-time. + From Pavel Pisa (2019-08-30). + * Tiva directories: Fix TM4C129XNCZAD part number in Kconfig and + identifiers. Rationale: Fully specify that this is the 212-pin BGA + package (ZAD ending) and for consistency with earlier changes to other + Tiva TM4C12x part numbers in Kconfig names and identifiers. From + Nathan Hartman (2019-08-30). + * tools/Makefile.win: Port changes of commit + 3ed844640d25b854457b6cc08f89d907072c0054 to Makefile.win. Untested + because I don't have a Windows native build platform setup. There + have been a lot of changes to the build system lately do to directory + re-organization so likely the native build is broken. Certainly + tools/configure.bat should be replaces with tools/configure.c. From + Gregory Nutt (2019-08-30). + * net/Kconfig: Ethernet packet buffer size cannot be permitted to go + below 1294 if IPv6 is selected. From Gregory Nutt (2019-08-31). + * net/: Now handles reception of IPv4 packets with larger IPv4 headers + containing options. From Gregory Nutt (2019-08-31). + * boards/arm/lpc17xx_40xx/lx_cpu/configs/nsh/defconfig: Correct shit + defconfig file. Recent patch dumped a prohibited .config file as the + defconfig file when a proper defconfig file created via 'make + savdefconfig' is required. Bad. From Gregory Nutt (2019-08-31). + * arch/arm/src/stm32/stm32_adc.c: Correct an error found in build + testing. Recent commit to add STM32F1 calibration was not properly + conditioned. Caused compilation errors on all STM32 F2 family + members. From Gregory Nutt (2019-08-31). + * arch/arm/src/stm32/stm32_adc.c: Another fix. adc_calibrate() was + called even when it was conditioned out, causing a link time failure. + From Gregory Nutt (2019-08-31). + * net/: Re-order the content of all address-family socket 'connection' + structures so that they begin with a common prologue. This permits + better use of logic for different address family types. From Gregory + Nutt (2019-09-01). + * net/local/local_conn.c: Removed unnecessary memset(). Connection + structure is allocated with kmm_zalloc() which will clear all memory. + From Gregory Nutt (2019-09-01). + * boards/Board.mk: Add support to pass dependency paths. + boards/arm/cxd56xx/common/Makefile: Add correct dependency paths for + board/ and src/ subdirectories. From Gregory Nutt (2019-09-01). + * net/arp/arp.h: Remove an unused structure definition. From Gregory + Nutt (2019-09-01). + * gs2200m supports SIOCGIFHWADDR From Masayuki Ishikawa (2019-09-02). + * drivers/timers/pwm.c: Move the pwm/pwm.c driver to timers/pwm.c, The + drivers/pwm contained only one .c file (pwm.c), so to avoid the + proliferation of sub-directories inside drivers/ is better to move the + pwm.c driver to drivers/timers. The pwm.h header was moved to + include/nuttx/timers to keep consistency, so all files referencing it + need to be updated. From Augusto Fraga Giachero (2019-09-02). + * libc/libc/unistd/: Add stubs for geteuid(), getegid(), seteuid(), and + setegid(). NuttX does not currently support effective user/group IDs, + but these stubs will support linkage of applications that expect these + POSIX standard interfaces. From Gregory Nutt (2019-09-03). + * libc/libc/unistd/: Add stubs for setreuid(), and setregid(). NuttX + does not currently support effective user/group IDs, but these stubs + will support linkage of applications that expect these POSIX standard + interfaces. From Gregory Nutt (2019-09-03). + * arch/arm/src/arm/up_fullcontextrestore.S: When performing stability + test, the application would cause kernel crash. When I trace the + stack, I find that register R1 has been changed, and its value is the + same as register CPSR. In up_fullcontextrestore.S, the restoration of + R0 and R1 is not atomic: 'msr cpsr r1 will enable interrupts and the + recovery of r0 and r1 may be interrupted and the value or R1 may be + changed. Fix is to use a single ldmia to restore R0, R1, and return + via R15. From Loyen Wang (2019-09-04). + * drivers/sensors/isl29023.c: Add basic driver of ISL29023 ambient + light sensor. The basic driver can set operational mode, range, and + resolution. It can also read lux value in continuous mode. Interrupt + and the alarm is not implemented. From Matous Pokorny (2019-09-04). + * Makefile updates From jjlange (2019-09-05). + * tools/Makefile.win: Change of + 8883623d07f642e205109389268e97b2a519a77a needs to be applied to + Makefile.win too. From Gregory Nutt (2019-09-04). + * Fix some typos. Also minor update to stm32f7/nucleo-144/README.txt and + stm32l4/nucleo-l496zg/README.txt board documentation. From Juha + Niskanen (2019-09-05). + * drivers/rf/dat-31r5-sp.c: Add support to the DAT-31R5-SP+ digital + attenuator. Creates a the new device driver directory drivers/rf/ to + support drivers related to RF peripherals. It also adds support for + the DAT-31R5-SP+ digital attenuator. From Augusto Fraga Giachero + (2019-09-05). + * include/nuttx/spi/spi_bitbang.c: Fix build error when the spi bitbang + variable width support is enabled. From Augusto Fraga Giachero + (2019-09-05). + * include/sys/boardctl.h: Fix numbering of board IOCTL commands. Error + in numbering noted by Nathan Hartman. From Gregory Nutt (2019-09-05). + * net/tcp/tcp_send.c: Commit a52ceac13ee598696cb907b62326bfd4c111ac6c + broke IPv4 sending. In cp_send.c:tcp_ipv4_sendcomplete(), ‘ipv4->vhl’ + now needs to be configured before call to tcp_ipv4_chksum(). Noted by + Jussi Kivilinna in commit comments. From Gregory Nutt (2019-09-06). + * boards/Kconfig: Fix help text for BOARDCTL_IOCTL. From Nathan + Hartman (2019-09-06). + * net/ipforward/ipv4_forward.c: Correct some errors introduced with + commit a52ceac13ee598696cb907b62326bfd4c111ac6c. Noted by Adam + Porter. From Gregory Nutt (2019-09-06). + * tools/Makefile.unix: Rethink creation of new .version file with GIT + information. Cannot use 'sed -i' in its current form because that + does not work on macOS, FreeBSD, or NetBSD. From Gregory Nutt + (2019-09-07). + * tools/version.h and Makefile.unix: Minor improvement to previous + commit: Permit custom version strings that do not derive from the + major and minor version number From Gregory Nutt (2019-09-07). + * arch/arm/src/stm32/stm32_otg[fs|hs]host.c: STM32 host only initiates + transfer if buflenl > 0. From Adam Porter (2019-09-08). + * STM32F7/H7/L4 OTG host: Adam Porter's fix for STM32 FS/HS probably + should be applied to STM32 F7, H7, and L4 OTG host which are very + similar. From Gregory Nutt (2019-09-08). + * EFM32 OTG host: Adam Porter's fix for STM32 FS/HS probably should be + applied to EFM32 host which which has very similar IP. From Gregory + Nutt (2019-09-08). + * arch/arm/src/armv7-a: Fix typo and missing quotation for armv7-a. + From Oki Minabe (2019-09-08). + * arch/arm/src/armv7-a/arm_addrenv_utils.c: Fix double increment in + armv7-a's arm_addrenv_destroy_region(). From Oki Minabe (2019-09-08). + * arch/arm/src/armv7-a/arm_pgalloc.c: Fix L2 page table mask for + armv7-a. From Oki Minabe (2019-09-08). + * drivers/ioexpander/gpio_lower_half.c: Remove limitation when pintype + > GPIO_INTERRUPT_PIN. From ligd (2019-09-09). + * STM32, STM32F7, STM32H7, STM32L4, and EFM32 USB Host: This change was + required to get my devices (CDC-MBIM) to enumerate. Initially the + system timed out retrieving the USB configuration descriptor. Ctrl IN + requests got nothing but NAKs. I found that the initial SETUP packet + and corresponding IN transfer were fine; it was the Status OUT phase + that was getting the NAK. After receiving a NAK on the Status OUT, + the code would loop back and issue another ctrl IN, which will always + fail because the data was already transferred before. Thus the entire + transfer would 'timeout'. The fix I implemented moves the DATANAK + timeout loop to only apply to the Status OUT. Of course this worked + for my devices, but maybe isn't the right solution in general. I + think that both the ctrl IN and the Status OUT need their own retry + loops? From Adam Porter (2019-09-09). + * tools/mkexport.sh: Export LDSCRIPT and STRIP definition and align + with Makefile.export. From Pavel Pisa (2019-09-10). + * boards/arm/lpc17xx_40xx/lx_cpu/configs/nsh/defconfig: Tested + ETHRENET, UARTs, heap in external SDRAM, use of symbol tables for + applications loading over TFTP and kernel modules insertion. USB and + SD card enabled but there are some issues (probably config or IO + ports) still. From Pavel Pisa (2019-09-10). + * sched/sched_rrgetinterval.c: sched_get_rr_interval() should return + {0,0} if round-robin scheduling is not selected for the task. From + Gregory Nutt (2019-09-10). + * include/sys/types.h: Remove non-standard HP-UX priority range + definitions. HP-UX is not a supported OS. From Gregory Nutt + (2019-09-10). + * Fix typos, 1 in a #define, others in comments. This changes one + definition: _MQ_TIMEDRECIEVE is changed to _MQ_TIMEDRECEIVE. It + appears this symbol is not used anywhere. From Nathan Hartman + (2019-09-11). + * boards/z80: Correct path to linker script in all boards using the + ZDS-II toolchain. Yet more fallout from the big boards/ directory + re-organization. From Gregory Nutt (2019-09-11). + * boards/: Several more fixes to Make.defs files and README.txt files. + More collateral damage from the big boargs/ directory + re-organization. From Gregory Nutt (2019-09-11). + * boards/arm/imx6/sabre-6quad/scripts/Make.defs: Yet another boards/ + re-organization fix-up. From Gregory Nutt (2019-09-11). + * libs/libc/builtin/: builtin_isavail() should not set the errno + variable because this functions may be used by internal OS logic for + which setting the errno variable would be inappropriate. From Gregory + Nutt (2019-09-11). + * boards/arm/stm32f0l0g0/nucleo-g071rb/scripts/ld.script: Fix + .ARM.exidx section overlap with .data From Daniel Pereira Volpato + (2019-09-11). + * Modify all files from 2eb4fe5ffb7dee21b33 to use solution from Daniel + P. Volpato. From Alan Carvalho de Assis (2019-09-11). + * Modify all a few more linker scripts missed in 415e3d34482012ab308, + probably because they were created after 2eb4fe5ffb7dee21b33. From + Gregory Nutt (2019-09-11). + * Move EXIDX-related assignments inside of braces so that we can be + assure that the symbols have the correct alignment. Suggested by + Daniel P. Volpato From Gregory Nutt (2019-09-12). + * boards/arm/tiva/tm4c123g-launchpad/scripts/tm4c123g-launchpad.ld: Add + alignments for the TMC4123G-LaunchPad as well. From Nathan Hartman + (2019-09-12). + * boards/arm/stm32/axoloti, omnibusf4, and stm32f4discovery: If + CONFIG_SCHED_CRITMONITOR is selected, then make sure that ITM and DWT + resources are enabled before accessing ITM and DWT registers. By + default, these registers are disabled. Suggested by Juha Niskanen. + From Gregory Nutt (2019-09-13). + +8.2 2019-11-16 Gregory Nutt + + * drivers/mtd/gd25.c: Add support for a new FLASH vendor. From zhangbo_a + (2019-09-15). + * drivers/mtd/gd25.c: Add support for GD25 device with 256-Mbit + capacity. From YanLin Zhu (2019-09-15). + * drivers/mtd/gd5f.c: Add gigadevice SPI NAND FLASH driver. From + YanLin Zhu (2019-09-15). + * tools/Config.mk: Eliminate use of the built-in implicit rules. From + anchao (2019-09-15). + * tools/Config.mk and Makefile.unix: Support the incremental build for + configuration change. From Xiang Xiao (2019-09-15). + * All linker scripts: Preface all _ebss definitions with . = ALIGN(4). + Otherwise, the last bytes in the .bss section will not be initialized + properly. Also convert all linker scripts that use TABs to spaces. + From Gregory Nutt + (2019-09-15). + * All linker scripts: Preface all _edata definitions with . = ALIGN(4). + Otherwise, the last bytes in the .data section may not be initialized + properly. Also convert all linker scripts indent in units of 8-spaces + to units of 4-spaces. From Gregory Nutt (2019-09-15). + * tools/configure.*: Add -s option to skip .config/Make.defs existence + check. From Xiang Xiao (2019-09-16). + * tools/Makefile.unix: Fix build error when issue 'make -B'. mkdir: + cannot create directory 'staging': File exists: + tools/Makefile.unix:269: recipe for target 'staging' failed' From + Xiang Xiao (2019-09-16). + * drivers/syslog: syslog_force does not set errno so do not test + against it. Some changes to comments. From Juha Niskanen (2019-09-16). + * Large Ethernet packet can leads network halt From Bazooka Joe + (2019-09-16). + * boards/mips Linker Scripts: The PIC32M* start-up code initializes + .bss by writing 16 bytes at a time in a loop. The start (_sbss) + alignment is only required to be 4 bytes since the write is done with + 4 store instructions. In a previous change, the end address, _ebss, + was aligned to 16 byte to prevent initializing past the end off the + .bss region. However, that does not work unless the start address, + _sbss, is also aligned to 16 bytes. From Gregory Nutt + (2019-09-16). + * arch/arm/src/stm32h7/stm32_ethernet.c: Bazooka Joe's fix to the STM32 + F7 Ethernet driver (ec4a7be5c2540207042669e10cc4134e108dae02) should + be applied to the H7 as well. The other STM32 Ethernet driver already + has the change. From Gregory Nutt (2019-09-16). + * Kconfig and arch/Kconfig: Add some protection so that you cannot + select an architecture-specific header file if the architecture does + not provide the header file. From Gregory Nutt (2019-09-16). + * libs/libc/math/Kconfig: Should select the NuttX float.h file + automatically if the NuttX math library is selected. From Gregory + Nutt (2019-09-16). + * boards/arm/cxd56xx/spresense/include/board_pinconfig.h: Add board + specific pin configurations of CXD5602 pins to fit Spresense board. + From Takayoshi Koizumi (2019-09-16). + * boards/arm/cxd56xx/spresense/Kconfig: Add a configuration to select + if an extension board is attached to the SPresence. If there is no + extension board attached, the SPresense may run in a low-power mode by + default (as determined by the CONFIG_CXD56_CUSTOM_PINCONFIG option). + If an extension board is present, then the SPresense will need to run + at a higher power mode, selected by the new CONFIG_SPRESENSE_EXTENSION + option. From Gregory Nutt (2019-09-17). + * boards: spresense: Add isx012 camera initialization and config From + Alin Jerpelea (2019-09-17). + * Add support for STM32G070xx: + arch/arm/include/stm32f0l0g0: add support for STM32G070CB, STM32G070KB, + STM32G070RB + arch/arm/src/stm32f0l0g0: add support for STM32G070CB, STM32G070KB, STM32G070RB + From Daniel Pereira Volpato (2019-09-17). + * boards/arm/stm32f0l0g0/nucleo-g070rb: Initial support for board STM32 + NUCLEO-G070RB, including NSH config From Daniel Pereira Volpato + (2019-09-17). + * boards/arm/stm32f0l0g0/nucleo-g070rb/scripts/ld.script: Fix + .ARM.exidx section overlap with .data From Daniel Pereira Volpato + (2019-09-17). + * arch/arm/src/stm32f0l0g0/stm32*_pwr.c and stm32g0_rcc.c: Scale + dynamic voltage and flash wait states properly on STM32G0 chips. + arch/arm/src/stm32f0l0g0/stm32g0_rcc.c: Set VOS and flash wait states + properly + arch/arm/src/stm32f0l0g0/stm32f0l0_pwr.c: Renamed from + arch/arm/src/stm32f0l0g0/stm32_pwr.c + arch/arm/src/stm32f0l0g0/stm32g0_pwr.c: Preliminary implementation of + PWR module for STM32G0 (stm32_pwr_setvos() only) + From Daniel Pereira Volpato (2019-09-17). + * boards/arm/stm32f0l0g0/nucleo-g070rb/include/board.h: Enable PWR + peripheral and increase sysclk to max. frequency. SYSCLK can be + increased now that VOS and flash wait states are properly configured. + From Daniel Pereira Volpato (2019-09-17). + * arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c: Respect the I2C_M_NOSTART + flag. Sending a restart condition when not requested will break other + drivers that depend on this behavior. From Augusto Fraga Giachero + (2019-09-17). + * boards: spresense: Add board initialization for isx012 From Alin + Jerpelea (2019-09-18). + * include/nuttx/sensors/ioctl.h: Commands for the VL53L1X did not follow + the sequence. Noted by Daniel Pereira de Carvalho. From Gregory Nutt + (2019-09-18). + * net/ipforward, tcp, and udp: Fix a chicken and egg problem by + eliminating the check of the arp/neighbor tables before packet + transmission + 1. For buffered tcp/udp case, if + CONFIG_NET_ARP_SEND/CONFIG_NET_ARP_IPIN / CONFIG_NET_ICMPv6_NEIGHBOR + isn't enabled and the table doesn't contain ip<->ethaddr mapping + yet, the logic will skip the realtransmission and then arp/neighbor + can't steal the final buffer to generate arp/icmpv6 packet. + 2. For all other cases, the tcp layer or user program should already + contain the retransmit logic, the check is redundancy and may + generate many duplicated packets if arp/icmpv6 response is too slow + because the cursor stop forward. If user still concern about the + very first packet lost, he could fix the issue by + enabling CONFIG_NET_ARP_SEND/CONFIG_NET_ICMPv6_NEIGHBOR at begin. + From Xiang Xiao (2019-09-18). + * stm32h7 SDMMC support IDMA, Interrupt driven, pullups and SDIO + - stm32h7: Supports ARMV7M Stack check + - stm32h7: sdmmc bug fix writting address 0 + - stm32h7: sdmmc Clean up timming + - stm32f7: Kconfig typos, formating + - stm32f7: sdmmc use binary not + - stm32f7: nxstyle formatting + - stm32h7: SDMMC Kconfig add Block Setup, Preflight, Delayed Invalidate + - stm32h7: Correct value of ICR reset + - stm32h7: SDMMC support IDMA, Interrupt driven, pullups and SDIO + - stm32h7: Add AXI + - stm32h7: Workaround for Errata 2.2.9 Reading from AXI SRAM may lead + to data read corruption + From David Sidrane (2019-09-19). + * tools/configure.sh and configure.c: Do not remove CONFIG_SIM_M32 if + host is specified. From anchao (2019-09-19). + * libs/libc/unistd/lib_getcwd.c: remove stray sched_unlock(). Also + fixes several typos. From Juha Niskanen (2019-09-19). + * Dispatch ICMP_POLL to device's callback list too since icmpv6_neighbor + still append the callback into this list. From Gregory Nutt + (2019-09-20). + * Fix portability issue with date, hostname From David Alessio + (2019-09-20). + * net/: Decouple autoconfig and icmpv6 socket to avoid the invalid + kconfig combination. From Xiang Xiao (2019-09-20). + * net/icmpv6/icmpv6_autoconfig.c: cmpv6_autoconfig() error handling + must not overwrite overwrite the error code. From Xiang Xiao + (2019-09-20). + * Add support for the BCM43438A1 Bluetooth capability. It also adds a + serial 'shim' to allow any regular serial port that can support a + Bluetooth H4 interface (i.e. it has RTS/CTS) to be used to drive a + Bluetooth device (Get a handle to it via hci_uart_getdevice + ("/dev/xxx") and then pass it to the btuart_register function. From + Dave Marples (2019-09-21). + * boards/arm/stm32/stm32f4discovery/src: Add support for external + DS1307 module. From Alan Carvalho de Assis (2019-09-22). + * boards/arm/samd2l2/arduino-m0: Add initial board support for the + Arduino M0. From Alan Carvalho de Assis (2019-09-22). + * arch/arm/src/lpc54xx/lpc54_clockconfig.c: Fix PLL settings. For the + lpc54628 Rev. E board the PLL was not configured properly and the + board wouldn't boot correctly. I checked the startup files from the + official IDE and inspected the assembly instructions for the libraries + used. From Andrei Stefanescu (2019-09-22). + * boards/arm/samd2l2/arduino-m0/src/sam_usb.c: Add usbnsh board + configuration. From Alan Carvalho de Assis (2019-09-22). + * sched/signal/sig_initialize.c: Add some checks for allocation + failures. From Gregory Nutt (2019-09-23). + * arch/arm/src/stm32h7/hardware/stm32_adc.h: Fix typos in ADC register + definitions. From Markus Bernet (2019-09-24). + * stm32h7: RCC Add PLL3 Support and only enable PLLs if used From David + Sidrane (2019-09-24). + * Direct users to our kconfig-frontends snapshot instead of upstream. + It appears Yann Morin's kconfig-frontends project has gone offline and + the website at http://ymorin.is-a-geek.org/projects/kconfig-frontends + is not responding. Until we can identify a "proper" upstream project, + use the snapshot in NuttX tools repository. + Replace (almost) all links to Yann Morin's kconfig-frontends in the + docs to point to the NuttX tools snapshot instead. From Nathan + Hartman (2019-09-24). + * drivers/net and net/: Use ntoh() when printing IPv6 addresses so that + the addresses appear in friendlier host order vs. network order. From + Bernd Walter (2019-09-24). + * net/icmpv6/icmpv6_rnotify.c: Correct a bad index in debug output. + From Bernd Walter (2019-09-25). + * net/inet/inet_close.c: Fixes two problems, both noted by Bernd Walter: + 1) Prior to this change the 'pstate' variable was non-NULL only when + doing a lingering close. Comments to this effect as well as tests + of pstate should also have been updated. These are confusing and + inappropriate, but do not lead to incorrect behavior. + 2) Eliminate an incomplete test when a disconnection event. When a + disconnection event occurs, the close logic MUST always terminate + the wait. The conditional test was not incorrect, however, it + lacked 'else' logic and would simply ignore that disconnection + event in some cases. That is bad because there may not be another + disconnection event and that can lead to hangs (or + at least very, very long delays). From Gregory Nutt (2019-09-25). + * cxd56xx: various fixes + - arch: arm: cxd56xx: Support to set any i2c frequency. This change + supports to be able to set the i2c frequency other than just 100 or + 400 Hz. + - arch: arm: cxd56xx: Enable SD clock during access to SD card + - Improve GNSS low sensitivity with SD card inserted + - Reduce power consumption by stopping SD clock + - arch: arm: cxd56xx: Do PANIC() when cpu rx FIFO is overflow. If CPU + Rx FIFO is overflow, it's fatal error for system. In such a case, this + change changes to allow the user to notice by calling PANIC() for + debuggability enhancement. + - arch: arm: cxd56xx: Fix compile error in sdhci debug code + - arch: arm: cxd56xx: Remove assertion in cpu tx queue. When CPU Tx + queue is overflow, it returns -EAGAIN instead of assertion to be + able to retry. + - arch: arm: cxd56xx: Add configurations for cpu fifo elements + - arch: arm: cxd56xx: Fix LPADC configuration. LPADC options defined + in the same symbol name, so kconfig tool couldn't process + them correctly. + - arch: arm: cxd56xx: Update loader and gnssfw ver.17660 + - arch: arm: cxd56xx: Fix hang-up when error interrupt occurs. Fix a + problem that error interrupts are not cleared. + - arch: arm: cxd56xx: Fix sdhci semaphore. Fix initial value of + semaphore in sdhci drive.r + - boards: cxd56xx: Treat the initial value of LNA power as off. LNA + is always turned power on when GNSS is started. So it is desirable + that the initial value of the LNA power is off by default. + - boards: cxd56xx: Remove initial setting of PIN_AP_CLK. PIN_AP_CLK is + used as a port selector of SDIO expander on the extension board, + and is set output low in initalizing. Therefore, this pin cannot be + used for other board. To avoid this restriction, remove this initial + operation because this pin is pulled down by default on the + extension board. From Alin Jerpelea (2019-09-26). + * arch\arm\src\stm32h7\Kconfig: Add the CRC option in KConfig. From + Eduard Niesner (2019-09-27). + * arch/arm/src/stm32l4/stm32l4_dumpgpio.c: Fix using wrong GPIO enable register. + From Juha Niskanen (2019-09-27). + * boards/arm/stm32/stm32f429i-disco/include/board.h: Remove forbidden STM32 + header file inclusions. Fix some coding standard issues. From Gregory Nutt + (2019-09-27). + * libs/libxx/Kconfig: Automatically select CONFIG_CLOCK_MONOTONIC when + CONFIG_LIBCXX is selected. + Remove hardcoded -DCLOCK_MONOTONIC from CFLAGS in Make.defs of several + configurations. That definition is now automatically adding this define when + CONFIG_LIBCXX=y. From Daniel Pereira Volpato (2019-09-27). + * arch/sim: Add stack color feature for ps command. From ligd (2019-09-28). + * tools/simbridge.sh: Add simbridge.sh to simplify the simulator bridge + creation. From Xiang Xiao (2019-09-28). + * libs/libc: move writev from math.csv to libc.csv From Xiang Xiao (2019-09-28). + * libs/symtab/Makefile and tools/mksymtab.c: Ensure that the generated symbol + table name same as the configuration option. From Xiang Xiao (2019-09-28). + * ibs/libc, libs/symtab, tools/ build system: Move symbol table generation into + libc since the address in symbol table should come from userspace binary for + protect build, not kernel binary. From Xiang Xiao (2019-09-28). + * libs/libc: Add CONFIG_MODLIB_SYSTEM_SYMTAB to generate the symbol table for + dlopen/insmod. From Xiang Xiao (2019-09-28). + * boards/arm/stm32f7: Remove inclusion of STM32 F7 header files from + all board.h header files. From Gregory Nutt (2019-09-29). + * boards/arm/stm32rl4: Remove inclusion of STM32 L4 header files from + all board.h header files. From Gregory Nutt (2019-09-29). + * tools/Makefile.unix: Make COMMON_DIR work with + CONFIG_ARCH_BOARD_CUSTOM. From Xiang Xiao (2019-09-30). + * Configuration: Auto-select CONFIG_BUILD_LOADABLE when either + CONFIG_BUILD_KERNEL or CONFIG_BINFMT_LOADABLE is selected. From Xiang + Xiao (2019-09-30). + * tools/ Make fragments: Fix the various minor issue for + NUTTXLIBS/USERLIBS + 1. Remove libcxx duplication in FlatLibs.mk and from kernel space + 2. Remove libpass1 from KernelLibs.mk since kernel build doesn't + support the two pass mode + 3. Remove FSDIR related comment since file system cannot be disabled + now + From Xiang Xiao (2019-09-30). + * tools/Directories.mk: Remove FSDIRS/NOFSDIRS related logic/comments + since the file system can no longer be disabled now. From Xiang Xiao + (2019-09-30). + * tools/Makefile.host: Add missing binaries from clean target From + Gregory Nutt (2019-09-30). + * tools/mksymtab.c: Clean up syntax of help text. From Gregory Nutt + (2019-09-30). + * tools/README.txt: Update to show new usage of mksymtab. From Gregory + Nutt (2019-09-30). + * Fix cxd56 ostest: + - boards: spresense: Fix config names in cxd56_ostest.c + - boards: spresense: Enable ostest in rndis/defconfig + - boards: spresense: Enable ostest in wifi/defconfig + From Masayuki Ishikawa (2019-10-01). + * boards: spresense: Add --gc-sections to LDFLAGS in scripts/Make.defs + Also, add -ffunction-sections -fdata-sections to ARCHCFLAGS From + Masayuki Ishikawa (2019-10-01). + * drivers/crypto/dev_urandom.c: Revert part of a previous change. That + change was ill informed and introduced warnings when + CONFIG_DEV_URANDOM_RANDOM_POOL is selected. As noted by Juha + Niskanen. From Gregory Nutt (2019-10-01). + * libs/libc/ Kconfig files: Disable EXECFUNCS_HAVE_SYMTAB for kernel + build. The symbol table don't have any meaning for kernel build since + all executable binary should be self contained. From Xiang Xiao + (2019-10-01). + * tools/mkexport.sh: Copy the essential build script files too and move + Make.defs/gnu-elf.ld into scripts like board folder layout. From + Xiang Xiao (2019-10-01). + * Makefiles: change ${shell pwd} to $(CURDIR) since pwd doesn't exist on + Windows From Xiang Xiao (2019-10-02). + * drivers/wireless/ieee802154/mrf24j40/mrf24j40.c: Correct erroneous + isolation of address mode field and subsequent bad comparison. From + Gregory Nutt (2019-10-02). + * arch/arm/src/stm32l4/stm32l4_firewall.c: Correct a test to determine + if an address lies in FLASH or not. Improper mask caused test to + always fail. From Gregory Nutt (2019-10-02). + * tools/testbuild.sh: Add an option to select the number of CPUs to use + with 'make' From Gregory Nutt (2019-10-02). + * tools/testbuild.sh: Use CPU option on 'make distclean' too, but not + 'make olddefconfig. From Gregory Nutt (2019-10-02). + * tools/Config.mk: Support the ability to change the CFLAGS for the + compilation of a single file. Set special compiler options as follows + the rule: sourcefile + fixed suffix "_[A|C|CPP|CXX]FLAGS" + apps/examples/hello/Makefile: $(SRCDIR)/hello_main.c_CFLAGS = -DTEST + From Xiang Xiao (2019-10-03). + * Spresense smp + - arch: arm: Add ARCH_GLOBAL_IRQDISABLE to ARCH_CHIP_CXD56XX in Kconfig + - arch: arm: cxd56xx: Make fpuconfg() public in cxd56_start.c. NOTE: + fpuconfig() is called in both cxd56_start.c and cxd56_cpustart.c + - arch: arm: cxd56xx: Add support for SMP. NOTE: To run cxd56xx in + SMP mode, new boot loader which will be released later must be used. + - arch: arm: cxd56xx: Add irq routing for SMP in cxd56_irq.c. NOTE: In + cxd56xx, each external interrupt controller can be accessed from a + local APP_DSP (Cortex-M4F) only. This change supports IRQ routing + for SMP by calling up_send_irqreq() in both up_enable_irq() and + up_disable_irq(). + - boards: spresense: Add smp configuration + From Masayuki Ishikawa (2019-10-03). + * boards: cxd56xx: common: Add .gitignore not to show untracked files. + From Masayuki Ishikawa (2019-10-03). + * tools/mkexport.sh: Should export full content for flat build even + with CONFIG_BUILD_LOADABLE. From Xiang Xiao (2019-10-03). + * arch/arm/src/stm32/stm32_usbdev.c: Fix some new warnings reported by + gcc 8.3.1 in build tests. From Gregory Nutt (2019-10-03). + * sched/signal/sig_default.c: fix undefined reference to sched_suspend + if CONFIG_SIG_SIGSTOP_ACTIO not defined and eliminate compilation + warnings From raiden00pl (2019-10-04). + * arch: armv7-m: Fix a deadlock in up_sigdeliver() in SMP mode. In + previous implementation, up_disable_irq() was called before recovering + local context. However, I noticed a deadlock happens in the following + situation. For example, if up_sigdevliver() is in progress on CPU0 and + CPU1 has called up_cpu_paused to CPU0, hence g_cpu_irqlock has been + locked by CPU1, in this case, we would see a deadlock in later call of + enter_critical_section() to restore irqcount. + To avoid this situation, we need to call enter_critical_section() to + break the deadlock. From Masayuki Ishikawa (2019-10-04). + * armv7-a and xtensa: Apply Masayuki Ishakawa's change to these these + other SMP architectures as well. From Gregory Nutt (2019-10-04). + * sched/wdog/wd_start.c: Back out a kludge-workaround for an SDCC + compiler problem fix back in Feb 2017. That workaround now appears to + conflict with newer GCC versions using unsupport warning options. + From Gregory Nutt (2019-10-04). + * drivers/wireless/bluetooth/bt_uart_bcm4343x.c: BCM4343x HCIUART + support. From Dave Marples (2019-10-04). + * arch/arm/src/lpc17xx_40xx/lpc17_40_ethernet.c: Use usleep() instead of + up_delay() for large wait times. From Augusto Fraga Giachero + (2019-10-04). + * boards/arm/tiva/tm4c123g-launchpad/: SPI CAN functionality on + TM4C123GXL - ek-tm4c123gxl_spi_can. From DisruptiveNL (2019-10-05). + * arch/sim/src/sim/up_hostfs.c: hostfs skip '.' and '..' in readdir' + From Xiang Xiao (2019-10-07). + * tools/mkromfsimg.sh: Use sed to add const to ROMFS declarations so + that they like in FLASH not RAM. From Bernd Walter (2019-10-07). + * arch/arm/src/stm32h7/hardware/stm32_tim.h: Fix ATIM_BDTR_BK2P define + arch/arm/src/stm32h7/hardware/stm32_tim.h: Fix ATIM_AF2 bitfields + wrongly allocated to ATIM_AF1 + arch/arm/src/stm32f7/hardware/stm32f76xx77xx_tim.h: Fix ATIM_AF2 + bitfields wrongly allocated to ATIM_AF1 + arch/arm/src/stm32h7/stm32_tim.c: Fix some copy'n'paste errors on + defines + From Daniel Pereira Volpato (2019-10-07). + * arch/arm/src/stm32f0l0g0: Support timers available on STM32G070 + arch/arm/src/stm32f0l0g0: Pinmap TIM1 GPIOs available for STM32G0 + arch/arm/src/stm32f0l0g0: Add TIM driver lowerhalf + arch/arm/src/stm32f0l0g0/stm32_tim_lowerhalf.c: Handle 32-bit + overflow on some calculations. + From Daniel Pereira Volpato (2019-10-07). + * boards/arm/stm32f0l0g0/nucleo-g070rb/include/board.h: Add TIMx clock + frequencies boards/arm/stm32f0l0g0/nucleo-g070rb: Enable basic timers + From Daniel Pereira Volpato (2019-10-07). + * drivers/wireless/bluetooth/bt_uart_bcm4343x.c: Fix small a small bug + found during testing. + drivers/wireless/bluetooth/bt_uart_shim.c: Change the task name for + the HCI receiver task to bring it into line with the transmitter + task. From Dave Marples (2019-10-08). + * drivers/usbdev/cdcacm.c: Fix memory leak of RX failsafe timer. From + Juha Niskanen (2019-10-08). + * boards: arm: cxd56xx: different updates + - boards: cxd56xx: spresense: initialize SCU at boot. The SCU has to + be initialized at bootup on spresense board because several + functions depend on it. + - boards: arm: cxd56xx: add audio control definitions. Add audio + control definitions for the audio implementation. + - boards: arm: cxd56xx: add audio defconfig. Add defconfig for the + audio implementation + From Alin Jerpelea (2019-10-08). + * Old style exceptions --> new style for Python 3 From Christian Clauss + (2019-10-08). + * boards: spresense: add audio implementation + - boards: arm: cxd56xx: add audio implementation. Add the board audio + control implemantation + - boards: arm: cxd56xx: update audio defconfig. Small updates to + build the platforms specific audio driver + - boards: arm: cxd56xx: drivers: add audio implementation. Add the + audio implementation for CXD56XX chip + - boards: arm: cxd56xx: fix Load switch GPIO. During the initial + bringup the grong GPIO was set. + From Alin Jerpelea (2019-10-09). + * drivers/pipes/fifo.c: mkfifo should return -1 and set errno on + failure From raiden00pl (2019-10-11). + * We have ported NuttX on Renesas RX65N Micro-controller. This port + includes following interfaces: (1) Serial (UART) driver (13 ports) and + (2) Ethernet driver. This port is provided on two boards: (1) RSK + RX65N-2MB and (2) GR-Rose. The port is built on Cygwin environment. + As part of this port, we have created two documents: (1) Readme.txt + for each board, and (2) User manual to provide information about + development environment setup. Both these documents are placed under + (1) /boards/renesas/rx65n/rx65n-grrose and (2) + boards/renesas/rx65n/rx65n-rsk2mb. From Anjana (2019-10-11). + * boards: arm: cxd56xx: audio: add power_control and audio_tone_generator + - boards: arm: cxd56xx: audio: add power_control. Add a simple way to + control the audio power for userspace apps + - boards: arm: cxd56xx: audio: add audio_tone_generator. Add a simple + way to control the audio buzzer with defined frequency for userspace + apps. + From Alin Jerpelea (2019-10-11). + * libs/libxx/Kconfig: CONFIG_LIBC_LOCALE is needed to build libcxx. A + math library is also needed, however, here are various ways to provide + a math library so CONFIG_LIBM is not now set. + boards/arm/stm32l4/nucleo-l476rg/scripts/Make.defs: Add required + definitiions if libcxx is enabled. + From Matias N (2019-10-12). + * Fix posix spawn + - boards: lc823450-xgevk: Fix build error for posix_spawn + - boards: stm32f4discovery: Fix build error for posix_spawn + From Masayuki Ishikawa (2019-10-13). + * Gs2200m with reset + - include: wireless: Add reset handler to struct gs2200m_lower_s + - drivers: wireless: Add reset and unreset sequence in gs2200m.c + - boards: cxd56xx: Add reset handler to cxd56_gs2200m.c + From Masayuki Ishikawa (2019-10-15). + * Fix cpustart for Cortex-M SMP + - arch: lc823450: Fix lc823450_cpustart.c. In Cortex-M, offset 0 in + vector table stores initial stack pointer and offset 4 stores reset + vector. + - arch: sam34: Fix sam4cm_cpustart.c. In Cortex-M, offset 0 in vector + table stores initial stack pointer and offset 4 stores reset vector. + From Masayuki Ishikawa (2019-10-16). + * drivers: serial: Fix data corruption when outputting data in SMP mode + From Masayuki Ishikawa (2019-10-16). + * sched/pthread, Documentation: fix pthread_key_delete, pthread_self and + pthread_yield documentation and some comments. From Juha Niskanen + (2019-10-17). + * arch/arm/src/stm32l4/Kconfig: Add STM32L4R5ZI chip type. From Jussi + Kivilinna (2019-10-17). + * include/sys/time.h: include sys/select.h to compatible with earlier + standards. According to earlier standards, usage of select(), FD_CLR, + FD_ISSET, FD_SET and FD_ZERO just need include headers: sys/time.h, + sys/types.h and unistd.h. So include sys/select.h in time.h to + compatible with it. Or mbedtls library would build break in calling + select() and FD_* related functions. + https://pubs.opengroup.org/onlinepubs/007908799/xsh/select.html + From liuhaitao (2019-10-17). + * sched/signal: Add support for SIGPIPE. SIGPIPE uses + SIG_SIGPIPE_ACTION which terminates process by default. It also could + be ignored. From liuhaitao (2019-10-17). + * tools/LibTargets.mk: Make libapps.a by the default target. From + Xiang Xiao (2019-10-17). + * include/nuttx/timers/pwm.h: Correct some typos. + arch/arm/src/stm32f0l0g0: Add PWM support. From Daniel Pereira + Volpato (2019-10-17). + * boards/arm/stm32f0l0g0/nucleo-g070rb: Add PWM support and GPIO_TIM3_* + mappings + boards/arm/stm32f0l0g0/nucleo-g070rb/configs/nsh: Enable PWM example + From Daniel Pereira Volpato (2019-10-17). + * boards: stm32f4discovery: Add support for MMCSD_SPI. This change + works with STM32F4 Discovery Shield plus microSD click From Masayuki + Ishikawa (2019-10-18). + * boards: spresense: audio: add missing header. Add the missing header + to silence compiler warnings From Alin Jerpelea (2019-10-18). + * boards/arm/am335x/beaglebone-black/src/: Use the same bring-up + structure as is used with other boards. From Gregory Nutt (2019-10-18). + * arch/arm/src/stm32/hardware/stm32f40xxx_pinmap.h: ETH_RMII_REF_CLK is + an input. From Gregory Nutt (2019-10-18). + * net/udp/udp_psock_sendto_unbuffered.c: Add a check for the device + that is polling. In the multiple network device case, this check is + necessary to prevent sending the UDP packet to the wrong device. This + change addresses only the unbuffered case. The buffered case is more + complex. See patch attached to issue 172. From Gregory Nutt + (2019-10-18). + * net/udp/udp_psock_sendto_buffered.c: Add a check for the device that + is polling. In the multiple network device case, this check is + necessary to prevent sending the UDP packet to the wrong device. This + change addresses the buffered case. From Gregory Nutt (2019-10-18). + * boards/sim/sim/sim/configs:: Add -m32 to HOSTLDFLAGS if enable + CONFIG_SIM_M32. Fixes the following link errors: + /usr/bin/ld: i386 architecture of input file `nettest_host.hobj' is + incompatible with i386:x86-64 output + /usr/bin/ld: i386 architecture of input file `nettest_server.hobj' is + incompatible with i386:x86-64 output + From Xiang Xiao (2019-10-19). + * tools/indent.sh: Add a command line option to suppress reformatting + of comments. This is useful when comments are already correct and/or + contain formatted data such as tables or lists. From Gregory Nutt + (2019-10-19). + * arch/arm/src/s32k1xx: Support configuration and initialization of the + flash configuration bytes. In + boards/arm/s32k1xx/s32k1**evb/scripts/flash.ld: Create a special + FLASH section to hold the FLASH configuration bytes. From Gregory + Nutt (2019-10-19). + * arch/arm/src/s32k1xx/Kconfig: Add some help text for the flash + configuration fields. From Gregory Nutt (2019-10-19). + * boards/arm/imxrt/imxrt1060-evk/src/imxrt_lcd.c: Add support for LCD. + Clean up some LCD-related interfaces. From Fabio Balzano (2019-10-20). + * arch/sim/src/sim/up_tickless.c: Correct the calculation of the timer + period. Fix some missing initialization of globals and missing return + values. From Matias N (2019-10-20). + * fix early timespec overflow if using 32 bit system timer From Jens + Gräf (2019-10-21). + * STM32H7 Ethernet: Fix ETH_MACMDIOAR_CR_MASK bit mask. From Markus + Bernet (2019-10-21). + * boards: cxd56xx: add board support for LTE modem and modem driver + - drivers: modem: add altair modem driver. Add modem driver for the + altair modem. + - boards: cxd56xx: add board support for LTE modem. Add the Altair + LTE modem support on the Spresense board. + - boards: cxd56xx: spresense: add LTE defconfig. Add the Altair LTE + modem defconfig for spresense board + From Alin Jerpelea (2019-10-21). + * arch/sim/src/sim: Fixes compilation for sim target when enabling power + management. From Matias N (2019-10-22). + * stm32f4dis with gs2200m: + - drivers: wireless: Add SPI_SELECT() to _read/write_data() in gs2200m.c + - boards: stm32f4discovery: Add support for gs2200m. NOTE: GS2200M + for Spresense works with mikroe STM32F4 Discovery Shield (slot3) + From Masayuki Ishikawa (2019-10-22). + * STM32H7: Flash driver and Serious BUG fixes: + - arch/arm/Kconfig:Add ARCH_HAVE_PROGMEM for STM32H7 + - stm32h7:Add FLASH progmem support + - stm32h7:pwr add CPUCR & D3CR + - stm32h7:syscfg Add PWRCR + - stm32h7:rcc Properly configure VOS and Flash + From David Sidrane (2019-10-22). + * arch/arm/src/s32k1xx/s32k1xx_flashcfg.c: Flash configuration array + should be const (although it really does not matter in this context). + From Gregory Nutt (2019-10-22). + * drivers/usbhost: Remove all traces of support for the installable GPL + RTL8187 USB host driver. From Gregory Nutt (2019-10-22). + * boards: cxd56xx: spresense: add board_timerhook function + - boards: cxd56xx: spresense: add board_timerhook function. In + preparation for SDK we muts have a weak board_timerhook function + - drivers: usbhost: add missing endif. By accident an endif was + missing. + - boards: cxd56xx: audio: add build barrier. The audio implementation + should not be bebuilt if the config CONFIG_CXD56_AUDIO is not set. + - arch:arm:cxd56xx: add ge2d.h header. The header is used by + imageproc. + From Alin Jerpelea (2019-10-23). + * drivers/usbhost/usbhost_hidkbd.c: Fix keyboard debounce algorithm + used when CONFIG_HIDKBD_NODEBOUNCE is undefined. From Jeff Theusch + (2019-10-23). + * boards: cxd56xx: spresense: add Spresense Image Processor. Enable + support for accelerated format convertor, rotation and so on.using the + CXD5602 image processing accelerator. + boards:cxd56xx:spresense: initalize GNSS and GEOFENCE at boot. Add + the optional initialization of GNSS and GEOFENCE at bootif the + drivers are enabled. + From Alin Jerpelea (2019-10-23). + * drivers/usbhost/Kconfig: Change default for CONFIG_HIDKBD_POLLUSEC + per recommendation of Jeff Theusch. From Gregory Nutt (2019-10-23). + * tools/nxstyle.c: Add detection of carriage returns. Improve + reporting of TABs. From Gregory Nutt (2019-10-23). + * i.MXRT1060-EVK (mostly): Add basic LCD support for the board + IMXRT1060-EVK. From Fabio Balzano (2019-10-23). + * boards/arm/imxrt/imxrt1060-evk: Added Littlevgl demo configuration + into imxrt1060-evk board directory. From Fabio Balzano (2019-10-23). + * boards/arm/imxrt/imxrt1060-evk/README.txt: Fix typos and whitspace + problems in README file. From Fabio Balzano (2019-10-23). + * boards/arm/imxrt/imxrt1060-evk/README.txt: Added instructions to run + the LVGL demo. From Gregory Nutt (2019-10-23). + * arch/sim/src/Makefile: Fixes missing recursion into sim board + directory for dependency generation. From Matias N (2019-10-24). + * arch/sim/src/sim/up_idle.c: Report activity on simulated UART. From + Matias Nitsche (2019-10-24). + * boards/arm/imxrt/imxrt1060-evk: Fix FT5X06 CTRSTn pin configuration, + increased number of pollwaiters for the FT5X06, tuned resolution + during pointer dragging. From Fabio Balzano (2019-10-24). + * boards: cxd56xx: spresense: cleanup and new defconfig + - arch: cxd56xx: remove NVIC_SYSH redefinition. The NVIC_SYSH is + already defined in nvicpri.h + - boards: cxd56xx: spresense: configs: enable SPRESENSE_EXTENSION. + Enable high current mode for the Spresense Extension board on all + examples that have SDCARD support + - boards: cxd56xx: spresense: ifdef SDCARD_TXS02612. The SD Card + TXS02612 port expander is hosted on the Extension board and should + not be enabled if the extension board is not prezent. + - boards: cxd56xx: spresense: configs: increase MQ_MAXMSGSIZE. This + change is needed by the display driver on spresense platform + - boards: cxd56xx: spresense: config: add lcd examples defconfig. + This is a configuration for the basic nx examples. + From Alin Jerpelea (2019-10-24). + * tools/nxstyle.c: Add logic to detect if there is a blank line + following the final right brace. sched/: Applied the modified + nxstyle to all C file as a test. From Gregory Nutt (2019-10-24). + * arch/arm/src/imxrt/imxrt_lpi2c.c: Fix a warning about an unused local + variable. Found in build testing. From Gregory Nutt (2019-10-24). + * Add DMA support for STM32L4+ series + - Add DMA support for STM32L4+ + - stm32l4xrxx_rcc: enable "Range 1 boost" mode if any PLL freq above + 80 Mhz + From Jussi Kivilinna (2019-10-25). + * stm32l4_otgfs: enable OTGFS for STM32L4+ series. The OTGFS peripheral + on stm32l4x6 and stm32l4rxxx reference manual is exactly the same. + This change also adds missing bits and fixes errors in stm32l4x5xx and + stm32l4x6xx OTGFS register maps. From Jussi Kivilinna (2019-10-25). + * drivers/mtd/gd25.c: Add 4byte address operation for capacity larger + than 128Mbit. From YanLin Zhu (2019-10-25). + * tools/nxstyle.c: Eliminate false alarm errors on comments that are to + the right of code when the comment terminator is on the same line as + the last of the comment. From Gregory Nutt (2019-10-25). + * drivers/modem/altair/Kconfig: Default for CONFIG_MODEM_ALTMDM should + be 'n' and it must depend on CONFIG_SPI_EXCHANGE. From Gregory Nutt + (2019-10-25). + * This change corrects a problem with NSH: NSH was calling the OS + internal function ramdisk_register() in violation of the portable + POSIX interface. This change solves the problem by introducing a new + boardctl() function BOARDIOC_MKRD which moves the RAM disk creation + into the OS. From Gregory Nutt (2019-10-26). + * drivers/Kconfig: Add an option, CONFIG_DRVR_MKRD, to control whether + or not the mkrd() implementation is build. Otherwise, if mkrd() is + built unconditionally, it will be drawn into every build whether it is + used or not and will increase the build size. From Gregory Nutt + (2019-10-26). + * board/boarctl.c: Add support for the new BOARDIOC_ROMDISK command. + This allows applications to create ROMFS block drivers without illegal + direct calls to romdisk_register. + include/sys/boardctl.h: Add basic definitions to support a ROM disk + creation boardctl() command. + From Gregory Nutt (2019-10-26). + * drivers/Kconfig: If CONFIG_DRVR_MKRD is selected, then we must + auto-select CONFIG_FS_WRITABLE and CONFIG_FS_READABLE. From Gregory + Nutt (2019-10-26). + * boards/arm/stm32/axoloti: Every BSP must provide boot + board_late_initialize() AND board_app_initialize(). That is because + you never now how the configuration will be set. CONFIG_LIB_BOARDCTL + may be auto-selected by applications that need boardctl() support... + requiring the existence of board_app_initialize(). From Gregory Nutt + (2019-10-26). + * tools/nxstyle.c: Eliminate false alarms when checking for alignment + of comments to the right of code. Fix check for C++ style comments so + that strings like http:// and https:// do not generate false alarms. + From Gregory Nutt (2019-10-27). + * boards/arm/sama5/sama5d4-ek/src/sam_appinit.c: Fix error found in + build testing. Bad conditional compilation for + board_app_initialize(). Should depend only on CONFIG_LIB_BOARDCTL, + CONFIG_BUILD_KERNEL is irrelevant. From Gregory Nutt (2019-10-27). + * boards/arm/dm320/ntosd-dm320/src/: Fix error found in build testing. + All configurations must provide boar_app_initialize() which is + required if CONFIG_LIB_BOARDCTL is enabled. From Gregory Nutt + (2019-10-27). + * arch/arm/src/stm32 and boards/arm/stm32/olimex-stm32-p207/src: Fix an + error found in build testing. There is not relationship be + CONFIG_STM32_USBHOST and CONFIG_USBHOST, yet they they are used + interchangeably. This means that can (and did) get out of synch + causing link time failures. This change adds logic to select + CONFIG_USBHOST when CONFIG_STM32_USBHOST is selected, keeping the two + settings synchronized. Furthermore, since CONFIG_STM32_USBHOST is the + authoritative setting, all occurrences of CONFIG_USBHOST were replaced + with CONFIG_STM32_USBHOST in the architecture code and in this one + board code that was producing the error in build testing. From + Gregory Nutt (2019-10-27). + * boards/arm/a1x/pcdueno-a10/src/: Fix error found in build testing. + All configurations must provide boar_app_initialize() which is + required if CONFIG_LIB_BOARDCTL is enabled. From Gregory Nutt + (2019-10-27). + * boards/arm/stm32/stm32vldiscvoery/src/: Fix error found in build + testing. All configurations must provide boar_app_initialize() which + is required if CONFIG_LIB_BOARDCTL is enabled. From Gregory Nutt + (2019-10-27). + * arch/arm/src/stm32l4 and boards/arm/stm32l4/nucleo-l476rg: Add + support for LPTIM timers on the STM32L4 as PWM outputs. From Matias N + (2019-10-27). + * boards/arm/kinetis/twr-k60n512/src/k60_appinit.c: Suppress errors + related to card detect GPIO configuration if SDHC support is not + enabled. From Gregory Nutt (2019-10-27). + * drivers/can/mcp2515.c and boards/arm/stm32/nucleo-f4x1re: MCP2525 + SPI STD-EXT ID fixes. Verified on MCP2525 tested on nucleo-f4x1re. + From DisruptiveNL (2019-10-28). + * drivers/mtd/gd25.c and gd5f.c: Missed in previous change. Without + this change, the compiler will complain that spi_devid cannot be + found. From Xiang Xiao (2019-10-29). + * drivers/wireless/ieee80211/bcmf_chip_43362.c: Fix bcmf_chip_43362 + compile error. From Xiang Xiao (2019-10-29). + * fs/driver/fs_findmtddriver.c: Fix compile failed if NO CONFIG_MTD. + From ligd (2019-10-29). + * arch/arm/src/stm32/stm32_sdio.c: SDIO Fix system hang on card eject. + From David Sidrane (2019-10-29). + * arch/arm/src/stm32f7/stm32_sdmmc.c: SDMMC Fix system hang on card + eject. From David Sidrane (2019-10-29). + * arch/arm/src/stm32h7/stm32_sdmmc.c: SDMMC Fix system hang on card + eject. From Gregory Nutt (2019-10-29). + * arch/arm/src/stm32l4/stm32l4_sdmmc.c: SDMMC Fix system hang on card + eject. From David Sidrane (2019-10-29). + * drivers/mmcsd/mmcsd_sdio.c: Set wrbusy after success of all the + operations. Any failure could leave wrbusy set when it should not be + if the operation failed. From David Sidrane (2019-10-29). + * drivers/mmcsd/mmcsd_sdio.c: Enter a removed card state On a failure. + If we fail to read cardstatus in mmcsd_transferready consider this a + hard error and set the card to removed. From David Sidrane + (2019-10-29). + * arch/arm/src/stm32f7/stm32_otghost.c: OTGFS_EPTYPE_INTR should be + OTG_EPTYPE_INTR. From Gregory Nutt (2019-10-29). + * drivers/wireless/ieee80211/mmc_sdio.c: In sdio_io_rw_extended(), the + behavior of the DMA setup differs, depending on the hardware + capability SDIO_CAPS_DMABEFOREWRITE. If this capability is set, then + the DMA setup much be done before the transfer setup. Dave Marples + modified this file for the i.MXRT USDHC which does have the + SDIO_CAPS_DMABEFOREWRITE. Xiao Xiang reports that this change breaks + the Wifi on the Photon which does not report the + SDIO_CAPS_DMABEFOREWRITE and suggests reverting the change. In + reality both changes are correct but must be conditioned on the DMA + capability of the underlying SDIO device. From Gregory Nutt + (2019-10-29). + * drivers/wireless/ieee80211: Add tools/nxstyle to all of the C files + in this directory. From Gregory Nutt (2019-10-29). + * NXP k66 Ethernet + - Kinetis:Add TJA1100 Phy + - Kinetis:enet.c formated with nxstyle + - net:mii Cleanup TJA1100 Support. Formating and adding mask and + shifts. + - net:Kconfig Cleanup formatting. + From David Sidrane (2019-10-30). + * drivers/mmcsd/mmcsd_sdio.c: Align DMA buffer for MBURST size. From + David S. Alessio (2019-10-31). + * drivers/mtd/gd25.c: spi_devid argument was not used in + initialization. GD25 driver was always using priv->spi_devid + initialized to zero by kmm_zalloc(). This change initializes it from + the supplied function argument. From Juha Niskanen (2019-10-31). + * Add INVIOLABLES.txt file. From Gregory Nutt (2019-10-31). + * This change brings in the drivers needed to support OpenAMP. These + changes were ported from https://github.com/FishsemiCode/nuttx. The + current state: Most drivers do now compile but are not yet verified. + This port was effort of a number of people, I rather arbitrarily gave + authorship to Guiding Li because he has the largest number of + fundamental quashed commits from the Xiamoi repository. From Guiding + Li (2019-11-02). + * include/nuttx/usb/usbdev.h and usbhost.h: Add CODE qualifier to + function pointers. From Gregory Nutt (2019-11-02). + * drivers/rptun/rptun.c and fs/hostfs/hostfs_rpmsg.c: Fix 64-bit build + issue in rpmsg driver. From Xiang Xiao (2019-11-03). + * drivers/rptun/rptun.c: Switch open/close/seek/read to file_* + version. From Xiang Xiao (2019-11-03). + * Documentation/NuttShell.html: Update to include the new rptun + command. From Gregory Nutt (2019-11-03). + * net/netlink/netlink_route.c (mostly): This completes a minimal + netlink implementation that will retrieve the ARP table. + net/netlink: Add basic hooks (only) to support the NETLINK_ROUTE + protocol. From Gregory Nutt (2019-11-03). + * Documentation/NuttShell.html: Document the new -t option for the + 'arp' command. From Gregory Nutt (2019-11-03). + * net/netlink/: Misc bugfixes from initial testing using NSH 'arp -t' + command. From Gregory Nutt (2019-11-03). + * Various drivers: Cloned logic. On error, memory was freed, but the + error was not returned. It just continued as though no error + happened. From Petro Karashchenko (2019-11-03). + * sched/semaphore/spinlock.c: Remove support for re-entrant spinlocks. + They seem like a good idea, but they are never used. From Xiang Xiao + (2019-11-03). + * sched/semaphore/spinlock.c: spin_trylock handle memory barrier and + instrumentation correctly. From Xiang Xiao (2019-11-03). + * drivers/addrenv.c: Move up_addrenv_ implementation to common folder. + From Xiang Xiao (2019-11-03). + * include/nuttx/ioexpander/gpio.h: Add guards so that file content will + not compile unless CONFIG_DEV_GPIO is selected. From ligd (2019-11-03). + * audio/audio.c: Add message type to support audio trigger. From + anchao (2019-11-03). + * include/nuttx/mm/mm.h: Remove the assumption that one character + equals eight bits. From Xiang Xiao (2019-11-03). + * drivers/serial/serial.c: Only real uart will call pm_activity(). + From ligd (2019-11-03). + * include/nuttx/rptun/rptun.h: openamp/open_amp.h must not be included + unless CONFIG_RPTUN (and heance CONFIG_OPENAMP) are selected. From + Alin Jerpelea (2019-11-04). + * boards/arm/cxd56xx/spresense/configs/lte/defconfig: Select + CONFIG_MODEM_ALTMDM. From Alin Jerpelea (2019-11-04). + * boards/boardctl.c: Expose power manager function through boardctl + interface. From Xiang Xiao (2019-11-04). + * Documentation/NuttShell.html: Update document to at least mention the + new pmconfig command. From Gregory Nutt (2019-11-04). + * arch/: Add rpmsg_serialinit() call to every implementation of + up_initialize() for rpmsg uart initialization. From Xiang Xiao + (2019-11-04). + * drivers: modem: altair: auto select SPI. The Altair hardware is + connected to SPI and will not work without SPI support. The + SPI_EXCHANGE is automatically enabled (default y) when SPI is + selected. Since SPI is mandatory it should be auto selected. From + Alin Jerpelea (2019-11-04). + * net/netlink: The NETLINK_ROUTE logic needs to return the first queued + response and not attempt to match up reponses with requests. That is + the Linux compatible way. Also, use queue.h functions for list + management and fix an error in arp_snapshot(). From Gregory Nutt + (2019-11-04). + * arch/arm/src/imxrt/imxrt_serial.c: This change improves the + performance of UART serial ports on the IMXRT by enabling the RX & TX + FIFOS and transmission on the holding register being empty (TDRE) + rather than transmission being complete (TC). From Dave Marples + (2019-11-04). + * boards/arm/stm32f0l0g0/nucleo-g070rb: Add button driver support, Add + driver support. Add GPIO example. Includes fixes to the GPIO driver + support from Guillherme Amaral . From Daniel + Pereira Volpato (2019-11-04). + * boards/arm/stm32f0l0g0/nucleo-g070rb/src/stm32_boot.c: Fix some + erroneous conditional compilation in board_late_initialize(). From + Gregory Nutt (2019-11-04). + * boards/arm/stm32/nucleo-f4x1re/src/stm32_boot.c: Fix some erroneous + conditional compilation in board_late_initialize(). From Gregory Nutt + (2019-11-04). + * libs/libc/string/Make.defs: Need to include build support for files + needed when CHAR_BIT != 8. From Gregory Nutt (2019-11-02). + * drivers/serial/serial_io.c: Uses signal numbers, but does not include + signal.h. This has not problems but missing signal definitions have + been seen in certain cases. From David Sidrane (2019-11-04). + * include/sys/boardctl.h: pm.h is in include/nuttx/power/pm.h, not + include/nuttx/pm.h. From Gregory Nutt (2019-11-04). + * boards/boardctl.c: pm_stay() was used were pm_staycount() was + intended. The caused an error: void value not ignored as it ought to + be. From Gregory Nutt (2019-11-04). + * boards/Kconfig: Newer Olimex E407 boards are populated with + STM32407ZE chips. From David Alessio (2019-11-05). + * fs/smartfs/smartfs_smart.c: Fix O_CREAT without O_TRUNC truncating + existing file. Also nothing in POSIX says that O_APPEND should + prevent O_TRUNC. From Juha Niskanen (2019-11-05). + * fs/smartfs/smartfs_smart.c: Honor O_APPEND on writes. Also document + pwrite() bug/limitation. From Juha Niskanen (2019-11-05). + * sched/sched/sched_waitpid.c: Fix null pointer derefence on race + without DEBUG_ASSERT. From David Alessio (2019-11-05). + * boards/arm/stm32h7/nucleo-h743zi/src: Added gpio-device-driver for + userspace apps. From Heiko Demlang (2019-11-05). + * drivers/wireless/ieee80211/bcm43xxx: Move drivers/wireless/ieee80211/ + to drivers/wireless/ieee80211/bcm43xxx/ since the directory only + contains only BCM43362 and BCM43438 related code. From Xiang Xiao + (2019-11-05). + * boards/arm/stm32/olimex-stm32-e407/scripts/: Individual linker + scripts for F407ZE and F407ZG chips. From David S. Alessio + (2019-11-05). + * drivers/serial/serial_dma.c: Avoid uart_xmitchars_done() move the + tail bigger then head. If ioctl(TCOFLUSH) occurs between + uart_xmitchars_dma() and uart_xmitchars_done(), TCOFLUSH will reset + xmit buffer, then uart_xmitchars_done() will move the 'tail' ahead of + 'head', then sends lots of wrong data. From ligd (2019-11-06). + * stm32h7: allocateheap SRAM and SRAM1 are not continuous From David + Sidrane (2019-11-06). + * arch/arm/src/tiva, arch/arm/include: Add support for Tiva + TM4C129ENCPDT. From Nathan Hartman (2019-11-06). + * arch/arm/src/tiva/common/tiva_flash.c: Improve tiva_write(). + arch/arm/src/tiva/common/tiva_flash.c: Fix several mistakes in + tiva_write() but note that this function needs more work. (1) Fix + wrong use of && when & was intended. (2) Add compile- time warning + directive because according to this function's interface, it is + supposed to support unaligned writes and/or writes of arbitrary + numbers of bytes to FLASH. However, this function does NOT support + that at this time. This needs to be fixed. (3) Fix wrong preprocessor + conditional. Was written to use the 32-word write buffer only for + TM4C1294NCPDT. This buffer is available on all TM4C123 and TM4C129 + parts. Now conditioned upon CONFIG_ARCH_CHIP_TM4C123 or + CONFIG_ARCH_CHIP_TM4C129. (4) Add comments to document the intent of + the above preprocessor logic. From Nathan Hartman (2019-11-06). + * arch/arm/include/tiva/tm4c_irq.h: Fix wrong IRQ vector number. From + Nathan Hartman (2019-11-06). + * drivers/serial/serial_dma.c: Still need reset xmit buffer when meet + TCOFLUSH. From ligd (2019-11-07). + * boards/arm/s32k1xx/s32k146evb/scripts/s32k146.cfg and + boards/arm/s32k1xx/s32k146evb/README.txt: Added configuration script + and instructions for using Thread-Aware OpenOCD for the S32K146 with + Eclipse. From Han Raaijmakers (2019-11-07). + * net/netlink/Kconfig: Remove dependency on EXPERIMENTAL. Although the + Netlink implementation is still only fragmentary, there is no usable + functionality there and no reason for it to depend on EXPERIMENTAL. + Also minor changes to the menu organization so that the Netlink + options appear the same was as do other network options. From Gregory + Nutt (2019-11-07). + * arch/arm/src/stm32l4/stm32l4x6xx_rcc.c: This fix is needed if HSI + clock is selected. Otherwise when waking up from STOP mode, the MSI + clock is selected instead of the HSI clock. From Matias N (2019-11-07). + * drivers/syslog/syslog_device.c: Fix assert that assumes re-opened + syslog file is the same. Logic in syslog_file_channel() is calling + syslog_initialize() for the default syslog device as a recovery action + after failed syslog_dev_initialize(). From Juha Niskanen (2019-11-08). + * arch/arm/src/armv7-m/nvic.h: Add BPIALL register address. From Dave + Marples (2019-11-08). + * STM32H7: Set the BBSRAM memory range to non-cacheable. + - armv7-m: mpu add user peripheral helper + - stm32h7: BBSRAM Exclude BBSRAM from cacheable when + CONFIG_ARMV7M_DCACHE. ST placed the STM32H7 BBSRAM in the SRAM + default memory region which is cacheable. This change sets the + BBSRAM memory range to non-cacheable. + From David Sidrane (2019-11-08). + * net/netlink/netlink_route.c: Add Netlink socket NETLINK_ROUTE support + for getting a snopshot of the Neighbor table. + net/neighbor/neighbor_snapshot.c: Add neighbor_snapshot() that will + eventually be used by the Netlink sockets. Also fixed naming + violation 'struct neighbor_entry' -> 'struct neighbor_entry_s'. + include/nuttx/net/neighbor.h: Expose format of the IPv6 neighbor + table for use with Netlink sockets. + From Gregory Nutt (2019-11-08). + * arch/arm/src/stm32l4/stm32l4_idle.c: (1) Added BEGIN_IDLE() / + END_IDLE() to stop call so that we also get notification via LED of + the STOP mode, (2) Added the stm32l4_clockenable call as previously + discussed, and (3) Added call to pm_changestate() to inform drivers + we're back to running after the call to stm32l4_stop() returns. From + Matias N (2019-11-08). + * This change, initially for the imxrt1050, separates out the pinmux and + iomux functions cleanly. For ease of conversion default IOMUX + definitions have been added into imxrt_iomux.h. The change effectively + does two things; + (1) Unifies the iomux definitions - previously some pins had them, and + some didn't. This effectively made it impossible to use the + pinmuxes without editing the header file in the standard + distribution tree. + (2) Unifies the pin definitions so that every pin now has a suffix. + This makes it *much* easier to see when a pin is in use in your + code, because it will always have a definition in your board.h file. + For anyone who is already using this CPU, a couple of small changes + are needed to existing code; + - In respect of (1) add IOMUX decorators to your pin definitions. + You will find defaults in haardware/imxrt_iomux.h. Every pin + should have a IOMUX decorator and in general the defaults should + be OK. + - In respect of (2) you will need to add selectors for any function + that previously only had one pinning option. There aren't many of + those but LPUART1 is a good example. That just means adding into + your board.h something like; From Dave Marples (2019-11-08). + * boards/arm/imxrt/imxrt1020-evk: Add support for the MIMXRT1021-EVK + board. It features nsh, netnsh and usdhc sample configurations. From + Dave Marples (2019-11-08). + * arch/arm/src/imxrt/imxrt_enet.c: Improve naming of Ethernet pins. + From Dave Marples (2019-11-08). + * i.MXRT 106x: pinmux changes of the 1060's. From Dave Marples + (2019-11-08). + * tools/nxstyle.c: Correct detection of missing blank line following a + block comment. From Gregory Nutt (2019-11-09). + * drivers/power/pm: Historically, the NuttX PM subsystem has consisted + of two functional components: (1) an "Upper" part that detects state + changes based on a random walk driven by activity levels, and (2) and + "lower" part that implements the state changes. + This change decouples that upper activity-based logic from the lower + random walk logic and allows use of other upper state detection logic + (such as a custom, application-specific state machine). + From Matias Nitsche (2019-11-09). + * boards/arm/imxrt/imxrt1020-evk/include/board.h: Fix an error that I + introduced with code review. From Gregory Nutt (2019-11-09). + * arch/sim/src/nuttx-names.dat: Add host ftruncate() support. From + chao.an (2019-11-09). + * tools/nxstyle.c: Eliminate false positive 'Invalid character after + asterisk in comment block'. From Gregory Nutt (2019-11-09). + * net/netlink/netlink_route.c: Add support for the NETLINK_ROUTE + RTM_GETLINK command that is used to obtain a list of all devices in + the UP state. From Gregory Nutt (2019-11-09). + * single wire Allow selection of pull{up|down|none}: + - tioctl: Allow selection of pull{up|down|none} + - stm32: Single Wire add pull{up|down|none} tioctl + - stm32f0l0g0: Single Wire add pull{up|down|none} tioctl + - stm32f7: Single Wire add pull{up|down|none} tioctl + - stm32h7: Single Wire add pull{up|down|none} tioctl + - stm32l4: Single Wire add pull{up|down|none} tioctl + From David Sidrane (2019-11-10). + * openamp/: Add Makefile defines. From hao.an (2019-11-10). + * openamp/Makefile: Linker input file unused because linking not done. + From Xiang Xiao (2019-11-10). + * drivers/rptun/rptun.c: Refine the rptun naming. From Xiang Xiao + (2019-11-10). + * net/netlink: Fix offset in rtattr. include/net/route.h: Correct form + and naming of sruct rtentry. include/netpacket/netlink.h: Add some + definitions that will be needed to access routing tables. From + Gregory Nutt (2019-11-10). + * net/netlink/netlink_route.c: Add support for obtaining the entire + routing table. From Gregory Nutt (2019-11-10). + * net/netlink/netlink_route.c: Add missing routing table list + terminating response. From Gregory Nutt (2019-11-10). + * boards/arm/imxrt/imxrt1060-evk: An update to the configuration on + imx1060-evk to remove compilation warnings about duplicated + definitions. No functional changes. From Dave Marples (2019-11-10). + * arch/sim/src/sim/up_simuart.c: Remove CONFIG_SIM_UART_DATAPOST for + arch/sim. It's very dangerous to call NuttX API from simuart_thread. + From Xiang Xiao (2019-11-10). + * arch/sim/src/sim: Replace all CONFIG_DEV_CONSOLE with USE_DEVCONSOLE + for arch/sim and compile up_devconsole.c conditionally. From Xiang + Xiao (2019-11-10). + * arch/sim/src/Makefile: Move all SMP stuff into one place for + arch/sim. From Xiang Xiao (2019-11-10). + * arch/sim/src/sim/up_hostfs.c: Fix warning: 'mapflags' may be used + uninitialized in this function. From Xiang Xiao (2019-11-11). + * drivers/rptun/rptun.c: Refine the start/stop flow to support the + repeat boot. From Xiang Xiao (2019-11-11). + * drivers/rptun/rptun.c: vring size should also be aligned. From ligd + (2019-11-11). + * boards/arm/imxrt/imxrt1020-evk: Fix ifdef string. The old configs + folder was migrated to Boards/ and we should fix the ifdef. + From Alin Jerpelea (2019-11-11). + * boards/arm/imxrt/imxrt1020-evk: Make naming of the LED consistent. + In most places it is referred to as LED1. In board.h it is referred + to as USERLED1. The i.MXRT1020-EVK hardware user guide (HUG) uses the + name USERLED. This command makes all names internally consistent and + consistent with the HUG. Noted by Alin Jerpelea. From Gregory Nutt + (2019-11-11). + * arch/sim/ and boards/sim/sim/sim: Support OpenAMP between two + simulator instances. Please read rpserver/rpproxy section in + boards/sim/sim/sim/README.txt for more information. From chao.an + (2019-11-12). + * boards/renesas/rx65n: Fix ifdef string in header files. The old + configs folder was migrated to Boards/ and we should fix the + ifdef. From Alin Jerpelea (2019-11-12). + * boards/arm/imxrt/imxrt1020-evk/src/imxrt1020-evk.h: Fix ifdef + string. The old configs folder was migrated to Boards/ and we + should fix the ifdef. From Alin Jerpelea (2019-11-12). + * boards/arm/lpc17xx_40xx/lincoln60/src/lincoln60.h: Fix ifdef + string. The old configs folder was migrated to Boards/ and we + should fix the ifdef. From Alin Jerpelea (2019-11-12). + * drivers/power/activity_governor.c: Fix timer can't start when meet + very small pmtick. From ligd (2019-11-12). + * arch/arm/src/imxrt/imxrt_idle.c: Y'all remember that conversation we + had about why WFI might have been disabled on imxrt? Well, looks like + we found the reason: + - https://github.com/zephyrproject-rtos/zephyr/pull/8535/commits: + "The imxrt1050 is configured to use SYSTICK for the kernel timer, but + SYSTICK cannot wake up the soc from low-power modes. Disable + low-power modes on this soc until we have support for an alternative + timer." + "This fixes k_sleep on the EVKB version of the mimxrt1050_evk board. + An earlier version of the board (EVK, not EVKB), had A0 silicon which + by default did not enter low-power mode on a wfi." + - This change reverts the WFI enable for further investigation post + 8.2. With this change in place together with the previous one my + system is fully stable(*), just drinking a bit more power than I'd + like. From Dave Marples (2019-11-12). + * drivers/mtd/gd25.c: Add gd25_lock/unlock to case: enable 4-bytes + address From ligd (2019-11-12). + * arch/arm/src/imxrt/imxrt_serial.c: o, just to complete the + documentation of this...it looks like two issues, which confused me + greatly: + 1) Operational issue. TC (Transmission complete) and TDRE (TX Buffer + Empty) were transposed in imxrt_serial.c. The end result was that + for unoptimised code everything worked fine, but optimised code + got itself into a real mess and continually fired interrupts. The + change attached fixes this. This one would have been found much + more quickly if this particular board had supported SWO :-/ + 2) Startup issue. There are a number of chip errata that apply to + the 1052 first revision (A-suffix) that don't apply to the second + (B-suffix). Those got me for a while and it's important to use an + EVK_B_ dev board if you're suffering stability problems with this + particular chip. However, even with that resolved with either + optimised or unoptimised code when there is no SNVS (Battery + Backup) power and the power is switched on the CPU appears to boot + but gets stuck with timer interrupts not being generated. The CPU + is running and it will execute linear code. I have determined + this by putting an 'imxrt_lowputc('A'+irq)' into up_doirq. For the + non-running case the output looks like this: + + LLLL + + this implies 4 0x0b interrupts have been generated, and nothing + else. If I hit keys on the keyboard I get 'e' in the flow. 0x0b + is the SVC instruction and is the mechanism by which NuttX handles + task switching. 'e' is 0x24, which corresponds to the LPUART1 + interrupt. Other than these, the system does not respond further + but is happily in the idle loop. In this circumstance if you hit + SW2 on the EVKB board though the logjam 'unjams' and normal + service is established, output now looks like: + + LLLLPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPLPP ...etc. + + Where 'P' is 0x0f (the SYSTICK interrupt)....this is what _should_ + be happening so; SYSTICK starts up after SW2 has been pressed. + From this point on everything works correctly and you can reboot + the CPU, put new code into it or do whatever you wish, **provided + power is not cycled off**. If power is cycled off then return to + the top and go through the process again. When there is SNVS + power to the CPU then power can be switched on and off as you + wish, and the CPU will boot correctly. This has been determined by + putting 3V onto J6. + I think we are probably doing something naughty with the way we + are starting the clocks to the timers. There are certainly some + restrictions on imxrt clock manipulation which we have studiously + avoided. I am investigating further and have some potential + patches but even if I find the root cause it should not be + included in 8.2 as the change could be disruptive. + From Dave Marples (2019-11-12). + * net/netlink: Add options to disable individual NETLINK_ROUTE + commands. This will probably become quite large and will need to be + higher tunable for smaller platforms. From Gregory Nutt (2019-11-12). + * libs/libc/stdio/lib_getdelim.c: Add implementations of the POSIX + functions getdelim() and getline(). From Gregory Nutt (2019-11-12). + * libs/libc/stdio/lib_libfgets.c: Because of how the function is + defined, getline() canot be used on platforms that use CR-LF line + terminations. From Gregory Nutt (2019-11-12). + * include/sys/time.h, libs/libc/unistd, sched/timer: Implement + alarm(), setitimer() and getitimer() APIs. From liuhaitao + (2019-11-13). + * libs/libc/stdio/lib_getdelim.c: Make getdelim() behave per + specification on OpenGroup.org. Specifically, needs to reallocate + buffer if more data is received than will fit. From Gregory Nutt + (2019-11-13). + * libs/libc/stdio/lib_getdelim.c: Initial allocation should be larger; + incremental reallocs should be smaller. Update some comments. From + Gregory Nutt (2019-11-13). + * arch/renesas/include and arch/renesas/src: Fix spurious '=' in + comments. From David Sidrane (2019-11-14). + * drivers/syslog/ramlog.c: Fix ramlog readers never woken up when using + ramlog as syslog or console. We also make an attempt to avoid the + thundering herd problem if there are multiple readers/pollers. + Change also removes forcing CONFIG_RAMLOG_CRLF in + uttx/syslog/ramlog.h as there is no point of wasting precious RAM for + useless characters. From Juha Niskanen (2019-11-14). + * boards/arm/imxrt/imxrt1060-evk/src/imxrt_lcd.c: Because + board-private GPIO definitions have been moved to the public board.h + (VERY BAD IDEA), breakage happened in all files that need GPIO + definitions, but did not include board.h (which they should not have + to). From Gregory Nutt (2019-11-14). + * include/netpacket/netlink.h: Add definitions that will be needed for + future NETLINK_CRYPTO support. From Gregory Nutt (2019-11-14). + * syscall/: Implementation of syscall for new getitimer and setitimer + were incomplete. + include/sys/syscall.h: Should be SYS_getitimer and SYS_setitimer, + not SYS_getitime and SYS_setitime. + From Gregory Nutt (2019-11-14). + * syscall/ and include/sys/syscall.h: Fix an inconsistency. In + some places, getitimer() and setitimer() depend on + CONFIG_DISABLE_POSIX_TIMERS=n and in other places they depend on + nothing. As a result, there are link failures when + CONFIG_DISABLE_POSIX_TIMERS=y. Which is correct? On one hand, these + interfaces are not POSIX timers, so conditioning them on + CONFIG_DISABLE_POSIX_TIMERS. I opted to keep the dependence and just + apply it consistently. I did this because setitimer() and + getitimer() are seldom used so it is really best if a system call is + no generated for them in all cases. From Gregory Nutt (2019-11-14). + +8.3 2020-xx-xx Gregory Nutt diff --git a/INVIOLABLES.txt b/INVIOLABLES.txt new file mode 100755 index 0000000..674bc5c --- /dev/null +++ b/INVIOLABLES.txt @@ -0,0 +1,125 @@ +The Inviolable Principles of Nuttx +================================== + +These are properties of NuttX that we can be certain of for all time: + +Definition +---------- + +*in·vi·o·la·ble* +/inˈvīələbəl/ + +adjective +adjective: inviolable + + never to be broken, infringed, or dishonored. + + "an inviolable rule of chastity" + + synonyms: inalienable, absolute, untouchable, unalterable, + unchallengeable, unbreakable, impregnable; sacrosanct, + sacred, holy, hallowed; rare intemerate + + "the inviolable right to life" + +Source: Oxford Dictionary of the English Language + +Strict POSIX compliance +----------------------- + + o Strict conformance to the portable standard OS interface as defined at + OpenGroup.org. + o A deeply embedded system requires some special support. Special + support must be minimized. + o The portable interface must never be compromised only for the sake of + expediency. + o Expediency or even improved performance are not justifications for + violation of the strict POSIX interface + +Modular Architecture +-------------------- + + o The internal modular architecture of the OS must maintained. + o This means formalizing and documenting all internal interfaces (in the + porting guide), minimal use of global variables at the interface, and + only well defined functional interfaces. + +Clear, Consistent, Standardized Coding Style +-------------------------------------------- + + o Strict conformance to the NuttX coding style. No "revolutionary" + changes to the coding standard (but perhaps some "evolutionary" + changes). + o Personal or organizational preference is not a justification for a + coding style change. + o Nothing can come into NuttX that does not follow the coding standard. + o Expediency is not a justification for violating the coding standard. + + The NuttX coding standard can be found here: + http://www.nuttx.org/doku.php?id=documentation:codingstandard + +Open and Unencumbered License +----------------------------- + + o Currently BSD 3-clause or compatible: BSD 3-clause with constraints, + BSD 3 and 4 clause, MIT, public domain + o Other unencumbered licenses such as Apache may be considered + NuttX will never be licensed under a restrictive, "Copyleft" license. + +All Users Matter +---------------- + + o All support must apply equally to all supported platforms. At present + this includes Linux, Windows MSYS, Windows Cygwin, Windows Ubuntu, + Windows native, macOS, Solaris, and FreeBSD. No tool/environment + solutions will be considered that limit the usage of NuttX on any of + the supported platforms. + o Inclusive rather than exclusive + o Hobbyists are valued users of the OS including retro computing hobbyists + * and DIY “Maker” hobbyists. + o Supported toolchains: GCC, Clang, SDCC, ZiLOG ZDS-II (c89), IAR. + Others? + o No changes to build system should limit use of NuttX by any user. + o Simplifying things for one user does not justify excluding another user. + o We should seek to expand the the NuttX user base, not to limit it for + reasons of preference or priority. + o We must resist the pull to make NuttX into a Linux-only, GCC-only, and + ARM-only solution. + +NuttX Branding +-------------- + + o The official name of authentic Nuttx will always be "NuttX" + o This name is trademarked and may not be used by other OSs or forks of + NuttX + +The Enemies +=========== + +No Short Cuts +------------- + + o Doing things the easy way instead of the correct way. + o Reducing effort at the expense of Quality, Portability, or + Consistency + o Focus on the values of the organization, not the values of the Open + Source project. Need to support both. + o It takes work to support the Inviolables. There are no shortcuts. + +Sometimes Code Duplication is OK +-------------------------------- + + o Sometimes is better to duplicate some logic than to introduce coupling + +Keep the Big Picture +-------------------- + + o Too much focus on solving the problem in hand, loss of the Big Picture + o Insufficient understanding of the architectural principles. + +Conform to Standards +-------------------- + + o Changing things only to suite a personal or organizational preference + o Inflexibility, Inability to adapt + o Not Invented Here (NIH) syndrome diff --git a/README.txt b/README.txt new file mode 100755 index 0000000..d52643e --- /dev/null +++ b/README.txt @@ -0,0 +1,2355 @@ +README +^^^^^^ + + o Environments + - Installing Cygwin + - Ubuntu Bash under Windows 10 + o Installation + - Download and Unpack + - Semi-Optional apps/ Package + - Installation Directories with Spaces in the Path + - Downloading from Repositories + - Related Repositories + - Notes about Header Files + o Configuring NuttX + - Instantiating "Canned" Configurations + - Refreshing Configurations + - NuttX Configuration Tool + - Finding Selections in the Configuration Menus + - Reveal Hidden Configuration Options + - Make Sure that You are on the Right Platform + - Comparing Two Configurations + - Making defconfig Files + - Incompatibilities with Older Configurations + - NuttX Configuration Tool under DOS + o Toolchains + - Cross-Development Toolchains + - NuttX Buildroot Toolchain + o Shells + o Building NuttX + - Building + - Re-building + - Build Targets and Options + - Native Windows Build + - Installing GNUWin32 + o Cygwin Build Problems + - Strange Path Problems + - Window Native Toolchain Issues + o Documentation + +ENVIRONMENTS +^^^^^^^^^^^^ + + NuttX requires a POSIX development environment such as you would find under + Linux or macOS. NuttX may also be installed and built on Windows system + if you also provide such a POSIX development environment. Options for a + POSIX development environment under Windows include: + + - An installation of Linux on a virtual machine (VM) in Windows. I have + not been happy using a VM myself. I have had stability problems with + open source VMs and commercial VMs cost more than I want to spend. + Sharing files with Linux running in a VM is awkward; sharing devices + connected to the Windows box with Linux in a VM is, at the very least, + confusing; Using Windows tools (such as Segger J-Link) with files + built under the Linux VM is not a possibility. + + - The Cygwin environment. Instructions for installation of Cygwin on a + Windows system are provided in the following paragraph, "Installing + Cygwin". Cygwin is a mature, well-tested, and very convenient + environment. It is especially convenient if you need to + integrate with Windows tools and files. Downsides are that the + installation time is very long and the compile times are slow. + + - Ubuntu/Bash shell under Windows 10. This is a new option under + Windows 10. See the section "Ubuntu Bash under Windows 10" below. + This is an improvement over Cygwin if your concern is compile time; + its build performance is comparable to native Linux, certainly better + than the Cygwin build time. It also installs in a tiny fraction of + the time as Cygwin, perhaps 20 minutes for the basic Ubuntu install + (vs. more than a day for the complete Cygwin install). + + There have been even more recent ports of Linux environment to + Windows. I need to update this section to include some mention of + these alternatives. + + - The MSYS environment. MSYS derives from an older version of Cygwin + simplified and adapted to work more naturally in the Windows + environment. See http://www.mingw.org/wiki/MSYS if you are + interested in using MSYS. The advantages of the MSYS environment is + that it is better integrted with the native Windows environment and + lighter weight; it uses only a minimal number of add-on POSIX-land + tools. + + The download link in that Wiki takes you to the SourceForge download + site. The SourceForge MSYS project has been stagnant for some time. + The MSYS project has more recently moved to + http://odsn.net/projects/sfnet_mingwbundle. Downloads of current .zip + files are available there but no instructions for the installation. + + - MSYS2 appears to be a re-write of MSYS based on a newer version of + Cygwin. Is it available at https://www.msys2.org. A windows + installer is available at that site along with very good installation + instructions. The download is relatively quick (at least compared to + Cygwin) and the 'pacman' package management tool supports supports + simple system updates. For example, 'pacman -S git' will install the + GIT command line utilities. + + - Other POSIX environments. Check out: + + UnxUtils: https://sourceforge.net/projects/unxutils/, + https://en.wikipedia.org/wiki/UnxUtils + MobaXterm: https://mobaxterm.mobatek.net/ + Gow: https://github.com/bmatzelle/gow/wiki + + Disclaimer: In principle, these should work. However, I have never + used any of these environments and cannot guarantee that there is + not some less-than-obvious issues. + + NuttX can also be installed and built on a native Windows system, but with + some potential tool-related issues (see the discussion "Native Windows + Build" under "Building NuttX" below). GNUWin32 is used to provide + compatible native windows tools. + +Installing Cygwin +----------------- + + 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, network + 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. + + NOTE: The last time I installed EVERYTHING, the download was + about 5GiB. The server I selected was also very slow so it took + over a day to do the whole install! + + NOTE: You don't really have to install EVERYTHING but I cannot + answer the question "Then what should I install?" I don't know + the answer to that and so will continue to recommend installing + EVERYTHING. + + You should certainly be able to omit "Science", "Math", and + "Publishing". You can try omitting KDE, Gnome, GTK, and other + graphics packages if you don't plan to use them. + + Perhaps a minimum set would be those packages listed below for the + "Ubuntu Bash under Windows 10" installation? + + UPDATE: Sergey Frolov had success with the following minimal + Cygwin configuration: + + 1. After starting the Cygwin installer, keep the recommended + packages that are pre-selected in the default configuration. + 2. Using the installation tools, add the following packages: + + make (GNU make) bison libgmp3-dev + gcc-core byacc libmpfr-dev + gcc-g++ gperf libmpc-dev + flex gdb automake-1.15 + libncurses-dev libgmp-dev + + 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). Unless otherwise noted, the rest of these + instructions assume that you are at a bash command line prompt in + either Linux or in Cygwin shell. + +Using MSYS +---------- + + MSYS is an environment the derives from Cygwin. Thus, most things said + about Cygwin apply equally to MSYS. This section will, then, focus on + the differences when using MSYS, specifically MSYS2. + + Here is it assumed that you have already downloaded and installed MSYS2 + from https://www.msys2.org using the windows installer available at that + location. It is also assumed that you have brought in the necessary + tools using the 'pacman' package management tool Tools needed including: + + pacman -S git + pacman -S make + pacman -S gcc + pacman -S gdb + + And possibly others depending upon your usage. Then you will need to + build and install kconfig-frontends per the instructions of the top-level + README.txt file in the tools repository. This requires the following + additional tools: + + pacman -S bison + pacman -S gperf + pacman -S ncurses-devel + pacman -S automake-wrapper + pacman -S autoconf + pacman -S pkg-config + + Because of some versioning issues, I had to run 'aclocal' prior to + running the kconfig-frontends configure script. See "Configuring NuttX" + below for further information. + + Unlike Cygwin, MSYS does not support symbolic links. The 'ln -s' command + will, in fact, copy a directory! This means that you Make.defs file will + have to include definitions like: + + ifeq ($(CONFIG_WINDOWS_MSYS),y) + DIRLINK = $(TOPDIR)/tools/copydir.sh + DIRUNLINK = $(TOPDIR)/tools/unlink.sh + endif + + This will force the directory copies to work in a way that can be handled + by the NuttX build system. NOTE: The default link.sh script has been + updated so that is should now be MSYS2 compatible. The above is preferred + but no longer necessary in the Make.defs file. + + To build the simulator under MSYS, you also need: + + pacman -S zlib-devel + + It appears that you cannot use directory names with spaces in them like + "/c/Program\ Files \(86\)" in the MSYS path variable. I worked around this + by create Windows junctions like this:: + + 1. Open the a windows command terminal, + 2. CD to c:\msys64, then + 3. mklink /j programfiles "C:/Program\ Files" and + 4. mklink /j programfiles86 "C:/Program\ Files\ \(x86\)" + + They then show up as /programfiles and /programfiles86 with the MSYS2 + sandbox. Thos paths can then be used with the PATH variable. I had + to do something similar for the path to the GNU Tools "ARM Embedded + Toolchain" which also has spaces in the path name. + +Ubuntu Bash under Windows 10 +---------------------------- + + A better version of a command-line only Ubuntu under Windows 10 (beta) + has recently been made available from Microsoft. + + Installation + ------------ + Installation instructions abound on the Internet complete with screen + shots. I will attempt to duplicate those instructions in full here. + Here are the simplified installation steps: + + - Open "Settings". + - Click on "Update & security". + - Click on "For Developers". + - Under "Use developer features", select the "Developer mode" option to + setup the environment to install Bash. + - A message box should pop up. Click "Yes" to turn on developer mode. + - After the necessary components install, you'll need to restart your + computer. + + Once your computer reboots: + + - Open "Control Panel". + - Click on "Programs". + - Click on "Turn Windows features on or off". + - A list of features will pop up, check the "Windows Subsystem for Linux + (beta)" option. + - Click OK. + - Once the components installed on your computer, click the "Restart + now" button to complete the task. + + After your computer restarts, you will notice that Bash will not appear in + the "Recently added" list of apps, this is because Bash isn't actually + installed yet. Now that you have setup the necessary components, use the + following steps to complete the installation of Bash: + + - Open "Start", do a search for bash.exe, and press "Enter". + - On the command prompt, type y and press Enter to download and install + Bash from the Windows Store. This will take awhile. + - Then you'll need to create a default UNIX user account. This account + doesn't have to be the same as your Windows account. Enter the + username in the required field and press Enter (you can't use the + username "admin"). + - Close the "bash.exe" command prompt. + + Now that you completed the installation and setup, you can open the Bash + tool from the Start menu like you would with any other app. + + Accessing Windows Files from Ubuntu + ----------------------------------- + File systems will be mounted under "/mnt" so for example "C:\Program Files" + appears at "/mnt/c/Program Files". This is as opposed to Cygwin where + the same directory would appear at "/cygdrive/c/Program Files". + + With these differences (perhaps a few other Windows quirks) the Ubuntu + install works just like Ubuntu running natively on your PC. + + A good tip for file sharing is to use symbolic links within your Ubuntu + home directory. For example, suppose you have your "projects" directory + at C:\Documents\projects. Then you can set up a link to the projects/ + directory in your Ubuntu directory like: + + ln -s /mnt/c/Documents/projects projects + + Accessing Ubuntu Files From Windows + ----------------------------------- + In Ubuntu Userspace for Windows, the Ubuntu file system root directory is + at: + + %localappdata%\lxss\rootfs + + Or + + C:\Users\Username\AppData\Local\lxss\rootfs + + However, I am unable to see my files under the rootfs\home directory. + After some looking around, I find the home directory + %localappdata%\lxss\home. + + With that trick access to the /home directory, you should actually be + able to use Windows tools outside of the Ubuntu sandbox with versions of + NuttX built within the sandbox using that path. + + Executing Windows Tools from Ubuntu + ----------------------------------- + You can also execute Windows tools from within the Ubuntu sandbox: + + /mnt/c/Program\ Files\ \(x86\)/Microchip/xc32/v1.43/bin/xc32-gcc.exe --version + Unable to translate current working directory. Using C:\WINDOWS\System32 + xc32-gcc.exe (Microchip Technology) 4.8.3 MPLAB XC32 Compiler v1.43 Build date: Mar 1 2017 + ... + + The error message indicates that there are more issues: You cannot mix + Windows tools that use Windows style paths in an environment that uses + POSIX paths. I think you would have to use Linux tools only from within + the Ubuntu sandbox. + + Install Ubuntu Software + ----------------------- + Use "sudo apt-get install ". As examples, this is how + you would get GIT: + + sudo apt-get install git + + This will get you a compiler for your host PC: + + sudo apt-get install gcc + + This will get you an ARM compiler for your target: + + sudo apt-get install gcc-arm-none-eabi + + NOTE: That is just an example. I am not sure if apt-get will give you a + current or usable compiler. You should carefully select your toolchain + for the needs of your project. + + You will also need to get the kconfig-frontends configuration as + described below under "NuttX Configuration Tool". In order to build the + kconfig-frontends configuration tool you will also need: make, gperf, + flex, bison, and libncurses-dev. + + That is enough to do a basic NuttX build. + + Integrating with Windows Tools + ------------------------------ + If you want to integrate with Windows native tools, then you would need + deal with the same kind of craziness as with integrating Cygwin with + native toolchains, see the section "Cygwin Build Problems" below. + + However, there is currently no build support for using Windows native + tools with Ubuntu under Windows. This tool combination is made to work + with Cygwin through the use of the 'cygpath -w' tool that converts paths + from say '/cydrive/c/Program Files' to 'C:\Program Files'. There is, + however, no corresponding tool to convert '/mnt/c/Program Files' in the + Ubuntu environment. + + Graphics Support + ---------------- + The Ubuntu version support by Microsoft is a command-line only version. + There is no support for Linux graphics utilities. + + This limitation is not a limitation of Ubuntu, however, only in what + Microsoft is willing to support. If you install a X-Server, then you + can also use basic graphics utilities. See for example: + + http://www.howtogeek.com/261575/how-to-run-graphical-linux-desktop-applications-from-windows-10s-bash-shell/ + + Many Linux graphics programs would, however, also require a graphics + framework like GTK or Qt. So this might be a trip down the rabbit hole. + +INSTALLATION +^^^^^^^^^^^^ + + There are two ways to get NuttX: You may download released, stable + tarballs from either the Bitbucket or Sourceforge download locations. + Or you may get NuttX by cloning the Bitbucket GIT repositories. Let's + consider the released tarballs first: + +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. + + Download locations: + + https://bitbucket.org/nuttx/nuttx/downloads + https://sourceforge.net/projects/nuttx/files/nuttx/ + +Semi-Optional apps/ Package +--------------------------- + + 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 called "Semi-optional" because if you don't have some apps/ + directory, NuttX will *fail* to build! You do not necessarily need + to use the NuttX apps tarball but may, instead, provide your own + custom application directory. Such a custom directory would need + to include a valid Makefile to support the build and a valid Kconfig + file to support the configuration. More about these files later. + + Download then unpack the apps tarball in the same directory where you + unpacked the NuttX tarball. After you unpack the apps tarball, you + will have a new directory called apps-version (where the version + 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 (and renaming) 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 modifying your NuttX configuration file, but that + is another story. + +Installation Directories with Spaces in the Path +------------------------------------------------ + + 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 too difficult to fix. Some + Makefiles probably just need some paths within double quotes] + + 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. + +Downloading from Repositories +----------------------------- + + Cloning the Repository + + BEFORE cloning repositories on any Windows platform do the following GIT + command: + + git config --global core.autocrlf false + + That will avoid conversions of linefeeds (newlines, \n) to carriage + return plus linefeed sequences (\r\n) + + The current NuttX du jour is available in from a GIT repository. Here are + instructions for cloning the core NuttX RTOS (corresponding to the nuttx + tarball discussed above):: + + git clone https://bitbucket.org/nuttx/nuttx.git nuttx + + And the semi-optional apps/ application directory and be cloned like: + + git clone https://bitbucket.org/nuttx/apps.git apps + + That will give you the same directory structure like this: + + | + +----+----+ + | | + nuttx/ apps/ + + Configuring the Clones + + The following steps need to be performed for each of the repositories. + After changing to the clone directory: + + Set your identity: + + git config --global user.name "My Name" + git config --global user.email my.name@example.com + + Colorized diffs are much easier to read: + + git config --global color.branch auto + git config --global color.diff auto + git config --global color.interactive auto + git config --global color.status auto + + Checkout other settings + + git config --list + + Cloning NuttX Inside Cygwin + + If you are cloning the NuttX repository, it is recommended to avoid + automatic end of lines conversions by git. These conversions may break + some scripts like configure.sh. Before cloning, do the following: + + git config --global core.autocrlf false + +Related Repositories +-------------------- + + These are standalone repositories: + + * https://bitbucket.org/nuttx/apps + + This directory holds an optional package of applications and libraries + can be used with the NuttX RTOS. There is a README.txt file there that + will provide more information about that package. + + * https://bitbucket.org/nuttx/nxwidgets + + This is the NuttX C++ graphics support. This includes NxWM, the tiny + NuttX Window Manager. + + * https://bitbucket.org/nuttx/uclibc + + This repository contains a version of the uClibc++ C++ library. This code + originates from http://cxx.uclibc.org/ and has been adapted for NuttX by the + RGMP team (http://rgmp.sourceforge.net/wiki/index.php/Main_Page). + + * https://bitbucket.org/nuttx/buildroot + + A environment that you can to use to build a custom, NuttX GNU toolchain. + + * https://bitbucket.org/nuttx/tools + + There are snapshots of some tools here that you will need to work with + NuttX: kconfig-frontends, genromfs, and others. + + * https://bitbucket.org/nuttx/pascal + + Yes, this really is a Pascal compiler. The Pascal p-code run-time and + pcode debugger can be built as a part of NuttX. + +Notes about Header Files +------------------------ + + Other C-Library Header Files. + + When a GCC toolchain is built, it must be built against a C library. + The compiler together with the contents of the C library completes the + C language definition and provides the complete C development + environment. NuttX provides its own, built-in C library. So the + complete, consistent C language definition for use with NuttX comes from + the combination of the compiler and the header files provided by the + NuttX C library. + + When a GCC toolchain is built, it incorporates the C library header + files into the compiler internal directories and, in this way, the C + library really becomes a part of the toolchain. If you use the NuttX + buildroot toolchain as described below under "NuttX Buildroot + Toolchain", your GCC toolchain will build against the NuttX C library + and will incorporate the NuttX C library header files as part of the + toolchain. + + If you use some other, third-party tool chain, this will not be the + case, however. Those toolchains were probably built against some + other, incompatible C library distribution (such as newlib). Those + tools will have incorporated the incompatible C library header files + as part of the toolchain. These incompatible header files must *not* + be used with NuttX because they will conflict with definitions in the + NuttX built-in C-Library. For such toolchains that include 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. + + The math.h and stdarg.h are probably the two most trouble some header + files to deal with. These troublesome header files are discussed in + more detail below. + + 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 files + (i.e., with -nostdinc). 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 tuned math libraries are + bundled with your toolchain. + + The math library 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//include/math.h. There + is a stub math.h header file located at include/nuttx/lib/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/lib/math.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 architecture-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 available, a default float.h header file will + be 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 + 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 + it 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. + +CONFIGURING NUTTX +^^^^^^^^^^^^^^^^^ + +Instantiating "Canned" Configurations +------------------------------------- + + configure.sh and configure.bat: + + "Canned" NuttX configuration files are retained in: + + boards////configs/ + + Where is the name of your development board and + is the name of the sub-directory containing a specific configuration for + that board. and refer to characteristics of the + MCU used on the board: is the CPU architecture implemented + by the MCU; identifies the MCU chip family. Only a few + steps are required to instantiate a NuttX configuration, but to make the + configuration even easier there are scripts available in the tools/ + sub-directory combines those simple steps into one command. + + There is one tool for use with any Bash-like shell that does configuration + steps. It is used as follows: + + tools/configure.sh : + + There is an alternative Windows batch file that can be used in the windows + native environment like: + + tools\configure.bat : + + And, to make sure that other platforms are supported, there is also a + C program at tools/configure.c that can be compiled to establish the + board configuration. + + See tools/README.txt for more information about these scripts. + + General information about configuring NuttX can be found in: + + {TOPDIR}/boards/README.txt + {TOPDIR}/boards////README.txt + + The Hidden Configuration Scripts: + + As mentioned above, there are only a few simple steps to instantiating a + NuttX configuration. Those steps are hidden by the configuration scripts + but are summarized below: + + 1. Copy Files + + Configuring NuttX requires only copying two files from the + to the directory where you installed NuttX (TOPDIR): + + Copy boards////configs//Make.def + to {TOPDIR}/Make.defs + + OR + + Copy boards////scripts/Make.def + to {TOPDIR}/Make.defs + + Make.defs describes the rules needed by your tool chain to compile + and link code. You may need to modify this file to match the + specific needs of your toolchain. NOTE that a configuration may + have its own unique Make.defs file in its configuration directory or + it may use a common Make.defs file for the board in the scripts/ + directory. The first takes precedence. + + Copy boards////configs//defconfig + to{TOPDIR}/.config + + The defconfig file holds the actual build configuration. This + file is included by all other make files to determine what is + included in the build and what is not. This file is also used + to generate a C configuration header at include/nuttx/config.h. + + Copy other, environment-specific files to{TOPDIR} + + This might include files like .gdbinit or IDE configuration files + like .project or .cproject. + + 2. Refresh the Configuration + + New configuration setting may be added or removed. Existing settings + may also change there values or options. This must be handled by + refreshing the configuration as described below. + + NOTE: NuttX uses only compressed defconfig files. For the NuttX + defconfig files, this refreshing step is *NOT* optional; it is also + necessary to uncompress and regenerate the full making file. This is + discussed further below. + +Refreshing Configurations +------------------------- + + Configurations can get out of date. As new configuration settings are + added or removed or as dependencies between configuration settings + change, the contents of a default configuration can become out of synch + with the build systems. Hence, it is a good practice to "refresh" each + configuration after configuring and before making. To refresh the + configuration, use the NuttX Configuration Tool like this: + + make oldconfig + + AFTER you have instantiated the NuttX configuration as described above. + The configuration step copied the .config file into place in the top-level + NuttX directory; 'make oldconfig' step will then operate on that .config + file to bring it up-to-date. + + If your configuration is out of date, you will be prompted by 'make oldconfig' + to resolve the issues detected by the configuration tool, that is, to + provide values for the new configuration options in the build system. Doing + this can save you a lot of problems down the road due to obsolete settings in + the default board configuration file. The NuttX configuration tool is + discussed in more detail in the following paragraph. + + Confused about what the correct value for a new configuration item should + be? Enter ? in response to the 'make oldconfig' prompt and it will show + you the help text that goes with the option. + + If you don't want to make any decisions are willing to just accept the + recommended default value for each new configuration item, an even easier + way is: + + make olddefconfig + + The olddefconfig target will simply bring your configuration up to date with + the current Kconfig files, setting any new options to the default value. + No questions asked. + +NuttX Configuration Tool +------------------------ + + An automated tool has been incorporated to support re-configuration + of NuttX. This tool is based on the kconfig-frontends application available + at https://bitbucket.org/nuttx/tools/src/master/kconfig-frontends/. (This + is a snapshot of http://ymorin.is-a-geek.org/projects/kconfig-frontends.) + This application provides a tool called 'kconfig-mconf' that is used by the + NuttX top-level Makefile. The following make target is provided: + + make menuconfig + + This make target will bring up NuttX configuration menus. + + WARNING: Never do 'make menuconfig' on a configuration that has + not been converted to use the kconfig-frontends tools! This will + damage your configuration (see + http://www.nuttx.org/doku.php?id=wiki:howtos:convertconfig). + + How do we tell a new configuration from an old one? See "Incompatibilities + with Older Configurations" below. + + The 'menuconfig' make target depends on two things: + + 1. The Kconfig configuration data files that appear in almost all + NuttX directories. These data files are the part that is still + under development (patches are welcome!). The Kconfig files + contain configuration information for the configuration settings + relevant to the directory in which the Kconfig file resides. + + NOTE: For a description of the syntax of this configuration file, + see kconfig-language.txt in the tools repository at + https://bitbucket.org/nuttx/tools + + 2. The 'kconfig-mconf' tool. 'kconfig-mconf' is part of the + kconfig-frontends package. You can download that package from the + snapshot in the tools repository at https://bitbucket.org/nuttx/tools. + + Building kconfig-frontends under Linux may be as simple as + 'configure; make; make install' but there may be some build + complexities, especially if you are building under Cygwin. See + the more detailed build instructions in the top-level README.txt + file of the tools repository at https://bitbucket.org/nuttx/tools. + + The 'make install' step will, by default, install the 'kconfig-mconf' + tool at /usr/local/bin/mconf. Where ever you choose to + install 'kconfig-mconf', make certain that your PATH variable includes + a path to that installation directory. + + The kconfig-frontends tools will not build in a native Windows + environment directly "out-of-the-box". For the Windows native + case, you should use the modified version of kconfig-frontends + that can be found at + http://uvc.de/posts/linux-kernel-configuration-tool-mconf-under-windows.html + + The basic configuration order is "bottom-up": + + - Select the build environment, + - Select the processor, + - Select the board, + - Select the supported peripherals + - Configure the device drivers, + - Configure the application options on top of this. + + This is pretty straight forward for creating new configurations + but may be less intuitive for modifying existing configurations. + + Another ncurses-based tool that is an option to kconfig-mconf is + kconfig-nconf. The differences are primary in in the aesthetics of the + UI. If you have kconfig-nconf built, then you can invoke that front end + with: + + make nconfig + + If you have an environment that supports the Qt or GTK graphical systems + (probably KDE or gnome, respectively, or Cygwin under Windows with Qt or + GTK installed), then you can also build the graphical kconfig-frontends, + kconfig-qconf and kconfig-gconf. In these case, you can start the + graphical configurator with either: + + make qconfig + + or + + make gconfig + + Some keyboard shortcuts supported by kconfig-mconf, the tool that runs + when you do 'make menuconfig': + + - '?' will bring up the mconfig help display. + + - '/' can be used find configuration selections. + + - 'Z' can be used to reveal hidden configuration options + + These last two shortcuts are described further in the following + paragraphs. + +Finding Selections in the Configuration Menus +--------------------------------------------- + + The NuttX configuration options have gotten complex and it can be very + difficult to find options in the menu trees if you are not sure where + to look. The "basic configuration order" describe above can help to + narrow things down. + + But if you know exactly what configuration setting you want to select, + say CONFIG_XYZ, but not where to find it, then the 'make menuconfig' + version of the tool offers some help: By pressing the '/' key, the + tool will bring up a menu that will allow you to search for a + configuration item. Just enter the string CONFIG_XYZ and press 'ENTER'. + It will show you not only where to find the configuration item, but + also all of the dependencies related to the configuration item. + +Reveal Hidden Configuration Options +----------------------------------- + + If you type 'Z', then kconfig-mconf will change what is displayed. + Normally, only enabled features that have all of their dependencies met + are displayed. That is, of course, not very useful if you would like to + discover new options or if you are looking for an option and do not + realize that the dependencies have not yet been selected and, hence, it + is not displayed. + + But if you enter 'Z', then every option will be shown, whether or not its + dependencies have been met. You can then see everything that could be + selected with the right dependency selections. These additional options + will be shown the '-' for the selection and for the value (since it + cannot be selected and has no value). About all you do is to select + the option to see what the dependencies are. + +Make Sure that You are on the Right Platform +-------------------------------------------- + + Saved configurations may run on Linux, Cygwin (32- or 64-bit), or other + platforms. The platform characteristics can be changed use 'make + menuconfig'. Sometimes this can be confusing due to the differences + between the platforms. Enter sethost.sh + + sethost.sh is a simple script that changes a configuration to your + host platform. This can greatly simplify life if you use many different + configurations. For example, if you are running on Linux and you + configure like this: + + tools/configure.sh board:configuration + + The you can use the following command to both (1) make sure that the + configuration is up to date, AND (2) the configuration is set up + correctly for Linux: + + tools/sethost.sh -l + + Or, if you are on a Windows/Cygwin 64-bit platform: + + tools/sethost.sh -c + + Or, for MSYS/MSYS2: + + tools/sethost.sh -g + + Other options are available from the help option built into the + script. You can see all options with: + + tools/sethost.sh -h + + Recently, the options to the configure.sh (and configure.bat) scripts have + been extended so that you both setup the configuration, select for the host + platform that you use, and uncompress and refresh the defconfig file all in + one command like: + + tools/configure.sh -l board:configuration + + For a Linux host or for a Windows/Cygwin host: + + tools/configure.sh -h board:configuration + + Other options are available from the help option built into the + script. You can see all options with: + + tools/configure.sh -h + +Comparing Two Configurations +---------------------------- + + If you try to compare two configurations using 'diff', you will probably + not be happy with the result. There are superfluous things added to + the configuration files that make comparisons with the human eye + difficult. + + There is a tool at nuttx/tools/cmpconfig.c that can be built to simplify + these comparisons. The output from this difference tool will show only + the meaningful differences between two configuration files. This tool is + built as follows: + + cd nuttx/tools + make -f Makefile.host + + This will create a program called 'cmpconfig' or 'comconfig.exe' on Windows. + + Why would you want to compare two configuration files? Here are a few + of the reasons why I do this + + 1. When I create a new configuration I usually base it on an older + configuration and I want to know, "What are the options that I need to + change to add the new feature to the older configurations?" For example, + suppose that I have a boardA/nsh configuration and I want to create a + boardA/nxwm configuration. Suppose I already have boardB/nsh and + boardB/nxwm configurations. Then by comparing the boardB/nsh with the + boardB/nxwm I can see the modifications that I would need to make to my + boardA/nsh to create a new boardA/nxwm. + + 2. But the most common reason that I use the 'cmpconfig' program is to + check the results of "refreshing" a configuration with 'make oldconfig' + (see the paragraph "Refreshing Configurations" above). The 'make + oldconfig' command will make changes to my configuration and using + 'cmpconfig', I can see precisely what those changes were and if any + should be of concern to me. + + 3. The 'cmpconfig' tool can also be useful when converting older, legacy + manual configurations to the current configurations based on the + kconfig-frontends tools. See the following paragraph. + +Making defconfig Files +---------------------- + + .config Files as defconfig Files: + + The minimum defconfig file is simply the generated .config file with + CONFIG_APPS_DIR setting removed or commented out. That setting provides + the name and location of the apps/ directory relative to the nuttx build + directory. The default is ../apps/, however, the apps directory may be + any other location and may have a different name. For example, the name + of versioned NuttX releases are always in the form apps-xx.yy where xx.yy + is the version number. + + Finding the apps/ Directory Path: + + When the default configuration is installed using one of the scripts or + programs in the NuttX tools directory, there will be an option to provide + the path to the apps/ directory. If not provided, then the configure tool + will look around and try to make a reasonable decision about where the + apps/ directory is located. + + Compressed defconfig Files: + + The Makefile also supports an option to generate very small defconfig + files. The .config files are quite large and complex. But most of the + settings in the .config file simply have the default settings from the + Kconfig files. These .config files can be converted into small defconfig + file: + + make savedefconfig + + That make target will generate a defconfig file in the top-level + directory. The size reduction is really quite remarkable: + + wc -l .config defconfig + 1085 .config + 82 defconfig + 1167 total + + In order to be usable, the .config file installed from the compressed + defconfig file must be reconstituted using: + + make olddefconfig + + NOTE 1: Only compressed defconfig files are retained in the NuttX repository. + All patches and PRs that attempt to add or modify a defconfig file MUST + use the compressed defconfig format as created by 'make savdefconfig.' + + NOTE 2: When 'make savedefconfig' runs it will try several things some of + which are expected to fail. In these cases you will see an error message + from make followed by "(ignored)." You should also ignore these messages + + CAUTION: This size reduction was accomplished by removing all setting + from the .config file that were at the default value. 'make olddefconfig' + can regenerate the original .config file by simply restoring those default + settings. The underlying assumption here is, of course, that the default + settings do not change. If the default settings change, and they often + do, then the original .config may not be reproducible. + + So if your project requires 100% reproducibility over a long period of + time, you make want to save the complete .config files vs. the standard, + compressed defconfig file. + + Configuring with "Compressed" defconfig Files: + + As described above defconfig, all NuttX defconfig files are compressed + using 'make savedeconfig'. These compressed defconfig files are + generally not fully usable as they are and may not build the target + binaries that you want because the compression process removed all of + the default settings from the defconfig file. To restore the default + settings, you should run the following after configuring: + + make olddefconfig + + That will restore the the missing defaulted values. + + Using this command after configuring is generally a good practice anyway: + Even if the defconfig files are not "compressed" in this fashion, the + defconfig file may be old and the only way to assure that the installed + .config is is up to date is via 'make oldconfig' or 'make olddefconfig'. + See the paragraph above entitled ""Refreshing Configurations" for + additional information. + +Incompatibilities with Older Configurations +------------------------------------------- + + ***** WARNING ***** + + The current NuttX build system supports *only* the new compressed, + defconfig configuration files generated using the kconfig-frontends tools + as described in the preceding section. Support for the older, legacy, + manual configurations was eliminated in NuttX 7.0; support for + uncompressed .config-files-as-defconfig files was eliminated after + NuttX-7.21. All configurations must now be done using the + kconfig-frontends tool. The older manual configurations and the new + kconfig-frontends configurations are not compatible. Old legacy + configurations can *not* be used with the kconfig-frontends tool and, + hence, cannot be used with releases of NuttX 7.0 and beyond: + + If you run 'make menuconfig' with a legacy configuration the resulting + configuration will probably not be functional. + + Q: How can I tell if a configuration is a new kconfig-frontends + configuration or an older, manual configuration? + + A: Only old, manual configurations will have an appconfig file + + + Q: How can I convert a older, manual configuration into a new, + kconfig-frontends toolchain. + + A: Refer to http://www.nuttx.org/doku.php?id=wiki:howtos:convertconfig + + ***** WARNING ***** + + As described above, whenever you use a configuration, you really should + always refresh the configuration with the following command *before* you + make NuttX: + + make oldconfig + + OR + + make olddefconfig + + This will make sure that the configuration is up-to-date in the event that + it has lapsed behind the current NuttX development (see the paragraph + "Refreshing Configurations" above). But this only works with *new* + configuration files created with the kconfig-frontends tools. + + Further, this step is *NOT* optional with the new, compressed defconfig + files. It is a necessary step that will also uncompress the defconfig + file, regenerating the .config and making it usable for NuttX builds. + + Never do 'make oldconfig' (OR 'make menuconfig') on a configuration that + has not been converted to use the kconfig-frontends tools! This will + damage your configuration (see + http://www.nuttx.org/doku.php?id=wiki:howtos:convertconfig). + +NuttX Configuration Tool under DOS +---------------------------------- + + Recent versions of NuttX support building NuttX from a native Windows + console window (see "Native Windows Build" below). But kconfig-frontends + is a Linux tool. At one time this was a problem for Windows users, but + now there is a specially modified version of the kconfig-frontends tools + that can be used: + http://uvc.de/posts/linux-kernel-configuration-tool-mconf-under-windows.html + + The configuration steps most recent versions of NuttX require the + kconfig-tweak tool that is not not available in the the above. However, + there has been an update to this Kconfig Windows tools that does include + kconfig-tweak: http://reclonelabs.com/more-kconfig-awesomeness-for-windows/ + + Source code is available here: https://github.com/reclone/kconfig-frontends-win32 + and https://github.com/reclone/kconfig-frontends-win32/releases + + It is also possible to use the version of kconfig-frontends built + under Cygwin outside of the Cygwin "sandbox" in a native Windows + environment: + + 1. You can run the configuration tool using Cygwin. However, the + Cygwin Makefile.win will complain so to do this will, you have + to manually edit the .config file: + + a. Delete the line: CONFIG_WINDOWS_NATIVE=y + b. Change the apps/ directory path, CONFIG_APPS_DIR to use Unix + style delimiters. For example, change "..\apps" to "../apps" + + And of course, after you use the configuration tool you need to + restore CONFIG_WINDOWS_NATIVE=y and the correct CONFIG_APPS_DIR. + + 2) You can, with some effort, run the Cygwin kconfig-mconf tool + directly in the Windows console window. In this case, you do not + have to modify the .config file, but there are other complexities: + + a. You need to temporarily set the Cygwin directories in the PATH + variable then run kconfig-mconf manually like: + + kconfig-mconf Kconfig + + There is a Windows batch file at tools/kconfig.bat that automates + these steps: + + tools/kconfig menuconfig + + b. There is an issue with accessing DOS environment variables from + the Cygwin kconfig-mconf running in the Windows console. The + following change to the top-level Kconfig file seems to work + around these problems: + + config APPSDIR + string + - option env="APPSDIR" + + default "../apps" + +TOOLCHAINS +^^^^^^^^^^ + +Cross-Development Toolchains +---------------------------- + + In order to build NuttX for your board, you will have to obtain a cross- + compiler to generate code for your target CPU. For each board, + configuration, there is a README.txt file (at + boards////README.txt). + That README file contains suggestions and information about appropriate + tools and development environments for use with your board. + + In any case, the PATH environment variable will need to be updated to + include the location where the build can find the toolchain binaries. + +NuttX Buildroot Toolchain +------------------------- + + For many configurations, a DIY set of tools is available for NuttX. These + tools can be downloaded from the NuttX Bitbucket.org file repository. After + unpacking the buildroot tarball, you can find instructions for building + the tools in the buildroot/boards/README.txt file. + + Check the README.txt file in the configuration directory for your board + to see if you can use the buildroot toolchain with your board (this + README.txt file is located in + boards////README.txt). + + This toolchain is available for both the Linux and Cygwin development + environments. + + Advantages: (1) NuttX header files are built into the tool chain, + and (2) related support tools like NXFLAT tools, the ROMFS + genromfs tools, and the kconfig-frontends tools can be built into your + toolchain. + + Disadvantages: This tool chain is not was well supported as some other + toolchains. GNU tools are not my priority and so the buildroot tools + often get behind. For example, until recently there was no EABI support + in the NuttX buildroot toolchain for ARM. + + NOTE: For Cortex-M3/4, there are OABI and EABI versions of the buildroot + toolchains. If you are using the older OABI toolchain the prefix for + the tools will be arm-nuttx-elf-; for the EABI toolchain the prefix will + be arm-nuttx-eabi-. If you are using the older OABI toolchain with + an ARM Cortex-M3/4, you will need to set CONFIG_ARMV7M_OABI_TOOLCHAIN + in the .config file in order to pick the right tool prefix. + + If the make system ever picks the wrong prefix for your toolchain, you + can always specify the prefix on the command to override the default + like: + + make CROSSDEV=arm-nuttx-elf + +SHELLS +^^^^^^ + + The NuttX build relies on some shell scripts. Some are inline in the + Makefiles and many are executable scripts in the tools/. directory. The + scripts were all developed using bash and many contain bash shell + dependencies. + + Most of the scripts begin with #!/bin/bash to specifically select the + bash shell. Some still have #!/bin/sh but I haven't heard any complaints + so these must not have bash dependencies. + + There are two shell issues that I have heard of: + + 1. Linux where /bin/sh refers to an incompatible shell (like ksh or csh). + + In this case, bash is probably available and the #!/bin/bash at the + beginning of the file should do the job. If any scripts with #!/bin/sh + fail, try changing that to #!/bin/bash and let me know about the change. + + 2. FreeBSD with the Bourne Shell and no bash shell. + + The other, reverse case has also been reported on FreeBSD setups that + have the Bourne shell, but not bash. In this base, #!/bin/bash fails + but #!/bin/sh works okay. My recommendation in this case is to create + a symbolic link at /bin/bash that refers to the Bourne shell. + + There may still be issues, however, with certain the bash-centric scripts + that will require modifications. + +BUILDING NUTTX +^^^^^^^^^^^^^^ + +Building +-------- + + NuttX builds in-place in the source tree. You do not need to create + any special build directories. Assuming that your Make.defs is setup + properly for your tool chain and that PATH environment variable contains + the path to where your cross-development tools are installed, the + following steps are all that are required to build NuttX: + + cd{TOPDIR} + make + + At least one configuration (eagle100) requires additional command line + arguments on the make command. Read + {TOPDIR}/boards////README.txt to see + if that applies to your target. + +Re-building +----------- + + Re-building is normally simple -- just type make again. + + But there are some things that can "get you" when you use the Cygwin + development environment with Windows native tools. The native Windows + tools do not understand Cygwin's symbolic links, so the NuttX make system + does something weird: It copies the configuration directories instead of + linking to them (it could, perhaps, use the NTFS 'mklink' command, but it + doesn't). + + A consequence of this is that you can easily get confused when you edit + a file in one of the linked (i.e., copied) directories, re-build NuttX, + and then not see your changes when you run the program. That is because + build is still using the version of the file in the copied directory, not + your modified file! + + Older versions of NuttX did not support dependencies in this + configuration. So a simple work around this annoying behavior in this + case was the following when you re-build: + + make clean_context all + + This 'make' command will remove of the copied directories, re-copy them, + then make NuttX. + + However, more recent versions of NuttX do support dependencies for the + Cygwin build. As a result, the above command will cause everything to be + rebuilt (because it removes and will cause recreating the + include/nuttx/config.h header file). A much less gracefully but still + effective command in this case is the following for the ARM configuration: + + rm -rf arch/arm/src/chip arch/arm/src/board + + This "kludge" simple removes the copied directories. These directories + will be re-created when you do a normal 'make' and your edits will then be + effective. + +Build Targets and Options +------------------------- + + Build Targets: + Below is a summary of the build targets available in the top-level + NuttX Makefile: + + all + + The default target builds the NuttX executable in the selected output + formats. + + clean + + Removes derived object files, archives, executables, and temporary + files, but retains the configuration and context files and directories. + + distclean + + Does 'clean' then also removes all configuration and context files. + This essentially restores the directory structure to its original, + unconfigured stated. + + Application housekeeping targets. The APPDIR variable refers to the user + application directory. A sample apps/ directory is included with NuttX, + however, this is not treated as part of NuttX and may be replaced with a + different application directory. For the most part, the application + directory is treated like any other build directory in the Makefile script. + However, as a convenience, the following targets are included to support + housekeeping functions in the user application directory from the NuttX + build directory. + + apps_clean + + Perform the clean operation only in the user application directory + + apps_distclean + + Perform the distclean operation only in the user application directory. + The apps/.config file is preserved so that this is not a "full" distclean + but more of a configuration "reset" for the application directory. + + export + + The export target will package the NuttX libraries and header files into + an exportable package. Caveats: (1) These needs some extension for the KERNEL + build. (2) The logic in tools/mkexport.sh only supports GCC and, for example, + explicitly assumes that the archiver is 'ar' + + download + + This is a helper target that will rebuild NuttX and download it to the target + system in one step. The operation of this target depends completely upon + implementation of the DOWNLOAD command in the user Make.defs file. It will + generate an error an error if the DOWNLOAD command is not defined. + + The following targets are used internally by the make logic but can be invoked + from the command under certain conditions if necessary. + + depend + + Create build dependencies. (NOTE: There is currently no support for build + dependencies under Cygwin using Windows-native toolchains.) + + context + + The context target is invoked on each target build to assure that NuttX is + properly configured. The basic configuration steps include creation of the + the config.h and version.h header files in the include/nuttx directory and + the establishment of symbolic links to configured directories. + + clean_context + + This is part of the distclean target. It removes all of the header files + and symbolic links created by the context target. + + Build Options: + Of course, the value any make variable an be overridden from the make command + line. However, there is one particular variable assignment option that may + be useful to you: + + V=1 + + This is the build "verbosity flag." If you specify V=1 on the make command + line, you will see the exact commands used in the build. This can be very + useful when adding new boards or tracking down compile time errors and + warnings (Contributed by Richard Cochran). + +Native Windows Build +-------------------- + + The beginnings of a Windows native build are in place but still not often + used as of this writing. The build was functional but because of lack of + use may find some issues to be resolved with this build configuration. + + The windows native build logic initiated if CONFIG_WINDOWS_NATIVE=y is + defined in the NuttX configuration file: + + This build: + + - Uses all Windows style paths + - Uses primarily Windows batch commands from cmd.exe, with + - A few extensions from GNUWin32 + + In this build, you cannot use a Cygwin or MSYS shell. Rather the build must + be performed in a Windows console window. Here is a better terminal than the + standard issue, CMD.exe terminal: ConEmu which can be downloaded from: + https://sourceforge.net/projects/conemu/ or https://conemu.github.io/ . + + Build Tools. The build still relies on some Unix-like commands. I use + the GNUWin32 tools that can be downloaded from http://gnuwin32.sourceforge.net/ + using the 'Download all' selection. Individual packages can be download + instead if you know what you are doing and want a faster download (No, I + can't tell you which packages you should or should not download). + + Host Compiler: I use the MingGW GCC compiler which can be downloaded from + http://www.mingw.org/. If you are using GNUWin32, then it is recommended + the you not install the optional MSYS components as there may be conflicts. + + This capability should still be considered a work in progress because: + + (1) It has not been verified on all targets and tools, and + (2) it still lacks some of the creature-comforts of the more mature + environments. + +Installing GNUWin32 +------------------- + + The Windows native build will depend upon a few Unix-like tools that can be + provided either by MSYS or GNUWin32. The GNUWin32 are available from + http://gnuwin32.sourceforge.net/. GNUWin32 provides ports of tools with a + GPL or similar open source license to modern MS-Windows (Microsoft Windows + 2000 / XP / 2003 / Vista / 2008 / 7). See + http://gnuwin32.sourceforge.net/packages.html for a list of all of the tools + available in the GNUWin32 package. + + The SourceForge project is located here: + http://sourceforge.net/projects/gnuwin32/. The project is still being + actively supported (although some of the Windows ports have gotten very old). + + Some commercial toolchains include a subset of the GNUWin32 tools in the + installation. My recommendation is that you download the GNUWin32 tools + directly from the sourceforge.net website so that you will know what you are + using and can reproduce your build environment. + + GNUWin32 Installation Steps: + + The following steps will download and execute the GNUWin32 installer. + + 1. Download GetGNUWin32-x.x.x.exe from + http://sourceforge.net/projects/getgnuwin32/files/. This is the + installer. The current version as of this writing is 0.6.3. + + 2. Run the installer. + + 3. Accept the license. + + 4. Select the installation directory. My recommendation is the + directory that contains this README file (). + + 5. After running GetGNUWin32-0.x.x.exe, you will have a new directory + /GetGNUWin32 + + Note that the GNUWin32 installer didn't install GNUWin32. Instead, it + installed another, smarter downloader. That downloader is the GNUWin32 + package management tool developed by the Open SSL project. + + The following steps probably should be performed from inside a DOS shell. + + 6. Change to the directory created by GetGNUWin32-x.x.x.exe + + cd GetGNUWin32 + + 7. Execute the download.bat script. The download.bat script will download + about 446 packages! Enough to have a very complete Linux-like environment + under the DOS shell. This will take awhile. This step only downloads + the packages and the next step will install the packages. + + download + + 8. This step will install the downloaded packages. The argument of the + install.bat script is the installation location. C:\gnuwin32 is the + standard install location: + + install C:\gnuwin32 + + NOTE: This installation step will install *all* GNUWin32 packages... far + more than you will ever need. If disc space is a problem for you, you might + need to perform a manual installation of the individual ZIP files that you + will find in the /GetGNUWin32/packages directory. + +CYGWIN BUILD PROBLEMS +^^^^^^^^^^^^^^^^^^^^^ + +Performance +----------- + + Build performance under Cygwin is really not so bad, certainly not as good + as a Linux build. However, often you will find that the performance is + not just bad but terrible. If you are seeing awful performance.. like two + or three compilations per second.. the culprit is usually your Windows + Anti-Virus protection interfering with the build tool program execution. + + I use Cygwin quite often and I use Windows Defender. In order to get good + build performance, I routinely keep the Windows Defender "Virus & Threat + Protections Settings" screen up: I disable "Real-Time Protection" just + before entering 'make' then turn "Real-Time Protection" back on when the + build completes. With this additional nuisance step, I find that build + performance under Cygwin is completely acceptable. + +Strange Path Problems +--------------------- + + If you see strange behavior when building under Cygwin then you may have + a problem with your PATH variable. For example, if you see failures to + locate files that are clearly present, that may mean that you are using + the wrong version of a tool. For example, you may not be using Cygwin's + 'make' program at /usr/bin/make. Try: + + which make + /usr/bin/make + + When you install some toolchains (such as Yargarto or CodeSourcery tools), + they may modify your PATH variable to include a path to their binaries. + At that location, they may have GNUWin32 versions of the tools. So you + might actually be using a version of make that does not understand Cygwin + paths. + + The solution is either: + + 1. Edit your PATH to remove the path to the GNUWin32 tools, or + 2. Put /usr/local/bin, /usr/bin, and /bin at the front of your path: + + export PATH=/usr/local/bin:/usr/bin:/bin:$PATH + +Window Native Toolchain Issues +------------------------------ + + There are many popular Windows native toolchains that may be used with NuttX. + Examples include CodeSourcery (for Windows), devkitARM, and several vendor- + provided toolchains. There are several limitations with using a and Windows + based toolchain in a Cygwin environment. The three biggest are: + + 1. The Windows toolchain cannot follow Cygwin paths. Path conversions are + performed automatically in the Cygwin makefiles using the 'cygpath' utility + but you might easily find some new path problems. If so, check out 'cygpath -w' + + 2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links + are used in Nuttx (e.g., include/arch). The make system works around these + problems for the Windows tools by copying directories instead of linking them. + But this can also cause some confusion for you: For example, you may edit + a file in a "linked" directory and find that your changes had no effect. + That is because you are building the copy of the file in the "fake" symbolic + directory. If you use a Windows toolchain, you should get in the habit of + making like this: + + make clean_context all + + An alias in your .bashrc file might make that less painful. The rebuild + is not a long as you might think because there is no dependency checking + if you are using a native Windows toolchain. That bring us to #3: + +General Pre-built Toolchain Issues +---------------------------------- + + To continue with the list of "Window Native Toolchain Issues" we can add + the following. These, however, are really just issues that you will have + if you use any pre-built toolchain (vs. building the NuttX toolchain from + the NuttX buildroot package): + + There may be incompatibilities with header files, libraries, and compiler + built-in functions detailed below. For the most part, these issues + are handled in the existing make logic. But if you are breaking new ground, + then you may encounter these: + + 4. Header Files. Most pre-built toolchains will build with a foreign C + library (usually newlib, but maybe uClibc or glibc if you are using a + Linux toolchain). This means that the header files from the foreign + C library will be built into the toolchain. So if you "include ", + you will get the stdio.h from the incompatible, foreign C library and + not the nuttx stdio.h (at nuttx/include/stdio.h) that you wanted. + + This can cause confusion in the builds and you must always be + sure the -nostdinc is included in the CFLAGS. That will assure that + you take the include files only from + + 5. Libraries. What was said above header files applies to libraries. + You do not want to include code from the libraries of any foreign + C libraries built into your toolchain. If this happens you will get + perplexing errors about undefined symbols. To avoid these errors, + you will need to add -nostdlib to your CFLAGS flags to assure that + you only take code from the NuttX libraries. + + This, however, may causes other issues for libraries in the toolchain + that you do want (like libgcc.a or libm.a). These are special-cased + in most Makefiles, but you could still run into issues of missing + libraries. + + 6. Built-Ins. Some compilers target a particular operating system. + Many people would, for example, like to use the same toolchain to + develop Linux and NuttX software. Compilers built for other + operating systems may generate incompatible built-in logic and, + for this reason, -fno-builtin should also be included in your + C flags + + And finally you may not be able to use NXFLAT. + + 7. NXFLAT. If you use a pre-built toolchain, you will lose all support + for NXFLAT. NXFLAT is a binary format described in + Documentation/NuttXNxFlat.html. It may be possible to build + standalone versions of the NXFLAT tools; there are a few examples + of this in the buildroot repository at https://bitbucket.org/nuttx/buildroot + However, it is possible that there could be interoperability issues + with your toolchain since they will be using different versions of + binutils and possibly different ABIs. + +Building Original Linux Boards in Cygwin +---------------------------------------- + + Some default board configurations are set to build under Linux and others + to build under Windows with Cygwin. Various default toolchains may also + be used in each configuration. It is possible to change the default + setup. Here, for example, is what you must do in order to compile a + default Linux configuration in the Cygwin environment using the + CodeSourcery for Windows toolchain. After instantiating a "canned" + NuttX configuration, run the target 'menuconfig' and set the following + items: + + Build Setup->Build Host Platform->Windows + Build Setup->Windows Build Environment->Cygwin + System Type->Toolchain Selection->CodeSourcery GNU Toolchain under Windows + + In Windows 7 it may be required to open the Cygwin shell as Administrator + ("Run As" option, right button) you find errors like "Permission denied". + +Recovering from Bad Configurations +---------------------------------- + + Many people make the mistake of configuring NuttX with the "canned" + configuration and then just typing 'make' with disastrous consequences; + the build may fail with mysterious, uninterpretable, and irrecoverable + build errors. If, for example, you do this with an unmodified Linux + configuration in a Windows/Cgwin environment, you will corrupt the + build environment. The environment will be corrupted because of POSIX vs + Windows path issues and with issues related to symbolic links. If you + make the mistake of doing this, the easiest way to recover is to just + start over: Do 'make distclean' to remove every trace of the corrupted + configuration, reconfigure from scratch, and make certain that the set + the configuration correctly for your platform before attempting to make + again. + + Just fixing the configuration file after you have instantiated the bad + configuration with 'make' is not enough. + +DOCUMENTATION +^^^^^^^^^^^^^ + +Additional information can be found in the Documentation/ directory and +also in README files that are scattered throughout the source tree. The +documentation is in HTML and can be access by loading the following file +into your Web browser: + + Documentation/index.html + +NuttX documentation is also available online at http://www.nuttx.org. + +Below is a guide to the available README files in the NuttX source tree: + +nuttx/ + | + |- arch/ + | | + | |- arm/ + | | `- src + | | |- common + | | | `- README_lwl_console.txt + | | |- lpc214x + | | | `-README.txt + | | `- stm32l4 + | | `- README.txt + | |- renesas/ + | | |- include/ + | | | `-README.txt + | | |- src/ + | | | `-README.txt + | |- x86/ + | | |- include/ + | | | `-README.txt + | | `- src/ + | | `-README.txt + | `- z80/ + | | `- src/ + | | |- z80/README.txt + | | `- z180/README.txt, z180_mmu.txt + | `- README.txt + |- audio/ + | `-README.txt + |- binfmt/ + | `-libpcode/ + | `-README.txt + |- boards/ + | |- arm/ + | | |- a1x/ + | | | `- pcduino-a10/ + | | | `- README.txt + | | |- am335x/ + | | | `- beaglebone-black/ + | | | `- README.txt + | | |- c5471/ + | | | `- c5471evm/ + | | | `- README.txt + | | |- cxd56xx/ + | | | `- spresense/ + | | | `- README.txt + | | |- dm320/ + | | | `- ntosd-dm320/ + | | | |- doc/README.txt + | | | `- README.txt + | | |- efm32/ + | | | |- efm32-g8xx-stk/ + | | | | `- README.txt + | | | |- efm32gg-stk3700/ + | | | | `- README.txt + | | | `- olimex-efm32g880f128-stk/ + | | | `- README.txt + | | |- imx6/ + | | | `- sabre-6quad/ + | | | `- README.txt + | | |- imxrt/ + | | | |- imxrt1050-evk/ + | | | | `- README.txt + | | | `- imxrt1060-evk/ + | | | `- README.txt + | | |- kinetis/ + | | | |- freedom-k28f/ + | | | | `- README.txt + | | | |- freedom-k64f/ + | | | | `- README.txt + | | | |- freedom-k66f/ + | | | | `- README.txt + | | | |- kwikstik-k40/ + | | | | `- README.txt + | | | |- teensy-3.x/ + | | | | `- README.txt + | | | |- twr-k60n512/ + | | | | `- README.txt + | | | `- twr-k64f120m/ + | | | `- README.txt + | | |- kl/ + | | | |- freedom-kl25z/ + | | | | `- README.txt + | | | |- freedom-kl26z/ + | | | | `- README.txt + | | | `- teensy-lc/ + | | | `- README.txt + | | |- lc823450/ + | | | `- lc823450-xgevk/ + | | | `- README.txt + | | |- lpc17xx_40xx/ + | | | |- lincoln60/ + | | | | `- README.txt + | | | |- lpc4088-devkit/ + | | | | `- README.txt + | | | |- lpc4088-quickstart/ + | | | | `- README.txt + | | | |- lpcxpresso-lpc1768/ + | | | | `- README.txt + | | | |- lx_cpu/ + | | | | `- README.txt + | | | |- mbed/ + | | | | `- README.txt + | | | |- mcb1700/ + | | | | `- README.txt + | | | |- olimex-lpc1766stk/ + | | | | `- README.txt + | | | |- open1788/ + | | | | `- README.txt + | | | |- pnev5180b/ + | | | | `- README.txt + | | | |- u-blox-c027/ + | | | | `- README.txt + | | | `- zkit-arm-1769/ + | | | `- README.txt + | | |- lpc214x/ + | | | |- mcu123-lpc214x/ + | | | | `- README.txt + | | | `- zp214xpa/ + | | | `- README.txt + | | |- lpc2378/ + | | | `- olimex-lpc2378/ + | | | `- README.txt + | | |- lpc31xx/ + | | | |- ea3131/ + | | | | `- README.txt + | | | |- ea3152/ + | | | | `- README.txt + | | | `- olimex-lpc-h3131/ + | | | `- README.txt + | | |- lpc43xx/ + | | | |- bambino-200e/ + | | | | `- README.txt + | | | |- lpc4330-xplorer/ + | | | | `- README.txt + | | | |- lpc4337-ws/ + | | | | `- README.txt + | | | |- lpc4357-evb/ + | | | | `- README.txt + | | | `- lpc4370-link2/ + | | | `- README.txt + | | |- lpc54xx/ + | | | `- lpcxpresso-lpc54628/ + | | | `- README.txt + | | |- max326xx/ + | | | `- max32660-evsys/ + | | | `- README.txt + | | |- moxart/ + | | | `- moxa/ + | | |- nrf52/ + | | | `- nrf52-generic/ + | | | `- README.txt + | | |- nuc1xx/ + | | | `- nutiny-nuc120/ + | | | `- README.txt + | | |- s32k1xx/ + | | | |- s32k118evb/ + | | | | `- README.txt + | | | |- s32k146evb/ + | | | | `- README.txt + | | | `- s32k148evb/ + | | | `- README.txt + | | |- sam34/ + | | | |- arduino-due/ + | | | | `- README.txt + | | | |- flipnclick-sam3x/ + | | | | `- README.txt + | | | |- sam3u-ek/ + | | | | `- README.txt + | | | |- sam4cmp-db/ + | | | | `- README.txt + | | | |- sam4e-ek/ + | | | | `- README.txt + | | | |- sam4l-xplained/ + | | | | `- README.txt + | | | |- sam4s-xplained/ + | | | | `- README.txt + | | | `- sam4s-xplained-pro/ + | | | `- README.txt + | | |- sama5/ + | | | |- sama5d2-xult/ + | | | | `- README.txt + | | | |- sama5d3x-ek/ + | | | | `- README.txt + | | | |- sama5d3-xplained/ + | | | | `- README.txt + | | | `- sama5d4-ek/ + | | | `- README.txt + | | |- samd2l2/ + | | | |- arduino-m0/ + | | | | `- README.txt + | | | |- samd20-xplained/ + | | | | `- README.txt + | | | |- samd21-xplained/ + | | | | `- README.txt + | | | `- saml21-xplained/ + | | | `- README.txt + | | |- samd5e5/ + | | | `- metro-m4/ + | | | `- README.txt + | | |- samv7/ + | | | |- same70-xplained/ + | | | | `- README.txt + | | | `- samv71-xult/ + | | | `- README.txt + | | |- stm32/ + | | | |- axoloti/ + | | | | `- README.txt + | | | |- clicker2-stm32/ + | | | | `- README.txt + | | | |- cloudctrl/ + | | | | `- README.txt + | | | |- fire-stm32v2/ + | | | | `- README.txt + | | | |- hymini-stm32v/ + | | | | `- README.txt + | | | |- maple/ + | | | | `- README.txt + | | | |- mikroe-stm32f4/ + | | | | `- README.txt + | | | |- nucleo-f103rb/ + | | | | `- README.txt + | | | |- nucleo-f207zg/ + | | | | `- README.txt + | | | |- nucleo-f302r8/ + | | | | `- README.txt + | | | |- nucleo-f303re/ + | | | | `- README.txt + | | | |- nucleo-f303ze/ + | | | | `- README.txt + | | | |- nucleo-f334r8/ + | | | | `- README.txt + | | | |- nucleo-f410rb/ + | | | | `- README.txt + | | | |- nucleo-f446re/ + | | | | `- README.txt + | | | |- nucleo-f4x1re/ + | | | | `- README.txt + | | | |- nucleo-l152re/ + | | | | `- README.txt + | | | |- olimexino-stm32/ + | | | |- olimex-stm32-e407/ + | | | | `- README.txt + | | | |- olimex-stm32-h405/ + | | | | `- README.txt + | | | |- olimex-stm32-h407/ + | | | | `- README.txt + | | | |- olimex-stm32-p107/ + | | | |- olimex-stm32-p207/ + | | | | `- README.txt + | | | |- olimex-stm32-p407/ + | | | | `- README.txt + | | | |- omnibusf4/ + | | | | `- README.txt + | | | |- photon/ + | | | | `- README.txt + | | | |- shenzhou/ + | | | | `- README.txt + | | | |- stm32_tiny/ + | | | | `- README.txt + | | | |- stm3210e-eval/ + | | | | `- README.txt + | | | |- stm3220g-eval/ + | | | | `- README.txt + | | | |- stm3240g-eval/ + | | | | `- README.txt + | | | |- stm32butterfly2/ + | | | |- stm32f103-minimum/ + | | | | `- README.txt + | | | |- stm32f334-disco/ + | | | | `- README.txt + | | | |- stm32f3discovery/ + | | | | `- README.txt + | | | |- stm32f411e-disco/ + | | | | `- README.txt + | | | |- stm32f429i-disco/ + | | | | `- README.txt + | | | |- stm32f4discovery/ + | | | | `- README.txt + | | | |- stm32ldiscovery/ + | | | | `- README.txt + | | | |- stm32vldiscovery/ + | | | | `- README.txt + | | | `- viewtool-stm32f107/ + | | | `- README.txt + | | |- stm32f0l0g0/ + | | | |- b-l072z-lrwan1/ + | | | | `- README.txt + | | | |- nucleo-f072rb/ + | | | | `- README.txt + | | | |- nucleo-f091rc/ + | | | | `- README.txt + | | | |- nucleo-g070rb/ + | | | | `- README.txt + | | | |- nucleo-g071rb/ + | | | | `- README.txt + | | | |- nucleo-l073rz/ + | | | | `- README.txt + | | | |- stm32f051-discovery/ + | | | | `- README.txt + | | | `- stm32f072-discovery/ + | | | `- README.txt + | | |- stm32f7/ + | | | |- nucleo-144/ + | | | | `- README.txt + | | | |- stm32f746g-disco/ + | | | | |- configs/fb/README.txt + | | | | |- configs/nxdemo/README.txt + | | | | |- configs/nxterm/README.txt + | | | | `- README.txt + | | | |- stm32f746-ws/ + | | | `- stm32f769i-disco/ + | | | `- README.txt + | | |- stm32h7/ + | | | `- nucleo-h743zi/ + | | | `- README.txt + | | |- stm32l4/ + | | | |- b-l475e-iot01a/ + | | | | `- README.txt + | | | |- nucleo-l432kc/ + | | | | `- README.txt + | | | |- nucleo-l452re/ + | | | | `- README.txt + | | | |- nucleo-l476rg/ + | | | | `- README.txt + | | | |- nucleo-l496zg/ + | | | | `- README.txt + | | | |- stm32l476-mdk/ + | | | | `- README.txt + | | | |- stm32l476vg-disco/ + | | | | `- README.txt + | | | `- stm32l4r9ai-disco/ + | | | `- README.txt + | | |- str71x/ + | | | `- olimex-strp711/ + | | | `- README.txt + | | |- tiva/ + | | | |- dk-tm4c129x/ + | | | | `- README.txt + | | | |- eagle100/ + | | | | `- README.txt + | | | |- ekk-lm3s9b96/ + | | | | `- README.txt + | | | |- launchxl-cc1310/ + | | | | `- README.txt + | | | |- launchxl-cc1312r1/ + | | | | `- README.txt + | | | |- lm3s6432-s2e/ + | | | | `- README.txt + | | | |- lm3s6965-ek/ + | | | | `- README.txt + | | | |- lm3s8962-ek/ + | | | | `- README.txt + | | | |- lm4f120-launchpad/ + | | | | `- README.txt + | | | |- tm4c123g-launchpad/ + | | | | `- README.txt + | | | `- tm4c1294-launchpad/ + | | | `- README.txt + | | |- tms570/ + | | | |- launchxl-tms57004/ + | | | | `- README.txt + | | | `- tms570ls31x-usb-kit/ + | | | `- README.txt + | | `- xmc4/ + | | `- xmc4500-relax/ + | | `- README.txt + | |- avr/ + | | |- at32uc3/ + | | | `- avr32dev1/ + | | | `- README.txt + | | |- at90usb/ + | | | |- micropendous3/ + | | | | `- README.txt + | | | `- teensy-2.0/ + | | | `- README.txt + | | `- atmega/ + | | |- amber/ + | | | `- README.txt + | | |- arduino-mega2560/ + | | | `- README.txt + | | `- moteino-mega/ + | | `- README.txt + | |- hc/ + | | `- mcs92s12ne64/ + | | |- demo9s12ne64/ + | | | `- README.txt + | | `- ne64badge/ + | | `- README.txt + | |- mips/ + | | |- pic32mx/ + | | | |- mirtoo/ + | | | | `- README.txt + | | | |- pic32mx7mmb/ + | | | | `- README.txt + | | | |- pic32mx-starterkit/ + | | | | `- README.txt + | | | |- sure-pic32mx/ + | | | | `- README.txt + | | | `- ubw32/ + | | | `- README.txt + | | `-pic32mz/ + | | |- flipnclick-pic32mz/ + | | | `- README.txt + | | `- pic32mz-starterkit/ + | | `- README.txt + | |- misoc/ + | | `- lm32/ + | | `- misoc/ + | | `- README.txt + | |- or1k/ + | | `- mor1kx/ + | | `- or1k/ + | | `- README.txt + | |- renesas/ + | | |- m32262f8/ + | | | `- skp16c26/ + | | | `- README.txt + | | `-sh7032/ + | | `- us7032evb1/ + | | `- README.txt + | |- risc-v/ + | | |- gap8/ + | | | `- gapuino/ + | | | `- README.txt + | | `-nr5m100/ + | | `- nr5m100-nexys4/ + | | `- README.txt + | |- sim/ + | | `- sim/ + | | `- sim/ + | | |- include/README.txt + | | `- README.txt + | |- x86/ + | | `- qemu/ + | | `- qemu-i486/ + | | `- README.txt + | |- xtensa/ + | | `- esp32/ + | | `- esp32-core/ + | | `- README.txt + | |- z16/ + | | `- z16f2811/ + | | `- z16f2800100zcog/ + | | |- configs/nsh/README.txt + | | |- configs/ostest/README.txt + | | |- configs/pashello/README.txt + | | `- README.txt + | |- z80/ + | | |- ez80/ + | | | |- ez80f910200kitg/ + | | | | |- configs/ostest/README.txt + | | | | `- README.txt + | | | |- ez80f910200zco/ + | | | | |- configs/dhcpd/README.txt + | | | | |- configs/httpd/README.txt + | | | | |- configs/nettest/README.txt + | | | | |- configs/nsh/README.txt + | | | | |- configs/poll/README.txt + | | | | `- README.txt + | | | `- makerlisp/ + | | | |- configs/nsh_flash/README.txt + | | | |- configs/nsh_ram/README.txt + | | | |- configs/sdboot/README.txt + | | | `- README.txt + | | |- z180/ + | | | `- p112/ + | | | `- README.txt + | | |- z8/ + | | | |- z8encore000zco/ + | | | | |- configs/ostest/README.txt + | | | | `- README.txt + | | | `- z8f64200100kit/ + | | | |- configs/ostest/README.txt + | | | `- README.txt + | | `- z80/ + | | `- z80sim/ + | | `- README.txt + | `-README.txt + |- drivers/ + | |- eeprom/ + | | `- README.txt + | |- lcd/ + | | | README.txt + | | `- pcf8574_lcd_backpack_readme.txt + | |- mtd/ + | | `- README.txt + | |- sensors/ + | | `- README.txt + | |- syslog/ + | | `- README.txt + | `- README.txt + |- fs/ + | |- binfs/ + | | `- README.txt + | |- cromfs/ + | | `- README.txt + | |- mmap/ + | | `- README.txt + | |- nxffs/ + | | `- README.txt + | |- smartfs/ + | | `- README.txt + | |- procfs/ + | | `- README.txt + | |- spiffs/ + | | `- README.md + | `- unionfs/ + | `- README.txt + |- graphics/ + | `- README.txt + |- libs/ + | |- README.txt + | |- libc/ + | | |- zoneinfo + | | | `- README.txt + | | `- README.txt + | |- libdsp/ + | | `- README.txt + | |- libnx/ + | | |- nxfongs + | | | `- README.txt + | | `- README.txt + | |- libxx/ + | `- README.txt + |- mm/ + | |- shm/ + | | `- README.txt + | `- README.txt + |- net/ + | |- sixlowpan + | | `- README.txt + | `- README.txt + |- pass1/ + | `- README.txt + |- syscall/ + | `- README.txt + `- tools/ + `- README.txt + +Below is a guide to the available README files in the semi-optional apps/ +source tree: + +apps/ + |- examples/ + | |- bastest/README.txt + | |- json/README.txt + | |- pashello/README.txt + | `- README.txt + |- gpsutils/ + | `- minmea/README.txt + |- graphics/ + | |- tiff/README.txt + | `- traveler/tools/tcledit/README.txt + |- interpreters/ + | |- bas/ + | | `- README.txt + | |- ficl/ + | | `- README.txt + | `- README.txt + |- modbus/ + | `- README.txt + |- netutils/ + | |- discover/ + | | `- README.txt + | |- ftpc/ + | | `- README.txt + | |- json/ + | | `- README.txt + | |- telnetd/ + | | `- README.txt + | `- README.txt + |- nshlib/ + | `- README.txt + |- NxWidgets/ + | `- README.txt + |- system/ + | |- cdcacm/ + | | `- README.txt + | |- i2c/ + | | `- README.txt + | |- inifile/ + | | `- README.txt + | |- install/ + | | `- README.txt + | |- nsh/ + | | `- README.txt + | |- nxplayer/ + | | `- README.txt + | |- psmq/ + | | `- README.txt + | |- symtab/ + | | `- README.txt + | |- termcurses/ + | | `- README.txt + | |- usbmsc/ + | | `- README.txt + | `- zmodem/ + | `- README.txt + `- wireless + |- bluetooth/ + | `- btsak/ + | `- README.txt + `- ieee802154 + `- i8sak/ + `- README.txt + +Additional README.txt files in the other, related repositories: + +NxWidgets/ + |- Doxygen + | `- README.txt + |- tools + | `- README.txt + |- UnitTests + | `- README.txt + `- README.txt + +buildroot/ + `- README.txt + +tools/ + `- README.txt + +uClibc++/ + `- README.txt + +pascal/ + `- README.txt diff --git a/ReleaseNotes b/ReleaseNotes new file mode 100755 index 0000000..7dab746 --- /dev/null +++ b/ReleaseNotes @@ -0,0 +1,26620 @@ +NuttX Release Notes +=================== + +This file contains are the release notes for the NuttX (and apps) packages +for every release. The text is just as was written at the time of release +(with perhaps some corrected typos). Over the course of time, NuttX has +used several different repositories: CVS, two SVN repositories, and +currently a GIT repository. Therefore, revision information specific to an +older repository may not be meaningful today. + +To make it easier to track there older versions in the current GIT +repository, a GIT lightweight tag has been applied for each release. The +tag name is the release name (for example, the release 6.27 has tag name +"nuttx-6.27"). + +NuttX-0.1.0 +----------- + +This is the initial. This initial includes the complete NuttX RTOS +with support for the Linux user mode simulation and the TI TMS320C5471 +(Arm7) processor. Partial support for the 87C52 is included. + +This release has been verified on both the Linux user-mode and C5471 +platforms using the test program under examples/ostest. Test results +for the C5471 can be found in arch/c5471/doc/test-results.txt. + +This tarball contains a complete CVS snapshot from March 9,2007. + +NuttX-0.1.1 +----------- + +This is the second release of NuttX. This release includes the following. +See the ChangeLog for more detailed description of the changes. + +(1) General OS bugfixes (see the ChangeLog for details), +(2) bugfixes for the TI TMS320C5471 (Arm7) platform (see + the ChangeLog) +(3) Complete support for the 87C52. (However, the 87C52 + release is not stable enough for general usage). +(4) Added the beginning of a shell call NuttShell (nsh) + +This release has been verified on the Linux user-mode platform, the +Spectrum Digital TMS320C5471 EVM, and the PJRC 87C52 development board +using the test program under examples/ostest. + +STATUS: The development status remains as ALPHA until further testing +is performed. + +This tarball contains a complete CVS snapshot from March 14, 2007. + +NuttX-0.1.2 +----------- + +This is the third release of NuttX. This release is +primarily a bugfix release with minimal new features. See +the ChangeLog for a more detailed description of the +changes. + +(1) Several important OS and ARM7 bugfixes, +(2) opendir(), closedir(), readdir(), etc. added +(3) Added C5471 watchdog timer. +(4) Created a shareable, serial driver. +(5) Added 'ls' command to NuttShell (nsh) +(6) Added a test of the round robin scheduler + +This release has been verified on the Linux user-mode +platform, the Spectrum Digital TMS320C5471 EVM using the +test program under examples/ostest. + +This tarball contains a CVS snapshot from March 19, 2007. + +NuttX-0.2.1 +----------- + +This is the fourth release of NuttX. This release adds adds +support for a new platform, restructures many header files, +and adds a few new features: + +(1) Support for Neuros OSD / DM320 +(2) Restructuring of header files for better POSIX compliance +(3) Added kill() +(4) Added POSIX timers +(5) bugfixes and documentation updates + +This release has been verified on the Linux user-mode +platform, the Spectrum Digital TMS320C5471 EVM, and the +Neuros OSD using the test program under examples/ostest. Because +of the stability of these tests, the project status +has been upgraded to 'beta.' + +This tarball contains a complete CVS snapshot from March 22, 2007. + +NuttX-0.2.2 +------------ + +This is the fifth release of NuttX. There is no major new +functionality in this release. This release adds support +for new pthread barrier APIs, changes the directory +structure, to better handle different board configurations +using the same processor architecture, and corrects a few +defects. + +See the ChangeLog for a complete list of changes. + +This release has been verified on the Linux user-mode +platform and the Neuros OSD using the test program under +examples/ostest. There are no known, critical defects but +the project development status remains at 'beta' status +pending further test and evaluation. + +This tarball contains a complete CVS snapshot from +March 26, 2007. + +NuttX-0.2.3 +------------ + +This is the sixth release of NuttX. This release is +primarily a bugfix release. Numerous problems were fixed +as detailed in the change log. New functionality includes +support for timed message queues. + +See the ChangeLog for a complete list of changes. + +This release has been verified on the Linux user-mode +platform and the Neuros OSD using the test program under +examples/ostest. The results of the testing is available in +the source tree under configs/ntosd-dm320/doc/test-results. +There are no known, critical defects but the project +development status remains at 'beta' status pending further +test and evaluation. + +This tarball contains a complete CVS snapshot from March 29, +2007. + +NuttX-0.2.4 +------------ + +This is the 7th release of NuttX. This release is only to roll out +build changes to better support different SoC's that use the same +processor architecture. In particular, the two existing ARM architectures, +c5471 and DM320 were combined into a single ARM directory. This was done +in preparation for an LPC2148 port that is currently in progress. There +is NO new functionality or significant bugfixes in this release. + +See the ChangeLog for a complete list of changes. + +This release has been verified on the Linux user-mode platform +and the Neuros OSD using the test program under examples/ostest. +The results of the testing is available in the source tree under +configs/ntosd-dm320/doc/test-results and under configs/sim/doc/test-results. +There are no known, critical defects but the project development status +remains at 'beta' status pending further test and evaluation. + +This tarball contains a complete CVS snapshot from April 28, 2007. + +NuttX-0.2.5 +------------ + +This is the 8th release of NuttX. This release includes: + +(1) Several bug fixes +(2) Initial support for FAT filesystems. Testing has not + been exhaustive and some functionality is missing + (mkdir, stat, unlink chmod, and rename functionality is + not yet implemented). +(3) Support for the NXP lpc2148 processor is included but + is untested as of this writing. The current + implementation includes only support for serial console + and timer interrupt. + +See the ChangeLog for a complete list of changes. + +This release has been verified only on the Linux user-mode +platform. + +This tarball contains a complete CVS snapshot from May 19, +2007. + +NuttX-0.2.6 +----------- + +This is the 9th release of NuttX. This is primarily a +bugfix release to correct a number of problems introduced +with the 0.2.5 release. This release does include some FAT +filesystem extensions including unlink(), mkdir(), rmdir(), +rename(), opendir(), closedir(), readdir(), seekdir(), +telldir(), rewindir(). There are some pending FAT changes +that did not make it into this release including stat(), +truncate(), and long file names. + +See the ChangeLog for a complete list of changes. + +This release has been verified only on the Linux user-mode platform. + +This tarball contains a complete CVS snapshot from May 26, 2007. + +NuttX-0.2.7 +----------- + +This is the 10th release of NuttX. This is primarily a bugfix +release to correct a number of problems reported to me (thanks +Didier!). This release does include the final changes complete the +FAT filesystem logic including stat(), statfs(), and non-standard +APIs to manage FAT attributes. At present, FAT long file names and +file truncate() are still not supported. + +See the ChangeLog for a complete list of changes. + +This release has been verified only on the Linux user-mode platform. + +This tarball contains a complete CVS snapshot from June 9, 2007. + +NuttX-0.2.8 +----------- + +This is the 11th release of NuttX. This release: +(1) corrects important bugs in opendir() and realloc() +(2) adds support for environment variables +(3) adds several new C library interfaces +(4) extends several example programs + +See the ChangeLog for a complete list of changes. + +This release has been verified only on the Linux user-mode platform. + +This tarball contains a complete CVS snapshot from July 2, 2007. + +NuttX-0.3.0 +----------- + +This is the 12th release of NuttX. This release includes the initial +integration of a network subsystem and the uIP TCP/IP stack into NuttX +(see http://www.sics.se/~adam/uip/index.php/Main_Page). Also included +is a device driver for the Davicom DM90x0 Ethernet controller. + +This integration is very preliminary. Only a small portion of the +network functionality has been integrated and there are a number of +open issues (see the TODO file). The network subsystem is pre-alpha +at this point in time. I expect that it will stabilize and mature +over the next few releases. + +The baseline functionality of NuttX continues to mature and remains at +post-beta (as long as the network is not used). + +See the ChangeLog for a complete list of changes. + +This release has been verified only on the Neuros OSD (DM320 ARM9) +platform using the DM90x0 driver. + +This tarball contains a complete CVS snapshot from November 6, 2007. + +NuttX-0.3.1 +----------- + +This is the 13th release of NuttX and the second release containing +the integration of a network subsystem and the uIP TCP/IP, UDP, and +ICMP stacks into NuttX (see http://www.sics.se/~adam/uip/index.php/Main_Page). + +Many network-related problems have been fixed and the implementation +has matured significantly. However, the level of network reliability +is probably still at the pre-alpha or early level. It is sufficiently +complete that you may begin to perform some network integration and +is expected to achieve beta level of reliability over the next few +releases. + +The baseline functionality of NuttX continues to mature and remains at +post-beta (as long as the network is not used). + +See the ChangeLog for a complete list of changes. + +This release has been verified only on the Neuros OSD (DM320 ARM9) +platform using the DM90x0 driver. + +This tarball contains a complete CVS snapshot from November 19, 2007. + +NuttX-0.3.2 +----------- + +This is the 14th release of NuttX and the 3rd release containing +the integration of a network subsystem and the uIP TCP/IP, UDP, and +ICMP stacks into NuttX (see http://www.sics.se/~adam/uip/index.php/Main_Page). + +Many network-related problems have been fixed and the implementation +has matured significantly. This release consists of: + +o TCP-related bug-fixes +o TCP performance improvements +o Initial UDP integration +o Initial uIP micro webserver integration + +See the ChangeLog for a complete list of changes. + +The level of network reliability is at alpha level is expected to +achieve beta level of reliability over the next few releases. + +The baseline functionality of NuttX continues to mature and remains at +post-beta. + +This release has been verified only on the Neuros OSD (DM320 ARM9) +platform using the DM90x0 driver. + +This tarball contains a complete CVS snapshot from November 23, 2007. + +NuttX-0.3.3 +----------- + +This is the 15th release of NuttX and the 4th release containing +the integration of a network subsystem and the uIP TCP/IP, UDP, and +ICMP stacks into NuttX (see http://www.sics.se/~adam/uip/index.php/Main_Page). + +Many network-related problems have been fixed and the implementation +has matured significantly. This release consists of: + +o TCP-related bug-fixes for disconnecting sockets +o Correction of some TCP read-ahead logic +o TCP performance improvements +o Misc. additions and cleanup (See the ChangeLog for a complete list of + changes). + +The level of network reliability is at an early beta release level. The +baseline functionality of NuttX continues to mature and remains at +post-beta. Open network-related issues include only: + +o Some minor unimplemented BSD socket functionality, +o Thread safety issues: the same socket cannot be used concurrently on + different threads. +o Pending design changes necessary to support multiple network interfaces. +o IPv6 support is incomplete. + +This release has been verified only on the Neuros OSD (DM320 ARM9) +platform using the DM90x0 driver. Any feedback for improving the network +reliability/performance would be greatly appreciated. + +This tarball contains a complete CVS snapshot from November 28, 2007. + +NuttX-0.3.4 +----------- + +This is the 16th release of NuttX and the 5th release containing +the integration of a network subsystem and the uIP TCP/IP, UDP, and +ICMP stacks into NuttX (see http://www.sics.se/~adam/uip/index.php/Main_Page). + +This release is primarily a bug-fix release. New features include +only: + +o TELNET front-end to NSH, +o DHCPC server functionality, and +o C5471 Ethernet driver. + +Numerous network related problems were fixed related to DHCPC, UDP +input processing, UDP broadcast, send timeouts, and bad compilation when +uIP is compiled at high levels of optimization. + +The level of network reliability is at a strong beta release level. The +baseline functionality of NuttX continues to mature and remains at +post-beta or production level. + +Parts of this release were verified only on the Neuros OSD (DM320 ARM9) +platform using the DM90x0 Ethernet driver and other parts on the Spectrum +Digital C5471 EVM using the C5471 Ethernet driver. Any feedback about bugs +or suggestions for improving the network reliability/performance would be +greatly appreciated. + +This tarball contains a complete CVS snapshot from December 10, 2007. + +NuttX-0.3.5 +----------- + +This is the 17th release of NuttX this release is primarily a bug-fix +release and intended to synchronize with the current CVS contents. See +the ChangeLog for a detailed list of changes and fixes. + +This release were verified only on the Spectrum Digital C5471 EVM using +the C5471 Ethernet driver. Any feedback about bugs or suggestions for +improvement would be greatly appreciated. + +This tarball contains a complete CVS snapshot from December 18, 2007. + +NuttX-0.3.6 +----------- + +This is the 18th release of NuttX. This release contains on a few +changes. The primary purpose of this release is to synchronize with +the release of the pascal-0.1.0 add-on package. + +This release of NuttX includes the following changes: + +* Fixes for use with SDCC compiler +* Added a simulated z80 target (arch/z80) +* Fix deadlock errors when using stdio but with no buffering +* Add support for the add-on Pascal P-Code interpreter (pcode/) + (see the pascal-0.1.0 package) + +This release were verified only on the simulated Z80 and host +simulation targets. As usual, any feedback about bugs or suggestions +for improvement would be greatly appreciated. + +This tarball contains a complete CVS snapshot from January 6, 2007. + +==== + +There was an error in the initial 0.3.6 release that prevented +a successful build unless the Pascal add-on was present. The +tarball was patched to include the fix. Make sure that you download +the nuttx-0.3.6.1.tar.gz version to avoid this problem. + +NuttX-0.3.7 +----------- + +This is the 19th release of NuttX. This release includes the +preliminary port of NuttX to the ZiLOG z16f 16-bit microcontroller. +This port was verified using the ZiLOG z16f2800100zcog Development +and the ZiLOG ZDS-II toolchain. See http://www.zilog.com for +further information. + +I emphasize that this is a preliminary release of the z16f port and +is only alpha or, perhaps, pre-alpha quality as of this writing. +There are a list of known issues in the TODO file in the root of +the NuttX directory. The overall quality of NuttX (excluding the +z16f port) continues to improve beyond the late beta level. + +The z16f port required numerous changes to NuttX to handle: + +* NEAR and FAR addressing, and +* Use of a Windows native toolchain in a Cygwin build environment. + +In addition to the z16f port, at least one very critical bug was +found and corrected in NuttX: The thread-specific errno value of one +task was being randomly trashed when a different thread exited. + +This release were verified on the ZiLOG z16f2800100zcog, Neuros OSD +(ARM9), and the simulation platforms. As usual, any feedback about bugs +or suggestions for improvement would be greatly appreciated. + +This tarball contains a complete CVS snapshot from January 31, 2008. + +NuttX-0.3.8 +----------- + +This is the 20th release of NuttX. This is a minor bugfix release. +It corrects a few minor problems, adds a few minor features, and +continues the integration of the ZiLOG Z18F and of the Pascal P-Code +add-on. This release is synchronized with the release of Pascal-0.1.2. + +This tarball contains a complete CVS snapshot from February 10, 2008. + +NuttX-0.3.9 +----------- + +This is the 21st release of NuttX. This is a minor future enhancement +release. This release includes support for the ZiLOG Z8Encore! micro- +controller. Also included is the initial framework for support for +the Z80, XTRS platform (http://www.tim-mann.org/xtrs.html). + +This released has been verified only on the ZiLOG ZDS-II Z8Encore! +chip simulation. + +This tarball contains a complete CVS snapshot from March 9, 2008. + +NuttX-0.3.10 +------------ + +This is the 22nd release of NuttX. This is an important bug fix +release. This release incorporates fixes to correct critical list +handling errors in task shutdown logic: One in timer deletion logic +(timer_delete.c) and one in stream logic (lib_init.c). This release +also includes support to ZiLOG EZ80Acclaim microcontroller (EZ80F91 +chip) and configurations for the ZiLOG z8f64200100kit (Z8F6423) and +ez80f0910200kitg (EZ80F091) development kit. + +NuttX-0.3.11 +------------ + +This is the 23rd release of NuttX. This is another important bugfix +release. This releases fixes several bugs: + +* Two POSIX timer bugs: a memory leak as well a fatal sequencing error. +* Several FAT filesystem errors. +* A deadlock that can occur in opendir() + +A few new features were also added: + +* Support for recursive mutexes +* Added a RAM disk block driver +* The host simulator no longer uses direct Linux system calls and + now also works on Cygwin. +* The OS test was strengthen and now runs as an endurance test + +These changes were verified only on the Host simulator under Cygwin. +Please report any errors to me. + +This tarball contains a complete CVS snapshot from June 1, 2008. + +NuttX-0.3.12 +------------ + +This is the 24th release of NuttX. This release includes some minor +bugfixes as well as a few new features. Bugs fixed include: + +* Corrected an error in recursive mutex implementation. +* task_create() was only dup()ing the first three file descriptors. +* Fixed driver open reference counting errors in dup(), dup2(), and exit(). +* Fixed error handling logic in fflush(). + +New features were also added: + +* Pipes and pipe() API +* FIFOs and mkfifo() API +* mkfatfs() API can be used to format FAT file systems. + +These changes were verified only on the Host simulator under Cygwin. +Please report any errors to me. + +This tarball contains a complete CVS snapshot from August 10, 2008. + +NuttX-0.3.13 +------------ + +This is the 25th release of NuttX. This release includes some +important bugfixes as well as a few new features. Bugs fixed +include: + +* Fixed problems with Cygwin-based console input. NSH now works + with the Cygwin simulator. +* sched_get_priority_max/min returned error on SCHED_RR +* Corrected detection of End-of-File in fgets() +* Fixed an error in opendir() that could cause an assertion to fail + inappropriately. +* Corrected an error in the FAT that caused files opened for writing + with O_APPEND to fail. +* Fix error in getopt() when called with argc==1 +* Fix error in stat() when used on the root directory +* Fixed a critical bug that effects the way that environment variables + are shared among pthreads. +* uIP port now supports multi-threaded, concurrent socket access. + So, for example, one thread can be reading from a socket while + another is writing to the socket. + +New features were also added: + +* New OS APIs: chdir() and getcwd() +* The Nuttx shell (NSH) has been extended in many ways. + - New commands: mkfatfs, mkfifo, sleep, usleep, nice, sh, cd, and pwd + - New memory inspection commands and heap usage commands + - New capabilities: + - Execution of commands in background + - Execution of simple scripts + - Redirection of command output + - Last command status ($?) + - Now supports if-then[-else]-fi construct + - Other features as noted in the ChangeLog. + +These changes were verified only on the Host simulator under Cygwin +and under Linux and also on the Neuros OSD (ARM9). Please report +any errors to me. + +This tarball contains a complete CVS snapshot from September 1, 2008. + +nutt-0.3.14 +----------- + +This is the 26th release of NuttX. This release includes some +important bugfixes as well as a few new features. Critical bugs +fixed include: + +FAT FS: + * Fixed several critical bugs with regard to fat reading and + writing and FAT12 accesses. Basically the FAT FS only worked + with my tiny test files and test cases. A lot of stronger FAT + tested is still needed! + * Fixed another FAT bug in implementation of FAT lseek(); + this prohibited correct random access to large files. + +Network: + * Corrected a critical bug that may prevent recvfrom from receiving + packets from most remote UDP port numbers. + * Corrected an error in multi-threaded socket handling in send() and + sendto(). Outgoing data could overwrite incoming data. + * Corrected IP checksum calculation in ICMP and UDP message send logic. + * Corrected an error in send() timeout logic. + +New features were also added: + +Network: + * Added support for application access to ICMP protocol stacks + * Added ping request logic (net/uip). + * Added basic TFTP client logic (netutils/tftpc). + +NuttShell (NSH): + * New commands: 'test', '[', 'ping', 'mkrd', 'xd', and TFTP 'get' and 'put' + See the new NuttShell User Guide for additional information. + +Other less critical bugs were also fixed and other less important +features were were added. See the ChangeLog for details. + +These changes were verified only on the Neuros OSD (ARM9). Please +report any errors to me. + +This tarball contains a complete CVS snapshot from September 8, 2008. + +nutt-0.3.15 +----------- + +This is the 27th release of NuttX. This release includes some new features: + +* Adds support for the ROMFS filesystem +* ROMFS supports mmap() to provide eXecute In Place (XIP) capability +* NuttShell (NSH) can be configured to use ROMFS to provide a tiny read-only + filesystem with a startup script in /etc. +* Completed the basic port of the NXP LPC2148 on the mcu123.com board. + The basic port includes successful booting, timer interrupts, + serial console, successfully passing the examples/ostest, and a + NuttShell (NSH) configuration. + +These changes were verified only on the mcu123.com NXP LPC2148 +board. Please report any errors to me. + +This tarball contains a complete CVS snapshot from September 20, 2008. + +nutt-0.3.16 +----------- + +This is the 28th release of NuttX. This release includes the first +support for USB in NuttX. A set of USB APIs were added to support +USB device controller drivers and bindings to USB device class +drivers. The form of the interface was inspired by the Linux Gadget APIs. + +At present USB device controller drivers are included for: + * The NXP LPC214x. This driver has been verified and is an early alpha + stage in quality. + * TI DM320. Coding for this driver is complete but it is completely + untested as of this release. + +A controller-independent class driver is also included for: + * USB serial class device driver (emulates the Prolific PL2303 + serial-to-USB adapter). This driver has only been verified with + the Linux host PL2303 driver. + +Other new features include: + * Add an option to set aside a separate stack for interrupt + handling (ARM only). This is useful when memory is constrained, + there are multiple tasks, and the interrupt stack requirement + is high (as when USB is enabled). + +A few bugs were also fixed: + * Fixed the frequency of system timer interrupts in the NXP LPC214x port + (off by 20x in nuttx-0.3.15) + * Fixed serial driver bugs related to (1) open counts and (2) recognizing + O_NONBLOCK on read. + * Fixed an error in read(); it was not setting the errno on errors returned + from the driver. + +These changes were verified only on the mcu123.com NXP LPC2148 board +using with a Linux host. Please report any errors to me. + +This tarball contains a complete CVS snapshot from October 10, 2008. + +UPDATE +------ +This release does not build for the ARM target when USB is disabled. +Here is the fix: + +Index: arch/arm/src/common/up_internal.h +=================================================================== +RCS file: /cvsroot/nuttx/nuttx/arch/arm/src/common/up_internal.h,v +retrieving revision 1.13 +diff -u -r1.13 up_internal.h +--- arch/arm/src/common/up_internal.h 6 Oct 2008 16:20:52 -0000 1.13 ++++ arch/arm/src/common/up_internal.h 13 Oct 2008 20:48:21 -0000 +@@ -200,7 +200,8 @@ + extern void up_usbinitialize(void); + extern void up_usbuninitialize(void); + #else +-# define up_netinitialize() ++# define up_usbinitialize() ++# define up_usbuninitialize() + #endif + + #endif /* __ASSEMBLY__ */ + +NuttX-0.3.17 +------------ + +This is the 29th release of NuttX. This release includes the +additional support for USB in NuttX. The following new features +were added: + +* Added support for SPI-based MMC/SD cards (with an SPI driver + for the NXP LPC214x). +* Added USB storage class device side driver (BBB) +* Added an example that demonstrates the USB storage class by + exporting the SPI based MMC/SD card on the NXP LPC214x. + +This is an early alpha release of these drivers. At present they +only work with debug features enabled so there are probably some +race conditions that occur only with debug features disabled. +(Anyone out there with a USB analyzer? I would love to know what +is happening.) + +Several important bugs were also fixed in the FAT file system, USB +serial driver and NXP LPC214x USB controller driver. (See the ChangeLog +for details.) + +These changes were verified only on the mcu123.com NXP LPC2148 board +using a Linux development environment. USB testing was performed +using both a Linux host and a WinXP host. Please report any errors +to me. + +This tarball contains a complete CVS snapshot from October 28, 2008. + +NuttX-0.3.18 +------------ + +This is the 30th release of NuttX. This release includes two +partially completed ports, several new features, and a couple of +important bug fixes. The two partially completed ports are: + + * The STMicro STR71x processor and configuration for the Olimex + STR-P711 board. + * The Hitachi SH-1 using the SH1_LCEVB1 (SH-1/US7032EVB1) board + +Progress on these ports is stalled (as detailed in the ChangeLog). + +The new features focus primarily on management of block devices and +extensions of the NuttShell (NSH). These include: + + * A loop device that converts a file into a block device. + * A block to character (BCH) driver that allow access a block device as + if it were character device. + * Added strcasecmp() and strncasecmp() libc functions. + * Added the 'dd' and 'losetup' commands to NSH. These commands + (along with mkfatfs and mount), give good management of filesystems + on the target. + +Several bugs were fixed, the most important of which are: + + * Fixed a race condition workaround delay in LPC214X SPI logic. + This was also the cause of some bad MMC/SD performance on that + platform. + + * Fixed a recently introduced FAT file system problem: It would + mount a (invalid) FAT file system even if the medium is not formatted! + + * Corrected two other important errors in the FAT lseek() implementation: + 1 - The sectors-per-cluster value was being reset to "1". + 2 - Important lseek logic was omitted when the seek position was zero. + +The FAT filesystem has had many bugs fixed in it and, I think, is +now maturing and becoming stable. + +These changes were verified only on the mcu123.com NXP LPC2148 +board, the Hitachi SH1_LCEVB1 board, and the Linux simulator, all +using a Linux development environment. Please report any errors +to me. + +This tarball contains a complete CVS snapshot from November 16, 2008. + +NuttX-0.3.19 +------------ + +This is the 31st release of NuttX. This release includes the +following new feature: + + * Add poll() and select() APIs that may be used to monitor for + data availability on character devices or TCP/IP sockets. + * Implemented support TCP/IP connection backlog. This allows + select() to wake-up on new connections to a listener socket. + * Added definition of a framebuffer driver and implement framebuffer + drivers for the simulated platform and the TI DM320 (untested + as of the initial check-in). + * Partially developed a graphics framework based on the framebuffer + drivers, however, this will not be ready for use for a few more + releases. Currently this includes only a few color conversion + routines and some rasterizing functions. A tiny windowing system + is under development but not ready for check-in yet. + * Added support for fixed precision math. + * Added support for outgoing multicast packets. + +Several bugs were fixed, the most important of which are: + + * Fixed an important bug in the TCP/IP buffering logic. When + TCP/IP read-ahead is enabled and not recv() is in-place when a + TCP/IP packet is received, the packet is placed into a read-ahead + buffer. However, the old contents of the read-ahead buffer + were not being cleared and old data would contaminate the newly + received buffer. + + * Changed the behavior of the serial driver read. It now returns + data as it is available rather than waiting for the full requested + read size. This makes functions like fgetc() work much more + smoothly. + +These changes were verified only on the Neuros OSD (ARM9) using a +Linux development environment. Please report any errors to me. + +This tarball contains a complete CVS snapshot from November 26, 2008. + +NuttX-0.4.0 +----------- + +This is the 32nd release of NuttX. This release adds graphics +support and a tiny windowing subsystem. That new graphics subsystem +is documented at http://nuttx.sourceforge.net/NXGraphicsSubsystem.html. +No other substantial changes were made. + +These changes were verified only on the NuttX simulation platform +with X11 windows simulating a device framebuffer. Please report any +errors to me. + +The version number was bumped up to 0.4.0 in part to reflect the +new graphics subsystem, but also to recognize the NuttX is approaching +complete functionality. In the 0.3.x versions, network support was +added, Pascal P-code runtime support was added, FAT and ROMFS +filesystems were added, MMC/SD and USB device support were added. +There were also numerous extensions to the NuttShell, NuttX APIs, +and architecture ports. + +This tarball contains a complete CVS snapshot from December 6, 2008. + +NuttX-0.4.1 +----------- + +This is the 33rd release of NuttX. This is a minor bugfix release. +The primary reason for this release is to correct numerous build +errors that have accumulated for the ZiLOG ZDS-II based targets. +All ZDS-II targets now build correctly (but have not been re-tested). +In addition to platform-specific build failures, this release also +adds the following features which were not tested as of the time +of the release: + + * Board support for the ZiLog ez80Acclaim! ez80f910200zco Development Kit + * ZiLOG eZ80F91 EMAC driver + +These changes were verified only on the NuttX simulation platform. +Please report any errors to me. + +This tarball contains a complete CVS snapshot from February 6, 2009. + +NuttX-0.4.2 +----------- + +This is the 34th release of NuttX. This release adds no new OS +features but does include support for two new architectures: + + * ez80Acclaim! Basic support has been integrated and verified + for the ez80f910200zcog-d board (eZ80F91-based). That basic + support includes timer interrupts and serial console. Ongoing + work includes an EMAC driver that should be integrated for the + next release nuttx-0.4.2. eZ80Acclaim! support has been in the + code base for some time, but has only just been integrated due + to toolchain issues. + + * Renesas M16C/20. Support for the Renesas SKP16C20 board has + been included in the NuttX source tree. However, as the + eZ80Acclaim!, testing and integration of that port is stalled + due to toolchain issues. + +These changes were verified only on the ZiLOG eZ80910200zcog-d +board. Please report any errors to me. + +This tarball contains a complete CVS snapshot from February 28, 2009. + +NuttX-0.4.3 +----------- + +This is the 35th release of NuttX. This release one important new +OS feature and corrects and extends the eZ80 port: + + * Priority Inheritance. The basic NuttX waiting logic was extended + to support priority inheritance. See the NuttX User Manual for + further information: + http://www.nuttx.org/NuttxUserGuide.html#priorityinheritance. + + * ez80Acclaim! Corrected several critical, show-stopping bugs on that + platform including: + - Errors in the serial driver interrupts. + - An error in the eZ80 table. + * eZ80Acclaim!: Completed integration of the eZ80F91 EMAC driver. + +These changes were verified only on the ZiLOG eZ80910200zcog-d board +and on Cygwin-based simulation platform in various configurations. +Please report any errors to me. + +This tarball contains a complete CVS snapshot from March 13, 2009. + +NuttX-0.4.4 +----------- + +This is the 36th release of NuttX. This release focuses on bugfixes +and extending and verifying certain networking features. + + * Important bugs were fixed in NSH, UDP checksum calculation, UDP + bind() behavior for port==0, the eZ80Acclaim! EMAC driver, Z80 + interrupt handling, and in the C libraries. + + * Testing was extended to further verify the tiny webserver, + DHCPD, wget(), and sendmail. + +See the Changelog for a detailed description of these changes. + +These changes were verified only on the ZiLOG eZ80910200zcog-d board +using the ZDS-II toolchain in Cygwin-based environment. Please +report any errors to me. + +This tarball contains a complete CVS snapshot from March 29, 2009. + +NuttX-0.4.5 +----------- + +This is the 37th release of NuttX. This release focuses on a few new features. + + * The basic port for the Freescale ARM920T i.MX1 processor on the + Freescale MX1ADS board. Coding is complete for this port, but + it is has not yet fully integrated + * Extended I2C and SPI interface definitions + * Add basic support for C++ applications. Very simple C++ + applications can now be built against NuttX without any external + libraries. At present, only the most primitive C++ programs + are supported, but it is hoped that this support will be extended + in future releases. + +See the Changelog for a detailed description of these changes. + +This tarball contains a complete CVS snapshot from April 19, 2009. + +NuttX-0.4.6 +----------- + +This is the 38th release of NuttX. The release features support +for the Micromint Eagle-100 development board. This board is based +around, the Luminary LM3S6918 MCU. This is the first ARM Cortex-M3 +architecture supported by Nuttx. This initial, basic port includes +timer and serial console with configurations to execute the NuttX +OS test and to run the NuttShell (NSH). Work is still underway on +this port and current plans are to have I2C, SSI, MMC/SD, and +Ethernet driver in the 0.4.7 release. + +Additional work was done on the MXADS i.MX1 port, however, that +work has been set aside until I complete work on the Eagle-100 (I +also need to come up with a 3V power supply). + +Other changes in this release include: Extensions to the SPI interface +definition in order to handle 9-bit interfaces to displays. Several +bugs were fixed (see the ChangeLog for a complete list of changes). + +This tarball contains a complete CVS snapshot from May 19, 2009. + +NuttX-0.4.7 +----------- + +This is the 39th release of NuttX. This release focuses on cleaning +up and extending the Eagle100/LM3S6918 port released in nuttx-0.4.6 +and on improved MMC/SD support. New features include: + + * Improved reliably and additional drivers for the Eagle-100 board + (LM3S6918 ARM Cortex-M3). Additional drivers include Ethernet, + SSI, and support for the on-board LEDs and microSD cards. + + * The SPI-based MMC/SD driver was extended to support SDHC Version + 2.xx cards. + +In addition, this release includes several important bugfixes for +the LM3S6918, the LPC2148, the SPI-based MMC/SD driver, and to +FAT32. See the ChangeLog for details of these bugfixes. + +This tarball contains a complete CVS snapshot from May 29, 2009. + +NuttX-0.4.8 +----------- + +This is the 40th release of NuttX. This release adds: + + * Support for the Olimex STRP711 board. That board is based on + the STMicro STR711 MCU (ARM7TDMI). Integration is complete on + the basic port (boot logic, system time, serial console). Two + configurations have been verified: (1) The board boots and + passes the OS test with console output visible on UART0, and + the NuttShell (NSH) is fully functional with interrupt driven + serial console. An SPI driver is available but untested (because + the Olimex card slot appears to accept only MMC cards; I have + only SD cards). Additional needed: USB and driver, MMC + integration. + + * Support for the CodeSourcery and devkitARM Windows-native GNU + toolchains. Makefiles have been modified for the LM3S6918, + LPC2148, and STR711 to support these toolchains under Cygwin. + +This tarball contains a complete CVS snapshot from June 13, 2009. + +NuttX-0.4.9 +----------- + +This is the 41st release of NuttX. This release adds: + + * Support for a new binary format call NXFLAT that can be used to + execute separately linked programs in place in a file system. + See http://www.nuttx.org/NuttXNxFlat.html. + + * Several important bugs were files related to networking and ROMFS. + See the ChangeLog for a complete list. + +This tarball contains a complete CVS snapshot from June 26, 2009. + +NuttX-0.4.10 +----------- + +This is the 42nd release of NuttX. This released focused on the +port of Jeff Poskanzer's THTTPD HTTP server (see +http://acme.com/software/thttpd/). As of the 0.4.10 release, that +port is still not fully complete and functional. However, numerous +related bug-fixes and functional additions for THTTPD were added: + + * Several new standard C-library functions (fileno, strstr, + strpbrk, fcntl). + * Improved and extended timing APIs (mktime, gmtime, gmtime_r, + gettimeofday, localtime, localtime_r, and strftime) + * Networking enhancements: recvfrom() and accept() now work with + non-blocking sockets. + * NXFLAT extensions (exec) + * Pattern matching logic. + * And miscellaneous bug fixes (see the ChangeLog for details). + +This tarball contains a complete CVS snapshot from August 8, 2009. + +NuttX-0.4.11 +------------ + +This is the 43rd release of NuttX. This release of NuttX incorporates +the verified port of Jeff Poskanzer's THTTPD HTTP server (see +http://acme.com/software/thttpd/). Many of the key features of +THTTPD have been tested on the Micromint Eagle-100 development board +(Cortex-M3). These tests verify: + + * Serving of files from any file system + * Execution of CGI executable. This release supports execution + of NXFLAT executables on a ROMFS file system + (http://www.nuttx.org/NuttXNxFlat.html) + +A standard CGI interface is used: Information is pasted to the CGI +program via POST commands and via environment variables. CGI socket +I/O is redirected to stdin and stdout so that the CGI program only +need to printf() to send its content back to the HTTP client. + +Another value to this THTTPD integration effort has been that THTTPD +has provided a very good test bed for finding NuttX networking bugs. +Several very critical networking bugs have been fixed with this +0.4.11 release (see the ChangeLog for details). Networking throughput +has also been greatly improved. Anyone using NuttX networking +should consider upgrading to this release. + +This tarball contains a complete CVS snapshot from September 16, 2009 + +NuttX-0.4.12 +------------ + +This is the 44th release of NuttX. This release adds basic support +for the STMicro STM32, Cortex-M3 MCU. The specific port is to the +STMicro STM3210E-EVAL development board based around the STM32F103ZET6 +MCU. Some highlights of this port: + + * This basic port includes boot-up logic, interrupt driven serial + console, and system timer interrupts. + * Includes a basic STMicro RIDE7 project that can be used to + perform basic STM32 board bring-up (due to RIDE7 size limitations, + it cannot be used for the full NuttX bring-up). + * Working, Tested Configurations: the NuttX OS test and the + NuttShell (NSH) example. + +This basic STM32 port will be extended in the 0.4.13 NuttX release. +Functionality needed for complete STM32 support includes: USB +device driver, LCD driver and NX bringup on the development board's +display and MicroSD support. An SPI driver and a DMA support was +included in this 0.4.12 release, but is not yet tested. + +This tarball contains a complete CVS snapshot from October 17, 2009 + +NuttX-0.4.13 +------------ + +This is the 45th release of NuttX. The release extends the support +for the STMicro STM32 microcontroller. Minimal support for the +STM3210E-EVAL development board based around the STM32F103ZET6 MCU +was released in NuttX-0.4.12. This release adds: + + * A simple interface definition to support some FLASH, EEPROM, + NVRAM, etc. devices. + * Verified SPI operation using driver for SPI based FLASH parts + M25P64 and M25P128. + * Improved Cortex-M3 context switching. This should improve + context switching performance be 2x in certain cases. + * Added a USB device-side driver for the STM32. This is an early + release of a very complex driver; some bugs are expected. + * The USB driver has been verified against the USB serial device + class driver. There is at least one known outstanding issue + (see the full bug description in the TODO list). + +This release also corrects some important bugs in the early STM32 release: + + * Fixed several errors the prevented operation of NuttX on an + STM32 development board using USART2 as the serial console. + * Fixed and optimization-dependent race condition in the clock + initialization. + * Fixed a critical bug in the interrupt control logic that could + cause interrupt operations to failed used for interrupts in a + certain range. + +This tarball contains a complete CVS snapshot from November 4, 2009 + +NuttX-4.14 +---------- + +This is the 46th release of NuttX. The release extends the support +for the STMicro STM32 microcontroller. Minimal support for the +STM3210E-EVAL development board based around the STM32F103ZET6 MCU +was released in NuttX-0.4.12 and extended in Nuttx-0.4.13 to include +initial USB support. This completes the STM32F103ZET6 and adds: + +New Generic RTOS Features: + + * Added generic support that can be included in any block driver + to provide read-ahead buffering and write buffering for improved + driver performance. + * Added a generic worker thread that can used to defer processing + from an interrupt to a task. + * Defined a generic SD/SDIO interface can can be bound to a MMC/SD + or SDIO driver to provide SDIO support. + * Implemented a an SDIO-based MMC/SD driver using this new SDIO + interface. + +New STM32 Features: + + * Add support to configure an STM32 input GPIO to generate an + EXTI interrupt. + * Added support for buttons on the STM3210E-EVAL board. + * Implemented an STM32 version of the common the SDIO interface. + * Added a configuration to exercise the STM32 with the USB mass + storage device class example. + +This release also corrects some important bugs in the early STM32 release: + + * Correct error handling in the mount() logic. + * Fixed several STM32 DMA-related issues. Integrated and debugged + STM32 DMA functionality that was added in 0.4.12. + * Fixed several bugs in the STM32 USB device-side driver. + +NOTE: This version, 4.14, is equivalent to what would have been +called 0.4.14 to follow 0.4.13. The zero has been eliminated from +the front of the version number to avoid confusion about the state +of development: Some have interpreted the leading zero to mean +that the code is in some way unstable. That was not the intent. +Beginning in January 2010, I will switch to the 2010.nn versioning +as many others have done to avoid such confusion. + +This tarball contains a complete CVS snapshot from December 2, 2009 + +NuttX-5.0 +--------- + +This is 47th release of NuttX and the successor to nuttx-4.14. This +major revision number has been incremented to indicate that an +incompatibility with previous nuttx releases has been introduced. +This version adopts standard fixed width integer names as specified +by the ANSI C99 standard. The core logic of NuttX is older than +that standard and did not conform to it. + +If you have applications running on NuttX-4.14, those applications +should continue to build and execute without problem on NuttX-5.0. +However, if you have device drivers or other OS-internal logic, you +will probably have to make some minor changes to your code to use +this version. Below is a summary of those changes: + + * If you include sys/types.h to get the non-standard, fixed width + integer types (uint32, uint16, ubyte, etc.), that is no longer + necessary. + * Instead, you will need to include stdint.h where the new fixed + width integer types are defined (uint32_t, uint16_t, uint8_t, etc). + * You will have to change all occurrences of the following types: + + uint32 -> uint32_t + uint16 -> uint16_t + ubyte -> uint8_t + uint8 -> uint8_t + sint32 -> int32_t + sint16 -> int16_t + sint8 -> int8_t + + * In addition, the non-standard type 'boolean' must replaced with + the standard type 'bool'. The type definition for 'bool' is in + stdbool.h + +This change in typing caused small changes to many, many files. It +was verified that all configurations in the release still build +correctly (other than the SDCC-based configurations). Regression +testing was performed on a few configurations, but it is possible +that minor build issues still exist. (If you encounter any, please +let me know and I will help you to fix them.) + +In the course of the regression testing, several important bugs +unrelated to the type changes were found and corrected. + + * Fixed an important error in the RX FIFO handling logic of the + LM3S6918 Ethernet driver. + * Corrected the handling of TCP sequence numbers in the TCP stack. + * And other less important bugs as detailed in the ChangeLog. + +The primary focus of this release was standards compatibility, but +a few new features were added including a (1) Flash Translation +Layer (FTL) that will support filesystems on a FLASH device and (2) +partial ports for the STM32F107VC and HCS12 C9S12NE64 MCUs. Those +ports are very incomplete as of this writing. + +This tarball contains a complete CVS snapshot from December 21, 2009 + +NuttX-5.1 +--------- + +This is the 48th release of NuttX. This release adds support for +two new MCU architectures in various states of development: + +* AT91SAM3U (http://www.atmel.com/products/at91/sam3landing.asp?family_id=605) + + This release adds support for the SAM3U-EK development board with + the AT91SAM3U4E MCU + (http://www.atmel.com/dyn/products/product_card_mcu.asp?part_id=4562). + As with most NuttX architecture releases, the release will be + rolled out in two parts: A basic port and an extended port. + + NuttX-5.1 includes the basic port for the SAM3U-EK board. This + release passes the NuttX OS test and is proven to have a valid + OS implementation. It supports the basic boot-up, serial console + and timer interrupts. A configuration to support the NuttShell + is also included. + + The extended port will also include support for SDIO-based SD + cards and USB device (and possible LCD support). These extensions + may or may not happen by the Nuttx 5.2 release as my plate is + kind of full now. + +* LPC3131 (http://ics.nxp.com/products/lpc3000/lpc313x.lpc314x.lpc315x/) + + This release also adds the complete implementation of the basic + port for the NXP LPC3131 MCU on the Embedded Artists EA3131 board + (http://www.embeddedartists.com/products/kits/lpc3131_kit.php). + That port, unfortunately has stalled due to tools issues. Those + tool issues have been resolved and I am confident that the verified + basic port will be available in NuttX-5.2. + + The extended release will follow and should include SDIO-based + SD card support and device USB. + +A few additional features and bugfixes of a minor nature were also +incorporated as detailed in the ChangeLog. + +NuttX-5.2 +--------- + +This is the 49th release of NuttX. This release completes the +verification of the basic port for the NXP LPC3131 MCU on the +Embedded Artists EA3131 board +(http://www.embeddedartists.com/products/kits/lpc3131_kit.php). +This basic port includes basic boot-up, serial console, and timer +interrupts. This port has been verified on the using the NuttX OS +test and includes a working implementation of the NuttShell (NSH). + +An extended release will follow and should include SDIO-based SD +card support and device USB. + +NuttX-5.3 +--------- + +This is the 50th release of NuttX. This release support for one new +architecture: + + * A basic port for the NXP LPC2378 MCU on the Olimex-LPC2378 + development board was contributed by Rommel Marcelo. + +And extensions to two existing architectures: + + * David Hewson contributed a dual-speed (full/high) USB device-side + driver for the NXP LPC3131 on the Embedded Artists EA3131 + development board. + + * A DMA driver and a high speed MCI driver for the Atmel AT91SAM3U + are included (but not fully tested in this release). + +Two important bugfix was also included: + + * An important fix to the USB mass storage driver was contributed + by David Hewson. + * A serious error in the AT91SAM3U PIO handling was fixed. + +NuttX-5.4 +--------- + +This is the 51st release of NuttX. This release includes one new, +important extension to th NX graphics system (See +http://www.nuttx.org/NXGraphicsSubsystem.html). + +NX was develop a couple years back on hardware that supported only +framebuffer devices, that is, video hardware with video memory +directly converts the memory content to video. However, most MCUs +that NuttX focuses on do not support such video memory; rather, +that typically only support LCDs via parallel or serial interfaces. + +This release of NuttX extends NX so that now renders directly to +the LCD device via its serial or parallel interface. No in-memory +copy of the screen memory need be maintained so this solution should +also work in MCUs with very limited SRAM. + +This initial release of this feature includes the verified NX +extensions plus a driver for the HX8347, 16-bit parallel LCD. This +LCD supports 16-bit RGB (5:6:5). + +NuttX-5.5 +--------- + +This is the 52nd release of NuttX. This release includes one new +port, some new drivers and some important bugfixes: + + * NuttX was ported to the Luminary/TI LM3S6965 Ethernet Evaluation + Kit. At present, that port includes an OS test configuration + and a NuttShell (NSH) configuration with Telnet support. + + MMC/SD and Networking support are provided but not thoroughly + verified in this release: Current development efforts are focused + on porting the NuttX window system (NX) to work with the + Evaluation Kits OLED display. + + * A NuttX Ethernet driver for the Microchip ENC28J60 SPI Ethernet + chip is available in the source tree (but has not yet been fully + verified because I haven't properly connected it to hardware + yet). + + * The Olimex STR-P711 NuttX port was extended to support the + ENC28J60 and some new networking configurations were added. + The ENC28J60 has not been tested on the STR-P711, however, + because of hardware issues (I don't think the USB powered board + provides enough power for the ENC28J60 and I don't have the + right wall wart yet). + + Along the way, external interrupt support (XTI) was added to + the STMicro STR-P711 port and some important bugs were fixed + in the STR-P711 SPI driver. + + * Added (optional) floating point support for printf(). + (Contributed by Yolande Cates.) + + * Corrected an important UDP reference counting error. It was + not a serious error, but it trigger an assertion was IS a serious + error. + +NuttX-5.6 +--------- + +This is the 53rd release of NuttX. This release includes one several +new drivers for existing NuttX ports: + + * This port adds support for the RiT displays P14201 4-bpp, + greyscale OLED. 4-bpp greyscale support was integrated into + the NX graphics sub-system and verified using the TI/Luminary + LP3S6965 Ethernet Evaluation Kit. + + * The M25Px driver was extended for the M24P1 FLASH part (see NOTE). + + * An I2C driver and (basic) SPI driver were added for the NXP + LPC313x port. The I2C interface definition was extended to + efficiently handle multiple I2C transfers. + (Contributed by David Hewson.) + +As well as a few, important USB-related bugfixes (See the ChangeLog +for details). + +This release also includes the beginnings of a port for the NXP +LPC1768 MCU. However, it is too early for that port to be useful +(stay tuned for a future announce of the availability of the LPC1768 +port). + +NuttX-5.7 +--------- + +This is the 54th release of NuttX. This release adds basic support +for one new ARM Cortex-M3 architecture: + + * Added support for NXP LPC1768 MCU as provided on the Nucleus + 2G board from 2G Engineering (http://www.2g-eng.com). + * Some initial files for the LPC17xx family were released in NuttX + 5.6, but the first functional release for the NXP LPC1768/Nucleus2G + occurred with NuttX 5.7. + * That initial basic release included timer interrupts and a + serial console and was verified using the NuttX OS test. + * That release includes a verified NuttShell (NSH) configuration + (see the http://www.nuttx.org/NuttShell.html). + * Also included are unverified SPI and USB device drivers. + +Further efforts include: + (1) development of a DMA support library + (2) SPI-based MMC/SD support + (3) verification of the USB driver + +Watch for announcement of the completed LPC1768 port expected in +NuttX-5.8. + +NuttX-5.8 +--------- + +This is the 55th release of NuttX. This includes several important +bugfixes: + + * Corrects some interrupt vectoring for the TI/Stellarix LM3S + port + * Correct initialization logic for NXP LPC17xxx NuttX ports: + Power was not being provided to the GPIO module! + * Corrected (but did not verify) implementation of the optional + interrupt stack feature (all Cortex M3 architectures). + * Correct a HardFault in the LPC17xx SSP driver. + +Additional minor fixes are also included as detailed in the ChangeLog. + +Several new features have been fully developed and included in this +release, but full verification of most of these new features has +been blocked for a variety of issues: + + * Added microSD support for the NuttShell (NSH) configuration in + the Nucleus2G LPC1768 port. For reasons that have not yet been + determined, I have not successfully accessed the microSD card + as of this writing. + * Two USB configurations were also added for the Nucleus2G board: + One to support the USB serial device and one for the USB mass + storage device. Some testing of the USB driver was performed, + but full verification is stalled for an OTG style USB cable. + * LEDs now work correctly on the Nucleus2G LPC1768 board. + * The NuttX/uIP networking subsystem now supports IGMPv2 client. + IGMP (Internet Group Multicast Protocol) network "appliances" + to join into multicast groups. Outbound traffic to enter and + leave multicast groups has been verified, but full verification + will require a switch capable of multicast. Issues associated + with the receipt of multicast packets are likely. + +NuttX-5.9 +--------- + +This is the 56th release of NuttX. This release is difficult to +categorize; NuttX-5.9 was really released because there were too +many changes accumulating in CVS -- a few important, some unfinished +implementations, and a couple of important bugfixes. + + * By far biggest change in this release is the complete implementation + of on-demand paging support. This feature will allow you to + execute large programs on a mass storage device (such as SPI + FLASH) in a small RAM. All of the core on-demand paging logic + was completed (see http://www.nuttx.org/NuttXDemandPaging.html) + and support was implemented for the ARM-9 family. A test + configuration is in place for the NXP LPC3131. It has been + verified that this new logic does not interfere with normal + fixed-page ARM9 operation, but otherwise this new on-demand + paging feature is untested. + * Add support for the CodeSourcery toolchain to the Olimex-lpc2378 + port and for the Neuros OSD port. + * The Neuros OSD port has been updated to work with the production + v1.0 OSD (previously it only worked with the development board). + * And some miscellaneous feature enhancements as detailed in the + ChangeLog. + +This includes several important bugfixes: + + * NXP LPC17xx - Fixed a critical bug in the GPIO configuration + logic: When attempting to set no pull-up or pull-down (floating), + it would, instead, select pull-down. + + * TI/Luminary LM3Sxxxx - Fixed: + (1) A logic error in an address table lookup. + (2) GPIO port encoding the limited support to only 8 GPIO ports. + + * Corrected the lease time in the DHCPC implementation: It was + not in host byte order. + + * And several other less important bugs as documented in the + ChangeLog: Warnings, cornercase compilation problems, etc. + +NuttX-5.10 +---------- + +This is the 57th release of NuttX. This release includes a combination +of some new features as well as several bugfixes. New features +include: + + * TI/Luminary Stellaris LM3S9B96: + Header file changes contributed by Tiago Maluta. + * TI/Luminary Stellaris LM3S8962: + Header file changes and support for the Stellaris LM3S8962 + Ethernet+CAN Evaluation Board contributed by Larry Arnold. + * On-Demand Paging Support: + The basic logic for the On-Demand Paging feature is complete, + implemented for the NXP LPC3131, and partially tested. See + http://www.nuttx.org/NuttXDemandPaging.html. Some additional + test infrastructure will be needed in order to complete the + verification. See configs/ea3131/README.txt for details. + * Two Pass Build Support: + The make system now supports a two pass build where a relocatable, + partially linked object is created on the first pass and that + object is linked with the NuttX libraries to produce the final + executable on the second pass. This two pass build is currently + only used to support the On-Demand paging feature: The first + pass link forces critical logic into the locked text region; + the second pass builds the NuttX executable more-or-less as + normal. + * CONFIG_APP_DIR: + Generalized the way in which applications are built and linked + with NuttX. The new configuration CONFIG_APP_DIR replaces + CONFIG_EXAMPLE. CONFIG_EXAMPLE used to identify the sub-directory + within the NuttX examples/ directory that held the example + application to be built. That made it awkward to configure to + build an application that resides outside of the NuttX examples/ + directory. CONFIG_APP_DIR is more general; it can be used to + refer to any directory containing the application to be built. + + For people who have their own configurations and/or Makefiles, + you will need to make a couple of changes: + + - Replace all occurrences of CONFIG_EXAMPLE=foobar with + CONFIG_APP_DIR=examples/foobar in all of the configuration + files. + - Replace any occurrences of examples/$(CONFIG_EXAMPLE) with + $(CONFIG_APP_DIR) + - Replace any occurrences of lib$(CONFIG_EXAMPLE)$(LIBEXT) + with libapp$(LIBEXT) in your Makefiles. + - Check any other occurrences of CONFIG_EXAMPLE. + + * Several bugfixes are included as well as code changes to eliminate + some warnings. See the ChangeLog for details. + +NuttX-5.11 +---------- + +This is the 58th release of NuttX. This is a bugfix release. + + * One very important bug fixes a race condition that can occur + using semaphores that can be awakened by signals. Under this + particular race condition, a task could hang waiting for a + semaphore. + * Corrections to lm3s8962 port contributed by Larry Arnold. That + port is purported to work correctly with these changes in place. + +Plus less critical bugfixes as detailed in the ChangeLog. New features +include: + + * A new configuration to support the mbed.org LPC1768 board. + (Contributed by Dave Marples.) + * A driver for the Atmel AT45DB161D 4Mbit SPI FLASH part + +NuttX-5.12 +---------- + +This is the 59th release of NuttX. This is a critical bugfix release. + + * Fixed an important error in the signal trampoline logic. + Essentially, interrupts are re-enabled while the signal handler + executes, but the logic to re-disable the interrupts before + returning from the signal handler trampoline was missing. Under + certain circumstances, this can cause stack corruption. This + was discovered by David Hewson on an ARM9 platform, but since + the code has been leveraged, the bug has been propagated from + ARM to Cortex-M3, AVR32, M16C, SH1, ZNEO, eZ80, Z8, and Z80 -- + almost every architecture. The correction has been incorporated + for all architectures but only verified on a few. + +Other notable changes in NuttX-5.12: + + * A complete port for the AVR32 (AT32UC3B0256) is incorporated + in the source tree. Testing of this port is underway now. This + release was made before verifying this port in order to get the + important bugfix in place. + + * Other miscellaneous bugfix and enhancements as noted in the + ChangeLog. + +NuttX-5.13 +---------- + +This is the 60th release of NuttX. Headlines for this release +include: + + * AVR32, www.mcuzone.com AVR32DEV1 + + The port for the www.mcuzone.com AVRDEV1 board based on the + Atmel AT32UC3B0256 MCU was (almost) fully integrated. The port + now successfully passes the NuttX OS test (examples/ostest). + A NuttShell (NSH) configuration is in place (see the NSH User + Guide at http://www.nuttx.org/NuttShell.html). Testing of that + NSH configuration, however, has been postponed (because it got + bumped by the Olimex LPC1766-STK port -- see below) + + Current Status: I think I have a hardware problem with my serial + port setup. There is a good chance that the NSH port is complete + and functional, but I am not yet able to demonstrate that. At + present, I get nothing coming in the serial RXD line (probably + because the pins are configured wrong or I have the MAX232 + connected wrong). + + A complete port will include drivers for additional AVR32 UC3 + devices -- like SPI and USB --- and will be available in a + later release, time permitting. + + * LPC1766, Olimex LPC1766-STK + + Support for the Olimex-LPC1766 is newly added to NuttX and is + still undergoing development, test, and integration. Verified + configurations for the NuttX OS test and for the NuttShell (NSH, + see the NSH User Guide at http://www.nuttx.org/NuttShell.html. + Additional USB configurations are in the release as well, but + they have not yet been verified. Goals for NuttX-5.14 include: + (1) An Ethernet driver, (2) Verified USB support, and (3) SD + card support. + + * Additional changes and bugfixes as detailed in the ChangeLog. + +NuttX-5.14 +---------- + +The 61st release of NuttX, NuttX-5.14, was made on November 27, +2010. This release includes multiple, important bugfixes as well +as a new driver for the NXP LPC1766. + +This release corresponds with SVN release number: r3137 + +Important bugfixes include: + + * Cortex-M3 Hard Fault. Fixed a hard fault problem that can occur + if certain types of interrupts are pending at the time another + interrupt returns. This problem has only been observed on the + LPC1766 (returning from a SYSTICK interrupt with a pending + Ethernet interrupt). However, it is assumed that all Cortex-M3 + ports could have this as a latent bug. + + * TCP/IP Sequence Number Bug. Corrected errors some important + logic in the way that sequence numbers are managed when send() + sends out packets before a previous packet has been acknowledged. + Some of that send() logic was incompatible with logic in the + uIP layer. Errors seen include: (1) The final final packet in + a sequence of packets might be too large! In the THTTPD example, + this might leave some garbage at the bottom of the display. Or + (2) send() might hang with outstanding, unacknowledged data + (and with no re-transmission requests). This was due to + differences in sequence number handling in send() and in + uip_tcpinput.c; uip_tcpinput.c thought (incorrectly) that all + of the bytes were acknowledged; send.c knew that they were not. + + * One-Shot POSIX Timer Bug. Fixed an error in set-up of a one-shot + POSIX timer. It was using the repetitive timer value (which + is zero in the one-shot case), always resulting in a 10Ms timer! + Found and fixed by Wilton Tong. + +Additional support has been included for the Olimex-LPC1766. Support +for that board was added to NuttX 5.13. This release extends that +support with an Ethernet driver. Verified configurations are now +available for the NuttX OS test, for the NuttShell (NSH, see +http://www.nuttx.org/NuttShell.html), for the NuttX network test, +and for the THTTPD webserver. (Additional USB configurations are +in the release as well, but those have not yet been verified. Goals +for NuttX-5.15 (and beyond) include: (1) Verified USB support, (2) +SD card support, and (3) LCD support. + +NuttX-5.15 +---------- + +The 62nd release of NuttX, NuttX-5.15, was made on December 12, +2010. This release includes several bugfixes as well as feature +enhancements, primarily for the Olimex LPC1766-STK board. + +Important bugfixes included: + + * Additional fixes needed with the TCP sequence number problem + "fixed" in NuttX-5.14. + * In the send() logic, now checks if the destination IP address + is in the ARP table before sending the packet; an ARP request + will go out instead. This improves behavior, for example, on + the first on the first GET request from a browser + * All USB class drivers need to call DEV_CONNECT() when they are + ready to be enumerated. That is, (1) initially when bound to + the USB driver, and (2) after a USB reset. + * The SPI_SETBITS macro was calling the SPI setmode method. + * And several other bug fixes of lower importance (see the + ChangeLog for details). + +And feature enhancements: + + * The LPC176x Ethernet driver was using all of AHB SRAM Bank0 for + Ethernet packet buffers (16K). An option was added to limit + the amount of SRAM used for packet buffering and to re-use any + extra Bank0 memory for heap. + + * Enabled networking and SD/MMC card support in the Olimex + LPC1766-STK NuttShell (NSH) configuration. + + * The LPC176x USB driver is now fully fully functional. + * Added an optional cmddata() method to the SPI interface. Some + devices require an additional out-of-band bit to specify if the + next word sent to the device is a command or data. The cmddata + method provides selection of command or data. + + * A driver for the Nokia 6100 LCD (with either the Phillips PCF8833 + LCD controller and for the Epson S1D15G10 LCD controller) and + an NX graphics configuration for the Olimex LPC1766-STK have + been added. However, neither the LCD driver nor the NX + configuration have been verified as of the this release. + +NuttX-5.16 +---------- + +The 63rd release of NuttX, Version 5.16, was made on January 10, +2010 and is available for download from the SourceForge website. +This release includes initial support for USB host in NuttX. The +USB host infrastructure is new to NuttX. This initial USB host release +is probably only beta quality; it is expected the some bugs remain +in the logic and that the functionality requires extension. + +Below is a summary of the NuttX USB host implementation as extracted +from the NuttX Porting Guide: + + 6.3.9 USB Host-Side Drivers + * include/nuttx/usb/usbhost.h. All structures and APIs needed to + work with USB host-side drivers are provided in this header + file. + * struct usbhost_driver_s. Each USB host controller driver must + implement an instance of struct usbhost_driver_s. This structure + is defined in include/nuttx/usb/usbhost.h. Examples: + arch/arm/src/lpc17xx/lpc17_usbhost.c. + * struct usbhost_class_s. Each USB host class driver must implement + an instance of struct usbhost_class_s. This structure is also + defined in include/nuttx/usb/usbhost.h. Examples: + drivers/usbhost/usbhost_storage.c + * USB Host Class Driver Registry. The NuttX USB host infrastructure + includes a registry. During its initialization, each USB host + class driver must call the interface, usbhost_registerclass() + in order add its interface to the registry. Later, when a USB + device is connected, the USB host controller will look up the + USB host class driver that is needed to support the connected + device in this registry. Examples: drivers/usbhost/usbhost_registry.c, + drivers/usbhost/usbhost_registerclass.c, and + drivers/usbhost/usbhost_findclass.c, + * Detection and Enumeration of Connected Devices. Each USB host + device controller supports two methods that are used to detect + and enumeration newly connected devices (and also detect + disconnected devices): + + int (*wait)(FAR struct usbhost_driver_s *drvr, bool connected); + Wait for a device to be connected or disconnected. + + int (*enumerate)(FAR struct usbhost_driver_s *drvr); + Enumerate the connected device. As part of this enumeration + process, the driver will (1) get the device's configuration + descriptor, (2) extract the class ID info from the configuration + descriptor, (3) call usbhost_findclass() to find the class + that supports this device, (4) call the create() method on + the struct usbhost_registry_s interface to get a class instance, + and finally (5) call the connect() method of the struct + usbhost_class_s interface. After that, the class is in charge + of the sequence of operations. + * Binding USB Host-Side Drivers. USB host-side controller drivers + are not normally directly accessed by user code, but are usually + bound to another, higher level USB host class driver. The class + driver exports the standard NuttX device interface so that the + connected USB device can be accessed just as with other, similar, + on-board devices. For example, the USB host mass storage class + driver (drivers/usbhost/usbhost_storage.c) will register a + standard, NuttX block driver interface (like /dev/sda) that can + be used to mount a file system just as with any other other + block driver instance. In general, the binding sequence is: + + 1. Each USB host class driver includes an initialization entry + point that is called from the application at initialization + time. This driver calls usbhost_registerclass() during this + initialization in order to makes itself available in the + event that the device that it supports is connected. Examples: + The function usbhost_storageinit() in the file + drivers/usbhost/usbhost_storage.c + 2. Each application must include a waiter thread thread that + (1) calls the USB host controller driver's wait() to detect + the connection of a device, and then (2) call the USB host + controller driver's enumerate method to bind the registered + USB host class driver to the USB host controller driver. + Examples: The function nsh_waiter() in the file + configs/nucleus2g/src/up_nsh.c and the function nsh_waiter() + in the file configs/olimex-lpc1766stk/src/up_nsh.c. + 3. As part of its operation during the binding operation, the + USB host class driver will register an instances of a standard + NuttX driver under the /dev directory. To repeat the above + example, the USB host mass storage class driver + (drivers/usbhost/usbhost_storage.c) will register a standard, + NuttX block driver interface (like /dev/sda) that can be + used to mount a file system just as with any other other + block driver instance. Examples: See the call to + register_blockdriver() in the function usbhost_initvolume() + in the file drivers/usbhost/usbhost_storage.c. + +NuttX-5.17 +---------- + +The 64th release of NuttX, Version 5.17, was made on January 19, +2011 and is available for download from the SourceForge website. +This release follows close on the heels of the 5.16 release and +extends the USB host capabilities first introduced in that version. + + * The LPC17xx USB host controller driver was extended to (1) add + support for low-speed devices, (2) handle multiple concurrent + transfers on different endpoints (still only one TD per endpoint), + and (3) handle periodic interrupt endpoint types. + + * Add a USB host HID keyboard class driver. Now you can connect + a standard USB keyboard to NuttX and receive keyboard input for + an application. + +And other changes as detailed in the ChangeLog. + +NuttX-5.18 +---------- + +The 65th release of NuttX, Version 5.18, was made on February 27, +2011 and is available for download from the SourceForge website. +This is first release from the new NuttX SVN repository. This +release is made primarily to keep the release tarball in synchronization +with SVN. Many smaller changes have been made as identified in the +ChangeLog. Headlines include: + + * Incorporate several important uIP patches -- including the well + known patch to handle missing SYNACK. + * The Freescale mc8s12ne64 port is code complete but testing has + not yet begun due to toolchain issues. Added support for the + Future Electronics Group NE64 Badge board. + * Added support for a new STM32 board, the ISOTEL NetClamps VSN + V1.2 ready2go sensor network platform. This board is based on + a STM32F103RET6 and includes some interesting power saving/clock + control extensions. + * USB host support expanded to handle vendor specific USB devices. + * Incorporated the LUFA HID parser. + * Various bugfix as detailed in the ChangeLog + +NuttX-5.19 +---------- + +The 66th release of NuttX, Version 5.19, was made on March 12, 2011 +and is available for download from the SourceForge website. This +release includes several new features in various states of integration +and maturity: + + * 486SX QEMU port. This port supports the Intel 486SX architecture + using the QEMU simulator. Initial functionality is in place a + partially tested. There are still some outstanding issues with + timer interrupts. + * Platform specific application support. A new apps/ directory + appears in this port. This apps/ directory provides a mechanism + for applications using NuttX to have a highly customized + initialization process. It supports a set of end-user applications + than can be executed (1) standalone so you can have a fully + customized application startup, or (2) on top of NSH. Think + of it this way: In a buckled-up embedded application, your + end-user programs will probably have their own dedicated start-up + logic. But, during development, you might want to have you + applications available and executable from the NSH command line. + This apps/ add-on (and NSH hooks) was contributed by Uros to + accomplish just that. + * NSH was also extended to support application specific ROMFS + /etc/init.d/rcS start-up scripts. This feature, as well, as + all of the above-mentioned apps/ directory support was contributed + by Uros Platise + * Additional NSH improvements and bug fixes. See the Changelog + for details. + * This release also provides a new SLIP network driver. This + driver should support point-to-point network communications to + a host using TCP/IP or UDP. This driver is code complete, but + not tested in this release. + * New RAMTRON FRAM driver (contributed by Uros Platise) + * New generic 16550 UART driver. + * Cortex-M3 Power improvements: Waits for Interrupt (WFI) in idle + loop for reduced power consumption (LPC17xx and STM32 only - + contributed by Uros Platise)) + * New waitpid() system interface. + * Additional bugfixes: pipes, stdint.h, STM32 SDIO and SPI drivers + +NuttX-6.0 +--------- + +The 67th release of NuttX, Version 6.0, was made on March 21, 2011 +and is available for download from the SourceForge website. The +version number of this release was bumped from 5.19 to 6.0. A +change in the major revision number is used to reflect an incompatibility +with previous versions. In this release, the NuttX core OS +functionality has been separated from NuttX application-related +functionality. These are provided as separate tarballs: + + * nuttx-6.0.tar.gz, and + * apps-6.0.tar.gz + +The purpose of this separation is both to better organize and +modularize the NuttX source tree, but also to provide better support +for incorporation of end-user applications with Nuttx. + +The incompatibility results from the changes to the board configuration +logic needed to supported the separable application. The major +changes to the configuration include: + + * CONFIG_APPS_DIR - This should not be set. The default is + ../apps. This should only be set if you have a custom, + product-specific application directory in some different location. + + * appconfig - Each board configuration now requires a new file + called 'appconfig.' As its name suggests, this file provides + new configuration information needed by the logic in ../apps. + +In addition to this major reorganization in the directory structure, +this release also includes some important extensions to existing +features and some important bugfixes. These include: + + * The SLIP driver was been well debugged and significantly + re-designed. Now you can have an Ethernet connection to you + board even if you have no Ethernet hardware. How cool is that? + + * The QEMU i486 port is now functional. It has also been reported + to work on the Bifferboard (see http://bifferos.bizhat.com/). + + * And extensions to the uIP driver interface, and + + * Bug fixes to fopen() and STM32 GPIO configuration + +Please see the ChangeLog for details. + +NuttX-6.1 +--------- + +The 68th release of NuttX, Version 6.1, was made on April 10, 2011 +and is available for download from the SourceForge website. The +6.0 release introduced a detach-able application environment to +build applications outside of the NuttX source tree. The primary +purpose of this release is to correct numerous build problems +introduced by that architectural change: + + * In many newer environments, NuttX produced strange Makefile + errors but built correctly in older environments. A fix provided + by Rafael Noronha was incorporated and is reported to fix those + build problems. + * The apps/ directory build system would not handle Windows-native + toolchains due to obscure path formatting issues. + * And other problems as detailed in the Changelog. + +Many additional changes were made in the 6.1 release for another +major architectural change: NuttX will now build as a separately +linked microkernel. In this build option the RTOS builds as a +kernel, applications build separately and interface with kernel via +system calls. Applications run in user mode and kernel logic users +in kernel-mode. This provides a secure environment for NuttX. This +feature is fully coded in NuttX-6.1, but has not been tested due +to higher priority tasks that have arisen. + +Related to this change, support for the Cortex-M3 memory protection +unit (MPU) has been integrated with the NuttX kernel build to provide +an even higher level of security. + +NOTE: This kernel build is an option; the default build configuration +is still the standard, flat, unsecured RTOS as in previous releases. + +Additional new features in this release: + + * Support for LPC17xx GPIO interrupts (with much support from + Decio Renno). + * Basic timer support for STM32 (Contributed by Uros Platise) + * A binfs file system. This is a tiny pseudo file system that + lets named applications to be viewed and accessed in NSH under + the /bin directory. + * An I2C-based driver for the LIS331DL MEMS motion sensor. + (Contributed by Uros Platise.) + * A configuration for the Embedded Artists LPCXpresso LPC1768 board. + * The user_initialize() interface has been removed. + +And several bugfix associated with SD drivers, opendir(), signed +8-bit types (int8_t), and USB serial device. See the ChangeLog for +details. + +NuttX-6.2 +--------- + +The 69th release of NuttX, Version 6.2, was made on May 6, 2011 and +is available for download from the SourceForge website. The 6.2 +release includes several new features: + + * NXFFS: The obvious new feature is NXFFS, the NuttX wear-leveling + FLASH file system. This new file system is intended to be + small for the MCU usage and has some limitations. No formal + documentation of NXFFS yet exists. See the fs/nxffs/README.txt + file for details (see + http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/fs/nxffs/README.txt?view=log) + * Support for NXP LPCXpresso LPC1768 board on the Embedded + Artists base board. The Code Red toolchain is supported under + either Linux or Windows. Verified configurations include + dhcpd, nsh, nx, ostest, thttpd, and usbstorage. + * Support for the Univision UG-9664HSWAG01 OLED with Solomon + Systech SD1305 LCD controller. + * A new RAM MTD driver with FLASH simulation capability. + * A version.h file is now automatically generated so that C code + can now be version aware. + +In addition to these new feature, several important bugfixes are +included in this release correcting problems with dup2(), LPC17xx +GPIO interrupts, LPC17xx UART2/3, the FAT file system, build issues, +and strrch(). See the ChangeLog for more details. + +NuttX-6.3 +--------- + +The 70th release of NuttX follows only a nines days after the release +of version 6.2. It was released on May 15, 2011. This special +back-to-back release was made so that the current released version +of NuttX will correspond to the initial release from the RGMP +project. + +This release adds architecture support and build configuration for +RGMP. RGMP is a project for running GPOS and RTOS simultaneously +on multi-processor platforms. See +http://rgmp.sourceforge.net/wiki/index.php/Main_Page for further +information about RGMP. + +This release also includes support for STM32 FLASH, build improvements, +and initial, incomplete support for the MicroChip PIC32MX MCU. Bug +fixes are included for some build problems, USB host class driver +error handling, NX graphics color mapping, and problems with C +standard I/O buffer flushing. See the ChangeLog for further details. + +NuttX-6.4 +--------- + +The 71st release of NuttX, Version 6.4, was made on June 5, 2011 +and is available for download from the SourceForge website. The +6.4 release includes several new features: + + * A new, full-featured FTP client. This client may be used as a library + for automated FTP or via an FTP client shell. The FTP shell + supports the following commands: cd, chmod, get, help, idle, + login, ls, quit, mkdir, noop, put, pwd, rename, rhelp, rm, + rmdir, size, time, and up. A configuration is available for + the NXP LPC17xx to demonstrate this functionality. + * A functional C1101 wireless driver (contributed by Uros Platise) + * A PCI-based E1000 Ethernet driver (contributed by Yu Qiang) + * New C library functions: inet_addr() (contributed by Yu Qiang), + strndup(), asprintf() + * Reduced memory allocation overhead for MCUs with small heaps (<64K). + * fdopen() now works with socket descriptors allowing standard + buffered C functions to be used for network communications. + * The NSH ifconfig command can now be used to set or change the + IP address (contributed by Yu Qiang) + +This release also includes some completed but untested functionality. + + * The MicroChip PIC32MX port is now code complete and ready to + begin testing. Unfortunately, testing will be delayed due to + tool issues. + * Support for the NXP LPC315x MCUs. + +Additional miscellaneous enhancements and bug fixes to task_delete(), +recvfrom(), and other changes as noted in the ChangeLog. + +NuttX-6.5 +--------- + +The 72nd release of NuttX, Version 6.5, was made on June 21, 2011 +and is available for download from the SourceForge website. The +6.5 release is all about support for the Atmel 8-bit AVR family. +I have been interested in the AVR family for some time but because +of the severe SRAM constraints and because of the availability of +many tiny schedulers for the AVR, it has not been "on the radar +screen." However, I have recently become interested because of +interest expressed by members of the forum and because of the +availability of newer, larger capacity AVR parts (that I don't have +yet). + +This release corresponds with SVN release number: r3730 + +This release includes support for the following AVR boards. As +with any initial support for new architectures, there are some +incomplete areas and a few caveats that need to be stated. Here +they are, ordered from the least to the most complete: + + * SoC Robotics Amber Web Server (ATMega128). + + This port of NuttX to the Amber Web Server from SoC Robotics + (http://www.soc-robotics.com/index.htm). Is only partially in + place. The Amber Web Server is based on an Atmel ATMega128 + (128K FLASH but only 4K of SRAM). + + STATUS: Work on this port has stalled due to toolchain issues. It + is complete, but untested. + + * Micropendous 3 AT9USB647 + + This port of NuttX to the Opendous Micropendous 3 board. The + Micropendous3 may be populated with an AT90USB646, 647, 1286, + or 1287. See http://code.google.com/p/opendous/. I have only + the AT90USB647 version for testing. This version has very + limited memory resources: 64K of FLASH and 4K of SRAM. + + STATUS: The basic port was released in NuttX-6.5. This basic + port consists only of a "Hello, World!!" example that demonstrates + initialization of the OS, creation of a simple task, and serial + console output. The tiny SRAM limits what you can do with the + AT90USB647 (see issues below). + + * PJRC Teensy++ 2.0 AT9USB1286 + + This is a port of NuttX to the PJRC Teensy++ 2.0 board. This + board was developed by PJRC (http://pjrc.com/teensy/). The + Teensy++ 2.0 is based on an Atmel AT90USB1286 MCU with 128K + of FLASH and 8K of SRAM; a little more room to move than the + AT90USB647. + + STATUS: The basic port was released in NuttX-6.5. This basic + port consists of a "Hello, World!!" example and also slightly + simplified NuttShell (NSH) configuration (see the NSH User Guide + at http://www.nuttx.org/NuttShell.html). + + An SPI driver and a USB device driver exist for the AT90USB as + well as a USB mass storage configuration. However, this + configuration is not fully debugged as of the NuttX-6.5 release. + +AVR-specific issues. The basic AVR port is solid and biggest issue +for using AVR is its tiny SRAM memory and its Harvard architecture. +Because of the Harvard architecture, constant data that resides to +flash is inaccessible using "normal" memory reads and writes (only +SRAM data can be accessed "normally"). Special AVR instructions +are available for accessing data in FLASH, but these have not been +integrated into the normal, general purpose OS. + +Most NuttX test applications are console-oriented with lots of +strings used for printf and debug output. These strings are all +stored in SRAM now due to these data accessing issues and even the +smallest console-oriented applications can quickly fill a 4-8K +memory. So, in order for the AVR port to be useful, one of two +things would need to be done: + +1. Don't use console applications that required lots of strings. + The basic AVR port is solid and your typical deeply embedded + application should work fine. + +2. Create a special version of printf that knows how to access + strings that reside in FLASH (or EEPROM). + +NuttX-6.6 +--------- + +The 73rd release of NuttX, Version 6.6, was made on July 11, 2011 +and is available for download from the SourceForge website. The +6.6 release adds several smaller features but is mostly a bugfix +release. + +Bugfixes include + + * Fixed several NX Graphics bugs: Rendering fonts at >8 bits-per-pixel, + graphics move logic, and display artifacts that appear when a + window is closed. + * Corrections to the USB host mass storage class driver + * STM32 bugfixes: serial driver, GPIO interrupt handling + * LPC17xx: Changes for a success compilation with no console. + * Corrections to the Teensy AT90USB SD driver + * Changes for a clean compilation under the ZDS-II toolchain. + +Minor features: + + * Add logic to extract printf strings from FLASH (but there are + still printf issues for that target) + * Added a configuration for the Sure Electronics PIC32MX board. + However, higher priority tasks have stopped work on that + configuration. + * Added several new configurations for the STMicro STM3210E-EVAL + board. + * Added support for the STM3210E-EVAL board: (1) LCD in either + landscape or portrait mode, and (2) interrupting buttons. + * Added a configuration option to use different serial ports for + debug and for the NSH serial console (there are some issues + with CR-LF expansion and character echo if NSH is not run on + the console). + * Standardized the button press and button interrupt interfaces + so that they are common across all boards. + * Added a new graphics example that focuses on placing text on + the background while pop-up windows occur. Text should continue + to update normally with or without the popup windows present. + * Added ARM stack checking logic. + +See the ChangeLog for a detailed description of these changes. + +NuttX-6.7 +--------- + +The 74th release of NuttX, Version 6.7, was made on August 2, 2011 +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.7.tar.gz and +apps-6.7.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). Changes in this release are summarized +below: + + * New OS APIs: Add the standard sem_timedwait() interface. + * FAT File System: Adds (optional) support for VFAT long file + names. + * USB: Now the mass storage device can be connected when needed + and disconnected when not needed (or re-connected as a different + kind of device). + * Touchscreen Support: Defined a new NuttX touchscreen interface. + Added a driver for the TI TSC2007 touchscreen controller chip. + * NX Fonts: Add support for multiple fonts; developed a tool to + convert open source fonts into NuttX format; Converted and + installed nine new, high quality fontsets. + * NX Graphics: Add new NX APIs to support drawing of wide lines + in any orientation. Added new low level routines to set + individual pixel more efficiently. + * Build system: Added a export target that will bundle up all + of the NuttX libraries, header files, and the startup object + into an exportable tarball. + * LPC17xx: A CAN driver was contributed by Li Zhuoyi (Lzyy). + * STM32: New NX-related configurations to exercise text and + graphic image displays. + * C Library: Added a fixed precision atan2() math function. + * Bugfixes: Serial RX overrun error, FAT upper/lower NT 8.3 name + handling fixed. FAT directory allocation and initialization + bug. STM32 SDIO DMA race condition bug. eZ80 UART1 serial + driver errors (Paul Osmialowski) + +NuttX-6.8 +--------- + +The 75th release of NuttX, Version 6.8, was made on August 19, 2011 +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.8.tar.gz and +apps-6.8.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). Changes in this release are summarized +below: + + * NuttX has been ported to run on the Freescale Cortex-M4 "Kinetis" + boards. Two board ports are available for (1) the Kinetis + KwikStik-K40 and (2) the Kinetis TWR-K60N512 tower. + * Support for RGMP 0.3. This version of RGMP now runs on the + OMAP4430 (arm) pandaboard + * LPC17xx CAN driver extended to support both CAN1 and CAN2 + (submitted by Li Zhuoy (Lzzy)) + * Fixed several critical bugs related to signal handling + initialization and for signals the wake up tasks that are waiting + to send or receive message queues.Both are important. (submitted + by hkwilton). + * drivers/can.c: Fixed a semaphore overflow problem in the CAN + driver (reported by Li Zhouy (Lzzy)). + * Added a new ADC driver infrastructure and TI ADS1255 driver + both developed and submitted by Li Zhouy (Lzzy)). + +See the Changelog for additional changes included in this release. + +NuttX-6.9 +--------- + +The 76th release of NuttX, Version 6.9, was made on September 11, 2011 +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.9.tar.gz and +apps-6.9.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release includes a few new features and several important bug fixes. +The new features (some still incomplete) include: + + * Analog Support/ NXP LPC17xx: New DAC sub-system including ADC and DAC + drivers for the LPC17xx. Extensions to the ADS1255 driver. + (Contributed by Li Zhuoyi (Lzyy)) + + * Power Management: Added a new NuttX power management sub-system for + controlling and coordinating reduced power states. At present, only + verified in a simulation environment. + + * I2C Test Tool: A new application was added that can be used to + verify and debug I2C interfaces from the NuttShell (NSH) command + line. + + * NuttShell (NSH): In addition to the I2C test tool, a date command + is now supported (if CONFIG_RTC is defined) that can be used to + read and set the RTC. + + * NXP LPC17xx: I2C and DAC driver for the NXP LPC17xx family submitted by Li Zhuoyi + (Lzyy) + + * Kinetis Cortex-M4: Added a SDHC driver for the Kinetis parts. + Complete debug of the Kinetis SDHC driver was not completed, however, + do to some higher priority tasks that forced me to stop work. + + * Other new drivers: Driver for I2C-based at24cxx EEPROM submitted by + Li Zhuoyi (Lzyy); Driver for the LM-75 temperature sensor. Support + for the LM-75 temperature sensor integrated into the SM3210E-EVAL + development board. + + * NuttX Graphics (NX): Added new NX interfaces for drawing circles, + both circle outlines and filled circles. + + * FLASH: Added a function that accepts the path to a block driver and + then erases the underlying FLASH memory + + * Build System: The Make export logic now also tries to track down all + architecture-specific header files and include these in the NuttX + export bundle as well. Various changes and modifications so that + NuttX wil build on FreeBSD using the ASH shell (submitted by Kurt Lidl). + +Bugfixes, order roughly on decreasing criticality include: + + * STM32 I2C Driver: Add resets, timeout, and other fixes to work + reliably with the I2C tool. Corrected a major error introduced in + NuttX 6.8. + + * BCH Driver. Several important bugs (noted by Li Zhuoyi (Lzyy)) + were fixed. + + * C Library: Fixed errors in gmtime() and gmtime_r() that could lead to + errors in date calculations. + + * Timing: Correct an error in the tv_nsec calculation that happens + only config CONFIG_RTC is enabled + + * Build System: Use of -print-libgcc-file-name to get path to + libgcc.a might select the wrong libgcc.a if a multilib toolchain + is used + +NuttX-6.10 +---------- + +The 77th release of NuttX, Version 6.10, was made on October 6, 2011 +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.10.tar.gz and +apps-6.10.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r4028 + +This release includes a few new features and several important bug fixes. +The new features (some still incomplete) include: + + * CDC ACM serial class device-side driver + + * RTC: Now supports hi-res and lo-res hardware RTC. The lo-res RTC + runs at 1Hz. + + * STM32 I2C driver. Now supports faster, polled mode of operation. + Added an I2C trace capability. + + * ADS7843E touchscreen driver. As used on the SAM3U-EK development + board. + + * AT91SAM3U SPI driver. To support the ADS7843E toucscreen + + * X11 Support on simulation target. Build errors in the X11 windows + for the simulated target have been correct. Added support for a + simulated touchscreen on the X11 window (based on mouse inputs). + + * System Timer. Added support for a 64-bit system timer. + + * TIFF Support. Added a TIFF library (currently used for storing + LCD screen shots). + + * LCD Support. Added a test to verify that we read and write correct + to LCD GRAM memory. + + * I2C tool. Extended to support to include a verify command and + repititions and auto-address increment for most commands. + + * USB terminal example. Line oriented serial bridge connects a host + USB serial terminal to a host UART serial terminal. + + * Build System. apps/ Makefile will now include external directories + in the application build. + +Bugfixes, order roughly on decreasing criticality include: + + * Message Queues. Correct errors in mq_timedsend() and + mq_timedreceive(). + + * FAT. Writes that cross sector boundaries, stray write into the FAT, + and a FAT long file name issue + + * NXFFS. Added a missed error check. Files cannot be opened for + writing if they are already opened for reading. + + * Library: fopen() for append modse was not appending. + + * STM32 I2C driver. Correct another conflict between concurrent FSMC + and I2C1 accesses. Fixed some bad error detection logic. + + * STM32 SDHC driver. Interrupts were being left disabled. + +NuttX-6.11 +---------- + +The 78th release of NuttX, Version 6.11, was made on November 12, 2011 +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.11.tar.gz and +apps-6.11.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r4090 + +This release is a maintenance release that includes a few new features +and some important bugfixes. New features include: + + * NX Graphics: New interfaces to read from graphics memory + * Drivers: AT24 FLASH driver will now supports clustering of blocks + to achieve a larger, more usable block size for NXFFS. + * STM32: LCD color corrections + * PIC32: Board configuration for the Microchip PIC32 Ethernet Starter kit + (not yet verified), new GPIO support library, button and LED support + for the Sure Electronics PIC32MX board. A lot of progress has been + made on the PIC32 NuttX port, but it is still not ready for prime time. + * NXP LPC3152: Board configuration for the Embedded Artists EA3152. + +Bugfixes, order roughly on decreasing criticality include: + + * NXFFS: Corrected critical bugs in initialization, some full FLASH handling, + and errors in certain cases where the FLASH is repacked. + * ARM EABI: Fix stack aligment required for passing floating point values. + * Build system: Fix build issues when g++ is used as the compiler. + * NX Graphics: Bitmap error handling, correct RGB color conversion macros, + Error when the background window is released. + * STM32: RTC build fixes, LCD color corrections + * Simulation target: build fixes + * C Library: fclose() return value. + +See the change log for more detailed information. + +NuttX-6.12 +---------- + +The 79th release of NuttX, Version 6.12, was made on December 6, 2011 +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.12.tar.gz and +apps-6.12.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r4141 + +New features in this release include: + + * STM32. Basic support added for the STM32 F4 family. Board support + verified for the STMicro STM3250G-EVAL board. + * FAT. Enhanced partition handling. + * SDIO-Based SD Card support. Add support for large (>4Gb) devices + * Graphics. Added four new small sans serif fonts. + * Drivers. Fix a banding problem with the R61580 LCD. + +Bugfixes, order roughly on decreasing criticality include: + + * FAT. Fix errors in how the first entries in the root directory are + added. Fix errors in FAT date/time handling. + * Signals. Fix bug in certain sig_timedwait() error handling. + * Drivers. Fix cloned errors in poll() handling in several drivers. + * Message Queues. errno was not being set correctly by mq_notify(). + * C Library. wchar_t is a built-in type for C++ + +NuttX-6.13 +---------- + +The 80th release of NuttX, Version 6.13, was made on December 26, 2011 +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.13.tar.gz and +apps-6.13.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r4231 + +New features in this release include: + + * Drivers. New standard interface for PWM drivers and common + "upper half" PWM driver. Updated the MP25x driver to support + the Macronix MX25 chips (submitted by Mohammad Elwakeel). + * STM32 F1/F4. Added an Ethernet driver, ADC drivers, DAC driver, + PWM driver, CAN driver, F4 RTC driver, F4 DMA support, + logic for saving/restoring F4 FPU registers in context switches. + * STM32 Boards. Added STM3240G-EVAL DHPCD and nettest configuration. + Support for a new STM32 board, the HY-Mini STM32v board, was + contributed by Laurent Latil + * PIC32. The port to the Microchip PIC32MX is finally functional and + reliable. The NuttX PIC32 port has verified configurations for + the OS test and the NuttShell (NSH) both exist. + * Tests: New re-usable tests (in apps/examples) for PWM, ADC, and + CAN loopback. Several existing tests can now be built as NSH built-in + applicaitons (dhcpd, nettest, and all of the new tests). + +Bugfixes, order roughly on decreasing criticality include: + + * STM32: Correct handling of data overrun conditions. Existing logic + would hang with infinite interrupts when a data overrun occurred. + * DHCPD. Fix several problems using host order address where network + addresses expected (and vice versa). + +And several others. See the ChangeLog for more details. + +NuttX-6.14 +---------- + +The 81st release of NuttX, Version 6.14, was made on January 15, 2012, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.14.tar.gz and +apps-6.14.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r4301 + +New features in this release include: + + * Drivers. The upper-half PWM driver will now support a pulse count (as + would be needed to control a stepper motor). + + * STM32. The CAN driver has been verified in loopback mode. ADC driver + support for the STM32 F4. Add support for UART4-5 and USART6 + (Contributed by Mike Smith). The PWM driver now supports a pulse + count for TIM1 and TIM8. Timer driver now supports the F4's 32-bit + timers (Contributed by Mikhail Bychek) + + * STM32F4Discovery. Support for the STM32F4-Discovery board contributed + by Mike Smith. + + * STM3240G-EVAL. Add support for user control of LEDs. + + * LPC17xx. Add support for loopback mode to CAN driver. CAN TX done + perations are now interrupt driver. Now supports configurable CAN bit + rate. + + * LPC1766-STK. Add support for on-board buttons. Add support for user + control of LEDs. + + * LM3S. Add support for the LM3S6432S2E on the TI RDK-S2E (Contributed + by Mike Smith) + + * PIC32MX. USB device-side driver (needs further testing). A partial + Ethernet driver is also in place. + + * Library. Support added for fixed floating point fieldwidths in output + formatting (Contributed by Mikhail Bychek) + + * Build. New targets apps_clean and apps_distclean to simplify working + with application diretories. + +Bugfixes include: + + * Drivers. Fixed a buffer-full test in the upper-half CAN driver. + + * STM32. GPIO initialize logic (submitted by Mike Smith). Fix the + debug logic that dumps the GPIO configuration. + + * LPC17xxx. Correct an integer overflow in GPIO interrupt setup + (prevented pins > 15 from being used as interrupt sources). Correct + a value used in GPIO interrupt number range test. + + * FAT. Now returns the correct error value when it is unable to + recognize the file system. + + * Build. MAC OS build fixes (submitted by Mike Smith) + +And several others. See the ChangeLog for more details. + +NuttX-6.15 +---------- + +The 82nd release of NuttX, Version 6.15, was made on February 12, 2012, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.15.tar.gz and +apps-6.15.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r4387 + +New features and extended functionality: + + * General Drivers: Add support for (29-bit) extended CAN IDs. Add an + infrastructure to support battery drivers. Add a driver for MAX17040x + battery "fuel gauge". Add support for Composite USB drivers (in + particular for a CDC/ACM with MSC USB composite driver). + + Added a new RAM logging driver. This will allow debug output into + a RAM buffer associated with a character driver at /dev/ramlog. + Added the new command 'dmesg' to NSH that can be used to dump the + current contents of the log. This is useful for systems that do not + have the usual serial console (for example, if you only have a + Telnet console with NSH). + + * Networking: Add a lower level, primitive socket interface. Telnet + driver: + + A New Telnet daemon was created. It wraps a Telnet session within a + character driver that can serve as a "controlling terminal." The + Telnet session will then be inherited by tasks created from the + Telnet session and the stdin/stdout from the created task will + still go through the same Telnet connection. + + * STM32 Drivers. PWM driver pulse count was limited to 128; now is + (essentially) unlimited. Add support for (29-bit) extended CAN IDs. + Add support for I2C3. The SDIO driver is (mostly) verified on the + STM32 F4 platforms. + + * LPC17xx Drivers. Extended the CAN driver so that the TSEG1 and TSEG2 + bit times can be set via the NuttX configuration. Add support for + (29-bit) extended CAN IDs. + + * PIC32 Drivers. The PIC32 Ethernet driver is code complete (but still + untested). + + * FTPD. Add a new FTP server daemon. This is based loosely on + the hwport_ftpd library provided by Jaehyuk Cho. + + * Library: Add support for on_exit(). Implemented tcsetattr() and + tcgetattr(). Moved the old, too-smart fgets() to a new application + library function called readline(). Dumbed down the original fgets(). + Add strcasestr(), avsprintf(), inet_ntop(), and inet_pton(). + Add support to enable or disable debug output. + + * Build system: Support for building a 32-bit simulation executable on + a 64-bit Linux machine. Correct a dependency issue in the arch/*/src/board + directory. + +Bugfixes: + + * System: Correct PTHREAD_MUTEX_INITIALIZER + + * FAT: Fix an error in the FAT statfs() reported by David Sidrane. + + * STM32: Fix clock frequencies for APB2 timers. Correct AFIO register + offset. + + * PIC32. Correct GPIOs used for LEDs on the Sure PIC32MX board. + + * NSH. Wait for a USB connection if a USB serial class is used to + interface with the host. + +Additional bugfixes, name changes, and other differences as detailed in the +ChangeLog. + +NuttX-6.16 +---------- + +The 83rd release of NuttX, Version 6.16, was made on March 10, 2012, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.16.tar.gz and +apps-6.16.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r4475 + +New features and extended functionality: + + * ARMv7M Support: Includes new, streamlined Cortex-M exception + handling provided by Mike Smith. Context switching support for the + Cortex-M4 FPU registers is now provided (in both "lazy" and "non-lazy" + modes) + + * General Drivers: Added a generic "upper half" Quadrature Encoder driver. + The USB CDC/ACM serial driver can now be dynamically connected or + disconnected from the host (programmatically or using NSH commands). + + * STM32 Drivers: Added a "lower half" Quadrature Encoder driver. + Verified the STM32 F4 DMA driver; Added F4 DMA support to the existing + STM32 SDIO driver. + + * STM32 Board Support. Added support for the STM32 F2 family and + for the STM3220G-EVAL board (contributed by Gary Teravskis). + Support is now included for C++ static constructors (verified using + the Atollic toolchain). Added support for the SRAM available on the + STM3240G-EVAL board. + + * PIC32 Drivers. PIC32MX USB (device) driver is now functional. + The PIC32MX Ethernet driver not yet fully verified (and an + unverified SPI driver is also available). + + * Networking. Added a lower-level, thread-independent socket layer. + Parts of this layer were created in 6.15 to support the FTPD + controlling terminal; this support has been extended in order + to support an NFS file system (not yet released). + + * NuttShell (NSH). NSH will now support a USB serial connection for + the console (such as CDC/ACM). This is useful in environments + where there is no physical serial port on the board. + + * Build System. Reorgnaization of networking header files. + +Critical Bugfixes. The following bug fixes are considered critical: + + * Networking: Fixed a "leak" in the TCP/IP read-ahead buffering logic. + Corrected an error in TCP/IP sequence numbering/ACK logic which + occurred when read-ahead buffering memory is exhausted. + + * STM32 Drivers: Fixed an buffer sizing error in the STM32 Ethernet + driver. + +Additional Bugfixes: Other important bug fixes are listed below. See +the ChangeLog of a complete, detailed list of bug fixes. + + * Networking: Corrected recv()/recvfrom() return value. Added logic to + monitor for loss of connection after a new connection has been + established via accept() (Contributed by Max Nekludov). Add + logic to select() to correctly handle POLLHUP (Contributed by Max + Nekludov) + +Additional bugfixes, name changes, and other differences as detailed in the +ChangeLog. + +NuttX-6.17 +---------- + +The 84th release of NuttX, Version 6.17, was made on April 14, 2012, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.17.tar.gz and +apps-6.17.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r4607 + +New features and extended functionality: + + * Networking: Additional low-level, thread-independent socket + interfaces (for NFS client support). + + * RTC: Added a new interface call clock_synchronize(). This function + will reload the system time from an RTC and is required when the + system re-awakens from certain deep-sleep modes. + + * Graphics: Add NxConsole. This is a character device driver that + wraps an NX window and can be re-directed for stdout. This allows, + for example, a pop-up graphics window that contains a NuttShell (NSH) + session. A test of NxConsole is available at apps/examples/nxconsole. + + * Watchdog Drivers: Added an interface definition an "upper half" + driver to support watchdog timers. + + * Calypso: Support for TI Calypso-based cellphones (as supported by + the Osmocom-BB project) was contributed by members of the Osmocom-BB + team. This includes configurations for the Compal e88 and e99 phones. + + * USB Device Interface: Needed to extend the USB device interface + because there was no mechanism for passing endpoint OUT data that + may need to accompany a setup request. + + * STM32 drivers: Added some power management controls for entering + reduced power consumption states. An OTG FS driver was completed + and partially verified (this driver seems to be functional but since + it has been test so lightly, it might better be listed in the + next section "Work in progress"). + + * PIC32 drivers: The PIC32 Ethernet driver is now stable. The PIC32 + USB device controller driver is now functional (but not yet stable). + + * PIC32 boards: Added support for the Sure DB-DP11212 PIC32 General + Purpose Demo Board. There is now a PIC32 Starter Kit that + provides NSH only through a Telnet connection. + + * Build System: Some header files were moved into include/nuttx. + The goal is to move any non-standard header files to include/nuttx + or include/arch. Moved include/math.h to include/nuttx/math.h; + this file is now only instantiated as the 'system' math.h if + CONFIG_ARCH_MATH_H=y is defined. + + * Tools: Added tools/cmpconfig.c, a tool for comparing two + configuration files. + +Work in progress. This release includes some partially completed +work that is still not ready for prime time. + + * NFS Client: Work is progressing on support for an NFS client + file system. This is a port of the BSD NFS client file system + that is being done by Jose Pablo Rojas V. + + * Automated Configuration: Automated configuration based on the + kconfig-frontends tool is being incorporated into the build + system. The configuration is still not complete enough for + general use in this release. + + * STM32 Drivers: Added files that will (eventually) hold an STM32 + OTG FS host driver. This is still a work in progress. + +Bugfixes: + + * Networking: Corrected a deadlock that only occurred when + executing the NSH 'ifconfig' command over Telnet. + + * File system: Fix incorrect return errno value from read() when + the file is opened write-only. + + * Graphics: Fix several compilation errors that have crept into the + multi-user NX server because of lack of use. + + * STM32: In order to use CAN2, both CAN1 and CAN2 clocking must be + enabled. Fixed a troublesome bug in the STM32 F4 I2C driver that + resulting in timeouts. + + * LPC17xx: Fixes for errors the crept in the LPC17xx DAC logic + Contributed by Lzyy). + + * Build System: Reordered the link command line to account for new + versions of libgcc.a that require symbols from the application + (abort()). + +NuttX-6.18 +---------- + +The 85th release of NuttX, Version 6.18, was made on May 19, 2012, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.18.tar.gz and +apps-6.18.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +The majority of changes in this release are focused on supporting the +synchronized release of NxWM, the NuttX tiny window manager. That +window manager is released as part of the NxWidgets package, but depends +upon many of the changes in this NuttX release. + +This release corresponds with SVN release number: r4751 + +New features and extended functionality: + + * Drivers. Added a watchdog timer driver infrastructure. Add general + support for STMicro STMPE811 I/O Expander/touchscreen device. + + * STM32. Add support for the STM32 IWDG and WWDG watchodog timers. DMA + now supports cicular buffer mode; serial driver now uses circular + DMA to improve Rx performance (Contributed by Mike Smith). + + * STM3240G-EVAL Board. Add support for the LCD and for the STMPE811 + I/O Expander as a touchscreen controller. + + * PIC32 Boards. Board support for the Mikroelektronika PIC32MX7 + Multimedia Board (MMB) and for the Sparkfun UBW32 PIC32 board. + + * NX. Framed windows are now draw in three colors instead of just two. + Numerous other extensions needed to support NxWM (see the ChangeLog + for details). + + * Library. Add prctl() command that can be used to setting and getting + the names of threads. This (plus several other improvements and bug + fixes) are part of a larger effort to improve task monitoring + capabilities. + +Work in progress. This release includes some partially completed +work that is still not ready for prime time. + + * NFS Client. Work is progressing on support for an NFS client + file system. This is a port of the BSD NFS client file system + that is being done by Jose Pablo Rojas V. + + * Automated Configuration. Automated configuration based on the + kconfig-frontends tool is being incorporated into the build + system. The configuration is still not complete enough for + general use in this release. + + * STM32 Drivers. Added files that will (eventually) hold an STM32 + OTG FS host driver. This is still a work in progress. + +Bugfixes (see the change log for details) : + + * sched_setscheduler() return value (Contributed by Richard Cochran). + + * stdio. Ignore CONFIG_STDIO_LINEBUFFER if the file was opened in binary mode. + + * fopen(). Correct an error in parsing open mode string. + + * serial driver. Improved performance be reducing the amount of time + that Rx interrupts are disabled. + + * recvfrom(). Fix a compilation problem. + + * CDC/ACM device driver. Fix an infinite loop that occurs when the serial + device is unregistered. + + * STM32 OTG FS device driver. Numerous fixes and the driver is partially + functional but there are still some issues that become apparent when + debug output is disabled. + + * fcntl(). Always returned zero on success; however, some fcntl commands + need to return non-zero values on success. + + * graphics: Many multi-use mode fixes added to support NxWM (see the + ChangeLog for details). Auto-raise is temporarily disabled in multi- + user mode because it causes some problems with NxWM. + + * on_exit(): Fix compilation errors if CONFIG_SCHED_ONEXIT is enabled. + +NuttX-6.19 +---------- + +The 86th release of NuttX, Version 6.19, was made on June 15, 2012, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.19.tar.gz and +apps-6.19.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r4847 + +This release features new support for a Network File System (NFS) client. +This feature allows a tiny, embedded MCU to mount a remote file system +exported by an NFS server and then to access the file system as it would +any local file system. Then the tiny MCU can effectively have terabytes +of storage! + +This might be useful for data collection, for MCU configuration information, +for software updates, for providing modular, loadable code modes, controlling +a "farm" of MCUs, ... there are many possibilities and opportunities for +innovation! + +The NuttShell (NSH) now supports the following command: + + nfsmount + +That command will mount the remote NFS server directory at + on the target machine. is the IP address of +the remote server. + +The NFS development was the graduation project of Jose Pablo Rojas V. who +is a student at the Instituto Tecnolgico de Costa Rica (ITCR, or TEC). +A lot of effort went into understanding what a tiny, embedded NFS client should +do and getting the target resource usage to a bare minimum. Only around a +kilobyte or so of memory is required to run the NFS client (and most of that +for I/O buffers). Jose Pablo has spent several months living with NFS and +should be congratulated. + +Additional new features and extended functionality: + + * Drivers: SSD1289 LCD driver, MIO283QT2 LCD driver + + * LM3S: Additional register definition header files (contributed by Max + Neklyudov). + + * STM32 Boards: The STM32F4Discovery will now support an SSD1289 LCD, + The STM3220G-EVAL board support is now equivalent to the STM3240G-EVAL + board support. + + * PIC32 Boards: The Mikroelektronika PIC32MX7 MMB board port is now + functional, very complete, and stable. + + * Graphics: The NxConsole will now take keyboard input from the NX graphics + subsystem. This means that if there are multiple NxConsole windows, only + the top instance that has focus will receive the keyboard input. + + * apps/: Add the capability to use an arbitrary USB device as the console + (not necessarily /dev/console). Additional enhancements for USB consoles. + Added the 'mv' command. + +Work in progress. This release includes some partially completed +work that is still not ready for prime time. + + * Automated Configuration. Automated configuration based on the + kconfig-frontends tool is being incorporated into the build + system. The configuration is still not complete enough for + general use in this release. + + * STM32 Drivers. Added files that will (eventually) hold an STM32 + OTG FS host driver. This is still a work in progress. + +Bugfixes (see the change log for details) : + + * General: sleep() and usleep() return values, sig_timedwait() errno setting + on timeout. + * Drivers: STMPE811 touchscreen driver, USB PLC2303, USB CDC/ACM + * STM32: Several USB device controller driver fixes, F4 interrupt priorities + (contributed by Mike Smith). + * Graphics: Keyboard input, fill trapezoid bug + +As well as other, less critical bugs (see the ChangeLog for details) + +NuttX-6.20 +---------- + +The 87th release of NuttX, Version 6.20, was made on July 12, 2012, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.20.tar.gz and +apps-6.20.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r4937 + +Additional new features and extended functionality: + + * Power Management: An evolving power management example is being + created by Diego Sanchez. This effort currently involves on the + STM32 F1 but clearly demonstrates the NuttX power management + system which will automatically drive the system to lower power + usage states due to lack of use. + + * Drivers: Added a driver for the SST 25 SPI-based FLASH parts. + + * PIC32: Added support for the PIC32MX1 and PIC32MX2 families. + Added support for the microchipOpen and Pinguino toolchains. + + * NXP LPC43XX: Added support for the entire LPC43xx family + + * PIC32 boards: Added support for the DTX1-4000L "Mirtoo" module + from http://www.dimitech.com/ (PIC32MX2). + + * NXP LPC43XX Boards: Added support for NGX LPC4330-Xplorer board. + + * NXP LPC17XX Boards: Added support for Micromint Lincoln60 board + (LPC1769). + + * LM3S Boards: Add a configuration to support the TI/Stellaris + EKK-LM3S3B96 development board. Contributed by Jose Pablo Rojas V. + + * Library: NuttX now supports platform-specific stdarg.h header + files. + +Work in progress. This release includes some partially completed +work that is still not ready for prime time. + + * Automated Configuration. Automated configuration based on the + kconfig-frontends tool is being incorporated into the build + system. The configuration is still not complete enough for + general use in this release. + + * STM32 Drivers. Added files that will (eventually) hold an STM32 + OTG FS host driver. This is still a work in progress. + +Bugfixes (see the change log for details) : + + * PIC32: GPIO output configuration (critical bug) + * STM32: Typos in pin mapping files. + * LM3S: Fixed an optimization related but that caused slow start-up + times if optimization was disabled. + * Library: Fixed signed extension but in all limit.h files + (reported by Lorenz Meier). inet_ntoa compilation failure + on Z80. + +As well as other, less critical bugs (see the ChangeLog for details) + +NuttX-6.21 +---------- + +The 88th release of NuttX, Version 6.21, was made on August 25, 2012, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.21.tar.gz and +apps-6.21.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r5052 + +Additional new features and extended functionality: + + * Core: Add support for multiple registered atexit() functions. Syslog + extended: Now any character driver may be used for the debug logging + device. Mountpoint traversal logic. + * Drivers: Added support for the TI PGA112-7 amplifier/multiplexor. + * LPC43xx: Added clock ramp-up logic to run at 204 MHz + * LPC43xx Drivers: SPIFI block driver, RS-485 support, Minimal termios + support. Framework for USB0 device controller driver. + * LPC17xx Drivers: Minimal termios support + * STM32: Support for STM32 F1 "Value Line" (contributed by Mike Smith). + Add support for STM32 F107 "Connectivity Line" (contributed by Max + Holtzberg). + Clock restart logic needed for recovery from low power modes. + * STM32 Drivers: RTC alarm support. Usable for wakeup from sleep mode, + Minimal serial termios support. USB OTG FS host driver (alpha). + * STM32 Boards: Add power management hooks for the STM32F4Discovery, + Add support for the Olimex STM32-P107 (contributed by Max Holtzberg). + * PIC32: Add support for the Pinguino MIPS toolchain. + * PIC32 Drivers: GPIO driver now supports F1 analog regiaters (ANSEL). + * PIC32 Boards: Add support for the PGA117 on the Mirtoo module. + * Calypso: Add support for the SSD1783 LCD on the Compal E99. + * Library: cfsetispeed(), cfsetospeed(), tcflush(), memchr(), and + memccpy(). + * Applications: Port of freemodbus-v1.5.0. Add support for testing + devices with multiple ADC, PWM, and QE devices. + NSH: NSH 'mount' command (with no arguments) will now show mounted + volumes. Add new NSH 'df' command. Extended 'help' support. NSH + now catches the return value from spawned applications (provided + by Mike Smith). + * Build System: mkconfig will not define CONFIG_DRAM_END. A lot of + progress has been made on the automated NuttX configuration logic + (Thanks go to Richard Cochran). + * Documentation: Document ways to customize the behavior of NSH. + +Bugfixes (see the change log for details) : + + * Serial drivers (all): Fix ioctl return value. Common "upper half" + serial driver will now return with EINTR if a serial wait is + interrupted by a signal. + * FAT: Fix statfs() file name length. + * LPC43xx: Clock configuration. + * STM32: Pinmap fixes, SPI driver re-initialization + * STM32 Boards: Correct and lower SDIO frequency for F2 and f4 boards. + * AVR: C++ build issues. + * PM: Fix a place where interrupts were not be re-enabled. + * Applications: NSH application start-up race conditions. + * Library: Fieldwidth and justification for %s format. Fixed several + issues with presenting floating point numbers. NULL definition + for C++ + +As well as other, less critical bugs (see the ChangeLog for details) + +NuttX-6.22 +---------- + +The 89th release of NuttX, Version 6.22, was made on September 29, 2012, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.22.tar.gz and +apps-6.22.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r5206 + +Note that all SVN information has been stripped from the tarballs. If you +need the SVN configuration, you should check out directly from SVN. Revision +r5206 should equivalent to release 6.22 of NuttX 6.22: + + svn checkout -r5206 svn://svn.code.sf.net/p/nuttx/code/trunk nuttx-code + +Or + + svn checkout -r5206 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code + +Additional new features and extended functionality: + + * RTOS: Application entry point is no longer user_start, but can be + configured using CONFIG_USER_ENTRYPOINT. NuttX now supports two work + queues: A lower priority work queue (for extended processing) and a + higher priority work queue (for quick, high priority operations). + + * Memory Management: Added a new granule-based allocated that can be + used to manage, aligned and quantized DMA memory. + + * File System: Add hooks to allocate I/O memory with and external + allocated (need if required by DMA). + + * Networking: ENC28J60 driver is (finally) verified. + + * Drivers: Add hooks USB device drivers to allocate I/O memory with and + external allocated (need if required by DMA). Driver for the Windbond + SPI FLASH family (W25x16, W25x32, W25x64, and others). ADS7843E driver + extended for TSC2046 and XPT2046 and verified. + + * ARMv7-M: Added logic to reset the MCU using the NVIC. + + * STM32: Add support for STM32F103VET6. + + * STM32 Drivers: Add logic to re-initialize UARTs a second time to + enable DMA (Mike Smith). I2C driver error recovery (Mike Smith). + + * STM32 boards: Support for USB host added add to several configurations + (or at least explained in README files). Support for the Shenzhou + STM32F107 board (see www.armjishu.com). Support for M3 Wildfire + STM32F103 board (v2 and v3). + + * Build System: Kconfig string de-quoting logic. Remove comments from + defconfig files (Kate). Add tool to create NuttX-style symbol tables. + Numerous changes to configuration logic as needed for the new mconf-based + configuration (much of this from Richard Cochran). Refactor common + Make.defs logic into tools/Config.mk (Richard Cochran). + + * Library: Configurable terse output from strerror(). Added perror() (Kate). + Add %n format to sscanf() (Kate). + + * Applications: Numerous changes and extensions to the old uIP web server + (from Kate and Max Holtzberg, see the ChangeLog for specific extensions). + UDP network discovery utility (Max Holtzberg). Embeddable Lightweight + XML-RPC Server (http://www.drdobbs.com/web-development/an-embeddable-lightweight-xml-rpc-server/184405364, Max Holtzberg). + +Bugfixes (see the change log for details). Some of these are very important +(marked *critical*): + + * RTOS: Fixes to priority inheritance logic (*critical*). waitpid() + critical section. Assertion in work_cancel() (Mike Smith). mmap() (Kate). + + * FAT File System: Improper Boolean expression caused un-necessary writes + and performance issues (*critical*, Ronen Vainish). + + * Networking: Remove an un-necessary delay from recvfrom(). This greatly + improves network performance (*critical*, Max Holtzberg). + + * Graphics: NX parameter checking errors. + + * Drivers: Fix double release of memory in SDIO-based, MMC/SD driver + (Ronen Vainish). + + * LPC17xx: Ethernet driver fixes needed for certain PHYs (Kate). + + * AVR: Fix build error (Richard Cochran). + + * STM32: USB OTG FS host driver NAKing an retries. Power management + compilation errors (Diego Sanchez). Missing SPI3 remap logic. + + * STM32 Drivers: Fix for Ethernet errata for STM32F107 (*critical*). + Ethernet buffer alignment check. Add "kludge" to Ethernet driver to + handle DM9161 PHY which (at least on the Shenzhou board), sometimes + does not come up correctly. + + * Applications: THTTPD (Kate). NSH ping when IP address is on a different + network (Darcy Gong). + + * Library: fread(), fflush(), fdopen(): Fix error handling logic (Ronen + Vainish). Fix some field-width handling issues in sscanf() + +As well as other, less critical bugs (see the ChangeLog for details) + +NuttX-6.23 +---------- + +The 90th release of NuttX, Version 6.23, was made on November 5, 2012, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.23.tar.gz and +apps-6.23.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r5313 + +Note that all SVN information has been stripped from the tarballs. If you +need the SVN configuration, you should check out directly from SVN. Revision +r5313 should equivalent to release 6.23 of NuttX 6.23: + + svn checkout -r5313 svn://svn.code.sf.net/p/nuttx/code/trunk nuttx-code + +Or + + svn checkout -r5313 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code + +Additional new features and extended functionality: + + * RTOS: If both atexit() and on_exit() are enabled, use on_exit() to + implement atexit(). Updates for RGMP 4.0. + + * Binfmt: Add support for loading and executing ELF binary modules from + a file system. + + * Drivers: Maxim MAX11802 touchscreen controller (Petteri Aimonen) + + * STM32 Driver: Implementation of /dev/random using the STM32 Random Number + Generator (RNG). + + * STM32 Boards: ADC support for the Shenzhou IV board. Relay support for + the Shenzhou IV board. + + * C Library: Support is now included for the add-on uClibc++ C++ + standard library support. This includes support for iostreams, strings, + STL, RTTI, exceptions -- the complete C++ environment. (uClibc++ is + provided as a separate add-on package due to licensing issues). + + Optimized generic and ARM-specific memcpy() function. Optimized + memset() function. + + Add support for ferror(), feof(), and clearerror(). Add support for + __cxa_atexit(). + + Math Library: Port of the math library from Rhombus OS by Nick Johnson + (Darcy Gong). + + * Applications: New NSH commands: ifup, ifdown, urlencode, urldecode, + base64enc, bas64dec, md5 (Darcy Gong). Add support for NSH telnet login + (Darcy Gong). Enancements to NSH ping command to support pinging hosts + with very long round-trip times. Extensions to the ifconfig command + Darcy Gong), + + Many extensions to the webclient/wget and DNS resolver logic from Darcy + Gong. JSON, Base64, URL encoding, and MD5 libraries contributed by Darcy + Gong. + + New examples: ELF loader, JSON, wgetjson, cxxtest, relays. + +Bugfixes (see the change log for details). Some of these are very important +(marked *critical*): + + * Drivers: W25 SPI FLASH + + * STM32 Drivers: ADC reset + + * Graphics: Missing implementation of the blocked method (*critical*, + Petteri Aimonen). + + * C Library: Floating point numbers in printf and related formatting functions + (Mike Smith), cf[get|set]speed() (Mike Smith) + +As well as other, less critical bugs (see the ChangeLog for details) + +NuttX-6.24 +---------- + +The 91st release of NuttX, Version 6.24, was made on December 20, 2012, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.24.tar.gz and +apps-6.24.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r5447 + +Note that all SVN information has been stripped from the tarballs. If you +need the SVN configuration information, you should check out directly from +SVN. Revision r5447 should equivalent to release 6.24 of NuttX 6.24: + + svn checkout -r5447 svn://svn.code.sf.net/p/nuttx/code/trunk nuttx-code + +Or (HTTP): + + svn checkout -r5447 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code + +Additional new features and extended functionality: + + * RTOS: + + - Implemented the POSIX pause() function (still has some compiance + issues). + - Tasking logic is extended to support the notion of address + environments. An address environment is the key notion underlying + "process" vs. tasks. If tasks are created with address environments + (by binfmt), the OS will propogate that environment to child threads + and will destroy the address environment when the "process" exists. + - If support for the PATH variable is enabled, the OS start up logic + will create an initial environment containing the default PATH + setting (CONFIG_PATH_INITIAL). This initial PATH will then be + inherited by all tasks. + + * Binfmt + + - The NuttX binary loaders have been updated to support the PATH + environment variable. Now, if the PATH is properly defined, programs + can be executed from mass storage using only the file name. This + feature is added to support more standard behavior (eventually, NSH + will support execution of programs in file systems by just entering + the file name, perhaps in 6.25?). + - The NXFLAT and ELF binary loaders have been extended to create + address environments for any new tasks executed from the file system. + This feature requires that the architecture support a memory management + unit (MMU) and the address environment interfaces declared in + include/nuttx/arch.h (currently, this is only supported by the z180). + + * Drivers: LCD driver for the Univision UG-2864AMBAG01 OLED + + * STM32: Support for STM32F100 high density chips contributed by Freddie + Chopin. + + * STM32 Drivers: Added optional RS-485 direction bit control (from + Freddie Chopin). + + * STM32 Boards: + + - Support for generic STM32F100RC board contributed by Freddie Chopin. + - stm32f4discovery/nxlines: STM32F4Discovery support for the + UG-2864AMBAG01 OLED. + - stm32f4discovery/winbuild: A version of the NuttX OS test + configured to build natively on Windows. + - stm32f4discovery/elf: Now uses the PATH variable to find ELF + executables. + - configs/cloudctrl: Added for Darcy Gong's CloudController board + + * PIC32 Boards: Update the Mirtool configuration for Release 2 of the + Mirtoo module. + + * Calypso: Add Calypso keypad driver. From Denis Cariki. + + * ZiLOG: + + - Add support for the z180 chip family and, specifically, for + the P112 retro hardware (see http://p112.feedle.net/). + - All ZiLOG configurations updated to use the current ZDS-II + and/or SDCC toolchains. + + * Graphics: + + - Add a semaphore handshake so that operations on buffers from + the NXMU client will be blocked until the NX server operates on the + buffer data (from Petteri Aimonen). + - nxtk_subwindowmove() and nxtk_getwindow(): Improvements to clipping + logic from Petteri Aimonen. + + * C Library: lib/ sub-directory renamed libc/ (there is a new lib/ sub- + directory that is used to hold all archives). + + * C++: Exception stubs from Petteri Aimonen. + + * Applications: + + - Add NSH hexdump command to dump the contents of a file (or character + device) to the console (contributed by Petteri Aimonen). + - Extend the NSH ifconfig command plus various DHCPC improvements + (from Darcy Gong). + + * apps/examples: + + - ostest: Replace large tables with algorithmic prime number + generation. This allows the roundrobin test to run on platforms + with minimal SRAM (Freddie Chopin). + - keypadtest: A new keypad test example contributed by Denis Carikli. + - elf and nxflat: If CONFIG_BINFMT_EXEPATH is defined, these examples + will now use a relative path to the program and expect the binfmt/ + logic to find the absolute path to the program using the PATH + variable. + + * Build system: + + - New top-level Makefiles: Makefile.unix and Makefile.win (along with + numerous changes to other make-related files). This adds basic + support for building NuttX natively under Windows from a CMD.exe + window (rather than in a POSIX-like environment). This build: (1) + Uses all Windows style paths, (2) Uses primarily Windows batch + commands from cmd.exe, with (3) a few extensions from GNUWin32. + + This capability should still be considered a work in progress + because: (1) it has not been verfied on all targets and tools, + and (2) still lacks some of the creature-comforts of the more + mature environments (like a function configure.sh script and + 'make menuconfig' support). + + - Example Windows native builds for STM32F4Discovery, eZ80, z16f, z8, + Z80, and Z180. + - Several configurations have been converted to work the kconfig- + frontends mconf configuration tool: stm32f4discovery/nxlines, and + all eZ80, z16f, z8, Z80, and Z180 configurations. + - Architectures now include a common Toolchain.defs file that can be + used to manage toolchains in a more configurable way (most of this + contributed by Mike Smith). + + * Build tools: + + - Renamed tools/winlink.sh to tools/copydir.sh. + - Several new tools/scripts to support the Windows native build: + tools/mkdeps.bat, tools/mkdeps.c, tools/link.bat, unlink.bat, and + copydir.bat. + - tools/incdir.sh and incdir.bat now support an -s option to generate + system header file paths. + - tools/b16.c: Fixed precision math conversion utility. + +Bugfixes (see the change log for details). Some of these are very important +(marked *critical*): + + * RTOS: Fix some backward conditional compilation in the work queue + logic (Freddie Chopin). + + * File System: Uninitialized variable caused assertions (from Lorenz + Meier). + + * Drivers: Partial fix for STM32 OTGFS device drivers and fix for short, + unaligned writes in the flash translation layer (drivers/mtd/ftl.c), + both from Petteri Aimonen. + + * STM32 Drivers: + + - Qencoder driver and TIM3 driver fixes from Ryan Sundberg. + - Fix timeout delay calculation in the STM32 OTG FS host driver. + + * LPC17xx Drivers: Resources not being properly released when I2C + driver is un-initialized. + + * Graphics: + + - Fix logic when the mouse drags outside of the window; fix + another "blocked message" handling case (both from Petteri Aimonen). + - nxtk_filltrapwindow(): Correct an offset problem (also from Peterri + Aimonen). + - nxglib_splitline(): Correct the "fat flat line" bug. + + * C Library: + + - nrand() changes to prevent coefficients from becoming zero which + would "lock up" the random number generate. + - Add rounding functions to the math library (contributed by Petteri + Aimonen). + + * Build system: Changes to MIN definitions in all limit.h header files + to avoid integer overflows. For example from (-128) to (-127 - 1) + (from Petteri Aimonen). + + * Applications: Modbus fixes from Freddie Chopin. + +As well as other, less critical bugs (see the ChangeLog for details) + +NuttX-6.25 +---------- + +The 92nd release of NuttX, Version 6.25, was made on February 1, 2013, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.25.tar.gz and +apps-6.25.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r5595 + +Note that all SVN information has been stripped from the tarballs. If you +need the SVN configuration information, you should check out directly from +SVN. Revision r5595 should equivalent to release 6.25 of NuttX: + + svn checkout -r5595 svn://svn.code.sf.net/p/nuttx/code/trunk nuttx-code + +Or (HTTP): + + svn checkout -r5595 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code + +Additional new features and extended functionality: + + * OS Initialization + + - Removed support for CONFIG_BUILTIN_APP_START. This is not really a + useful feature and creates a violation of the OS layered + architecture. + + * Task Creation: + + - Implement a simple vfork(). In NuttX-6.25, this interface is + available only for ARM7/9, ARMv7-M (Cortext-M3/4), and MIPS32 + (PIC32MX) platforms. + - exec() now sets the priority of the new task to the same priority as + the parent task (instead of the arbirtrary value of 50). + - New, partially complient implementations of execv() and execl(). + These are only partially compliant because they do not overlay any + existing "process space" but rather create the new task and exit(). + - Add a complete implementation of posix_spawn(). This standard + interface is a better match for an MMU-less architecture than are + vfork() plus execv() or execl(). + - Add a task start hook that will be called before the task main + is started. This can be used, for example, to schedule C++ + static constructors to run automatically in the context of the + new task. + + * Task Parentage + + - Repartitioned tasking data structures. All shared resources are now + collected together in a "task group". A task group includes the + original task plus all of the pthreads created by the task. + - Added support for remember the parent "task group" when a new task is + started. + - Added optional support to record the membership of each thread in + the "task group". + - Implement support for retaining child task status in the "task group" + after the child task exists. This is behavior required by POSIX. + But in NuttX is only enabled with CONFIG_SCHED_HAVE_PARENT and + CONFIG_SCHED_CHILD_STATUS + - Add internal logic to "reparent" a task. This is useful, + for example, where the child task is created through a trampoline + task that redirects I/O. Reparenting allows the caller of posix_spawn() + to be reparented for the eventual child thread. + - Added support for SIGCHLD. Sent to all members of the parent task + group when the file member of the child task group exits. + - If SIGCHLD and retention of child task exist status are enabled, then + a more spec-compliant version of waitpid() is enabled. + - New interfaces waitid() and wait() are also enabled when SIGCHLD + is enabled. + + * File System + + - dup() and dup2() can new be used with opened files in a mounted file + system. This supports re-direction of output in NSH to files. + - The binfs file system was moved from apps/builtin to fs/binfs. The + binfs file system was extended to support execution of "builtin + applications" using exec(), execv(), execl(), or posix_spawn(). + - Added logic based on SIGCHLD to automatically unload and clean-up + after running a task that was loaded into memory. + + * Binary Formats + + - Much of the logic for "builtin applications" was moved from + apps/builtin to nuttx/binfmt/libbuiltin. Includes some extensions + contributed by Mike Smith. + - A binary loader was added for builtin applications to support + execution of "builtin applications" using exec(), execv(), + execl(), or posix_spawn(). + + * Drivers: + + - Added logic to marshal and serialized "out-of-band" keyboard + commands (such as cursor controls and key release events) intermixed + with normal ASCII keypress data. The encoding is partially integrated + in the HID keyboard driver and the decoding full integrated into the + apps/examples hidkbd and keypadtest (the latter contributed by Denis + Carlikli). + - Driver for the UG-2864HSWEG01 OLED contributed by Darcy Gong. + - Add support for removable serial devices (like USB serial). This + support is enabled by CONFIG_SERIAL_REMOVABLE. + + * ARMv7-M: + + - Added an option to use the BASEPRI register to disable interrupts + (instead of the PRIMASK). This eliminates some innocuous hardfaults + that interfere with some debug tools. You need to switch to the + BASEPRI method only if you have such tool interference. + + * STM32 Drivers + + - Bring STM32 F1 DMA capabilities up to par with the STM32 F2/F4 + (contributed by Mike Smith). + - Add support for USART single wire mode (Contributed by the PX4 + team). + - Updates to support for SPI DMA on the STM32 F1/F2/F4. From + Petteri Aimonen. + + * STM32 Boards: + + - New configuration to support the UG-2864HSWEG01 OLED on the + STM32F4Discovery board. + - Added a posix_spawn() test configuration for the STM32F4Discovery. + + * LM3S/LM4F + + - Files and directories repartitioned to support both LM3S and LM4F + using the STM32 organization as a model. + - Partial definitions for the LM4F contributed by Jose Pablo Carballo + (this is still a work in progress). + + * LM3S Boards + + - Added scripts and documentation to use OpenOCD with the LM3S (from + Jose Pablo Carballo). + + * LPC176x/LPC178x + + - Files and directories repartitioned to support both LPC175x/LPC176x + and the LPC177x/LPC178x families using the STM32 organization as a + model. The LPC1788 port is a work in progress by Rommel Marcelo. + + * LPC176x/LPC178x Boards: + + - Added a configuration to support the Wave Share Open1788 board. + This is still a work in progress by Rommel Marcelo. + + * LPC2148 Boards: + + - Add basic support for the The0.net ZP213x/4xPA board (with the LPC2148 + and the UG_2864AMBAG01 OLED). + - Add an nxlines configuration for the ZP213x/4xPA (with the LPC2148 + and the UG_2864AMBAG01). + + * Simulator: + + - Add an nxlines configuration for the simulator. + + * Networking: + + - Add logic to work around delayed ACKs by splitting packets + (contributed by Yan T.). + - Split net_poll() to create the internal interface psock_poll(). + + * LCDs: + + - Added support for LCD1602 alphanumeric LCD (HD4468OU controller). + + * Graphics: + + - Added 5x8 monospace font. This tiny font is useful for graph + labels and for small bitmapped display. Contributed by Petteri + Aimonen. + + * Build System: + + - Add an options to better manage toolchain prefixes. + - Redesigned how the context targer works in the apps/ directory. + The old design caused lots of problems when changing configurations + because there is no easy way to get the system to rebuild the + context. This change should solve most the problems and eliminate + questions like "Why don't I see my builtin application in NSH?" + + * Kconfig Files: + + - There are several new configurations that use the kconfig-frontends + tools and several older configurations that have been converted to + use these tools. There is still a long way to go before the conversion + is complete: + + configs/sim/nxwm + configs/sim/nsh + configs/stm3220g-eval/nxwm + configs/stm32f4discovery/posix_spawn + configs/olimex-lpc1766stk/nsh + configs/olimex-lpc1766stk/hidkbd + configs/olimex-lpc1766stk/nettest + configs/open1788/ostest + configs/stm32f4discovery/nsh + configs/stm32f4discovery/usbnsh + configs/lm326965-ek (all configurations) + configs/mcu123-214x/nsh + configs/ubw32/ostest + + * Tools: + + - tools/kconfig.bat: Kludge to run kconfig-frontends from a DOS shell. + - tools/configure.c: configure.c can be used to build a work-alike + program as a replacement for configure.sh. This work-alike + program would be used in environments that do not support Bash + scripting (such as the Windows native environment). + - tools/configure.bat: configure.bat is a small Windows batch + file that can be used as a replacement for configure.sh in a + Windows native environment. configure.bat is actually just a + thin layer that executes configure.exe if it is available. If + configure.exe is not available, then configure.bat will attempt + to build it first. + + * Applications: + + - New and modified examples: + + apps/examples/wlan: Remove non-functional example. + apps/examples/ostest: Added a test of vfork(). Extend signal + handler test to catch death-of-child signals (SIGCHLD). Add a + test for waitpid(), waitid(), and wait(). + apps/exampes/posix_spawn: Added a test of posix_spawn(). + + - NSH: + + NSH now supports re-direction of I/O to files (but still not from). + The block driver source argument to the mount command is now + optional for file systems that do not require a block driver. + NSH can now execute a program from a file system using posix_spawn(). + Added support for a login script. The init.d/rcS script will be + executed once when NSH starts; the .nshrc script will be executed + for each session: Once for serial, once for each USB connection, + once for each Telnet session. + + - Supports a new daemon that can be used to monitor USB trace outpout. + - Removed non-functional wlan example. + +Bugfixes (see the ChangeLog for details). Some of these are very important: + + * Tasking: + + - Fixed a *critical* task exit bug. Here is the failure scenario: + (1) sched_lock() is called increments the lockcount on the current + TCB (i.e., the one at the head of the ready to run list), (2) + sched_mergepending is called which may change the task at the head + of the ready-to-run list, then (3) sched_unlock() is called which + decrements the lockcount on the wrong TCB. The failure case that + I saw was that pre-emption got disabled in the IDLE thread, locking + up the whole system. + + * Signals: + + - sigtimedwait() would return a bad signal number if the signal was + already pending when the function was called. + + * Drivers: + + - Some SD cards will appear busy until switched to SPI mode for + first time. Having a pull-up resistor on MISO may avoid this + problem, but this fix from Petteri Aimonen makes it work also + without pull-up. + + * STM32 Drivers: + + - STM32 FLASH driver counting error (from Freddie Chopin). + - STM32 F4 maximum SPI frequency was wrong (corrected by Petteri + Aimonen). + + * STM32 Boards + + - Due to cloning of untested code, the logic to control on-board + LEDs did not work on any STM32 boards. + - Serial devices number /dev/ttyS0-5 is there is a serial console, + but /dev/ttyS1-6 if there is no serial console. + + * Binary Formats + + - C++ static constructors execute now using a start taskhook + so that they execute in the context of the child task (instead + of in the context of the parent task). + + * File Systems: + + - Several FAT-related bugs fixed by Petteri Aimonen. + + * Networking: + + - Fix poll/select issure reported by Qiang: poll_interrupt() must call + net_lostconnection() when a loss of connection is reported. Otherwise, + the system will not remember that the connection has been lost and will + hang waiting on a unconnected socket later. + - Similar issues corrected for recvfrom() and send(). + - Telnetd would hang in a loop if recv() ever returned a value <= 0. + + * Libraries: + + - fread() could hang on certain error conditions. + - Can't handle SYSLOG output to a character device from the IDLE task + (because the IDLE task can't block). + + * Build System: + + - Serial was driver was not being built if there is no console + device. Obviously, the serial driver may be needed even in + this case. + + * Additional Bugfixes: + + - sig_timedwait() and clock_time2ticks.c: Timing "rounding" logic + - ARM9 Compilation issue with low vectors. + - readline() return value + - Others as detailed in the ChangeLog: HID keyboard, LPC17xx bit + definitions, strndup(), PL2303, SYSLOG error handling, AT25, + apps/examples. + +NuttX-6.26 +---------- + +The 93rd release of NuttX, Version 6.26, was made on March 15, 2013, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.26.tar.gz and +apps-6.26.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release corresponds with SVN release number: r5745 + +Note that all SVN information has been stripped from the tarballs. If you +need the SVN configuration information, you should check out directly from +SVN. Revision r5745 should equivalent to release 6.26 of NuttX: + + svn checkout -r5745 svn://svn.code.sf.net/p/nuttx/code/trunk nuttx-code + +Or (HTTP): + + svn checkout -r5745 http://svn.code.sf.net/p/nuttx/code/trunk nuttx-code + +Additional new features and extended functionality: + + * OS Initialization: + + - Add an additional call-out to support board-specific driver + initialization during the boot-up phase (available with + CONFIG_BOARD_INITIALIZE=y). + + * Tasking: + + - New interface task_spawn() that is like posix_spawn(), but uses + entry point addresses like task_create(). + - Additional data restructuring as a continuation of the task group + changes of NuttX 6.25. These data structures were moved from the + TCB structure into the task group: pthread join data, + atexit/on_exit callbacks, waitpid data structures, and message + queues. + - TCBs for tasks and pthreads are now separate structures. This + saves a little memory since tasks do not have to carry the overhead + for threads and vice versa. + + * Kernel Build: + + - Extensive changes were made to support the kernel build mode. In + this mode, NuttX is built as a monolithic kernel. NuttX is built + as a separate kernel mode "blob" and the applications are built + as a separate user mode "blob". The kernel runs in kernel mode and + the applications run in user mode (with the MPU restricting user + mode accesses). Access to the kernel from the user blob is only + via system calls (SVCalls). + - Extensive changes were made to the syscall, SVCall, and trapping + logic. Many internal interfaces were renamed. + - The memory manager was extended to support both kernel- and user- + mode allocations. Logic within the kernel needs to use the + correct kernel- or user-space allocator, depending upon the user + of the allocated memory. + - The user-space blob now contains a header built in at the beginning + of the block that provides the same information that was previously + provided by a kludgy, auto-generated header file (user_map.h). + - Basic support implemented for the ARMv7-M family with fragments + also implemetned for the ARMv6-M and MIPS32 families. + - Kernel build supported added for the LPC17xx Open1788 and for + the Atmel SAM3U-EK board. All testing is being performed on the + Open1788 board. + + * Signals: + + - Delivery of signals to threads within a task group is now compatible + with the way that signals are delivered to threads within a process. + + * Drivers: + + - Add a driver for the SST29VF NOR FLASH parts. + - USB device trace/debug feature extended to decode device-specific + trace events to make the trace output more readable (from Petteri + Aimonen). + - USB MSC device driver can not support names of differing sizes + in the USB descriptor and the SCSI fields (from Petteri Aimonen). + - Locking added to MMC/SD SPI drivers so that MMC/SD can co-exist on + the same bus as other SPI devices. Frequency is reset each time + that the MMC/SD SPI has the bus locked. (from Petteri Aimonen). + + * ARMv6-M (Cortex-M0): + + - Added support for the ARM Cortex-M0 family. + + * nuvoTon NUC120: + + - Added support for the nuvoTon NUC120 MCU (Cortex-M0). + + * nuvoTon NUC120 Boards: + + - Added basic support for the nuvoTon NuTiny-SDK-NUC120 board (Cortex-M0). + + * LPC17xx: + + - Added support for the LPC177x and LPC178x families. Most of this is + the work of Rommel Marcelo. + + * LPC17xx Boards: + + - Added support for Zilogic System's ARM development Kit, ZKIT-ARM-1769. + From Rashid. + - The port for the WaveShare Open1788 board is now functional. Basic + OS test and NuttShell (NSH) configurations are functional. More + driver development and testing is needed (from Rommel Marcelo). + + * LPC17xx Drivers: + + - Added an SD card MSI driver for the LPC178x. The driver is marginally + functional but requires DMA capability to be reliable. + + * STM32 + + - Support extended to handle the STM32 F3 family (Cortex-M4 with F1-like + peripherals). + + * STM32 Boards + + - Added support the STMicro STM32F3Discovery board (STM32 F3). + + * Stellaris LM3S/LM4F + + - Basic support for the LM4F120 family is in place, but untested (mostly + from Jose Pablo Carballo). + + * Stellaris LM4F Boards + + - Add support for the LM4F120 LaunchPad (untested). + + * Networking: + + - select() should now allocate a little less memory. + + * Memory Management: + + - Extended to support multiple heaps. This is used as part of + the kernel build in order to support separater user- and + kernel-mode heaps. + - The stand-alone memory manger test had to be removed. It + was too entangled and made extension of the memory manager + nearly impossible. This is a loss. + + * Build System: + + - Several configurations converted to use the kconfig-frontends + configuration tool. There are still many more that need to + be converted. + + * C Library: + + - Move the workqueue logic into the C library. There is now a + special user-space version of the work queue (which will only + be used with a NuttX kernel build). + - Implementation of itoa() contributed by Ryan Sundberg. + + * Applications: + + - The NSH builtin task logic now uses task_spawn() to start builtin + applications. + - The OS test now includes a test cased to verify task_restart(). + +Efforts In Progress. The following are features that are partially +implemented but present in this release. Most are expected to be fully +available in NuttX 6.27. + + * LM4F120 LaunchPad port. Code is in place, but nothing has been tested. + + * WaveShare Open1788 port. This port as actually complete and + functional. However, there is still ongoing development and + testing of drivers. + + * Kernel Build. Much progress has been made, but there kernel build is + not yet fully functional due to several user resources that are not yet + properly disentangled from the kernel blob. + + * Conversion of old configurations to use the kconfig-frontends + tool is an ongoing effort that will continue for some time. + +Bugfixes (see the ChangeLog for details). Some of these are very important: + + * Tasking: + + - The wrong PID was being signalled with SIGCHILD. It should be + the PID of the task that create the task group, not the ID of + the last thread to leave the task group. + - Added logic so that some internal resources and states are recovered + when tasks are deleted or restarted. Handle cases where there are + outstanding timed events pending when tasks are deleted or restarted. + + * ARMv7-M: + + - Several fixes to the MPU control logic. + + * Drivers: + + - Removable serial drivers race conditions fixed. + - MAX11802 timing bug (from Petteri Aimonen). + + * STM32 Drivers: + + - Handle cases were SPI DMA logic fails if sem_wait is awakened + by a signal. Need to clear error flags to prevent corruption of + subsequent transfers. Also, bit count should not be changed while + the SPI peripheral is enabled (from Petteri Aimonen). + - Fixes to the OTG FS device driver from Petteri Aimonen. + - Fix typos in DMA register header file (from Yan T.) + + * Graphics: + + - Correction to the hyphen in the SANS 17x22 font (from Petteri + Aimonen). + + * Networking: + + - Corrected errors in the socket poll/select logic. Additional + state logic was needed to detect if the socket is still connected + before starting the poll wait. (bug reported by Qiang Yu). + + * Memory Management: + + - mallinfo() should hold the memory manager semaphore (from Petteri + Aimonen. + + * Build System: + + - Resolved several build errors reported by Mike Smith. + + * Applications: + + - Fixed an NSH memory leak: Needed to detach after creating each + pthread. + - readline() now returns EOF on any failure (instead of a negated + errno value). This is because the underlying read is based on + logic similar to getc. The value zero (meaning end-of-file) + was being confused with a NUL. So if a NUL was received, the + NSH session would terminate because it thought it was the end of + file. + +NuttX-6.27 +---------- + +The 94th release of NuttX, Version 6.27, was made on April 28, 2013, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.27.tar.gz and +apps-6.27.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * OS Initialization: + + - Add missing registration of /dev/zero. Registration of /dev/null + should depend upon conditional compilation. From Ken Pettit. + + * Tasking: + + - Added a new interface to set aside memory on the task's stack. This + is used (at least in the kernel build) to hold task arguments. + - Remove up_assert_code(). One assertion routine is enough. + + * Kernel Build: + + - Extensive changes were made to support the kernel build mode. In + this mode, NuttX is built as a monolithic kernel. NuttX is built + as a separate kernel mode "blob" and the applications are built + as a separate user mode "blob". The kernel runs in kernel mode and + the applications run in user mode (with the MPU restricting user + mode accesses). Access to the kernel from the user blob is only + via system calls (SVCalls). + - Kernel build configurations for the Open1788 board and for the + STM32F4Discovery now execute correctly. + - Changes were made to task and thread start-up routines, signal + handling, data structures, ARMv7-M SVCalls, stack management + interfaces, + + * Drivers: + + - Driver for the ST7567 LCD Display Module from Univision Technology + Inc. Contributed by Manikandan.S + - SPI initialize functions renamed so that multiple SPI blocks can + be initialized. + - Extended to support the RAMTRON FM25V01 device. Contributed by + Lorenz Meier + - Serial drivers: TIOCSERGSTRUCT ioctls now conditioned on + CONFIG_SERIAL_TIOCSERGSTRUCT + + * ARMv7-M (Cortex-M3/4): + + - Added support for modifiable interrupt vectors in RAM + + * nuvoTon NUC1xx: + + - Added kernel build support + + * Freescale Kinetis: + + - Add kernel build support + - Add support for the Kinetis L family of Cortex-M0+ MCUs. Contributed + by Alan Carvalho de Assis. + + * LPC17xx: + + - Now holds off sleep mode in the IDLE loop is DMA is in progress + (because sleep mode will disable CPU SRAM). + + * LPC17xx Boards: + + - ZKIT-ARM-1769: Now supports the ST7567 LCD display module. Added + an nxhello configuration for testing (Manikandan.S). + - ZKIT-ARM-1769: Add support for both CAN1 and CAN2. Contributed by + M.Kannan + + - Open1788: Basic support for the WaveShare Open1788 board is complete + with working OS test, NSH, and graphics configurations. + - Open1788: Integrated the LPC178x LCD driver with the WaveShare display. + Touchscreen support is included, howerver, there appears to be an + issue with the Open1788 touchscreen interrupt signal. + - Open1788: Now supports SDRAM (used to provide the LCD framebuffer). + - Open 1788: Reversed sense of the IDLE LCD. It is now off when the + LPC17 is sleeping and on when awake. That is much a better visual + indication of the dynamic CPU load + + * LPC17xx Drivers: + + - Added an LCD framebuffer driver for the LPC177x/8x family. + - Implemented LPC17xx GPDMA support. + - Integrated the LPC17xx GPDMA support into the SD card driver. + - SSP driver adapted to work with the LPC178x family. + - Separate LPC176x and LPC178x GPIO logic; this logic is too different + to maintain in one file with conditional compilation. + - Re-design of the GPIO logic for the LPC178x family by Rommel Marcelo. + + * LPC43xx: + + - Added kernel build support + + * STM32: + + - Added support for kernel mode build. + - Added architecure support for the STM32 F427/F437 chips. Contributed + by Mike Smith + + * STM32 Boards: + + - Added a configuration to support a kernel mode build of the OS test + on the STM32F4Discovery + + * Stellaris LM3S/LM4F: + + - Added kernel build support + - Added support for the 7 UARTs on the LM4F120 + + * Stellaris LM4F Boards: + + - Added scripts and instructions to simplify use of OpenOCD with ICDI + (JP Carballo) + - The basic for the Stellaris LM4F120 Launchpad is complete. This + includes support for OS test and NSH configurations. Additional + driver development is needed. + + * Build System: + + - Directories where the same sources files are used to build different + objects in the first and second pass kernel builds need to keep those + objects in separate directories so that they are not constantly + rebuilt. + + * Applications: + + - apps/system/ramtest: Add a simple memory test that can be built + as an NSH command. + + * Tools: + + - kconfig2html is a new tool which will replace the hand-generated + documentation of the NuttX configruation variables with auto- + generated documentation. + +Efforts In Progress. The following are features that are partially +implemented but present in this release. Most are expected to be fully +available in NuttX 6.28. + + * A port to the Freescale Freedom KL25Z is complete but not yet stable + enough. The KL25Z is a low-cost Cortex-M0+ part with 128KB of FLASH + and 16KB of SRAM. This is is the effort of Alan Carvalho de Assis. + + * Conversion of old configurations to use the kconfig-frontends + tool is an ongoing effort that will continue for some time. + At this time, only 32% of the configurations have been converted + to use the kconfig-frontends tools. + +Bugfixes (see the ChangeLog for details). Some of these are very important: + + * Tasking: + + - Fixed a critical bug: When there is pending C buffered output + and the system is very busy, the a pthread may be blocked at + a critical point when trying to exit. Blocking at this critical + point would cause crashes. All entire task/thread exit logic + paths were reviewed and failsafe mechanisms were put in place + to assure that exitting tasks never block after task teardown + has been started. + + * ARMv6-M: + + - Fixed parameter passing for all system call inline functions with > 3 + parameters + - Fixed a major problem: The Cortex-M0 has no BASEPRI register but the + logic of NuttX-6.26 was using it to manage interrupts. Switch to + using the PRIMASK instead. This means that hardfaults will (again) + occur when SVC instructions are executed + + * ARMv7-M: + + - Corrected Correct MPU sub-region settings for unaligned regions. + - In exception handling with CONFIG_NUTTX_KERNEL, need to explicitly + set and clear the privilege bit in the CONTROL + - Fixed parameter passing for all system call inline functions with > 3 + parameters + + * Drivers: + + - Support for O_NONBLOCK was not supported in the "upper half" + serial driver. + - PL2303 compilation errors + + * Stellaris LM3S/4F: + + - Corrected typos in alternate function definitions. + + * LPC17xx Drivers: + + - Added a work-around for an ADC errata. From Chris Taglia + - Only one ADC pin was configured. Need to configure all that + are in the ADC0 set. From MKannan + + * File Systems: + + - The FAT logic was not making a distinction between directory + non-existence and file non-existence so when it you try to + create a file in a non-existent directory, it would create a + file with the name of the missing directory. Reported by Andrew + Tridgell + - Several fixes to the FAT file system from Ronen Vainish. These + fixes mostly involve the logic to extend directory clusters for + the case of long file names but also include a few important + general fixes (such as for storing 32 bit FAT values) + - mkfatfs was writing the boot code to the wrong location. From + Petteri Aimonen + + * Networking: + + - Fixed a compilation error when socket options are are disabled. + Reported by Daniel O'Connor + + * C Library: + + - Corrected an error in sscanf. If %n occurs in the format statement + after the input data stream has been fully parsed, the %n format + specifier will not be handled. Reported by Lorenz Meier + - strchr(str, '\0') should return a pointer to the end of the string, + not NULL. From Petteri Aimonen + + * Build System: + + - Fix naming of NuttX target if EXEEXT is defined. + + * Applications: + + - OS test: Fix timing error in non-cancelable thread test. + - NSH: Correct the test of the skip input parameter. Was limiting the + range to <= count. From Ken Petit. + +NuttX-6.28 +---------- + +The 95th release of NuttX, Version 6.28, was made on June 14, 2013, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.28.tar.gz and +apps-6.28.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * File Systems: + + - SMART FLASH file system (contributed by Add Ken Pettit). + + * MTD (FLASH) Drivers: + + - Add support of MTD partitions via a new MTD driver that manages a + set of MTD devices, each managing a subset of the FLASH region + managed by the parent MTD driver. + - Extended the MTD interface to provide an (optional) method to + perform byte oriented writes if supported by the FLASH part. + - M25Px driver re-architected to use the byte write capability (when + possible) and to use 4KB sectors for the erase block size when the + part supports it (from Ken Pettit). + + * LCD Drivers: + + - New interface definitions to support audio devices (from Ken Pettit) + and alphanumeric, segment LCDs. + + * Wireless Drivers: + + - Added new driver for the wireless nRF24L01+ transceiver (from + Laurent Latil). + + * Calypso: + + - Added support for the Pirelli DP-L10 phone (from Craig Comstock via + Alan Alan Carvalho de Assis) + + * STM32: + + - Added an option to conditionally disable the "wfi" sleep mode. This + is needed with certain JTAG debuggers to prevent the debug session + from being disconnected (from Ken Pettit). + - Added support for the STM32L (STM32L15X/STM32L16x) family. + - Added STM32F103C4 and F103C8 chip support (from Laurent Latil). + - Added a new interface function, stm32_dmacapable() that can be used + to determine if DMA is possible from the specified memory address + (from Petteri Aimonen) + + * STM32 Drivers: + + - If CONFIG_STM32_DMACAPABLE is defined, the STM32 SPI driver now uses + stm32_dmacapable() to determine if it is possible to perform DMA + from the specified address. This change is important for the STM32 + F4 which may have SPI data buffers allocated on the stack in CCM + memory which cannot support the DMA (from Petteri Aimonen). + + * STM32 Boards: + + - Support added for the MikroElektronika Mikromedia for STM32F4 + development board (from Ken Pettit) with the MIO283QT2 LCD and + touchscreen. Several graphics configurations are included. + - The HY-mini STM32v board now uses the common SSD1289 driver + and supported the card detect interrupt. Several new + configurations also added and some removed (from Laurent Latil). + - Support added for the R65105-based LCD that comes with some + HY-Mini STM32v boards (from Christian Faure). + - Added basic support for the STM32L-Discovery board. Drivers + for the on-board segment LCD are included. + - Added support for the STM32 Tiny development board based on the + STM32 F103C8T6 MCU. This includes support for the nRF24L01+ + wireless on the board (from Laurent Latil). + + * Stellaris LM3S/LM4F: + + - Support added for a TI/Stellaris internal FLASH MTD driver (from Max + Holtzberg). + + * Stellaris LM4F Boards: + + - The LM3S6965-EK now has configurations for the UDP discovery tool and + for the TCP echo server (both from Max Holtzberg) + + * Atmel ATSAM3/4: + + - Reorganized, renamed, and updated directory structure to better + support additional members of the SAM3/4 family. + - Added support for both the ATSAM4S and ATSAM4L families. The + ATSAM4S is similar to the ATSAM3U, but the ATSAM4L is quite a + different beast, really much more akin to the AVR32s SoCs but + with a Cortex-M4. + + * Atmel ATSAM3/4 Boards: + + - Added support for the Atmel SAM4L Xplained Pro development board. + This board features the ATSAM4LC4C MCU (Cortex-M4 with 256KB FLASH + + 32KB SRAM). + - Added support for the Atmel SAM4S Xplained developement board. This + board features the ATSAM4S16C MCU (Cortex-M4 with 1MB FLASH + 128KB + SRAM). + + * PIC32MX Boards: + + - Added support for the 1602 segment LCD on-board the Sure PIC32MX + board. This board will now also support a USB NuttX console and + the USB monitor test program. + + * Build System: + + - Clean-up of almost all .gitignore files: Made scope of ignore to be + only the current directory; Ignore .dSYM files in directories where + .exe's may be built. Also, in Makefiles, clean .dSYM files in + directories where an .exe may be built. + - Standardize and consolidated all build-as-an-NSH-application + configuration settings. Now only CONFIG_NSH_BUILTIN_APPS is + sufficient to build an application, test, or or example as an NSH + builtin application. + - Added support for a generic ARM, ARMv6-M and ARMv7-M Windows EABI + toolchains. + + * Libraries: + + - Added encoder/decoder logic to marshal and serialize special segment + LCD (SLCD) commands intermixed with normal ASCII data. This is the + similar to the encoding/decoding logic that is used to marshal + special commands from a keyboard. + - Add dprintf() and vdprintf() (the latter from Andrew Tridgell). + - Add an application that may be built as an NSH builtin command that + will erase FLASH using a flash_eraseall NSH command (from Ken Pettit). + + * Applications: + + - Added an MTD partition test/examples. Currently used with (1) the a + simulation configuration to test MTD partitions on a RAM emulation + of FLASH and (2) with the Mikroe STM32F4 configuration. + - Added a test/example to verify alphanumeric, segment LCDs. + - Added a simple single threaded, poll based TCP echo server based + on W. Richard Stevens UNIX Network Programming Book (from Max + Holtzberg). + - Added several tests of the SMART block driver and file system (from + Ken Pettit). + - Added a runtime configuration for the UDP discover utility (from + Max Holtzberg). + - Added an example application to demo the nRF24L01 driver (from + Laurent Latil). + - New and modified NSH commands: + Added a -h option to the df command to show the volume information + in human readable form (from Ken Petit). + Add a new mksmartfs command (from Ken Petit). + +Efforts In Progress. The following are features that are partially +implemented but present in this release. Most are expected to be fully +available in NuttX 6.28. + + * Audio System: + + - A complete audio subsystem include CODECs, higher level management, + interface definitions, and audio drivers was contributed by Ken + Pettit. This work has not been completely verified as of this + release and so is categorized as a work-in-progress. At present, + progress is blocked due to issues interfacing with the VS1053 + audio DAC on the Mikroe STM32F4 board. + + * kconfig-fronted Configuration: + + - Conversion of old configurations to use the kconfig-frontends + tool is an ongoing effort that will continue for some time. + At this time, only 43% of the configurations have been converted + to use the kconfig-frontends tools. + +Bugfixes (see the ChangeLog for details). Some of these are very important: + + * Tasking: + + - Modify assertion in the priority inheritance logic that is reported + to cause false alarm assertions. + + * Kernel Build: + + - Typo in syscall proxying logic corrected by Ken Pettit. + + * Networking: + + - Poll setup/teardown logic should ignore invalid (i.e., negative) + file descriptors (from Max Holtzberg). + - When readahead data is available, the network poll() logic should + set POLLIN (or POLLRDNORM), not POLLOUT (from Max Holtzberg). + + * LCD Drivers: + + - Correct power controls in the MIO283QT2 LCD driver. + + * USB Device Controller Drivers: + + - Change the default IN request buffer size from 64 to 96. This will + avoid requests of exactly MAXPACKET size and, hence, avoid so many + NULL packets. Also, fix the OUT request buffers size to exactly the + max packet size. It really cannot be any other size. + + * STM32 Drivers: + + - Correct some bad STM32 F1 DMA definitions that crept into the system + a few months ago a broke STM32 F1 DMA (from Laurent Latil) + - Fixed an error in NULL packet handling in the STM32 F1 USB device + controller driver: If the NULL-packet needed flag ever got set, + then it was not being cleared and infinite NULL packets resulted. + This only affects the CDC/ACM class and was the cause of the + failures using the USB CDC/ACM device as a NuttX console. With this + change the USB works well as an alternative NuttX console device for + the STM32 F1 family. + - Correct some bad condition compilation in the RCC logic (CONFIG_ + missing from setting names). This affects some STM32 FLASH pre- + fetch settings (from Lorenz Meier). + - Change for hardware flow control support for STM32. The change also + fixes incorrect operation of USART2 and UART5 in current master + (from Lorenz Meier and Mike Smith). + - Fixed a backward conditional in USB OTG FS host controller driver + that prevented detection of disconnection events (from Scott). + + * LPC17xx Drivers: + + - I2C interrupt control. Also correction for a single byte read + timeout error (from M. Kannan). + + * Freescale Kinetis: + + - Freedom KL25Z pin multiplexing and LED control corrections (from + Alan Carvalho de Assis) + + * PIC32MX: + + - Fix NULL packet handling in the PIC32 USB device driver. Without + this fix the CDC/ACM driver cannot be used reliably with the PIC32 + USB. With this change the USB works well as an alternative NuttX + console device. + + * Graphics: + + - Default priorities for NxWidget and NxWM threads should be 100, + not 50, to be consistent with other default priorities. + + * Applications: + + - Remove the CONFIG_EXAMPLES_NXTEXT_NOGETRUN option from the NXTEXT + example. The test logic was bad for the case where this options is + not selected. Also, completed the empty Kconfig file. + - C++ name mangling was occurring when this example is built as an NSH + built-in application causing the entry to be undefined when called + from C code. + - Add some missing NSH library configuration values (from Lorenz + Meier). + +NuttX-6.29 +---------- + +The 96th release of NuttX, Version 6.29, was made on July 31, 2013, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.29.tar.gz and +apps-6.29.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * Drivers: + + - Generalized the SSD1306 driver and added support UG-2832HSWEG04 + which is very similar to the existing support for the + UG-2864HSWEG01. + - Added support for a generic bit-bang SPI driver. This includes + both a common "upper half" driver as well as a platformp-specific + "lower half" dirvers based on a common "template." + + * ARMv7-A, Cortex-A5 + + - Added support for the ARMv7-A architecture and the Cortex-A5 in particular. + + * ARMv7-M, Cortex-M3/4 + + - Modified how some registers are copied during a context switch (with + lazy FPU register saving). This should save some context switching + time when the context switch is due to interrupt level processing. + + * STM32: + + - Added support for a separate CCM heap. This may be useful for + segregating allocations for CCM (which cannot be used for DMA) + from other allocations (that may be used used for DMA). + + * STM32 Drivers: + + - DAC: Added support for DAC DMA (contributed by John Wharington). + - I2C: An I2C driver for the STM32 F3 family (from John Wharington). + + * Atmel AT91 SAM/4: + + - Add support for SAM3X and SAM3A chips + + * Atmel AT91 SAM/4 Drivers: + + - Re-architect the SAM3/4 SPI driver so that is it compatible with the + SPI drivers of other MCUs. + - Added register definition file for the SAM4L LCD peripheral. + - Added SAM4L PDCA register definition file + + * Atmel AT91 SAM/4 Boards: + + - SAM4L-Xplained: Added support for the SPI-based SD card on the I/O1 + module. + - SAM4L-Xplained: Added a driver for the LED1 segment LCD module. + - SAM4L-Xplained: Added support for the UG-2832HSWEG04 OLED on the + SAM4L Xplained Pro's OLED1 module + - SAM4S-Xplained: Added support for on-board 1MB SRAM + - Arduino Due: Basic support for the Arduino Due (SAM3X) is now + included. + - SAM3U-EK: The touchscreen is now functional. + + * Atmel AT91 SAMA5D3 + + - Added support for the Atmel AT91SAMA5D3 Cortex-A5 chip family. + + * Atmel AT91 SAMA5D3 Boards + + - Added support for the Atmel SAMA5D3x-EK boards which use the AT9 + SAMA5D3x chips (x=1,3,4,5). + + * Freescale KL25Z Drivers + + - Freescale KL25Z TSI register definitions and example TSI driver for + the Freedom KL25Z board from Alan Carvalho de Assis. + - Added SPI driver and register definitions for the Freescale KL25Z. + - Added a framework for controlling SPI-related discrete inputs and + outputs. Taken from work by Alan Carvalho de Assis + + * Build System: + + - New sub-directories to hold SPI-related files: includes/nuttx/spi.h + moved to include/nuttx/spi/.; SPI-related Kconfig info moved from + drivers/Kconfig to drivers/spi/kconfig. + - Finally... I changed the naming of configuration variables like + CONFIG_DRAM_ to CONFIG_RAM_. This has bothered me for a long time + since most boards don't have DRAM. The more generic RAM naming + should not produce so much cognitive dissonance + + * Libraries: + + - Added CRC16 support. + + * Applications: + + - Added Zmodem file transfer support. This may be used as an embedded + library or may be built as 'sz' and 'rz' commands that can be + executed from NSH. + - C++ initializers should be set once and, preferably, in the context + of the task that uses any C++ statically initialized classes. This + only becomes an issue if cxxtest or helloxx are built as NSH builtin + applications. Then you want the initialization done in cxxtext or + helloxx and not in NSH (and certainly not twice). Added + configuration options to control who does the C++ initialization. + NSH now does not do C++ initialization be default and must be + configured to do otherwise. Conversely, cxxtest and helloxx + will always do C++ initialization unless configured do otherwise. + - examples/cxxtext: Add ostream test as provided by Michael. + - NSH: Added a 'cmp' command that can be used to compare two files + for equivalence. Returns an indication if the files differ. + Contributed by Andrew Tridgell (via Lorenz Meier). + +Efforts In Progress. The following are features that are partially +implemented but present in this release. They are not likely to be +completed soon. + + * Audio System: + + - A complete audio subsystem include CODECs, higher level management, + interface definitions, and audio drivers was contributed by Ken + Pettit. This work has not been completely verified as of this + release and so is categorized as a work-in-progress. At present, + progress is blocked due to issues interfacing with the VS1053 + audio DAC on the Mikroe STM32F4 board. + + * kconfig-fronted Configuration: + + - Conversion of old configurations to use the kconfig-frontends + tool is an ongoing effort that will continue for some time. + At this time, only 45% of the configurations have been converted + to use the kconfig-frontends tools. + +Bugfixes (see the ChangeLog for details). Some of these are very important: + + * File Systems: + + - Fixed compilation error if no file systems are enabled: Change + error to ERROR. + - Read-Ahead/Write buffering: Correct typos that can cause failures + in some configurations (From Chia Cheng Tsao). + + * Drivers + + - Remove the wait for the touchscreen busy bit in the ADS7843E driver. + From my reading of the ADS7843 spec, it would not be appropriate to + wait for the BUSY bit to de-asserted anyway (since it is only de- + asserted when we read the data). Most boards do not even bother to + provide the BUSY bit. + - MMC/SD SPI based driver: Driver needs to make sure that the SPI + mode and data width are correct. + - ENC28J60: Change buffer ordering to work around Errata. From Dave + (ziggurat29). + + * USB Device Controller Drivers: + + - Fixed a typo in the composite device driver unitialization logic. + DEV1 should be DEV2 in one case. + - usbdev.h: Fix some typos that cause compiler errors when + CONFIG_USBDEV_DMA and CONFIG_USBDEV_DMAMEMORY are selected (From + Chia Cheng Tsao). + + * ARM9: + + - Fix a bug (uninitialized register error) that crept in the ARM9 + boot-up code several years ago. Obviously no one has used the + ARM9 NuttX port for years! + + * STM32 Drivers: + + - Fix STM32 OTF FS endpoint allocation logic. Apparently the same + endpoint can be allocated as both an IN or an OUT endpoint. The + existing implementation only supported one allocation, either IN or + OUT. This resulted in failures to allocate endpoints when used with + the CDC/ACM + MSC composite driver (From Chia Cheng Tsao). + - SDIO: Add support for the data block end (DBCKEND) interrupt to + terminate transfers (From Chia Cheng Tsao). + - DAC: Fixed numerous DAC driver errors and added support for DAC + DMA (contributed by John Wharington). + + * SAM3/4: + + - SAM4S: Correct configuration of PIO pins for SAM4S B and C peripherals. + - Need to disable write protection before configuring PIO pins. + - GPIO configuration logic must protect against re-entrancy. + - Clocking must be applied to the SMC module for the 3X and 3A family in + order for the NFC SRAM to be functional. + - Fixed some errors for interrupts on ports D-F. + + * SAM3/4 Drivers: + + - Common SPI driver: Fix SPI mode setting. In the SAM3/4 family, the + clock phase control (CPHA) is inverted (NPHA). Also fixed an + incorrect pointer test. Was checking if the wrong pointer was NULL. + + * SAM3/4 Boards: + + - SAM3U-EK: Fix polarity of the /PENIRQ signal (it is active low). + The SAM3U-EK board now runs at 96MHz. + + * Applications: + + - apps/examples/nxhello: Minor fix for compilation error when the + display resolution is low (< 8bpp) due to a typo that has been there + for a long time. Also Correct default colors when in Y1 code mode. + - apps/system/ramtest: The RAM test was not correctly built + into the configuration and build system. + - apps/examples/composite: Change to prevent some false alarm debug + assertions (From Chia Cheng Tao). + +NuttX-6.30 +---------- + +The 97th release of NuttX, Version 6.30, was made on September 14, 2013, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.30.tar.gz and +apps-6.30.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * Common Drivers: + + - Extended TERMIOS support for serial and CDC/ACM drivers. From + Mike Smith, Andrew Tridgell and Lorenz Meier. + - Added option to disable serial port reordering. From Lorenz Meier. + - Several changes to the USB host control interface and extensions to + common USB host logic to handle host controllers with multiple + downstream ports in the root hub. + - USB device tracing: Extended decoding and stringifying of USB trace + output to include trace output from class drivers. + - USB host tracing: Added support for USB host tracing similar in + some ways to USB device tracing: Stringification is an inherent + part of the trace decoding (not an option). Only available in the + SAMA5 USB host drivers now. + + * Networking / Network Drivers + + - Support for the Microchip ENCX24J600 Ethernet driver from Max + Holtzberg + - CC3000 Networking. Initial support for the TI CC3000 network + module on the Freescale Freedom-KL25Z board from Alan Carvalho + de Assis. This is still a work in progress. + + * ARMv7-A, Cortex-A5 + + - Restructured some MMU-related logic and header files. + - Hooks added for Cortex-A8, but not yet used. + + * STM32 Drivers: + + - STM32 SPI: nbits() interface extended to control bit order as well + as bit width (from Teemu Pirinen) + + * STM32 Boards + + - Olimex STM32-P107: Incorporate ENCX24J600 networking for the Olimex + STM32 P107 board. + - LeafLabs Maple Board: Add board support for the LeafLabs Maple and + Maple Mini boards. From Librae. + + * Atmel AT91 SAMA5D3x + + - Added support for the SAMA5 DMAC controllers. + - DMA-capable drivers for the SAMA5 SPI peripherals. + - DMA-capable HSCMCI 0/1/2 drivers. + - Support for PIO interrupts + - Utilities for intelligent conversions between physical and virtual + addresses. + - Added USB host controller drivers for both the OHCI (low- and full- + speed) peripheral and the ECHI (high-speed) peripheral. + - Added USB device controller for the SAMA5 UDPHS peripheral (full- + and high-speed). + - Added a Two Wire (TWI) driver. This is a variant of I2C. + + * Atmel AT91 SAMA5D3x-EK Development Boards + + - Now supports onboard SDRAM. Modified heap initialization logic + to include SDRAM if configured. + - Integrated a FAT file system on the on-board SPI-based AT25 serial + FLASH + - Integrated HSMCI0 and HSMCI1 support for the microSD and full file + SD card slots. Includes PIO interrupts for card detection events. + - Integrated USB OHCI and ECHI host and high-speed peripheral support. + File system on AT25 now exported via Mass Storage Class. Includes + PIO VBUS controls. + - Integrated the TWI driver and the I2C tool. Added support for an + external AT24 serial EEPROM. + + * Applications: + + - apps/examples/cc3000. Initial support for the TI CC3000 network + module on the Freescale Freedom-KL25Z board from Alan Carvalho de + Assis. Includes the test to verify the CC3000. + - apps/examples/usbmsc: apps/examples/usbstorage renamed usbmsc for + consistency. Change submitted by CCTSAO. + - apps/system/usbmonitor: The USB monitor has been extended so that + it can be used with USB device or host trace data. + +Efforts In Progress. The following are features that are partially +implemented but present in this release. They are not likely to be +completed soon. + + * CC3000 Networking + + - CC3000 Networking. Initial support for the TI CC3000 network + module on the Freescale Freedom-KL25Z board from Alan Carvalho + de Assis. This is still a work in progress. + + * kconfig-fronted Configuration: + + - Conversion of old configurations to use the kconfig-frontends + tool is an ongoing effort that will continue for some time. + At this time, only 46% of the configurations have been converted + to use the kconfig-frontends tools. + +Bugfixes (see the ChangeLog for details). Some of these are very important: + + * File Systems: + + - ROMFS: Fix an error where long (>15) file names were read + incorrectly from a ROMFS file system. From Mike Smith + - NXFFS: Clean up some compiler warnings. + + * Common Drivers + + - MMC/SD driver: Correction for a bad return value when multiple + block SDIO transfers are suppressed. By Andrew Tridgell. + - USB HID keyboard and mass storage host-side class drivers: Fix some + compilation errors and warnings when pre-allocated data structures + are used. + - USB device-side class drivers: Fix some compilations errors when + DUALSPEED (i.e., full- and high-sped) support is enabled. + - CDC/ACM and PL2303: Don't use max packetsize assigned to the endpoint + when allocating request buffers; The default value of the endpoint + max packetsize may be incorrect because the endpoint has not yet + been configured. Really only an issue for high-speed endpoints. + - USB Host Mast Storage Class: Fixed a problem that was causing some + devices to fail to initialize: If device is returning fatal transfer + errors while attempting to initialize, don't bother with the startup + retries; abort immediately so that the device will be reset and we + can try again with a better ready device. + - USB Host Mast Storage Class: Correct a reference counting error: + When an MSC device transfer fails while waiting for UnitTestReady, + the reference count on the class was not being decremented. The end + result is a memory leak as can be seen by the USB device numbers + incrementing: sda, sdb, sdc, ... + - USB Device CDC/ACM: Fix backward conditional compilation in the + CDC/ACM driver with regard to remote wakeup and self-powered + capabilities. From the PX4 team via Lorenz Meier, + + * Networking / Network Drivers + + - ARP IP harvesting: Correct backward condition in netmask task. + From Max Holtzberg. + - Network connection monitor: Fixes a race condition where a loss of + connection may not be detected when the connection is lost before it + has been accepted (from Max Holtzberg). + - TCP/IP Backlog: Fix a critical bug in the TCP/IP backlog + initialization: Only the first backlog buffer was getting added to + the free list. From Max Holtzberg. + - ENC28J60: Fixes and improvements back-ported from the ENCX24J600 + to the ENC28J60 by Max Holtzberg. + + * STM32 Drivers: + + - STM32 I2C fixes for the STM32 F3 family from John Wharington. + - STM32 I2C Correct an error that crept into the STM32 F1 I2C + driver with some recent changes. From Librae + - STM32 F4: Added some missing CONFIG_SERIAL_TERMIOS support; Fixed + some STM32 F4 Timer 8 pin configurations. From CCTSAO. + - STM32 SDIO: If CONFIG_SDIO_BLOCKSETUP defined, OS would crash. Now + Generate an error if CONFIG_SDIO_BLOCKSETUP is defined; that + option is not yet supported by the STM32 SDIO driver. From CCTSAO + - STM32 I2C Timers: Some CCER bit settings changed. Submitted by + CCCTSAO. + - STM32 CAN: Fix access to CAN filter registers. From the PX4 team + via Lorenz Meier. + - STM32 Kconfig: Fix STM32 UART7/8 Kconfig names and UART DMA. From + the PX4 team via Lorenz Meier. + + * LPC17xx Drivers + + - Fix #endif with missing #if in USB host header file. Reported + by Andrew Bradford, + + * SAM3/4 Boards: + + - Corrected DMA-related problems: Bad register definitions, parameters + reversed in a function call. + - Correct a race condition in the HSMCI driver when an interrupt + occurs before the wait for the interrupt begins. + - Peripheral clock setup: Correct a typo in a register name. + + * Atmel AT91 SAMA5D3 + + - Order of some operations changed in boot-up logic to defer + enabling of caching of memory regions until SDRAM is initialized. + - Correct handling of spurious interrupts. + + * Freescale KL25Z Drivers + + - KL25Z SPI: Correct typo in name of a function. From Alan Carvalho + de Assis. + + * Applications: + + - apps/examples/composite: Fix a typo that can cause a configuration + error. From CCTSAO. + - apps/examples/pwm: Clean-up some configuration confusion. + - apps/netutils/dhcpd/dhcpd.c: Fixed calculation of the next lease + address. From Paolo Messina. + - apps/examples/usbmsc: Don't try to control USB trace if we are + an NSH built-in task. In that case our attempts are inadequate + and only interfere with with other logic that is attempting to + to do the same thing (in NSH or in the USB monitor). + - apps/examples/usbmsc: IMPORTANT bug fix: Change how the msconn + works. Because of recent changes the msconn command was hanging. + This was because the USB MSC start-up logic creates a pthread; + Now waitpid() will wait until all members of the task group + exit. So NSH was hanging in waitpid when msconn started even + though msconn returned. The USB MSC logic really should not use + a pthread, but we are stuck with that for now. The work-around + is the msconn now daemonizes itself so that it so that the pthread + is created in a different task group. + - apps/nshlib: Fix NSH listing output for the case of a single file. + From the PX4 team; provided by Lorenz Meier. + +NuttX-6.31 +---------- + +The 98th release of NuttX, Version 6.31, was made on October 28, 2013, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.31.tar.gz and +apps-6.31.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * General: + + - Standardized stack checking logic so the interfaces can be used + by common stack monitoring logic. + + * Audio Subsystem and Audio Drivers: + + - Ken Pettit has finally released his long awaited audio subsystem. + This is a generic audio subsystem that is appropriate for the + deeply embedded MCU. Current testing has, however, been focused + on the VS1053 CODEC chip. + - Ken Pettit's VS1053 audio CODEC driver is now functional. + + * Networking / Network Drivers + + - Add the prefix ETH0 to all PHY configuration selections. This + will allow us to support to Ethernet MAC drivers with two different + PHYs (identified with ETH0 and ETH1). Enabled with CONFIG_NETDEV_MULTINIC. + - Add MII/RMII PHY definitions for the Micrel KSZ8051 PHY. + - Add GMII/GRMII PHY definitions for the Micrel KSZ9021/31 PHY. + - New network-optimized, higher-performance sendfile() implementation + from Max Holtzberg. + - Added a simple routing table. This table is currenly only used (1) + when we need to look-up an Ethernet device based on an IP address, + and (2) in the ARP logic when we need to request the MAC address of + the router, vs the MAC address of the peer. + - Make net_close() nonblocking and free unestablished connections if + no free connections available. From Max Holtzberg. + - Changed the meaning of the uip_*input functions. They now return + success when a packet is dropped; This is needed for the ENCX24J600 + driver that must make a decision to return the packet or not: It + should not retry dropped packets. From Max Holtzberg. + - David Sidrane has completed integration of the CC3000 networking. + This is much more than a network driver: It is a complete + replacement for the NuttX networking with off-chip networking support + in the CC3000. + - Numerous enhancements to the ENCX24J600 driver from Max Holtberg. + + * Other Common Drivers: + + - The SST25 serial FLASH MTD driver now includes support for the + SST25VF016B. From David Sidrane. + - Add a preflight method to the SDIO interface to support the STM32 + DMA usage model. From Mike Smith. + - Enhanced the MMC/SD SDIO driver to perform DMA preflight operations + and fail DMA read/write requests that fail preflighting. From Mike + Smith. + - Add an ioctl command that can be used to trigger ADC/DAC conversion + under application control. + + * File Systems: + + - Enhanced the FAT32 filesystem code to understand DMA preflight + failures, and to use the file sector buffer as a bounce buffer when + a user-supplied buffer is not suitable for DMA. From Mike Smith. + + * Atmel AT91 SAMA5D3x + + - Add support so that subsets of the total DRAM (and other external + memory) can be added to the heap, leaving other memory reserved for + other purposes (like the LCDC framebuffers). + + * Atmel AT91 SAMA5D3x Drivers: + + - Use more descriptive task names when starting the EHCI and OHCI + monitor tasks. + - Added a 10/100Base-T Ethernet (EMAC) driver. + - Added a 1000Base-T Ethernet (GMAC) driver. + - Added a Real Time Clock (RTC) driver and integrated with the NuttX + system time logic. + - Added support for /dev/random using the SAMA5D3x True Random Number + Generator (TRNG). + - Added a Watchdog Timer (WDT) driver. + - Added a Timer/Counter (TC) library with interface that make be used + by other drivers that need timer support. + - Added an ADC driver that can collect multiple samples using the + sequencer, can be trigger by a timer/counter, and supports DMA data + transfers. + - Added a touchscreen driver based on the special features of the + SAMA5D3 ADC peripheral. + - Added an LCD controller (LCDC) frame buffer driver. + - Added a CAN driver. However, testing has been delayed because of + cabling issues. + - Basic header file support is available for the Image Sensor + Interface (ISI) camera interface. Work on the camera driver is + underway and is expected in the next release. + + * Atmel AT91 SAMA5D3x-EK Development Boards + + - Add OS test support for the FPU test. + - Enable the task name feature board configuration sto provide + prettier ps command output. + - Added NX and NxWM configurations to verify the LCD and touchscreen. + There are still some outstanding issues with the NxWM configuration + as of this release. + - The TRNG and /dev/random are now enabled by default in the demo + configuration. + + * Atmel AT91 SAM3/4 Boards: + + - Add configuration to select revision 3 of the Arduino Due which has + some small but important differences. Suggested by gdi@embedders.org. + + * STMicro STM32: + + - Add support for the STM32F207ZE chip. From Martin Lederhilger. + + * STMicro STM32 Boards: + + - Add configuration for the Spark Core. The initial check-in is + basically the Maple Mini board and subsequent development by David + Sidrane is his special Spark emulation hardware. The configuration + should be very mature when actual Spark hardware is available. + - Support for the Olimex STM32 P207 board added by Martin Lederhilger. + - Configuration for the Mikroe STM32F4 board configuration updated for + audio support by Ken Pettit. + + * NXP LPC17xx Boards: + + - zkit-arm-1769: LED1 is now user controllable after booting. From + Rashid Fatah. + + * Kinetis KL Drivers: + + - PIT and TPM register definitions header files for the from Alan + Carvalho de Assis. + - Added low-level getc() function for operation with no file system. + The KL25Z can now support NSH in a very minimal system that does + not even have a file system. + + * Kinetis KL Boards + + - A new configuration called minnsh was added is an experiement to + see how small we can get the NuttX footprint and still support NSH. + From Alan Carvalho de Assis.. + + * TI Calypso Phones: + + - Basic board support for the Motorola C139 (Compal E86) phone. From + Craig Comstock. + + * Applications: + + - Moved several useful examples from apps/examples to apps/system. + This includes USB MSC, USB CDC/ACM, and USB Composite. + - New addroute and delroute commands added to NSH in order to manage + the network routing table. + - Numerous enhancements and updates to the CC3000 example from David + Sidrane. + - Add a new stack monitor daemon that can be used to constantly + monitor stack usage by all threads. + - Numerous changes to get NSH working with no file system. Basically + this suppresses I/O redirection and replaces file I/O with calls to + low-level console read/write functions. Suggested by Alan Carvalho + de Assis. + - apps/system/nxplayer: A new, command-line media player called + 'nxplayer' from Ken Pettit. + - apps/examples/random: Add a simple test that dumps values from + /dev/random. + - apps/examples/adc: Add support so that a ADC driven by software + triggering can be tested. + + * Build System: + + - The MKDEP tools now support a new argument that identifies the + object file path. + +Efforts In Progress. The following are features that are partially +implemented but present in this release. They are not likely to be +completed soon. + + * kconfig-fronted Configuration: + + - Conversion of old configurations to use the kconfig-frontends + tool is an ongoing effort that will continue for some time. + At this time, only 48% of the configurations have been converted + to use the kconfig-frontends tools. + +Bugfixes (see the ChangeLog for details). Some of these are very important: + + * Initialzation and Scheduling: + + - IDLE thread initialization logic should not call group_setupidlefiles() + if there are no file descriptors (and, hence, no file system). + - Fix some cornercase error handling logic: If sched_releasetcb() is + called as part of a failed pthread startup before the flags field in + the TCB has been initialized, then a crash occurs. Pointed out by + David Sidrane. + + * Networking / Network Drivers: + + - Look up of a device using subnet will fail if the packet is being + sent out of our subnet (via a router). The fallback here is just to + use the only device ("eth0") if the subnet lookup fails (this logic + was extended to handle multiple Ethernet devices by adding a simple + routing table). + - Fix some backward conditional logic in send() that enabled the + check if the ARP address is in the ARP table. From Max Holtzberg. + - Notify the socket layer from the network monitor if a connection is + lost before the monitoring callback has been registered. From Max + Holtzberg. + - send(): Reset the send timeout when the data is ACKed, not when the + data is sent. Remove conditions on checking for timeout. From Max + Holtzberg. + - Correct how the TCP/IP initial minimum MSS is calculated. Max + Holtzberg. + - TCP state machine: Move tcp connection into SYN_RCVD state after + aception instead of bypassing and moving directly into ESTABLISHED. + From Max Holtzberg. + - Numerous fixes to the ENCX24J600 driver from Max Holtberg. + + * USB Drivers: + + - Change naming of SELFPOWERED and REMOTEWAKEUP to avoid name + collisions. Prepend the name of the driver (for example + CDCACM_SELFPOWERED). + - CDC/ACM class driver: Change the interval for the interrupt + endpoint from 0xff (invalid) to 10. This is not a critical + change but will avoid a complaint from the Linux driver when + it overrides the 0xff value. + + * ARM Cortex-A5: + + - Fix an error in data cache clean and invalidate functions: Fix of + addresses to cache line boundaries. + + * Atmel AT91 SAMA5D3x Drivers: + + - Correct some inconsistencies in the way that USB configuration + settings are used. This caused compilation errors in SAMA5 OHCI + when USB debug was ON but USB host tracing was off. + - When 480MHz UPLL is used to drive OHCI, it should have a divider + of 10. However, that does not work. A divider of 5 does. Why?. + - OHCI HCD: Fix a place where DMA-related data needed to be flushed + to data cache; Fix another where a virtual address was being used + in a register where a physical address was required. + - HSMCI Driver: TX DMA disabled. It is just not reliable. No idea + why. RX DMA is still used. + - STM32F103C pinmapping corrections from David Sidrane. + + * Atmel SAMA5D3x-EK Board + + - Increase the number of pre-allocated watchdog timers. The default + number of 4 was easily being exhausted in the more complex + configurations. + + * STMicro STM32: + + - STM32 F4 DMA definitions: Typo fixes for UART7 and UART8 DMA + configs. From Mike Smith. + - DMA priority configuration corrections from Mike Smith. + - Changes to the stm32_dmacapable API. In order to correctly + verify that a buffer can be transferred, the transfer count and + the CCR value are required. Implemented stm32_dmacapable for + stm32f1xx devices. Enhanced stm32_dmacapable for stm32f2xx and + stm32f4xx devices to check for additional conditions that will cause + DMA to fail or lose data. + - STM32 F1 DMA fix from David Sidrane: The DMA_CNDTRx register + cannot be modified if the DMA channel is disabled. + + * STMicro STM32 Drivers: + + - Fix compilation errors from bad bit definitions in ADC and PWM + register. From Martin Lederhilger. + - DMA-related fixes to the SPI driver from Ken Pettit. + + * NXP LPC17xx Drivers: + + - Remove undefined spi_select() prototype. This was causing compile + time warnings. + + * NXP LPC17xx Boards: + + - zkit-arm-1768: MMC/SD is on SPI, not SSP0. From Rashid Fatah. + + * C Library + + - scanf() fixes from kfrolov: 1) sscanf() function hangs in the + following example: sscanf("2", "%u,%u,%u,%u", ...), 2) sscanf() + returns incorrect number of parsed numbers if some arguments + can't be parsed: sscanf("=2", "%u,%u,%u,%u",...)==1 instead of + 0, and 3) using of char* instead of const char* in vsscanf + function leads to warnings from GCC. + + * Build System + + - Dependency generation generation was broken for directories that + keep objects in a sub-directory. The MKDEP tools now support a new + argument that identifies the object file path. + - tools/define.sh: 'cut' no longer works as it once did. Script + adapted to observed behavior. + + * Applications: + + - Remove a warning from the NSH library when DHCP is not enabled. + - Default NSH IP address should be 0x0a000001 (10.0.0.1), not + 0xa0000001 (160.0.0.1). Ditto for the gateway. + - Add some missing options to the OS test Kconfig file + - Fix some bad conditional compilation in the USB monitor. + - Fix default I2C frequency used by the I2C tool: 400KHz instead + of 4MHz. Suggested by Max Kriegleder. + - Increase stack size for the system/info command. Ken Petit + reports that this simple command can exceed its 768 stack size + under certain conditions. The size is marginal and has been + increased to 1024 by default but is also now configurable. + - apps/Makefile: Needs to include external/Make.defs if we want + allow external applications to participate in the NuttX + configuration. Suggested by gdi@embedders.org. + - apps/netutils/telnetd: Missing argument to debug statement + can cause crashes in certain error conditions. From David + Sidrane. + - apps/examples/can: Correct an error in a debug statement. From + Martin Lederhilger. + +NuttX-6.32 +---------- + +The 99th release of NuttX, Version 6.32, was made on December 7, 2013, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.32.tar.gz and +apps-6.32.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * General: + + - Extension and standardization of stack debug logic. Now includes + coloration of the IDLE and interrupt stacks as well as the heap. + Suggested by David Sidrane. + + * Audio Subsystem and Audio Drivers: + + - I2S interface definition. Integrates with audio sub-system. + - VS1053 worker thread stack size is now configurable and assigned a + name via pthread_setname_np(). From Ken Pettit. + + * Networking / Network Drivers + + - Updates and adaptations to support for TI CC3000 wireless module + from David Sidrane. These updates include multi-threading support + and interface and header file changes to integrate more seamlessly + with NuttX applications. + + * File Systems: + + - procfs: Add support for a tiny procfs file system. The initial + offering is little more that a proof of concept but may be developed + further in subsequent releases. + - NXFFS: An initial attempt was made to integrate NXFFS with the NAND + MTD driver. Changes were made to handle bad blocks. However, I + later realized that NXFFS cannot handle NAND because the way that + is re-writes blocks is incompatible with the NAND ECC handling. + These changes were backed-out so as not to introduce turmoil, but + can be re-enabled if needed via configuration option. + - NXFFS: Make the start up scan of the media a configuration option. + It just takes to long and is not really necessary! Those rare cases + where the scan was helpful can be fixed using MDIOC_BULKERASE IOCTL + command. + + * General Drivers: + + - I2S: A simple character driver was added to support I2S accesses. + This driver in its current state is intended only to support I2C + testing and would not be appropriate to used for any real driver + application. + + * MTD Drivers + + - Add a container for an MTD device that can be used to provide a + simple, lightweight interface to configuration data storage that + resides on some storage media that is wrapped as an MTD device. + From Ken Pettit. + - New interface definition for lower half NAND drivers. + - MTD Nand: Add MTD NAND driver that will support ONFI devices, + non-ONFI devices (via table lookup), bad block checking, software + ECC (Hamming), and will interact with the lower-half, hardware- + specific, NAND driver. Based on BSD-compatible Atmel sample code. + - MTD geometry structure is now packed so that it can support larger + erase block sizes needed by NAND without increasing the size of + the geometry structure. + - SST25: Add another SST25 SerialFlash driver, sst25xx.c. This one + differs from sst25.c in that it supports larger SST25 parts: In + the larger parts support page write instead of byte/word writes + like the smaller parts. From Ken Pettit. + + * USB Drivers + + - STM32 F1 USB Device: Add support for decoded USB trace strings. + From David Sidrane. + + * ARM + + - Add more ARM9 cache management functions to flush and invalidate + D-Cache for DMA support. + + * Atmel AT91 SAMA5D3x Drivers: + + - Many new drivers including CAN, PWM, SSC/I2S + - PCK: Add support for programmable clock outputs. + - NAND: Driver with hardware ECC and DMA support + + * Atmel AT91 SAMA5D3x Boards: + + - SAMA5D3x-EK: Add support for the apps/examples/i2schar test. + - SAMA5D3x-EK: Provides board-specific memory controller initialize + for NAND flash. + - SAMA5D3x-EK: Add support for "auto-mounting" NAND MTD block driver + or NXFFS file system. + + * Atmel AT91 SAM3/4 Boards: + + - Basic support for the Atmel SAM4E family. From Mitko. + + * STMicro STM32: + + - Added support for the STM32F429. From Ken Pettit. + - Added support for GPIOK and GPIOJ. From Ken Pettit. + + * STMicro STM32 Drivers + + - STM32 F4 OTG FS/HS Device: OTG FS device and host drivers extended + so that they can support either the OTG FS peripheral or the OTG HS + peripheral (in FS mode). This was done as a quick way to get USB + support on the STM32F429 which has only OTG HS. From Ken Pettit. + - Added header files and driver framework for the STM32F429 LTDC + framebuffer driver. From Ken Pettit. + + * STMicro STM32 Boards: + + - Support for the Spark board was completely by Davide Sidrane. The + Spark configuration includes integrated CC3000 wireless support, FAT + file system on the SerialFlash and a composite device that can be + used both to export the FAT file system and to provide a serial + interface. + - The Mikroe-stm32f4 now uses /dev/config for configuration data + storage. From Ken Pettit. + - Added support for the STM32F429I-Discovery board from Ken Pettit. + - Added board support for the ViewTool STM32F103/F107 board with the + STM32F107VCT6 installed. + + * NXP LPC31xx Drivers: + + - USB ECHI HCD: Add a driver for the low-/full-/high-speed variant + of the EHCI host controller. + + * NXP LPC31xx Boards: + + - Board-specific USB host support for the Emedded Artists EA3131 board. + (Missing PCA9532 controls). + - Add support for the Olimex LPC-H3131 board. Including USB host + support (which does not depend on the PCA8532 interface). + + * Kinetis KL Drivers: + + - PWM driver for the Freescale Kinetis KL family from Alan Carvalho + de Assis. + + * Kinetis KL Boards + + - Freedom-KL25Z: Add PWM support from Alan Carvalho de Assis. + + * TI Stellaris LM3S + + - Don't initialize .data in start-up logic if not running from FLASH. + + * Applications: + + - apps/platform: A new home for platform-specific application code. + - Define a common interface that can be used to manage platform- + specific configuration data. From Ken Pettit. + - apps/examples/configdata: A unit test for the MTD configuration + data driver from Ken Pettit. + - Aapps/platform/mikroe-stm32f4: dd platform-specific storage of + configuration data for the Mikroe-stm32f4. From Ken Pettit. + - apps/examples/cc3000: Fine tuning of memory usage from David Sidrane. + - apps/system/nxplayer: Play thread stack size is now configurable. + All NxPlayer threads now have names assigned via pthread_setname_np(). + From Ken Pettit. + - apps/examples/i2schar: The I2S test based on the I2S character + driver. + - apps/examples/hidkbd/hidkbd_main.c: Now calls a function named + arch_usbhost_initialize() that must be provided by the platform- + specific code. + - NSH: + + - hexdump: Add skip= and count= options to the hexdump command. From Ken Pettit. + - Allow USB trace without a USB console. From David Sidrane. + - Mount command updates from Ken Pettit. + - Add an option to the mkfatfs command to specify FAT12, FAT16, or FAT32. + + * Tools + + - tools/mkctags.sh: A script for creating ctags from Ken Pettit. + +Efforts In Progress. The following are features that are partially +implemented but present in this release. They are not likely to be +completed soon. + + * kconfig-fronted Configuration: + + - Conversion of old configurations to use the kconfig-frontends + tool is an ongoing effort that will continue for some time. + At this time, only 50% of the configurations have been converted + to use the kconfig-frontends tools. + +Bugfixes (see the ChangeLog for details). Some of these are very important: + + * File Systems + + - FAT: In one error return case, the error return value was not being + set, making the failure look like success. From David Sidrane. + - mount: SMART FS must be included in the conditional compilation for + the set of file systems that require block drivers. From Daniel + Palmer. + - SmartFS: Fixed a minor bug with SMART partition number reporting + that would only be seen if both partition support and multi-root + directory support are enabled at the same time. From Ken Pettit. + - Deadlock: The inode semaphore must be re-entrant. Here is the re- + entrant path that I found: (1) USB host connects to FLASH drive and + creates /dev/sda, (2) /dev/sda is mounted, (3) FLASH drive is + removed but /dev/sda is not destroyed because there is still a + reference on the device because of the mount, (4) umount() is + called, taking the inode semaphore, now the driver tries to destroy + the block driver by calling unregister_blockdriver(). But (5) + unregister_blockdriver() also takes the inode semaphore causing a + deadlock if the inode semaphore is not re-entrant. + - FAT: Fix a typo in the FAT16 formatting logic. Was this ever able to + format a FAT16 volume? + + * MTD Drivers + + - MTD Partitions: Fix erase block vs page block confusion. From Ken + Pettit + - SST25 Serial Flash: Improved write performance by fixing a bug that + prevented operation in the faster write mode. From David Sidrane. + + * USB Drivers: + + - USB MSC Device: pthread_join() does not work if called from a + different task group than the pthread. This is correct behavior, + but still a problem. The correct solution would be configure the + USB MSC thread to a task, however, this workaround from David + Sidrane plugs the hole for now. + - USB CDC/ACM, USB MSC, and Composite Device Classes: Un-initialization + logic caused re-use of a stale pointer. Changed to a two pass + un-initialization for the case of the composite driver: Memory + resources are not freed until the second un-initialization pass. + From David Sidrane. + + * STMicro STM32 Drivers: + + - STM32 F1 USB Device: Fix some errors that cause crashes when the USB + was disconnected. From David Sidrane. + - STM32 F1 USB Device: Correct EP0 state handling logic when buffers + larger than the EP0 packet size are sent. From David Sidrane. + - STM32 F1 USB Device: The long outstanding bug involving the handling + of OUT SETUP commands has been fixed in the STM32 F1 USB device + driver by David Sidrane. + - Kconfig: Add missing setup of CAN TSEG1 and TSEG2 values. From + Martin Lederhilger. + + * Tools + + - tools/mkconfig.c: SMART FS must be included in the conditional + compilation for the set of writable file systems. Noted by Daniel + Palmer. + + * Applications: + + - apps/platform/Makefile: Was not dealing with the bin sub-directory + correctly. + - apps/system/composite/composite_main.c: The wrong handle was getting + nullified. From David Sidrane. + +NuttX-6.33 +---------- + +The 100th release of NuttX, Version 6.33, was made on January 30, 2014, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-6.33.tar.gz and +apps-6.33.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * Core OS Interfaces + + - nanosleep() added. sleep() and usleep() are no longer core OS + interfaces. These have been moved into the library and re-implemented + as simple wrappers around nanosleep(). + + * File Systems + + - procfs restructured by Ken Pettit. Added files for MTD status. + - procfs extended to show uptime and task group status. + - procfs now shows stack information. + + * Networking + + - Add support for the SO_LINGER socket option. Extended from logic + provided by Jason Jiang. Enabled with CONFIG_NET_SOLINGER. + - TCP write buffering support added. From Jason Jiang. + - Changes from Max Holtzberg to improve how network status is + reported. New controls to manage carrier detect. + + * Graphics + + - Massive reshuffling of files with little or no logic changes. This + reshuffling was necessary to build graphics applications with the + kernel builds where the graphics application lie in user space and + the core graphic server likes in kernel space. Moved much logic out + of nuttx/graphics to a new user library, libnx. + + * Cortex-A5/A8/A9 + + - Existing Cortex-A5 support updated to include Cortex-A8/9. + - Add the syscall.h header file needed for the Cortex-A architecture. + - Start-up logic now supports execution from FLASH with .data and + .bss in SDRAM. This was not possible prior to this because .bss + and .data were initialized before SDRAM was configured. + + * Allwinner A10: + + - Basic support for the Allwinner A10 (Cortex-A8) is in place. + + * Allwinner A10 boards + + - Support for the pcDuino v1 board has been added. This support + is not yet very mature and still lacks many drivers. It is a + good starting point, however, if anyone wants to develop A10 + support. + + * Atmel SAMA5D3X + + - Start-up logic now supports execution from FLASH with .data and + .bss in SDRAM. This was not possible prior to this because .bss + and .data were initialized before SDRAM was configured. + + * Atmel SAMA5D3X Boards + + - Partial logic in place to support the OV2640 camera. Still needs + quite a bit of additional logic to be useful. + + * ARMv7-M + + - Add support for high priority, nested interrupts. This change + effects not only core ARMv-7M logic, but all ARMv7-M MCU logic: + LM3S, LM4F, LPC17xx, LPC43xx, SAM3, SAM4, and STM32. See + http://www.nuttx.org/doku.php?id=wiki:nxinternal:highperfints + + * STMicro STM32 + + - Add clocking support for STM32F107 USB OTG FS (which does not yet + work) + - Single-wire UART support for the F1 series from Thomas Grubler. + + * STMicro STM32 Boards + + - The Viewtool board can now be configured to support either the + STM32F103VCT6 or the STM32F107VCT6. + - The Viewtool STM32F107VCT6 now supports networking with the + DP83848C module installed. + - Add support for Viewtool SSD1289-based LCD on the Viewtool + STM32F103VCT6 board (untested) + - Add support for the XPT2046 touchscreen controller on the Viewtool + LCD module connected to the Viewtool STM32F103 board. + - Added kernel mode build support for the STM3240G-EVAL board. Added + a new kernel mode NxWM build configuration + - C++ static constructor logic from the nuttx/configs/stm3240g-eval/ + directory to the apps/platform/stm3240g-eval/up_cxxinitialize.c + where is belongs so that it is available in user-space in the kernel + mode build. + - Add native Windows build support for the Olimex STM32 P107. From + Max Holtzberg + - Support for the STM32VL-Discovery board. Contributed by Alan + Carvalho de Assis + - Added a configuration for testing simple configurations on the + PX4FMU v2. + + * ZiLOG ZNEO Boards + + - Add an NSH configuration for the Z16F2800100ZCOG ZNEO board. + - Added support for the Toyaga 16Z ZNEO board. The 16Z board is + based on the ZiLOG ZNEOZ16F2811AL20EG part. See + https://github.com/toyaga/16z for further information + - Developed a patch to work around a compiler error that is revealed + when building the NSH configuration. + + * Architecture-Independent Drivers + + - OV2640 Camera Driver. + - Support for the Sharp Memory LCD from Librae. + + * Library + + - Pattern matching logic extended to handle set of characters and + ranges of character values. From Ken Pettit. + - sleep() and usleep() moved intot the C library. These are not + longer core OS interfaces; they are simple wrappers for the + nanosleep(). + - Add an implementation of gets_s(). + - Extend fopen() to include support for C11 exclusive open ("x") + open mode. + - Add an implementation of stpcpy() + - strtol(), strtoll, strtoul(), strtoull(), and strtod() from + libc/string to libc/stdlib where they belong. + + * Header Files + + - Add rsize_t to include/sys/types.h + - Add the C11 thread.h header file + + * Configuration/Build System + + - Top level Makefile now supports qconfig and/or gconfig targets that + may be used for configuration. These may be used if you build + kconfig-frontends with support for kconfig-qconf and/or + kconfig-gconf. + - Add CONFIG_DEBUG_NOOPT. Now you can independently enable/disable + debug symbols and optimization + - File system related header files moved to include/nuttx/fs + - Video related header files moved to include/nuttx/video + - Changes for native Windows build: fix creation of a .version file + if one does not exist. Make sure that the APPDIR environment + variable is set before configuring. From Max Holtzberg. + - Board configuration sub-directory can now be specified. The default + need not be used. This is only useful when CONFIG_ARCH_BOARD_CUSTOM + is selected and there is no meaningful default sub-directory. + - Many functions renamed to better conform with the naming standard: + up_buttoninit() renamed to board_button_initialize(), up_buttons() + renamed to board_buttons(), up_irqbutton() renamed to + board_button_irq(), up_ledinit() renamed to board_led_initialize(), + up_ledon() renamed to board_led_on(), and up_ledoff() renamed to + board_led_off(). All prototypes removed from board.h header files. + Now ONLY prototypes in include/nuttx/arch.h. + + * Applications + + - NSH: Refactor. Separate NSH command handling and command execution + from NSH line parsing. + - NSH: Will now support multiple commands on a command line, each + separated with a semi-colon. + - NSH: Add support of commands enclosed in back quotes as command + arguments. + - NSH: Can now handle arguments that are concatenations of constant + strings, command return data, application return data, and + environment variables. + - NSH: Add true and false commands. + - NSH: Add support for while-do-done and until-do-done loops. These + only work when executing a script file because they depend on the + ability to seek in the file to implement the looping behaviors. + Can be conditionally compiled out to reduce footprint. + - NSH: Loosen up if-then-else-fi syntax to allow a command to be on + the same line as the then or else tokens like: + "if true; then echo true; else echo false; fi". More like bash. + - NSH: Add a break command that can be executed with a loop to + terminate the loop immediately. + + - system/inifile: A simple .INI file parser. + - system/vi: Add support for a tiny, VI work-alike editor. This is + a minimal full screen editor that works with a terminal emulator + that using VT100 commands. + +Efforts In Progress. The following are features that are partially +implemented but present in this release. They are not likely to be +completed soon. + + * kconfig-fronted Configuration: + + - Conversion of old configurations to use the kconfig-frontends + tool is an ongoing effort that will continue for some time. + At this time, only 53% of the configurations have been converted + to use the kconfig-frontends tools. + +Bugfixes (see the ChangeLog for details). Some of these are very important: + + * Core OS + + - Added missing sem_timedwait() system call. + + * Networking + + - Prevent tcp_connect callback from being double freed. From Max + Holtzberg + - uiplib: Support new definitions and state passing for network + device status. From Maz Holtzberg. + + * File Systems + + - FAT: (1) A correction to FAT cluster allocation, and (2) Fix to some + root directory logic that was conditionally done only for FAT 32. + Apparently this needs to done for all FAT types. Both from Andrew + "Tridge" Tridgell via Lorenz Meier. + + * Binary Formats + + - Fix a small memory leak when attempting to load a program from a file. + + * Cortex-A8/9 + + - Fix some errors in the cache invalidation logic (only seem to matter + for Cortex-A8). + - Add more nop's after enabling the MMU. The cortex-a8 seems to need + these + + * Graphics + + - Fix a typo that caused a compilation error when + CONFIG_NXCONSOLE_BPP < 8. From Librae + + * ARMv7-M + + - Correct alignment of RAM vector table. + - Interrupt handling: Do not disable and enable the IRQ on each + entry, (2) this interferes with controlling the IRQ interrupt + setting from interrupt handlers, and (3) up_disable_irq() does + not work anyway so that this has never done anything. + - Fix all implementations of up_disable_irq() for all Cortex-M3 and + M4 architectures: To enable an interrupt on the Cortex-M3/4 CPU, + you need to set a bit in the ISER register. To disable the + interrupt, you need to set a bit in the ICER register. Existing + logic was trying to disable interrupts by clearing the bit in the + ISER register. That will not work; writing a '0' to the ISER + register has no effect. That means that up_disable_irq() was + doing nothing! It turns out that that is not really important + because up_disable_irq() is not really used for that purpose. But + some spurions STM32 ADC interrupts have been reported to me and this + turned out to be the cause in that case. Thanks to Manuel Sthn for + the tip. + + * STMicro STM32 + + - Fix configuration and pin definitions that would prevent building + USB for the connectivity and performance lines. + - STM32L15xx: Fix a typo in USB pin definitions + - Fix pin definition names for SPI2 MOSI and MISO. Noted by Brian Webb + - Various fixes for STM32F103ZE SPI3 pin mapping definitions. From + Steve Redler IV + + * STMicro STM32 Boards + + - Olimex STM32-P107: Failed to build if SPI3 for UEXT is not remapped. + From Max Holtzberg + + * x86 Boards + + - Add a configuration option to select the -m32 compiler option when + building for a 32-bit target on a native 64-bit compiler. So far, + only used for the qemu/i486 configuration. + - Patch from Matt Campbell to fix 'Error: .size expression for idle_stack + does not evaluate to a constant". + + * Library + + - strftime(): Needs null termination on the generated string. From + Max Holtzberg. + - Typo in ctype.h macro name: iscntrl(), not iscontrol(). + - If there are no arguments (argc == 1), then getopt() will leave the + optind variable in an undefined state (2014-1-20). + - ARMv7-M memcpy(): Assembler changes with the gcc-47 distribution + from ARM mean that we need to be explicit about branch sizes; one + or more of the wide branch opcodes results in bad table branching. + From Mike Smith. + + * Configuration/Build System + + - Fixes for some tools/ for Windows build issues from Max Holtzberg. + - Config.mk: 'cypath' must be called if we are using a Windows native + toolchain with the Cygwin 'make' to convert paths to proper + Windows paths. From Richard Cochran. + - ARM Makefile: Dependency directory list is now computed from the + VPATH. From Richard Cochran. + - builtin/Makefile: Fixes for native Windows build from Max Holtzberg. + - Refactor some configuration dependencies: NSH networking features + should depend on netutil selections; netutil selections, in turn, + should depend on networking selections. + + * Applications + + - NSH: Modified the df -h logic to eliminate truncating numbers in + conversion (like 7900 -> 7M). From Ken Pettit. + +NuttX-7.1 +--------- + +The 101st release of NuttX, Version 7.1, was made on March 15, 2014, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-7.1.tar.gz and +apps-7.1.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + + The previous NuttX version was 6.33. The NuttX minor version number is + incremented on each release, but the major version number is incremented + only when an incompatibility with previous versions is included in the + release. In this case, the legacy, manual configuration is no longer + supported by the NuttX build system beginning with NuttX 7.1. Only the + newer configurations generated by the kconfig-frontends tools will generate + viable NuttX configurations. + + All board configurations in the NuttX source tree have been converted to + use the newer configuration, but if you have some older style configurations + for you board, you will need to convert those configurations to use the + kconfig-frontends tools before taking any new code from the repository. See + http://www.nuttx.org/doku.php?id=wiki:howtos:convertconfig for some + guidelines. + +Additional new features and extended functionality: + + * Core OS: + + - System time logic now includes logic to measure and calculate the + CPU load percentage (from David Alessio). This CPU load logic + extended to keep counts on each thread. The per-thread CPU is + now reported in the procfs under /loadavg An asynchronous, + "external" clock may be used to drive the CPU load calculations + for more accurate measurements when needed. + + * File Systems: + + - As mentioned above, the per-thread CPU load information is now + reported in the procfs under /loadavg. + - Many file system interfaces have been extended to operate on the + top-level NuttX pseudo filesystem. These include rmdir, mkdir, + rename, and unlink. This capability can be disabled with + CONFIG_DISABLE_PSEUDOFS_OPERATIONS in order to keep the footprint + small. + + * Networking: + + - Numerous updates and improvements to the CC3000 driver from David + Sidrane. + + * Common Drivers: + + - Defined a mouse interface that is very similar to a touchscreen + interface, but allows reporting of all mouse buttons. Also, unlike + touchscreen drivers, mouse drivers need to report positional data + with no button is pressed so that the mouse position can drive a + cursor. + - Added support for a USB HID boot mouse device. Cursor support is + not integrated and must be provided by the application based upon + the reported mouse data. + - Support added for the MIO283QT9A LCD from Toby Duckworth. + + * Atmel SAMA4E: + + - Added complete architecture support for the Atmel AT91 SAM4E + Cortex-M4F parts. + + * Atmel SAM4E Board Support: + + - Add board support for the SAM4E-EK board. + + * Atmel SAM4E Drivers: + + - Added logic to manage the Cortex-M Cache Control block. + - Developed and integrated an Ethernet MAC driver for the SAM4E. + - Backported the SAMA5 SPI driver to the SAM3/4 architecture. The + SAMA5 version supports both multiple SPI peripherals as needed by the + SAM3A and SAM3X and also supports DMAC (but not PDC) needed by the + SAM4E. + + * Atmel SAM D20: + + - Added basic architecture support for the Atmel AT91 SAM D20 + Cortex-M0+ parts. + + * Atmel SAM D20 Board Support: + + - Added basic support for SAM D2 Xplained Pro board. Currently, the + NuttShell (NSH) works reliably over a serial port. An SPI driver + has also been developed. Work with the SAM D20 has been temporarily + stopped, however, in order to focus on the SAM4E-EK. + + * TI Tiva TMC4C123G: + + - Added architecture support for the TI Tiva TM4C123G parts. This was + merged into the existing support for the LM3S and LM4F families. + All directory, file, and function references changed from lm to tiva. + + * TI Tiva TMC4C123G Board Support: + + - Added basic board support for the TM4C123G-Launchpad. As of this + release the TM4C123G-Launchpad board support is untested and likely + incomplete. + + * STMicro STM32 Boards: + + - The Mikroe STM32F4 can now support the newer MIO283QT9A LCD. From + Toby Duckworth. + - Miscellaneous changes to better support FPU on STM32F429 Discovery + from David Alessio. + + * NXP LPC2378 Drivers: + + - Incorporated I2C and SPI drivers for the LPC23xx from Lizhuoyi. + + * QEMU i486 Drivers: + + - New QEMU keyboard and VGA drivers from Lizhuoyi. + + * Documentation: + + - Added a coding standards document. See + http://www.nuttx.org/doku.php?id=documentation:codingstandard + + * Configuration/Build System: + + - A configuration option, CONFIG_DEFAULT_SMALL, was added to select + default values for configuration variables based upon whether you + want a smaller footprint or more features. This is not very useful + if you are modifying existing configurations because then the + default values do not apply. + - CONFIG_DEFAULT_SMALL has been defined on all tiny MCU configurations + so that they do not grow so rapidly when new, optional features are + added. + - The legacy, manual configuration is no longer supported by the + NuttX build system. Only the newer configurations generated by + the kconfig-frontends tools will generate viable NuttX + configurations. All board configurations in the NuttX source tree + have been converted to use the newer configuration, but if you have + some older style configurations for you board, you will need to + convert those configurations to use the kconfig-frontends tools. See + http://www.nuttx.org/doku.php?id=wiki:howtos:convertconfig for some + guidelines. + + * Applications: + + - NSH can now use an EMACS-like command line editor. This CLE, is + really more like the traditional readline than is the default, tiny + the NuttX readline . + - The touchscreen example can now be configured to work with either a + touchscreen or a mouse device. + - Several NSH commands can now be used to operate on objects in the + top-level pseudo-filesystem: rmdir, mkdir, mv, and rm. This + capability can be disabled with CONFIG_DISABLE_PSEUDOFS_OPERATIONS + in order to keep the footprint small. + - If both the CPU load feature and the procfs features are enabled, + then the NSH 'ps' command will show the CPU load used by each + thread. + +Bugfixes (see the ChangeLog for details). Some of these are very important: + + * Core OS: + + - task_terminate() always returned an error because the return value + was not being set correctly (from Gosha). + - nanosleep() Fix a missing call to re-enable interrupts (from Jason + Jiang). + + * File Systems: + + - Fixed an error in the FAT logic that can cause file corruption. The + error conditions are rare and only seen with very large files (from + Andrew Tridgell). This replaces a previous, partial fix for the same + problem. + - Fixed memory leaks in the NXFFS open() and stat() implementations + (from Lzyy). + - The interfaces include opendir(), readdir(), et al, were modified so + that errors will not be reported if you attempt to list a empty + pseudo-directory. + + * Networking: + + - Fix one place where the connection reference count was not being + decremented in the socket close() logic. This is really a cosmetic + change BUT when CONFIG_DEBUG_NET is enabled, it will cause assertions. + - Backed out a small part of the NuttX 6.33 write buffering changed. + David G says that this causes problems in connecting to a server. + - In DHCPD, there was a place where the logic was calling ntohl() + inappropriately; the address was already in the correct order. How + could DHCPD have worked with this bug? + + * TI Tiva/Stellaris Drivers: + + - Fixed cut'n'paste error that prevented UARTS2-7 from being used with + the LM4F120 Launchpad. + - Fixed several errors there were unmasked with UARTs > UART2 are + enabled (grom Gosha). + + * Allwinner A10 Drivers: + + - Fixed cut'n'paste error that prevented UARTS2-7 from being used with + the pcDuino. + + * NXP LPC17xx Drivers: + + - Fix an compilation error that crept into the LPC17xx USB host driver. + + * STMicro STM32 Drivers: + + - Fix cloned typo in the serial driver: FLOWCONTROL vs FLOWCONROL. + - Disable SPI before changing DPI CR1 register (from David Sidrane). + - stm32 TIM: Set the timer CCMR when selecting timer channel. From + David Sidrane. + - Fix typo in a Makefile: stm32_pwm.c not stm32_psm.c. Noted by Max + Kriegleder. + + * Library: + + - More sscanf() bug fixes from David Sidrane. + + * Header files: + + - cstdbool: Ignore _Bool8 if CONFIG_C99_BOOL8=y + + * Configuration/Build System: + + - Several changes to restore the broken native Windows build + + * NuttShell (NSH): + + - Use strncpy vs strcpy in the Telnet console logic to avoid + overrunning the username and password buffers (from Bertold Van den + Bergh). + - Add a newline after printing the file in the 'cat' command. This + prevents the NSH prompt from be in the same line as the final line + of the file in the case where there is no newline at the end of the + file. + +NuttX-7.2 +--------- + +The 102nd release of NuttX, Version 7.2, was made on April 29, 2014, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-7.2.tar.gz and +apps-7.2.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * Core OS: + + - Add support for CLOCK_REALTIME. From Macs N. + + * Network Utilities: + + - Add a very primitive NTP client. + - DNS resolver: Long needed major clean up for coding style and + unification of naming conventions (resolv vs dns). + + * Common Drivers: + + - Add a new MTD driver that can be used to contain another driver and + force its apparent sector size to be 512 bytes. + - If DCD can support queuing of stall requests, then the USB MSC stall + work around delays are not necessary. + - Redesign threading module used with the USB MSC driver. It was using + pthreads before and these were changed to a kernel thread. The reason + for this has to do with task grouping: A pthread is a memory of the + group of the task that started it. A kernel thread is independent of + the task that started in (other than knowing it as the parent). This + allows me to remove so kludge logic to "deparent" the pthread on + startup. + - Update the MIO183QT-9A LCD driver to support reading from the LCD. + From Toby Duckworth. + - Timer "upper half" driver and l"lower half" interface definition from + Bob Doiron. + + * Atmel SAM4E/4S Board Support: + + - All SAM4E configurations updated to run with 120MHz CPU speed and + with the CMCC enabled. + - Support for the SAM4S Xplained Pro board from Bob Doiron. + - Add watchdog driver. From Bob Doiron. + + * Atmel SAM4E/4S Drivers: + + - Add a USB full speed device driver (UDP) for the SAM4E. + - Add support in HSMCI and SPI drivers to invalidate cached memory if + the CMCC is enabled. + - Add logic to handle SPI word widths > 8 + - Port RTC driver from SAMA5 to SAM3/4. From Bob Doiron. + - HSMCI: Extensions from Bob Doiron needed to support PDC-based HSMCI + DMA transfers. Verified on the SAM4S Xplained Pro. + + * Atmel SAMA5: + + - Add support for the SAMA5D36 chip. + - Add functions to calculate PLLACK, PCK, and MCK frequencies given + the main clock frequency. + - Implemented RAM functions. When booting directly into NOR flash, + reconfiguring the PLL while executing out of NOR FLASH causes + crashes. This was fixed by David Sidrane by implementing RAM + functions. The killer code is copied and executed from ISRAM and + the crash is avoided. + + * Atmel SAMA5 Drivers: + + - Add support for the SAMA5D3 DBGU. + + * Atmel SAMA5 Board Support: + + - Add a board support configuration for the Atmel SAMA5D3 Xplained + board running out of SDRAM. When booting from SDRAM, start-up logic + needd to query the PMC registers to determine the MCK, PCK, etc. + - For all SAMA5 boards, added support for 528MHz clocking. + + * TI Tiva/Stellaris: + + - Modify the logic to disables the interrupts and sets the default + interrupt priority so that it uses the ICTR to get the number of + interrupt lines/registers. This is instead of using some fixed + number of initializations based a priori knowledge of the number + of interrupt lines in the MCU. + + * STMicro STM32 + + - Add support for the STM401RE. From Frank Bennett. + + * STMicro STM32 Boards: + + - STM32F4Discovery: Add support to register keyboard and mouse + classes if so configured. From Leo. + - Add support for the Nucleo-F401RE board. From Frank Bennett. + + * STMicro STM32 Drivers: + + - Add STM32 Ethernet IGMP hashing support. From Manuel Sthn. + - OTG FS Host: USB host tracing added by Leo. + + * Freescale Kinetis + + - Modify the logic to disables the interrupts and sets the default + interrupt priority so that it uses the ICTR to get the number of + interrupt lines/registers. This is instead of using some fixed + number of initializations based a priori knowledge of the number + of interrupt lines in the MCU. + + * NXP LPC17xx + + - Modify the logic to disables the interrupts and sets the default + interrupt priority so that it uses the ICTR to get the number of + interrupt lines/registers. This is instead of using some fixed + number of initializations based a priori knowledge of the number + of interrupt lines in the MCU. + + * ZiLOG ZNEO Drivers + + - Added ZNEO ESPI driver. + + * Library: + + - Finish incomplete support for ferror(). From Macs N. + + * Documentation: + + - UsbTrace.html: Add some discussion of the USB monitor. + + * Configuration/Build System: + + - compiler.h: Add macro UNUSED() that can be used to eliminate + warnings about variables that are set to values that are not + used. + + * Debugging Support: + + - Add a configuration option to enable dumping of the USB trace buffer + on assertion. + + * Applications: + + - IGMP Example: Fill out Kconfig file; update makefile so that the + IGMP example can be used as an NSH built-in application. From Manuel + Sthn. + - lcdrw Example: Fill out empty Kconfig file. + - touchscreen Example: Add a configuration option to indicate if + architecture-specific initialized is required, yes or no. + - System usbmsc: Back out the USBMSC daemon... it is no longer needed + with the recent fix to the USBMSC class driver. + - NSH: malloc/free IOBUFFER for 'cat' and 'hexdump' commands instead of + using the stack. From Bob Doiron. + - cpuhog, serialblaster, and serialrx Examples: Stress test examples + added by Bob Doiron. + +Bugfixes (see the ChangeLog for details). Some of these are very important: + + * Core OS: + + - errno_get_errno_ptr() and getpid(): Add some checks. If these + functions are called very early in initialization before the tasking + structures are initialized, they would not behave properly. + + * Networking: + + - IGMP-related bug fixes from Manuel Sthn. + - In netdev_findbyaddr(), skip network devices that are in the "down" + state. It does not make sense to consider an address match with a + "down" device. From Brennan Ashton. + + * Network Utilities: + + - DHCPD: The correct value of the PAD option. Should be zero, not + one. From Brennan Ashton. + - Corrections to the NTP client from Manuel Stuehn. + + * Common Drivers: + + - usbhost.h: Fix some USB HID-related conditional compilation. From Leo. + - USB HID mouse driver: Don't include NAKs from the device in the error + count. From Leo. + + * TI Tiva/Stellaris: + + - Add corrected control logic for TM4C125GXL based on logic from Daniel + Carvalho with modifications. The LM4F120 also works well with this + change. + + * STMicro STM32 Drivers: + + - STM32 F2 SPI: Correct a mapping for SPI MOSI pin. From dlsitzer. + - OTG FS Host: Fixes related to low-speed devices and interrupt + endpoints from Leo. Necessary in order to use a USB HID mouse + device. + - STM32 SDIO: The dmaflight method must be conditioned on + CONFIG_SDIO_PREFLIGHT. Noted by Pelle Windestam. + - Sourceforge Ticket #26. up_prioritize_irq should not be called + if CONFIG_ARCH_IRQPRIO is not defined. + + * Atmel SAM3/4: + + - Fix some backward conditional compilation in the start-up logic. + - Fix initialization of the default interrupt priorities. This is + a critical bug fix! + - SAM4S: Fix error in macros that disable peripheral clocking. From + Bob Doiron. + + * Atmel SAMA5: + + - Fix double mapping of SDRAM when executing out of SDRAM. In this + case, the SDRAM was already mapping in arm_head.S. + - In clock configuration, the BMS bit handling was fixed to match + what the HW really does. From David Sidrane. + - TLB Bufferable bit did not do what I thought it was going to do. + I though I was selecting a write-through cache, but the result was + that all caching was disabled and NOR FLASH accesses were very slow. + - Move the un-definitions of __ramfuncs__ from the clock configuration + .c file to the .h file. Otherwise, the attribute will be applied + differently for the prototype and the function definition. + Sourceforge patch 38 from Luciano Neri. + + * Atmel SAMA5 Drivers: + + - Fix a case in the UDPHS driver where received status was not being + cleared, causing OUT SETUP commands to fail. + - TWI data sending fails to increment the number of bytes transferred + on first byte sent. from David Sidrane. + - If running from SDRAM, then BOARD_MCK_FREQUENCY is not a constant + and cannot be used in conditional compilation. All drivers fixed + EXCEPT for the PWM and Timer/Counter drivers which will need some + more extensive redesign. + + * Atmel SAMA5 Boards: + + - SAMA5D3x-EK: The red LED is controlled by PE24 which is also the + camera/ISI interface reset line. So if the a camera is installed, + then we must avoid controlling the red LED or we inadvertently + also reset the camera module. Noted by David Sidrane. + - Header files reference type xcpt_t in certain configurations and + so must include nuttx/irq.h. This is Sourceforge bug 25 submitted + by Luciano Neri. + + * NXP LPC17xx Drivers + + - arm/src/lpc17xx/Kconfig and lpc17_ethernet.c: The default interrupt + priority should be default, not the highest priority (2014-4-19). + + * ZiLOG ZNEO + + - Fix calculation of timer reload and prescaler. The timer frequency + was way too fast. + + * Library: + + - strncpy(): Change ordering of test and copy. Logic would have + failed if n=0; one byte was always copying before testing + for the end of the copy. + - Fix a counting error in the return value from sscanf(). Noted by + kfrolov. Also, sscanf() should return EOF if no values were + converted. + - Fix a logic error in ftell(). It was simply using the file offset + and did not take into account data buffered in memory. From Macs N. + - sccanf(): Use stroul() vs strol() with %u format otherwise, range + of values is restricted because of sign bit. From kfrolov. + + * Configuration/Build System: + + - Fix a build error that occurs when only USB device tracing is enabled. + + * NuttShell (NSH): + + - Fix NuttShell version number display in the NSH welcome message. + version.h was not being included. + + * Other Applications: + + - sysinfo: CONFIG_VERSION_BUILD is a string an needs to be + printed with %s, not %d. Noted by Librae. + - nxplayer: Compilation failure in one configuration reported by + Manuel Stuhn. + - System sdcard: Remove an STM32 dependency. From Bob Doiron. + - telnetd Example: Naming is confused. In someplaces 'telnetd', + and in others 'shell.' All changes to telnetd. Noted by Pelle + Windestam. + +NuttX-7.3 +--------- + +The 103rd release of NuttX, Version 7.3, was made on June 25, 2014, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-7.3.tar.gz and +apps-7.3.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * Core OS: + + - Dynamic loader: Framework to support Pascal P-Code as a binary + format that can be exec'ed from a file system. + - Dynamic Loader: Extend the binfmt interface to handle error + conditions where format-specific clean-up is needed in the event + of error conditions. This is needed by the P-Code binfmt. + + * Networking + + - IOB: Add a generic I/O buffer chain logic. This logic uses small, + pre-allocated buffers that can be chained together to support + transfers of any size, using fewer resources and also without + committing in advance to a TCP window size. There is now only + one I/O type used in the networking and it is these I/O buffer + chains. + - TCP Write Buffering: TCP write buffering logic converted to use + I/O buffer chains. + - TCP Read-Ahead Buffering: TCP read-ahead buffering logic converted + to use I/O buffer chains. + - Includes logic to support throttling of read-ahead buffering if + the read-ahead buffering is competing with write buffering for + I/O buffers. + - Raw Sockets: Add support for the AF_PACKET socket family. From + Daniel Lazlo Sitzer. + + * Common Drivers: + + - W25 Serial FLASH driver extended by Mark Whitehorn to support the + 8Mbit W25Q80BV part. + - Add support for Fujitsu MB85RS1MT RAMTRON part. From Charles Ash. + - Enhancements to the generic timer interface to support capture mode + from Bob Doiron. + - Add an rxflowcontrol method to the serial interface to better + support RX flow control. This involves common changes in addition to minor updates to all MCU-specific serial drivers (only fully implemented for the STM32). From Jussi Kivilinna. + + * Atmel SAM4C + + - Add support for the SAM4CM family. From Max Neklyudov. + + * Atmel SAM4E/4S Drivers: + + - RTT driver from Bob Doiron. Also added high resolution RTC + emulation using the RTT for the sub-second counter. + + * Atmel SAM4E/4S Board Support: + + - The SAM4S Xplained Pro now uses the extended timer/counter + features. From Bob Doiron. + - Added a touchscreen and LCD driver for the SAM4E-EK board (the LCD, + however, not yet fully functional). + + * Atmel SAMA5: + + - Optimized, high performance, assembly language memcpy(). This is + the same optimized memcpy() function that Mike Smith brought in + for the ARMv7-M with minor tweaks by David Sidrane to work with + the ARMv7-A. + - Basic support added for the SAMA5D4 family. + + * Atmel SAMA5 Drivers: + + - SAMA5D4: New drivers unique to the SAMA5D4: XDMAC, SAIC, and + others. + + * Atmel SAMA5 Board Support: + + - SAMA5D4-MB: Initial board support for the SAMA5D4-MB/EK boards. + + * STMicro STM32 + + - Add support for the STM32152 and STM32162 Medium+ density parts + (plus miscellaneous other improvements to the original STM32151 + logic). From Jussi Kivilinna and Sami Pelkonen. + + * STMicro STM32 Boards: + + - Support for the Olimex STM32 H405 board contributed by Martin + Lederhilger. + + * STMicro STM32 Drivers: + + - Implement the rxflowcontrol method to the serial interface to better + support RX flow control. From Jussi Kivilinna. + + * NXP LPC17xx Drivers: + + - Added support for the RTC, ADC, DAC, Timers, PWM and MCPWM + drivers. From Max (himax). + + * NXP LPC17xx Boards: + + - Support for the RTC, ADC, DAC, Timers, PWM and MCPWM integrated + in the LPCXpresso LPC1768 board support. From Max (himax). + + * Library: + + - Add support for seek-able streams. + + * Configuration/Build System: + + - Restructured network directories, header files, and naming to + better modularize the networking and to better integrate the + networking with the rest of NuttX. + + * Applications: + + - prun: An NSH built-in application that can be used to run + Pascal P-Code programs either programatically or from the NSH + command line. + - netpkt: A "raw" socket test from Lazlo Sitzer. + - hex2bin: A library and built-in task to convert from + Intel HEX to binary format. It can write the binary data to a file or it can store the binary data to memory (to support, for example, a loader). + +Bugfixes. Only the most critical bugfixes are listed here (see the ChangeLog for the complete list of bugfixes and for additional, more detailed bugfix information): + + * Core OS: + + - Dynamic Loader: Fix an error in a symbol table search function. + Noted by Pelle Windestam. + - Dynamic Loader: Fix a critical error in exec(); argv was not + being passed. + - mq_notify: Test for a valid signal number was inverted; this + function could not have been working correctly before??? From + eero.nurkkala. + - Fix typo in conditional compilation: CONFIG_CLOCK_MONOTONIC vs. + CLOCK_MONOTONIC. From Manuel Sthn. + + * Graphics + + - Fix typos in several RGB conversion macros. + + * Networking: + + - Modify TCP timout handling to provent situations where connections + may not be freed. From Max Holtzberg. + - Improved TCP fallback allocation logic from Max Holtzberg. Also, + fallback mechanism is disabled when SO_LINGER is to prevent + deadlocks. + - Write Buffering: Add checks from buffer allocation failures. From + Max/Himax. + + * Network Utilities: + + - webserver: httpd_fs_open() should return OK on success and ERROR on + failure, not 1 and 0. + + * Common Drivers: + + - Make sure that all references to up_prioritize_irq() are + conditioned on CONFIG_ARCH_IRQPRIO. Problem noted by Mike Smith. + - CC3000: Correct SPI mode for CC3000 is CPOL=0 CHPA=1. From Jussi + Kivilinna. + - CC3000: Fix a race condition in thread start-up logic. From Jussi + Kivilinna. + - CC3000: Additional fixes including a compilation failure if POLL is + enabled. From Jussi Kivilinna. + + * USB Drivers: + + - CDC/ACM and PL2303 device: Reset RX head to avoid resending last + serial data when USB cable disconnected/re-connected. From + Lizhuoyi. + + * TI Tiva/Stellaris Boards: + + - The Nucleo-F401RE has no on-board crystals and, hence, needs to run + with the PLL input from the on-chip HSI clock. + + * STMicro STM32 Drivers: + + - Serial: Handle configuration for the case of 8-bit data with + parity. From Freddie Chopin. + + * Atmel SAM3/4 Boards: + + - There was a cloned error in all SAM3/4 board configurations (and + for a few other architectures as well). Button interrupts not + being disabled after being detached. As a result, unexpected + interrupts could be received after the button interrupt was + detached. + + * Atmel SAMA5: + + - Fix some critical typos in the SAMA5D3 DMA definitions. + + * STMicro STM32 Drivers + + - I2C: Add an alternative I2C implementation for the STM32 F103 that + works around errata in that specific part. From Patrizio Simona. + - RTCC: Add retry logic to RTC initialization. It sometimes takes + longer for the RTC to initialize, at least as noted on an F2 part. + From Daniel Lazlo Sitzer. + + * NXP LPC17xx Drivers + + - GPDMA: Fix an error when DMA is started: The read-modify-write + fails when the DMA is started. This is because the value read is + not the same as the value set (on write it is the number of + transfers to do; on read it is the number of transfers completed). + From Lizhuoyi. + + * Library: + + - snprintf(): If the size passed to snprintf() is zero, then + snprintf() must write nothing, but instead return the size of the + buffer needed to hold the entire string. From Sami Pelkonen. + + * Configuration/Build System: + + - The alternate console device CONFIG_NSH_CONDEV must not be defined + unconditionally. This causes errors when using Telnet sessions. + This was solved by adding CONFIG_NSH_ALTCONDEV: CONFIG_NSH_ALTCONDEV enables or disables the feature then, if + enabled, CONFIG_NSH_CONDEV provides the alternative console + device name. + - Many files: Convert all old-style GCC variadic macros to the C99 + form. Recent GCC changes tightens up that behavior and can cause + some problems (at least for the IAR compiler for some reason). + Noted by Bob Grimes. + - tools/configure.sh: In-place SED edit messes up permissions on + windows. From Hannes Delago. + + * Build Tools: + + - tools/mkfsdata.pl: Apparently, the trailing the 0x00 in http + server files is seen as a bug in javascript and images. From + Max/Himax. + + * Other Applications: + + - I2C Tool: Fix to show the updated register address on each + fetch (vs. showing the same starting address each time). From + Ryan VanSickle. + - CLE was not returning the terminating newline character. But + reported by Max kriegleder. + +NuttX-7.4 +--------- + +The 104th release of NuttX, Version 7.4, was made on August 15, 2014, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-7.4.tar.gz and +apps-7.4.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * Core OS: + + - Beginnings of a crypto/ subsystem from Max Neklyudov + - Tickless operation: NuttX now supports a mode with no periodic + timer interrupts. Rather, timed events are handle via an interval + timer. This (1) lowers the rate of interrupt processing to timer + events, (2) gives much high timing resolution, and (3) allows lower + power modes of operation where the CPU is not constantly being + interrupted by the timer. + - Restructured the OS files under sched/ to better support the already + modular nature of the RTOS. + + * Networking + + - Substantial directory and header file reorganization and renaming to + make the NuttX networking implementation more modular. + - Add network device ioctl to access PHY registers. From Daniel Lazlo + Sitzer + + * Binary Loader: + + - Various changes associated with symbol tables from Pelle Windestam. + + * Graphics: + + - colorcmp(): New utility to compare two colors. + - The initial background color is now configurable. Includes logic to + eliminates multiple background updates to get the right color. + - Minor configuration changes to handle mouse X/Y and touchscreen + X/Y differently. + + * File System/Block Drivers: + + - SmartFS: Increase some variables from uint16_t to uint32_t to handle + larger device sizes. From Ken Pettit. + - Add configurable AES encryption support to the block-to-character + (BCH) driver. This allows any block device to be accessed as an + encrypted character device. From Max Nekludov + - Add an MTD layer that will add read-ahead or write buffering to any + MTD driver (incomplete). + - Automounter: Add support for an auto-mounter that will automatically + mount and unmount a file system a media is inserted and removed + + * Audio/Audio Drivers + + - WM8904 audio CODEC driver. + - PCM .WAV file decoder. Fast forward implemented with sub-sampling + (currently no rewind support). + - Add a NULL audio device that can be used to simply unit-level testing + of audio decoders. + - Audio subsystem now supports interfaces for fast-forward and rewind + needed by CMediaPlayer; add hooks for equalizer settings needed by + the WM8904 CODEC. + + * Other Common Drivers: + + - MTD: Extend erase block size to 18-bits in order (decrease block + size to 14-bits) to handle parts with large erase blocks. From Kosma + Moczek + - maxTouch: Add support for the Atmel maXTouch touchscreen controller. + + * Host Simulation: + + - Provides the timers needed to support the Tickless mode of operation. + + * Atmel SAM4C: + + - Add SAM4CM IPC register header file. From Max Neklyudov + - Various fixes PMC and clock configuration for the SAM4CM port from + Max Neklyudov + + * Atmel SAM4E/4S Drivers: + + - SAM4 AES driver. Contributed by Max Neklyudov + + * Atmel SAMA5: + + - Add logic to redirect all SAMA5D4 interrupts to the AIC + - Add a configuration option to reserve DRAM for a framebuffer when + executing out of DRAM. This optional was available before when + executing out of NOR, but needs to work a little differently in + this case. + - Add SAMA5 slow (32.768KHz) clock support. + - Add support for the ARM L2CC-PL310 L2 cache. The system runs with + L2CC cache enabled but there is some issues still with the LCD DMA; + I suspect that the memory timing configuration for L2CC needs to + be tuned. + - Provides the timers needed to support the Tickless mode of operation. + + * Atmel SAMA5 Drivers: + + - XDMAC-based HSCMI driver for the SAMA5D4 + - Adapt the SAMA5D3 LCDC driver to work with the SAMA5D4 which has + no hardware cursor. + - PIO: Add a new interface sam_pio_forceclk() that can be used to + force PIO clocking on. I am afraid I was too conservative with + PIO clocking in the initial design; this is the price. + - TWI: Now supports the up_i2creset() method. + - TWI: Use sam_pio_forceclk() so that we can read the current state + of an open-drain output in the TWI reset logic. + - SSC: SCC Frame Synch Delay and Start Delay are now configurable. + - PCK: Add the slow clock and the main clocks as options for the + PCK configuration. + - Timer/Counter: Can now handle non-constant BOARD_MCK_FREQUENCY. Also + now supports methods to attach client interrupt handlers + - One shot and free-running timers. These are wrappers around the low + level timer/counter logic to provide one-shot and free-running + timers. These were developed to support the Tickless operation, but + can be used for any purpose. + + * Atmel SAMA5 Board Support: + + - Add a boot loader that runs from ISRAM and loads an Intel HEX file + into DRAM. + - Add a configuration that will load a bootloader into AT25 Serial + FLASH + - SAMA5D4-EK NSH configuration supports many more features: RTC, HSCMI + card detection, maXTouch touchscreen, TM7000 LCD, the command line + media player (currently using the NULL audio device), automounter, + and others. + - SAMA5D4-EK: Add an NxWM configuration using the TM7000 LCD with + the maXTouch multi-touch touchscreen. + - SAMA5D4-EK NxWM: Uses new, larger icons in configuration instead of + scaling. + - SAMA5D4-EK NxWM: The NxPlayer and audio system are now enabled in + the default configuration (but currently using the NULL audio + device). The automounter is used to automatically mount media + on an SD card. + - SAMA5D3x-EK: Add a configuration to support the command line + NxPlayer and to verify the WM8904 CODEC driver. + + * STMicro STM32: + + - Add support for the STM32F103RC and RD. From Kosma Moczek + - Add a procfs entry to show the state of the CCM heap usage. + From Pelle Winderstam + + * STMicro STM32 Drivers: + + - Unconfigure GPIO pins when closing a serial port to prevent back + effects from back-powering on the TX pin. From Kosma Moczek + + * NXP LPC17xx Drivers: + + - ADC: Added burstmode ADC conversion mode, with CONFIG_ADC_BURSTMODE + option in Kconfig. From Max + - Ethernet: Added option to use the kernel worker thread to do most of + the workload with CONFIG_NET_WORKER_THREAD option in Kconfig. From Max + - Ethernet: Critical bugfix: From time to time (after some hours) the + Ethernet receiver would lose one receive interrupt and the IP stack + never recover because there is no receive watchdog as the transmit + watchdog. From Max + + * NXP LPC17xx Boards: + + - mbed: Port ADC, DAC, and PWM logic from the configs/zkit-arm-1769. + From Max + - mbed: Eliminated a problem with PHY DP83848C : it doesn't need a + specific initialization on mbed. From Max + + * Library: + + - Adds support for localtime. From Max Neklyudov + + * Configuration/Build System: + + - Make variable definitions 'static const' when possible to save RAM + usage. From Kosma Moczek + + * Applications: + + - sysem/mdio: New PHY tool from Daniel Lazlo Sizter. + - NSH: Networking logic modified to handler the case of SLIP + transport. From Max Neklyudov. + - NSH: Add a configuration to use a USB keyboard for the stdin + device. + - NSH: Software assigned MAC address is now configurable. From Lazlo. + - NSH: Also add an option to let platform-specific logic select the + MAC address. + - NSH: There is now a configuration option that will bring up the + network on an separate thread. Since the network bring-up is + asynchronous, there are no serial console start-up delays due + to the network negotiation time. + - NxPlayer: Changes to integrate with Ken's NxWM::CMediaPlayer. + - NxPlayer: Add interfaces for fast-forward and rewind needed by + CMediaPlayer; add interface for equalizer settings needed by the + WM8904. + - NxPlayer: Supports new way of identifying the end of the audio + stream (see the Audio section above). + - Sudoku: Add a sudoku game. + +Bugfixes. Only the most critical bugfixes are listed here (see the ChangeLog for the complete list of bugfixes and for additional, more detailed bugfix information): + + * Graphics: + + - NxConsole: Fix scrolling for the case of the framebuffer device. In + this case, the logic for clearing the vacated region at the bottom + was missing so garbage would scroll up from the last, uncleared + line. + + * Networking: + + - Important fix to the read-ahead buffer queue management: Consumed + bytes were being trimmed from the head of the queue, but the queue + head itself was not being updated. From Rony XLN. + - Fix an error in SLIP escaping. From Max Neklyudov + + * Network Utilities: + + - Fix an include file ordering problem when CONFIG_NET_STATISTICS=y. + - Move statistics from uip.h to new netstats.h to remove a circular + inclusion problem + - Various fixes for networking and tiny webserver from Max + - webclient: Fix to offset calculation from Rony Xln. Prevents 0x0a + at the beginning of lines. + - webserver: Fix some configuration usage issues. From Max. + - webserver: Missing logic to close sockets on loop termination. + + * File System / Block Drivers: + + - SmartFS: Fix for a bug that would show up if CONFIG_MTD_BYTE_WRITE + was not selected and the SMART sector size was larger than the MTD + device's block size (like it would be if using SMARTFS on larger + flash devices). From Ken Pettit. + + * Audio: + + - Change how the end of the audio stream is detected by the leaf audio + component. This used to be done by looking for the first partial + buffer. That does not work with the in-place sub-sampling performed + by the PCM decoder: That always reduces the size of the buffer so + that all buffers only partially filled by the time they get to the + leaf. Now, a flag is set in the audio buffer flags set to indicate + the final buffer in the stream. + + * Common Drivers: + + - RAMLOG putc() method needs to set the errno and return EOF on a + failure. + - Add missing configuration option to select the MAX11802 touchscreen + controller. From Petteri Aimonen + + * Atmel SAMA5D3/4: + + - Fix logic in conversion of physical and virtual DRAM addresses when + running out of DRAM. This is an important bug fix for the SAMA5D3 + and 4 when running out of DRAM . + - Critical SAMA5D3 and 4 bug fix: PIO clocking must be enabled for + all input pins or else the value that is read never changes. + + * Atmel SAMA5D3/4 Drivers: + + - OHCI: Fix an error in a DEBUGASSERT statement. Caused an + assertion to fire inappropriately when a low- or full-speed device + was removed and CONFIG_DEBUG=y + - OHCI: Pointers to allocated port values were not being + nullified after being deallocated. This caused some assertions + to fire when debug was enabled + - SSC: Needs to account for data offset in audio buffer + + * ARMv7-M: + + - Correct the initial value of the BASEPRI register. This was + apparently never being initialized! From Max + + * STMicro STM32 Drivers: + + - I2C: Fix missing configuration of GPIO pins in I2C driver. Fix + from Alex D. + - STM32 OTGFS device: Various changes to try to reduce that amount of + time in interrupts handles and with interrupts disabled. From + Petteri Aimonen + + * Atmel SAM3/4 Drivers: + + - Ethernet: Wrong bits being cleared before OR-ing in new settings. + - Ethernet: Fix an error in the function that determines the number + of free TX descriptors. This is an important bugfix on busy + networks. + - I2C: Test for read or write operation was reversed. How could + this have worked before? + + * Atmel SAM3/4 Boards: + + - SAM4S Xplained-Pro: Correct description of LEDs and usage. From + Kosma Moczek + + * Atmel SAMA5: + + - PIO: Fix definitions that could disable PIO interrupt support if only + PIOE interrupts were enabled + - PIO: Macro SAM_PION_VBASE is not define-able for the SAMA5D4 and must + be replaced with a table lookup. + - PIO: Fix a typo in Schmitt trigger configuration; Configure pin as a + vanilla input first so that final pin configuration is more read-able + (i.e., easier to debug) + - PIO: Logic for Schmitt trigger selection backward + - SAMA5D4: Correct system timer frequency. Input clock is MCK/2, not MCK. + + * Atmel SAMA5 Drivers: + + - Ethernet: Wrong bits being cleared before OR-ing in new settings. + - Ethernet: Fix an error in the function that determines the number + of free TX descriptors. This is an important bugfix on busy + networks. + - HSMCI: The 8-byte SCR transfer was failing silently with the DMA + transfer, leaving the SD card in single bit mode. Fixed by adding + a non-DMA read transfer mode. + - HSMCI: Fix a problem on card insertion/removal callback handling. + Interrupts were being disable so that the callbacks occurred with + interrupts disabled. This resulted in loss of some interrupts and + some not-so-good behaviors. The solution is to perform all + callbacks on the work thread unconditionally + + * Atmel SAMA5 Boards: + + - PIO: Fix some cloned errors in SAM GPIO interrupt setup + + * NXP LPC17xx Drivers: + + - Ethernet: Comment out an assertion that is reported to fire + inappropriately. From Max + + * Library: + + - stdint.h: Correct naming of [U]INT_LEASTn_{MAX|MIN} and + [U]INT_FASTn{MAX|MIN}. From Kosma Moczek + - unistd.h: POSIX definitions should be defined to a value. rom Kosma + Moczek + - Fixes associated with rint() and related interfaces in the math + library. + + * Configuration/Build System: + + - NAME_MAX not available on SunOS; use FILENAME_MAX or MAXNAMELEN. + Noted by Douglas Beattie + + * Applications: + + - NSH: if # appears on line, need to comment ignore additional + commands on the line + - NxPlayer: Check for file read errors and end-of-file with zero + bytes read. Other error handling corrected as well. + - NxPlayer: NxPlayer needs to set curbyte field to zero before + enqueuing a buffer. Otherwise, it looks like beginning of the + buffer has already been consumed. + +NuttX-7.5 +--------- + +The 105th release of NuttX, Version 7.5, was made on September 28, 2014, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-7.5.tar.gz and +apps-7.5.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * Core OS: + + - Watchdog Timer Allocation: (1) If we run out of pre-allocated + watchdog times, the logic will now allocate additional timers + from the heap. A reserve of pre-allocated watchdog timers is + maintained so that there will always be timers available for + interrupt handlers. (2) Added support for statically allocated + watchdog timer + - Address Environment Support: (2) New OS APIs integrated into all + platform-specific context switching logic (up_block_task(), + up_unblock_task(), _exit(), and others). + - Kernel Build Support: (1) The MPU based "kernel build" renamed to a + protected build (CONFIG_BUILD_PROTECTED); added support for the a + new MMU-based "kernel build" (CONFIG_BUILD_KERNEL), (2) The system + call library can now be built with CONFIG_NUTTX_KERNEL. New + selection: CONFIG_LIB_SYSCALL. + - System Startup: Add configuration options to start the system from + a program on a file system (versus an address in memory). + - Startup Parameter Passing. There used to be two ways to pass + parameters to new tasks, depending upon the configuration: Either + (1) argv[] as created as an array with each string strdup'ed. Or + (2) argv[] array and strings were created on the stack before the + new task was started. Now, there is only one way, way (1). Way + (2) might be slightly more compact, but this is not worth carry the + complexity of two different ways of doing the same thing. + - Board Initialization: Add capability to perform initial board + initialization on a separate worker thread. This is needed because + there are many cases where initialization logic cannot execute on + the start-up/IDLE thread. That is because blocking or waiting is + not permitted on the IDLE thread. + + * Memory Management: + + - Granule Allocator: (1) Add a new function to reserve un-allocatable + regions in the granule heap. (2) Add interfaces to support + un-initializing a granule allocator. + - Page Allocator: Add a simple physical page allocator based on the + existing NuttX granule allocator. I am not certain if the granule + allocator is sufficiently deterministic for long range use, but it + gets get a page allocator in place for testing very quickly. + - Remove CONFIG_MM_MULTIHEAP. Non-multiheap operation is no longer + supported. + - sbrk(): sbrk() is now supported in the kernel build to permit + dynamically sized, per-process heaps. + - Per-Process Heaps: Space at the beginning of the process data space + is now reserved for user heap management structures. In the kernel + build mode, these heap structures are shared between the kernel and + use code in order to allocate user-specific data. + - User Heap Management: When a privileged thread exits, we have to + use the kernel allocator to free memory; when an unprivileged thread + exits, we don't have to do anything... heap memory will be cleaned + up when the address environment is torn down. + - Inter-Process Shared Memory Support: (1) Add implementation and + documentation for shmget(), shmctl(), shmat(), and shmdt(). (2) + Add system system calls to support the user call gate to the shared + memory interfaces. (3) Add platform-specific interface definitions + needed to support the shared memory feature. + - Virtual Page Allocator: Add support for a per-process virtual page + allocator. This is a new member of the task_group_s structure. The + allocator must be initialized when a new user process is started and + uninitialize when the process group is finally destroyed. It is + used by shmat() and shmdt() to pick the virtual address onto which + to map the shared physical memory. + + * File Systems/Block Drivers/MTD: + + - SMART FS and SMART FS procfs updates from Ken Pettit. + - The MTD Read-ahead/Write buffer layer appears is now functional. + + * Binary Formats: + + - Add logic to initialize the per-process user heap when each user + process is started. + + * Graphics: + + - Change all occurrences of NxConsole to NxTerm. + + * Networking: + + - PHY Interrupts: (1) Standardize a PHY interrupt attachment + interface. (2) Add support for an ioctl that can be used to notify + an application when there is a change in the network status + signalled by a PHY interrupt. + - Improved Send Logic: In the past, the first packet send to a new + network peer would fail; there would be no entry in the ARP table + for the peer and so an ARP request could replace that first packet. + Now as an option if CONFIG_NET_ARP_SEND=y, all send logic will (1) + check if the peer MAC address is in the ARP table and, if not, (2) + send ARP requests periodically to get the mapping and (3) wait for + the ARP response. Then (4) when the ARP response is received then + the actual send logic will be initiated. Thus there may be a delay + with the first packet sent to a new peer, but the packet should not + be lost + + * Host Simulation: + + - Emulated SPI FLASH driver for the sim target from Ken Pettit. + + * Intel x86: + + - The default host is now x86_64 and the -m32 option will be + automatically selected for simulation builds. + + * Intel 8051 Family: + + - Removed all support for the 8051 family architecture from the NuttX + source tree. The obsoleted code along with the removal patch can + now be found at misc/Obsoleted/. This code was removed because (1) + although some functionality has been demonstrated, I am not aware of + any really successful ports of NuttX to any 8051, and (2) the 8051, + with its hardware stack, forces limitations and complications to the + other architectures and make growth and development of NuttX more + complex. + + * ZiLOG ZNeo Boards: + + - configs/16z: Support for this board has been removed from the NuttX + source tree (but still can be found in the misc/Obsoleted + directory). This port is not ready for usage but may return to the + NuttX tree at some point in the future. + + * Atmel SAM3/4 Boards: + + - SAM4E-EK: Add (1) a fully-functional ILI9341-based LCD driver and + (2) a fully-functional NxWM configuration. + + * ARMv7-A: + + - Address Environments: Add support for application address + environments using the Cortex-A MMU. Implement standardized + platform-specific interfaces of NuttX address environment + support. + - Cache Operations: Implement standardized, platform-specific cache + operations. These are called from the ELF loader in order to flush + D-cache and invalidate I-cache after an ELF module has been loaded + into memory. With this change, ELF modules work correctly on the + SAMA5/Cortex-A platform. + - Kernel Build: (1) Add implementations of system call gate. (2) Add + CRT0 start-up file that can be linked with separately built user + programs. (3) Add support for delivery of use-mode signals in the + kernel build. (4) Add logic to initialize the per-process user heap + when each user process is started. (5) ARMv7-A exception handling + needs to work a little differently if we support user mode + processes. This is because R13 and R14 are paged differently + between user and SVC mode. + - Shared Memory Support: (1) Add logic necessary to handle remapping + of shared memory on context switches. (2) Extend virtual/physical + address conversions to include addresses in shared memory. (3) Add + implementation of platform-specific shared memory support. + + * Atmel SAMA5D Drivers: + + - Implement all network ioctls, including the new ioctl to setup PHY + event notifications. + - In kernel build with address environment, need logic to map user + virtual addresses to physical addresses, and vice versa. + + * Atmel SAMA5D Boards: + + - SAMA5D3 Xplained, SAMA5D3-EK, and SAMA5D4-EK: Convert existing + board specific PHY interrupt interfaces to use newly defined + standard interface. + - SAMA5D4-EK: Add a configuration for testing the kernel build + configuration. There are configurations to boot either from an SD + card or from and in-memory ROMFS file system. + - SAMA5D4-EK: Add documentation/support for Rev E. board. + + * STMicro STM32 Drivers: + + - Ethernet: Modified to support the change to the network ioctl + signature changes. Also add support for new ioctl to setup PHY + event notifications. + + * STMicro STM32 Boards: + + - STM32F4Discovery with STM32F4DIS-BB: Add a network enabled NSH + configuration for the STM32F4Discovery board with the STM32F4DIS-BB + base board installed. Includes support for the microSD card slot on + the STM32F4DIS-BB base board. + + * TI Tiva Drivers: + + - Add support for the TI CC3200. From Jim Ewing. + + * TI Tiva Boards: + + - Add support for the TI CC3200 Launchpad. From Jim Ewing. + + * C Library: + + - Re-implemented poll() delay using sem_timedwait(). + + * Configuration/Build System: + + - Export Target: In the kernel or protected builds, (1) only the user + libraries should be exported, (2) do not copy internal header files + or build scripts if this is a kernel or protected build, and (3) + needs to bundle up the user C startup file (crt0), not the kernel + head object for the kernel and protected builds. + - Add logic that will permit us to build user libraries with different + CFLAGS than kernel code. This is needed because we need the + -fno-common option when building ELF code to prevent SHN_COMMON + relocations. + + * Applications: + + - NSH: Extend the NSH network initialization logic. There is now an + option that will create a network monitor thread that will monitor + the state of the link. When the link goes down, the code will + attempt to gracefully put the Ethernet driver in a down state; When + the link comes back, the code will attempt to bring the network back + up. + - ELF Example: The ELF test/example has been extended so the + individual ELF test programs can link against the SYSCALL library + (if it is available) or against the C library to eliminate or + minimize the need for symbol tables. + - Change all occurrences of NxConsole to NxTerm. + - MTDRWB Example: Add an example to test MTD R/W buffering. + - OS Test Example: Add a trivial test of sem_timedwait. + + * Application Configuration/Build System: + + - Import Target: (1) Add logic that will allow building applications + against a NuttX export package (vs. the nuttx/ source tree). (2) + Add .config file to export package. (3) Create apps/import. Create + apps/import/Make.defs that does things like define CFLAGS; ELF build + requires -fno-common in CFLAGS. Copy some base logic from + nuttx/tools/Config.mk to apps/import/Make.defs. (4) Add + apps/import/scripts/gnu-elf.ld GCC linker script for ELF import + builds. + - All Makefiles: (1) Add an install target to all makefiles. For + the import build, the top-level Makefile now does two passes: (1) + builds libapp.a, then (2) installs the programs into apps/bin. (2) + Add program installation for CONFIG_BUILD_KERNEL in all Makefiles + that build a main(). (3) For kernel build, the object file + containing main cannot go into library because of name collisions. + The object file must be handled as a special case in every Makefile. + - All Built-In Programs: With kernel build (CONFIG_BUILD_KERNEL), + entry point to all tasks is main(), not some xyz_main(). + - NSH: Several commands must be disabled in the kernel build because + they depend on interfaces that are not available outside of the + kernel: dd, df, losetup, mkfatfs, mkdr, and ps. + - apps/tools/: (1) Add mkimport.sh to expload an NuttX import package + and install in apps/import. (2) Add mkromfsimg.sh script to create + a BOOT ROMFS filesystem image. + - ELF and NxFLAT Examples: Do not build test cases that use + task_create() if there is an address environment. + + * Tools: + + - refresh.sh: Add a tool to make refreshing configurations easier + when you want to do a lot of them. + - mksyscall.c: Build syscalls that do not need header files. + - mkexport.sh: Add .config file to export package. + - See above for new apps/tools scripts. + +Efforts In Progress. The following are features that are partially +implemented but present in this release. They are not likely to be +completed soon. + + * Processes. Much of the work in this release is focused on the + realization of Unix-style user processes in NuttX. There is more to + be done, however. The full roadmap and status is available at: + http://www.nuttx.org/doku.php?id=wiki:nxinternal:memconfigs#the_roadmap_toward_processes + + * XMega: There are some fragments in place for an XMega port. That + port has not really started, however. + + * Galileo: Similarly, there are fragments in place for an Intel Galileo + port. The port not been started in earnest either. + +Bugfixes. Only the most critical bugfixes are listed here (see the ChangeLog for the complete list of bugfixes and for additional, more detailed bugfix information): + + * Core OS: + + - Kernel build fixes: (1) IDLE TCB setup needs to indicate that the + IDLE thread is a privileged, kernel thread. (2) Don't build + task_create() or task_spawn() interfaces if there is an address + environment. (3) posix_spawn() kernel proxy thread should be a + kernel thread, not a user task. + - Several pthread interfaces: Add const storage class to phthread + parameters. From Freddie Chopin. + - sched/clock: Remove vestiges of g_tickbias; need, instead, to apply + time bias to g_basetime in order to provide the correct system time. + - System Calls: (1) Several typos fixed; corrected integration of + exevc(), execvl(), posix_spawn, and posix_spawnp system calls. (2) + If we are configured to use a kernel stack while in SYSCALL handling, + then we need to switch back to the user stack to deliver a signal. + + * File Systems/Block Drivers/MTD: + + - procfs: Fix some procfs breakage introduced by reorganizing some + non-reorganizable data structures. From Ken Pettit. + - AT45: In at45db_bwrite , the buffer is not increased when writing + more than 1 page. Sourceforge bug #34. + + * Binary Formats: + + - ELF relocations. Some relocation types do not have a named symbol + associated with them. The design did not account for that case. + - ELF Loader: Critical bugfix.. BSS was not being cleared. + + * Memory Management: + + - Granule allocator initialization uses wrong allocator to setting + aside kernel memory. + - Add a flag to group structure: If the group is created by a kernel + thread, then all resources in the group must be privileged. + + * Cryptogrphic Support: + + - crypto/cryptodev.c: Path segments reversed in include file path. Noted by Brennan Ashton. + + * Common Drivers: + + - Common CAN upper-half: In can_txdone, waiters on the semaphore + should be informed regardless of the return value of can_xmit. First + it returns -EIO if there are no new packets, and second the + information of the waiters is about the last transferred packet. + From Daniel Lazlo Sitzer. + + * ARM: + + - System Calls: Fix a typo in system call when fetching parameter from + the stack: regs[REG_PC]+4 is the address, not regs[REG_PC+4]. + + * STMicro STM32 Drivers: + + - STM32 F401 UART: Correct support for USART6 on this chip. From + Freddie Chopin. + - STM32 FLASH fixes: use size_t instead of uint16_t, make interface + more generic. From Freddie Chopin. + - Fix for UART7 and UART8 on STM32 clock enable from Aton. + - CAN: At the end of the interrupt handler, the interrupts were being + disabled, if all packets have been transferred when the interrupt + handler was invoked. This is problematic, because the interrupt + handler calls can_txdone of the upper half which can enqueue new + packets to send. Removed the block altogether, because can_txdone + calls can_xmit which disables interrupts if there are no new packets + to send. From Daniel Lazlo Sitzer. + - Additional STM32 CAN correction suggested by Max Holtzberg. + + * STMicro ST32 Boards: + + - configs/mikroe-stm32f4: Fix a few compile bugs and minor corrections + to the mikroe-stm32f4 configuration source. From Ken Pettit. + + * ARM9/ARMv7-A: + + - System Calls: Fix ARM7/9 and Cortex-A SYSCALLs: For threads in SVC + mode, the SVC instructions clobbers R14. This must be taken account + in the inline assembly. + - Task Setup: All tasks, even user mode tasks, must start in + supervisor mode until they get past the start-up trampoline. + - ARMv7-A: Modify up_fullcontextrestore() for CONFIG_BUILD_KERNEL. + It changed CPSR while in kernel. That will crash if the new CPSR is + user mode while executing in kernel space. Fixed by adding a + SYS_context_restore system call. There is an alternative, simpler + modification to up_fullcontextrestore() that could have been done: + It might have been possible to use the SPSR instead of the CPRSR and + then do an exception return from up_fullcontextrestore(). That + would be more efficient, but I never tried it. + + * Atmel SAM3/4 Boards: + + - SAM3X/Arduino Due: Fix typo in sam3x_periphclks.h; add SCLK + definitions to board.h header file. From Fabien Comte. + - SAM3 RTT: Only SAM4 family has RTTDIS bit in the MR register. + SourceForge bug #33 from Fabien Comte. + + * C Library: + + - sscanf(): NuttX libc tried to guess how many characters to parse, + extracted them into a buffer, then ran strtol() on that buffer. + That guess was often wrong. A better approach would be to call + strtol() directly on the input data, using the endptr return value + to determine how many characters to skip after parsing. From Kosma + Moczek. + - Corrected atan2 implementations from Denis Arnst. + - Change to lib_dtoa() to fix precision error from trailing zeroes. + From Bob Doiron. + + * Applications: + + - Fix NSH PS command: If there are no arguments, it could print + garbage for argument list. + + * Configuration/Build System: + + - Null Example: Need to include config.h it order know if this is or + is not a kernel build. This problem still exists in several other + file that may need to define main(). + +NuttX-7.6 +--------- + +The 106th release of NuttX, Version 7.6, was made on November 26, 2014, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-7.6.tar.gz and +apps-7.6.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * Core OS: + + - Moved name semaphore and message queue support out of the OS and + into the VFS. These improves the architecture by unifying the + management of named resources, removes redundant resource management + logic, and makes named semaphores and message queues visible in the + file system. By default, these are visible at /var/lock and + /var/mqueue. + - Add SIGPOLL for use as part of the AIO implementation. + - Remove CONFIG_MAX_TASK_ARGS configuration. There is now no + predetermined limit on the number of arguments that may be passed + to a new task on start-up. + + * Work queues: + + - Add support for priority inheritance on the low priority worker + queue. That is, if a higher priority thread has scheduled work, the + priority of the low priority worker thread(s) will be boost to the + priority of the queuing thread. At work is performed at at least + thread priority of the scheduling thread. If there are multiple + worker threads, then all threads get reprioritized. Currently + only implemented for AIO. + - Add support for multiple low-priority work queue threads. This + allows individual worker threads to block indefinitely for I/O as + necessary without halting the entire work queue. + + * VFS/General Drivers: + + - Implement create() (as a macro). + - Add pread() and pwrite(). Also added pread() and pwrite() + system calls. + - AIO: Add aio_read(), aio_write(), aio_return(), aio_error(), + aio_suspend(), aio_canel(), lio_listio(), and aio_fsync(). This + logic minimizes the creation of new threads by using the new + features also added to the low priority work queue with this + release. It uses the new low priority worker thread interface + to adjust the priority of the worker thread according to the + priority of the AIO client thread + - Implement standard syslogmask() to control logging (also removing + the non-standard syslog_enable()). + + * File Systems/Block Drivers/MTD: + + - Extend MTD support to the M25P16. From Sbastien Lorquet. + + * Drivers: + + - BCH (Block-to-Character): Add support for seeking in BCH. From + Sbastien Lorquet. + + * Graphics Support/Graphics-Related Drivers: + + - Add support for a generic ILI9341 LCD driver. From Marco Krahl. + - Add ANSI/VT100 foreground and background color commands. + - Add driver for ST7565 LCD that works with NHD-C12864KGZ display. From Pierre-noel Bouteville. + + * Networking: + + - Verify that multiple networks can be supported. + - Add support for the case where there are multiple networks: One + being Ethernet and the other not (SLIP, PPP, ...). The primary + difference from the standpoint of the stack is that (1) ARP may or + may not be necessary, (2) the size of the link layer header will + vary, and (3) different MTUs and TCP receive windows may be used + with each link. Suggested by Brennan Ashton. + - Extensions to UDP and TCP connection structures for the case of + multiple networks. In this case, assigned port numbers only have to + be unique with respect to the IP address. So, for example, you + could have multiple port 80's, one on each network. + + * Host Simulation: + + - Removed the old, strange up_stdio.c and implemented a simulated UART + driver to provide the console input. The new logic starts a + separate, Linux domain pthread to read the console input in raw mode + and provides the incoming data to NuttX via standard NuttX domain + IPCs. + - Add support for 64-bit longjmp/setjmp in simulator platform. This + will permit operation of the simulation natively on a 64-bit + platform. + + * ARMv7-M: + + - Add ARMv7-M CMSIS ITM header file and library. From Pierre-noel + Bouteville. + - Add ARMv7-M CMSIS DWT and TPI header files. From Pierre-noel + Bouteville. + - Add ARMv7-M support to use ITM for SYSLOG debug output. Includes + logic from Pierre-noel Bouteville. + + * Atmel SAM3/4 Drivers: + + - Add support for SAM3/4 basic serial TERMIOS and flow control. + There are issues with IFLOW control: PDC or DMAC support is + required. + + * Atmel SAM3/4 Boards: + + - SAM4E-EK: Add support for PHY interrupt. + + * Atmel SAMA5D Boards: + + - SAMA5D3-Xplained: Add a configuration that provides a simple test + for the EMAC and GMAC on the SAMA5D3 working together. + - SAMA5D4-EK: Add a configuration that provides a simple test for the + EMAC0 and EMAC1 on the SAMA5D4 working together. + + * Freescale KL: + + - Add an I2C header file for the Freescale KL family. From Alan + Carvalho de Assis. + + * NXP LPC32xx: + + - Add support for tickless operation using the NXP LPC43xx. From + Brandon Warhurst. + + * SiLabs EFM32: + + - Add a basic port for the SiLabs EFM32 family. Includes many files + contributed by Pierre-noel Bouteville . + + * SiLabs EFM32 Boards: + + - Add board support for the EFM32 Gecko Starter Kit. + - Add board support for the Olimex EFM32G8809128 STK. NOTE: I am + unable to test this configuration due to tool-related issues. + - Add board support for the SiLbas EFM32GG Giant Gecko Starter kit. + + * STMicro STM32: + + - Add support for the STM32 F411RE from Serg Podtynnyi. + - Add support for the STM32F103RG. From Murilo Ponte. + + * STMicro STM32 Drivers: + + - STM32 F4: Add logic that implement true high speed support for the + STM32 OTGHS peripheral and concurrent support for both LS and HS + OTG. New OTGHS drivers provided for both device and host. From + Brennan Ashton. + + * STMicro STM32 Boards: + + - STM32 Nucleo-F411RE: Extend this board configuration to also support + the Nucleo-F411RE. From Serg Podtynnyi. + - Add support for the STM32F429i Discovery's LCD (SPI based). From + Marco Krahl. + - configs/stm32f100rc_generic: Removed this generic board configuration. + I have decided to stop support of generic board configurations. Generic + board configurations do not provide support for any specific hardware + but can be useful only if there are not other examples for the setup + for a particular architecture. Not the case here. + + * C Library: + + - Add a mostly bogus wchar.h header file. This file is mostly bogus + because none of the wide character operations are currently + supported in the Nuttx C library. The file does provide the wchar_t + types needed by some software, however. + - Add isatty() function. From Alan Carvalho de Assis. + - Add mktemp(), mkstemp(), tmpnam() and tempnam(). + + * Configuration/Build System: + + - Add a PRELINK macro to Config.mk. From Kriegleder. + - compiler.h: Defines inline functions as not instrumented - this is + relevant for anyone using instrumentation. From Lorenz Meier. + + * Applications: + + - apps/interpreter/bas: Added in the Michael Haardt's BAS 2.4 adapted + for use by NuttX by Alan Carvalho de Assis. Includes support for + VT100 terminals and color commands. + - Examples: Added bastest/ which holds a special version of Michael + Haardt's BAS 2.4 test files adapted for use by NuttX on a ROMFS file + system. + - Examples: Add a simple UDP relay bridge for testing configurations + with multiple networks. Includes a host-side test driver for + testing the bridge. + - Netutils: Add implementation of timeouts for the netutils webclient. + From Brennan Ashton + - NSH: Add support for a custom NSH ROMFS startup image header file + location. From Martin Lederhilger. + - OS test: Add a simple test of named semaphores. + - OS test: Add AIO test case in OS test. + +Efforts In Progress. The following are features that are partially +implemented but present in this release. They are not likely to be +completed soon. + + * Processes. Much of the work in this release is focused on the + realization of Unix-style user processes in NuttX. There is more to + be done, however. The full roadmap and status is available at: + http://www.nuttx.org/doku.php?id=wiki:nxinternal:memconfigs#the_roadmap_toward_processes + + * XMega: There are some fragments in place for an XMega port. That + port has not really started, however. + + * Galileo: Similarly, there are fragments in place for an Intel Galileo + port. The port not been started in earnest either. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + +I ran cppcheck against the entire code base and correct many latent bugs +including things as serious as memory leaks, two locations where interrupts +were be disabled but never re-enabled, and errors in the Tickless mode of +operation. My thanks to the developers of cppcheck! I am impressed! + + * Core OS: + + - vfork(): Now that arguments are kept on the stack, the way that + arguments are passed from parent to child in vfork() must change. + This bug has always been present, but was not visible with the + old strdup() way of passing arguments. + - vfork() problem: If we get to vfork() via system call, then we + need to clone some system call information so that the return form + the cloned system call works correctly. + - Fixes to tickless operation code, especially in alarm mode. From + Brandon Warhurst. + - Fix an important bug in the watchdog timer creation logic. + - Calling mq_timedreceived() with immediate timeout was getting stuck + and not timing out. Immediate timeout is achieved by setting absolute + timeout value to past time, for example abstime={ .tv_sec=0, + .tv_nsec=0 }. However absolute time was converted to relative time + using unsigned integer arithmetic and resulted large ticks count by + clock_abstime2ticks, instead of expected negative ticks value. + Change corrects clock_abstime2ticks() to return negative ticks, if + absolute time is in the past. From Jussi Kivilinna. + + * Memory Management: + + - Fix a place in the memory manager where it explicitly assumed that + the size of a pointer is 4 bytes. That assumption was OK if the + actual size is smaller but made the heap unstable when used with + the x86_64 host simulation. + - Granule Allocator: If the INTR granule allocator mode is enabled, + there is no semaphore to destroy. From Lorenz Meier. + + * Networking: + + - Network routing: I don't think that the net_route() function has + ever worked correctly. The source IP was updated in the match + struct instead of the route IP. From Brennan Ashton. + - Move and rename IP header flag definitions. The problem fixed here + is that there IP header flag definitions were not available when TCP + was disabled. The IP flags are used in ICMP and IGMP. + - Network routing: Refuse to perform routing table lookups for the + Broadcast IP address. From Brennan Ashton. + - Network routing: Add logic to netdev_findbyaddr() to return the + correct network device for the case where a broadcast + address is used. This change caused trivial ripples through other + files because additional parameters are required for + netdev_findbyaddr() when CONFIG_NET_MULTINIC. + + * File Systems/Block Drivers/MTD: + + - NXFFS Dump: Fix problems with redefinitions of fdbg macro. With the + fix to the syslog prototype, a LOG priority must now be the first + parameter. Fixed by replacing all occurrences of fdbg with + syslog(LOG_DEBUG, and eliminating the macro redefinitions. Noted + by Sebastien Lorquet. + - poll() was not waking up from signals (for example mq_notify() + events). From Jussi Kivilinna. + - poll(): Add proper handling for sem_timedwait errnos. From Jussi + Kivilinna. + - include/nuttx/fs/fs.h: Fix typo in conditional compilation. From + Alan Carvalho de Assis. + + * Graphics/Graphic-Related Drivers: + + - Remove warnings when CONFIG_NXTK_BORDERWIDTH is set to zero. From + Pierre-Noel Bouteville. + + * Common Drivers: + + - Make standard syslog and vsyslog POSIX compliant (also modify + non-standard syslog functions for compatibility). + - R/W buffering: Fix typo that can cause compilation error. + + * Atmel SAM3/4: + + - SAM4S: Add missing SPI0 clock configuration macro for the SAM4S. From spasbyspas. + + * Atmel SAM3/4 Drivers: + + - SAM4E-EK: Fix an error in a USART1 pin number. + + * Atmel SAMA5D3/4 Drivers: + + - SAMA5DF4: Fix several typos that will prevented EMAC1 from + initializing properly. + + * NXP LPC43xx: + + - Fixes to allow compile of lpc43_gpioint.c. From Brandon Warhurst. + + * STMicro STM32: + + - Add missing ADC pinmap definitions for the STM32 F103R from Martin + Lederhilger. + + * STMicro STM32 Drivers: + + - STM32 EXTI: Correct STM32 RTC EXTI bit definition. From Lazlo. + - STM32 IWDG, WWDG, DBGMCU: Fix watchdog stop bit usage. From Lazlo. + - STM32 OTGFS: Correct a typo in the STM32 OTGFS register bit definitions. + + * ARM: + + - ARM up_internal.h: Add protection from C++ name mangling in the + ARM up_internal.h. From Lorenz Meier. + + * MicroChip PIC32MX: + + - PIC32MX7: DEVCFG0 bit 2 must be set. Writing bit 2 as zero can + brick the CPU on some versions. From Cris Kvist. + + * C Library: + + - The implementation of access() as vararg macro has the issue that + any function call with the same name (even in a C++ class) will + match with it and result in a compile error. Replaced with a small + function. This resolves the compile issue, and shouldnt have + negative side effects for users of the function. From Lorenz Meier. + - The definition of strncpy() is that empty space should be zero- + filled, the change adds the zero filling (See the POSIX spec here: + http://pubs.opengroup.org/onlinepubs/7908799/xsh/strncpy.html). From + Lorenz Meier. + - limits.h: Remove the definition of INT_FAST32_MIN which is already + defined in stdint.h (the correct location). From Lorenz Meier. + + * Applications: + + - apps/: Correct everything under apps to use the corrected syslog + interfaces. Remove any non-portable uses of syslog. + - NSH: Fix ls -l output for regular files. + - NSH: Fix reversed in/out file closing in DD command when an error + occurs. From Ken Pettit. + - NSH: Add logic to restart the console wait if an error occurs + while reading from the console. In USB console startup, the logic + must be able to open the USB serial and receive 3 newlines. + However, it the USB driver is disconnected or otherwise fails before + the 3 newlines are received, the receive loop becomes a killer, + infinite loop, CPU hog. Noted by spasbyspas. + - Netutils: Fix memcpy of host address in netlib_gethostaddr(). From + Brennan Ashton. + - Netutils: If you make a DNS request before the DNS address it would + cause an assertion. The state of the IP setting is not something the + application should be aware of, it should only be concerned with + whether or not the name was resolved. From Brennan Ashton. + - Netutils: Fix md5 hashing when digest[$i] islower that 16. From + Sergey. + - Stack Monitor: Fix compile problems introduced when the syslog() + prototype changed; Also update Makefile for kernel build From + Radoslaw Adamczyk. + - Examples: Update NxTerm makefile for kernel-build issues. From + Radoslaw Adamczyk. + - Examples: Fixes to keypadtest from Pierre-Noel Bouteville. + - Examples: These examples all set the IP address of eth1 but the + netmask and gateway of eth0 if DHCP is enabled: discover, tcpecho, + webserver, xmlrpc. That can't be right. + +NuttX-7.7 +--------- + +The 107th release of NuttX, Version 7.7, was made on January 26, 2015, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-7.7.tar.gz and +apps-7.7.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * Core OS: + + - Task exit handling: Add logic to clean up after task_delete() or + pthread_cancel() if the task happens to be waiting on a semaphore + when was is cancelled. + - Stack coloration: Removed CONFIG_DEBUG_STACK and replaced it with + CONFIG_STACK_COLORATION that does the same thing but without enabling + debug. From David Sidrane. + + * Common Drivers: + + - Discrete joystick driver: Added an interface definition and upper + half driver for a discrete joystick device (where X/Y changes are + indicated with button presses). + - Analog joystick driver: Added an interface definition and upper + half driver for a analog joystick device (where X/Y positions are + sampled, numeric values). + - Add driver support for the ADXL345 accelerometer. From Alan + Carvalho de Assis + - Generic serial driver: Add watermark levels to the serial RX flow + control logic. Modify the rxflowcontrol method to accept the number + of bytes in the buffer and a boolean indication of which watermark + was crossed. + + * File Systems/Block Drivers/MTD: + + - Add procfs write support. From Ken Petit. + - Implemented wear-leveling in the SmartFS. From Ken Pettit. + - MMC/SD Interface: MMCSD SDIO: Add support for a new + SDWAIT_WRCOMPLETE condition. The previous logic used a busy-wait + loop to poll the card R1 status to determine when the card was + ready for the next transfer. That busy-wait can be quite long -- + up to hundreds of milliseconds. An alternative is to look the SD D0 + pin which will change state when the card is no longer busy. This + change avoids the busy-wait poll by reconfiguring the SD D0 pin as a + GPIO interrupt, then waiting for the card to become ready without + taking up CPU cycles. From David Sidrane. + + * Drivers: + + - Add support for a generic EEPROM driver that accesses EEPROM as a + character driver (vs. an MTD driver). From Sbastien Lorquet. + + * Graphics Support: + + - Many new fonts converted for use with NuttX and added by + Pierre-noel Bouteville + + * Networking: + + - IPv4 support is now conditioned on CONFIG_NET_IPv4. + - Implemented and verified IPv6 support conditioned on + CONFIG_NET_IPv6. Either IPv4 or IPv4 or both may be selected. + Sockets, of course, must be bound to one or the other. Added support + for IPv6 ioctls to manipulate IP addresses. + - Integrated support for ICMPv6 and the ICMPv6 Neighbor Discovery + Protocol and ICMPv6 ECHO request/reply needed to support ping logic. + - All Ethernet drivers: Modified to support. Most, however, are + still missing address filtering logic required for ICMPv6 Neighbor + Discovery Protocol. See + http://www.nuttx.org/doku.php?id=wiki:howtos:ipv6#ethernet_driver_requirements + - Also added missing raw/packet socket support to all Ethernet drivers. + + * Host Simulation: + + - Add a configuration build and test the Traveler first person game + using the simulator. + - Add an X11 mouse-based simulation of an analog joystick device + + * Atmel SAMA5D Boards: + + - Add analog Joystick shield support for the SAMA5D3 Xplained board. + + * Freescale KL Drivers: + + - Add GPIO interrupt capability for the KL architecture. From Alan + Carvalho de Assis + + * Freescale KL Boards: + + - Freedom-KL25Z: Add board support for the ADXL345 accelerometer. From + Alan Carvalho de Assis + - Freedom-KL25Z: Update the Freedom KL25Z board CC3000 support to use + the current CC300 interfaces. From Alan Carvalho de Assis + + * NXP LPC43xx Boards: + + - A port of NuttX to the LPC4357-EVB from Toby Duckworth. This port + is a leverage of the LPC3330-Xplorer port and still have a some + misinformation from that port that needs to be updated for the + LPC4357-EVB. + + * SiLabs EFM32 Drivers: + + - Serial: Add support for serial termios TCGET and TCSET. For the + moment, only set/get speed is implemented. From Pierre-noel + Bouteville. + - RMU: Add support for the EFM32 reset management unit (RMU). From + Pierre-noel Bouteville. + + * SiLabs EFM32 Boards: + + - Add support for timer/PWM on the EFM32GG. From Pierre-noel + Bouteville + + * STMicro STM32: + + - Enable support for the STM32 F102. From the PX4 team. + + * STMicro STM32 Drivers: + + - STM32 F429 LTDC: Add interface to perform hardware accelerated layer + operation. Provides access to a reference of a specific ltdc layer. + From Marco Krahl + - STM32 F429 LTDC support: Implemented LTDC framebuffer support for the + generic nuttx framebuffer interface. Also implements the interface to + perform hardware accelerated layer operation by the ltdc controller + and dma2d controller later. From Marco Krahl. + - STM32: Add support for the internal low speed clock (LSI) as a + source of the RTC clock. Some boards do not have the external + 32kKhz oscillator installed, for those boards we must fallback to + the crummy internal RC clock. From Kevin Hester + - STM32 SDIO: Add support for the new SDWAIT_WRCOMPLETE condition. + From David Sidrane + + * STMicro STM32 Boards: + + - Add a discrete Joystick support for the STM3210E-EVAL. + - Add analog Joystick shield support for the Nucleo F4x1RE boards. + - STM32 F429i-Disco: Add support for initializing of the ltdc + controller and the lcd device connected on the stm32f429i-disco. + From Marco Krahl. + - Removed the px4-v2_upstream configuration. This was not the + official configuration for the PX4 board and has led to confusion + by NuttX users. The board configuration also requires some ongoing + maintenance and customization to support ongoing PX4 testing and + evaluation. It is best retained the PX4 repositories where it can + be properly maintained and not in the upstream NuttX repository. + + * TI Tiva: + + - Add support for the TI Tiva TM4C 129X family. Some unverified + support for the TM4C 1294 is also in place. + + * TI Tiva Drivers: + + - Added support for Tiva I2C driver. Verified on the Tiva TM4C123G + and TM4C129X. + - Added a Tiva TM4C129X Ethernet driver. + - Add a timer library for generic support of Tiva timers + - Add a driver lower half for drivers/timer.c. Only 32-bit periodic + timers are supported. This provides userspace access to timers. + + * TI Tiva Boards: + + - TM4C123G Launchpad: Add initialization logic for an external AT24 + EEPROM. This is intended only to support testing of the Tiva I2C + driver. + - Board support for the Tiva DK-TM4C129x Connected Development Kit. + - DK-TMC129X: Add an IPv6-enabled NSH configuration. + + * C Library/Header Files: + + - Added support for a variadic ioctl() function. The ioctl() + interface is a non-standard, Unix interface. NuttX has always used + the older, three-parameter version. Most contemporary systems now, + however, use a variadic form of the ioctl() function. Added an + option to insert a shim layer to adapt the three-parameter ioctl() + to use the variadic interface form. Internally, the ioctl handling + is the same three-parameter logic. The only real complexity to the + shim is in how the system calls must be handled. + - Added sys/custom_file.h. Used when CUSTOM_FILE_IO is define and + avoids re-definition errors about the FILE define. From Thomas + Gruber via the PX4 repository + - Add CRC8 support to the C library. From Ken Pettit. + - math.h: Added support for the expm1 functions. From Brennan Ashton + + * Applications: + + - apps/examples/djoystick: Add a test of the discrete joystick + driver. + - apps/examples/ajoystick: Add a test of the analog joystick + driver. + - apps/examples/ltdc: Add ltdc test example. From Marco Krahl + - apps/system/lm75: Add a tiny application to read the temperature + from an LM-75 (or compatible) temperature sensor + - apps/examples/timer: Add a trivial test of the timer driver + + - apps/system/cu: Add a minimalist implementation of the 'cu' + terminal program (part of Taylor UUCP for ages). Using it, you can + simply open a serial port and interact with it. Using '~.' you can + leave the terminal program and drop back to nsh. This might come + in handy for people that have e.g. GSM modems, GPS receivers or + other devices with text based serial communications attached to + their Nuttx systems. From Harald Welte + - apps/interpreters/micropython: A port of Micro Python to NuttX. + Contributed by Dave Marples + + - apps/netutils/dnsclient: Can select to be either IPv4 or IPv6, but + not both (IPv6 still does not compile) + - apps/netutils/netlib: Add new library functions to manipulate IPv6 + addresses. + - apps/examples/nettest: Update test so that it can be used to test + IPv6 TCP sockets + - apps/examples/udp: The UDP test example has been extend to support + IPv6 domain sockets + + - apps/nshlib: Add logic to initialize IPv6 addresses + - apps/nshlib: Add the ping6 command to support checking IPv6 networks. + - apps/nshlib: Clean up network status presentation for IPv6 + +Efforts In Progress. The following are features that are partially +implemented but present in this release. They are not likely to be +completed soon. + + * IPv6. While basic IPv6 support was completed in NuttX-7.7, + there are lingering issues with getting IPv6 compatibility + with applications and network utilities. + + * Processes. Much of the work in this release is focused on the + realization of Unix-style user processes in NuttX. There is more to + be done, however. The full roadmap and status is available at: + http://www.nuttx.org/doku.php?id=wiki:nxinternal:memconfigs#the_roadmap_toward_processes + + * XMega: There are some fragments in place for an XMega port. That + port has not really started, however. + + * Galileo: Similarly, there are fragments in place for an Intel Galileo + port. The port probably will not happen (I gave my Galileo board away!). + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - POSIX message queues: msg type should be char * not void * in + mq_send, mq_timedsend, mq_receive, and mq_timedreceive. Noted by + Pierre-Noel Bouteville + - POSIX message queues: In message queue creation return ENOSPC error + if size exceeds the configured size of pre-allocated messages; Use + ENOSPC vs ENOMEM per OpenGroup.org. From Pierre-Noel Bouteville. + - Task Names: strncpy() will not copy the terminating \0 into the + destination if the source is larger than the size of the + destination. Ensure that the last byte is always zero and let + strncpy() only copy CONFIG_TASK_NAME_SIZE bytes. The issue of + unterminated names can be observed in ps when creating a pthread + while CONFIG_TASK_NAME_SIZE is set to 8. From Daniel Willmann + + * Memory Management: + + - Granule allocator: Fixes some issues found by the PX4 team using + Coverity. From Pavel Krienko + + * Networking: + + - Several fixes correcting issues with the CC3000 networking. From + Jussi Kivilinna + - CC3000 Fix: Data can be unaligned. When dereferenced as an input + ntosh(), a bad value is returned. Reported by Alan Carvalho de + Assis + - Correct naming of fields in struct sockaddr_in6: sin6_port and + sin6_family, not sin_port and sin_family. + - accept(): Correct the value returned by accept() in the case where + net_lockingwait() is called. It was returning -1 and losing the + errno value. Noted by Rony Xln + + * Common Drivers: + + - Loop device should return -EINTR is interrupted by a signal. + - M25P serial flash driver: Add subsector size of the M24P16 part. + From Lazlo + - Common serial driver: In case a thread is doing a blocking operation + (e.g. read()) on a serial device, while it is being terminated by + pthread_cancel(), then uart_close() gets called, but the semaphore + is still blocked. This means that once the serial device is opened + next time, data will arrive on the serial port (and driver + interrupts handled as normal), but the received characters never + arrive in the reader thread. The problem was fixed by re- + initializing the semaphores on the last uart_close() on the device. + From Harald Welte + - Pipes: Fixes some issues found by the PX4 team using Coverity. From + Pavel Krienko + - CDC/ACM driver: Fixes some issues found by the PX4 team using + Coverity. From Pavel Krienko + + * NXP LPC43xx Drivers: + + - LPC4357: Changes required to get USART 2 & 3 working on the + lpc4357-evb. From Toby Duckworth. + + * STMicro STM32: + + - Several fixes correcting issues with the STM32 header files from + Jussi Kivilinna + + * STMicro STM32 Drivers: + + - Ported Tridge's STM32 I2C noise resilience logic from the PX4 + repository. + - STM32 F2 and F4: Set the GPIO_SPEED_50MHz on all F2 and F4 SPI pin + configurations. This is based on an F411 SPI1 errata but the fixed + is generalized to all SPI and all F2 and F4. Discovered and fixed + by Sebastien Lorquet. + - Fix for STM32 OTGHS device driver working in FS mode. From Ken + Pettit. + - For STM32 OTG HS DEV (in FS mode): Disable ULPI clock enable in RCC + AHB1 Register. If Both ULPI and the FS clock enable bits are set in + FS mode, then the ARM never awakens from WFI due to a chip issue. + This is only an issue if you are using the internal PHY. From Ken + Pettit. + - STM32 F429 LTDC: Add missing clut register definition. From Marco + Krahl + - STM32 serial: fix declaration and definition of up_receive() and + up_dma_receive() to match fields in the interface definition of + struct uart_ops_s. From Freddie Chopin. + + * TI Tiva Drivers: + + - Fix Tiva IRQ control logic; was limited to only 64 IRQs. That is a + problem for higher numbered IRQs on many platforms + + * C Library/Header Files: + + - avsprintf(): Fix a bug in usage of va_list on x86. On x86, + va_list is a pointer to a single copy on the stack. avsprintf() + calls lib_vsprintf() twice and so traverses the va_list twice using + va_start. va_start modifies that single copy on the stack so that + the second call to lib_vsprintf() fails. This appears to be an + issue with x86 only so far. + - stdint.h: Don't use hex values to specify minimum values of fixed + width, signed values. Hex values are inherently unsigned and not + usable for this purpose in all contexts. + - strncpy(): Would trash a lot of memory if n == 0. From Yasuhiro + Osaki. + - sscanf(). Accept %X and %F as well as %x %f as a format specifiers. + From Sbastien Lorquet + + * Applications: + + - apps/examples/romfs: fix romfs example builtin app registry issue. + From Librae + - apps/system/cdcacm, composite and usbmsc: Fix some strangely placed + conditional compilation. Looks like an automated update went awry + - apps/netutils/telnetd: Add protection when CONFIG_SCHED_HAVE_PARENT + is enabled: Call sigaction with SA_NOCLDWAIT so that exit status is + not retained (no zombies) and block receipt of SIGCHLD so that + accept is not awakened by a signal. If accept() is awakened by a + signal, do not do anything crazy like exit. Most from Rony Xln + - apps/nshlib/: NSH TFTP get command: Wrong file name used for the + destination. From Lazlo + +NuttX-7.8 +--------- + +The 108th release of NuttX, Version 7.8, was made on February 11, 2015, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-7.8.tar.gz and +apps-7.8.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +This release is primarily a bugfix release for the NuttX-7.7 version that +was release just two weeks prior. That release included substantial +modifications in the NuttX networking to accommodate support for IPv6. This +release follows close behind NuttX-7.7 in order to correct some the problems +discovered in that networking code. This release does, however, include a +small number of new features and bug fixes unrelated to NuttX networking. + +Additional new features and extended functionality: + + * Core OS: + + - Tickless Mode: added limit of maximum delay that can be request + by the scheduler tickless logic. This is necessary so that the + tickless logic does not request a delay beyond the capability of the + underlying hardware. From Macs Neklyudov. + + * Common Drivers: + + - VFS Unlink: Add an unlink method to both the character and block + driver interface. This is important because if the driver inode is + unlinked and there are no open references to the driver, then the + driver resources will be stranded. On the unlink call, the driver + has the opportunity (1) check if there an any open references, and + if not, (2) free the driver resources. + - Pipes and FIFOs: Implement the unlink method. If the pipe/FIFO is + unlinked, it will marked the pipe/FIFO as unlinked. If/when all + open references to the driver are closed, all of the driver + resources will be freed. + - Added an option to use the syslog'ing device as the system console. + This option enables a low-level, write-only console device at + /dev/console (similar to the low-level UART console device). From + Pierre-noel Bouteville. + + * File Systems/Block Drivers/MTD: + + - RAM/ROM disk: Add logic to dispose of the driver and RAM buffer + when the RAM disk has been unlinked and all open references to the + RAM disk have been closed. Add new parameters to romdisk() to + specify what should be done with the RAM/ROM buffer in this case -- + Should it be freed or not? Changed all calls to ramdisk() to use + these new parameters. + + * Networking: + + - Add support for local, Unix domain sockets. Support included for + both SOCK_STREAM and SOCK_DGRAM style local socket. + - UDP enhancement: Add UDP read-ahead support. In addition to + eliminating the main reason for lost UDP packets, then change + enables support for for poll/select on UDP sockets and also non- + blocking UDP sockets. From Macs Neklyudov. + - SLIP interface improvements. From Macs Neklyudov. + - IPv6 Neighbor Solicitation: Added logic to support verification + that we have the IPv6 address in the Neighbor Table before sending + any packets. If not, then the Neighbor Solicitation message is + sent. This feature is important because otherwise the first packet + sent to a remote peer will fail (it would have been replaced with a + Neighbor Solicitation). + - IPv6 Autonomous Auto-Configuration: Added support for sending + ICMPv6 Router Solicitation and receiving Router advertisement. The + local IPv6 address, mask, and router address are then auto-configured + from the response.. + - IPv6 Router Support: Add logic to behave like a router (if so + configured) only in the sense that NuttX will send the router + advertisement message in response to any received router solicitation + messages. Thus, one NuttX node in a network can configure the IPv6 + addresses of all other nodes in the network. + - Optional IPv6 address filtering added to all Ethernet drivers for + the all-routers multicast address. + + * Atmel AVR: + + - Added architecture support for the Atmel AVR ATMega1284P MCU. From + Jedi Tek'Unum. + + * Atmel AVR Boards: + + - Added support for the LowPowerLab MoteinoMEGA that is based on the + Atmel AVR ATMega1284P MCU. From Jedi Tek'Unum. + + * Atmel SAMA4: + + - Add support for Tickless mode of operation for the SAM4CM platform. + From Macs Neklyudov. + + * Atmel SAMA4 Drivers: + + - Ethernet: The SAM4E Ethernet driver can now be configuration to + perform all network processing on the work queue. This greatly + reduces the amount of interrupt level processing to service Ethernet + packets. + - SAM4E Ethernet: Add support multicast address matching and IPv6. + + * Atmel SAMA4 Boards: + + - SAM4E-EK: The nsh configuration now configures the Ethernet driver + for execution on the work thread. + + * Atmel SAMA5D Drivers: + + - SAMA5D4 Ethernet: The SAMA5D4 Ethernet driver can now be configuration + to perform all network processing on the work queue. This greatly + reduces the amount of interrupt level processing to service Ethernet + packets. + - SAMA5D3 and SAMA5D4 Ethernet: Add support multicast address matching + and IPv6. + + * Atmel SAMA5D Boards: + + - SAMA5D4-EK; Added a configuration to testing IPv6. + - SAMA5D4-EK: Converted the nsh and ipv6 configurations to configure + the Ethernet driver to use the work queue (vs. interrupt level + processing). + + * Freescale KL: + + - Add architectural support for the K26Z128VLH4 chip. From Derek B. Noonburg. + + * Freescale KL Boards: + + - Add board support for the Freedom KL26Z board. From Derek B. Noonburg. + + * NXP LPC17xx Drivers: + + - Ethernet: Add support multicast address matching and IPv6. + + * SiLabs EFM32: + + - Add configurable option to unconditionally enable LE clocking. Even + you don't use core clock LE as source for LFA or LFB, to read are + write any register not clocked by HFPERCLK or HFCORECLK, HFCORECLKLE + should be enabled. From Pierre-noel Bouteville. + + * SiLabs EFM32 Drivers: + + - EFM32 RTC: RTC driver using BURTC. From Pierre-Noel Bouteville. + + * STMicro STM32 Drivers: + + - AES: Add driver for STM32L162XX AES peripheral. From Juha Niskanen. + - Ethernet: The STM32 Ethernet driver can now be configuration to + perform all network processing on the work queue. This greatly + reduces the amount of interrupt level processing to service Ethernet + packets. + - Ethernet: Add support multicast address matching and IPv6. + + * STMicro STM32 Boards: + + - Added an IPv6 configuration for the STM32F4-Discovery board (with the + STM32-DISCO_BB base board). + - Converted all STM32F4-Discovery configurations (with base board) to + configure the Ethernet driver to use the work queue (vs. interrupt + level processing). + + * TI Tiva Drivers: + + - Added support for TM4C123G timers. From Calvin Maguranis. + - Added a Tiva ADC driver. From Calvin Maguranis. + + * TI Tiva Boards: + + - Added TM4C123G timers on the TM4C123G Launchpad. From Calvin Maguranis. + - Added Tiva ADC support to the TM4C123G-Launchpad. From Calvin Maguranis. + + * C Library/Header Files: + + - Math Library: Added support for inverse hyperbolic functions, + isfinite(), error functions, nan(), copysign(), and trunc() + functions. From Brennan Ashton. + + * Applications: + + - apps/examples/ustream: Add a simple test of Unix domain stream + sockets. + - apps/examples/udgram: Add a simple test of Unix domain datagram + sockets. + - apps/netutils/netlib: Add utilities to convert to/from prefix + lengths from/to 128-bit network masks. + - apps/nshlib: Modify the NSH IPv6 ifconfig command to show the more + standard post-pended prefix value, rather than the full 128-bit + netmask. + +Efforts In Progress. The following are features that are partially +implemented but present in this release. They are not likely to be +completed soon. + + * Processes. Much of the work in this release is focused on the + realization of Unix-style user processes in NuttX. There is more to + be done, however. The full roadmap and status is available at: + http://www.nuttx.org/doku.php?id=wiki:nxinternal:memconfigs#the_roadmap_toward_processes + + * XMega: There are some fragments in place for an XMega port. That + port has not really started, however. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Work Queues: Fix a backward calculation when determining the time + to the next interesting event. . From Liio Chen via the PX4 + repository. + - clock_systimespec(): Fixes for compilation errors in certain + configurations. From Macs Neklyudov. + + * Graphics + + - Fixed a problem with one of the font files. From Pierre-noel Bouteville. + + * Networking: + + - IOB Deadlock: There were issues with the TCP write-ahead buffering + if CONFIG_NET_NOINTS was enabled: There is a possibility of + deadlocks in certain timing conditions: The network should never + wait for TCP read-ahead buffering space to be available. It should + drop the packets immediately if no buffering is available. This was + fixed by duplicating most of the IOB interfaces: The versions that + waited are still present (like iob_alloc()), but now there are non- + waiting versions of the same interfaces (like iob_tryalloc()). The + TCP read-ahead logic now uses only these non-waiting interfaces. + - TCP Deadlock: Fix another deadlock when CONFIG_NET_NOINTS is enabled. + tcp_write_buffer_alloc() calls sem_wait() with network locked. That + worked if CONFIG_NET_NOINTS was not defined because interrupts are + automatically restored when the wait happens. But with + CONFIG_NET_NOINTS=y, the wait blocks with the network locked -- bad + style and also can lead to a deadlock condition. + - ARP response waiting: Fixes another CONFIG_NET_NOINTS issue. When + called sem_timedwait() with the network locked, the network stays + locked while we wait which is not what we want (without CONFIG_NET_NOINTS, + interrupts are re-enabled while we wait and all is well). + - TCP accept(): Fix a major TCP bug introduced with the NuttX-7.7 + IPv6 changes: Some connection logic was reordered; setting the + socket as 'connected' got moved to BEFORE the point where the check + was made if the socket was already connected. The resulting behavior + was odd: Telnet would connect, but then when you exit and reconnect, + it would fail to connect. But then if try again, it would connect + okay. So the symptom was connect-fail-connect-fail-... + - Lots of build problems introduced into multiple NIC support with the + IPv6 changes of NuttX-7.7. Many places where conditional logic based + on CONFIG_NETDEV_MULTINIC is confused with CONFIG_NET_MULTILINK. + Lots of code changed with IPv6 that was never compiled with MULTINIC + enabled. + + * Common Drivers: + + - Pipes and FIFOs: Fix a race condition between FIFO buffer operations + and the opening and closing of FIFOs which necessary when the FIFOs + are used to support Unix domain, datagram sockets. The default + policy is the deallocate FIFO buffering when the last client closes + the pipe. When when used for datagram communications, packets left + in the FIFO will be lost. Some like UDP read-ahead is needed: The + buffered data in the FIFO needs to be retained until the reader gets + a chance to re-open the FIFO. Added an ioctl (PIPEIOC_POLICY) to + control the buffer policy. Default (0) is the legacy behavior; Unix + domain datagram logic sets the alternative policy so that the packet + data persists after the FIFO is closed. + - RAMTRON: Table of parts is not terminated properly if + CONFIG_RAMTRON_FRAM_NON_JEDEC is not defined. Noted by David + Sidrane. + + * All Architectures: + + - Removed all occurrences of up_maskack_irq() that disables interrupts + with up_ack_irq() that only acknowledges the interrupts. This is only + used in interrupt decoding logic. Also remove the logic that + unconditionally re-enables interrupts with the interrupt exits. This + interferes with the drivers ability to control the interrupt state. + This is a necessary, sweeping, global change and unfortunately + impossible to test. + + * ARM + + - ARMv7-A and ARMv7-M memcpy(): Optimized ARM assembly language + memcpy's were not returning a value in R0 they are required to do. + From David Sidrane. + - ARMv7-A interrupt handler should not automatically re-enable interrupts + on interrupt return. That interferes with the driver's ability to + manage interrupts. Analogous change made to all other architectures + as well (ARM7, ARM9, HC, SH, x86, z16, z80, etc,. See above.). + + * STMicro STM32: + + - GPIO Interrupts: Disabling any of EXTI 5-9 interrupts was disabling + interrupts for all EXTI 5-9. Same issue with EXTI 10-15. From Jussi + Kivilinna. + + * STMicro STM32 Drivers: + + - RTCC: Fix for recent changes that caused compilation failrues with + STM32L15XX configurations. From Jussi Kivilinna. + - SPI: The source clock for SPI 4,5, and 6 should be PCLK2, not PCLK1 + (for F411, F427, and F429). Per David Sidrane. + + * C Library/Header Files: + + - execl(): Fix bad logic in counting the number of arguments. + execl() parameter passing could never have worked. Noted by + Pierre-noel Bouteville. + + * Applications: + + - Fix for building with parallel make. Build-server sometimes failed + 'make -j24' with errors in the builtin line or or sometimes silently + succeeds but generated builds that contain a random subset of + configured NuttX applications. There are two root causes for this: + (1) Recipes for building builtin_list.h and builtin_proto.h are + not linearizable, and (2) Nothing ensures that 'make context' is run + first for apps/builtin. This change address both issues. From Juha + Niskanen. + +NuttX-7.9 +--------- + +The 109th release of NuttX, Version 7.9, was made on April 14, 2015, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-7.9.tar.gz and +apps-7.9.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * Core OS: + + - Assertions: Add support for dumping board-specific information on + assertions. From David Sidrane. + - boardctl(): : Add a new non-standard OS interface called boardctl(). + This is similar to a driver IOCTL call. But this is an IOCTL call + directly on the board logic. This function will eventually replace + all of the ad hoc OS interfaces that are current used to perform + application specific initialization and application driver test + configuration. It essentially formalizes and institutionalizes + these rogue interface in to at least a single crazy call. + + * Graphics: + + - Line Joins: Line drawing graphic functions now take an argument that + will draw a circular "cap" on the ends of lines to support cleaner + joining of lines segments.. + + * Common Drivers: + + - SPI iInterface: Add an SPIDEV_USER so that there can be board- + specific definitions of SPI devices. + - I2C Interface: Add a user provided void * argument to the I2C + callback method for the I2C slave interface. Suggested by Nate + Weibley. + - AT24 EEPROM Driver: Add support for (1) the byte-oriented read() + method, (2) devices that have extended memory regions, and (3) + devices that use 8-bit addressing. + - Freescale MPL115A barometer: Add driver for the Freescale MPL115A + barometer. From Alan Carvalho de Assis. + - CS2100-CP: Add a driver for the CS2100-CP Fractional-N Multipler + chip. + - RTC IOCTls: Added the definitions of a driver based RTC interfaces + and RTC upper half driver. + + * File Systems/Block Drivers/MTD: + + - umount2(): Added to support un-mount flags. umount() is now a macro + that just calls umount2() with flags = 0. + - File system interface: Pass the umount2() flags to every unbind() + implementation. That is where the decision to umount or not and how + to umount will be made. + - FAT unbind: Add support for umount2(target, MNT_FORCE) in the FAT + file system. + + * Networking: + + - netdev_register(): Improve the network device registration logic. + When multiple link types are used, modify how each interface number + is assigned to the device name by incrementing the device number + individually for each interface link type. From Max Neklyudov. + - Add TUN network device. Used to support the Netutils PPPD + implementation. From Max Neklyudov. + + * ARMv7-M + + - ARM Cortex-M7: Add basic support for the Cortex-M7 architecture. + - ARMv7 Common Lazy Exception handling. Add common support for lazy + FPU state saving. MCU-specific lazy FPU saving was already in place. + This change just makes the code share-able. + + * Atmel SAMA5D3/4 Drivers: + + - SAMA5 Serial: Backport support for flowcontrol and termios from + SAM3/4. + + * Atmel SAMV7: + + - Atmel SAMV7: Add architecture support for the Atmel SAMV7 family + (Cortex-M7) + + * Atmel SAMV7 Boards: + + - Atmel SAMV71 Xplained Ultra: Add board support for this SAMV7 board. + This initialize release includes support for: SDRAM, TWI/I2C, SPI, + Ethernet, HSMCI, DMA, GPIOs, UARTs, AT24 EEPROM and the maXTouch + Xplained Pro LCD. Drivers are available for SSC/I2C, the WM8904, + the maXTouch trouchscreen, and USB device but have not yet been + fully integrated in this release. + + * SiLabs EFM32 Drivers: + + - EFM32 USB Device is now functional with the efforts of From Pierre- + noel Bouteville. + - EFM32 I2C: Add I2C driver. From Pierre-noel Bouteville. + + * STMicro STM32: + + - STM32F372/F373: Adds architecture support for this STM32 parts. + Tested on STM32F373CC. Contributed by Marten Svanfeldt. + + * STMicro STM32 Drivers: + + - STM32 RTCC: Break out a new internal interface, stm32_rtc_setdatetime(). + This eliminates some un-necessary time conversions. From Freddie Chopin. + - STM32 RTCC: Add an implementation of the RTC lower half interface + for the STM32. + - STM32 RTCC: Extend the RTC interface to support reading subseconds. + From Jussi Kivilinna. + - STM32 BBSRAM: Adds the ability to use the STM32F2 and STM32F4 Battery + Backed SRAM in the file system. With an option to Save Panic context + to one of the files. From David Sidrane. + + * STMicro STM32 Boards: + + - Olimexino-STM32: Board support for the Olimexino STM32 board from David + Sidrane. + - Viewtool-STM32F107: Add support for an optional, add-on Freescale + MPL115A baramoter. From Alan Carvalho de Assis. + + * TI Tiva: + + - TM4C1294: Add support for the TM4C1294. Contributed by Frank Sautter. + + * TI Tiva Drivers: + + - Tiva ADC: Updated files to allow for ADC and PWM triggering by a + timer. Refactoring of ADC implementation. From Calvin Maguranis. + - Tiva Timer: Refactoring by Calvin Maguranis + + * TI Tiva Boards: + + - TM4C123G-launchpad: Add ADC support. From Calvin Maguranis. + - TM4C123G-launchpad: Add board button interrupt support. From Calvin + Maguranis. + - TM4C1294 Launchpad: Add support for the TM4C1294 Launchpad. + Contributed by Frank Sautter. + + * Microchip PIC32 + + - PIC32MZ: Add architectural support for the PIC32MZ (MIPS32 M14k). + Includes contributions from Kristopher Tate. + + * Microchip PIC32MZ Boards + + - PIC32MZ Starter Kit: Add basic board support for the PIC32MZ. + Includes contributions from David Sidrane. + + * C Library/Header Files: + + - gettimeofday(): This function is no longer a core OS interface. It + is only a wrapper around clock_settime(). + - settimeofday(): Added. gettimeofday has been deprecated in POSIX + 2008. settimeofday() was never part of POSIX, but I decided to add + it to libc as well just for symmetry. + - Day-of-Week: Add CONFIG_TIME_EXTENDED to support the last 3 members + of the tm struct and support for filling them in with the day of the + week. From David Sidrane. + - sighold(), sigrelse(), sigignore(), sigset() and sigpause(): New + signal handling functions. + - sys/select.h: Extend the fd_set type definition so that it can + handle more than 32 descriptors (if so configured). From Max + Neklyudov. + - netdb.h: Add a mostly-commented-out version of the standard netdb.h + header file. + - include/nuttx/board.h: Remove common board function prototypes from + other files and consolidate them in this new header file. + + * Applications: + + - OS test: Improved error checking for sem_timedwait() from Juha + Niskanen. + - OS test: Add a simple test of sigprocmask, sighold, and sigrelse. + - PPPD test: Add PPPD test case. Split out from the PPPD daemon by + Brennan Ashton. + - Netutils: Add a PPP daemon. From Max Neklyudov. + - NSH: NSH initialization now calls boardctl(BOARDIOC_INIT) instead + of nsh_archinitialize(). Remove support for CONFIG_NSH_ARCHMAC. + It is not used and there are better ways to do that operation. + - NSH: Allow NSH 'date' command with no hardware RTC. This command + is useful without an RTC too. Also, this permits testing on the + simulator which never has an RTC. + - apps/examples/: Several tests changed (touchscreen adc, pwm, + graphics). No longer call directly into the OS, but rather + indirectly via boardctl(). + - Modbus: Includes extensions to support RTU master mode by + Armink(383016632@qq.com): https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32. + Ported to NuttX by Darcy Gong. + - TZ database: All logic to build timezone database needed for + localtime() support. Does not do much else yet. + +Efforts In Progress. The following are features that are partially +implemented but present in this release. They are not likely to be +completed soon. + + * Processes. Much of the work in this release is focused on the + realization of Unix-style user processes in NuttX. There is more to + be done, however. The full roadmap and status is available at: + http://www.nuttx.org/doku.php?id=wiki:nxinternal:memconfigs#the_roadmap_toward_processes + + * XMega: There are some fragments in place for an XMega port. That + port has not really started, however. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - atexit(): Fix compile failure due to reference to undefined variable + in certain configurations. From Juha Niskanen. + - syscalls: Last changes to message queue prototypes did not make it + into call gate logic. Some additional errors had crept as well since + the system calls are seldom used. + - waitpid(): Do not use uninitialized boolean in waitpid(). From Juha + Niskanen. + - Timing functions: Fix some nanosecond comparisons. Comparisons should + be greater than OR EQUAL TO 1000000000 for maximum value of nanoseconds + in struct tm. From Juha Niskanen. + - Time initialization: Fix an error in time initialization when there + is no RTC and the time is initialized from a fixed configured value. + The call to clock_calendar2utc() was returning the time in units of + seconds. The initialization logic, however, was expecting to get + time in units of days. This problem has been there forever but + obviously has not significant impact to behavior in systems where + time is not visible. + - mq_timedsend(): Should not check for valid time if there is space + in the message queue. Noted by Freddie Chopin. + - select() and sem_timedwait(): Fix places where the errno value was + being overwritten by subsequent actions so that the returned errno + value was incorrect. From Max Neklyudov. + - clock_systimer64(): Fix a problem in clock_systimer64 that occurs + when (1) the 64-bit system time is enabled, and (2) the value of + CONFIG_USEC_PER_TICK is less than 1 milliseconds (such as when using + the tickless mode of operation). In that case, the conversion of + time to 64-bit millisecond value in clock_systmer64() causes some + bad times to be returned. Time was converted to milliseconds, then + to configured ticks. Precision was lost in the millisecond + conversion. The fix is to first convert time to a 64-bit microsecond + value, then to the configured tick value. Noted by David Sidrane. + - clock_systimespec(): When an RTC is used clock_systimespec() must + subtract the basetime from the returned time. It needs to return + the time since power up, no the current time. Issue noted by Max + Neklyudov. + - AIO: correct some backward tests in aio_read() and aio_write(): + Socket descriptors have higher numbers than file descriptors. In + aio_contain(), Copy u.ptr (void *) when initializing aioc and not + the case specific u.aioc_filep. From Michal Ulianko. + + * File Systems/Block Drivers/MTD: + + - procfs: Fix potential NULL pointer dereference of 'node'. From + Juha Niskanen. + - FAT: fat_unbind() was accessing 'fs->fs_sem' after freeing the 'fs' + struct. From Juha Niskanen. + - mkfatfs: Use DMA memory for mkfatfs when needed. This makes mkfatfs + use fat_dma_alloc() when CONFIG_FAT_DMAMEMORY is set. This is needed + to ensure mkfatfs operates with boards that use DMA for microSD. + From Andrew Tridgell via the PX4/NuttX repository. + - FAT unmount: Fix a bug in the FAT unbind() logic. There were + problems with the way certain internal list handling was + implemented. The end result is that newly opened or cloned file + structures were never being added to the list of open files. So + when the unmount() happens, it always looked like there were not + open files and a crash could ensue. + - FAT mounting: Fix misthink when CONFIG_ENDIAN_BIG=y. From Lwazi Dube. + + * Common Drivers: + + - CAN upper half driver: Some lines had to be reordered in the can_open + function otherwise the open count will only be incremented from 0 to + 1. This caused problems when trying to open the can bus from two + different tasks. SourceForge Patch #46. + + * Crypto: + + - crypto: Fix issues when AES support was added for the STM32L1. + From Juha Niskanen. + + * Networking: + + - Network initialization: Divide net_intiialize() into net_setup() and + net_initialize() to solve a chicken-and-egg problem. net_setup() + must be called before up_initialize() is called so that networking + data structures are ready to register new network devices. + net_initialize() now does only timer related operations and is + called AFTER up_initialize() where the timers are configured. + Problem noted by Max Neklyudov. + - netdev_unregister(): Fix a list handling error. From Max Neklyudov. + - Socket dup: Do not call sockfd_socket() twice. From Juha Niskanen. + + * Common Drivers: + + - max11802 touchscreen: Fix possible unmatched IRQ restore (not + normally a problem, but could happen in certain configurations). + Noted by Juha Niskanen. + - MMCSD SPI Multi-block transfers: ACMD23 must be preceded with CMD55 + command as any other ACMD commands. Also, after the block reading + wait loop must be inserted before writing the next block of data to + the sd card. From Dmitry Nikolaev via Jussi Kivilinna. + - MMCSD SDIO: Fix some bad logic when file system debug is turned on: + Arguments to syslog were missing so that garbage was being printed. + - Common upper-half serial driver: Report correct number of bytes free + in serial buffer with FIONWRITE. From Sami Pelkonen via Jussi Kivilinna. + - Pipes/Fifos: Fix zero-lenth writes to pipes/FIFOs. From Jussi Kivilinna. + - USB device MSC: Add NULL pointer check. From Juha Niskanen. + - BCH driver: Avoid NULL pointer dereference when bch->refs == 255. + From Juha Niskanen. + - Various drivers: The inode unlink method should not be support if + operations on the root pseudo-filesystem are disabled. + + * ARMv7-M + + - ARMv7M MPU: Bad syntax in ARMv7-M MPU logic would cause failure to + write the correct value to the MPU_RASR register. From Juha Niskanen. + + * Atmel SAM3/4 Drivers: + + - SAM3/4 Serial TERMIOS: A side-effect of changing serial settings + via TERMIOS (such as tcsetattr) is that serial interrupts were being + left disabled. This is not a problem if the serial configuration is + changed when there are no open references to the serial device. In + that case, serial interrupts are disabled and will not be enabled + enabled until the serial device is first opened. But it is fatal if + the serial device is already opened and if there is a task waiting + to receive data. In that case, the side-effect of disabling + interrupts is fatal: That task is then left hanging with interrupts + disabled. + - SAM3/4 Serial: The IMR register is read-only. This means that + sam_restoreints() did not actually re-enable UART interrupts + (Fortunately, that function was not being used up to this point). + - SAMA5 HSMCI: Fix a bug in SAMA5 HSMCI. The bitfield mask and shift + values were reversed resulting in a trashed value for the number of + blocks in the BLOCKR register. This was sufficient to prevent DMA + writes from working. + + * Atmel SAMA5 Drivers: + + - SAMA5 Timer/Counter: Fix typos in timer/counter header file. From + Bob Doiron. + + * STMicro STM32 Drivers: + + - STM32 PWR and RTC: Changes to support fully write protecting the + backup domain. N.B. stm32_pwr_enablebkp did not account for the delay + from enable to the domain being writable. The KISS solution is a + up_udelay. A more complex solution would be a negated write test + with restore. From David Sidrane. + - STM32 SPI: Add missing SPI callback functions to the STM32 SPI + driver. From Freddie Chopin. + - STM32 I2C: Add missing NULL check. From Juha Niskanen. + - STM32 USB device: Fix stale initialization invalidating later NULL + check. From Juha Niskanen. + - STM32 UART: Fix RX DMA setup for UART5. From Jussi Kivilinna. + - STM32 UART: Make input hardware flow-control work with RX DMA. From + Jussi Kivilinna. + - STM32 RTC and clock control: The STM32F4Discovery board doesn't + come with a Low speed external oscillator so the default LSE source + for the RTC doesn't work. In stm32_rtcc.c the up_rtc_initialize() + logic doesn't work with the LSI. The check on RTC_MAGIC on the BK0R + register lead to rtc_setup() call that rightfully enables the LSI + clock; but the next times, when the rtc is already setup, the + rtc_resume() call does NOT start the LSI clock! The right place to + put LSE/LSI initialization is inside stm32_stdclockconfig() in + stm32fxxxxx_rcc.c. Doing this I checked the possible uses of the + LSI and the LSE sources: the LSI can be used for RTC and/or the + IWDG, while the LSE only for the RTC (and to output the MCO1 pin). + This change is not verifed for any other platforms. From Leo + Aloe3132 + + * Tiva Drivers: + + - Tiva GPIO driver needed small fixes in the configuration routines and + discovered false-positive bugs in interrupt testing: interrupts are + now verified to actually be working reliably. From Calvin Maguranis . + + * MIPS32: + + - mips32/Toolchain.mk: Current Pinguino toolchain uses the prefix p32- + instead of mips-. + + * C Library/Header Files: + + - sigaddset() and sigdelset(): Need to set errno if a bad signal + number is received. + - sfrtime(): Missing implementation of %C in sfrtime() C (was being + treated as %y). From Freddie Chopin. + - pthread.h: Fix PTHREAD_COND_INITIALIZER. + - ungetc.c: Fix NULL pointer dereference in ungetc() if 'stream' was + NULL, 'stream->fs_oflags' was evaluated. From Juha Niskanen. + - Fixes to asinh(), atanh(), and sinh(): The 'basic' expansions all + exhibited bad cancellation errors near zero (<= 1E-10). This can be + easily seen e.g. with x = 1E-30, the results are all zero though they + should be extremely close to x. The cutoff values (1E-5, 1E-9) are + chosen so that the next term in the Taylor series is negligible (for + double). Functions could maybe be optimized to use only first term (x) + and a smaller cutoff, just bigger than where the cancellation occurs + - localtime(): Inconsistent configuration name: CONFIG_LIBC_TZDIR vs + CONFIG_LIBC_TZ_TZDIR. Former wins. + + * Applications: + + - Modbus: Fix some compile problems when TCP is enabled. + +NuttX-7.10 +---------- + +The 110th release of NuttX, Version 7.10, was made on June 9, 2015, +and is available for download from the SourceForge website. Note +that release consists of two tarballs: nuttx-7.10.tar.gz and +apps-7.10.tar.gz. Both may be needed (see the top-level nuttx/README.txt +file for build information). + +Additional new features and extended functionality: + + * Binary Loader: + + - ARMv-7M, binfmt/, STM32: Add support uClibc++ exceptions. This + involved additional handling for relative relation types, additional + support for unwinding, as well as additional changes. The + culmination of a big effort from Leo Aloe3132. + + * Graphics/Graphic Drivers: + + - RA8875 LCD driver contributed by Marten Svanfeldt. + + * File Systems/Block Drivers/MTD: + + - Union File System: Add support for a union file system that can be + used to overlay and merge the content of two mounted file systems. + + * USB Host: + + - USB Hub Support: Bring in USB hub-related files from + https://github.com/kaushalparikh/nuttx. This is the work of Kaushal + Parikh. This is quite a bit more hub logic was needed in before the + USB hub support was fully functional. This involved changing many + USB host controller driver interfaces and modifications to many + drivers. + - USB host CDC/ACM class driver: Added initial implementation of a + host-side CDC/ACM driver. Initial version was a great learning + experience, but probably should be partially redesigned (as + discussed in the top-level TODO file). + - IPv6 Routing: Complete implementation of the IPv6 routing logic. + From Max Neklyudov. + + * Networking: + + - Local Sockets: Add poll support for Unix stream sockets. From Jussi + Kivilinna. + - net/: ARP, ICMP, ICMPv6, PKT, TCP, and UDP now all receive event + notifications from both network device packet processing, but now + also from Device-specific events such as when the network goes down. + The device notification callback structure is now supports dual + linkages so that the client can receive notifications from both + source; The device structure now includes a list of clients that + want to receive device related notifications. This prevents network + actions from hanging when the device goes down and will be an + essential part of future support for removable network devices. + Some of the core logic was contributed by Max Neklyudov. + - TUN: Misc. improvements to the TUN driver, mostly related to poll(). + Also several bugfixes. From Max Neklyudov. + + * Simulation Platform: + + - Simulator: Add logic to test localtime and TZ database. See + apps/system/README.txt for info. + - Simulation: Add a configuration for testing the Union File System. + + * Calypso: + + - Calypso Compal-E86: Updates for execution out of FLASH on the C139 + phone. From Craig Comstock. + + * Atmel SAMD/L: + + - SAML21 Support: And chip definitions, configuration framework, + memory map and pin configuration files for SAML21 support. + + * Atmel SAMD/L Boards: + + - SAML21-Xplained: Add a board support for the SAML21 Xplained Pro. + This is based on the similar SAMD20 Xplained Pro board. + + * Freescale/NXP KL: + + - KL25Z64: Added support for the KL25Z64. The KL25Z64 is a lower + memory variant of the KL25Z128 and is used on the Teensy LC. From + Michael as SourceForge patch 50. + + * Freescale/NXP KL Boards: + + - Teensy-LC: Add board support for the Teensy LC board. Support is + based off the Freedom KL25Z board. LED, PWM, and UART0 have been + tested. The SPI pins are mapped correctly but have not yet been + tested. From Michael Hope as SourceForge patch 51. + + * NXP LPC111x: + + - LPC111x: Support for the LPC11xx family (the LPC1115 MCU in + particular). Contributed by Alan Carvalho de Assis. + + * NXP LPC111x Boards: + + - LPCXpresso LPC1115: Support for the LPCXpression LPC1115 + board. Contributed by Alan Carvalho de Assis. + + * NXP LPC17xx Drivers: + + - LPC17xx Ethernet: Add support for the Micrel KSZ8041 PHY to the + LPC17xx Ethernet driver. + + * NXP LPC17xx Boards: + + - Lincoln60: Add a network enabled configuration for the Lincoln60 + board. + + * Atmel SAM3/4 Drivers: + + - SAM4CM: Add support for optical mode for the SAM4CM UART1. From + Max Neklyudov. + + * Freescale (NXP) Kinetis: + + - Kinetis K20: Basic support for the Kinetis K20 architecture. Taken + from PX4. This is the work of Jakob Odersky. + + * Atmel SAMV7 Boards: + + - SAMV71-Xplained w/maXTouch Xplained Pro: A TWIHS fix was the last + barrier to getting the touchscreen working in the maXTouch Xplained + Pro LCD. Added the NxWM integrated graphics demonstration + configuration. + + * STMicro STM32: + + - STM32: Added support for STM32F302K8 and STM32F302K6. From Ben Dyer + via PX4/David Sidrane. + - STM32F205RG: Add basic support for the STM32F205RG. From SourceForge + Ticket 40 (anonymous, 2015-05-31). + - STM32 F3: Add DBGMCU register definitions for the F3 family. From + Greg Meiste. + + * STMicro STM32 Drivers: + + - STM32 LCDC: Defined a second interface for the dma2d controller. + LTDC only controls the display visibility but the DMA2D controller + changes the content of the frame buffer (buffer of the layer). From + Marco Krahl. + - STM32 PVD: Added support for STM32's Programmable Voltage Detector + (PVD) feature. By Dmitry Nikolaev, submitted by Juha Niskanen. + + * STMicro STM32 Boards: + + - STM32F429i-Disco: Add support for the new DMA2D features to the LTDC + configuration. From Marco Krahl. + + * TI Tiva Boards: + + - TM4C1294 Launchpad: Added TM4C1294NCPDT EN0_LED2 (10/100-Base-Tx); + removed all booster pack pin definitions. From Frank Sautter. + + * C Library/Header Files: + + - libc: Add an option to disable support for long long formats in + lib_vsprintf(). On very tiny platforms, this reduces the footprint + by omitting large libgcc.a libraries to perform the 64-bit + arithmetic operations. From Alan Carvalho de Assis. + + * Applications: apps/system: + + - nuttx/zoneinfo: Add logic to build a ROMFS file system + containing the timezone data. + + * Applications: apps/nshlib: + + - Add poll support for Unix stream sockets. From Jussi Kivilinna. + - Enhancements to NSH ifconfig for case of multi-link operation, TUN + device and local connections. From Max Neklyudov. + - Enhanced output to NSH ping command from Max Neklyudov. + - The NSH mount command now recognizes the Union filesystem type when + listing mounted file systems. + + * Applications: apps/netutils: + + - apps/netutils/thttpd/ and apps/examples/thttpd/: Add support for + using binfs/ with the Union FS instead of NXFLAT. NXFLAT is + probably the better solution but recently compiler changes make it + unusable. binfs or ELF are fallback binary formats. This commit + adds an option to use binfs with the Union FS. + + * Applications: apps/examples: + + - Modify/simpify apps/examples build files. From Roman Saveljev. + - apps/examples/ltdc: Add testing support for the STM32 LTDC's 2D DMA. + From Marco Krahl. + - apps/examples/ostest: Add a test of nested signals. There are no + failures to handle signals but neither am I getting any nested signal + handling. + - apps/examples/elf: Add configuration options to support building the + hello++4 example that depends upon having uClibc++ available. Also + add hello++5 to the ELF example From Leo aloe3132. + - apps/examples/unionfs: Add a test of the union file system to + apps/examples. + +Efforts In Progress. The following are features that are partially +implemented but present in this release. They are not likely to be +completed soon. + + * Processes. Much of the work in this release is focused on the + realization of Unix-style user processes in NuttX. There is more to + be done, however. The full roadmap and status is available at: + http://www.nuttx.org/doku.php?id=wiki:nxinternal:memconfigs#the_roadmap_toward_processes + + * XMega: There are some fragments in place for an XMega port. That + port has not really started, however. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - boardctl(): Add missing case causing that caused failures of PWM + test. + - pthread_kill(): Re-implemented pthread_kill(). It was just a simple + wrapper around kill() but since the correct dispatching of signals + for multi-threaded task groups has been implemented, calling kill() + does not do what pthread_kill() is supposed to do. The corrected + implementation of pthread_kill() will direct the signal specifically + to the specific pthread and no other. + - uint32_t callbacks: Update the type passed to watchdog timer + handlers. Using uint32_t is a problem for 64-bit machines because + it it too small to pass a pointer. uintptr_t is a more appropriate + type. + - mq_timedreceive(): move the location where the errno value is set; + the ETIMEDOUT errno setting was being overwritten by subsequent + actions before returning. Noted by Freddie Chopin. + - POSIX message queues: Move mq_setattr() and mq_getattr() from + nuttx/libc/mqueue to nuttx/sched/mqueue. Also add syscall support + for mq_setattr() and mq_getattr(). This is necessary in protected + and kernel builds because in those cases the message queue + structure is protected and cannot be accessed directly from user + mode code. + + * File Systems/Block Drivers/MTD: + + - MTD: Increase the size of the fields in the geometry structure + (again) to support larger FLASH sizes. Needed by Sebastien Lorquet. + + * Common Drivers: + + - poll(): Fix resource leak and memory corruption on poll failure. + From Jussi Kivilinna. + + * USB Host: + + - LPC31xx and SAMA5Dx EHCI: Fix cache related problem in LPC31 and + SAMA5Dx EHCI drivers. All buffers are now aligned with the cache + line size in both starting address and in length. This cause major + problems in unlucky builds where the USB host buffers where + unaligned and abutting other data. The cache flush and invalidate + operations could be subverted by accesses to adjacent data or could + have unexpected side effects. This bug has been in the ECHI drivers + forever, but was only revealed due to unlucky memory allocations + during the integration of the hub feature. + + * USB Device: + + - All USB device class drivers: There needs to be a check to make + sure that the size of a returned string does not exceed the size of + the allocated request buffer. Strings such as vendor names or + product names will be truncated to fit in the request buffer. + + * Networking: + + - TCP: Correct failures in long Telnet sessions by increasing th + size of the number of bytes sent from uint16_t to uint32_t. This + avoids an integer overflow that causes a long Telnet session to be + closed unexpectedly. From Rony XLN. + - Network locks: Correct some network lock logic: Two error + conditions where the network was not being unlocked and one where it + was getting unlocked twice. From Jussi Kivilinna. + - Local Sockets: Local stream sockets had problem of double releasing + pipes (both server and client attempt release), which causes wrong + pipe pair being closed in multi-client case. Solve by adding per + connection instance ID to pipe names. From Jussi Kivilinna. + - TCP: Fix an important TCP networking bug: 16-bit flags was being + converted to 8-bits in a few locations, causing loss of status + indications. + - TCP: net_startmonitor() always returned OK. In the race case + where a socket has already been closed, it correctly handled the + disconnection event but still returned OK. Returning OK caused the + callers of net_startmonitor() to assume that the connection was + okay, undoing the good things that net_startmonitor() did and + causing the socket to be incorrectly marked as connected. This + behavior was noted by Pelle Windestam. + - setsockopt() failed when setting timeouts to values less tha 100 + msec. That is because the timeout is limited to stops of 1 + decisecond and because the conversion of structure timeval was + truncating the microsecond remainder. The utility + net_timeval2dsec() now accepts and option to determine how it + handles the remainder: truncate, discarding the remainder, use + the remainder to round to the closed decisecond value, or use any + non-zero remainder to the next larger whole decisecond value. Bug + discovered by Librae. + - TCP: In the TCP connection operation, it was trying to setup the + network monitor BEFORE the socket was successfully connected. This, + of course, has ALWAYS failed because the socket is not yet connected + and the TCP state is not yet correct for a connected socket. However, + because of other changes net_startmonitor() now returns a failure + condition that causes worse problems when trying to connect. The fix + is to move the logic that starts the network monitor to AFTER the + socket has been successfully connected. + + * Atmel SAM3/4 Drivers: + + - SAM4CM and SAMA5D Free-running timer: Logic that samples the free + running counter reads the pending interrupt status register and can + cause interrupts to be lost. So, if when the status register is + read, the logic must also handle the timer overflow event. Found + and fixed by Max Neklyudov. + + * Atmel SAMA5 Drivers: + + - SAM3/4 Serial: When reconfigured, serial does not receive bytes + from UART. This happens because RX interrupt was disabled in the + setup routine. Fixed this I save interrupt configuration before + UART shutdown and restore it after. From Max Neklyudov. + + * NXP LPC17xx Drivers: + + - LPC176x GPIO: Reorder steps when an output GPIO is configured in + order to avoid transient bad values from being output. From Hal + Glenn. + - LPC17 USB OHCI: Correct some initialization of data structures. + When hub support is enabled, it would overwrite the end of an array + and clobber some OS data structures. + - LPC17xx Ethernet: Review, update, and modify the Ethernet driver so + that it works better with CONFIG_NET_NOINTS=y. Also, update all + LPC17xx networking configurations so that they have + CONFIG_NET_NOTINTS=y selected. + + * SiLabs EMF32 Drivers: + + - EFM32 SPI: Add missing SPI GPIO pin initialization. From Pierre-noel + Bouteville. + + * STMicro STM32: + + - STM32 F3: Added missing EXTI definitions for the STM32 F3; Correct + an error the port D base address in the STM32 F30x and F37x memory + maps. From Greg Meiste. + + * STMicro STM32 Drivers: + + - STM23 RTC: Fix an error introduced into stm32_pwr_enablebkp(). + That function must preserve the previous state of backup domain + access on return. + - STM32 RTC counter: Now need to enable backup domain write access + when setting the time. From Darcy Gong. + - STM32 OTG FS and HS: Added protection in the event that out-of-bound + endpoint numbers are received. From David Sidrane. + + * STMicro STM32 Boards: + + - STM32F429i Disco: (1) Fix a bad return value if the LCD driver is + already initialized. (2) The LCD driver initialization is now + performed during the early boot sequence. (3) Increased the size + of the message queue from 32 to 64 in the lcd configuration. From + Marco Krahl. + + * TI Tiva + + - Fixes for Tiva TM4C1294NCPDT. From Frank Sautter. + + * Atmel SAMV71 Drivers: + + - SAMV7 TWIHS: Fix SAMV TWIHS logic that performs multi-message + transfers with and without repeated starts. + + * Atmel SAMA5D3/4 Dirvers: + + - SAMA5 CAN: Fix SAMA5 CAN frame construction. From Max Holtzberg. + + * C Library/Header Files: + + - stdlib.h: MAX_RAND should be RAND_MAX. + - assert.h: Wrap definitions of assertion macros in do while so that + they are valid C statements. Numerous places throughout the code + where semicolons were missing at the end of an assertion also had to + be fixed. Suggested by orbitalfox. + - inetntoa(): Correct errors in printing IP address when type char is + signed and the value is >= 128. From Max Neklyudov. + + * Tools: + + - Tools: Fix test for the existence of the apps/ directory in + configure.c. Fix backward interpretation of options, -l was selecting + Windows and -w was selecting Linux. This was SourceForege Ticket #39. + + * Applications: apps/nshlib: + + - apps/nshlib/nsh_timcmds.c: Check return values from time functions. + - apps/nshlib/: Fix handling of gmtime_r return value in time commands. + gmtime_r returns a pointer, not an int. + + * Applications: apps/netutils: + + - apps/netutils/ntp: Fix mismatched sched_lock/unlock. Noted by Juha + Niskanen. + + * Applications: apps/examples: + + - apps/examples/nxlines: Fix missing right bracket that causes + compile error when CONFIG_NX_XYINPUT=y. From Librae. + - apps/examples: When boardctl() fails, need to print errno not the + returned value which will always be -1. + - apps/examples: Correct use of the BOARDIOC_GRAPHICS_SETUP boardctl() + call. + +NuttX-7.11 Release Notes +------------------------ + +The 111th release of NuttX, Version 7.11, was made on August 13 2015, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.11.tar.gz and +apps-7.11.tar.gz. These are available from: + + https://bitbucket.org/patacongo/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - clock_gettime(): Use up_timer_gettime for CLOCK_MONOTONIC in + tickless mode. From Max Neklyudov. + - waitpid(): Implement WNOHANG for waitpid() only and for the case of + CONFIG_SCHED_HAVE_PARENT not selected. From Max Neklyudov. + - SCHED_SPORADIC: Add a sporadic scheduler to NuttX. + - Extend the processor-specific interface to include information to + support the Sporadic Scheduler. + - sem_tickwait(): Added this function for internal use within the OS. + It is a non-standard but more efficient version of sem_timedwait() + for use in higher performance device drivers. + + * Binary Loader: + + * Graphics/Graphic Drivers: + + - Graphics: Implement anti-aliasing in order to clean the drawing of + all edges. Anti-aliasing is supported in the horizontal, raster + direction only. + - SSD1306 LCD Driver: Modify the SSD1306 LCD driver to support either + the SPI or I2C interface. From Alan Carvalho de Assis. + + * File Systems/Block Drivers/MTD: + + - mount: Add the ability to mount a file system on top of en existing + node in the pseudo-file system. + - epoll(): Add a very simple epoll layer just around poll calls. To + satisfy build app requirements. From Anton D. Kachalov. + + * Common Device Drivers: + + - IOCTL: Add relay IOCTL definitions. From Max Neklyudov. + - I/O Expander Framework: Add an I/O expander driver framework. From + Sebastien Lorquet + - NXP PCA9555 I/O Explander. Add PCA9555 driver.From Sebastien + Lorquet + - BMP180 Barameter: Add support to Bosch BMP180 barometer. From + Alan Carvalho de Assis. + - CAN IOCTLs: Add CAN IOCTL command definitions to manage CAN message + filtering + - CAN Driver: Add configuration to support DLC to byte conversions + needed for CAN FD mode. + - SPI Slave Interface: Add a definition of an SPI slave interface. + - LM92 Temperature Sensor: Add a driver for the LM92 temperature + sensor. Contributed by Paul Alexander Patience. + - AS5048B Rotary Magnetic Sensor: Add support for an AS5048B rotary + magnetic sensor. From Paul Alexander Patience. + - Ramtron Driver: Update to include supportf for newer RAMTRON parts. + From David Sidrane. + - MB7040 Sonar Driver: Add support for a MB7040 sonar driver. From + Paul Alexander Patience. + - ms5805 Altimeter Driver: Add support for an MS5805 altimeter. From + Paul Alexander Patience. + + * Networking: + + - DNS Client: Implement the low-level network DNS packet protocol to + request and receive IPv6 address mappings. + - NetDB: Add support for a DNS host name resolution cache. This can + save a lot of DNS name server lookups (but might also have the + negative consequence of using stale IP address mappings. + - NetDB: Name resolution logic now supports lookups from a file like + /etc/hosts. + - Network Initialization: Add CONFIG_NETDEV_LATEINIT that can be + used to suppress calls to up_netinitialize() from early in + initialization. + - FTMAC100 Ethernet MAC Driver. Add support for Faraday FTMCA100 + Ethernet MAC/ From Anton D. Kachalov. + - UDP Networking: Add support for send() for connected UDP sockets. + + * Crypto: + + - Add CFB and MAC AES modes. From Max Neklyudov. + + * Simulation Platform: + + - Simulation: Implement board_power_off() for the simulation platform. + This allows for a graceful exit from the simulation. + + * MoxaRT: + + - MoxaRT SoC: Add support for MoxaRT SoC found in the most Moxa serial + converters such as NP51x0, NP66xx, UC72xx. From Anton D. Kachalov. + + * MoxaRT Boards: + + - Moxa NP51x0: Moxa NP51x0 series of 2-port advanced RS-232/422/485 + serial device servers. From Anton D. Kachalov. + + * ARMv6-M: + + - ARMv6-M Assertions: Port some per-process stack dumping logic from + ARMv7-M to ARMv6-M. From Alan Carvalho de Assis. + + * Atmel SAMD/L Boards: + + - SAML21: DMA: Add SAML21 DMA support. + - SAMD21: Add architecture support for the SAMD21 family. + - SAMD21-Xplained: Board configuration for the SAMD21 Xplained board. + + * Atmel SAM3/4 Drivers: + + - SAM4E: Add default loop optimization if EEFC_FMR is available in the + configuration (i.e., for SAM4S and 4E). From Marco Aurlio da Cruz. + - crypto/ and SAM4CM: Add CFB and MAC AES modes. From Max Neklyudov. + - SAM3/4: Add a TWI driver for the SAM4CM. From Max Neklyudov. + + * Freescale (NXP) Kinetis: + + - Kinetis: Add support for MK20DN--VLH5 and MK20DX---VLH5. Needed + for backward compatible support for Teensy-3.0. + + * Freescale (NXP) Kinetis Boards: + + - Teensy 3.x: Add board support for the PJRC Teensy-3.0 and + Teensy-3.1 boards. + + * Atmel SAMV7 Drivers: + + - SAMV7: Add an MCAN driver for the SAMV7 platform. + - SAMV7 SPI Slave Driver: Add the an SPI slave driver. + + * STMicro STM32: + + - STMicro STM32 F7: Add architecture support for the STMicro STM32 + F7. + - STM32 F446: Add support for the STMicro STM32 F446. From David + Sidrane. + + * STMicro STM32 Drivers: + + - STM32 F7: Add an STM32 F7 Ethernet driver. + - STM32 F7: Port the STM32 F4 DMA driver. + - STM32 F4 ADC: Add DMA support to the ADC driver for STM32 F4. From + Max Kriegler. + + * STMicro STM32 Boards: + + - STM32F762G-Disco: Add support for the STMicro STM32 F7 Discovery + board. + - STM32F4-Disco: Add support to BMP180 driver on the STM32F4 Discovery. + From Alan Carvalho de Assis. + + * C Library/Header Files: + + - Add asctime(), asctime_r(), ctime(), and ctime_r(). + - sethostname(): Add support for sethostname(). + - gethostbyname() and gethostbyaddr(): Add support for + gethostbyname() and gethostbyaddr(). Also support included for the + non-standard gethostbyname_r() and gethostbyaddr_r(). This moves + the DNS client logic from apps/ into the NuttX libc implementation. + + * Tools: + + - testbuild.sh: Add a script that can be used to perform building + testing for several board configurations. + + * Build/Configuration System: + + - apps/ Build System: No longer depends on hardcoded lists of + directories. Instead, it does a wildcard search to find all + appropriate directories. This means that to install a new + application, you simply have to copy the directory (or link it) into + the apps/ directory. If the new directory includes a Makefile and + Make.defs file, then it will automatically be included in the build. + - mkkonfig.sh: Add the tool mkkconfig.sh that dynamically builds the + apps/Kconfig file at configuration time. The hardcoded + configuration file has been removed and now the top-level Makefile + executes tools/mkkconfig.sh to auto-generate the top-level Kconfig + file. A new apps/ make target call preconfig: was added to support + this operation. Now you do not have to modify the top-level Kconfig + file to add a new directory into the configuration; the top-level + subdirectory simply needs to include a Kconfig file and it will + automatically be included in the configuration. The native Windows + build is temporarily broken until a new apps/tools/mkconfig.bat + script is generated. + - mkkconfig.bat: Add the Windows script corresponding to + apps/tools/mkkconfig.sh. Needed for a Windows native build. + + * Applications: apps/nshlib: + + - NSH shutdown command: NSH will now support an (optional) shutdown + command if the board provides the option CONFIG_BOARDCTL_POWEROFF. + The command can also be used to reset the system if + CONFIG_BOARDCTL_RESET=y. + - NSH uname command: Add support for a uname command. + - NSH nslookup command: Add an nslookup command. + + * Applications: apps/system: + + - NetDB: Add a system command to access the network database. + - readline(): Add support for Unix-style tab complete to readline. + Contributed by Nghia Ho. + - readline(): Extended the tab-completion support to also expand NSH + command names. + - readline(): Add support for an in-memory command line history that + can be retrieved using the up and down arrows. Contributed by Nghia + Ho. + + * Applications: apps/netutils: + + - DNS client: Moved the DNS client logic into the NuttX C library. + It is a necessary part for the full implementation of the netdb logic + and provides more flexibility in that location. + - Replace calls to the non-standard dns_gethotip() with calls to + standard gethostbyname(). + - NetLib: Create netlib wrapper functions around dns_getserver() and + dns_setserver() to isolate application code from changes to those + interfaces. + + * Applications: apps/examples: + + - OS test: Extend the OS test to include a test of + pthread_mutex_trylock() for recursive mutexes. From Juha Niskanen. + - OS test: Add a test for the sporadic scheduler. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - pthreads: Use -1 instead of 0 as PID for unclaimed mutexes. From + Juha Niskanen. + - pthreads: Implement pthread_mutex_trylock() for recursive mutexes. + From Juha Niskanen. + - pthread_create(): Group binding needs to be cleared before + sched_releasetcb(), as otherwise group_leave() will be called and + group->tg_nmembers decremented or group being released. group_leave() + should be called only after group_join() is called, not after + group_bind(). From Jussi Kivilinna. + - Protected Mode User Memory Allocator: Redesigned how the user space + heap is accessed from the kernel code in protected mode. It used to + call memory management functions in user space via function pointers + in the userspace interface. That is inefficient because the first + thing that those memory management functions do is to trap back into + the kernel to get the current PID. Worse, that operation can be + fatal is certain fragile situations such as when a task is exiting. + The solution is to remove all of the memory management function + calls from the interface. Instead, the interface exports the users + pace heap structure and then kernel size implementations of those + memory management functions will operate on the userspace heap + structure. This avoids the unnecessary system calls and, more + importantly, failures do to freeing memory when a test exits. + - pthread_create(): Fix an (unlikely) error in fallback value in the + event of a failure (which should never occur). + + * Common Drivers: + + - STMPE811 Driver: In stmpe811_instanciate() when + CONFIG_STMPE811_MULTIPLE is enabled, and the call to + stmpe811_checkid() fails, then the linked device list is not + restored to its previous state. From Sebastien Lorquet. + - CAN driver: Fix an issue in the CAN driver where the rx_sem count + can grow beyond bounds. + + * File System/Block Drivers: + + - NFS client: Fix prototype of unbind method. The function prototype + was not updated for NFS after a recent change to the file system + interface. From Manuel St??. + + * Networking/Network Drivers: + + - netconfig.h: Fix some backward compilation that was emitting #error + in the wrong condition when SLIP was enabled. + - SLIP Driver: Fix a missed name change when many of network + interface names changed sometime back but were apparently never + updated for SLIP. + - Networking: Allow receipt of empty UDP packets. From Max Neklyudov. + + * ARMv6-M: + + - ARMv6-M: Fix Cortex-M0 assembly error when the interrupt stack is + enabled. From Alan Carvalho de Assis. + + * Atmel SAMD/L Drivers: + + - SAMD20, D21, L21: In the SAML21, SERCOM5 uses a different SLOW clock + channel (and, hence, also a different SLOW GCLK generator). This + means that the channel selection cannot be a global definition but + must be a per SERCOM configuration setting. + - SAMD/L: Several fixes to register definitions and types. From + Janne Rosberg. + + * Atmel SAM3/4 Drivers: + + - SAM3/4 UART: Back out an error introduced with commit + 02c33f66c5a8be774034cd40e4125e9323c7b4d8. Causes an infinite loop in + up_lowputc(). From Max Neklyudov. + - SAM4CM: Fix SUPC register definitions. From Max Neklyudov. + - SAM3/4 WDT: Correct some problems with SAM3/4 watchdog driver. + Includes some small improvements. From Max Neklyudov. + + * Atmel SAMV7 Drivers: + + - SAMV7 UART: Also back the bad cloned change o sam_lowputc.c for + SAMV7 platform. + + * NXP LPC43xx Drivers: + + - LPC4350: Correct some LPC4350 GPIO pin configurations. From + Alessandro Temil. + + * SiLabs EMF32 Drivers: + + - EFM32 SPI: Correct write to incorrect register in EFM32 SPI driver. + From Pierre-noel Bouteville. + + * STMicro STM32 Drivers: + + - STM32 F15x: STM322 F15x stm32_stdclockconfig() was calling + stm32_pw_setvos() which accessed PWR_CR via an inactive APB From + Juha Niskaneni. + - STM32 Ethernet: Extend STM32 Ethernet operating frequency to 180MHz. + From Sebastien Lorquet. + + * STMicro STM32 Boards: + + - SAMV7 Xplained: In clock configuration, divider was set to 25 to get + 25*12MHz=300MHz CPU clock. The correct multiplier is 24 because the + calculation if (24+1)*12MHz. So the board was running at 312MHz. + From Efim Monjak. + + * ARMv7-A: + + - Cortex-A5 vfork(): Fix a Cortex-A compilation error when system + calls are enabled in modes other than CONFIG_BUILD_KERNEL. + + * Atmel SAMA5 Drivers: + + - SAMA5Dx EHCI: Fix some bad conditional compilation that left a + function undefined if CONFIG_USBHOST_ASYNCH is not selected. + + * C Library/Header Files: + + - getopt(): Uninitialized variable can cause hardfault from getopt() + if required argument is missing. From George McWilliams. + + * Applications: apps/nshlib: + + - NSH/THHPD: Change decoding to handle the increased size of the + scheduling policy field in the TCB. + + * Applications: apps/netutils: + + - THTTPD: Fix compilation problems when + CONFIG_THTTPD_GENERATE_INDICES is defined. + - THTTPD: Missing gci-src as a dependency path when building with + BINFS enabled. + + * Applications: apps/examples: + + - poll() example: Fix a few bit-rot compilation errors. + - Nx Lines example: If CONFIG_NX_ANTIALIASING=y, then the nxlines + example now erases a line that is 2 pixels longer and 2 pixels wider + than the line it drew. That eliminates edges effects due to + applying the anti-aliasing algorithm twice. A better solution + would be to make anti-aliasing an option for each graphics call so + you would rend the line with anti-aliasing ON and clear it with + anti-aliasing OFF. but I don't have the wherewithal for that change + today. + - OS test: Improve synchronization in round robin tests. On very fast + processors, there are race conditions that make the test fail. + Need better interlocking to assure that the threads actually do start + at the same time. + +NuttX-7.12 Release Notes +------------------------ + +The 112th release of NuttX, Version 7.12, was made on October 1, 2015, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.12.tar.gz and +apps-7.12.tar.gz. These are available from: + + https://bitbucket.org/patacongo/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Graphics/Graphic Drivers: + + - Added SSD1351 OLED controller support. Contributed by Paul + Alexander Patience. + + * Common Device Drivers: + + - MS58xx: Generalize the MS5805 altimeter driver to support other + family members. From Paul Alexander Patience. + - CAN driver interface: Add an error indication bit to the CAN + message report. + - Developed a new interface for QSPI. Most QSPI hardware (such as the + SAMV71) used a programmed interface to access the QuadSPI FLASH. + That programmed interface is no compatible with the simpler NuttX + SPI data transfer interface. + - Added a driver for ST25L1*K QuadSPI parts. + - Renamed the battery driver interface to battery_gauge since it + really only implements a battery fuel gauge. From Alan Carvalho de + Assis. + - Added a new framework to support a batter charger interface. From + Alan Carvalho de Assis. + - Added a BQ24250 battery charger driver. From Alan Carvalho de Assis. + + * Networking: + + - Added support for the local loopback device (dev lo, hostname localhost). + - Added NetDB support for the local loopback device. + - Network initialization: Automatically initialize all the TUN and + loopback devices if they arein the configuration. + + * Simulation Platform: + + - The simulation now runs under Cygwin64. Modern Cygwin X86_64 + machines follow the Microsoft ABI for parameter passing. The Linux + System 5 ABI would not work on X86_64-based Cygwin machines. Newer + Cygwin tool chains do nor pre-pend symbol names with the underscore + character. + + * Atmel SAMA5Dx: + + - Added architectural support for the Atmel SAMA5D2 parts. Not fully + verified in this NuttX release. + + * Atmel SAMA5Dx Boards: + + - Added support for the Atmel SAMA45D2 Xplained Ultra board. Not + fully verified in this NuttX release. + + * Atmel SAMV7 Drivers: + + - SAMV7 USBHS DCD: The device controller driver is (finally) + functional. + + * NXP LPC17xx: + + - Implement options to use external SDRAM and or SRAM for the heap. + From Pavel Pisa. + + * NXP LPC43x: + + - Added architectural support for the LPC4370. From Lok Tep. + + * NXP LPC43xx Drivers: + + - Added Ethernet support. From Ilya Averyanov. + - Added LPC43xx EHCI driver from Ilya Averyanov. + + * NXP LPC43xx Drivers: + + - Added support for the NXP LPC4370-Link2 development board from Lok + Tep. + + * STMicro STM32: + + - Added architectural for STM32F303K6, STM32F303K8, STM32F303C6, + STM32F303C8, STM32F303RD, and STM32F303RE devices. From Paul + Alexander Patience. + + * STMicro STM32 Drivers: + + - Added OTG support for STM32F44x. From David Sidrane. + + * STMicro STM32 Boards: + + - Added support for the STMicro Nucleo F303ERE board from Paul + Alexander Patience. + + * C Library/Header Files: + + - stdlib: Add support for div() to the C library. From OrbitalFox. + Also added ldiv() and lldiv() which are equivalent to div() with + long and long long types, respectively, instead of int. + - Added an implementation of the standard shutdown function. + + * Tools: + + - tools/mksymtab: declare g_symtab array as const to occupy RO section + (Flash). From Pavel Pisa. + + * Build/Configuration System: + + - Simplify configs/ Makefiles by combining common logic into a new + Board.mk Makefile fragment. From Paul Alexander Patience. + + * Applications: apps/system: + + - apps/system/symtab: Optional canned symtab inclusion to the build. + When option CONFIG_SYSTEM_SYMTAB is selected and symbol table file + libc/symtab/canned_symtab.inc is prepared then application can use + system provided complete symbol table. The option has substantial + effect on system image size. Mainly code/text. If loading of + applications at runtime is not planned do not select this. From + Pavel Pisa. + + * Applications: apps/canutils: + + - apps/canutils/uavcan: Add support for libuavcan. From Paul Alexander Patience. + + * Applications: apps/examples: + + - apps/examples/can: Extend the CAN loopback test by adding more + command line options. + - apps/examples/usbserial: Can now be run as an NSH builtin-function. + Now uses a configurable IO buffer size. + - apps/examples/nettest: Add option to suppress network initialization. + This is necessary if the nettest is run from NSH which has already + initialized the network. + - apps/examples/nettest: Extend test so that can be performed using + the local loopback device. + - apps/examples/netloop: Add a test of the local loopback device. + - apps/examples/udpblaster: Add a test to stress the network by + sending UDP packets at a very high rate. . + - apps/examples/uavcan: libuavcan example from Paul Alexander Patience. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - wd_create(): Correct a counting error in the number of available + watchdog timers. When the number of free timers is low, the counter + could be incremented below zero. + - mq_open(): When message queue is opened, inode_reserve() leaves the + reference count at zero. mq_open() logic must assure that the + reference count of the newly created inode is one. + - work_queue(): Logic that sets the queued indication and the logic + that does the actual queuing must be atomic. + + * Binary Loader: + + - Fix a memory leak in the built-in application logic: File was not + being closed. From Bruno Herrera. + + * File System/Block Drivers: + + - poll(): If we fail to setup the poll for any file descriptor, for + any reason, set the POLLERR bit. + - rwbuffer: Fix some logic errors. From Dmitry Nikolaev via Juha + Niskanen. + - ROMFS: One allocation was not being freed if there was a subsequent + failure to allocation I/O buffers resulting in a memory leak on + certain error conditions. From Bruno Herrera. + + * Networking/Network Drivers: + + - Fix a bug in tun interface driver. From Max Neklyudov. + - recvfrom(): Correct wait for new data when NET_UDP_READAHEAD is + enabled. Fix size accounting when recvfrom_udpreadahead() sets + state.rf_recvlen == -1. I have not checked if data are accumulated + to the right position in the buffer however. From Pavel Pisa. + - networking: Correct return value from psock_tcp_accept(). From + SaeHie Park. + - TCP: Fix a problem in when there are multiple network devices. + Polls were being sent to all TCP sockets before. This is not good + because it means that packets may sometimes be sent out on the wrong + device. That is inefficient because it will cause retransmissions + and bad performance. But, worse, when one of the devices is not + Ethernet, it will have a different MSS and, as a result, incorrect + data transfers can cause crashes. The fix is to lock into a single + device once the MSS is locked locked down. + - net/tcp: The logic that binds a specific network device to a + connection was faulty for the case of multiple network devices. On + bind(), the local address should be used to associate a device with + the connection (if the local address is not INADDR_ANY); On connect(), + the remote address should be used (in case the local address is + INADDR_ANY). On accept(), it does not matter but the remote address + is the one guaranteed to be available. + - net/tcp: Fix unbuffered send compilation error when Ethernet is not + enabled. From Alan Cavalho de Assis. + + * ARMv7-M: + + - All ARMV7-M IRQ setup: Always set the NVIC vector table address + unconditionally. This is needed in cases where the code is running + with a bootload and when the code is running from RAM. It is also + needed by the logic of up_ramvec_initialize() which gets the vector + base address from the NVIC. Suggested by Pavel Pisa. + - Fix some H/W floating point logic: In the original implementation, + !defined(CONFIG_ARMV7M_CMNVECTOR) was a sufficient test to determine + if lazy floating point register saving was being used. But recents + changes added common lazy register as well so now that test must be + (!defined(CONFIG_ARMV7M_CMNVECTOR) || defined(CONFIG_ARMV7M_LAZYFPU)). + - ARMv7-M, all "lazy" interrupt stack logic. Assembly instruction + that fetches the saved value is incorrect; replace with more + traditional push and pop. This is an important fix. Noted by + Stefan Kolb. + - All ARMV7-M: Force 8-byte stack alignment when calling from assembly + to C to interrupt handling. + - up_schedulesigaction(): Fix logic that determines if there is a + pending signal action before scheduling the next signal action. + Both the test and the scheduling action need to be atomic. This + problem was fixed on the ARMv7-M but also ported to other + architectures that had the same issue. + + * NXP LPC43xx: + + - LPC43xx: Fix NVIC_SYSH_PRIORITY_STEP define. From Ilya Averyanov. + - LPC43xx: Fix missing #define in eeprom. From Ilya Averyanov. + + * NXP LPC43xx Drivers: + + - Fixed the SPI driver. From Ilya Averyanov. + + * Atmel SAMA5 Drivers: + + - LPC31 and SAMA5D EHCI: Fix qh_ioccheck to move bp to next QH. From + Ilya Averyanov. + - LPC31 and SAMA5D EHCI: Performance improvement: Do not disable the + asynchronous queue when adding a new QH structure. From Ilya + Averyanov. + + * C Library/Header Files: + + - gethostbyname(): correct returned address format when DNS is used. + The hostent.h_addr_list should point to raw in_addr or in6_addr + as defined in the standard. Original implementation used that for + numeric addresses but for DNS lookup returned pointer to whole + sockaddr_in or sockaddr_in6. From Pavel Pisa . + - asin(): The function did not convert for some input values. asing() + did not convert for values which do not belong to the domain of the + function. But aside of that the function also did not converge for + allowed values. I achieved a conversion of the function by + reducing the DBL_EPSION and by checking if the input value is in + the domain of the function. This is a fix for the problem but the + function should always terminate after a given number of iterations. + From Stefan Kolb. + - Change all references from avsprintf to vasprintf. From Sebastien + Lorquet. + + * Applications: apps/nshlib: + + - Fix error handling in 'cat' command. On a failure to allocate + memory, a file was not being closed. From Bruno Herrera. + - Fix error handling in 'mv' command. On a failure to expand the + second path, the memory allocated for the expansion of the first + path was not being freed. From Bruno Herrera. + + * Applications: apps/system: + + - apps/system/netdb: Failed to build if CONFIG_NET_HOSTFILE was not + defined because gethostbyaddr() was not available. Noted by + OrbitalFox. + + * Applications: apps/netutils: + + - Various Kconfig files in netutils: Fix some changes from from + NETUTILS_DNSCLIENT to NETDB_DNSCLIENT. From Pavel Pisa. + + * Applications: apps/modbus: + + - Macros PR_BEGIN_EXTERN_C and PR_END_EXTERN_C were not defined in + all contexts. Replace with explicit expansion in all cases. From Stefan Kolb. + +NuttX-7.13 Release Notes +------------------------ + +The 113th release of NuttX, Version 7.13, was made on December 5, 2015, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.13.tar.gz and +apps-7.13.tar.gz. These are available from: + + https://bitbucket.org/patacongo/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - External RTC: Added OS support for external RTC chips. + - boardctl(): Add a command to the boardctl() interface to obtain a + board unique ID. + + * File Systems: + + - TMPFS: Add support for a new TMPFS, RAM file system. The TMPFS + file system does not require any significant amount of memory + itself. It will grow dynamically as files are added and shrink back + when files are deleted. A very low overhead way to retain temporary + files. + - VFS: The VFS was extended to support standard file operations on + block drivers (open, close, read, write, etc.). The open() interface + accomplishes this by creating a temporary characer driver to mediate + the character oriented accesses to tje block driver. + - HOSTFS: Added a HOSTFS file system for use with the simulator. The + HOSTFS file system mounts in the simulated Nuttx context by provides + proxied access to the file system on the host PC. This is useful for + providing file system content and nonvolatile storage of files in the + simulation environment. From Ken Pettit. + - MTD/PROCFS: Add an interface to un-register an MTD procfs entry. + From Ken Pettit. + - filemtd: A new MTD conversion layer that will convert a regular file + (or driver file) to an MTD device. This is useful for testing on the + simulation using the HOSTFS. From Ken Pettit. + - PROCFS: Extended to include networking entries in the procfs. Device + status, device statistics, and network statistics are now available + from the PROCFS. + - PROCFS: The PROCFS file system can now be configured so that it + supports runtime registration of PROCFS entries with + CONFIG_FS_PROCFS_REGISTER=y. + + * Graphics/Graphic Drivers: + + - ST7565 Driver: Extend to include support for the ERC12864-3. From + Pierre-noel Bouteville. + + * Common Device Drivers: + + - User buttons: Added a character driver to support application access + to board buttons. Supports notification of button activity via + signals. + - User LEDs: Added a character driver to support application access + to on-board LEDs. + - Zero Cross: Added a Zero Cross device driver support. From Alan + Carvalho de Assis. + - MAX6675: Added support to Thermocouple-to-Digital converter MAX6675. + From Alan Carvalho de Assis. + - BCH: Block-to-character (BCH) driver should forward ioctl() calls + to the contained block driver. + - S25FL1xx: Added a S25FL1xx QuadSPI FLASH driver. + - On-Chip FLASH: Added an upper half MTD device that can use the + interfaces defined in included/nuttx/progmem.h to provide a + standard MTD driver. + - Serial: Implemented high level DMA infrastructure for serial + devices. From Max Neklyudov. + - AT24XX: Add support for multiple AT24xx EEPROM parts, each with + unique I2C addresses, but otherwise identical. + - External RTC: Added drivers for external I2C RTC chips: DS3102, + DS1307, DS3231, DS3232, and NXP PCF85263. + - W25: Added support for byte write mode to the W25 FLASH driver. From + Ken Pettit. + - dev/loop: Added a loop character device. losetup() and loteardown() + should not be called directory from applications. Rather, these + functions are now available as IOCTL commands to the loop driver. + - dev/smart: Added support for a /dev/smart loop device. From Ken + Pettit. + + * Networking: + + - Driver Statistics: Most network drivers do not support statistics. + Those that do only supported them when DEBUG is enabled. Each + driver collected an architecture specific set of statistics and + there was no common mechanism to view those statistics. Thus, + the driver feature was mostly useless. This release standardizes + the driver statistics and puts the definition in the common network + device structure defined in netdev.h where they can be accessed by + network applications. All Ethernet drivers that collect statistics + have been adapted to use these common statistics. + + * Simulation Platform: + + - W25 FLASH: Added support for W25 FLASH simulation. From Ken Pettit. + - HOSTFS: Added support for the HOSTFS file system (see "File Systems", + above). + + * Atmel SAMV7: + + - SAME70: Added support for the SAME70 family of chips. + - Tickless: SAMV7 now supports the tickless mode of operation. + + * Atmel SAMV7 Drivers: + + - MPU: Added MPU and protected build support. + - QSPI: Added a QuadSPI FLASH driver. This driver operates in the + memory-mapped, Serial Memory Mode (SMM). + - FLASH: Added support to write on-chip FLASH. + - Timer/Counter: TC driver ported to SAMV7 from the SAMA5. Free-running + and one-short timer logic also ported. + - PCK: Brought programmable clock (PCK) logic from SAMA5 into SAMV7. + - Timer/Counter: Support PCK6 as an optional source for the timer/ + counter clock. + + * Atmel SAMV7 Boards: + + - SAME70-Xplained: Add NSH and networking configurations for the + SAME70 Xplained board. Includes verified support for serial console, + LEDs, buttons, SDRAM, HSMCI SD card, and networking. + - SAMV7-XULT and SAME70-Xplained: If Tickless mode is selected then + enable PCK6 as a timer/counter clock source + + * STMicro STM32: + + - CCM PROCFS: Is no longer a part of the 'base' procfs entries and can + now only be supported via run time registration with + CONFIG_FS_PROCFS_REGISTER=y. + + * STMicro STM32 Drivers: + + - Timers: Add a compatible lower-half timer driver for use with the + common timer upper-half driver. From Wail Khemir. + + * STMicro STM32 Boards: + + - STM32F4-Discovery: Add low level support for the Zero Cross driver + for the STM32F4-Discovery. From Alan Carvalho de Assis. + - STM32F4-Discovery: Add board config to support for the MAX6675. From + Alan Carvalho de Assis. + + * C Library/Header Files: + + - bsearch(): Added the bsearch() function from NetBSD. + - freopen(): Added support for freopen(). + - strftime(): Added day-of-week support (when avaialable). + + * Tools: + + - nxstyle: Add crappy style checking tool nxstyle.c. See thee tools/ + README file for more info. + + * Applications: NSH + + - mksmartfs command: Add configuration option to supported multiple + rootdirectories. From Ken Pettit. + - Add support for 'basename' and 'dirname' commands. + - set command: Like bash, NSH set command now strips off any leading + or trailing whitespace. + - mount command: The mount commands now accepts mount options + (currently needed only for the hostfs file system). From Ken + Pettit. + - losetup command: NSH no longer calls losetup() and loteardown + directly. Now it opens /dev/loop and accomplishes these things + using ioctl() calls. + - ifconfig command: If CONFIG_NETDEV_STATISTICS=y, then print the + network driver statistics in the ifconfig. + - ifconfig, ifup, and ifdown: These commands now uses /proc/net/ + to view network device configuration and status and /proc/net/stat + to show network statistics. A consequence of this is that you + cannot view this network information if the procfs is not enabled + and mounted at /proc. + - losmart command: Added a new NSH losmart command. losmart setups + up a loop device for the smart MTD driver similar to losetup but + with different syntax. From Ken Pettit. + - ps command: The 'ps' command now uses /proc// to obtain task + status information. A consequence of this is that you cannot use + the 'ps' command if the procfs is not enabled and mounted at /proc. + + * Applications: apps/system: + + - apps/system/hexed: Port the hexed command line hexadeciamal editor + to Nuttx. See http://apps.venomdev.net/hexed/. + + * Applications: apps/fsutils: + + - apps/fsutils/smartfs: Move into apps/fsutils from kernel, now uses + only open and ioctl. From Ken Pettit. + + * Applications: apps/examples: + + - apps/examples/fstest: Add a generic file system test. This is + essentially the same as examples/smart, but has all of the SmartFS + specific logic ripped out. This was created for testing the new + TMPFS. + - apps/examples/zerocross: Add a Zero Cross application example. From + Alan Carvalho de Assis. + - apps/examples/media: Add a simple test for access of media via a + block driver or MTD driver. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Fixed an error in clock_timespec_subtract(). Found by Lok. + - pthreads: CRITICAL BUGFIX: Logic was wiping out the indication that + of the type of a pthread. Hence, it could be confused as a task. + Found because this was causing a crash when /proc/nnn/cmdline was + printed. + + * File System/Block Drivers: + + - SMART MTD: Fix some Smart wear-leveling bugs. Fixed SmartFS wear + level error that occurs when the logical sector size is too small to + save all wear level status bytes in a single sector. Logical + sectors 1 and 2 were simply not being allocated and then the + read_sector and write_sector routines were failing. From Ken + Pettit. + + * Graphics/Graphic Drivers: + + - ILI9432: Fixed errors in orientation. Portrait, RPortrait, and + Landscript should work correly now. They were displayed mirrored. + From Marco Krahl. + + * Common Drivers: + + - CAN: Fix a problem in the CAN upper-half driver that occurs only + for CAN hardware that support a H/W FIFO of outgoing CAN messages. + In this case, there can be a hang condition if both the H/W and + S/W FIFOs are both full. In that case, there may be no event to + awaken the upper half driver. Add a new (conditional) CAN upper + half interface called can_txready() that can be used by the lower + half driver to avoid this hang condition. + - MS58xx: Fix some issues with initialization and with CRC + calculation. From Karim Keddam. + - W25: Fixed W25 FLASH driver page read/write logic. From Ken Pettit. + + * Atmel SAMV7 Drivers: + + - USART1 pin configuration: Reconfigure System I/O when using USART1. + From Frank Benkert. + - MCAN: Added a call to can_txready() to the MCAN driver. + + * STMicro STM32 Drivers: + + - stm32 F4: Fix some TIM12 pin mappings. From Max Kriegleder. + + * STMicro STM32 Boards: + + - STM32F429i-Disco: Calculated partition boundries based on page + block sizes but mtd_partition() is expecting calculations based on + erase block size. From Alan Carvalho de Assis. + + * C Library/Header Files: + + - sys/types.h: When building on a 64-bit machine, the size of size_t + should be 64-bits. In general, I believe that sizeof(size_t) should + be the same as sizeof(uinptr_t). mmsize_t should always be 32-bits + in any event. The last change to stddef has been backed out. With + these changes, the simulator builds without errors or warnings an a + 64-bit machine. + + * Applications: apps/nshlib: + + - The I/O buffer, g_iobuffer, should not be a global buffer. That + will not work in an environment where there are multiple NSH + sessions. The I/O buffer must, instead, be a part part of the + session-specific data defined in nsh_console.h. + +NuttX-7.14 Release Notes +------------------------ + +The 114th release of NuttX, Version 7.14, was made on January 28, 2016, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.14.tar.gz and +apps-7.14.tar.gz. These are available from: + + https://bitbucket.org/patacongo/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - modules: Add support for kernel modules: insmod, rmmod, support + functions. procfs support for user lsmod functioniality. + - SIGEV_THREAD: Add support for the SIGEV_THREAD notification method + in struct sigevent. This initial implementation will only work in + the FLAT build since it utilizes the work queue for signal + callbacks. See the top-level TODO file for additional details. + - 64-Bit Timer: If the 64-bit timer is selected, then use it whenever + clock_systimer() is called rather then chopping the 64-bit timer + down to 32-bits. Add a new type, systime_t to represent the 32- or + 64-bit system timer. This eliminates clock_systimer32() and + clock_systime64(); there is now only clock_systimer(). + + * Common Device Drivers: + + - Telnet Driver: Move the Telnet driver from apps/ to + nuttx/drivers/net. It is a driver a belongs in the OS. Now works + like the loop device: A new interface called telnet_initialize() + registers a telnet session "factory" device at /dev/telnet. Via + ioctl, the factory device can create instances of the telnet + character devices at /dev/telnetN to support Telnet sessions. + - PCA9635PW: Add a driver for the PCA9635PW I2C LED driver IC which + can be used to control the intensity of up to 16 LEDs. From + Alexander Entinger. + - MCP9844: Driver for the MCP9844 I2C digital temperature sensor with + a selectable resolution. From Alexander Entinger. + - PN532: Add driver for the NXP PN532 NFC-chip. From Janne Rosberg + and others at Offcode Ltd. + - LSM9DS1: Add driver for the STMicro LSM9DS1 chip. The LSM9DS1 is a + system-in-package featuring a 3D digital linear acceleration sensor, + a 3D digital angular rate sensor, and a 3D digital magnetic sensor. + From Paul Alexander Patience. + - CAN Interface: Add more extensive error reporting capaibility to + the CAN interface definitions. From Frank Benkert. + - SPI Interface: Add an optional hwfeatures() method to the SPI + interface. + + * Simulation Platform: + + - NSH configuration uses the custom start up scriptwith a read-only + passwd file. Includes hooks for an MOTD message. + + * ARMv7-R + + - ARMv7-R: Add basic architecture support for the ARMv7-R processor + family. + + * Atmel AVR: + + - Atmega2560: Add support for the Atmega2560. From Dimitry Kloper. + - debug.h: Add an AVR-specific header file used when the AVR MEMX + pointer is used. From Dimitri Kloper. + + * Atmel AVR Boards: + + - Arduino-Mega2560: Add support for the Arduino-Mega2560. From + Dimitry Koper. + + * Atmel SAMV7 Drivers: + + - Port the TRNG driver from the SAMA5D3/4 to the SAMV7. + - Port the WDT driver from the SAMA5D3/4 to the SAMV7. + - Add an RSWDT driver. + + * Atmel SAMV7 Boards: + + - SAMV71-XULT: Add configuration for testing OS modules. + + * Freescale Kinetis: + + - MK60N512VLL100: Add support for the MK60N512VLL100 Kinetis part. + From Andrew Webster. + + * Freescale Kinetis Boards: + + - ENET: Numerous updates to the Kinetis ENET driver. That driver is + now functional. From Andrew Webster. + + * NXP LPC43xx Boards: + + - WaveShare LPC4337-WS: Support for the WaveShare LPC4337-WS board. + From Lok Tep. + + * STMicro STM32 Drivers: + + - Timer Capture: Add timer input capture driver. From Pierre-Noel + Bouteville. + + * STMicro STM32 Boards: + + - Olimex STM32 H407: Added a port to the Olimex STM32 H407 board. + This board features the STMicro STM32F407ZGT6 (144 pins). + Contributed by Neil Hancock. + + * TI TMS550 Boards: + + - TI LaunchXL-TMS57004: Add basic board support for TI LaunchXL- + TMS57004. Still a work in progress. + + * C Library/Header Files: + + - sys/time.h: Add timeradd(), timersub(), timerclear(), timerisset(), + and timercmp() as macros. These are non-POSIX interfaces, but + included in most BSD deriviatives, including Linux. From Manuel St??. + - AVR support: Introduce support for Atmel toolchain in-flash strings. + Atmel toolchain AVR compiler provides a transparent in-flash object + support using __flash and __memx symbols. The former indicates to + compiler that this is a flash-based object. The later used with + pointer indicates that the referenced object may reside either in + flash or in RAM. The compiler automatically makes 32-bit pointer + with flag indicating whether referenced object is in flash or RAM + and generates code to access either in run-time. Thus, any function + hat accepts __memx object can transparently work with RAM and flash + objects. + For platforms with a Harvard architecture and a very small RAM like + AVR this allows to move all constant strings used in trace messages + to flash in the instruction address space, releasing resources for + other things. This change introduces IOBJ and IPTR type qualifiers. + The 'I' indicates that the object may lie in instruction space on a + Harvard architecture machine. For platforms that do not have __flash + and __memx or similar symbols IOBJ and IPTR are empty, making the + types equivalent to, for example, 'const char' and 'const char*'. + For Atmel compiler these will become 'const __flash char' and + 'const __memx char*'. All printf() functions and syslog() functions + are changed so that the qualifier is used with the format parameter. + From Dimitry Kloper. + - debug.h: Add configuration to support an architecture-specific + debug.h header file. From Dimitri Kloper. + - netdb: Add support for the use of a DNS resolver file like + /etc/resolv.conf. + - TEA: Add an implementation of the Tiny Encryption Algorithm. + - math32.h: Add some utilities to support 64-bit arithmetic + operations for platforms that do not support long long types. + + * Tools: + + - tools/cnvwindeps.c: Add a tool that will convert paths in + dependencies generated by a Windows compiler so that they can be + used with the Cygwin make. + - tools/mkwindeps.sh: A script that coordinates use of cnvwindeps.exe. + Dependencies now work on the Cygwin platform when using a Windows + ative toolchain. + + * Applications: NSH + + - Module Commands: Add module commands: insmod, rmmod, and lsmod. + - Time Command: Add a 'time' command that may be used to time the + execution of other commands. + - Password Commands: Add useradd, userdel, and passwd commands. + - MOTD: Now supports a Message of the Day (MOTD) that will be + presented after the NSH greeting. + - Session Logins: All sessions may be protected with logins using the + encrypted password in /etc/passwd. + - Extended Logins. Added optional platform-specific function to + perform password verification and optional delay after each failed + login attempt. + + * Applications: apps/fsutils: + + - apps/fsutils/passwd: Utility library for accessing a password file + like /etc/passwd. + + * Applications: apps/netutils: + + - apps/netutils/telnetd: Now creates Telnet sessions by opening a new + factory device at /dev/telnet and then using ioctl calls to create + the session character drivers at /dev/telnetN. + - apps/netutils/netlib: Add netlib_get_dripv4addr() and + netlib_get_ipv4netmask(). From Pelle Windestam. + + * Applications: apps/examples: + + - apps/examples/module: Add a test harness for verifying NuttX kernel + modules. + - apps/examples/pca9635: Add a simple test of PCA9635PW PWM LED driver. + From Alan Carvalho de Assis. + - apps/examples/ostest: Add a test of POSIX timers using SIGEV_THREAD. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - pthreads: CRITICAL BUGFIX: Logic was wiping out the indication that + of the type of a pthread. Hence, it could be confused as a task. + - waitpid: CRITICAL BUGFIX. Add a reference count to prevent waitpid + from using stale memory released by the waited-for task group. + - clock_systimespec(): Fix an error in a time conversion. + + * File System/Block Drivers: + + - poll(): Fix handling of sem_tickwait() return value sem_tickwait() + does not return an -1+errno, it returns a negated errno value. + Noted by Freddie Chopin. + + * Common Drivers: + + - TUN Driver: Fix a compile time error in the TUN driver. From + Vladimir Komendantskiy. + - USB Host HID Parser: Wrong size used in memcpy(). From Hang Xu. + - PCA9555: Fixed a bug in the function pca9555_setbit which occurs if + someone tries to set one of the pins 8-15. The problem is that + after the check if the pin is greater than 7 the variable addr is + incremented and used in the Call I2C_WRITEREAD. But later in the + call to the I2C_WRITE buf[0] is used as address but this address is + not incremented as it should be. Note address does mean the address + to the register in the ioexpander and not the I2C address. From + Stefan Kolb. + + * Networking: + + - TCP/IOB: Numerous fixes, mostly relate to TCP and IOB buffering + and race conditions. These were necessary for for the NuttX + networking later to be stable in some stress testing. From Andrew + Webster. + + * Atmel SAMV7 Drivers: + + - USBHS Device: In USBHS device driver, fix check if zero length + packet is needed. + + * STMicro STM32 Drivers: + + - OTG FS Host: Fix some backward arguments to stm32_putreg(). Note + by Hang Xu. + + * Tools: + + - tools/mkdeps.c: Extended/fixed support for --winpath option. + Dependencies now work under Cygwin with a native Windows toolchain. + + * Build System: + + - apps/platform/Makefile: Use a relative path to the board directory + link rather than the absolute path. For Cygwin, the absolute would + would need converted with cygpath. But just using the relative path + is a simpler solution. + +NuttX-7.15 Release Notes +------------------------ + +The 115th release of NuttX, Version 7.15, was made on March 27, 2016, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.15.tar.gz and +apps-7.15.tar.gz. These are available from: + + https://bitbucket.org/patacongo/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - Add a state variable that provides the current level of OS + initialization. This is needed by some logic that may attempt to + run early in the start-up sequence but cannot run if a sufficient + level of initialization has not yet occurred. + - Spinlocks: Add interface definitions for to support spinlocks as + needed for multi-CPU configurations. + - SMP support. Support for Symmetric Multi-Processing (SMP) added. + This affects many internal data structures, spinlock extensions + and renaming of interrupt enable/disable interfaces, new platform + interfaces to support CPU initialization and inter-actions, and + new application interfaces to manage CPU affinity. The changes + are too extensive to summarize here; see the SMP Wiki page at + http://www.nuttx.org/doku.php?id=wiki:nxinternal:smp. The + new platform interfaces are also described in the NuttX porting + guide: http://www.nuttx.org/doku.php?id=documentation:portingguide. + Only partially verified; awaiting hardware for the complete + verification. + - TLS: Basic definitions needed to support thread local storage + (TLS). TLS is not used anywhere yet (and may not be used in the + near future either). + - Performance Monitoring: Add a configuration option to buffer + RTOS instrumentation data in an in-memory buffer. + - boardctl(): Add boardctl() support that will permit applications + to control USB devices. + + * File Systems/Block Drivers: + + - procfs: Add /proc/kmm entry that shows that state of the kernel + heap. Only useful in PROTECTED and KERNEL build modes where there + is a kernel heap. + - procfs: Add support for showing CPU in the tast status if SMP is + enabled. + + * Networking: + + - ARP: Add support for IOCTL commands to manage the ARP table. + - IEEE 802.15.4 and 6LowPAN: There are some radio drivers and a + directory structure is in place. However, most of this + development is occurring on a fork and is not yet available in the + NuttX repositories. Hopefully in NuttX-7.16. + + * Common Device Drivers: + + - ADS1242: Driver for the 24-Bit Differential Input ADC ADS1242 that + communicates via SPI with a MCU. Reading the ADC conversion result + as well as configuring the ADC, setting the input channel, etc. is + implemented via ioctl calls. However, it does not yet implement + the standard ADC interface. From Alexander Entinger. + - U-Blox Modem: Add an upper half driver for the U-Blox Modem. From + Vladimir Komendantskiy. + - I2C: Add an I2C, "upper half", character drivers to support raw I2C + data transfers for test applications. + - RGB LED: Add a driver to manage a RGB LED via PWM. From Alan + Carvalho de Assis. + - Performance Monitoring: Add a character driver that will allow an + application to read buffered scheduler instrumentation data. + + * Simulation Platform: + + - SMP: Add multi-CPU support to the simulation to support SMP + investigation. There are issues with the simulation and it is less + than perfect but sufficient for some very preliminary testing of + the core SMP feature. + + * ARMv7-A, ARMv7-R, and ARMv7-M: + + - ARMv7-A, ARMv7-R, and ARMv7-M: Add test-and-set logic and + definitions needed to supports spinlocks. + - ARMv7-A: Added MPCOre Generic Interrupt Controller (GICv2) and + Global Timer support + - ARMv7-A: Now includes in MCU-specific hooks needed for SMP support. + + * Atmel SAMV7 Drivers: + + - HSMSI: HSMCI driver can now be configured to handle unaligned data + buffers. + + * NXP Freescale LPC11xx/17xx/43xx and LPC2378 Drivers: + + - I2C: Backported the LPC43XX I2C driver, replacing the LPC11XX, + LPC17XX, and LPC2378 I2C drivers. This gives us the I2C_TRANSFER + method in all I2C drivers. + + * NXP Freescale LPC17xx Boards: + + - Support for the u-blox GSM and GPS module evaluation board with + NXP LPCExpresso LPC1768. The GSM module is one of LISA-C200, + LISA-U200 or SARA-G350. The GPS module is one of MAX-M7 or + MAX-M8. From Vladimir Komendantskiy. + + * NXP Freescale i.MX6: + + - Basic support is in place for the i.MX6 Quad/Dual MCUs. + Verification is, however, waiting for the receipt of hardware. + + * NXP Freescale i.MX6 Boards: + + - Sabre-6Quad: Basic support for the NXP/Freescale Sabre 6Quad + board is in place but waiting for hardware for verification. + + * STMicro STM32: + + - STM32F46xx: Support for STM32F46xx from Paul Alexander Patience + - STM32L4: Add support for the STM32L4 family. From Sebastien + Lorquet. + + * STMicro STM32 Boards: + + - STM32F4 Discovery: Add PWM support for the onboard RGB LED. From + Alan Carvalho de Assis. + - Nucleo-L476: Add support for the Nucleo-L476 board. From Sebastien + Lorquet. + - STM32L476VG Discovery: Add support for the STM32L476VG Discovery + board. From Dave. + + * Tools: + + - tools/refesh.sh now has a --silent option so that it can be used in + batch modes without human input. + + * Build System: + + - Added a 'make olddefconfig' target that will refresh a .config file + without interaction. + + * Applications: NSH + + - 'arp': Add an 'arp' command that will support access to the OS ARP + table. + - 'ps': The 'ps' command will show CPU if SMP is enabled. + + * Applications: apps/netutils: + + - apps/netutils/chat: Chat logic contributed by Vladimir + Komendantskiy. + - apps/netutils/netlib: Add utility functions to support accesses to + the ARP table. + + * Applications: apps/examples: + + - apps/examples/chat: Chat example contributed by Vladimir + Komendantskiy. + - apps/sysem/ubloxmodem: Example to control the power + state of the modem in nsh. From Vladimir Komendantskiy. + - apps/examples/leds: An example to demonstrate use of LED driver. + - apps/examples/smp: Add a test to verify SMP configurations. + - apps/examples/rgbled: Example using the RGB LED driver to drive an + RGB LED via PWM. From Alan Carvalho de Assis. + - apps/examples/ostest: Add a test of TLS. + - apps/examples/sched_note: Add a simple example to exercise the + scheduler instrumentation logic. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Signals: Move the list of signal actions from the TCB to the group + structure. Signal handlers are not per thread but, rather, per task + group. I know, I preferred it the other way too, but this is more + compliant with POSIX. + - Semaphores: Add an internal, non-standard interface to reset a + semaphore count. This is sometimes needed by drivers in order to + recover from error conditions. Were previously using sem_init() + which is both inappropriate and incorrect if the semaphore count is + negative. + - Low-Priority Work Queue: Fix logic to find an IDLE worker thread; + the test for busy was backward. From Linfei Chen. + + * File System/Block Drivers: + + - FAT: Add an option to force all transfers to be performed + indirectly using the FAT file system's internal sector buffers. + This is a fix for the case where the user provided buffers are not + properly aligned for DMA (as with THTTPD). + - MTD: Increase block size in mtd_geometry_s to 32-bits. + + * Common Drivers: + + - I2C: Restructured the I2C interface as necessary to eliminate some + thread-safety issues inherent in the legacy I2C interface design. + This effects the interface definition, all I2C clients, and all low- + level I2C drivers. I have used caution, but I still expect a change + of this magnitude to introduce some errors. Any bug reports of bug + fixes will be much appreciated. + - I2C_RESET: Eliminate up_i2creset(). It should not be a global + function; Now it is an I2C interface method. + - PCA555: Add logic to make the PCA555 driver thread safe. + - syslog: If syslog timestamping is enabled, don't try to get the time + if the timer hardware has not yet been initialized. + - AT24xx driver: Correct missing address calculation logic. From Frank + Benkert. + + * Networking: + + - Networking drivers that support CONFIG_NET_NOINTS: Fix a race + condition that can cause the TX poll timer to stop running. From + Manuel Stuhn. + - Timer Poll: Fix some logic when there are multiple network + interfaces. In this case, TCP timeout events can really only being + processed when the poll from the correct device is received. + + * Atmel SAMV7 Drivers: + + - SAMV7 USB HS device: The USB driver has had some issue that would + occasionally cause loss of packets. Back last December, a fix was + put in for this but the fix apparently worsens the problem; now + causing hangs. The basic problem is that the number of busy banks + (NBUSYBKS) status is not real time but is delayed. This was fixed; + now when the DMA completes and NBUSYBKS > 0, the NBUSYBK is + interrupt is enabled and the operations are deferred until NBUSYBKS + is truly zero. + + * Tools: + + - tools/testbuild.sh: .config files were not being updated because + (a) kconfig-conf was being called in the wrong directory and (b) + apps/Kconfig had not yet been created. Now uses 'make + olddefconfig'. + + * Applications: apps/system: + + - apps/system/i2c: The I2C tool now obeys it OS interfacing: it now + uses an I2C character driver to access the I2C bus. + - apps/system/cdcacm, usbmsc, and composite: Use new boardctl() + instead of calling directly in the OS when possible. + + * Applications: apps/netutils: + + - apps/netutils/dhcpd: DHCPD no longer calls directly into the OS but + uses the new network IOCTL commands to modify the ARP table. + + * Applications: apps/modbus: + + - apps/modbus/nuttx/portserial.c: Was not returning an error on + failure to open the device driver. From Olololshka kokoko. + + * Applications: apps/examples: + + - apps/examples/usbserial, composite, usbterm: Use new boardctl() + instead of calling directly in the OS when possible. There are + still a few bad OS calls for USB device interfaces that do not yet + have boardctl() commands. + + * Applications: apps/platform: + + - Moved C++ initialization logic out of the RTOS and into the + application space, specifically to apps/platform/board, where it + belongs. + +NuttX-7.16 Release Notes +------------------------ + +The 116th release of NuttX, Version 7.16, was made on June 1, 2016, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.16.tar.gz and +apps-7.16.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - Power Management: Add activity domain to all PM interfaces and + driver callbacks. If CONFIG_PM_NDOMAINS == 1, then the legacy + behavior is preserved. If CONFIG_PM_NDOMAINS > 1, then multiple + PM domains are supported. This will allow separate control for + certain power management groups. For example, a network can be + shut down without affect an ongoing UI (and vice versa). + - board_app_initialize(): board_app_initialize() now accepts an + argument that may be used to support initialization in different + configurations. + + * File System and Block and MTD Drivers: + + - N25Qxxx: Add MTD support for Micron N25Qxxx family of QSPI flash. + From Dave (ziggurat29). + - SST26F: Add an MTD driver for SST26F spi/qspi flash devices (SPI + mode only). From Sebastien Lorquet. + - File Descriptor Detach: Add logic to detach a file structure from a + file descriptor. This is for use only within the OS. It permits an + open file or driver to be used across multiple threads. + + * Networking and Network Drivers: + + - listen()/accept(): Separate out psock_listen() and psock_accepti() + for internal, thread independent OS usage (i.e., without a socket + descriptor). + - VNC Server: Add support for a VNC server. This logic is code + complete and functional, but not well tested. + + * Graphics and Graphic Drivers: + + - Framebuffer driver: Add a display number to each interface in order + to support multiple display devices. + - VNC Server: Add support for a VNC server. This logic is code + complete and functional, but not well tested. + - LCD Backpack: Add support for PCF8574 LCD Backpack driver. This + driver supports an interface board that is based on the PCF8574 I/O + expander and supports the HD44780-based (or compatible) LCD modules. + There are a myriad of different vendors of such, but they are + principally the same, save wiring and minor features like jumpers + for I2C addresses. This driver supports known and unknown variants. + From Dave (ziggurat29). + + * Common Device Drivers: + + - RTC: Simplify the RTC interface. The old interface was way too + complex and was not fully implemented anywhere. + - BH1750FVI: Add a character driver for Rohm Ambient Light Sensor + BH1750FVI. From Alan Carvalho de Assis. + - CAN: Improve CAN error reporting. From Frank Benkert. + - aes.h: Modifications to the crypto API needed for LPC43xx. From + Alexander Vasiljev. + - ADC: Interface no longer uses global adc_receive() call. Added a + new bind() method to the ADC interface. Now the ADC upper half + driver will register its receipt-of-data callback. This change + allows the ADC lower half driver to be used with a differ ADC upper + half. + + * Simulation Platform: + + - Linux Host Networking: Enhance networking support for the + simulation under Linux. Includes updated support for Linux TUN/TAP, + and the addition of support for Linux bridge devices. From Steve. + + * ARMv7-A, ARMv7-R, and ARMv7-M: + + - ARMv7-M: Convert more assembly language files for use with the IAR + toolchain. From Kha Vo. + - ARMv7-A: Complete re-design of SMP-related logic to initialize each + CPUn, n > 0, when CONFIG_SMP=y. + + * Atmel SAMV7: + + - Add a JTAG config and ERASE config to Kconfig to set the + CCFG_SYSIO SYSIO Pins. From David Sidrane. + - System Reset: Add the up_systemreset interface to the samv7 arch. The + approach is slightly different in that: 1) It enables ARCH_HAVE_RESET + and allows the user to set if, and for how long, to drive External + nRST signal. It also does not contain a default board_reset, as that + really should be done in the config's src if CONFIG_BOARDCTL_RESET + is defined. From David Sidrane. + + * Atmel SAMV7 Boards: + + - SAMV71-XULT: Add configuration(s) that were be used to verify VNC + graphics output as well as mouse and keyboard input. + + * NXP Freescale i.MX6 Boards: + + - Sabre-6Quad: The basic i.MX6 port is complete. This is a minimal + port at present and probably still has some as-of-yet-undiscovered + issues. + - Sabre-6Quad: Basic SMP NSH configuration is now working. But this + is probably only because the SMP test case does not stress the + logic. There are know outstanding SMP issues as noted in the + Sabre-6Quad README.txt file. + + * NXP Freescale LPC43xx: + + - LPC4337jet100: Add definitions for the LPC4337jet100 chip. From + Alexander Vasiljev. + + * NXP Freescale LPC43xx Drivers: + + - AES: Add AES support. From Alexander Vasiljev. + + * STMicro STM32: + + - STM32 L4: Add configuration options to allow SRAM2 to be used for + heap, or not at all, and to zero-initialize it on OS start, or not + at all. From Dave dev@ziggurat29.com. + - STM32 L4: Add support for HSE and MSI clocks, and auto trim of MSI + to LSE (needed for USB). From Dave (ziggurat29) + - STM32 L4: Add support for unique id function to arch; modified board + to support unique id boardctl. From Dave (ziggurat29) + + * STMicro STM32 Drivers: + + - STM32 F4 RTC: Add a custom RTC driver with support for alarms. From + Neil Hancock. + - STM32 L4 QSPI: Add a QSPI driver with DMA support and (optional + memory mapped mode support. From Dave ziggurat29). + - STM32, STM32 L4, and STM32 F7 Serial: Add support for compliant + SD-style breaks. From David Sidrane. + - STM32 L4 CAN: Add CAN support for STM32L4. From Sebastien Lorquet. + - STM32 1-Wire: Add support for a custom 1-wire driver. The serial + driver already supports a 1-wire interface, but this driver uses the + same serial logic to implement a lower half driver much like the + I2C lower half driver. From Aleksandr Vyhovanec. + - STM32 L4 SPI: Add support for SPI 4 and 5 on stm32f411 chips. From + Konstantin Berezenko. + - STM32 ADC: Allow omitting use of channels in a lower part of PWM. + From Pierre-noel Bouteville. + - STM32 L4 I2C: Get I2C working for STM32L4. From Dave (ziggurat29). + + * STMicro STM32 Boards: + + - STM3220G-EVAL: Add support for both the IAR and uVision GCC IDEs. + From Kha Vo. + - STM32F429I Discovery: Add support for the uVision GCC IDE. From + Kha Vo. + - STM32F4 Discovery: Integrate BH1750FVI driver in the STM32F4 Discovery + board. From Alan Carvalho de Assis. + - STM32L476VG Discovery: Add support for QSPI based N25Qxxx flash. + From Dave (ziggurat29) + - STM32L476VG Discovery: Add board ioctls for allowing user application + to cause QSPI memory mapped mode to be engaged and disengaged. Also + partitioned QSPI flash for file system and other (eventually xip). + From Dave (ziggurat29) + - Nucleo-144: Basic port for the Nucleo-144 board with the STM32F746ZG + MCU. From Kconstantin Berezenko. + - STM32F103 Minimum: Add support for this minimual STM32F103CBT6 "blue" + board. From Alan Carvalho de Assis. + - STM32F411E Discovery: Add basic configuration for stm32f411e-disco + board with STM32F411VE chip. From Konstantin Berezenko. + + * Build/Configuration System: + + - Moved NuttX repository to https://bitbucket.org/nuttx/nuttx. + Eliminated use of sub-modules. + - Add support for the IAR toolchain for the limited case of the ARMv7-M + architecture and the STM32 chip. From Aleksandr Vyhovanec. + - make export: Pass top-level make to the script to allow -j greater + than 1. From David Sidrane. + - fs/Kconfig: Allow CONFIG_FS_WRITABLE to be manually selectable. This + is needed when there are no writable file systems, but write support + is still needed in BCH or FTL. + - arch/*/Makefile: Add definitions that can be overrided to use GCC + instead of LD in the final link. From Paul Alexander Patience . + + * Applications: apps/netutils: + + - apps/netutils/esp8266: ESP8266 driver application. From Pierre-noel + Bouteville. + + * Applications: apps/examples: + + - apps/examples/alarm: Add a simple test of the ALARM iotcl calls of + the RTC driver. + - apps/examples/nximage: Add a configuration option to select + greyscale. + + * Platforms: apps/platform: + + - apps/platform/nucleo-144: Add platform files for NUCLEO-144 + (NUCLEO-F746ZG). From Mark Olsson. + - apps/examples/media: You can now override the default device driver + path by providing an alternal path on the command line. From + Sbastien Lorquet. + +Works-In-Progress: + + * IEEE802.14.5/6LowPAN. Hooks and framework for this effort were + introduced in NuttX-7.15. Work has continued on this effort on + forks from the main repositories, albeit with many interruptions. + The completion of this wireless feature will postponed until at + least NuttX-7.17. + + * i.MX6 SMP. Partially functional, but there is more that still + needs to be done. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Various places: Search for places where a stray semicolon following + an if condition cause the if body to be executed unconditionally. + Fixes in all SAM DMA logic, unionfs, OS signalling logic, and others. + - enter/leave_critical_section() may attempt to access task lists + before they have been initialized in the SMP configuration. + + * File System/Block Drivers: + + - SMART MTD: Return code of smart_scan not checked, can cause success + result in failure case, leading to 'dev' pointer being invalid. From + Dave (ziggurat29) + - mount: Fix a backward debug assertion. Noted by David Sidrane. + + * Common Drivers: + + - NRF24L01: Fix backward calculation of relative frequency. Noted by + Henry Zhang. + - PCA9555 I/O expander: Fix an error in the PCA9555 driver: Under + certain error conditions, interrupts were not being re-enabled. + Sebastien Lorquet. + - ADS1255: Must not do SPI access from interrupt handler. Use the + worker thread instead. Must also lock the SPI bus before using it. + - Several SPI-based drivers modified. All drivers that use SPI must + call SPI_LOCK and SPI_UNLOCK. This is not optional. + - MS583730: Fix a bug in crc computation for ms583730. Implement + POSIX read. + + * Atmel SAMV7: + + - Fix typo in MATRIX register definitions. From Stefan Kolb. + - SAMV7 Tickless Mode: This is a fix to a problem in the handling of + the oneshot timer. Due to a wrong assumption concerning the behavior + directly after the start of the timer/counter the function + sam_oneshot_cancel() calculates the wrong remaining time. The code + assumes that the counter register is zero directly after the start + of the timer, but this is not true. To start the time/counter a + software trigger is invoked, this trigger starts the timer/count and + sets the counter register to zero, but the reset of the counter + register is not performed instantly. According to the datasheet: + "The counter can be reset by a trigger. In this case, the counter + value passes to zero on the next valid edge of the selected clock." + Thus the counter is set to zero between 0 and USEC_PER_TICK + microseconds after the clock was started. + In my fix I use the freerun count value to determine if at least one + tick passed since the start of the timer and thus if the value of + the oneshot counter is correct. I also tried to use the function + up_timer_gettime() to achieve this but, at least if compiled with + no optimization the problem vanishes without using the value of the + function, the function call takes too long. + Another problem treated in the fix is that if the oneshot timer/counter + is canceled, we only know the remaining time with a precision of + USEC_PER_TICK microseconds. This means the calculated remaining time + is between 0 and USEC_PER_TICK microseconds too long. To fix this I + subtract one tick if the calculated remaining time is greater than + one tick and otherwise set the remaining time to zero. By doing so + the measured times are much more precise as without it. From Stefan + Kolb. + + * Atmel SAMA5: + + - SAMA5: Stefan Kolb's change to the SAMV7 Oneshot Timer should also + be applied to the SAMA5 oneshot time since the drivers are identical. + + * Atmel SAM3/4: + + - SAM3/4: Stefan Kolb's change to the SAMV7 Oneshot Timer should also + be applied to the SAM3/4 oneshot time since the drivers are identical. + + * Atmel SAMV7 Drivers: + + - SAMV7 TWIHS (as well as SAM3/4 and SAMA5: Ensure that the TWIHS + (i2c) hw get's its clock set when the sequence of + sam_i2cbus_initialize(), sam_i2cbus_uninitialize(), then + sam_i2cbus_initialize() or twi_reset() is called. I found this a + while back in the stm32 family, so there may be more arch-es with + this sort of bug. I suppose any driver that has the notion of "do + not set the freq if it is already set" could be suspect. From David + Sidrane. + - USBHS Device: Remove disabling of whole USB on suspend of USBHS. + This fix removes the disabling of the whole USB peripheral on + suspend interrupt. Its enough to freeze the clock instead. When + disabling the whole peripheral, the next wakeup-interrupt comes up + with an disabled clocking. The unfreeze clock has no effect, because + the master clock is disabled. This makes all registers, including + the IDR unwriteable and the IRQ falls in an endless loop blocking + the whole system. Furthermore the disabling of the peripheral clock + prevents hotplugging or reconnecting the USB. From Frank Benkert. + - MCAN: Fix missing unlock of device in MCAN mcan_txempty(). From + Frank Benkert. + + * STMicro STM32: + + - STM32 L4 Clocking: Problem with resetting backup domain clears + clocking options set up before in *rcc.c use INITS flag to avoid + magic reg value to detect power up reset state of RTC correct a + problem clearing interrupt flags (they weren't) which prevented an + alarm from ever being used more than once per reset cycle. From + Dave (ziggurat29) + + * STMicro STM32 Drivers: + + - STM32L4 SPI: That STM32Lr SPI driver is quite different. They now + handle frames of arbitrary size between 4 and 16 bits. It was broken + before a new bit has to be set (RX fifo threshold) to handle <= 8-bit + transactions. If not set, the default is 16-bit packed >=8-bit + frames and the RXNE bit is never set (it is set when 16-bits are + received). weird things as always. This also add 8-bit access + routines to the data register, because a 16-bit access to the data + register when the frame size is below 9 bits is interpreted as a + packed dual frame exchange. Sebastien Lorquet. + - STM32: Correct some bad commits that broke the LTDC display example. + From Marco Krahl. + - STM32 F4 RTC: Fix logic in F4 RTCC driver that prevent ALARM + interrupt. From Neil Hancock. + - STM32 F1 ADC: Fix STM32 ValueLine ADC IRQ number selection. From + David Sidrane. + + * STMicro STM32 Boards: + + - STM32F429I Discovery: Correct some bad commits that broke the LTDC + display example. From Marco Krahl. + + * TI Tiva: + + - GPIO Interrupts: Fix a bug of GPIO falling-edge interrupt for tiva. + From Young. + + * C Library: + + - math: Add a NAN test on 'x' in asin function of lib_asin.c. Suggested + by Pierre-noel Bouteville. + + * Build/Configuration System: + + - Several Makefiles: Add .PHONY definitions to prevent 'clean up to date' + message weirdness when 'make clean' is done with no .config or + Make.defs file. + +NuttX-7.17 Release Notes +------------------------ + +The 117th release of NuttX, Version 7.17, was made on July 25, 2016, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.17.tar.gz and +apps-7.17.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * File System and Block and MTD Drivers: + + - drivers/mtd: Add a driver of IS25xP SPI flash devices. Based on + sst25xx driver. From Marten Svanfeldt. + + * Networking and Network Drivers: + + - Break out internal interface psock_ioctl(). + + * Common Device Drivers: + + - PTYs: Added support for pseduo-terminals: Device drivers that can be + used for communications between tasks (usually with re-directed I/O). + Based on existing pipe logic. + - Button upper half driver: Added support for poll(). + - CAN: Add support for poll. From Paul Alexander Patience. + - GPIO: Add support for a simple GPIO driver. It supports only pre- + configured input, output, and interrupting pins with basic input and + output operations. Interrupt events can lead to notification via a + signal. + - I/O Expander: 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. + - Pipes/FIFOs: Add support to allocating different sizes for pipe and + fifo buffers. Adds mkfifo2() and pipe2() which are just like mkfifo() + and pipe(), but allow control of the size of the underlying, in-memory + circular buffer. Move pipe() and mkpipe() to the C library, they are + no longer core OS interfaces. Capability currenty used only by PTY + logic to support, configurable, smaller buffers for PTYs. + + * SYSLOG/Debug Output: + + - SYSLOG: Consolidated all SYSLOG logic in drivers/syslog. Added an + abstraction layer that supports: (1) redirection of SYSLOG outpout. + This is usually so that you can boot with one SYSLOG output but + transition to another SYSLOG output when the OS has initialialized, + (2) adds common serialization of interrupt output as a configuration + option. Without this configuration setting, interrupt level output + will be asynchronous. And (3) vsyslog is now a system call and is + usable with other-than-FLAT builds. + - SYSLOG: syslog() will now automatically redirect output to + lowsyslog() if called from an interrupt handler. + - Extended SYSLOG logic so that we can send SYSLOG output to a file. + - SYSLOG character device channel will now expand LF to CR-LF. + Controllable with a configuration option. + - Add a SYSLOG character device that can be used to re-direct output + to the SYSLOG channel (Not be be confused the SYSLGO output to a + character device). + - Debug features are now enabled separately from debug output. + (1) CONFIG_DEBUG is gone. It is replaced with CONFIG_DEBUG_FEATURES. + (2) The macros dbg() and vdbg() have renamed as _err() and _info(), + respectively. This also applies to all of the variants as well, + XXdbg() and XXvdbg(). (3) Add a new debug level, _warn() (and + all variants XXwarn(), XXvwarn(), etc.). (4) Debug assertions can + now be enabled separately from debug output. (5) You can now enable + subsystem/device driver debug output at different output levels. For + example, CONFIG_DEBUG_FS no longer enables file system debug output + It enables general file system debug logic and enables selection of + CONFIG_DEBUG_FS_ERROR, CONFIG_DEBUG_FS_WARN, and CONFIG_DEBUG_FS_INFO. + - Since the SYSLOG layer now automatically handles low-level vs. + high-level output, the low-level (ll) variants of the debug macros + were eliminated. + - Reviewed all uses of *err(). These macro family should indicate + only error conditions. Convert *err() to either *info() or add + ERROR:, depending on if an error is reported. + - _alert(): New debug macro: _alert(). This is high priority, + unconditional output and is used to simplify and standardize crash + error reporting. + - Many CONFIG_DEBUG_* options did not have matching macros defined in + include/debug.h. Rather, there were various definitions scattered + throughout the sourse tree. These were collected together and + centralized with single macro definitions in include/debug.h + + * Simulation Platform: + + - Added the simulated QSPI (N25Q) flash to the simulation and extened + flash simulation capabilities to run with MTD drivers based on config + options (currently m25p, sst26 and w25). From Ken Pettit. + + * Atmel SAMV7 Drivers: + + - SPI: SPI-Freq. 40MHz; VARSELECT; hw-features This change adds the + following improvements: + + o Increase the allowed SPI-Frequency from 20 to 40 MHz. + o Correct and rename the "VARSELECT" option This option was + included in the code as "CONFIG_SPI_VARSELECT" but nowhere + defined in a Kconfig file. The change renames it to + "CONFIG_SAMV7_SPI_VARSELECT" and corrects the implementation + according the datasheet of Atmel. In short, this option + switches the processor from "fixed peripheral selection" + (single device) to "variable peripheral selection" (multiple + devices on the bus). + o Add a new Function to the interface to control the timing and + delays of the chip according the ChipSelect lines. This function + can control the delay between the assertion of the ChipSelect and + the first bit, between the last bit and the de-assertion of the + ChipSelect and between two ChipSelects. This is needed to tune + the transfer according the specification of the connected devices. + o Add three "hw-features" for the SAMV7, which controls the behavior + of the ChipSelect: + - force CS inactive after transfer: this forces a (short) de- + assertion of the CS after a transfer, even if more data is + available in time + - force CS active after transfer: this forces the CS to stay + active after a transfer, even if the chip runs out of data. + Btw.: this is a prerequisit to make the LASTXFER bit working + at all. + - escape LASTXFER: this suppresses the LASTXFER bit at the end + of the next transfer. The "escape"-Flag is reset automatically. + + From Frank Benkert + - TWISHS: Driver improvements from Michael Spahlinger. + - GPIO-Driver fixed for Open-Drain Pins: + + o 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 + o Re-Implemented twi_reset-function and enhanced it so it can be + called from inside the driver (see next point) + o Glitch-Filter: Added a configuration option to enable the twi- + built-in glitch filter + o 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 IC-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 + + * NXP Freescale LPC43xx Drivers: + + - EMC: Extend LPC43xx EMC code to support SDRAM on a dynamic memory + interface. From Vytautas Lukenskas. + + * NXP Freescale Kinetis: + + - Kinetis K64: 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). + + * NXP Freescale Kinetis Drivers: + + - Add a KinetisUSB device controller driver. Derived from the pic32mx + usb driver, which uses the same usb controller. From kfazz. + - Kinetis pwm support, based on the KL pwm driver. From kfazz. + - Kinetis Ethernet: Add support for the KSZ8081 PHY. + - Kinetis Ethernet: Modified Ethernet driver to try all PHY addresses + and then only fail if the driver cannot find a usable PHY address. + This means that you no longer have to specific the PHY address in + advance. + - Kinetis Ethernet: Add support for CONFIG_NET_NOINTS. The driver no + longer runs the networking at interrupt level but can defer interrupt + work to the high-priority work queue. + + * NXP Freescale Kinetis Boards: + + - Teensy-3.x: Add USB support and a usbnsh configuration. + From kfazz (2016-06). + - Freedom-K64F: Add support for the NXP Freedom-K64F board at 120MHz. + This is primarily the work of Jordan Macintyre. I leveraged this + code from https://github.com/jmacintyre/nuttx-k64f which was, itself, + a leverage from the old K60 TWR configuration. This includes + significant corrections (LEDs, buttons, README, etc) and extensions + and updates to match more recent BSPs. + - Freedom-K64F: Added a configuration that supports networking. + + * STMicro STM32: + + - STM32 F1-4: Added support for the STM32F105R. From Konstantin + Berezenko. + - STM32 F4: Added support for the STM32FF76xxx and STM32FF7xx + families. From David Sidrane. + - STM32 F1-4: Add support for Tickless mode (two timer + implementation). From Max Neklyudov. + - STM32 L4: Add support for tickless OS, and incidentally timers, + PWM, oneshot, free-running.... From ziggurat29. + + * STMicro STM32 Drivers: + + - STM32 F1-4: Add the up_getc() function to STM32 in order to support + the minnsh configuration. From Alan Carvalho de Assis. + - STM32 F7: Add SPI driver. From David Sidrane. + - STM32 F7: Add SPI, I2C, and ADC drivers. From Lok Tep. + - STM32 L4: Add ioctls to set/get CAN bit timing in stm32l4. Add + ioctl hooks to allow future management of can id filters. From + Sebastien Lorquet. + - STM32 L4: 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. + - STM32 F1-4: Port STM32L4 CAN IOCTLs to STM32. From Sebastien Lorquet. + - STM32 L4: Implementation of loopback IOCTLs. From Sebastien + Lorquet. + - STM32 F7: Added SDMMC1 support for stm32F7 74-75. From Lok Tep. + - STM32 F7: Add USB support. From Lok Tep. + - STM32 F7: Added PWR, RTC, and BBSRAM support for stm32f7. From David + Sidrane. + - STM32 F7: Added STMF7xxx RTC. From David Sidrane. + - STM32 F7: Added STM32F7 DBGMCU. From David Sidrane. + - STM32 L4: Port support for both RX FIFOs from STM32 CAN. From Paul + Alexander Patience. + + * STMicro STM32 Boards: + + - Added a minnsh configuration for the STM32F103-Minimum board. From + Alan Carvalho de Assis . + - Added support for the Nucleo-F767ZI board. From David Sidrane. + - Nucleo-144/Nucleo-F767ZI: Add test for STM32 F7 SPI. From David + Sidrane. + - Nucleo-144: Added SDMMC support to Nucleo-144. From David Sidrane. + - Olimex STM32-E4077: Add support for Olimex STM32 E407 board. From + Mateusz Szafoni. + - Nucleo-144: Added USB OTG device to Nucleo-144. From David Sidrane. + - Nucleo-144: Added bbsram test to Nucleo-144. From David Sidrane. + - STM32F4 Disovery: Add CAN support for STM32F4 Discovery. From + Matthias Renner. + - STM32F4 Disovery: added a canard configuration files. From + Matthias Renner. + - STM32F4 Discovery: Add FPU support for ostest for the STM32F4 + Disovery platform. From David Alessio. + - STM32L476 Discovery: Update stm32l476 disco to include init code for + smartfs and nxffs for cases where those fs are included in build. + From ziggurat29. + + * C Library/Header Files: + + - include/assert.h: Check if NDEBUG is defined. From Paul Alexander + Patience. + - assert.h: Define static assert for C++ usage. From Paul Alexander + Patience. + - Add crc64 support. From Paul Alexander Patience. + - hex2bin: Move the portable library portion of apps/system/hex2bin + the C library with the OS internals. It is used in certain internal + boot-loader builds. + - Add raise(). + - libm: This change should significantly improve the performance of + single precision floating point math library functions. The vast + majority of changes have to do with preventing the compiler from + needlessly promoting floats to doubles, performing the calculation + with doubles, only to demote the result to float. These changes only + affect the math lib functions that return float. From David Alessio. + - printf(): If there are no streams, let printf() fall back to use + syslog() for output. + - Move pipe() and mkpipe() to nuttx/libc, they are no + longer core OS interfaces. Capability currenty used only by PTY logi + to support, configurable, smaller buffers for PTYs. + - Move driver-related files from include/nuttx to include/nuttx/drivers. + Move driver related prototypes out of include/nuttx/fs/fs.h and into + new include/drivers/drivers.h. + - include /nuttx/lib: Move library-related files from include/nuttx to + include/nuttx/lib. + + * Build/Configuration System: + + - Custom Board Configuration: 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. + - Remove the includes/apps link to apps/include. It is no longer + used. From Sebastien Lorquet. + + * Tools: + + - tools/tesbuild.sh will now build NxWM configurations. + + * Appplication Build/Configuration System: + + - Change to the way that apps/ Kconfig files are generated in + order to better support reuse of the apps/ directory in NuttX + products. Changes include: Make the full tree use wildcards + make.defs, Add empty preconfig rules to 'leaf' makefiles, Use + directory.mk for recursive dir makefiles, Individual app kconfig + fixes, Recursive Kconfig autogeneration, Add kconfig files for + pcode and tiff, and fix a gitignore rule, From Sbastien Lorquet. + - apps/include directory structure reorganized. There are no longer + any header files in the apps/include/. directory. Rather, sub- + directories were added to match the partitioning of apps/ sub- + directories and the header files were moved into the appropriate + sub-directory. This change is intended to help with some changes + being considered by Sbastien Lorquet. + - Call all includes from to "bla/bla.h". From Sebastien + Lorquet. + - Add apps/include to include path in top-level Make.defs file. + + * Applications: apps/nshlib: + + - Make NSH net-initialization be a configuration option. From Marten + Svanfeld. + - Add NTP client initialization in NSH network startup logic. From + David S. Alessio . + - 'ps' command now prints out the stack usage if stack coloration is + enabled. From Frank Benkert. + - Allow stack usage to be disabled on constrained systems. From David + Sidrane. + + * Applications: apps/netutils: + + - NTP Client: Add retries. From David S. Alessio. + - NTP Client: The NTP client will now optionally use pool.ntp.org as + the NTP server; and reset the retry count upon success -- more robust. + From David Alessio. + - ESP8266: Add logic to set the BAUD rate. From Pierre-noel Bouteville. + - ESP8266: In Kconfig, select ARCH_HAVE_NET when NETUTILS_ESP8266 is + selected. This allows, among other things, support for network debug + output. From Pierre-noel Bouteville. + + * Applications: apps/fsutils: + + - flash_eraseall: IOCTL wrapper for MDCIO_BULKERASE command. Was in + nuttx/drivers/mtd. Moved to apps/fsutils because the call directly into + the OS was incorrect. + + * Applications: apps/canutils: + + - canlib: Basic CAN utility library. From Sebastien Lorquet. + + * Platforms: apps/system: + + - flash_eraseall: Now uses the IOCTL wrapper at apps/fsutils/flash_eraseall. + + * Platforms: apps/platform: + + - Add platform files for Olimex STM32 E407. From Mateusz Szafoni. + + * Applications: apps/examples: + + - apps/examples/canard: Add canard example application. From + Matthias Renner. + - apps/examples/pty_test: PTY test program. From Alan Carvalho de + Assis. + +Works-In-Progress: + + * IEEE802.14.5/6LowPAN. Hooks and framework for this effort were + introduced in NuttX-7.15. Work has continued on this effort on + forks from the main repositories, albeit with many interruptions. + The completion of this wireless feature will postponed until at + least NuttX-7.18. + + * i.MX6 SMP. Partially functional, but there is more that still + needs to be done. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - semaphores: Need to set errno to EINVAL on errors in sem_post() + and sem_wait(). From Paul Alexander Patience. + + * File System/Block Drivers/MTD Drivers: + + - 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. + - VFS ioctl(). Per comments from David Sidrane, file_ioctl() should + not return succeed if the ioctl method is not supported. It + probably should return ENOTTY in that case. + - SST26 Driver: Before accessing the sst26 flash, the "Global Unlock" + command must me executed, which I do in the sst26 driver. BUT re- + reading the datasheet, the WREN instruction is required to enable + the execution of this command. This was not done. I have no idea how + the driver currently works except by chance. The writes should never + happen at all, the flash is half-enabled! From Sebastien Lorquet. + - N25Qxx Driver: Alter the notion of 'blocksize' to be equivalent to + 'flash write page size' in order to align with assumptions in the + smartfs driver (at least, maybe other things do as well). Correct a + bug that was previously masked by having blocksize=eraseblocksize + which would cause buffer overflows and delicious hardfaults. + Trivial spelling changes in comments, etc. From ziggurat29. + - SmartFS: Fix a 32-byte memory leak. From Ken Pettit. + - SMART MTD layer: Fixes freesector logic error when sectorsPerBlk=256, + adds DEBUGASSERT for invalid geometry and additional memory debug + logic. Also fixes the dangling pointer on error bug. From Ken + Pettit. + + * Common Drivers: + + - USB CDC/ACM Device Class: 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. + - Pipes and FIFOs: Add missing configuration for pipe ring buffer + size. From Frank Benkert. + - UART 16550: Handle when CONFIG_SERIAL_UART_ARCH_IOCTL is not + enabled. From Heath Petersen. + - Common Serial Upper Half: Fix a race condition noted by Stefan + Kolb. Between the test if the TX buffer is full and entering a + critical section, bytes may be removed from the TX buffer making + the wait unnecessary. The unnecessary wait is an inefficiency, + but not really a problem. But with USB CDC/ACM it can be a problem + because the entire TX buffer may be emptied when we lose the race. + If that happens that uart_putxmitchar() can hang waiting for data + to be removed from an empty TX buffer. + - USB MSC Device Class: Add locks when removing request from queue. + From Wolfgang Reissnegger. + - USB MSC Device Class: Fix reversed logic on waiting for SCSI thread + start. The scsi thread was waiting for the wrong condition. + However, this was masked by the fact that the code creating the + scsi thread was also holding usbmsc_scsi_lock(priv) while + initializing data, hence this lock synchronized the scsi thread + start with init completion. From Wolfgang Reissnegger. + + * Graphics and Graphic Drivers: + + - Correct conditional compilation in ST7565 LCD driver. From Pierre- + noel Bouteville + + * Networking: + + - In both IPv6 and IPv4 incoming logic: (1) Should check if the + packet size is large enough before trying to access the packet + length in the IP header. (2) In the comparison between the IP + length and the full packet length, need to subtract the size of + he link layer header before making the comparison or we will get + false positives (i.e., the packet is really too small) + - TCP Networking: While working with version 7.10 I discovered a + problem in TCP stack that could be observed on high network load. + Generally speaking, the problem is that RST flag is set in + unnecessary case, in which between loss of some TCP packet and its + proper retransmission, another packets had been successfully sent. + The scenario is as follows: NuttX did not receive ACK for some sent + packet, so it has been probably lost somewhere. But before its + retransmission starts, NuttX is correctly issuing next TCP packets, + with sequence numbers increasing properly. When the retransmission + of previously lost packet finally succeeds, tcp_input receives the + accumulated ACK value, which acknowledges also the packets sent in + the meantime (i.e. between unsuccessful sending of lost packet and + its proper retransmission). However, variable unackseq is still set + to conn->isn + conn->sent, which is truth only if no further + packets transmission occurred in the meantime. Because of incorrect + (in such specific case) unackseq value, few lines further condition + if (ackseq <= unackseq)is not met, and, as a result, we are going to + reset label. From Jakub Lagwa. + + * ARMv7-M: + + - ARM stack check: Fix double fault on IDLE task with stack size = 0. + From David Sidrane. + + * Atmel SAMV7 Drivers: + + - CAN: 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. + + * Atmel SAMA5: + + + * Atmel SAM3/4 Drivers: + + - Fix some errors in AFEC header file. From OrbitalFox. + - DAC: DACC_WPMR_WPKEY_MASK -> DACC_WPMR_WPKEY. From Wolfgang + Reissnegge. + - Timer: Fix ops check in TCIOC_STOP. From Wolfgang Reissnegge. + - I2C: Fix reversed logic in twi_startmessage(). From Wolfgang + Reissnegger. + - SAM3/4 UDP: Fix handling of endpoint RX FIFO banks. This fixes + a race condition where the HW fills a FIFO bank while the SW is + busy, resulting in out of sequence USB packets. + + * Atmel SAMV7 Drivers: + + - USBHS Device: This change solves a problem which causes data loss + while sending data via USB. This problem is caused by an incorrect + handling of the endpoint state in the USB driver sam_usbdevhs. This + leads under some circumstances to situations in which an DMA + transfer is setup while a previous DMA transfer is currently active. + Amongst other things I introduced the new endpoint state + USBHS_EPSTATE_SENDING_DMA for the fix. To reproduce the problem, I + used a program which send as many data as possible via a CDC/ACM + device and verified the received data on the PC. From Stefan Kolb. + + * NXP Freescale Kinetis Drivers: + + - Timers: Support up to 8 channels per timer. From kfazz. + + * NXP Freescale Kinetis Boards: + + - Teensy 3.x clock fixes: The High Gain bit in MCG_C1 was preventing + teensy from booting except after a programming session. The second + change doesn't appear to change any functionality, but complies with + restrictions in the k20 family reference manual on FEI -> FBE clock + transiions. From kfazz. + + * NXP Freescale LPC17xx Drivers: + + - LPC17 Ethernet: Needs to correctly ignore PHYID2 revision number + when comparing PHY IDs. + + * NXP Freescale LPC43xx Drivers: + + - Fix errors in GPIO interrupt logic. From v01d (phreakuencies) + - Ethernet: Correct auto-negotiation mode in the LPC43xx Ethernet. + From Alexander Vasiljev + - Writing zero to NVIC_IRQ_ENABLE has no effect. Disable interrupts + with NVIC_IRQ_CLEAR. From Paul Alexander Patience. + - SPIFI: If CONFIG_SPIFI_SECTOR512 undefined, lpc43_bwrite doesn't do + actual write (probably copy/paste errors). Still not sure about + current state of lpc43_spifi implementation, but for me NXFFS works + with this change. From Vytautas Lukenskas. + + * Qemu-i486: + + - Fix qemu-i486/ostest/Make.defs test for M32. From Heath Petersen. + + * SiLabs EFM32 Drivers: + + - Fix EFM32 FLASH conditional compilation. From Pierre-noel + Bouteville + - Writing zero to NVIC_IRQ_ENABLE has no effect. Disable interrupts + with NVIC_IRQ_CLEAR. From Paul Alexander Patience. + + * STMicro STM32: + + - STM32 F1-F4: In PWM driver, just update duty if frequency is not + changed and PSM started. This removeis glitch or blinking when + only duty is frequently changed. From Pierre-noel Bouteville. + + * STMicro STM32 Drivers: + + - STM32 F7: Fixed STM32F7 DMA stm32_dmacapable. DMA working on SDMMC. + From David Sidrane. + - STM32 F1-F4 Timer Driver: Change calculation of per- timer pre-scaler + value. Add support for all timers + - STM32 F1-F4: Correct conditional compilation in STM32 timer capture + logic. From Pierre-noel Bouteville + - STM32 F1-F4: Fix STM32 DMA code and configuration for STM32F37X chips. + From Marten Svanfeldt. + - STM32 F1-F4: Fix compilation errors in debug mode of stm32_pwm.c. + From Konstantin Berezenko. + - STM32 F1-F4: Correct the CAN2 RX IRQ number for stm32f10xx chips. + From Konstantin Berezenko. + - STM32 F1-F4: Move backup domain reset to earlier in the + initialization sequence (stm32_rcc.c() in order to avoid disabling + LSE during RTC initialiation. From Alan Carvalho de Assis. + - STM32 F1-F4: When configuring a GPIO via stm32_configgpio() the + function will first set the mode to output and then set the initial + state of the gpio later on. If you have an application with an + externaly pulled-up pin, this would lead to a glitch on the line + that may be dangerous in some applications (e.G. Reset Line for + other chips, etc). This changes sets the output state before + configuring the pin as an output. From Pascal Speck . + - STM32 F7: Apply Pascal Speck's GPIO STM32 change to STM32 L4. + - STM32 L4: Apply Pascal Speck's GPIO STM32 change to STM32 L4. + From Sebastien Lorquet. + - STM32 F7: BUGFIX: PLLs IS2 and SAI P Calculation. From David + Sidrane. + - STM32 L4: STM32 CAN fixes need to be backported to STM32L4 as well. + - STM32 F1-F4 and L4: Writing zero to NVIC_IRQ_ENABLE has no effect. + Disable interrupts with NVIC_IRQ_CLEAR. From Paul Alexander + Patience. + - STM32 F7: 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. + - STM32 F1-F4: STM32 BBSRAM fixed (and formatted) flags. From David + Sidrane. + - STM32 F7: STM32F7 BBSRAM fixed (and formatted) flags. From David + Sidrane. + - STM32 L4: Fix incorrect clock setup for LPTIM1. From ziggurat29. + - STM32 F4/L4 RTC ALARM: were enabling interrupts too early in the + power-up sequence, BEFORE the interrupt system was being + initialized. + + * STMicro STM32 Boards: + + - STM32 board.h: Fix STM32 timer input clock definitions. From David + Sidrane. + + * TI Tiva Drivers: + + - Bug Fix in tiva_serial.c - UART5, UART6 and UART7 were not being + configured as TTYS0 for printing over serial console. From Shirshak + Sengupta. + + * C Library/Header Files: + + - include/signal.h: Change type of SIG_ERR, SIG_IGN, ... to + _sa_handler_t. The type void does not work with the IAR toolchain. + From Aleksandr Vyhovanec. + - crc16: fix error. From Paul Alexander Patience. + - strtoul() and strtoull(): Fix errno settings required by function + definition. Resolved Bitbucket Issue #1. From Sebastien Lorquet. + + * Build/Configuration System: + + - 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. Now it does + context, pre_config, menuconfig, clean_context. Not nearly as + snappy as it used to be. + - Need to build the drivers/ directory even it file descriptors are + not supported. There are things in the drivers/ directory that are + still needed (like SYSLOG logic). + - Remove all inclusion of header files from the apps/include + directory from NuttX core logic. There should be no dependency on + logic within NuttX on logic within apps/. This caused a lot of + reshuffling of logic: binfmt pcode support, usbmonitor is now a + kernel thread, TZ/Olson database moved to libc/zoneinfo. + + * Application Build/Configuration System: + + - Make sure that APPNAME is defined in all Makefiles that generate + applications. From Sebastien Lorquet. + + * apps/builtins: + + - apps/builtins: exec_builtin was not using the provided open flags. + As a result >> redirection was not working; it was treated the same + as >. + + * apps/nshlib: + + - apps/nshilib: PS Command: When Priority Inheritance is enabled, the + format of /proc//status changes to show both the current + priority and the threads base priority. This messes up the format + of cmd_ps. From David Alessio. + + * apps/netutils: + + - apps/netutils, uIP webserver: Fix a data declaration in a header + file. + + * apps/canutils: + + - apps/canutils/libuavcan: Fix for recent change to STM32 timer + frequency definiitions. + + * apps/examples: + + - apps/examples/alarm: ioctl call was clobbering file descriptor. + - apps/examples/can: Some variables were not declared in all required + cases. From Sebastien Lorquet. + - apps/examples/media: media example was intended to take either a + command line argument, or a compiled-in default value from config. + However, the default was ignored, leading to confusing error + messages. From ziggurat29. + +NuttX-7.18 Release Notes +------------------------ + +The 118th release of NuttX, Version 7.18, was made on October 8, 2016, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.18.tar.gz and +apps-7.18.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - Add standard adjtime() interface and basic timekeeping support. + Normally used with an NTP client to keep system time in + synchronization. From Max Neklyudov. + - Use the oneshot timer with optional entropy to measure CPU load if + so configured. + + * File System and Block and MTD Drivers: + + - Add Fujistu MB85RS256B ramtron support. From Beat Kng. + - SPI-based MTD driver for Macronix MX25L3233F or MX25L6433F. From + Aleksandr Vyhovanec. + + * Graphics/Display Drivers: + + - SH1106 0.96 OLED module support (SSD1306 compatible) + I2C fixes. + From v01d (phreakuencies). + + * Sensor Drivers: + + - Add KXTJ9 Accelerometer driver from the Motorola Moto Z MDK. + - Add MFRC522 RFID ISO14443 and Mifare transceiver driver. From Alan + Carvalho de Assis. + - Add driver for the LIS3MDL 3 axis magnetometer. From Alexander + Entinger. + - Add driver for the MLX90393 3 axis magnetometer. From Alexander + Entinger. + - Add driver for the LIS3DSH 3 axis accelerometer. From Alexander + Entinger. + - Add driver for the Bosch BMG160 3 axis gyroscope. From Alexander + Entinger. + - Add support for the Sensixs XEN1210 3D-board. This sensor is used + on NANOSATC-BR2 a Brazillian CUBESAT project. From Alan Carvalho + de Assis. + - Add a new ioctl command (set MAXPOS) for Tiva QEI. From Young. + + * Other Common Device Drivers: + + - I/O Expander: Remove hard-coded PCA9555 fields from ioexpander.h + definitons. Add support for an attach() method that may be used + when any subset of pin interrupts occur. + - I/O Expander Interface: Encode and extend I/O expander options to + include interrupt configuration. + - PCA9555 Driver: Replace the signalling logic with a simple callback + using the new definitons of ioexpander.h. This repartitioning of + functionality is necessary because (1) the I/O expander driver is + the lower-lower part of any driver that uses GPIOs (include the GPIO + driver itself) and should not be interacting directly with the much + higher level application layer. And (2) in order to be compatible + with the GPIO driver (and any arbitrary upper half driver), the + PCA9555 should not directly signal, but should call back into the + upper half. The upper half driver that interacts directly with the + application is the appropriate place to be generating signal. + - Add a skeleton I/O Expander driver (based on the PCA9555 driver). + - Add PCF8574 I/O Expander driver. + - GPIO driver: Add IOCTLs to get the pin type and to unregister a + signal handler. + - Add a GPIO lower-half driver that can be used to register a GPIO + character driver for accessing pins on an I/O expander. + - Add an SPI helper function that encapsulates and manages a sequence + of SPI transfers. + - Add an SPI character driver that will permit access to the SPI bus + for testing purposes. + - Add oneshot timer lower half interface definition. + - Add an upper-half, oneshot timer character driver. + - Add Audio Tone Generator for NuttX. From Alan Carvalho de Assis. + - Add USB host support for composite devices. This feature is not + well tested. + - drivers/ioexpander: Add an (untested) TCA64XX I/O Expander driver + leveraged from Project Ara. + + * Simulation Platform: + + - Add a simulated I/O Expander driver. + - Add simulator-based test support for apps/examples/gpio. + - Add a configuration useful for testing Mini Basic. + - Add a simulated oneshot lowerhalf driver. + + * Atmel SAM3/4 Drivers: + + - SAM4CM: Add option to support oneshot timer without free-running + timer. Add oneshot lower half driver. + + * Atmel SAMA5 Drivers: + + - SAMA5D: Add option to support oneshot timer without free-running + timer. Add oneshot lower half driver. + + * Atmel SAMV7 Drivers: + + - SAMV71/SAME70: Add option to support oneshot timer without + free-running timer. Add oneshot lower half driver. + - Add support for SAMV7 DACC module. From Piotr Mienkowski. + + * NXP Freescale Kinetis Drivers: + + - Add support for I2C and RTC. From v01d (phreakuencies). + + * NXP Freescale Kinetis Boards: + + - Add teensy 3.x I2C support. From v01d (phreakuencies). + + * STMicro STM32: + + - Add IAR-style STM32F1xx vectors. Tested on STM32F103RB and + STM32F107RC. From Aleksandr Vyhovanec. + + * STMicro STM32 Drivers: + + - Add timekeeping support for the STM32 tickless mode. From Max + Neklyudov. + - Add a oneshot, lower-half driver for STM32. + - STM32 L4: Add oneshot lower half driver for STM32 L4. + - STM32 L4: Add support for quadrature encoders on STM32L4. Sebastien + Lorquet. + + * STMicro STM32 Boards: + + - stm32f103-minimum: Add board support to MFRC522 driver. From Alan + Carvalho de Assis. + - Add oneshot board initialization to stm32f103-minimum. From Alan + Carvalho de Assis. + - stm32f103-minimum: Add board configuration to initialize Audio Tone + Generator. From Alan Carvalho de Assis. + - stm32bufferfly2: Add support for the Kamami stm32butterfly2 + development board with optional ETH phy. From Michal Lyszczek. + - stm32f103-minimum: Add board config support to SPI LCD module + JLX12864G-086. From Alan Carvalho de Assis. + - stm32l476-mdk: Support basic booting and nsh on Motorola MDK. The + Motorola MDK is based off of an earlier version of NuttX. + This only provides a basic NSH shell. From Jim Wylder. + - STM32 F4 Discovery: Add support for XEN1210 3D-board. From Alan + Carvalho de Assis. + - stm32f103-minimum: Add stm32_bringup support and userled example to + STM32F103 Minimum board. From Alan Carvalho de Assis. + - Add support for qencoders on various nucleo boards. From Sebastien + Lorquet. + - olimex-stm32-e407: Add some networking configurations. From Mateusz + Szafoni. + + * TI Tiva Drivers: + + - Add tiva PWM lower-half driver implementation. From Young. + - Tiva QEI: Add QEI lower-half driver for Tiva series chip. From + Young. + + * C Library/Header Files: + + - Separate XorShift128 PRNG from /dev/urandom and make it generally + available. + - Add POSIX type sig_atomic_t. From Sebastien Lorquet. + - Add the difftime() function. The function depends on the toolchain- + dependent CONFIG_HAVE_DOUBLE so is not available on tiny platforms. + From Sebastien Lorquet. + - Add support for remove(). From Sebastien Lorquet. + - Add system() to stdlib.h. Actual implementation is in + apps/system/system. + + * Build/Configuration System: + + - Rename arch/sh to arch/renesas. + - Remove contactless drivers from drivers/wireless to drivers + contactless. From Sebastien Lorquet. + - Move all modem-related IOCTL commands to a common file to assure + that they will be unique. + + * Tools: + + - Add sethost.sh. This is a script that you can use to quickly + change the host platform from Linux to Windows/Cygwin. Might save + you a lot of headaches. + + * Applications: apps/nshlib: + + - Add logic to support an NSH-specific system command. + - Add printf command to NSH, e.g., controlling /dev/userleds from + command line: nsh> printf \x01 > /dev/userleds. From Alan Carvalho + de Assis. + + * Platforms: apps/system: + + - Port tee command from NetBSD. + - Add a generic system command. Current implentation cannot use + /bin/sh and spawns the custom NSH system command directly. + + * Platforms: apps/platform: + + - Add C++ support for STM32L476-MDK. + + * Platforms: apps/interpreters: + + - Add a port of Mini Basic, version 1.0, written by Malcom McLean and + released under the Creative Commons Attribution license. + + * Applications: apps/examples: + + - Add a simple test of the GPIO driver. + - Add RFID_READUID sample application. From Alan Carvalho de Assis. + - Add Oneshot timer example. + - Add a simple test of the system command. + +Works-In-Progress: + + * IEEE802.14.5/6LowPAN. Hooks and framework for this effort were + introduced in NuttX-7.15. Work has continued on this effort on + forks from the main repositories, albeit with many interruptions. + The completion of this wireless feature will postponed until at + least NuttX-7.19. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Explicitly initialize the group tg_exitsem with sem_init(). The + existing logic worked because the correct initialization value is + all zero, but it is better to initialize the semaphore explicitly. + - The TCB nchildren field should not be incremented when pthreads are + created. + - Move fields related to parent/child task relationship out of TCB + into group structure where they belong. Child is a group, not a + thread. + - mq_send() was not setting the errno value on certain failures to + allocate a message. + - Define 'group' even if HAVE_GROUPID is not set. From Mateusz + Szafoni. + - Vector table should have dimension NR_IRQS, not NR_IRQS+1. From + Sagitta Li. + - pthreads: When a pthread is started, there is a small bit + of logic that will run on the thread of execution of the new + pthread. In the case where the new pthread has a lower + priority than the parent thread, then this could cause both the + parent thread and the new pthread to be blocked at the priority of + the lower priority pthread (assuming that CONFIG_PRIORITY_INHERITANCE + is not selected). This change temporarily boosts the priority of the + new pthread to at least the priority of the new pthread to at least + the priority of the parent thread. When that bit of logic has + executed on the thread of execution of the new pthread, it will then + drop to the correct priority (if necessary) before calling into the + new pthread's entry point. + + * File System/Block Drivers/MTD Drivers: + + - FAT performance improvement. In large files, seeking to a + position from the beginning of the file can be very time consuming. + ftell does lssek(fd, 0, SET_CURR). In that case, that is wasted + time since we are going to seek to the same position. This fix + short-circuits fat_seek() in all cases where we attempt to seek to + current position. Suggested by Nate Weibley. + - MTD: Fixed cloned typos in several FLASH drivers. From Aleksandr + Vyhovanec. + - mount: Corrects a bad assertion noted by Pierre-noel Bouteville. + Also fixes a reference counting problem in an error condition: + When the mountpoint inode is found but is not an appropriate + mountpoint, the reference count on the inode was not being + decremented. + + * Common Drivers: + + - Various serial drivers: Fix FIONWRITE and add FIONSPACE. All + implementations of FIONWRITE were wrong. FIONWRITE should return + the number of bytes waiting in the outgoing send queue, not the free + space. Rather, FIONSPACE should return the free space in the send + queue. + - Add missing prototype for btn_lower_initialize(). + - Make DAC sample structure packed. From Marc Recht. + + * Networking: + + - TCP: tcp_ipvX_bind() not actually using the port selected with + port==0. Also removes duplicate call to pkt_input(). Issues noted + by Pascal Speck. + - drivers/net: NET_TUN=y => NET_MULTIBUFFER=y. From Vladimir + Komendantskiy. + - slip driver: Fix calculations using MSEC_PER_TICK. If + USEC_PER_TICK is less than 1000, then MSEC_PER_TICK will be + zero. It will be inaccurate in any case. + + * Atmel SAM3/4 Drivers: + + - SAM3/4 GPIO: Enable peripheral clock for GPIO port when GPIO is + configured as input. The value of a GPIO input is only sampled when + the peripheral clock for the port controller the GPIO resides in is + enabled. Therefore we need to enable the clock even when polling a + GPIO. From Wolfgang Reissnegger. + - All SAM Ethernet Drivers: Add support so that the drivers can be + built with CONFIG_NET_MULTIBUFFER=y. + - SAM3/4: Fix GPIO pull-up/down code. Enabling the pull-down resistor + while the pull-up resistor is still enabled is not possible. In this + case, the write of PIO_PPDER for the relevant I/O line is discarded. + Likewise, enabling the pull-up resistor while the pull-down resistor + is still enabled is not possible. In this case, the write of + PIO_PUER for the relevant I/O line is discarded. From Wolfgang + Reinegger. + + * Atmel SAMV7 Drivers: + + - All SAM Ethernet Drivers: Add support so that the drivers can be + built with CONFIG_NET_MULTIBUFFER=y. + - SAM GPIO: Apply Wolfgang's change for SAM3/4 to SAMA5 and SAMV7. + + * Atmel SAMA5: + + - Add missing oneshot max_delay method. + - All SAM Ethernet Drivers: Add support so that the drivers can be + built with CONFIG_NET_MULTIBUFFER=y. + - SAM GPIO: Apply Wolfgang's change for SAM3/4 to SAMA5 and SAMV7. + + * NXP Freescale LPC43xx Drivers: + + - LPC43xx serial: Fix typos in LPC43 serial driver. Found by Vytautas + Lukenskas. + - LPC43xx Serial: There are some small problems in LPC43xx RS485 mode + configuration. In particular: (1) UART0,2,3 do not have DTR pins + (different from UART1), so, Kconfig needs to be adjusted. (2) + lpc43_uart.c in RS485 mode only configures DIR pin, but doesn't + enable pin output for UART0,2,3. (3) should be option to reverse DIR + control pin output polarity. (4) lpc43xx/chip/lpc43_uart.h doesn't + have USART3 definitions. NOTE: I didn't modified and didn't tested + USART1, as it has different hardware. From Vytautas Lukenskas. + From Vytautas Lukenskas. + + * SiLabs EFM32 Drivers: + + - EFM32 SPI drivers adopted incompatible conventions (See STM32 for + details of the issue). + + * STMicro STM32 Drivers: + + - STM32, STM32 L4, and EFM32 SPI drivers adopted incompatible + conventions somewhere along the line. They set the number of bits + to negative when calling SPI_SETBITS which had the magical side- + effect of setting LSB first order of bit transmission. This is not + only a hokey way to pass control information but is supported by no + other SPI drivers. This change three things: (1) It adds + HWFEAT_LSBFIRST as a new H/W feature. (2) It changes the + implementations of SPI_SETBITS in the STM32 and EFM32 drivers so + that negated bit numbers are simply errors and it adds the + SPI_HWFEATURES method that can set the LSB bit order, and + (3) It changes all calls with negative number of bits from all + drivers: The number of bits is now always positive and + SPI_HWFEATURES is called with HWFEAT_LSBFIRST to set the bit order. + - Add missing SPI2 and SPI3 support for STM32F3F3. Add STM32F37XX DMA + channel configuration. For STM32F37XX, SYSCFG_EXTICR_PORTE defined + twice. From Alan Carvalho de Assis. + - STM32: Make stm32_pwr_enablebkp thread safe. From Max Neklyudov. + - Fix bad pllmul values for STM32F1XX connectivity line. STM32F1XX + connectivity line supports only x4, x5, x6, x7, x8, x9 and x6.5 + values. From Michal Lyszczek. + - STM32F3 SPI: Fix the number of bit setting for the F3. That and + data packing work differently on the STM32F3 than for other STM32 + parts. + - STM32 and STM32 L4: Enabling SPI DMA loses other bits in CR2. + - STM32F3 SPI: Cannot write always 16-bit value to DR register + because of how the F3 implements data packing. + - STM32F411 and STM32F446 map i2c2_sda_4 to different alternate + function numbers. From Konstantin Berezenko. + - STM32 DMA Fix: Change stm32 adc dma callback to send channel + number instead of index. From Konstantin Berezenko. + - STM32 OTGFS device: Fix for lost first word from FIFO + + 1) Do not overwrite Reserved Bits in GINTSTS (per ref manual)* + 2) Acknowledge all pending int on entry to ISR that are Only rc_w1* + 3) Do not disable RXFVL* + 4) Loop until RXFVL is cleared* + 5) Only clear the NAK on the endpoint on the OTGFS_GRXSTSD_PKTSTS_SETUPDONE to not loose the first WORD of FIFO all the data (Bug Fix) + + Changed marked *are just driver clean up and ensure ints are not lost. The bug fix is #5 + + Test case open putty and observer the Set/Get LineCoding. Without this fix #5 the Get will not match the Set, and in fact the data might be skewed by 4 bytes, that are lost from the FIFO if the OTGFS_DOEPCTL0_CNAK bit is set in the OTGFS_GRXSTSD_PKTSTS_SETUPRECVD as opposed to the OTGFS_GRXSTSD_PKTSTS_SETUPDONE + + Set Line Coding DATA1: 4B | 00 c2 01 00 00 00 08 | c8 1B + Get Line Coding DATA1: 4B | .. .. .. .. 00 00 08 c8 .. 00 00 07 | 7a 72 + + From David Sidrane. + - STM32 L4 OTGFS device: Apply stm32 fix to stm32l4. From Sebastien + Lorquet. + - STM32 F7: Remove duplicate call to pkt_input from Ethernet driver. + Issues noted by Pascal Speck. + - STM32 L4: Add support for USART3-USART5. For STM32L4 parts, the + higher number USART ports supported varies. Add the HAVE_USARTx + definitions to the configuration to allow enabling the higher + numbered USART ports. From Jim Wylder. + - STM32 USB: Set USB address to avoid a failed assertion. From + Pierre-noel Bouteville. + - STM32 L4 and L7 USB: Pierre's assertion-avoidance change should + also be applied to STM32 F7 and L4. + - STM32, L4, and F7: Remove GPIO_ETH_RMII_TX_CLK. TX_CLK is not + present in RMII. Mateusz Szafoni. + - STM32 Ethernet: Correct typo in conditional logic. From Neil + Hancock. + - STM32 L4 USB Device: Fixed L4 USB Driver by avoiding SETUPDONE and + EPOUT_SETUP. From David Sidrane. + - STM32 SPI: stm32_modifycr2 should be available on all platforms if + DMA is enabled. + - STM32 DMA2D: fix an error in up_dma2dcreatelayer where an invalid + pointer was returned when a certain underlying function failed. + From Jens Grf. + + * TI Tiva Drivers: + + - Fix two bugs of tiva pwm lower-half driver implementation. From + Young. + - Tiva Ethernet: Needs support for CONFIG_NET_MULTIBUFFER=y. + + * C Library/Header Files: + + - lib_dumpbuffer() now prints a large on-stack buffer first to avoid + problems when the syslog output is prefixed with time. From + Pierre-noel Bouteville. + - libc/math: This fixes the following libc/math issues: (1) asin[f l]() + use Newtons method to converge on a solution. But Newtons method + converges very slowly (> 500,000 iterations) for values of x close to + 1.0; and, in the case of asinl(), sometimes fails to converge (loops + forever). The attached patch uses an trig identity for values of + x > sqrt(2). The resultant functions converge in no more than 5 + iterations, 6 for asinl(). (2) The NuttX erf[f l]() functions are + based on Chebyshev fitting to a good guess. The problem theres a + bug in the implementation that causes the functions to blow up with + x near -3.0. This patch fixes that problem. It should be noted that + this method returns the error function erf(x) with fractional error + less than 1.2E-07 and thats fine for the float version erff(), but + the same method is used for double and long double version which + will yield only slightly better precision. This patch doesn't + address the issue of lower precision for erf() and erfl(). (3) a + faster version of copysignf() for floats is included. From David S. + Alessio. + - strtod() was not returning endptr on error conditions. + - libc/math: floor(), floorf(), and floorl(): Fix logic error. Was + not correctly handling negative integral value. + - isatty() should be prototyped in unstid.h, not termios.h. From + Sebastien Lorquet. + - nxglib: Fix handling of near-horizontal lines of width 1 in + nxgl_splitline(). Missing handling for degenerate condition caused + width 1 lines such as (0, 0) - (100, 10) to have gaps in the + drawing. From Petteri Aimonen. + + * Build/Configuration System: + + - Top-Level Makefiles: Fix a chicken-and-egg problem. In the menuconfig + target, the context dependency was executed before kconfig-mconf. That + was necessary because the link at apps/platform/board needed to be set + up before creating the apps/Kconfig file. Otherwise, the platform + Kconfig files would not be included. But this introduces the chicken- + and-egg problem in some configurations. In particular: (1) An NX + graphics configuration is used that requires auto-generation of + source files using cpp, (2) the configuration is set for Linux, but + (3) we are running under Cygwin with (4) a Windows native toolchain. + In this case, POSIX-style symbolic links are set up but the Windows + native toolchain cannot follow them. The reason we are running + 'make menuconfig' is to change from Linux to Cygwin, but the target + fails. During the context phase, NX runs CPP to generate source files + but that fails because the Windows native toolchain cannot follow + the links. Checkmate. This was fixed by changing all of the make + menuconfig (and related) targets. They no longer depend on context + being run. Instead, they depend only on the dirlinks target. The + dirlinks target only sets up the directory links but does not try + to run all of the context setup; the compiler is never invoked; no + code is autogenerated and things work. + - CXXFLAGS: Add -fcheck-new whenever -fno-exceptions is used. From + Beat Kng. + + * Tools + + - tools/refresh.sh: Recent complexities added to apps/ means that + configuration needs the correct Make.defs file in place in order to + configure properly. + - tools/kconfig2html.c: Update to handle absolute paths when sourcing + Kconfig files. + - tools/mkfsdata.pl was still generating the old-style apps/include + inclusion paths. + + * Application Build/Configuration System: + + - Add DIRLINK and DIRUNLINK tool definitions to apps/Make.defs. + + * apps/nshlib: + + - Fix FIFO_SIZE vs PIPE_SIZE. + - Fix hex representation of IP address in Kconfig. Noted by Michal + Lyszczek. + - nsh_syscmds.c: missing semicolon. From Mateusz Szafoni. + - In system command, don't try to flush output streams if stdio + buffered I/O is not supported. + + * apps/canutils: + + - libuavcan: Under certain circumstances, DELIM is not be defined in + Makefile. + - Add definition for APPNAME in apps/canutils/canlib. From Sebastien + Lorquet. + + * apps/gpsutils: + + - Fix an error minmea. From Aleksandr Vyhovanec. + + * apps/examples: + + - apps/examples/oneshot: If the requested delay is > max_delay, then + break the delay up into several pieces. + +NuttX-7.19 Release Notes +------------------------ + +The 119th release of NuttX, Version 7.19, was made on December 26, 2016, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.19.tar.gz and +apps-7.19.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - sched/semaphore, sched/phread/, libc/semaphore, libc/pthread: Add + pthread_mutexattr_get/set_protocol and non-standard + sem_get/set_protocol. These may use to enable or disable priority + inheritance on a single semaphore. + - Spinlocks: Added capability to provide architecture-specific memory + barriers. + - SMP: Add spin_trylock(). Use this in conditions where other CPUs need + to stopped but we cannot call enter_critical_section(). + - sched note: Extend OS instrumentation to include some SMP events. + Also add spinlock instrumentation; In SMP configurations, add a + filter mask to log only notes from certain CPUs. + - sched note: Permit spinlock and critical section notes in in-memory + buffer iff sched_not_get() interfaces is disabled. + - sched note: Add additional note to see if/when CPU is started in SMP + mode. + - sched note: Record ID enumeration now results on constant values; ID + values do not change with configuration. This makes writing post-processing software much easier. + - boardctl: Add new boardctl() command, BOARDIOC_NX_START, to start the + NX server as a kernel thread. + - pthreads: Add pthread_cleanup_push() and pthread_cleanup_pop(). + - pthreads: Added pthread_setcanceltype() and pthread_testcancel(). + - pthreads: Add support for cancellation points. + - task_delete() now obeys all cancellation point semantics. + - Add task_setcancelstate(), task_setcanceltype(), and + task_testcancel(). These are non-standard interfaces analogous to the + correponding pthread_ interfaces that provide cancellation controls + for tasks. + + * Graphics/Display Drivers: + + - boardctl: Add new boardctl() command, BOARDIOC_NX_START, to start the + NX server as a kernel thread. + + * Networking/Network Drivers: + + - Network drivers: Add option to use low-priority work queue to all + Ethernet and MAC level drivers. + - Network Drivers: Adapt all Ethernet (and other MAC) drivers to work + as though CONFIG_NET_MULTIBUFFER were set. Remove all references to + CONFIG_NET_MULTIBUFFER. + - Eliminate CONFIG_NO_NOINTS. There is no longer any support for + interrupt level processing of the network stack. Lots of files changed. + + * Other Common Device Drivers: + + - Vishay VEML6070: Add Vishay VEML6070 driver. From Alan Carvalho de + Assis. + + * ARMv7-A + + - ARMv7-A/i.MX6: Add SCU register definitions. Add some controls to + enable SMP cache coherency in SMP mode. Makes no difference, however + -- cache still incoherent on i.MX6. + - ARMv7 GIC: SGIs are non-maskable but go through the same path as + other, maskable interrupts. Added logic to serialize SGI processing + when necessary. + + * Atmel SAM3/4: + + - SAM3/4: Add SMP support for the dual-core SAM4CM. From Masayuki + Ishikawa. + + * Atmel SAM3/4 Drivers: + + - Add support for the SAM5CMP-DB board. From Masayuki Ishikawa. + + * Atmel SAM3/4 Boards: + + - SAM4CMP-DB: Add support for the Atmel SAM4CMP-DB board running in an + SMP configuration. From Masayuki Ishikawa. + - SAM4CMP-DB: Add hooks to auto-mount the procfs file system on startup + in board bring-up logic. + + * Atmel SAMV7 Drivers: + + - SAMv7: Register the watchdog device at the configured device path + CONFIG_WATCHDOG_DEVPATH vs. hard-coded /dev/wdt. From Frank Benkert. + + * Calypso + + - Calyps: Remove all Calypso board configurations. Remove Calypso + architecture support and support for Calypso SERCOMM driver. + + * Misoc LM32: + + - Misoc LM32: Adds basic support for the Misoc procoessors and the LM32 + in particular. From Ramtin Amin. + - Misoc LM32: Add signal handling logic. From Ramtin Amin. + - Misoc LM32: Add logic to flush/invalidate caches. From Ramtin Amin. + + * Misoc LM32 Drivers: + + - Misoc LM32 Serial: Add interrupting Misoc serial driver. From Ramtin + Amin. + - Misoc LM32 Timer: Add timer driver. From Ramtin Amin. + - Misoc LM32: Add Misoc Ethernet driver From Ramtin Amin. + + * Misoc LM32 Boards: + + - Misoc LM32 Qemu: Board support for testing Misoc LM32 with Qemu. From + Ramtin Amin. + - Misoc LM32 Qemu: Integrate network support into configs/misoc/hello. + From Ramtin Amin. + - Misoc LM32 Qemu: Remove configs/misoc/include/generated directory. I + suppose the intent now is that this is a symbolic link? DANGER! + This means that you cannot compile this code with first generating + these files a providing a symbolic link to this location! There is a + sample directory containing generated sources. This is really only + useful for performing test builds. You really must generate the Misoc + architecture for a real-life build. From Ramtin Amin. + + * NXP Freescale i.MX6 Drivers: + + - i.MX6: Add an untested SPI driver taken directly from the i.MX1 port. + + * NXP Freescale Kinetis: + + - Kinetis: Added missing headers. Kinetis broke out SPI to + kinetis/kinetis_spi.h. Broke out DMA to use the modern Nuttx chip + inclusion - still STUBS. Add Kinetis support for ARMV7-M Common + Vector and FPU. Allow CONFIG_ARMV7M_CMNVECTOR, + CONFIG_STACK_COLORATION, CONFIG_ARCH_FPU. Fix i2c driver offset + swapped for value in kinetis_i2c_putreg. From David Sidrane. + + * NXP Freescale Kinetis Drivers: + + - Kinetis: Add UID Unique ID. From Neil Hancock. + + * NXP Freescale Kinetis Boards: + + - Freedom-K64F board: Add support for UID Unique ID. From Neil Hancock. + + * NXP Freescale LPC17xx Boards: + + - Olimex-LPC1766-STK: Enable procfs in NSH configuration. Automount + /proc on startup. + + * NXP Freescale LPC43xx Drivers: + + - LPC43xx: Add timer driver: From Alan Carvalho de Assis. + - LPC43xx GPDMA driver: The GPDMA block is basically the same as the + LPC17xx. Only the clock configuration is different and LPC43xx has + four different DMA request sources, where LPC17xx has only two. From + Alan Carvalho de Assis. + + * NXP Freescale LPC43xx Boards: + + - Bambino 200E: Add basic support to Micromint Bambino 200E board. + This includes contributions from Jim Wolfman. From Alan Carvalho de + Assis. + - Bambino 200E: Add support for timer driver. From Alan Carvalho de + Assis. + + * RGMP: + + - Remove RGMP and RGMP drivers. + + * RISC-V: + + - RISC-V: Add support for the RISC-V architecture and + configs/nr5m100-nexys4 board. The board support on this is pretty + thin, but it seems like maybe a good idea to get the base RISC-V stuff + in since there are people interested in it. From Ken Pettit. + + * STMicro STM32 Drivers: + + - STM32 F3: Implemention of the STM32 F37xx SDADC module. There are + also changes to ADC, DAC modules. SDADC has only been tested in DMA + mode and does not support external TIMER triggers. This is a work in + progress. From Marc Recht. + - STM32 F3: Add PWM driver support for STMF37xx. The changes have been + tested successfuly for TIM4 and TIM17 (different IPs). From Marc + Recht. + - STM32 F4: Support oversampling by 8 for the STM32 F4. From David + Sidrane. + - STM32 F4: Added Timers 2-5 and control of SAI and I2S PLLs. Added + support for stmf469 SAI and I2S PLL configuration and STM446 fixes. + From David Sidrane. + - STM32 F4: Expanded OTGFS support to stm32F469 and stm32f446. Added + missing bit definitions, Used stm32F469 and stm32f446 bit + definitions, Removed unsed header file. From David Sidrane. + - STM32 F4: Allow dma in 1 bit mode in STM32F4xxx. From David Sidrane. + - STM32 F7: Allow the config to override the clock edge setting. From + David Sidrane. + - STM32 L4: Support Complementary PWM outputs on STM32L4. From + Sebastien Lorquet. + - STM32 L4: Add implementation of dumpgpio for stm32l4, was required + for pwm debug. From Sebastien Lorquet. + + * STMicro STM32 Boards: + + - STM32F103 Minimum: Add button support. From Alan Carvalho de Assis. + - STM32F103 Minimum: Add support to PWM on STM32F103-Minimum board. + From Alan Carvalho de Assis. + - STM32F103 Minimum: Add RGB LED support on STM32F103 Minimum board. + From Alan Carvalho de Assis. + - STM32F103 Minimum: Add Vishay VEML6070 driver support to the + STM32F103-Minimum board. From Alan Carvalho de Assis. + - Nucleo-F303RE: Add STM32 F303RE hello configuration. From Marc + Recht. + - Nucleo-L476: Support PWM testing on board Nucleo L476. From + Sebastien Lorquet. + - Nucleo L476: Add support for timers to Nucleo L476. From Sebastien + Lorquet. + - Hymini STM32v: Enable CONFIG_RTC in the hymini-stm32v/nsh2 + (kitchensink) config. From Maciej Wjcik. + - Olimex STM32-p407: Add support for the Olimex STM32 P407 board. + + * TI Tiva Drivers: + + - Tiva PWM: Support PWM_PULSECOUNT feature for TI tiva. From Young.Mu. + + * Xtensa/ESP32 + + - Xtensa ESP32: Basic architectural support for Xtensa processors and + the Expressif. ESP32 added. + - Xtensa ESP32: Add EXPERIMENTAL hooks to support lazy Xtensa + co-processor state restore in the future. + - Xtensa ESP32: Basic port is function in both single CPU and dual CPU + SMP configurations. There is an NSH configuration for each CPU + configuration. Outstanding issues include missing clock configuration + logic, missing partition tables to support correct configuration from + FLASH, and some serial driver pin configuration issues. + - Xtensa ESP32: Add stack checking logic. + + * Xtensa/ESP32 Boards: + + - ESP32 Core v2: Basic support for Expressif ESP32 Core v2 board + added. The initial release includes an NSH and an SMP test + configuration. + - ESP32 Core v2: Add configuration to support linking NuttX for + execution out of IRAM. + - ESP32 Core v2: Automatically mount /proc at start-up. + - ESP32 Core v2: Add an OS test to verify the port. + + * C Library/Header Files: + + - libc/locale: Add a dummy setlocale() function to avoid drawing the + function from newlib. Add clocale header file. + - include/locale.h: Modify locale.h to add localeconv() and lconv + structure. From Alan Carvalho de Assis. + - libc/locale: Allows c++ code to compile with or without + CONFIG_LIBC_LOCALE and will generate a link error if + CONFIG_LIBC_LOCALE is not defined and setlocale is referenced. With + CONFIG_LIBC_LOCALE defined setlocale will act as if MB string is not + supported and return "C" for POSIX. C and "". From David Sidrane. + - libc/wchar: Add wcslen, wmemchr, wmemcmp, wmemcpy wmemset, btowc, + mbrtowc, mbtowc, wcscmp, wcscoll, and wmemmove to NuttX. From Alan + Carvalho de Assis. + - libc/wctype: Add functions wcrtomb, wcslcpy, wcsxfrm, wctob, wctomb, + wctype, localeconv, strcoll, strxfrm, swctype, towlower, towupper and + wcsftime. Add wctype.h; Move lib_wctype.c to libc/wctype. From Alan + Carvalho de Assis. + - include/ctype.h : Add isblank() macro to ctype.h. From Alan Carvalho + de Assis. + - lic/stdlib: Add strtof() and strtold() as simply a copy of strtod + with types and limits changed. + - sscanf(): Use strtof() instead of strtod() if a short floating point + value was requested. The should help performance with MCUs with + 32-bit FPU support with some additional code size. + - sscanf(): Add scansets to the scanf function. Enabled + CONFIG_LIBC_SCANSET option. From Aleksandr Vyhovanec. + - include/inttypes.h: Add architecture-specific inttypes.h. From Paul + A. Patience. + - C Library: Allow option to enable IP address conversions even when + the IP address family is not supported. + + * Build/Configuration System: + + - The Smoothie project needs to compile C++ inside config/boardname/src/ + to use with High Priority Interruption, then I modified the board + configs Makefile to support it. It works fine for the first time + compilation, but if we execute "touch config/boardname/src/Pin.cxx" + and execute "make" it will not detect that Pin.cxx was modified. I + think there is some other place I should modify, but I didn't find + it. From Alan Carvalho de Assis. + + * Tools: + + - tools/: Add tools/showsize.sh. + + * NSH: apps/nshlib: + + - NSH: dd command will show statistics. From Masayuki Ishikawa. + + * Applications: apps/system: + + - apps/system/sched_note: Extend to include additions to instumentation + for SMP. + - apps/system/sched_note: Add support for spinlock notes. + - apps/system/sched_note: Add support for new scheduler instrumentation. + + * Platforms: apps/platform: + + - ESP32 Core v2: Add platform support for the ESP32 core v2 board. + - Olimex STM32-p407: Add platform support for the Olimex STM32 P407. + + * Graphics: apps/graphics + + - graphics/traveler/tcledit and libwld: Add an X11 Tcl/Tk tool that can + be used to edit Traveler world files. + - Graphics: Remove all NX server taks. Instead, call boardctl() to the + NX server kernel thread. + + * Applications: apps/examples: + + - examples/buttons: Add a new buttons example that uses the button + character driver instead of the architecture buttons directly. From + Alan Carvalho de Assis. + - examples/cctype: Add an example to verify cctype functions. + - Remove RGMP example. + - examples/ostest: Extend the pthread cancellation test to exercise + pthread_cleanup_push() (and pthread_cleanup_pop() indirectly via + pthread_cancel() and pthread_exit(). + - examples/ostest: enhance pthread cancellation test some. + +Works-In-Progress: + + * IEEE802.14.5/6LowPAN. Hooks and framework for this effort were + introduced in NuttX-7.15. Work has continued on this effort on + forks from the main repositories, albeit with many interruptions. + The completion of this wireless feature will postponed until at + least NuttX-7.20. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - sched/semaphore: Within the OS, when a thread obtains a semaphore + count it must call sem_addholder() if CONFIG_PRIORITY_INHERITANCE is + enabled. If a count is available, then sem_wait() calls + sem_addholder(), otherwise it waited for the semaphore and called + sem_addholder() when it eventually received the count. This caused a + problem when the thread calling sem_wait() was very low priority. + When it received the count, there may be higher priority threads + "hogging" the CPU that prevent the lower priority task from running + and, as a result, the sem_addholder() may be delayed indefinitely. + The fix was to have sem_post() call sem_addholder() just before + restarting the thread waiting for the semaphore count. This problem + was noted by Benix Vincent who also suggested the solution. + - Many files: Make sure that priority inheritance is not enabled for + semaphores whose primary use is signaling (vs locking of resources) by + calling sem_setprotocol(). + - sched/semaphore: sem_trywait() no longer modifies the errno value + UNLESS an error occurs. This allows these functions to be used + internally without clobbering the errno value. From Freddie Chopin. + - sched/clock: Correct clock initialization. The correct range for the + month is 0-11 but is entered as 1-12 in the .config file. Add ranges + to START_YEAR, MONTH, and DAY in sched/Kconfig. + - sched/clock: Correct calculation for the case of Tickless mode with a + 32-bit timer. In that case, the calculation was returning millisecond + accuracy. That is not good when the timer accuracy is < 1 msec. From + Rajan Gill. + - Work Queue: When queuing new LP work, don't signal any threads if + they are all busy. From Heesub Shin. + - Work Queue: Signal sent from work_signal() may interrupt the low + priority worker thread that is already running. For example, the + worker thread that is waiting for a semaphore could be woken up by the + signal and break any synchronization assumption as a result. It also + does not make any sense to send signal if it is already running and + busy. This change fixes it. From Heesub Shin. + - Fix DEBUGASSERT() in group_signal.c. From Masayuki Ishikawa. + - Eliminate bad boardctl() commands: Remove all references to + BOARDIOC_PWMSETUP and board_pwm_setup(). Remove all references to + BOARDIOC_ADCSETUP and board_adc_setup(). Remove + BOARDIOC_CAN_INITIALIZE. CAN initialization is now done in the board + initialization logic just like every other device driver. + - pthreads: Fix an error in pthread_mutex_destroy(). An error could + occur while destroying a mutex after a pthread has been canceled while + holding the mutex. + - task_restart: Make sure new task starts with pre-emption disabled and + not in a critical section. + - Enter/leave Critical Sections. Major redeign to + enter/leave_critical_section logic to deal with the case where + interrupts are disabled only on the local CPU. In this case, some + rather complex spinlocks must be used to maintain the critical section + accross all CPUs. + - SMP Critical Sections: Fixes for the SMP case: (1) Change order for + SMP case in enter_critical_section: (1) Disable local interrupts + BEFORE taking spinlock and (2) If SMP is enabled, if any interrupt + handler calls enter_critical_section(), it should take the spinlock. + - SMP wdogs: Wdog timers use a tasking interface that to manipulate + wdogs, and a different interface in the timer interrupt handling logic + to manage wdog expirations. In the single CPU case, this is fine. + Since the tasking level code calls enter_critical_section, interrupts + are disabled and no conflicts can occur. But that may not be the case + in the SMP case. Most architectures do not permit disabling + interrupts on other CPUs so enter_critical_section must work + differently: Locks are required to protect code. this change adds + locking (via enter_critical section) to wdog expiration logic for the + the case if the SMP configuration. + - SMP vfork(): Fix a race condition in the SMP case. Existing logic + depended on the fact that the child would not run until waitpid was + called because the child had the same priority as the parent. BUT in + the SMP case that is not true... the child may run immediately on a + different CPU. + - SMP: This change adds a new internal interfaces and fixes a problem + with three APIs in the SMP configuration. The new internal interface + is sched_cpu_pause(tcb). This function will pause a CPU if the task + associated with 'tcb' is running on that CPU. This allows a different + CPU to modify that OS data stuctures associated with the CPU. When + the other CPU is resumed, those modifications can safely take place. + The three fixes are to handle cases in the SMP configuration where one + CPU does need to make modifications to TCB and data structures on a + task that could be running running on another CPU. Those three cases + are task_delete(), task_restart(), and execution of signal handlers. + In all three cases the solutions is basically the same: (1) Call + sched_cpu_pause(tcb) to pause the CPU on which the task is running, + (2) perform the necessary operations, then (3) call up_cpu_resume() to + restart the paused CPU. + - SMP: Add logic to avoid a deadlock condition when CPU1 is hung waiting + for g_cpu_irqlock with interrupts interrupts and CPU0 is waiting for + g_cpu_paused. + - SMP: Enforce this rule: Tasks which are normally restored when + sched_unlock() is called must remain pending (1) if we are in a + critical section, i.e., g_cpu_irqlock is locked , or (2) other CPUs + still have pre-emption disabled, i.e., g_cpu_schedlock is locked. In + those cases, the release of the pending tasks must be deferred until + those conditions are met. + + * File System/Block Drivers/MTD Drivers: + + - AT24XX EEPROM MTD driver: Added EEPROM timeout. Fromo Aleksandr + Vyhovanec. + - fs/procfs: Fix procfs status for SMP case. + + * Graphics/Graphic Drivers: + + - Fonts: Correct some default font IDs. From Pierre-Noel Bouteville. + + * Common Drivers: + + - usbhost/enumerate: Fix possible buffer overwrite. From Janne Rosberg. + - usbhost/composite: Fix compile; missing semicolons. From Jann Rosberg. + - syslog: Fixes required for file syslog output. From Max Kriegleder. + - SPI configuration: Fix Kconfig warning. This change moves the + ARCH_HAVE_SPI options outside the check for SPI. Those options don't + depend on SPI, and Kconfig files in arch/ enable them even if SPI + isn't enabled. Source the driver's Kconfig in drivers/Kconfig only + if support for the driver is enabled prevents us from defining these + ARCH_HAVE options in the driver's Kconfig. We should probably remove + the other checks in drivers/Kconfig and check if the drivers are + enabled only in their Kconfig. From Paul A. Patience. + - drivers/timer: Remove the timer driver TIOC_SETHANDLER IOCTL call. + This calls directly from the timer driver into application code. That + is non-standard, non-portable, and cannot be supported. Instead, add + timer driver hooks to support signal notification of timer + expiration. Signal notification logic added by Sebastien Lorquet. + - All timer lower half drivers. Port Sebastien's changes to all other + implementations of the timer lower half. + - USB MSC Device: Fix length of mode6 sense reply packet. From + Wolfgang Reinegger. + - USB Composite Host: Fix end offset in usbhost_copyinterface(). From + Janne Rosberg. + - USB CDC/ACM Host: Add CDC_SUBCLASS_ACM and CDC_PROTO_ATM to + supported class and proto. From Janne Rosberg. + - SSD1306: Fix errors in SPI mode configuration. From Gong Darcy. + - CDC/ACM Device Class: uart_ops_s portion of cdcacm will not be + initialized with correct functions if CONFIG_SERIAL_DMA is selected. + + * Networking/Network Drivers: + + - drivers/net/tun.c: Fix bug in TUN interface driver. From Max Nekludov. + + * ARMv7-A: + + - ARMv7-A SMP: Add SMP logic to signal handling. + + * ARMv7-M: + + - ARMv7-M: Fix double allocation of MPU region in mmu.h. + + * ARMv7-R: + + - ARMv7-R: Fix compilation error. This change fixes compilation errors + on MPU support for ARMv7-R. From Heesub Shin. + - ARMv7-R: fix invalid drbar handling. In ARMv7-R, [31:5] bits of DRBAR + is physical base address and other bits are reserved and SBZ. Thus, + there is no point in passing other than the base address. From Heesub + Shin. + - ARMv7-R: Remove the redundant update on SCTLR. mpu_control() is + invoking cp15_wrsctlr() around SCTLR update redundantly. From Heesub + Shin. + - ARMv7-R: Add new Kconfig entries for D/I-cache. Unlike in ARMv7-A/M, + Kconfig entries for data and instruction caches are currently missing + in ARMv7-R. This change adds those missing Kconfig entries. Actual + implmenetation for those functions will be added in the subsequent + patches. From Heesub Shin. + - ARMv7-R: Add cache handling functions. This change adds functions for + enabling and disabling d/i-caches which were missing for ARMv7-R. + From Heesub Shin. + - ARMv7-R: Fix typo in mpu support. s/ARMV7M/ARMV7R/g. From Heesub Shin. + - ARMv7-R: Fix CPSR corruption after exception handling. A sporadic + hang with consequent crash was observed when booting. It seemed to be + caused by the corrupted or wrong CPSR restored on return from + exception. NuttX restores the context using code like this: msr spsr, + r1. GCC translates this to: msr spsr_fc, r1. As a result, not all + SPSR fields are updated on exception return. This should be: msr + spsr_fsxc, r1. On some evaluation boards, spsr_svc may have totally + invalid value at power-on-reset. As it is not initialized at boot, the + code above may result in the corruption of cpsr and thus unexpected + behavior. From Heesub Shin. + - ARMv7-R: Fix to restore the Thumb flag in CPSR. Thumb flag in CPSR is + not restored back when the context switch occurs while executing thumb + instruction. From Heesub Shin. + + * Atmel SAM3/4 Drivers: + + - SAM3/4 UDP: Add delay between setting and clearing the endpoint RESET + bit in sam_ep_resume(). We need to add a delay between setting and + clearing the endpoint reset bit in SAM_UDP_RSTEP. Without the delay + the USB controller will (may?) not reset the endpoint. If the + endpoint is not being reset, the Data Toggle (DTGLE) bit will not to + be cleared which will cause the next transaction to fail if DTGLE is + 1. If that happens the host will time-out and reset the bus. Adding + this delay may also fix the USBMSC_STALL_RACEWAR in usbmsc_scsi.c, + however this has not been verified yet. From Wolfgang Reinegger. + - SAM3/4: Remove unused 'halted' flag from UDP driver. From Wolfgang + Reinegger. + - SAM3/4: Remove 'stalled' flag from the UDP driver. This flag is not + necessary because the state of the endpoint can be determined using + 'epstate' instead. From Wolfgang Reinegger. + + * Atmel SAM3/4 Boards: + + - SAM4S Xplained Pro: Configuration uses old, improper timer interface. + CONFIG_TIMER disabled in configuration. Remove obsolete timer + initialization logic. + + * Atmel SAMV7 Drivers: + + - SAMv7 USBDEVHS: A problem occurred with the SAMV7 USBDEVHS driver if + the USB cable is unplugged while a large amount of data is send over + an IN endpoint using DMA. If the USB cable is plugged in again after a + few seconds it is not possible to send data over this IN endpoint + again, all other endpoints work as expected. The problem occurs + because if the USB cable is unplugged while an DMA transfer is in + flight the transfer is canceled but the register SAM_USBHS_DEVDMACTRL + is left in an undefined state. The problem was fixed the problem by + resetting the register SAM_USBHS_DEVDMACTRL to a known state. + Additionally all pending interrupts are cleared. From Stefan Kolb. + - SAMV7 MCAN: Prevent Interrupt-Flooding of ACKE when not connected to + CAN-BUS. An Acknowledge-Error will occur every time no other CAN Node + acknowledges the message sent. This will also occur if the device is + not connected to the can-bus. The CAN-Standard declares, that the Chip + has to retry a given message as long as it is not sent successfully + (or it is not cancelled by the application). Every time the chip tries + to resend the message an Acknowledge-Error-Interrupt is generated. At + high baud rates this can lead in extremely high CPU load just for + handling the interrupts (and possibly the error handling in the + application). To prevent this Interrupt-Flooding we disable the ACKE + once it is seen as long we didn't transfer at least one message + successfully. From Frank Benkert. + - SAMV7 MCAN: Make delete_filter functions more robust. From Frank + Benkert. + + * Atmel SAMA5 Drivers: + + - SAMA5 PWM: Driver does not build when executing from SDRAM before + board frequencies are not constant. Rather, the bootloader configures + the clocking and we must derive the clocking from the MCK left by the + bootloader. This means lots more computations. This is untested on + initial change because I don't have a good PWM test setup right now. + + * Misoc LM32: + + - Misoc LM32: Corrects a bug that never occured in qemu on simulation or + real fpga. The error was that the r1 register was being modified out + of context switching and not restoring it. From Ramtin Amin + + * NXP Freescale i.MX6: + + - i.MX6 interrupt handling: Additional logic needed to handle nested + interrupts when an interrupt stack is used. Nesting can occur because + SGI interrupts are non-maskable. + + * NXP Freescale LPC43xx Drivers: + + - LPC43xx serial: Fix a typo in ioctl TIOCSRS485 ioctl. From Vytautas + Lukenskas. + - LPC43xx serial: Restore RS485 mode on serial port open (if RS485 is + enabled via menuconfig). From Vytautas Lukenskas. + - LPC43xx SD/MMC: Correct some definitions on SMMC control register in + lpc43_sdmmc.h. From Alan Carvalho de Assis. + - LPC43xx SD card: Correct pin configuration options needed for SD card + pins. From Alan Carvalho de Assis. + + * SiLabs EFM32: + + - EFM32: Fix a compilation error. From Pierre-noel Bouteville. + + * STMicro STM32 Drivers: + + - STM32 CHxN channels are always outputs. From Sebastien Lorquet. + - STM32 DAC: Fix shift value whenever there are is a DAC2 and, hence, + up to three interfaces. From Marc Recht. + - STM32 F1: Add TIM8 to STM32F103V pinmap. From Maciej Wjcik. + - STM32 F1: Fix for F1 RTC Clock, tested on F103. From Maciej Wjcik. + - STM32 F3: STM32F303xB and STM32F303xC chips have 4 ADCs. From Paul + A. Patience. + - STM32 F4: A new implementation of the STM32 F4 I2C bottom half. The + common I2C as this did not handled correctly in the current + implementation (see also https://github.com/PX4/NuttX/issues/54). The + changes almost exclusively affect the ISR. From Max Kriegleder. + - STM32 F4 OTGHS Host: If STM32F446 increase number of channels to + 16. From Janne Rosberg. + - STM32 F4: I think, that Size is (highest address+1 - Base address). + Base address has been removed and if address+count >= size we are + outside of the Flash. From David Sidrane. + - STM32 F4: Fix ADC compilation error when DMA isn't enabled. From Paul + A. Patience. + - STM32 F4: STM32F427 was rebooting. Over reached family. From David + Sidrane. + - STM32 F4: Added STM32F469 RAM size and deliberated STM32F446 size. + From David Sidrane. + - STM32 F4: Typo in stm32f76xxxx_pinmap.h edited online with + Bitbucket. From David Sidrane. + - STM32 F7: stm32_i2c.c Dejavu. Fixes a bug previously found in the + F4. From David Sidrane. + - STM32 F7: OTGDEV fixed typo. From David Sidrane. + - STM32 F7: Fix to SPI-Master driver. Without this the chip select + decoding feature will not work properly. From Michael Spahlinger. + - STM32 F7: STM32F7 SD/MMC driver depends on CONFIG_SDIO_DMA which is + only defined in stm32/Kconfig. Changed to CONFIG_STM32F7_SDMMC_DMA + and defined in stm32f7/Kconfig. + - STM32 F7: Fix some STM32F7 copy paste errors. From David Sidrane. + - STM32 L4: Complementary PWM outputs on STM32L4" (1) too many + parentheses when calculating max chan count and (2) channel 4 does not + have a complementary output. From Sebastien Lorquet. + - STM32 L4: Fix I2C devices RCC registers. From Sebastien Lorquet. + - STM32 L4: Enable and renaming for 32l4 UARTs 4 and 5. From Sebastien + Lorquet. + - STM32 L4: Change the way to configure quadrature encoder prescalers. + From Sebastien Lorquet. + - STM32 L4: Correct USART1/2 definitions. Use default mbed UART4 + settings. From Sebastien Lorquet. + + * STMicro STM32 Boards: + + - STM32F103 Minimum: Fix Timers 2 to 7 clock frequencies. From Alan + Carvalho de Assis. + - Nucleo-F303RE: Remove duplicate setting from board.h. From Marc + Recht. + - Nucleo F303RE: Various fixes to get the ADC configuration building + again after PR. Refresh all configurations. + - Nucleo L476RG: Add better selection of timer. + + * TI Tiva Boards: + + - DK-TM4C129x: Typo fix. From Wolfgang Reinegger. + + * Xtensa ESP32: + + - ESP32 core v2: Flush the UART TX buffer in the esp32 serial shutdown + routine. The ROM bootloader does not flush the FIFO before handing + over to user code, so some of this output is not currently seen when + the UART is reconfigured in early stages of startup. From Angus + Gratton. + - Xtensa ESP32: Corrects a problem with dispatching to signal + handlers: Cannot vector directly to the signal handling function as + in other ABIs under the Xtensa Window ABI. In that case, we need to + go through a tiny hook when performs the correct window call (call4) + otherwise registers will be scrambled in the signal handler. + + * Xtensa ESP32 Boards: + + - ESP32 core v2: Changes the openocd config file's default flash + voltage from 1.8V to 3.3V. This is not necessary right now, but may + save some hard-to-debug moments down the track (3.3V-only flash + running at 1.8V often half-works and does weird things...). From + Angus Gratton. + + * C Library/Header Files: + + - libc/stdio: Fixes sscanf() %sn where strlen(data) < n. From David + Sidrane. + - libc/stdio: Include wchar.h in lib_libvsprintf.c to fix compilation + error. From Alan Carvalho de Assis. + - include/sys/time.h: timersub macro modified per recommendations of + phreakuencies. + - include/ctype.h and cxx/cctype: Implement ctype.h functions as inline + if possible. cctype can then properly select namespace. + - include/: Fix a number of header files with mismatched 'extern C {' + and '}'. + - libc/unisted: Change brings strtol() and related functions more + conformant with POSIX. Corner cases like strtol(-2147483648, NULL, + 10) now pass clang -fsanitize=integer without warnings. From Juha + Niskanen. + - libc/unistd: sleep() was returning remaining nanoseconds (kind of), + instead the remaining seconds. From Eunbong Song. + - termios.h: Fix CRTSCTS define to include input and output flow. From + Lorenz Meier. + + * Build/Configuration System: + + - configs/*/defconfig: The buttons example was changed to archbuttons. + As a result all of the button configurations are broken and need some + renaming in the defconfig files. Noted by Frank Berkert. + - config/*/defconfgs: More fallout from name change of + apps/examples/buttons to archbuttons. + - configs: All QE encoder files. Last change made timer hard-coded to + 3. Make configurable. + - configs: Remove all traces of the no-longer existent ARCHBUTTONS + example. Remove all button configurations that depended on the + obsoleted ARCHBUTTON example. + - minnsh Configurations: Remove minnsh configurations and support + logic: up_getc() and lowinstream. This was an interesting exercise + to see just how small you could get NuttX, but otherwise it was not + useful: (1) the NSH code violated the OS interface layer by callup + up_getc() and up_putc() directly, and (2) while waiting for character + input, NSH would call up_getc() which would hog all of the CPU. Not a + reasonable solution other than as a proof of concept. + + * Application Build/Configuration System: + + - Make.defs: Using wrong link script if native window tool used with + Cygwin. + + * apps/platform: + + - ESP32 Core v2 Platform: Fix some naming that prevented building the + C++ support. + + * apps/nshlib: + + - NSH Library: nsh_getdirpath(), use snprint instead of sprintf to + avoid possibility of buffer overrun. Noted by Chung Hwan Kim. + + * apps/system: + + - Remove std_readline(). This called up_getc() and up_putc() directly, + violating the POSIX OS interface. + + * apps/netutils: + + - FTPD: Fixed bug that didn't free ftpd ressources on exit. From Pascal + Speck. + - NTP client: Fix missing left parenthesis. From Pierre-Noel Bouteville. + - cJSON: Import patch to fix:cJSON_PrintUnformatted() behaves unexpected + if an empty array shall be printed to text. from Jerome Lang + 2012-04-19. From Pierre-Noel Bouteville. + - esp8266 update cosmetic and many bug fix. From Pierre-Noel Bouteville. + - FTPD: Fix bug un ftpd file or socket may be not closed. From + Pierre-Noel Bouteville. + + * apps/modbus: + + - Modbus Master is missing many files and doesn't compile at all. More + details in + https://groups.yahoo.com/neo/groups/nuttx/conversations/topics/13734. + From Vytautas Lukenskas. + + * apps/examples: + + - The examples/qencoder app was trying to init the encoder by a direct + call into the board, cheating in a local header to declare the + normally unavailable function prototype. From Sebastien Lorquet. + - apps/examples/timer: Should detach signal handler before exiting. + - examples/qencode: The examples/qencoder app was trying to init the + encoder by a direct call into the board, cheating in a local header to + declare the normally unavailable function prototype. From Sebastien + Lorquet. + - apps/examples/archbuttons: Removed becaue it violates OS interface + principles. + - examples/adc, pwm, can: Remove all usage of BOARDIOC_ADCTEST_SETUP, + BIOARDIOC_PWMSETUP. Remove BOARDIOC_CAN_INITIALIZE. CAN + initialization is now done in the board initialization logic just like + every other device driver. + - examples/ostest: Add some delays to the pthread cancellation test. + With deferred cancellation enabled, things happen more asynchronously. + +NuttX-7.20 Release Notes +------------------------ + +The 120th release of NuttX, Version 7.20, was made on March 8, 2017, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.20.tar.gz and +apps-7.20.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - Kernel Modules: Module initializer may now return a symbol table. + - Modules: Extend the module interface so that we can access symbols + exported by the module. + - Shared Libraries: In the FLAT build mode, kernel modules may be + used to provide minimal shared library functionality. + - Modules/Shared Libraries: Add support for dependencies between + modules. + - Module Library: Add build a configuration logic for a shared module + library. + - Shared Libraries: Implement module based shared libraries for the + PROTECTED mode build. + - Interrupt handling: irq_attach() now includes an argument of type + xcpt_t that retained with the handler address. That argument is + then provided to the interrupt handler when the interrupt occurs. + The common parameter passing replaces the ad hoc parmater passing + implemented in current drivers. From Mark Schulte. + - Adapt many drivers to utilize the IRQ argument feature. + - All functions that used to return an xcpt_t old handler value, now + return an int error code. The oldhandler value is no longer useful + with the recent changes to the interrupt argument passing. Some of + the functions effected include board_button_irq(), arch_phy_irq(), + STM32 EXTI functions (Alarm, COMP, PVD), GPIO interrupt logic like + kinetis_pinirq(), stm32_gpiosetevent(), and others. + - IRQ subsystem: Add support for smaller interrupt tables as + described at + http://www.nuttx.org/doku.php?id=wiki:howtos:smallvectors . This + is partially the work of Mark Schulte. + + * File Systems/Block and MTD Drivers + + - Pseudo File System: Add support for soft links in the top-level + pseudo file system. + - Soft links: Add an implementation of readlink(). + - Add fstat() support. Implement fstat() method in binfs, romfs, + unionfs, tmpfs, nxffs, nfx, hostfs, procfs, and smartfs. + - fstat: Add fstat() support to FAT. From Alan Carvalho de Assis. + + * Graphics/Display Drivers: + + - Fonts: Add support for Tom Thumb small mono-space font. From Alan + Carvalho de Assis. + - Graphics: Separated of font cache from graphics/nxterm. Now in + libnx/nxfronts where it can be shared with other grapics + applications. + + * Networking/Network Drivers: + + - Ethernet drivers: Add framework for serialization in the case where + multiple low-priority work queues are used. + + * Other Common Device Drivers: + + - Add capabilities() method to SDIO interface. Remove + CONFIG_SDIO_WIDTH_D1_ONLY. That should not be a global propertie, + but rather a capability/limitation of single slot when there may be + multiple slots. + - Removed dmasupported() method from the SDIO interface. That is now + a bit in the capability set. + - drivers/sensors: Add driver for the ST L3GD20 3 axis gyro. From + raiden00. + + * Atmel SAM3/4: + + - SAM3/4: Add support for ATSAM4S4C. From Wolfgang Reinegger. + + * NXP Freescale i.MX6 Boards: + + - Sabre 6quad: Enable examples/smp test in i.MX6 SMP/NSH + configurations. + + * NXP Freescale Kinetis: + + - Kinetis: Added support for CHIP_MK60FN1M0VLQ12 chip. From Maciej + Skrzypek. + - Kinetis: Add support for K64/K66 RTC lower half driver. From Neil + Hancock. + - Kinetis: Extensive modification of MCG support based feature + configuration. From David Sidrane. + - Kinetis: Add support for K66 family. From David Sidrane. + - Kinetis: Created a kinetis SIM versioning scheme pulled in by + Kinetis chip.h. From David Sidrane. + - Created a kinetis PMC versioning scheme pulled in by Kinetis + chip.h. From David Sidrane. + - Kinetis: Extend clock configuration logic. Refactor + implementation. From David Sidrane. + + * NXP Freescale Kinetis Drivers: + + - Kinetis Ethernet: Kinetis Support RMII clock source select. This + defined the RMII clock source select bits and allows the selection + to be made via Kconfig. From David Sidrane. Freedom-K66F uses + ENET_1588_CLKIN as RMII clock + - Kinetis Serial: Added configurable 1|2 stop bits. + HAVE_SERIAL_CONSOLE -> HAVE_UART_CONSOLE to be consistent with + HAVE_LPUART_CONSOLE naming. From David Sidrane. + - Kinetis LPserial: Add LPUART serial driver and Clock + configuartaion to freedom-k66f board. From David Sidrane. + - Kinetis USB device: Refactor clocking in kinetis_usbdev. From + David Sidrane. + + * NXP Freescale Kinetis Boards: + + - Add support for NXP Freedom-k66f development board. From David + Sidrane. + - Kinetis Freedom K66F: Add Ethernet support. From David Sidrane. + - Add twr-k64f120m config. From Marc Recht. + + * NXP Freescale LPC43xx Boards: + + - Bamboo-200E: Add netnsh configuration. From Alan Carvalho de Assis. + - Add usbnsh config to Bambino 200E board. From Alan Carvalho de + Assis. + + * STMicro STM32: + + - STM32 F7: Allow board to configure HSE clock in bypass-mode. This + is needed to enable HSE with Nucleo-F746ZG board. From Jussi + Kivilinna. + - STM32 F7: stm32_allocateheap: allow use DTCM memory for heap. + STM32F7 has up to 128KiB of DTCM memory that is currently left + unused. This change adds DTCM to main heap if + CONFIG_STM32F7_DTCMEXCLUDE is not enabled. From Jussi Kivilinna. + - Add basic support for the STM32F334. From Mateusz Szafoni. + - STM32F33XX DAC, OPAMP, COMP, ADC, HRTIM headers. From Mateusz + Szafoni. + + * STMicro STM32 Drivers: + + - STM32 F7 SDMMC: Add support for single bit operation on SDMMC2. + - STM32 L4: Port STM32L4 SAI driver from MDK. + - STM32 L4: Bring power management logic from Motrola MDK into NuttX. + - STM32 L4: Bring LPTIM driver in from the Motorola MDK. + - STM32 L4 COMP: Port from Motorola MDK. + + * STMicro STM32 Boards: + + - STM32F429i Discovery: Add support for NxWM on STM32F429i-Disco + board. From Alan Carvalho de Assis. + - STM32F103 Minimum: Add support for nRF24 on STM32F103-Minimum + board. From Alan Carvalho de Assis. + - Olimex STM32 P407: Add a NSH protected build configuration; Enable + procfs/ in all configurations. + - Olimex STM32 P407: Add support for on-board microSD slot. + - STM32F429i Discovery: Add support for the L3GD20 driver. From + raiden00. + - STM32F103 Minimum: Add support to QEncoder on STM32F103 Minimum + board. From Alan Carvalho de Assis. + - Olimex STM32 P407: Add external SRAM support. + - Add basic support for the Nucleo F334R8 board. From Mateusz + Szafoni. + - STM32F103 Minimum: Add SDCard support over SPI on STM32F103-Minimum + board. From Alan Carvalho de Assis. + - STM32F103 Minimum: Add support to USB Device on STM32F103-Minimum + board. From Alan Carvalho de Assis. + + * C Library/Header Files: + + - compiler.h: packed_struct replaced by begin_packed_struct and + end_packed_struct. Now support IAR style packed structures. From + Aleksandr Vyhovanec. + - Math library: Leverage optimized ARMv8-M functions from BSD license + ARM file. + - Shared libraries: Add a non-standard dllfnc.h function to set the + symbol table. + - C Library: Add a support for setvbuf(). This is a collaborative + effort. Alan Carvalho de Assis did the initial prototype. + - C Library: Add setbuf() which is a trivial wrapper around setvbuf(). + - C library: Add swab(). + - C library: Add strtoimax and strtoumax. + - C library: Add ffs(), rindex(), an index(). Add strings.h. Move + strcasecmp, strncasecmp, bzero, bcmp, and bcopy to where they + belong in strings.h.h, not string.h. bzero, bcmp, and bcopy are + legacy functions; the contemporary counterparts should be used + instead. + - C library: Add fstatfs(). + - Update cwchar. Add cwctype. + + * Build/Configuration System: + + - Add configuration support for builds with Ubuntu under Windows 10. + + * Tools: + + - tools/noteinfo.c: A hack tool that I use to analyze some sched_note + output. Needs a home and may be useful to others. + - tools/mkconfig.c: Add logic to keep all of the buffering options in + sync. + + * NSH: apps/nshlib: + + - NSH: Add support for the 'ln' command. + - NSH ls command: if node is a symobolic link, use readlink() to get + and the display the target of the symblic link. + - NSH: Add readlink command. + + * Applications: apps/examples: + + - apps/examples/nxtext: Make line spacing configurable. + - apps/system/zmodem/host/nuttx/compiler.h synchronized with + nuttx/nuttx/include/nuttx/compiler.h. From Aleksandr Vyhovanec. + - apps/examples/sotest: Add a test for shared libraries. + - apps/examples/ostest: Add a test of setvbuf(). + - apps/examples/stat: Add a simple test for stat(), fstat(), + statfs(), and fstatfs(). + +Works-In-Progress: + + * IEEE802.14.5/6LowPAN. Hooks and framework for this effort were + introduced in NuttX-7.15. Work has continued on this effort on + forks from the main repositories, albeit with many interruptions. + The completion of this wireless feature will postponed until at + least NuttX-7.21. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - SMP: There were certain conditions that we must avoid by preventing + the release of the pending tasks while withn a critical section. + But this logic was incomplete; there was no logic to prevent other + CPUs from adding new, running tasks while on CPU is in a critical + section. This commit corrects this. This is matching logic in + sched_addreadytorun to avoid starting new tasks within the critical + section (unless the CPU is the holder of the lock). The holder of + the IRQ lock must be permitted to do whatever it needs to do. + - SMP: Make checks for CPU lock set more robust. There are certain + conditions early in initialization on during interrupt handling + where things need to be done a little differently. + - sched_cpulocked: Avoid use of spinlock. That has been reported to + cause a deadlock (2016-12-28). + - SMP: Fix a gap where we may try to make modifications to the task + lists without being in a critical sections. That permits + concurrent access to the tasks lists and many subtle problems. + This fix just remains in the critical section throughout the + operation (and possible until the task is restore in the event of a + context switch). Makes a big difference in stability. + - SMP: Fix an error in critical section logic when performing a + context switch from an interrupt handler. The g_cpu_irqset bit was + not being set for the CPU so other CPUs did not know about the + critical section. + - SMP Signals: Fix some SMP signal delivery logic. Was not handling + some critical sections correctly and was missing logic to signal + tasks running on other CPUs. + - SMP: Fix timer related issues: Round robin and sporadic + scheduling were only being performed for tasks running on the CPU + that processes the system timer interrupt. Similary, CPU load + measurements were only be processed for running on the CPU that + receives the sampling interrupt. + - sched_note: Fix spinlock instrumentation. From Masayuki Ishikawa. + - In all implementations of _exit(), use enter_critical_section() vs. + disabling local interrupts. + - sigtimedwait: When timer expires, up_unblock_task() is called. + This is okay in the single CPU case because interrupts are disable + in the timer interrupt handler. But it is insufficient in the SMP + case. enter_ and leave_critical_section() must be called in order + to manage spinlocks correctly. + - Fix a compile error: in sched_cpuload.c:Line136, the variables ts + and secs are not defined if CONFIG_CPULOAD_ONESHOT_ENTROPY = 0. + However, these variables are used regardless of + CONFIG_CPULOAD_ONESHOT_ENTROPY at lines~180:onwards. From Rajan Gill. + - CPU load: Correct computation of the nominal period to use when the + source is a oneshot timer. + - Cancellation points: Fix some backward logic in conditional + compilation. + - Remove an unused variable when calling sigwaitinfo() and + sigtimedwait(). From Masayuki Ishikawa. + + * File System/Block and MTD Drivers: + + - procfs: Correct to snprintf-related errors in fs_procfsproc.c. + Resolves issue #24. + - Add logic to VFS rename: If target of rename exists and is a + directory, then the source file should be moved 'under' the target + directory. POSIX also requires that if the target is a file, then + that old file must be deleted. + - Fix open() a block device with + CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y. From Masayuki Ishikawa. + - File System: Don't build block driver proxy if PSEUDOFS_OPERATIONS + are disabled. + - sendfile(): Fix error introduced with commit + ff73be870e38959b0aaee5961dc47b4b58dc2d86. Noted by Maciej Wjcik. + + * Graphics/Graphic Drivers: + + - NxWM configurations. If using a 7-bit character set, then the + cursor character cannot be 137 (graphic block). Use 95 + (underscore) instead. + - NX server: Correct message queue names. Should not be at /dev, + but rather relative to /var/mqueue. + + * Common Drivers: + + - MMCSD_SDIO: Only wait for card ejected if card detection is + supported. From Alan Carvalho de Assis. + - Typos withim mtd/ with Macronix MX25L. In + NuttX/drivers/mtd/Make.defs letters X between M and 25 are + missing. Noted by Oleg Evseev. + - USBMSC: Always set LUN readonly flag. From Wolfgang Reinegger. + - drivers/lcd: ssd1306_configspi() must have global scope. + - MMC/SD SDIO: Some drivers need to start DMA before sending CMD24 + and some AFTER. From Alan Carvalho de Assis. + - drivers/tone.c: Handle configuration with multiple PWM channels. + This resolves issue #30: Audio Tone Generator and PWM Multiple + Output Channel options. + - drivers/tone.c: 50% duty needs to be expressed a a fixed precision + number. + - drivers/spi/Kconfig: There is too much SPI in the configuration + menu; SPI Driver Support menu is empty. From Maciej Wjcik. + - option to enable Memory Card debug output was hidden with SD cards + connected through SPI. From Maciej Wjcik. + - usbhost_cdcacm: fix tx outbuffer overflow and remove now invalid + assert. From Janne Rosberg. + + * Networking/Network Drivers: + + - Networking: Fixed some issues that prevented IPv6 from working with + IPv4 enabled. From Pascal Speck. + - Networking: fixed a nullptr-dereference on iob_clone. From Pascal + Speck. + - Ethernet: Need two work structures (minimum) in all Ethernet + drivers so that pending poll work is not lost when an interrupt + occurs. + + * ARMv7-R: + + - I found an issue inside the cp15_coherent_dcache function: The + "mcr CP15_BPIALLIS(r0)" should only be used with SMP + configurationa. In non-SMP configuration this instruction could + become undefined. From Manohara HK. + + * Atmel SAM3/4 Drivers: + + - SAM3/4: GPIO bit numbering typo fixes. From Wolfgang Reinegger. + + * Atmel SAM3/4 Boards: + + - Add missing sched_note_*() calls in sam4cm SMP functions. + + * NXP/Freescale Kinetis: + + - Kinetis: Fixed wrong MCG VDIV calculation on new NXP K60. From + Maciej Skrzypek. + - Kinetis: Need to set HAVE_UART_DEVICE when UART4 is selected. From + Maciej Skrzypek. + - Kinetis MCG: Wrong FRDIV set in MCG_C1. From Maciej Skrzypek. + + * NXP/Freescale Kinetis Drivers: + + - Kinetis Serial: Fixed compile error when UART5 is selected. From + Maciej Skrzypek. + - Kinetis SDHC - Enable clock after selected. From David Sidrane. + - Kinetis: Correct some SPI and I2C configuration issues. From + David Sidrane. + - Kinetis Ethernet: Add #define for number of loops for auto + negotiation to complete. From Marc Recht. + - Kinetis Werial: Fixed up_rxint - did not disable the RX + interuppts. There was an OR where and AND NOT was needed. From + David Sidrane. + + * NXP/Freescale LPC43xx: + + - LPC43 pinset definitions: Add more 1 bit to pinset to reach + SFSCLK0-SFSCLK3. Remove PINCONFIG_DIGITAL. From Alan Carvalho de + Assis. + + * NXP/Freescale LPC43xx Drivers: + + - LPC43 serial: Correct conditional logic that selects /dev/ttySN. + Problem noted by Alan Carvalho de Assis. + + * NXP/Freescale i.MX6: + + - i.MX6: Fix clearing GPT status register. From Masayuki Ishikawa. + + * STMicro STM32: + + - STM32, STM32L4 Oneshot: Fix logic so that it can support multiple + oneshot timers. + - STM32 F7: Added missing ARCH_HAVE_RESET for F7. From David Sidrane. + - STM32: Add missing STM32_BKP_BASE. From David Sidrane. + - STM32 and STM32F7: Fixes the BKP reference counter issue. From + David Sidrane. + + * STMicro STM32 Drivers: + + - Fix for SAMv7 SPI: DLYBS value was calculated, but never written to + any registers. This led to incorrect timings on the bus. From + Michael Spahlinger. + - STM32 QEncoder: Fix QEncoder driver, based on STM32L4 driver. From + Alan Carvalho de Assis. + - STM32 QEncoder: Enable clocking to the timer on QE setup; disable + clock on QE teardown. + - STM32 Ethernet: Need two work structures so that pending poll work + is not lost when an interrupt occurs. This change has also been + ported to all all other effected Ethernet drivers. + - STM32 OTGHS host: stm32_in_transfer() fails and returns NAK if a + short transfer is received. This causes problems from class + drivers like CDC/ACM where short packets are expected. In those + protocols, any transfer may be terminated by sending short or NUL + packet. From Janne Rosberg. Adapted Janne Rosberg's patch to + STM32 OTGHS host to OTGFS host, and to similar USB host + implementations for STM32 L4 and F7. + + * STMicro STM32 Boards: + + - STM32F4 Discovery: Fix issues with QEncoder support. From Alan + Carvalho de Assis. + + * C Library/Header Files: + + - Add debug assertion in libdtoa to catch attempts to use floating + point output formats from within an interrupt handler. That will + cause assertions or crashes downstream because __dtoa will attempt + to allocate memory. From Pierre-noel Bouteville. + - libc: Fix ARMv7-A/R memcpy assembly. + - Fix return value if x is NaN. From Aleksandr Vyhovanec. + + * apps/nshlib: + + - NSH: Eliminate a warning when all memory inspection commands are disabled. + + * apps/graphics: + + - apps/graphics/traveler/tools: Fix linkage issue. The -lm should + come after -o binname. From Alan Carvalho de Assis. + + * apps/netutils: + + - The CONFIG_NETUTILS_HTTPD_PATH constant is used by httpd_mmap.c and + httpd_sendfile.c but It was not present in Kconfig menu. From + Maciej Wjcik. + + * apps/examples: + + - Configurations that enable OSTEST must not disable signals. + - apps/examples/ostest: Was ignoring + CONFIG_EXAMPLES_OSTEST_FPUTESTDISABLE. + - In apps/examples/mtdpart/mtdpart_main.c where + CONFIG_EXAMPLES_MTDPART_NPARTITIONS defining is checked should be + #ifndef instead of #ifdef. Noted by Oleg Evseev. + +NuttX-7.21 Release Notes +------------------------ + +The 121st release of NuttX, Version 7.21, was made on June 6, 2017, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.21.tar.gz and +apps-7.21.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - pthread rwlocks: Add an implementation for read/write locks + (rwlocks) into the pthread library. These locks are writer + priority, such that if any writers come in they are given priority + for writing. From Mark Schulte. + - pthread robust mutexes: Implement robust mutex support: + pthread_mutex_lock() and trylock() will return EOWNERDEAD if the + mutex is locked by a thread that no longer exists. Add + pthread_mutex_consistent() to recover from this situation. Keep + list of all mutexes held by a thread in a list in the pthread's TCB. + When pthread exits or is cancelled, mutexes held by thread are + marked inconsistent and the highest priority thread waiting for the + mutex is awakened. There is a configuration option to (a) support + only robust mutexes, (b) support only traditional unsafe mutexes, + or (c) Support both unsafe and robust mutexes via + pthread_mutexattr_get/setrobust(). + - pthread cancellation points: Add logic to disable cancellation + points within the OS. This is useful when an internal OS function + that is NOT a cancellation point calls an OS function which is a + cancellation point. In that case, irrecoverable states may occur if + the cancellation is within the OS. From Juha Niskanen. + - clock: Add clock_resynchronize and use subseconds RTC. Add + clock_resynchronize for better synchronization of CLOCK_REALTIME and + CLOCK_MONOTONIC to match RTC after resume from low-power state. Add + up_rtc_getdatetime_with_subseconds under + CONFIG_ARCH_HAVE_RTC_SUBSECONDS to allow initializing (and + resynchronizing) system clock with subseconds accuracy RTC. From + Jussi Kivilinna. + - clock: Add new type ssystime_t for relative 64-bit ticks, change + ticks<->time conversion functions to use ssystime_t. From Jussi + Kivilinna. + - clock: Add testing for 32-bit overflow of 64-bit system timer. From + Jussi Kivilinna. + + * File Systems/Block and MTD Drivers + + - drivers/mtd/w25.c: Erase sector only if it is not in erased state. + From Jussi Kivilinna. + + * Graphics/Display Drivers: + + - drivers/lcd: Extend st7565 driver to include support for the + AQM_1248A. From Masayuki Ishikawa. + - drivers/lcd: Add driver for Nokia 5110 (Philips PCD8544). From Alan + Carvalho de Assis. + + * Networking/Network Drivers: + + - Extensive modifications to support wireless network (see below). + - TUN driver: Implement TAP (OSI layer 2) mode. Enable by setting the + IFF_TAP flag instead of the IFF_TUN flag in ifr_flags. From Thomas + Keh. + - Add user-space networking stack API (usrsock). User-space + networking stack API allows user-space daemon to provide TCP/IP + stack implementation for NuttX network. Main use for this is to + allow use and seamless integration of HW-provided TCP/IP stacks to + NuttX. For example, user-space daemon can translate /dev/usrsock + API requests to HW TCP/IP API requests while rest of the user-space + can access standard socket API, with socket descriptors that can be + used with NuttX system calls. From Jussi Kivilinna. + - net/: Network driver now retains Ethernet MAC address in a union so + that other link layer addresses may be used in a MULTILINK + environment. + + * Wireless Networking/Wireless Drivers: + + - BCM43362: Support for Broadcom's BCM43362 WiFi chip was contributed + by Simon Piriou as part of the port of the Particle Photon board. + Only station functionality is available at present. This work + includes not on the WiFi driver, but the support Particle Photon + board, the infrasture for IEEE 802.11 FullMAC networking including + the network device interface, WiFi configuration, AP scanning and + authentication and association with an AP. + - IEEE 802.11 networking tools and support. + - IEEE 802.15.4 MAC support. This is an effort that was started some + time back by Sebastien Lorquet (with some help from Matte Poppe). + Recently, Anthony Merlino has taken on this effort and has made + some significant progress. Using the Microchip MRF24J40 module with + the Mikroe Clicker2-STM32 board along with a PC-based IEEE 802.15.4 + sniffer, Anthonly has verified correct transmittion and receipt of + basic frames. + - Microchip MRF24J40: As mentioned above, this IEEE 802.15.4 radio + driver is now basically functional. + - IEEE 802.15.4 Network Driver: A driver that interfaces the NuttX + network with the IEEE 802.15.4 MAC has been developed but is still + incomplete and has not been verified. + - IEEE 802.15.4 Network Loopback Driver: A simple IEEE 802.15.4 MAC + loopback driver was developed. This driver allowed for parallel + development of the IEEE 802.15.4 MAC and 6LoWPAN. + - 6LoWPAN: The Contiki 6LoWPAN stack has been ported so that works + within the NuttX networking framework and interfaces with the new + IEEE 802.15.4 MAC via the network driver. Live testing with + IEEE 802.15.4 radios has not yet been done; all testing has used + the loopback driver. There are no known problems and the stack + is ready for additional testing. + - Add option to enable wireless debug output. + + * Other Common Device Drivers: + + - Add entropy pool and strong random number generator. Entropy pool + gathers environmental noise from device drivers, user-space, etc., + and returns good random numbers, suitable for cryptographic use. + Based on entropy pool design from *BSDs and uses BLAKE2Xs algorithm + for CSPRNG output. Patch also adds /dev/urandom support for using + entropy pool RNG and new 'getrandom' system call for getting + randomness without file-descriptor usage (thus avoiding file- + descriptor exhaustion attacks). The 'getrandom' interface is similar + as 'getentropy' and 'getrandom' available on OpenBSD and Linux + respectively. From Jussi Kivilinna. + - XBox One controller: Adds USB host driver support for the XBox One + controller. Currently only the latest version (XBox One X) + controller works. The older XBox One controllers do not enumerate + correctly. From Brian Webb. + - drivers/analog: Add basic COMP driver. From Mateusz Szafoni. + - drivers/analog: Add driver for the LTC1767L ADC. From Martin + Lederhilger. + - drivers/analog: Add basic OPAMP driver. From Mateusz Szafoni. + - drivers/sensors: Add driver for ST HTS221 humidity sensor. From + Juha Niskanen. + - drivers/sensors: Add driver for ST LPS25H pressure sensor. From + Juha Niskanen. + - drivers/sensors: Add driver for ST LIS2DH accelerometer. From Timo + Voutilainen. + - drivers/usbmisc: Add driver for Fairchild FUSB301 USB type-C + controller. From Harri Luhtala. + - RTC: Add interface for check if RTC time has been set. New + interface allows checking if RTC time has been set. This allows to + application to detect if RTC has valid time (after reset) or should + application attempt to get real time by other means (for example, by + launching ntpclient or GPS). From Jussi Kivilinna. + - Buttons: Change return value of board_buttons() and the type of + btn_buttonset_t to uint32_t so that more than 8 buttons can be + supported. + - drivers/syslog: Use monotonic clock for timestamp when available. + From Jussi Kivilinna. + - SPI: Add an instance argument to the SPIDEV definitions. Thus, + instead of specifying a FLASH device, for example, as SPI_FLASH, you + would now use SPI_FLASH(0) where the "instance" argument now + distinguishes multiple FLASH devices on the same SPI bus. From + Sebastien Lorquet. + - IOBs: Move from net/iob to a better location in mm/iob where they + can be shared outside of the networking logic. Current also used + by IEEE 802.15.4 MAC and by syslog (when buffering enabled). + - syslog: Add option to buffer SYSLOG output to avoid interleaving. + Uses new shareable IOBs. Additional logic to assure that the the + write from the buffer is a single atomic write in normal debug + output. + - drivers/can: Move CAN subsystem to its own directory and put device + drivers there. From Alan Carvalho de Assis. + - drivers/can: Add Microchip MCP2515 CAN Bus controller driver. From + Alan Carvalho de Assis. + - drivers/audio: Add cs43l22 audio driver. From Taras Drozdovsky. + - drivers/input: Add Cypress MBR3108 CapSense touch button driver. + From Juha Niskanen. + + * Simulation + + - configs/sim/sixlowpan: Configuration for testing the 6LoWPAN with + the IEEE 802.15.4 loopback network driver. + + * Infineon XMC4xxx: + + - arch/arm/src/xmc4: Initial, partial support for Infineon XMC4xxx. + + * Infineon XMC4xxx Boards: + + - XMC4500 Relax: Add basic board support infrastructure of Infineon + XMC4500 Relax Lite v1. Basic serial, LED, and button button support + for a simple NSH configuration. There are still stome remaining + issues with serial communications. + + * MicroChip PIC32MX Boards: + + - pic32mx7mmb: Add support for the Pinquino toolchain. + - pic32mx7mmb: Add support for PROCFS file system. + + * NXP Freescale Kinetis: + + - Kinetis: Allow board to add pullups on SDHC lines. From David + Sidrane. + - Kinetis: Use optional BOARD_OSC_CR and BOARD_OSC_DIV in clock + configuration. From David Sidrane. + + * NXP Freescale Kinetis Drivers: + + - Kinetis: Add Timer PWM Module (TPM) to K66 chip. From David + Sidrane. + - Kinetis: Added HW flow control and termios. From David Sidrane. + - Kinetis: Add ARCH_HAVE_I2CRESET. From David Sidrane. + + * NXP Freescale LPC43xx: + + - Add support for LPC4337FET256. From Andreas Bihlmaier. + + * STMicro STM32: + + - Change STM32 tickless to use only one timer. From Konstantin + Berezenko. + - STM32 F7: Add support for LSE RTC and enable RTC subseconds. From + Jussi Kivilinna. + - STM32 L1: stm32l15xx_rcc: Add support for using MSI as system + clock. From Juha Niskanen. + - STM32 L1: stm32l15xxx_rcc: configure medium performance voltage + range and zero wait-state when allowed by SYSCLK setting. Zero + wait-state for flash can be configured when: (1) Range 1 and + SYSCLK <= 16 Mhz, (2) Range 2 and SYSCLK <= 8 Mhz, or (3) Range 3 + and SYSCLK <= 4.2 Mhz. Medium performance voltage range (1.5V) + can be configured when SYSCLK is up to 16 Mhz and PLLVCO up to + 48 Mhz. From Juha Niskanen. + - STM32 F0: Add basic support for STM32F0. From Alan Carvalho de + Assis. + - STM32 F0: Add basic support for STM32F07x family. + - STM32 L1: stm32l15xx_rcc: Allow board to configure HSE clock in + bypass-mode. Allows using MCO output from ST-link chip (on Nucleo + and Discovery boards) as HSE input. From Juha Niskanen. + - STM32 L1: Add support for STM32L152CC, STM32L152RC and STM32L152VC. + From Juha Niskanen. + - STM32 F0: Add support for HSI48. + - STM32 L4: Add support for the STM32L496XX family. From Juha + Niskanen. + - STM32 L4: modularize Kconfig to support different product + lines/families. This is modeled after STM32F7. Idea is to declare + each chip in Kconfig but allow for flash size override. Commit adds + many STM32L4_HAVE_XXX feature test macros. From Juha Niskanen. + - STM32 L4: Separate SYSCFG into product line specific files for + clarity. From Juha Niskanen. + - STM32 L4: Add support for many new MCUs from the STM32L4X3XX + product line. From Juha Niskanen. + - STM32 L4: Add dbgmcu header files. From Juha Niskanen. + - STM32 F410: Add support for STM32F410. STM32F410 is a version of + STM32F4 with 32 KB of RAM and 62 or 128 KB of flash. From Gwenhael + Goavec-Merou. + + * STMicro STM32 Drivers: + + - SDIO: Extensions to support the SDIO interface to the BCM43362 from + Simon Piriou. + - STM32 F2: Add USB OTG HS support for stm32f20xxx cores. From Simon + Piriou. + - STM32 F2, F4, and F7: Add BOARD_DISABLE_USBOTG_HSULPI flag. From + Simon Piriou. + - STM32 F33: Move DMA logic to a separate files + add ADC support. + From Mateusz Szafoni. + - STM32 F3: Add COMP support. From Mateusz Szafoni. + - STM32 F33: Support for COMP character driver. From Mateusz Szafoni. + - STM32 F4: Implement DMA support for the STM32F4 I2C. From Rajan Gill. + - STM32 F7: Add stm32 RNG support. This is copied from stm32l4. + Tested on STM32F746ZG board. From Juha Niskanen. + - STM32 L1: Add STM32L162VE to chip.h. From Juha Niskanen. + - STM32 F4: Add I2C3 SDA pin mapping for STM32F411. From no1wudi. + - STM32 L1: stm32_flash: Add EEPROM writing for STM32L15XX. From + Juha Niskanen. + - STM32 F7: Serial: Add interface to get uart_dev_t by USART number, + stm32_serial_get_uart. From Jussi Kivilinna. + - STM32 F4: Provide TIM5 definition for STM32F429. From Matias v01d. + - STM32 F0: Add an untested port of the F1 USB device to the STM32F0. + - STM32 F0: Add support for the STM32F09X family. From Juha + Niskanen. + - STM32 F0: Initial cut at I2C driver. Still a work in progress. + From Alan Carvalho de Assis. + - STM32 F33: Add OPAMP support. From Mateusz Szafoni. + - STM32 L4: stm32l4_i2c: Add I2C4 code. From Juha Niskanen. + - STM32 L4: Add GPIO_PORTI definition. From Juha Niskanen. + - STM32 F7 Serial: Allow configuring Rx DMA buffer size. From Jussi + Kivilinna. + - STM32 L4: Firewall for stm32l4x3xx. Not tested for any product + family, but now it at least compiles. L496 devices can have one bit + wider Volatile Data Segment. From Juha Niskanen. + - STM32 TIM: Add method to get timer width. Freerun timer: Use timer + width to get the correct clock rollover point. + - STM32 L4: Add internal flash write support. From Juha Niskanen. + - STM32 L4: Port stm32l4_serial_get_uart function from STM32F7. From + Juha Niskanen. + - STM32 Ethernet: Add support for KSZ8081 PHY interrupts. From + Sebastien Lorquet. + - STM32 F4: Add I2S driver. From Taras Drozdovsky. + - STM32 L4: Add IWDG peripheral. This is the same as for STM32 + except that prescale and reload can be changed after watchdog has + been started, as this seems to work on L4. From Juha Niskanen. + - STM32 F7: Add SPI DMA support. From Jussi Kivilinna. + + * STMicro STM32 Boards: + + - Support for the Particle Photon board was contributed by Simon + Piriou. The Photon board is based on a STM32F205G MCU with and on- + board BCM43362 WiFi chip that interfaces via the STM32's SDIO + interface. Board configuration support includes, in addition, + buttons, LEDS, IWDG, USB OTG HS, and procfs support. Configurations + available for nsh, usbnsh, and wlan configurations. + - Clicker2-STM32: Support for the Mikroelektronika Clicker 2 for + STM32 was added by Anthony Merlino. This board, along with the + MRF24J40 Click board is the platform used to deveop the IEEE + 802.15.4 support. The boad configuration includes the MRF24J40 + initialization logic and SPI support. Configurations exist for nsh, + knsh, usbnsh, and mrf24j40-radio. + - Nucleo_F334R8: Add ADC example. From Mateusz Szafoni. + - Nucleo-F334R8: Add COMP support. From Mateusz Szafoni. + - Nucleo-F334R8: Use new COMP driver. From Mateusz Szafoni. + - Adds USB host support to stm32f411-disco board. From Brian Webb. + - Add stm32f0discovery board support. From Alan Carvalho de Assis. + - Nucleo-F072RB: Add board configuration. + - Nucleo-F334R8: Add OPAMP support. From Mateusz Szafoni. + - Nucleo-F072RB: Add support for the I2C driver used by I2C tools. + - Nucleo-L496ZG: Add nucleo-l496zg board files. From Juha Niskanen. + - Nucleo-F091RC: Add nucleo-f091rc board files. From Juha Niskanen. + - Nucleo-L432KC: Add nucleo-l432kc board files. From Sebastien + Lorquet. + - Nucleo-L452RE: Add nucleo-l452re board files. From Juha Niskanen. + - stm32f103-miniumum: Add board support to use the Nokia 5110 + LCD display driver. From Alan Carvalho de Assis. + + * C Library/Header Files: + + - C library: Add strerror_r(). + - C Library: Add wcstoull(), swprintf(), wcstod(), wcstof(), wcstol(), + wcstold(), wcstoul(), wcstoll() functions. Add mbsnrtowcs() and + wcsnrtombs() (just returning success). Add mbtowc() and wctomb() to + C++ std namespace. From Alan Carvalho de Assis. + - C Library: Add ffsl(), ffsll(), fls(), flsl(), flsll() and use + GCC's __builtin_ctz/__builtin_clz for faster implementation of these. + From Jussi Kivilinna. + - fixedmath: Add square root and b32_t conversion operators. From + Jussi Kivilinna. + - locale.h: Add a bogus definition of locale_t. + - C library: Versions mbrlen and mbsrtowcs taken and adapted from + FreeBSD code (at https://github.com/freebsd/freebsd/). From Matias + v01d. + + * Build/Configuration System: + + - Include C++ library in 'make export'. From Alan Carvalho de Assis. + - configs: Remove all setenv.sh and setenv.bat files. Remove all + references to setenv.sh and setenv.bat from all config README files. + - Kconfig/deconfigs: Add CONFIG_ARCH_TOOLCHAIN_GNU to indicate that + the toolchain is based on GNU gcc/as/ld. This is in addition to the + CPU-specific versions of the same definition. + - Move prototype for up_cxxinitialize() from nuttx/include/nuttx/arch.h + to apps/include/platform/cxxinitialize.h. + + * Tools: + + - Add initialconfig.c so that perhaps in the future we will be able to + use this to generate a new configuration from scratch (rather than + having to derive new configurations from existing configurations). + NOTE: Not yet intregated into the build system. + + * NSH: apps/nshlib: + + - Added support for set [{+|-}{e|x|xe|ex}] [ ]. Set the + 'exit on error control' and/or 'print a trace' of commands when + parsing scripts in NSH. The settinngs are in effect from the point + of exection, until they are changed again, or in the case of the init + script, the settings are returned to the default settings when it + exits. Included child scripts will run with the parents settings and + changes made in the child script will effect the parent on return. + Use 'set -e' to enable and 'set +e' to disable (ignore) the exit + condition on commands. The default is -e. Errors cause script to + exit. Use 'set -x' to enable and 'set +x' to disable (silence) + printing a trace of the script commands as they are ececuted. The + default is +x. No printing of a trace of script commands as they are + executed. From David Sidrane. + - Print expanded variables if -x. From David Sidrane. + - ifconfig command: Extend ifconfig to support 6LoWPAN. Adapt to + some changes in configuration variable usage. + - Network initialization: If IEEE802.11 selected use wlan0 instead of + eth0 for network device name. + - Network initialization: NSH now has configuration options to select + the wireless properties. It builds the configuration structure and + passes this to wpa_driver_wext_associate() so that it will set the + network as configured. + - Network initialization: Add a new option CONFIG_NSH_NETLOCAL that + will suppress some built in operations and will support manual + configuration of a wireless network through command line tools. + + * Examples/Tests: apps/examples: + + - examples/xbc_text: Adds a test program for the XBox One controller + driver. From Brian Webb. + - examples/ostest: Add a test of robust mutexes. + - examples/ostest: Add tests for pthread_rwlock. Adding tests to be + used to verify the pthread_rwlock lock works. From Mark Schulte. + - examples/ostest: Additional test for rwlock and one for cancel + cleanup handlers. From Juha Niskanen. + - examples/usrsocktest: Add application for USRSOCK testing. From + Jussi Kivilinna. + - examples/nettest: Adapt for use in testing 6LoWPAN. + - examples/nettest: If doing loopback, but not using the official + loopback device, then use the server should use the configured client + IP address. + - examples/udpblaster: Several fixes to work with 6LoWPAN. + - examples/udpblaster: Add logic to bind the local UDP socket to a + well-known address. + - examples/configdata: Add stacksize and priority. From Juha Niskanen. + + * Network Utilities: apps/netutils: + + - netutils/netlib: Add IEEE 802.11 wireless IOCTL wrappers. + - netutils/netlib: Add a helper function to convert a string to a + 6LoWPAN node address. + - netlib and NSH: Add logic to get/set the IEEE802.15.4 PAN ID. + - netutils/dhcpc: Make the network device name a configuration + option. Was hardcoded to eth0 but may, instead, need to be wlan0. + - netutils/dhcpc: Remove hard-coded interface device. Now passed as + a parameter to dhcpc_open(). From Sebastien Lorquet. + + * Wireless Utilities: apps/wireless: + + - wireless/wapi: Port of Wapi wireless services. The original + depended on features not supported by NuttX: Removed logic that + depends on Linux netlink. Removed functionality that depended on + the Linux procfs: This includes only 1) listing of available + interfaces and 2) listing of all routes. + - wireless/wapi: Create command line Wapi application based on + Wapi sample code. + - wireless/wapi: wpa_driver_wext_associate() now accepts a + configuration parameter that can be used to specify the wireless + properties. + - wireless/wapi: Add basic wapi_event_stream_extract implementation. + From Simon Piriou. + - wireless/ieee802154: Add iwpan and i8sak tools. iwpan is similar + in concept to wapi. From Anthony Merlino (i8sak was originally + by Sebastien Lorquet). + - wireless/ieee802154/libmac: IEEE 802.15.4 MAC library. + - wireless/wext: Add drivers_wext from the WPA supplicant; Integrate + into NSH. From Simon Piriou. + + * System Utilities (apps/system) + + - apps/system/dhcpc: Add a command to renew or establish a lease on an + IPv4 address. + - apps/system/ntpc: Add a command to start or stop the NTPC daemon. + - apps/system/ramtest: Make stacksize and priority conigurable. + + * Platform-Specific Support (apps/platform) + + - apps/platform: Create gnu/ subdirectory that contains the one and + only GNU C++ initialization function. Remove all other C++ + initialization functions. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Priority inheritance: When CONFIG_SEM_PREALLOCHOLDERS==0, there is + only a single, hard-allocated holder structure. This is problem + because in sem_wait() the holder is released, but needs to remain in + the holder container until sem_restorebaseprio() is called. The call + to sem_restorebaseprio() must be one of the last things the + sem_wait() does because it can cause the task to be suspended. If in + sem_wait(), a new task gets the semaphore count then it will fail to + allocate the holder and will not participate in priority + inheritance. This fix is to add two hard-allocated holders in the + sem_t structure: One of the old holder and one for the new holder. + - Priority inheritance: sem_holder sem_findholder missing + inintalization of pholder. sem_findholder would fail and code + optimization covered this up. From David Sidrane. + - Partial Fix priority inheritance CONFIG_SEM_PREALLOCHOLDERS=0. From + David Sidrane. + - Priority inheritance: sem_boostholderprio prevent overrun of + pend_reprios. The second case rtcb->sched_priority <= + htcb->sched_priority did not check if there is sufficient space in + the pend_reprios array. From David Sidrane. + - lp_worker: Guard from pend_reprios overflow. From David Sidrane. + - Priority inheritance: Fixes improper restoration of base_priority in + the case of CONFIG_SEM_PREALLOCHOLDERS=0. The call to + sem_restorebaseprio_task context switches in the + sem_foreachholder(sem, sem_restoreholderprioB, stcb); call prior to + releasing the holder. So the running task is left as a holder as is + the started task. Leaving both slots filled thus failing to perform + the boost/or restoration on the correct tcb. This PR fixes this by + releasing the running task slot prior to reprioritization that can + lead to the context switch. To faclitate this, the interface to + sem_restorebaseprio needed to take the tcb from the holder prior to + the holder being freed. In the failure case where sched_verifytcb + fails it added the overhead of looking up the holder. There is also + the additional thunking on the foreach to get from holer to + holder->tcb. An alternate approach could be to leve the interface + the same and allocate a holder on the stack of sem_restoreholderprioB + copy the sem's holder to it, free it as is done in this pr and + then pass that address sem_restoreholderprio as the holder. It could + then get the holder's tcb but we would keep the same sem_findholder + in sched_verifytcb. From David Sidrane. + - Priority inheritance: Fixes improper restoration of base_priority. + From David Sidrane. + - sem_holder: Indexing error. From David Sidrane. + + if (sem->holder[0].htcb != NULL || sem->holder[**1**].htcb != NULL) + - realloc(): When realloc() has to fall back to calling malloc(), size + including overhead was being provided to malloc(), causing a slightly + larger allocation than needed. Noted by initialkjc@yahoo.com. + - scheduler: Fix tg_flags check with GROUP_FLAG_NOCLDWAIT. From Masayuki + Ishikawa. + - scheduler: Fix CHILD_FLAG_EXITED in include/nuttx/sched.h. From + Masayuki Ishikawa. + - binfmt/elf: Fix offset value when calling elf_read() in + elf_symname(). From Masayuki Ishikawa. + - binfmt/elf: Fix offset value when calling elf_read() in + elf_sectname(). From Masayuki Ishikawa. + - There can be a failure in IOB allocation to some asynchronous + behavior caused by the use of sem_post(). Consider this scenario: + (1) Task A holds an IOB. There are no further IOBs. The value of + semcount is zero. Task B calls iob_alloc(). Since there are not + IOBs, it calls sem_wait(). The value of semcount is now -1. (2) + Task A frees the IOB. iob_free() adds the IOB to the free list and + calls sem_post() this makes Task B ready to run and sets semcount to + zero NOT 1. There is one IOB in the free list and semcount is zero. + When Task B wakes up it would increment the sem_count back to the + correct value. (3) But an interrupt or another task runs occurs + before Task B executes. The interrupt or other tak takes the IOB off + of the free list and decrements the semcount. But since semcount is + then < 0, this causes the assertion because that is an invalid state + in the interrupt handler. So I think that the root cause is that + there the asynchrony between incrementing the semcount. This change + separates the list of IOBs: Currently there is only a free list of + IOBs. The problem, I believe, is because of asynchronies due + sem_post() post cause the semcount and the list content to become out + of sync. This change adds a new 'committed' list: When there is a + task waiting for an IOB, it will go into the committed list rather + than the free list before the semaphore is posted. On the waiting + side, when awakened from the semaphore wait, it will expect to find + its IOB in the committed list, rather than free list. In this way, + the content of the free list and the value of the semaphore count + always remain in sync. + - binfmt: Fix .dtor memory allocation. From Masayuki Ishikawa. + + * File System/Block and MTD Drivers: + + - SmartFS: If whence is SEEK_END, the file offset shall be set to the + size of the file plus offset. Noted by eunb.song@samsung.com. + - mtd/progmem: Fix incorrect target address calculation. + progmem_read/write() is incorrectly calculating the target address, + expecting the offset argument is given in a block number. This is + completely wrong and as a result invalid flash region is accessed. + Byte-oriented read/write interfaces of mtd device accept the target + address in a byte offset, not a block number. From Heesub Shin. + - procfs: Fix wrong member IDs are displayed when 'cat + /proc//group/status'. From Nobutaka Toyoshima. + - procfs: Fix incorrect uptime with CONFIG_SYSTEM_TIME64. From + Masayuki Ishikawa. + - vfs/poll: round timeout up to next full tick. Calling poll() with + timeout less than half tick (thus MSEC2TICK(timeout) => 0) caused + returning error with EAGAIN. Instead of rounding timeout down, value + should be rounded up. Open Group spec for poll says: + "Implementations may place limitations on the granularity of timeout + intervals. If the requested timeout interval requires a finer + granularity than the implementation supports, the actual timeout + interval will be rounded up to the next supported value." From Jussi + Kivilinna. + - mtd/config: erase block between block read and write. From Juha + Niskanen. + - mtd: Build RAMTRON and AT45DB drivers only if selected. From Juha + Niskanen. + - mtd/config: Fix byte read interface test. From Juha Niskanen. + - mtd: Fix some unallocated and NULL pointer issues. rwb->wrflush and + rwb->wrmaxblocks in rwbuffer could get unallocated values from + ftl_initialize() in some configurations. Also fixes related assert: + + up_assert: Assertion failed at file:rwbuffer.c line: 643 + + that can happen with the following configuration: + + CONFIG_FTL_WRITEBUFFER=y + CONFIG_DRVR_WRITEBUFFER=y + # CONFIG_FS_WRITABLE is not set + + These problems are caused by CONFIG variable differences between the + buffer layers. TODO: This is not a perfect solution. readahead + support has similar issues. From Juha Niskanen. + - net procfs: Fix buffer corruption and refactor netdev_statistics.c. + From Masayuki Ishikawa. + - FAT: Fix 'Missing unlock' in fs_fat32.c. From Masayuki Ishikawa. + - VFS fdopen: Add missing file stream flags clearing. Clear file + stream structure regardless of config options. Structure clearing is + needed as previous use of stream list entry might leave fs_flags + set. From Harri Luhtala. + - mtd/smart: Fix use of uninitialized variable. From Jussi Kivilinna. + - mtd/w25.c: Enable short delay after sector/chip erase. From Jussi + Kivilinna. + - mtd/config: Add some error checks for I/O errors. From Juha + Niskanen. + + * Graphics/Graphic Drivers: + + - net procfs: Some long lines were being generated that cause buffer- + related problems and corrupted output. + + * Networking/Network Drivers: + + - Fixed wrong assert on udp dgram send. From Pascal Speck. + - TCP/IPv6: Fix a compile issue when IPv6, but not IPv4 is enabled. + - net/socket/accept: Fix building with CONFIG_NET_LOCAL_STREAM. From + Jussi Kivilinna. + - Argument of network device IOCTL should be unsigned long, just as + will all other IOCTL methods. + - net/socket: Fix cloning of local and raw sockets. From Jussi + Kivilinna. + - TCP: Wait for 3-Way Handshare before accept() returns. From Simon + Piriou. + - TCP: Send RST if applicaiton 'unlistens()' before we complete the + connection sequence. + - TCP: An RST received during the 3-way handshake requires a little + more clean-up. + - IPv6: Fix net_ipv6_pref2mask(). From Masayuki Ishikawa. + - network IOCTL commands: The only place in net/netdev/netdev_ioctl.c + where the interface state should change is for SIOCSIFFLAGS. The + other ones .. SIOCSIFADDR, SIOSLIFADDR, SIODIFADDR .. should not + change the link state. From Sebastien Lorquet. + - TCP: Fix tcp_findlistner() in dual stack mode. From Masayuki + Ishikawa. + + * Common Drivers: + + - Fix as5048b by adding missing frequency parameter. From Andreas + Bihlmaier. + - multiple fixes in nrf24l01 driver: (1) signal POLLIN if there is + already data in the FIFO, (2) send ETIMEDOUT to userspace after 2 + seconds if TX IRQ was not received, (3) handle FIFO overflow, (4) + handle invalid pipes/empty FIFO, and (5) multiple cosmetics (missing + static, duplicate define, missing \n). From Leif Jakob. + - input/mxt: Prevent overriding i2c transfer return value. + put_reg/get_reg function was overriding i2c transfer error code with + i2creset return value, that lead to OK status although actual + transfer failed. From Juha Niskanen. + - drivers/audio/wm8904: WM8904 has same problem as that fixed by Juha + Niskanen in the MaxTouch driver. + - UART 16550: Missing left parenthesis in function prototype. This is + Bitbucket Issue #41. + - USBMSC: Fix a wrong lun number issue. From Masayuki Ishikawa. + - drivers/i2c: Fix compile issues if CONFIG_DISABLE_PSEUDOFS_OPERATIONS + is enabled. + - drivers/serial: I discovered a problem in the file + drivers/serial/serial.c concerning the function uart_close(). In the + case that a serial device is opened with the flag O_NONBLOCK the + function uart_close() blocks until all data in the buffer is + transmitted. The function close() called on an handle opened with + O_NONBLOCK should not block. The problem occurred with a CDC/ACM + device. From Stefan Kolb. + - drivers: Fix some bad NULL checks. From Juha Niskanen. + - drivers: Rename newly introduced up_i2creset to I2C_RESET. From + Juha Niskanen. + - drivers/bch: BCH character driver bch_ioctl() always returns -ENOTTY + for DIOC_GETPRIV command. It should returns OK if DIOC_GETPRIV + command succeeds. From EunBong Song. + - Replace sprintf() with snprintf() in pipe.c. From Nobutaka Toyoshima. + - drivers/bch: Fix 'Missing Unlock' in bchdev_driver.c. From Masayuki + Ishikawa. + - button_upper: Fix interrupt enabling for poll-events. From Jussi + Kivilinna. + - drivers/{sensors,usbmisc}: Fix uninitialized I2C frequency. From + Juha Niskanen. + + * ARM: + + - Set EABI stack alignment for all ARM architectures (remove OABI + code). From David Cabecinhas. + - Remove redundant interrupt stack coloring and OABI code. From David + Cabecinhas. + - Fix off-by-one interrupt stack allocation in 8-byte aligned + architectures. From David Cabecinhas. + + * ARMv6-M: + + - CONFIG_DEBUG_HARDFAULT should be available for Cortex-M0 too. + + * Microchip/Atmel SAM3/4 Drivers: + + - SAM3/4: Fixed configurations for TWI master. Obviously an + incomplete port from SAMA5. + + * Microchip/Atmel SAMv7 Drivers: + + - SAMV7: Watchdog: Fix Forbidden Window Value. According the Datasheet + the WDD Value is the lower bound of a so called Forbidden Window and + to disable this we have to set the WDD Value greater than or equal to + the WDV Value. This seems to be a bug in the datasheet. It looks + like we have to set it to a greater value than the WDV to really + disable this Thing. When triggering the Watchdog faster than the + (very slow) clock source of the Watchdog fires, this Forbidden Window + Feature resets the System if WDD equals to WDV. This Changeset + disables the Forbidden Window by setting the WDD Value to the Maximum + (0xfff) Value possible. From Frank Benkert. + - SAMV7 EMAC: Add conditional logic to account the fact that the + SAMV71 has 6 rather than 3 queues after version 1. From Ian McAfee. + + * NXP/Freescale Kinetis Drivers: + + - Kinetis: Fixed GPIO _PIN_OUTPUT_LOWDRIVE swapped with + _PIN_OUTPUT_OPENDRAIN. From David Sidrane. + - Ensure interrupts are back on BEFORE running code dependant on + clock_systimer. From David Sidrane. + - Kinetis k66, k64, k60, k40, k20: Pin mux configure all I2C signals as + Open Drain. The output structure of the GPIO for I2C needs to be + open drain. When left at the default, one can observe on a scope the + slave contending with the push-pull during the ACK. From David + Sidrane. + - Kinetis K66: Fixed TMP2_CH1 definition. From David Sidrane. + - Kinetis K66: Define ALT1 to match ref manual. From David Sidrane. + - Kinetis K66: GPIO and pin mux cleanup. From David Sidrane. + - Kinetis ADC: Various corrections and updates. From David Sidrane. + + * NXP/Freescale LPC43xx: + + - Add missing PINCONF_INBUFFER in several places of + lpc4310203050_pinconfig.h. From Andreas Bihlmaier. + - Fix logic in preprocessor checks and correct arguments to + lpc43_pin_config initialization. From Andreas Bihlmaier. + + * NXP/Freescale LPC43xx Drivers: + + - Fix logic error in lpc43_adc. From Andreas Bihlmaier. + - Use correct macro for irqid (fortunately both point to + LPC43_IRQ_EXTINT+18). From Andreas Bihlmaier. + - Actually write modified value to register. From Andreas Bihlmaier. + - Increase number of supported PWM channels from 4 to 6. From Andreas + Bihlmaier. + + * Silicon Labs EFM32 Drivers: + + - EFM32 I2C: Fix timeout calculation. From Masayuki Ishikawa. + + * STMicro STM32: + + - As discovered by dcabecinhas. This fix assume the 8 byte alignment + options for size stack size or this will overwrite the first word + after TOS. See + https://github.com/PX4/Firmware/issues/6613#issuecomment-285869778. + From David Sidrane. + - STM32 F7: In stm32_allocateheap.c There are 5 not 4 configurations. + From David Sidrane. + + * STMicro STM32 Drivers: + + - STM32, STM32 F7, STM32 L4: OTG host drivers: Do not do data toggle + if interrupt transfer is NAKed. Sugested by webbbn@gmail.com. + - Save elapsed time before handling I2C in stm32_i2c_sem_waitstop(). + This change follows the same logic as in previous fix to + stm32_i2c_sem_waitdone(). It is possible that a context switch + occurs after I2C registers are read but before elapsed time is saved + in stm32_i2c_sem_waitstop(). It is then possible that the registers + were read only once with "elapsed time" equal 0. When scheduler + resumes this thread it is quite possible that now "elapsed time" will + be well above timeout threshold. In that case the function returns + and reports a timeout, even though the registers were not read + "recently". Fix this by inverting the order of operations in the loop + - save elapsed time before reading registers. This way a context + switch anywhere in the loop will not cause an erroneous "timeout" + error. From Freddie Chopin. + - STM32, STM32 F7, and STM32 L4: Clone Freddie Chopin's I2C change to + similar STM32 I2C drivers. From David Sidrane. + - STM32: OTG host implementations of stm32_in_transfer() must obey the + polling interval for the case of isochronous and interrupt endpoints. + - STM32: Fix erase sector number for microcontrolers with more than 11 + sectors. Erase a sector from the second bank cause the bit 4 of SNB + being set but never unsed, so trying to erase a sector from the first + bank was acually eraseing a sector from the second bank. From Jos + Roberto de Souza. + - STM32: Make up_progmem thread safe. Writing to a flash sector while + starting the erase of other sector have a undefined behavior so lets + add a semaphore and syncronize access to Flash registers. But for + the semaphore to work it needs to be initialized so each board needs + call stm32_flash_initialize() on initialization, so to avoid runtime + problems it is only using semaphore and making it thread safe if + initialized, after all boards starts to call stm32_flash_initialize() + we can remove the boolean and the check. From Jos Roberto de Souza. + - STM32: Add workaround for flash data cache corruption on + read-while-write. This is a known hardware issue on some STM32 see + the errata of your model and if you make use of both memory banks you + should enable it. From Jos Roberto de Souza. + - STM32 Flash fixes. From Jos Roberto de Souza. + - STM32 Flash: Missing unlock on F1 HSI off path. From David Sidrane. + - STM32 F4 I2C: I needed to use DS3231,I rememberthatin past it + worked ok, but now for stm32f4xx is used another driver (chip + specific,stm32f40xxx_i2c.c) and DS3231 driver doesn't work. After + investigating a problem I found that I2C driver (isr routine) has a + few places there it sends stop bit even if not all messages are + managed. So, e.g., removing stm32_i2c_sendstop (#1744) and adding + stm32_i2c_sendstart after data reading helps to make DS3231 working. + From Alexander Oryshchenko; verified by David Sidrane. + - STM32 F7 Serial: Serial fix for dropped data: (1) Revert the + inherited dma bug from the stm32. see + https://bitbucket.org/nuttx/nuttx/commits/df9ae3c13fc2fff2c21ebdb098c520b11f43280d + for details. And (2) Most all CR1-CR3 settings can not be configured + while UE is true. Threfore we make all operation atomic and disable + UE and restore it's originalstate on exit. From David Sidrane. + - STM32 L1: Fix IWDG and WWDG debug mode stop for STM32L15XX. From + Juha Niskanen. + - STM32 F7: Fix UART7 and UART8 IFLOWCONTROL options. From Jussi + Kivilinna. + - STM32 F7: Add warning for RXDMA + IFLOWCONTROL combination. + Combination of RXDMA + IFLOWCONTROL does not work as one might + expect. Since RXDMA uses circular DMA-buffer, DMA will always keep + reading new data from USART peripheral even if DMA buffer underruns. + Thus this combination only does following: RTS is asserted on USART + setup and deasserted on shutdown and does not perform actual RTS + flow-control. Data loss can be demonstrated by doing long up_mdelay + inside IRQ critical section and feeding data to RXDMA+IFLOWCONTROL + UART. From Jussi Kivilinna. + - STM32 F7 Serial: Do not stop processing input in SW flow-control + mode. From Jussi Kivilinna. + - STM32 L4 DMA: Correct bad channel definition. From Sebastien Lorquet. + - STM32 F7: Warn if no DMA2 configured when using ADC with DMA. Also + correct ADC channel numbers that DMA callback passes to upper half + driver. From Juha Niskanen. + - STM32 F7 ADC: Do not override ADCPRE_DIV when measuring + internal voltage. From Juha Niskanen. + - STM32 L4: Don't think these chips have DPFPU, DTCM or ITCM. From + Juha Niskanen. + - STM32 F7 Flash: macro naming errors, there is no FLASH_CONFIG_F for + F7. From Juha Niskanen. + - STM32 L4: stm32l4x6xx_pinmap: Update I2C4 and DCMI pins. From Juha + Niskanen. + - STM32 L4: stm32l4_i2c: change wrong macro to CONFIG_I2C_POLLED. From + Juha Niskanen. + - Fix STM32F7 I2C interrupt handler. From Jussi Kivilinna. + - STM32: Serial Allow configuring Rx DMA buffer size. From David + Sidrane. + - STM32 CAN: I had the problem that the transmit FIFO size (= actual + elements in FIFO) was slowly increasing over time, and was full after + a few hours. The reason was that the code hit the line + "canerr("ERROR: No available mailbox\n");" in stm32_cansend, so + can_xmit thinks it has sent the packet to the hardware, but actually + has not. Therefore the transmit interrupt never happens which would + call can_txdone, and so the size of the FIFO size does not decrease. + The reason why the code actually hit the mentioned line above, is + because stm32can_txready uses a different (incomplete) condition than + stm32can_send to determine if the mailbox can be used for sending, + and thus can_xmit forwards the packet to stm32can_send. + stm32can_txready considered mailboxes OK for sending if the mailbox + was empty, but did not consider that mailboxes may not yet be used if + the request completed bit is set - stm32can_txinterrupt has to + process these mailboxes first. Note that I have also modified + stm32can_txinterrupt - I removed the if condition, because the CAN + controller retries to send the packet until it succeeds. Also if the + condition would not evaluate to true, can_txdone would not be called + and the FIFO size would not decrease also. From Lederhilger Martin. + - STM32 Serial: Fix freezing serial port. Serial interrupt + enable/disable functions do not disable interrupts and can freeze + device when serial interrupt is received while execution is at those + functions. Trivially triggered with two or more threads write to + regular syslog stream and to emergency stream. In this case, freeze + happens because of mismatch of priv->ie (TXEIE == 0) and actually + enabled interrupts in USART registers (TXEIE == 1), which leads to + unhandled TXE interrupt and causes interrupt storm for USART. From + Jussi Kivilinna. + - STM32 I2C: Make private symbols static. From Juha Niskanen. + - STM32 L4 GPIO: Put back EXTI line source selection. From Juha + Niskanen. + - STM32 L4 RTC: Store RTC MAGIC to backup reg, not to address zero. + From Juha Niskanen. + + * STMicro STM32 Boards: + + - Disable serial console on stm32f103-minimum usbnsh example project + config. Devices enumerate after this change. From Bob Ryan. + - Nucleo-144: Default for choice in Kconfig was not one of the + possible choices. + - Nucleo-F4X1RE User LEDS: Issue #51 reports compilation problems with + stm32_userled.c. Reported by Gappi92. + + * TI Tiva Drivers: + + - Tiva I2C: Correct an error in conditional compilation. + - Tiva SSI: Resolves issue 52 'Copy-Paste error in + tiva_ssibus_initialize()' submitted by Aleksandr Kazantsev. + + * C Library/Header Files: + + - C Library vsnprintf(): Fix precision for string formatting. Fixes + use of format precision to truncate input string. From Jussi + Kivilinna. + - C Library vsnprintf(): If size is zero, then vsnprintf() should + return the size of the required buffer without writing anything. + From Jussi Kivilinna. + - C Library netdb: in dns_query_callback, ret != -EADDRNOTAVAIL + condition consumes error returns including EAGAIN in this case, + dns query retransmission doesn't work. From Ritajina. + - C Library netdb: Fix time info in lib_dnscache.c. From Masayuki + Ishikawa. + - C Library netdb: Fix bugs in lib_gethostbynamer.c. This fix sets + h_name in struct hostent returned by gethostbyname(). From Masayuki + Ishikawa. + - C Library Defect Workaround: replace '%6.6u' format with an + equivalent '%06u'. From Tomasz Wozniak. + + * Tools + + - Fix mksyscall host binary name. From Alan Carvalho de Assis. + + * Applications (apps/) + + - Fix some calls to task_create(): argv[0] is the first parameter, not + the name of the task. + - Bitbucket Issue 5: I found an unexpected behavior in apps/ + configuration generation. Adding external symbolic link in apps/ + directory and using Make.defs for Kconfig generation, Kconfig file + has a wrong path in the source argument. It contains original dir + path outside of the source tree instead path to sub-directory in + apps/. The problem is connected with make/system symbolic link path + resolution. Corrected by a patch submitted by Artur Madrzak with + Issue 5. + - apps/: Make more globals static to avoid name clashes. From Juha + Niskanen. + + * NSH: apps/nshlib: + + - NSH library: In nsh_argexand(), if CONFIG_NSH_ARGCAT is defined but + CONFIG_NSH_CMDPARMS defined and/or CONFIG_DISABLE_ENVIRON not + defined, then there is a situation that causes an infinite loop in + the parser. Noted by Freddie Chopin. + - NSH library: Fix building when CONFIG_NET_USRSOCK enabled with other + link-layers. From Jussi Kivilinna. + - NSH library: Fix some warnings about integer/pointer casts of + different sizes (probably only effects 64-bit simulation). + - NSH library: Fix open flags in nsh_codeccmd.c. From Masayuki + Ishikawa. + - I need to look at the registers that are at or around 0xe000ef90. + Using mw and xd, I see that nsh does not support pointers greater + than 0x7fffffff. A quick look at the source shows that the pointers + for those two commands are set with calls to strtol() rather than + strtoul(). Changing the two pointer-setting instances to strtoul() + fixes the problem, at least for my architecture/config. From Ian + McAfee. + - NSH library: Fix a resource leak in cmd_hexdump(). From Nobutaka + Toyoshima. + + * Examples/Tests: apps/examples: + + - apps/examples/hidkbd: Remove call to arch_usbhost_initialize(). + That is violation of the OS interfacing rules and will no longer be + supported. USB host should be initialized as part of the normal + board bring-up logic as with any other devices and should not involve + illegal calls from applications into the OS. + - apps/examples/usbterm: Removed because it is not very useful and + because it can be configured to use an illegal call into the OS. + - examples/mm: Fix Makefile. Built-in was not being registered. + - examples/hidkbd: Add some missing configuration settings. + - examples/random: Avoid stack overflows. From Juha Niskanen. + - examples/nettest: Fix an error in pre-processor expression. + - examples/mtdpart: Prevent part array overflow. mtdpart examples + create partions and allocate from 1 index not a 0 index to part[] + array. This cause buffer overflow for part array. This change fixes + this problem. From EunBong Song. + - examples/can: Fix can example app to print data when + CONFIG_EXAMPLES_CAN_READ is defined. From Alan Carvalho de Assis. + + * Network Utilities: apps/netutils: + + - Not a clean fix, but at least makes DHCP working with + CONFIG_NETDEV_MULTINIC. From Andreas Bihlmaier. + - Ensure netlib will not be broken when setip will not bring the + network up anymore. From Sebastien Lorquet. + + * CAN Utilities: apps/canutils: + + - Fix libcanard github download link to get it compiling correctly. + From Alan Carvalho de Assis. + - Fix to use the new canardInit() function. From Alan Carvalho de + Assis. + + * System Utilities (apps/system) + + - system/dhcpc: Add missing argument of fprintf. + + * Tools (apps/tools): + + - The dedicated windows tool at tools/mkkconfig.bat uses $APPSDIR, + which is not a windows shell variable, and is left uninitialized, but + in fact should be the current directory. From Sebastien Lorquet. + +NuttX-7.22 Release Notes +------------------------ + +The 122nd release of NuttX, Version 7.22, was made on September 9, 2017, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.22.tar.gz and +apps-7.22.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - pthreads: Move functions from sched/pthreads to libc/pthreads. These + functions just coordinate other OS interface calls but are not a + fundamental OS interfaces and, hence, do not belong within the OS: + pthread_yield(), pthread_once(), pthread_cond_init(), + pthread_cond_destroy(), pthread_barrier_init(), + pthread_barrier_destroy(), and pthread_barrier_wait(). + - Add power-related debug output. + + * File Systems/Block and MTD Drivers + + - RAMTRON: Add support for splitting block writes in chunks. Some + Re-RAMs like MB85AS4MT have a write buffer size limitation. From + Boris Astardzhiev. + - MTD: Add driver for Macronix QuadSPI flash memory. From Simon Piriou. + + * Graphics/Display Drivers: + + - SSD1306 LCD Driver: (1) Separate lcd_dev_s setup to separate object. + g_oleddev takes 1 KiB because framebuffer and was allocated to .data + section because of lcd_dev_s function pointer setup. Move lcd_dev_s + setup out, so that g_oleddev goes to .bss and avoid wasting ROM. (2) + Fix memory corruption caused by ssd1306_getrun(). ssd1306_getrun was + writing one extra byte (with value 0) past target buffer when pixlen + is multiple of 8. When pixlen was not multiple of 8, last byte of + buffer was fully cleared, instead of modifying only the (pixlen % 8) + bits of last byte. (3) Add support for board power control. + ThingseeOne has regulator for controlling display power on/off. Patch + adds support for board based power control to SSD1306 driver. (4) Add + DD-12864WO-4A/SSD1309 support to SSD1306 driver. From Jussi Kivilinna. + + * Networking/Network Drivers: + + - Sockets: Support listening sockets in the getsockname() function. + From Roland Takacs. + - IP Forwading: At the IP level, network may be configured to forward + IP packets that are not destined for the target through a different + network device, decrementing the packet TTL. + - IP forwarding: Add optional support to forward broadcast and + multicast packets. Add missing ICMP support. + - ICMPv6: Add 6LoWPAN and IP forwarding support. + - ICMPv6: Support source link-layer address option in RA. From + Masayuki Ishikawa. + - TUN Driver: Add definitions that will permit TUN-only networking. + - Socket I/F: Created a socket interface used to provide socket support. + Each address family has an interface that describes how to perform + socket operations on that address family. Currently only a couple of + methods are defined in the socket interface call table + - Remove CONFIG_NET_MULTILINK. This increases code size by a little, + but greatly reduces the complexity of the network code. + - Network procfs: Add support for routing tables at proc/net/route. + - Network procfs: Add support for network procfs statistics for the + PF_IEEE802154 address family. + - Network Driver Backlog: Remove driver based backlog support. This + affects the entire network, but is used by only one driver. The only + supported RX backlog is now via common read-ahead buffering. + + * Wireless Networking/Wireless Drivers: + + - IEEE 802.15.4 MAC / MRF24J60 Driver: Extensive updates for + association/beacon-enabled networks. From Anthony Merlino. + - IEEE 802.15.4 MAC / MRF24J60 Driver: Hook in setdevmode from newly + added radio attribute setting. From Anthony Merlino. + - IEEE 802.15.4 MAC: Supports get request for coordinator address. From + Anthony Merlino. + - IEEE 802.15.4 MAC: Notify radio layer of changes in devmode. From + Anthony Merlino. + - IEEE 802.15.4: Add special attribute that can be used to perform a + regdump of the radio. From Anthony Merlino. + - IEEE 802.15.4 loopback driver: Better simulation addressing: short + and extended addresses, panid, and IP address conversion. + - IEEE 802.15.4 Network Driver: Add logic to setup the network mask, + update the MAC-based IPv6 addressing when the network is brought up. + The idea is that addressing changes are supposed to occur only while + the network is down but won't take effect until the network is up + again. + - PktRadio: Add an infrastructure to support networking on generic + (non-IEEE 802.15.4) packet radios. + - PktRadio Loopback Driver: Add a PktRadio loopback network driver to + testing testing with 6LoWPAN and PktRadios on the simulator. + - Spirit Network Driver: The Spirit1 radio (SPSGRF-915) is the first + generic PktRadio Network driver. Based on STMicros STack packets + with 8-bit addressing. We need to use the STack packets in order to + provide the source address and automatic ACKing. + - Network procfs: Fix so that PktRadio address are shown correctly. + - Networking: Add support for some packet radio IOCTL commands. + - 6LoWPAN: Added handling for TCP and ICMPv6 packets. + - 6LoWPAN: Add configurable support for 6LoWPAN star topology. With + this change, the endpoints which are the 'points' of the star will + forward all traffic to the coordinator. The coordinator is assumed to + be the 'hub' of the star. This function also used IPv6 forwarding. + - 6LoWPAN: The original, Contiki-based design used only a single buffer + for reassemblying larger packets. This could be a problem issue for + hub configurations which really need the capability concurrently + reassemble multiple incoming streams concurrently. These was also a + design issue in that the reassembly buffer could be corrupted by + outgoing packets. The design was extended to support multiple + reassembly buffers, each associated with the reassembly tag and source + address. This assures that there can be be no corruption of the + reassembly once it has started. + - 6LoWPAN PktRadio: Now radio agnostic. All IEEE 802.15.4 dependencies + have been removed or isolated so that 6LoWPAN can be used with any + kind of packet radio. This involved things like: (1) generalizing + the representation of radio MAC meta-data, (2) changes to handle + variable-length radio addresses, (3) removal of all explicit IEEE + 802.15.4 types, references, and interfaces, (4) a new radio driver + interface to return 'capabilities' of the drvier. + - ICMPv6: Update so that ICMPv6 can be used with 6LoWPAN. + - IPv6 Neighbor: Update table format to support IEEE 802.15.4 MAC + addresses. + - PF_IEEE802154 Address Family: Add support for the PF_IEEE802154 + address family socket type. This socket is similar to the PF_PACKET, + "raw" packet address family except that: (1) it supports only + SOCK_DRAM, not SOCK_RAW, and (2) works only with IEEE 802.15.4 + MAC-based radios. This address family permits simple access to IEEE + 802.15.4 IOCTLs and frame-level network transfers. + + * Other Common Device Drivers: + + - Dynamically configurable USB composite devices: We developed a huge + Changeset over a year ago to make USB Composite configuration + dynamical and be able to instantiate the CDC/ACM multiple times inside + this device. We use this feature to switch between one in typical USB MSC + CDC/ACM configuration and up to three CDCACMs dynamically. + I've changed the interface for some USB-Functions to receive also the + dynamic configuration. From Frank Benkert. + - Franks' change remained on a branch until all issues were resolved. + the current version in Master is complete and ready for use. + - power: battery_charger: Add ioctl for charging input current. From + Juha Niskanen. + - SMPS driver: Add generic upper-half driver for SMPS. From Mateusz + Szafoni. + - LED Driver: Add support for inverted LEDS. From Jeff. + - LED Driver: Add lightness correction for RGB LED driver. From Jeff. + - LTC4151 Driver: Add driver for LTC4151 current and voltage monitor. + From Giorgio Gro. + - Serial TERMIOS: tcdrain() implementation based on a new term ioctl. + From Sebastien Lorquet. + - Serial TERMIOS: Add support for TCFLUSH. From Sebastien Lorquet. + - syslog: Add option to use the CLOCK_MONOTONIC for time stamping. From + Jussi Kivilinna. + - HC-SR04 Driver: Add support to HC-SR04 distance sensor. From Alan + Carvalho de Assis. + - COMP Driver: Add poll support. From Pekka Ervasti. + - BQ2429X Driver: Add driver for TI BQ2429X battery charger. From Juha + Niskanen. + - ADC Driver: Add poll support. From Juha Niskanen. + - BCH Driver: Add poll support. From Jussi Kivilinna. + - RTC Driver: Extend the RTC framework with an alarm read ioctl + (RTC_RD_ALARM). Through it consumer could get configuration settings + about previously scheduled hardware alarms (active status, hours, + minutes, seconds). From Boris Astardzhiev. + + * Simulation + + - sim/ipforward: Add an IP forwarding configuration using TUN devices + and apps/examples/tun. + - Console: Add non blocking read to devconsole driver. From Simon + Piriou. + - Networking: Poll for TX frames to speed up driver. From Simon Piriou. + - pf_ieee802154: Add configuration for testing PF_IEEE802154 address + family sockets. + - ARM Simulator: Adds necessary functionality to build Simulator under + ARM Linux. Tested only on Raspberry3. Currently setjmp/longjmp do not + save/restore floating point registers. From Nickolay Semyonov. + + * MicroChip/Atmel SAML21 Drivers: + + - SAML21 I2C driver. Developed for and contributed with permissin from + Filament company. From Alan Carvalho de Assis. + - SAMD/L21 USB Driver: Add a USB driver. Developed for Filament Inc. + by Offcode, LTD. From Janne Rosberg. + + * MicroChip/Atmel SAMv7 Boards: + + - SAMV71-XULT: Add support for the MRF24J40 radio and create a + mrf24j40-starhub configuration. + - SAME70-Xplained: Add MRF24J40 support. + + * NXP Freescale Kinetis Drivers: + + - Kinetis USB Improvements: usbdev clean up ensuring proper use of HW. + Rework suspend and resume logic so they perform properly. Made attach + and detach functions optional. As they do not make sense for a bus + powered device. From David Sidrane. + - Kinetis SPI driver: From David Sidrane. + - Kinetis: I2C driver added I2C3, reference counting and reset. + Refactored the driver to support reference counting and reset added + I2C3. From David Sidrane. + - Kinetis RTC: Implementation of the alarm read function. + + * NXP Freescale Kinetis Boards: + + - configs/teensy-3.x USB: Define USBOTG-FS Read from FLASH access in + board config. Allow the board config to define the USBOTG-FS to have + Read access to FLASH. From David Sidrane. + - configs/teensy-3.x: Removed call to khci_usbattach. The call is not + need by the driver if CONFIG_USBDEV_BUSPOWERED=y. On a USB powered device if we are running we are attached. From David Sidrane. + - freedom-k66f: Use SPI driver. Initalize SPI1 on connector J6. No + real use, as of yet. From David Sidrane. + + * NXP Freescale LPC43xx: + + - LPC43xx: Modify up_allocate_(k)heap() to support PROTECTED mode. From + Alan Carvalho de Assis. + + * NXP Freescale LPC4xx Boards: + + - configs/Bambino: Add protected mode configuration to Bambino board. + From Alan Carvalho de Assis. + + * On Semiconductor LC823450 + + - LC823450: Initial support for ON Semiconductor LC823450. From Masayuki + Ishikawa. + - LC823450: eMMC/SD and USB support for LC823450. From Masayuki Ishikawa. + + * On Semiconductor LC823450 Boards + + - LC823450-XGEVK: LC823450-XGEVK board support. From Masayuki + Ishikawa. + - LC823450-XGEVK: Add eMMC/SD and USB support. From Masayuki Ishikawa. + + * STMicro STM32: + + - STM32 L4: Add support for the STM32L475 family. + - STM32 L4 RCC: Enable ADC clock source. From Juha Niskanen. + - STM32: Allow clock frequencies > 168 Mhz on stm32f427/429. We need + to enable the power overdrive for this case. This change allows the + required bits to be set in proper sequence. It also modifies the + local register access operations to allow more than 16-bit registers. + From Sebastien Lorquet . + - STM32 F4: Add support for STM32F433RC. From Alan Carvalho de Assis. + - STM32 F7: Add new configuration option for enabling flash ART + Accelerator and flash prefetcher. From Jussi Kivilinna. + + * STMicro STM32 Drivers: + + - STM32 TIM: Add the set counter function for stm32 timers. From + Sergey Ustinov. + - STM32 HRTIM: Update HRTIM definitions. Add HRTIM driver. From + Mateusz Szafoni. + - STM32 HRTIM: Add HRTIM character driver. From Mateusz Szafoni. + - STM32 HRTIM: Fix DAC triggers configuration, Add missing master timer + logic, enable DAC triggering. From Mateusz Szafoni. + - STM32 HRTIM: Add DMA configuration. From Mateusz Szafoni. + - STM32 HRTIM: Add burst mode configuration. From Mateusz Szafoni. + - STM32 RTC: Port Boris Astardzhiev's RTC change for STM32L4 to STM32. + - STM32 DAC: Add support for HRTIM triggering. Separate dma buffer + configuration for channels. From Mateusz Szafoni. + - STM32 DAC: Conditional logic for timer triggering, fix TSEL + configuration when HRTIM, DMA request remapping, Add DMA buffers + initialization logic. From Mateusz Szafoni. + - STM32 DAC: Support external triggering for DMA transfer. From Mateusz + Szafoni. + - STM32 L1 TIM: Add base address for TIM11. From Juha Niskanen. + - STM32 F4 FLASH: Enable/disable the flash write protection on any + sector. I have verified it to work on the STM32 F427. From Sebastien + Lorquet. + - STM32 F4 Clocking: To use an external oscillator module (not just a + crystal) with the STM32F4, one needs to enable the HSEBYP bit in the + RCC_CR register. This change allows an integrator to define + STM32_RCC_CR_HSEBYP in their board.h file if they want this + configuration. From Jeff. + - STM32 F4 USB: I'm working on bringing up USB full-speed support on + STM32F405. My board does not include a USB power switch, VBus + sensing, over current detection, or ID pin. This commit add a + configSTM32_OTGFS_VBUS_ CONTROL which lets us selectively disable + VBus sensing and control. I also sneaked in a change to disable the + configgpio call for the ID pin, which is only used in OTG mode which + isn't supported yet. The only pins that need to be initialized should + be OTGFS_DP and OTGFS_DM. From Jeff. + - STM32 FLASH: Add CONFIG_STM32_STM32F469 support. From David Sidrane. + - STM32 COMP: Add default INM configuration and some missing COMP + 1,3,5,7 code. From Mateusz Szafoni. + - STM32 F33: Add missing SYSCFG CFGR3 definitions. From Mateusz Szafoni. + - STM32 L4 Serial: Allow configuring Rx DMA buffer size. From Juha + Niskanen. + - STM32 L4 COMP: Input minus pin extended selection. From Juha Niskanen. + - STM32 L4 COMP: Bind to upper half comp driver. From Pekka Ervasti. + - STM32 L4 DAC: Port from STM32. Add ADC register definitions. From + Juha Niskanen. + - STM32 L4 DAC: Add option for routing DAC output to ADC. Actually + write something to the DAC DMA buffer. From Juha Niskanen. + - STM32 L4 DAC: Separate DMA buffer configuration for channels. From + Juha Niskanen. + - STM32 L4 ADC: Implement peripheral. From Juha Niskanen. + - STM32 F7: Definitions for I2C4, SDMMC2. Adapted RAM start / size to + internal SRAM. From Titus von Boxberg. + - STM32 F7 I2C4: I2C4_SDA can also be on GPIO PB7. From Titus von + Boxberg. + - STM32 F7 LTDC: Option for DSI output, inconsistency: the stm32f746 + does not feature a DSI interface. compilable with LTDC_INTERFACE and + LTDC_USE_DSI. From Titus von Boxberg. + - STM32 F7 Clocking: Added functions for DSI clock source selection. + From Titus von Boxberg. + - STM32 F7 Clocking: Enable APB2 DSI clock. From Titus von Boxberg. + - STM32 F7 LTDC: No board specific dithering values used; corrected + dithering init. Corrected LIPOS/LIPCR calculation. Change only + polarity bits in LTDC_GCR. From Titus von Boxberg. + - STM32 F7 Reset: Added function for reset. From Titus von Boxberg. + - STM32 F7 DMA: DMA add dcache alignment check in stm32_dmacapable. In + the case dcache write-buffed mode is used (not write-through) buffer + alignment is required for DMA transfers because a) + arch_invalidate_dcache could lose buffered writes data and b) + arch_flush_dcache could corrupt adjacent memory if the maddr and the + mend+1, the next next address are not on ARMV7M_DCACHE_LINESIZE + boundaries. From David Sidrane. + - STM32 F7 SDMMC: SDMMC remove widebus limitation on DMA. There is no + documantation for the STM32F7 that limits DMA on 1 bit vrs 4 bit + mode. From David Sidrane. + - STM32 F7 SDMMC: SDMMC add dcache alignment check in + dma{recv|send}setup. In the case where CONFIG_SDIO_PREFLIGHT is not + used. + - STM32 F7 RTC: Port Boris Astardzhiev's RTC change for STM32L4 to + STM32F7. + + * STMicro STM32 Boards: + + - STM32F103-Minimum: Add GPIO device driver example. From Alan + Carvalho de Assis. + - STM32F103-Minimum: Add small hello example for STM32F103-Minimum + board. From Alan Carvalho de Assis. + - STM32F103-Minimum: Add support for SmartFS on Winbond W25 SPI NOR + Flash. From Alan Carvalho de Assis. + - STM32F103-Minimum: (1) Enable CONFIG_MTD_PARTITION in Kconfig if flash + partition is enabled and (2) Update the README.txt file with info + needed to get SmartFS working. From Alan Carvalho de Assis. + - Nucleo-F334R8: Add HRTIM initialization. From Mateusz Szafoni. + - Nucleo-F334R8: UART2 is default serial port (STLINK Virtual Port). + From Mateusz Szafoni. + - Clicker2-STM32: Add a configuration that was used with the MRF24J60 + for 6loWPAN testing. + - Clicker2-STM32: Allow both IEEE 802.15.4 MAC character and network + devices to be registered. + - Clicker2-STM32: Add configurations to support the endpoint and hub + roles in a star topology. + - Clicker2-STM32: Add support for per-function-call stack checking. + From Anthony Merlino. + - Clicker2-STM32: Configure EDBG SPI CS just to make that it is + disabled. + - STM32F4 Discovery: Add logic to register the button driver and the + user led driver if so configured. From Jan Pobrislo. + - STM32F4-Discovery: Add a configuration for testing libc++. From Alan + Carvalho de Assis. + - B-L475E-IOT01A: Add support for the STMicro B-L475E-IOT01A board. + From Simon Piriou. + - B-L475E-IOT01A: Add support for the SPSRGF/Spirit1 radio module. Add + a configuration for testing sprit radio. + - B-L475E-IOT01A: Add configurations to support a star topology. + - B-L475E-IOT01A: Add basic support for external Macronix QuadSPI flash + memory. From Simon Piriou. + - B-L475E-IOT01A: Enable UDP broadcast test in the spirit-starhub + configuration. + - STM32F334-DISCO: Add STM32F334-DISCO basic support. From Mateusz + Szafoni. + - STM32F746-Disco: Add ADC3 support. From Ivan Ucherdzhiev. + - STM32L476-Disco: Add a knsh configuration that may be used to test + the PROTECTED build mode. + - STM32F769I-DISCO: Initial port to STM32F769I-DISCO. From Titus von + Boxberg. + + * C Library/Header Files: + + - Move TUN ioctl command to include/nuttx/net/ioctl.h so that it will + always be unique. + - Math Library: Port gamma() and lgamma() from FreeBSD to NuttX. From + Alan Carvalho de Assis. + - C++: Compilation with recent C++ compiler needs an overloaded delete + operator that includes a size_t size argument. New sized delete + operators are only for C++14 and above. + + * Build/Configuration System: + + - Initial clang compile. From Goran Mekic. + - Add CLANG definitions in Kconfig and Toolchain.defs. + - drivers/wireless/ieee802154: Moved radios to individual + sub-directories. From Anthony Merlino. + - Makefile.unix: Add savedefconfig target. From Gwenhael Goavec-Merou. + - Add Gwenhael's change to Makefile.win and update README.txt to + described the new make target. + - All defconfig files are now in the compressed format created with + 'make savedefconfig.' The original .config file can be reconstituted + using 'make olddefconfig.' + - Build System: It is no longer necessary to have a unique Make.defs + file for each configuration. A board may share a common Make.defs + file in the scripts directory. Duplicate Make.defs files removed; + common Make.defs file moved to the scripts/ sub-directory for each + board. + - Networking: Move INET socket interface out of net/sockets to its own + directory net/inet. + + * Tools: + + - testbuild.sh: Added -x to fail build on errors for continous + integration (CI). On CI we want to know ASAP of a failure. From + David Sidrane. + - Improve configure.sh behavior: (1) enable to call from top directory. + (2) enable to designate direct path for config. (3) install .gdbinit + if the target has. From Hidetaka Takano. + - Update tools/configure.c to same functionality as configure.sh. Add + an array of optional file names. Currently, .gdbinit is the only + optional file but other things like IDE-specific project files might + need to be copied as well. + - tools/configure.sh will now copy Eclipse project files if they are + present in the board directory file. + - Update configure.sh, configure.bat, configure.c: With compressed + format, part of the installation requires that we run 'make + olddefconfig' to restore the uncompressed defconfig format. Also, + while I was at it, I also added options to select host platform on + configure command line. + - tools/refresh.sh: Now runs make savedefconfig before copying the new + defconfig file in place; Also, added a new option --defaults. Since + the number of defaults that you now have to answer is so large, the + option lets you just accept the default values. So it works just like + --silent but still prompts you for the decision to save or discard the + new defconfig file. + - tools/refresh.sh: Update so that it can find the Make.defs file in + the new location. + + * NSH: apps/nshlib: + + - NSH Library: Add a Telnetd command. This is needed when network + initialization is deferred. In that case, telnet daemon cannot be + started until the network is finally initialized. The telnetd command + was added just for that case: So that the telnet daemon can be + started from the NSH command line after the network is configured. + - NSH Library: Misc changes needed for PktRadio support. + - NSH Library: Extend ifconfig command so that it can set variable + length packet radio addresss. + - NSH Library: Update addroute and delroute command. The would support either + IPv4 or IPv6, but not both. Allow expression of the netmask in IPv4 CIDR or + IPv6 slash notation. This really reduces the pain of using the commands, + especially for IPv6. + - NSH Library: Add a route command that will dump the content of routing table. + + * Examples/Tests: apps/examples: + + - examples/udp: Add configurable network device name; Add option to + suppress network initialization which is not needed if started by NSH + or for 6LoWPAN. + - examples/udp: Fix registration as a built-in program; Change some + naming to make room for a second target. Current one endpoint is the + target and one is the host. This will (eventually) allow two targets + to be both endpoints of the test. Change build so that both server + and client can be on a target, rather than one on the target one on + the host PC. Server IP address may not be provided on the command line. + - examples/udp: Port numbers need to be configurable to work with + 6LoWPAN. Need to bind the client socket to a port number. This was + not required before so is a apparently a change in the UDP packet + dispatch logic. + - examples/udp: Enable testing with the broadcast address. + - examples/nettest: Support target boards on both ends of the test. + Separate out network initialization so that it may be used by both a + target server and a target client. Fix client/server naming + confusion; Add command line option to select the server address on the + target. Add support for both enpoints on target boards vs. one on a + target and one on the host PC. + - examples/nettest: The send buffer size is now a configuration option. + - examples/nettest: Loopback option should be available in Kconfig for + PktRadio. + - examples/keypadtest: REMOVED and warehoused in the Obsoleted + repository. This was just a bad clone of apps/examples/hidkbd for a + keypad driver that was removed years ago. It also uses illegal + function calls into the OS. So it has no purpse: It is redundant, it + uses illegal interfaces, and is a test for non-existent code. + - examples/ipforward: Add an IP forwarding example using only TUN + devices. Test extended to test forwarding of ICMPv6 multicast messages. + - Implement powermonitor example for ltc4151 current and voltage + monitor. From Giorgio Gro. + - examples/pf_ieee802154: Add for testing PF_IEEE802154 sockets. Add + PANID to command line options; Cannot bind to address zero... There is + no counterpart to INADDR_ANY for these radios (not now at least). + - examples/dac: Add DAC example. From Juha Niskanen. + + * Network Utilities: apps/netutils: + + - netutils/telnetc: This a port of libtelnet to NuttX. + - netutils/telnetd and users of telnetd: Add support for IPv6. + - netutils/thttpd: Remove the netstats demo. This depends on an + illegal function call and cannot be supported. That example could be + replaced with logic that uses the procfs network entries as was done + for NSH which had the same issue. But I am too lazy to implement that. + - netutils/netlib: Add support for PktRadio IOCTL commands. + - netutils/netlib: Add a helper to decode short addresses. + + * Wireless Utilities: apps/wireless: + + - wireless/ieee802154/i8sak: Rewrote i8sak to be test CLI for IEEE + 802.15.4 MAC layer. From Anthony Merlino. + - wireless/ieee802154/i8sak: Updates to i8sak for + association/beacon-enabled changes to IEEE 802.15.4. From Anthony + Merlino. + - wireless/ieee802154/i8sak: Add option to make it easy to send large + frame for testing purposes. From Anthony Merlino. + - wireless/ieee802154/i8sak: Add scan command. From Anthony Merlino. + - wireless/ieee802154/i8sak: Add coordinfo command allowing you to + poll various attributes related to the coordinator. From Anthony + Merlino. + - wireless/ieee802154/i8sak: Add a option to retry on failures to the + assoc command (usually meaning tht the coordinator is not yet up). + - iwireless/ieee802154/8sak: Add reset command to reset the MAC layer. + Adds option to assoc command -t to specify how long to wait for a + response from the Coordinator. From Anthony Merlino. + - ieee802154/i8sak: Adds command to trigger regdump of radio. From + Anthony Merlino. + + * System Utilities (apps/system) + + - apps/system/composite: Update to apps/system/composite assocated with + big changes to the composite device logic. From Frank Benkert. + - apps/system/composite: Remove CDC/ACM and MSC configuration logic. + This belongs in the OS composite initialization. Add and argument so + that you can select the USB composite configuration to be attached. + Restore USB tracing; remove unused field in a structure. Remove + configuration settings that are no longer used. Fix configuration + selecting.. was setting the port number, not the configure ID. Also + add a configuration option to select the default configuration. + - apps/system/composite: Add a configuration option to the boardctl() + calls to support multiple composite device configurations dynamically. + - apps/system/composite: Remove references to USBMSC. There still + dependencies on CDC/ACM in the serial USB trace output. + - apps/system/telnet: Add Telnet Chat deamon and client from + libtelent. + + * Platform-Specific Support (apps/platform) + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Fix ELF loader up_checkarch on ARM arch. From Cristian Condurache. + - pthread_mutex_unlock(): Missing check for the case where + pthread_mutex_lock() is called when the mutex is not locked. In that + case, it would increment the underlying semaphore above 1. This is + the fix for a problem noted by initialkjc@yahoo.com. + - sig_timedwait(): Pending signal structure used after it has been + releasd. From anonymous Bitbucket Issue 59. + - mm_mallinfo: do heap end debug assert check with heap semaphore held. + From Jussi Kivilinna. + - sched/: Fix return value in sched_setaffinity(). From Masayuki + Ishikawa. + - Work Queues: work_queue() must cancel existing work prior to queuing + new work, otherwise the work queue list structure can become + corrupted. Problem noted by Pascal Speck. + - waitpid(): Corrects two problems when CONFIG_SCHED_HAVE_PARENT + + CONFIG_SCHED_CHILD_STATUS are enabled: (1) Was erroring out if the + waited for task had already exited, and (2) was not freeing resources + when a wait was completed. From Boris Astardzhiev. + + * File System/Block and MTD Drivers: + + - VFS poll(): Fix timeout calculation. From Jim Paris. + - VFS poll(): Fix poll for regular files and block devices. Open Group + documentation says that poll (and select) support regular files and + that 'Regular files shall always poll TRUE for reading and writing'. + From Jussi Kivilinna. + - VFS epoll(): Fix epoll_wait function. From Simon Piriou. + - Smart FS: Fix wrong freeing of device structure and use-after-free + issues on error paths. From Jussi Kivilinna. + - MTD FLASH drivers: The byte write method of several drivers had a + cloned error: It was not locking the bus while performing byte write + operations. + - MTD M2PX: If we READ while a write/erase is pending, the command is + ignored and the write/erase continues. If we dont catch this situation + we will return garbage to the user because the flash will not execute + the command. So READ MUST wait for write completion, and before that, + the bus must be locked since it's a precondition to calling + waitwritecomplete(). From Sebastien Lorquet. + - MTD FLASH drivers: Clone Sebastien Lorquet's m25px change to at25, + is25xp, ramtron, and sst25xx. + - MTD W25: Add missing locking and fix SPI_SELECT usage for + w25_unprotect. From Jussi Kivilinna. + - MTD W25: Wait for BUSY flag to clear in w25_readid and + w25_unprotect. W25Q128 datasheet says that all instructions expect + 'Read Status Register' and 'Erase/Program Suspend' are ignored when + BUSY flag in status register is '1'. Therefore wait for busy flag to + clear in w25_readid() and w25_unprotect(). From Jussi Kivilinna. + - Automounter: FS_AUTOMOUNTER should depend on SCHED_LPWORK. From + Nickolay Semyonov. + + * Networking/Network Drivers: + + - TCP Listen: Throw error when error happens in the tcp_listen + function. From Roland Takacs. + - Nework Device Management: Do not search net device when all-zeros + address is used. From Roland Takacs. + - Network Device Management: Fix a error in netdev_register(); it was + not handling device names properly when TUN is the only network device. + - Network Device Management: Fix netdev_dev_lladdrsize(). In some + configurations, it could return the wrong size for the address of a + packet radio. + - Network Device Management: Fix typo for 802.11 devices in + netdev_register(). Was being masked before because depended on + CONFIG_NET_MULTLINK. + - TUN Driver: Use critical section instead of semaphore in + tun_ifdown(). From Masayuki Ishikawa. + - TUN Driver: Do all polling on worker thread. Otherwise, the stack + gets very deep. + - TUN Driver: Currently cannot support TAP mode unless Ethenet is + enabled. + - netdb: Fixed buffer size used for sending DNS queries should depend + on the configured DNS name size. From Ritjaina. + - UDP networking: The TTL (time to live) was not being set in the IPv4 + or IPv6 header unless the UDP socket was bound. + - UDP Networking: Fix a copy-paste error that could effect networking + when both IPv4 and IPv6 are enabled. + - UDP Networking: When upd_input() cannot process a packet, it returns + ERROR so that network drivers may try calling ipv4_input() later. In + this case, it must also set d_len to zero. Otherwise, all network + drivers will assume tht there is also an outgoing packet. This + results in a gratuitous ARP. + - TCP Networking: Correct some issues that prevent TCP from working + correctly when both IPv4 and IPv6 are enabled. + - TCP Networking: TCP disconnection callbacks are not retained in a + list. This will support multiple callbacks per lower-level TCP + connection structure. That is necessary for the cae where a socket is + dup'ed and shares the same lower-level connection structure. NOTE: + There still needs to be a call to tcp_start_monitor() when the socket + is dup'ed. + - TCP Networking: Start the network monitor for a socket when a TCP + socket is dup'ed. + - TCP Networking: If one of the dup'ed socket's is closed, then network + monitor resources associated with that one socket must be recovered. + Also, in the event that socket is being used on one thread, but then + closed on another, any threads waiting for events from the socket + should be informed of the closure. That latter requirement is not + implemented because current data structures do not support it. + - TCP Networking: Fix a race condition. The accept() operation is + performed with the network locked. However, the network is unlocked + BEFORE the connected state is set. Therefore, a context switch may + occur and the socket may no longer be connected when it is marked so. + Noted by Pascal Speck. + - Network routing tables: Fix a compilation error when IPv6 and + routing are enabled. + - Network procfs: Fix some spacing when both IPv6 and IPv4 are enabled. + - Network Local Sockets: Fix accept for local stream sockets. From + Jussi Kivilinna. + - Network Local Sockets: Fix server lc_waitsem overflow. From Jussi + Kivilinna. + - IPv6 Networking: Remove comparisons to the address with all ones + set. IPv6 does not support broadcast addresses and certainly not in + that form. Replace with multicast addresses beginning with 0xff02. + - ICMPv6 Networking: Fix a compilation issue with + CONFIG_NET_ICMPv6_AUTOCONF=y. From Masayuki Ishikawa. + - Networking: Fix net_lock returning ERROR when instead of real error + code on failure. From Jussi Kivilinna. + - IGMPv2 Networking: Remove special support for interrupt level + processing (there is none) and fix some timer cancellation logic. In + many files, correct comments. There is no interrupt level processing + in the networking layer. + + * Wireless/Wireless Drivers: + + - IEEE 802.15.4 MAC: Need counting protection on the logic that + releases the notification resources. Otherwise, notification handlers + may be operating with a stale pointer. + - IEEE 802.15.4 MAC: Improves internal timer logic to handle work + serially. Before, the MAC timer used a watchdog to schedule work with + the high priority worker queue. However, since everything in the MAC + is supposed to be serialized through the use of the high priority work + queue, but the timer uses a watchdog, there are some unintended + consequences. To simplify, we now use the delayed work feature of the + work queue. From Anthony Merlino. + - IEEE 802.15.4 Network Driver: Update RX statistics in network driver. + - IEEE 802.15.4 MRF24J40 Driver: Minor timing fix. Matches recommended + value in datasheet. Splits up driver into multiple files to make it + easier to navigate. Fixes issue with non-beacon enabled mode. From + Anthony Merlino. + - IEEE 802.15.4 MRF24J40 Driver: Fix a bug causing radio to cease + transmitting. From Anthony Merlino. + - IEEE 802.15.4 MRF24J40 Driver: Fixes issues with sleeping for beacon + enabled networking. From Anthony Merlino. + - EEE 802.15.4 MRF24J40 Driver: Fix math error for calculating sleep + count values. From Anthony Merlino. + - IEEE 802.15.4: Fix timing issues for beacon enabled coordinators and + endpoints. From Anthony Merlino. + - iIEEE 802.15.4: Fix issue with association on beacon-enabled + networking. From Anthony Merlino. + - 6LoWPAN: Correct a few addressing issues. Also reserve two bytes at + the end of the frame for the FCS. + - 6LoWPAN: Fixes needed when extended addressing is enabled; broke short + addressing. Loopback driver needs to initialize the MAC meta data; + Address decompression logic must have the MAC address to handle the + most common compression cases. Fix a src/dest address confusion and + other addressing problems. + - 6LoWPAN: Add missing IPv6 address creation to HC1 decode logic. Fix a + typo in an index that prevented use with HC1 and extended addresses. + - 6LoWPAN: TCP logic was not obeying MTU packet size limitations. + - 6LoWPAN: Major re-architecting of TCP logic to properly handle TCP + stuff like ACKs and TDP windowing which were not properly covered in + the initial design. + - 6LoWPAN: HC06, copy TCP header as though it were data. TCP packet + reassembly now seems to work OK. + - 6LoWPAN: Fix duplicate and bad memcpy in loopback driver. + - 6LoWPAN: Fix a misconception about HC06 16-bit IPv6 address + compression. + - 6LoWPAN: TCP send logic was returning a failure in one case when, in + fact, the send was successful. + + * Common Drivers: + + - USB MSC: Use struct instead of pointer to the struct as sizeof + argument in memset in usbmsc.c. Otherwise it leads to error: argument + to sizeof in memset call is the same pointer type struct usbmsc_lun_s + * as the destination. From Oleg Evseev. + - USB MSC: Add missing logic to define endpoints. The composite + changes broke the the non-composite, USB MSC only case because it omitted the critical setup when USB MSC was not part of the composite. + - USB CDC/ACM. Fix several known problems resulting from merge of USB + composite device. That merge now breaks some of the non-composite USB + devices. + - Button Driver: Interrupts weren't enabled since nothing updates them + after btn_poll() marks the file descriptor structure as being polling. + From Jan Pobrislo. + - ADC Driver: Fix some data alignment issues in the ADC driver. + - I2C Drivers: Handle I2C_TRANSFER return value consistently. Some I2C + peripherals transfers return zero on success, others number of + completed transfers. Make drivers robust against this. From Juha + Niskanen. + - COMP Driver: Fix compilation errors when poll disabled. From Mateusz + Szafoni. + + * Simulation: + + - Simulation: Fix mkdir issue in GNU target. From Simon Piriou. + - Simulation: x86 stack needs to be aligned to 16-byte boundaries. + - Simulation: Fix building 32-bit simulation on 32-bit X86. From Jussi + Kivilinna. + + * ARM: + + - ARM: The older ARM7 and ARM9 configurations were determining CFLAGS + based on the GCC version 4.x.x or not. That needx to be extended for + 5.x.x and 6.x.x which also behave like 4.x.x. + + * ARMv7-M: + + - Fixed ARMv7-M Toolchain setting. Cortex-M4 only have Single + Precision FPU. From Hidetaka Takano. + - ARMv7-M syscall logic: Clear bit 0 in PC settings. Bit 0 is the + thumb mode indication and should not be set in the PC. This extra bit + has not caused problems in the past, but seeing it set in the PC is + unnerving. + + * Expressif ESP32: + + - Fix ESP32 gpio enable reg and default UART pin. Modify default UART + pin for ESP-WROOM-32. Fix gpio enable reg. From Sungki Kim. + + * Microchip/Atmel SAMD21 Drivers: + + - SAMD21: Fix some SPI-related issues. From Matt Thompson. + - SAMD21 SPI: I was having issues with the bus freezing up .. slaves + holding SDL low.. so I rewrote a good portion of the interrupt logic + based on the application notes from Atmel. One major improvement is + using the RXNACK flag in the STATUS register, which indicates that no + device responded to an address packet. Assuming that the chip will + always give an interrupt status, I believe it's possible to eliminate + the timer as well. From Matt Thompson. + - SAMD/L21: Need to preserve errno value across syslog() call. + - SAMD21: Changes needed to get USB working. From Matt Thompson. + + * Microchip/Atmel SAMv7 Drivers: + + - SAMv7 TWIHS: TWIHS driver add reference counting. From David Sidrane. + - SAMv7 CAN: We discovered a problem with the samv7 mcan driver which + results, under some circumstances, in a very high CPU load. The + problem occurs, and is easily reproducible, if the device is connected + to a CAN network with a wrongly configured CAN speed (baud rate). In + our tests we set the CAN speed of the device to 1000000 and the speed + of the other CAN nodes to 500000. The device is restarted and sends a + CANopen "bootup message" to the CAN network. This results in huge + amount of errors messages on the CAN bus, probably because of the CAN + feature for acknowledging error messages. The error messages cant be + read by the device because of the misconfigured CAN speed, instead the + CAN chip reports lots of errors, which are reported to the application + which uses the CAN driver (CONFIG_CAN_ERRORS is enabled). The CAN + errors are reported from the CAN chip via interrupts and thus the + interrupt load is very high in this scenario. To fix the problem the + driver now disables each RX error interrupt after it is occurred. The + RX error interrupts are turned back on if at least one CAN message is + received successfully. From Stefan Kolb. + - SAMv7 CAN: I discovered while working on the SAMV7 mcan driver that + the implementation of the CAN error handling is suboptimal. In the + current implementation the many errors are implemented as pending + errors. But those errors are not pending, the errors occurred and are + gone directly afterwards. This commit changes the described behavior + and simplifies the handling of CAN errors. From Stefan Kolb. + + * Microchip/Atmel SAMv7 Boards: + + - SAMv71-XULT: Fix MRF24J40 interrupt GPIO number. + + * NXP/Freescale Kinetis: + + - Kinetis MPU: Disable MPU when not in protected mode. The hardware + reset state of the the MPU precludes any bus masters other then DMA + access to memory. Unfortunately USB and SDHC have there own DMA and + will not have access to memory in the default reset state. This change + disabled the MPU if present on system startup. From David Sidrane. + - Kinetis MPU: Fixed warning for kinetis_mpudisable. Missing header + file added. From David Sidrane. + - Kinetis SIM: Ensure isolation of clock dividers for 0 value case. + This fixes a bug were a SoC does not have a clockdivN register and + passes a 0 for the init value. This prevents overflow of the 0 + decremented to -1 (0xffffffff) spilling over to other clockdivN + fields. From David Sidrane. + + * NXP/Freescale i.MX6 Drivers: + + - i.MX6: Fix a wrong parameter passed when calling irq_attach() in + imx_serial.c. From Masayuki Ishikawa. + - Based on Masayuki's change, I review all serial driver vector + attachment. I Found one additional error and updated all relevant + drivers to current interrupt parameter passing. + + * STMicro STM32: + + - STM32 F410 Kconfig: Fix peripherals available on the STM32 F410. + This also adds a select for STM32_HAVE_DAC1 present on this STM32 + flavor. From Gwenhael Goavec-Merou. + - STM32 L4 DMA: Correct USART3_RX bad channel definition. From Juha + Niskanen. + - STM32 L4 PWR: Correct PWR_SR2 REGLPS and REGLPF bits, add port I + registers. Also remove duplicate section from Kconfig. From Juha + Niskanen. + - STM32 F7: do not enable read-modify-write on DTCM. "AN 4667 - STM32F7 + Series system architecture and performance" recommends to disable + read-modify-write on DTCM: "If the DTCM-RAM is used as data location + and the variables used are byte or/and halfword types, since there is + no ECC management in this RAM on the STM32F7 Series, it is recommended + to disable the read-modify-write of the DTCM-RAM in the DTCM interface + (inthe DTCMCR register) to increase the performance." From Jussi + Kivilinna. + + * STMicro STM32 Drivers: + + - STM32 TIM3/4 are always 16-bits; never 32-bits. Noted by Eetu + Nevalainen.. + - STM32 ADC: Invalidate dma buffer before use. Missing invalidation + caused old samples being fetched from cache. From Jussi Kivilinna. + - STM32, STM32L4, STM32F7 ADC: Fix channel 18 sample time. From Juha + Niskanen. + - STM32 DAC: Fix some configuration logic. When STM32_NDAC is greather + than 1, then second channel is always DAC1OUT2. From Mateusz Szafoni. + - STM32 DAC: Fix compilation when DMA disabled for channel. From + Mateusz Szafoni. + - STM32 F0: Fix some funny shifts in DAC header files. From Juha + Niskanen. + - STM32 F1 RTC fixes: (1) Compile issues because of missing RTC_MAGIC + #defines, (2) missing functionality based on RTC_MAGIC in RTC based on + stm32_rtcounter.c, (3) IRQ setup from up_rtc_initialize was later + reset in up_irqinitialize, (4) write access to backup registers + without enabling access to backup domain, (5) possible races in + set/cancel alarm. tested with STM32F103C8 only. device now wakes up + from forced STANDBY mode by alarm. From Leif Jakob. + - STM32/STM32 L4 PWM: While attempting to output a 70 MHz square wave + from the timer output of a STM32 clocked at 140 MHz, found that the + reload calculation was off by one. This correction does allow the + output up to 70 MHz. I am not sure this affects most users + generating slow PWM but for frequencies close to the PCLK, the + difference becomes significant. From JM. + - STM32 L4 I2C: Set I2C SDA and SCL pins to open drain mode. From Pekka + Ervasti. + - STM32 L4 I2C: I2C4 was writing to wrong RCC registers. From Juha + Niskanen. + - STM32 L4 DAC: Report transfer as completed in DMA callback. Without + this even O_NONBLOCK writes block the calling task if DAC was using + DMA. From Juha Niskanen. + - STM32 L4 COMP: comparators share RCC enable bit with SYSCFG. From + Juha Niskanen. + - STM32 L4 ADC: Correct EXTSEL macros. From Juha Niskanen. + - STM32 L4 TIM: TIM15,16,17 are always in APB2. From Juha Niskanen. + - STM32 F7 I2C: Set I2C4 SDA and SCL pins to open drain mode. From Juha + Niskanen. + - STM32 F4 RTCC: ISR register and write protection fix. From Eetu + Nevalainen. + - STM32 F7 Ethernet: Fix typo in header; Add memory sync barrier + between writing to DMA TX descriptor and restarting DMA TX. Avoid + calling work_queue on pollwork if it's already queued, just skip a + poll cycle instead. Nucleo-144: Fix RMII TXD1 signal, connected to + PB13 not to PG14. From savinz. + - STM32 F7: Added missing config option for register value debugging. + From Titus von Boxberg. + - STM32 F7: No FSMC, only FMC for STM32F7. From Titus von Boxberg. + - STM32 F7: HEAP2 depends on CONFIG_ARCH_HAVE_HEAP2, not on particular + FMC RAM type. From Titus von Boxberg. + - STM32 F7: STM32_RCC_DCKCFGR2 has nothing to do with PLLI2S; PLLI2S is + not dependent on LTDC, instead on SAICLK1/2 generated from PLLI2S. + From Titus von Boxberg. + - STM32F7: Some STM32F7 builds failed in build testing due to undefined + STM32_SRAM1_BASE. I think that is because stm32_allocateheap.c was + not including chip/stm32_memorymap.h. + - STM32 F7: dcache write-buffed mode is used (not write-through) buffer + alignment is required for DMA transfers because a) + arch_invalidate_dcache could lose buffered writes data and b) + arch_flush_dcache could corrupt adjacent memory if the buffer and the + bufflen, are not on ARMV7M_DCACHE_LINESIZE boundaries. From David + Sidrane. + + * STMicro STM32 Boards: + + - STM32F103-Minumum SPI: SPIDEV_WIRELESS used when this has + changed to SPIDEV_CONTACTLESS. From Nicolas Estibals. + - configs/: a few more places where SPIDEV_WIRELELSS should be + SPIDEV_CONTACTLESS. + - STM32F103-Minumum: Fix a BUG when reading from output pin. We need + a different read_ops to read from output pin. This patch fixes the + issue. From Alan Carvalho de Assis. + - STM32F103-Minumum: Use separated read_ops for GPIO interrupt pins. + From Alan Carvalho de Assis. + - STM32F103-Minumum: Fix compiler error in MCP2415 logic. + - STM32F746G-DISCO: Fix for compilation of STM32F746G-DISCO. From Ivan + Ucherdzhiev. + - STM32F746G-DISCO: Fix for stm32f746g-disco board for button support + with interrupt. This change is tested with buttons app example and it + is working with interrupts (signals). I tried the test with polling + but at this point it doesn't work. From Ivan Ucherdzhiev. + + * Build System + + - Fix -Werror=implicit-fallthrough on gcc7. From Julien Lecoeur. + - configs/Board.mk: Remove comment form end of line. In windows native + build, it appears to be trying to make that an extra parameter to the + AR command. From Jeff. + - configs/Board.mk: Remove quotes from CONFIG_ARCH_FAMILY. Causes + problems with Windows native build. From Jeff. + - Makefile.win would only create uboot images for ARM. MIPS support + also needed. From Lwazi Dube. + + * C Library/Header Files: + + - C++: Fix C++ __guard implementation for ARM. The standard C++ ABI + that most platforms follow defines __guard to be 64 bits. The existing + implementation of libxx_cxa_guard.cxx follows this. However, the + 32-bit ARM C++ ABI defines it as 32 bits instead, and changes the + meaning slightly so only the lowest bit is used. This matters because + GCC creates guard symbols without regards to what libxx_cxa_guard.cxx + says. So on ARM, gcc allocates 4 bytes, but __cxa_guard_release + writes 8 bytes, zeroing out another unlucky variable nearby. Fix it + by special-casing 32-bit ARM in libxx_cxa_guard. From Jim Paris. + - C++: In cwchar it uses CONFIG_LIBC_WCHAR to only export the wc/mb + functions. When a build does not want to use wide or multibyte char + CONFIG_LIBC_WCHAR is not set. Therefore we should to only export the + wc/mb functions when defined. Regardless of the stat of + CONFIG_LIBC_WCHAR the non mb/wc definitions such as mbstate_t, + wint_t, wctype_t need to be exported. From David Sidrane. + - C Library: Fix an error in mkstemp() the could result in an infinite + loop. From Alan Carvalho de Assis. + - C Library: (1) Fix an error in mkstemp() the could result in an + infinite loop. (2) Fix for wrong output in some cases. For Example: + (a) input: "FILEXX", output: "FILE00" and repeats same output for + further invocations of mkstemp(). But, the output has to be FILE01, + FILE02, ...., FILEZZ. (b) input: "FILEXXXXXX", output: "FILE100000", + for next invocation "FILE200000" and so on. But it's good, if the + output goes like FILE000001, FILE000002, ..., FILE000101, ... From + Lokesh B V. + - C Library: gethostbyname_r: Fix check for space in buffer. + - C Library: inet_ntop() was printing negative values for fields >127. + - Math Library: Fix wrong output in modf() API. The sign of integral + part given by the modf() should be same as sign of input. But for + inputs between 0 and 1, the sign of integral part was not same as + sign of input. From Lokesh B V. + - Math Library: Fix wrong output in ceil() API. Ex:for input x = 1.0, + the output should be 1.0, but the output was 2.0. From Lokesh B V. + + * Tools + + - tools/testbuild.sh: Fix missing $ before variable name. + - tools/mkdeps.c: Eliminate a warning. MAX_PATH may already be defined + in included system files. From Jeff. + + * Applications: apps/ + + - All apps/ Makefiles: Add .PRECIOUS: apps/libapps.a to every + Makefile. Hopefully this will end awkward problems when you Control-C + out of a build and libapps.a is deleted. + - platform/Makefile: More attempts to fix for Windows native build. + Backslash as a delimiter causes problems in pattern subsitutions. + + * NSH: apps/nshlib: + + - NSH network initialization: Fix some ieee 802.15.4 initialization + logic. It should not set the saddr or panid; those cannot be + hard-coded but must come from the coordinator. Re-factor a function + that has gotten too big and too complex. Do not set the IP address + for 6loWPAN. The 6loWPAN stack uses IP address that derive from the + ieee 802.15.4 addressing and cannot be (safely) configured by the user. + - NSH Library: Fix copy-paste typo in nsh_usbconsole.c. From Oleg + Evseev. + - NSH Library: fix size of 6LoWPAN extended address. + - NSH Library: Fix build break in nsh_command.c with IPv4/IPv6 dual + stack. From Masayuki Ishikawa. + - NSH Library: Correct parsing of ifconfig so that you can specify the + HW address without specifying the IP address. + + * Examples/Tests: apps/examples: + + - examples/smart: Fix some compilation errors. Obviously this test has + not been used in a LONG time. + - examples/udp: Renaming some files to prevent name collision in + libapps.a. Fix naming of a configuration setting. + - examples/nettest: Renaming some files to prevent name collision in + libapps.a + - examples/nximage: Remove unused global variable. + - examples/nsh: Remove APPNAME, PRIORITY, and STACKSIZE settings from + Makefile to avoid showing nsh in Builtin Apps. From Masayuki Ishikawa. + + * Network Utilities: apps/netutils: + + - netutils/tftpc: Missing header file causes errors in some + configurations. + - netutils/tftpc: TFTPC depends on CONFIG_NET_IPv4. + - netutils/netlib: Fixes to work when only USRSOCK is enabled. + - netutils/netlib: Fix netlib_nodaddrconv() so that its return type is + the same as other address conversion functions. + - netutils/netlib: If only PF_IEEE802154 socket family is enabled, then + must use SOCK_DGRAM. + - netutils/ftpc: Fix some memory leaks. From Boris Astardzhiev. + - netutils/thttpd: Fix a malformed if condition detected by GCC 6.x.x. + - netutils/dhcpd: Prevent buffer overflow in dhcpd_addoption. offset + represents distance from start of option buffer. So this should be + changed current option pointer minus start of buffer. From EunBong + Song. + + * Wireless Utilities: apps/wireless: + + - wireless/ieee802154/i8sak: Need to increment the next_saddr after + each successful association. + + * System Utilities (apps/system) + + - correct copy-paste typo in comments in composite_main.c From Oleg + Evseev. + - system/dhcpc: The DHCPC renew command did not build correctly due to + naming problems. Noted by Masayuki Ishikawa. + - system/dhcpc: Fix warning about renew_main.o appear twice in rule. + + * Tools (apps/tools): + + - tools/mkkconfig.bat: Use %cd% instead of %~dp0 for usage of APPSDIR + in this batch file. + - tools/mkkconfig.bat: Remove quotes in echo. These were begin + Echo'ed and generating double quots in the output. From Jeff. + - Windows build fixes: tools/mkkconfig.bat - switch APPSDIR path to + use forward slashes for kconfig-frontends. interpreters/ficl - + Reorder some targets that causes GNUwin32 make to behave badly. From + Jeff. + +NuttX-7.23 Release Notes +------------------------ + +The 123rd release of NuttX, Version 7.23, was made on December 4, 2017, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.23.tar.gz and +apps-7.23.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - sem_open() should return SEM_FAILED on any failures. This is change + in the POSIX specification since the original sem_open() was written + so many years ago. + - exec(): The non-standard interface exec() is now enshrined as a + official NuttX API. I really dislike doing this but I think that + this is probably the only want to load programs in the protected + mode. It is currently used by some example code under apps/ that + generate their own symbol tables for linking. Other file execution + APIs relay on a symbol table provided by the OS. In the protected + mode, the OS cannot provide any meaning symbol table for execution + of code in the user-space blob so that is they exec() is really + needed in that build case. And, finally, the interface is + completely useless and will not be supported in the KERNEL build + mode where the contrary is true: An application process cannot + provide any meaning symbolic information for use in linking a + different process. + - OS Internal Functions: Rename many OS internal functions so it is + clear that they are not part of the application interface. All + internal functions with the sem_* prefix became nxsem_*, sig* become + nxsig_*, mq_* become nxmq_*, etc. + - Cancellation Points: Add new cancellation point interface, + check_cancellation_point(). + - Signals: Add logic to wake up a thread that is waiting on a signal + if it is canceled. + - sigtimedwait(): Add logic to suppress the wait if there is a + pending cancellation. + - clock_nanosleep(): Implement clock_nanosleep(). nanosleep() is now + reduced to a libc wrapper around clock_nanosleep(). + - task_delete(): Do not permit user applications to delete kernel + threads. + - kthread_create(): Rename kernel_thread() to kthread_create() for + better naming consistency with task_create() and kthread_delete(). + - boardctl(): Remove the BOARDIOC_GRAPHICS_SETUP command. + - TCB: Move POSIX thread specific data from pthread TCB to common TCB + structure. This change allows using pthread_getspecific and + pthread_setspecific from main thread. Patch also enables using + pthread data with config option CONFIG_DISABLE_PTHREAD=y. From Jussi + Kivilinna. + - mm: Remove the CONFIG_GRAN_SINGLE configuration option. It adds no + technical benefit (other than some minor reduction in the number of + interface arguments) but adds a lot of code complexity. Better + without it. + - mm: Add a function to get information about the state of the + granule allocator. This is the moral equivalent of mallinfo(). + + * File Systems/Block and MTD Drivers + + - MT25Q Serial FLASH: Add support for Micron MT25Q series MT25Q128. + From Sebastien Lorquet. + - MX35LFxGE4AB: Add an MTD driver for Macronix MX35LFxGE4AB serial + NAND flash. From Ekaterina Kovylova. + - FileMTD: Add block device MTD interface. Block MTD interface + allows using block device directly as MTD instead of having to use + file-system in between. NOTE that this provides the opposite + capability of FTL which will let you use an MTD interface directly + as a block device. From Jussi Kivilinna. + - BCH: The character driver to block device access now supports an + IOCTL to get the geomtry of the underlying block device. + - mkfatfs: Remove mkfatfs from the OS. This is a user-space + application and belongs in apps, not in the OS. + - procfs: Implements procfs /proc/fs/blocks and /proc/fs/usage files, + replacing the NSH df command. Also implements procfs /proc/fs/mount + file, replacing the NSH mount command when there are no arguments. + - procfs: Add /proc/meminfo. This is an alternative way to get the + information that was previoulsy available in apps/system/free. + apps/system/free was removed beause it made illegal calls into the + OS violating the portable interface. This new procfs entry provides + the same information with no such violation. it also provides + information about the kernel heap (formerly /proc/kmm), about the + use of program memory(formerly /proc/progmem). And also information + for the page table usage in the KERNEL build. + - UserFS: Adds the UserFS client and of the UserFS feature in + general. Initially used Unix domain local sockets instead of + message queues. Easier to transfer big data in local sockets than + message queues. However, that lead to certain inescapable deadlock + conditions So the IPC was converted to UDP LocalHost loopback + sockets. The problem with the local sockets is that they do require + operations on the top level pseudo-file system inode tree. That + tree must be locked during certain traversals such as enumerate + mountpoints or enumerating directory entries. This conversion is + unfortunate in the sense that Unix local domain sockets are + relatively lightweight. LocalHost UDP sockets are much heavier + weight since they rely on the full UDP stack. + + * Graphics/Display Drivers: + + - Framebufer character driver: Add framebuffer character device driver. + - LCD Framebuffer: Add support for a generic front-end that will + convert any LCD driver into a framebuffer driver. + - Framebufer character driver: Include support for LCD drivers that + use a simulated framebuffer and must receive explicit notification + when there is an update to a region in the framebuffer. + - LCD: Make LCD driver configuration indepently selected from NX + graphics configuration. This makes things awkward and loses some + error checking but is a necessary step in order to make LCD drivers + usable when the NX graphics system is disabled. + + * Networking/Network Drivers: + + - Networking: Add implementation of logic for SIOCGIFCONF and + SIOCGLIFCOF IOCTL commnds. + - Network IOCTLs: Add support for the SIOCGIFBRDADDR ioctl() command. + - Routing Tables: Permit IPv4 and IPv6 routing tables to be of + different sizes. + - Routing Tables: Adds support for read-only routing tables. Prior + to this change, routing tables were only support in RAM and had to + be initialized with explicit logic to add the necessary routes to + the routing table. With this change, routes may be defined in the + pre-initialized, read-only routing table provided by the + board-specific logic. + This would be particularly useful, for example, in the case where + there is only a single network adaptor and you want all output + packets to go to the single adaptor in all cases. So for that + behavior you could add a read-only routing table to the + board-specific long that contains a single entry, the default route: + 0.0.0.0/0. + - Routing Tables. Added support for routing tables in files in a file + system. This might be useful for customized, per-unit routing + tables. There are two issues with it however: + 1. Reading from file system on a per packet basis could be slow. I + think it probably should have a small, in-memory cache of most + frequently used routes for good problem. + 2. Currently the delroute logic is disabled due to a problem with + the design. NuttX does not currently support truncate(). + Therefore, it is not possible to delete entries from the routing + table file. In this current implementation, that leaves the last + entry intact at the end of the file. An alternative design + might include a tag on each record to indicate if the record is + valid or not. That would work but would add complexity to the + other routing table functions. + - Routing Tables: Add support for an in-memory routing table cache in + order to improve performance when the routing table is retained in a + file. The cache holds the most recently used routing table entries + and so can eliminate some file access. Flush the in-memory cache + when any entry is deleted from the routing table. When a router + matching an IP address is found, add the routing table entry to the + cache. + - Routing Tables: Add logic to mark a route as most-recently-used in + the route cache. + - ICMP: This change adds support for semi-standard IPPROTO_ICMP + AF_INET datagram sockets. This replaces the old ad hoc, nonstandard + way of implementing ping with a more standard, socket interface. + - ICMPV6: This commit adds support for semi-standard IPPROTO_ICMP6 + sockets. This is a replacement for the non-standard ICMPv6 ping + support that violated the portable POSIX OS interface. + - ICMPv6: Add option to manually specify router prefix in router + advertisement message. From Sakari Kapanen. + - Local Sockets: This commit modifies the Unix domain local socket + design. Local sockets are built on top of pipes. The Local socket + implementation maintained file descriptors to interrupt with the + pipes. File descriptors have the bad property that they are valid + only while running on the thread within the task that created the + local socket. + As a policy, all internal OS implementations must use "detached" + files which are valid in any context and do not depend on the + validity of a file descriptor at any point in time. This commit + converts the usage of file descriptors to detached files throughout + the local socket implementation. + + * Wireless Networking/Wireless Drivers: + + - IEEE-802154: Adds support for receiving MAC events via IOCTL through + socket interface. From Anthony Merlino. + - IEEE-802154: Simplifies notify() and rxframe() calls to a single + notify() call. dataind's and all other "notifs" are now "primitives" + which aligns with standard terminology From Anthony Merlino. + - MAC802154: Add support for getting promiscuous mode state From + Anthony Merlino. + - MAC802154 Character Driver: When in promiscuous mode, the char + driver sends the entire frame, including the MAC header. This + change adds an offset field indicating the header-payload boundary. + It is set to 0 when not in promiscuous mode as the header is not + passed to the application + - 6LoWPAN: Remove CONFIG_NET_6LOWPAN_FRAMELEN. In this case where + multiple radios are supported, this may not be a constant. 6LoWPAN + now always queries the driver to get the maximum frame length. + - 6LoWPAN: Support sending to a router that is on-link and may be + able to forward the packet for us if the destination is not + reachable directly. From Anthony Merlino. + - XBee: Adds XBee S2C (802.15.4 firmware) support. XBee driver + emulates mac802154 interface. From Anthony Merlino. + + * Other Common Device Drivers: + + - PowerLED: Add upper-half driver for high power LED driver (powerled) + From Mateusz Szafoni. + - RTC Driver: Add periodic alarms to upper and lower halves. From + Juha Niskanen. + - Pipes: Fix writing large buffers not triggering POLLIN for reader + poll. From Jussi Kivilinna. + - USB CDC/ACM Device: Add support for RX flow control to the CDC/ACM + driver. + - USB CDC/ACM Device: Add support for flow control TERMIOs in CDC/ACM + driver. + - USB RNDIS Device: Add RNDIS-over-USB driver. From Sakari Kapanen + with added Hi-Speed support from Masayuki Ishikawa. + - Loop Driver: Don't use file descriptors... Use the internal file + system interfaces so that the loop device can be shared across + threads. + - APA102 LED controller: Add driver for APA102 LED controller. These + LEDs are used on LED Strips and are controlled over SPI. + - INA219. Add INA219 Driver. The INA219 is a combined voltage and + current sensor that can measure up to 26 volts and a current that + depends on an external shunt resistor. Connection happens via + i2c/smbus and the chip features a power supply rail that is + independent from the measured voltage, so it can measure low + voltages. Right now it measures bus voltage and current, and does + not use the internal calibrated current reading, nor the available + power measurement. From Sebastien Lorquet. + - PCA9555: The IRQ subsystem now supports passing a void * parameter + to IRQ handlers. Use that method to support multiple PCA9555 + devices, by passing a pointer to the device to the board defined IRQ + handler. Now the CONFIG_ for multiple PCA devices just allocates + device structures dynamically instead of statically when not enabled. + The same interrupt handler is entered with the device structure + parameter in all situations, multiple or single PCA. One should + still be careful if multiple PCA devices share the same IRQ. From + Sebastien Lorquet. + - APDS-9960: Add driver for the APDS-9960 gesture sensor. From Alan + Carvalho de Assis. + - MAX7219: Add support to MAX7219 LED Matrix as LCD interface. From + Alan Carvalho de Assis. + - WM8774: Add WM8774 audio DAC support. From Masayuki Ishikawa. + - Nunchuck: Add Nintendo Wii Nunchuck driver. From Alan Carvalho de + Assis. + + * Simulation + + - Simulation: Add a configuration for non-graphical testing of the + frambuffer character driver using apps/example/fb. + - Simulation: Add a configuration for testing the UserFS using + apps/examples/userfs. + + * Broadcom BCM2708: + + - BCM2708: Add enough infrastructrue (more stubs) to get a clean + compilation of the Pi Zero configuration (with many undefined things + at link time). This includes several register definition header + files (some from Alan Carvalho de Assis), basic interrupt handling + logic, boot-up files, GPIO support, tickless timer, build and + configuration logic + + * Broadcom BCM2708 Boards: + + - Raspberry Pi Zero. Basic board support at configs/pizero. Untested + in this release and still some remaining issues. + + * Infineon XMC4xxx Boards: + + - XMC4500-Relax: Add config for UART3 on RXD P0.0 and TXD P0.1 pins. + From Alan Carvalho de Assis. + + * NXP Freescale LPC17xx Boards: + + - Open1788: Add initialization of Framebuffer driver. Add + configuration for testing the framebuffer driver. + + * NXP Freescale LPC43xx Drivers: + + - LPC43xx: Add LPC43xx CAN driver. From Alexander Vasiljev. + + * NXP Freescale LPC43xx Boards: + + - MCB1700: Add support for Keil MCB1700 board. From Alan Carvalho de + Assis. + - Open1788: Add support for the discrete joystick driver. + - Open1788: Add a configuration for testing pdcurses with discrete + joystick. + + * On Semiconductor LC823450 + + - LC823450: Add ADC driver and watchdog drivers. From Masayuki + Ishikawa. + - LC823450: Add IPL2 support. From Masayuki Ishikawa. + - LC823450: Add I2S support. From Masayuki Ishikawa. + - LC823450: Add auto LED for CPU activity. From Masayuki Ishikawa. + + * On Semiconductor LC823450 Boards + + - LC823450-XGEVK: Enable ADC and watchdog driver. From Masayuki + Ishikawa. + - LC823450-XGEVK: Add IPL2 support. From Masayuki Ishikawa. + - LC823450-XGEVK: Add WM8774 support. From Masayuki Ishikawa. + - LC823450-XGEVK: Add auto LED support. From Masayuki Ishikawa. + - LC823450-XGEVK: Enable CONFIG_SMP for audio. From Masayuki Ishikawa. + - LC823450-XGEVK: Add rndis configuration. From Masayuki Ishikawa. + + * STMicro STM32: + + - ARM Kconfig: Add support for classic ARM11 architecture selections. + - STM32 Tickless: Removes the restriction to 16-bit counts when a + 32-bit timer is used for tickless operation on the stm32. As it + was, the restriction is very limiting, especially if one wants high + granularity and large achievable intervals and has the hardware + (namely the 32bit timers) available. From Rajan Gill. + - STM32 L4 Kconfig: Add some L486 and L496 chips. From Juha Niskanen + - STM32 F7: Adds architecture support for the STM32 F72x and F73x + families. From Bob Feretich. + - STM32 F7: Allow changing voltage output scaling setting and + prevents enabling over-drive mode for low frequencies (STM32 F74xx, + 75xx, 76xx, 77xx). From Jussi Kivilinna. Changes replicated for + the 72xx and 73xx families. + + * STMicro STM32 Drivers: + + - STM32 ADC: Added support for ADC's IO_ENABLE_TEMPER_VOLT_CH ioctl + on STM32F10XX and STM32F20XX. From Dmitriy Linikov. + - STM32 Wakeup: Add logic for enabling wakeup pins. From Oleg Evseev. + - STM32 PWR: Adds stm32_pwr_getsbf and stm32_pwr_getwuf functions + that return the standby flag and the wakeup flag PWR power + control/status register. From Oleg Evseev. + - STM32 HRTIM: Sdd support for capture, chopper, deadtime and dump + registers. From Mateusz Szafoni. + - STM32 RTC: Canceling an alarm marks it as inactive. From Juha + Niskanen + - STM32 Serial: Add interface to get uart_dev_t by USART number, + stm32_serial_get_uart(). From Juha Niskanen. + - STM32 F33xx ADC: Initial ADC support for the STM32F33XX. From + Mateusz Szafoni. + - STM32 F33xx ADC: Add ADC DMA support to STM32F33 configuration. From + Mateusz Szafoni. + - STM32 L4 ADC: Port analog watchdog ioctl commands from the Motorola + MDK. From Juha Niskanen + - STM32 L4 ADC: Add option for routing ADC data to DFSDM, fix DFSDM + DMA. From Juha Niskanen + - STM32 L4 ADC: Add PM hooks from Motorola MDK + - STM32 L4 FLASH: Add function for modifying device option bytes, + From Juha Niskanen. + - STM32 L4 DFSDM: Add peripheral support for digital filters for + sigma-delta ADCs. Initial version. Timer trigger support is not + completed and there is some issue with DMA. From Juha Niskanen. + - STM32 L4 I2C: Port then STM32 F7 I2C driver to STM32 L4. STM32L4 I2C + driver is in work-in-progress state (plentiful of TODOs and + #warnings) and lags many features found in more up-to-date STM32 I2C + drivers. The peripheral on STM32F7 and STM32L4 are identical except + for L4's 'wakeup from stop mode' flag and STM32F7's I2C driver is in + more 'ready to use' state. The I2C clock configuration is kept the + same as before (I2CCLK = PCLK1 80 Mhz) instead of switching to + STM32F7 arch default that is I2CCLK=HSI. Further work would be to + add configuration option for choosing I2C clock source instead of + current hard-coded default. From Jussi Kivilinna. + - STM32 L4 RTC: Add up_rtc_getdatetime_with_subseconds + - STM32 L4 RTC: Change maximum alarm time from 24h to one month. From + Juha Niskanen. + - STM32 L4 RTC: Add support for periodic interrupts with + (experimental) CONFIG_RTC_PERIODIC. From Juha Niskanen. + - STM32 L4 SDMMC: Add support for an SDMMC driver. From Miha Vrhovnik. + - STM32 L4 Serial: Suspend serial for Stop mode. From Juha Niskanen. + - STM32 L4 Serial/PM: STM32L4 serial PM interface improvements: + Check rx/tx buffers for pending data in pmprepare. Remove adhoc PM + interfaces and move serial suspend functionality behind CONFIG_PM. + From Jussi Kivilinna. + + * STMicro STM32 Boards: + + - STM32F103-Minimum: Add board support for APA102 driver. From Alan + Carvalho de Assis. + - STM32F103-Minimum: Add ADC support on stm32f103-minimum board. + From Alan Carvalho de Assis. + - STM32F103-Minimum: Add support for LM75 in the stm32f103-minimum + board. From Alan Carvalho de Assis. + - STM32F103-Minimum: Add an ADPS-9960 example configuration. From + Alan Carvalho de Assis. + - STM32F103-Minimum: Add board support for MAX7219 LED Matrix + controller. From Alan Carvalho de Assis. + - STM32F103-Minimum: Add USB MSC device initialzation to + stm32f103-minimum. From Alan Carvalho de Assis. + - STM32F103-Minimum: Add framebuffer driver initialization for + stm32f103-minimum board. From Alan Carvalho de Assis. + - STM32F103-Minimum: Add Nunchuck board support for + stm32f103-minimum board. From Alan Carvalho de Assis. + - STM32F4 Discovery: Add support for JLX12864G display on STM32F4 + Discovery board. From Alan Carvalho de Assis. + - Viewtool-STM32F107: Add support to auto-mount the procfs file system. + - Photon: Support SPI1 and SPI3. From Anthony Merlino. + - STM32F334-DISCO: Add lower half driver for high power LED + (powerled). From Mateusz Szafoni. + - STM32F334-DISCO: Add flash mode support for powerled driver. From + Mateusz Szafoni. + - STM32F334-DISCO: Add powerled example configuration. From Mateusz + Szafoni. + - STM32F334-DISCO: Add lower-half driver for SMPS (buck-boost onboard + converter). From Mateusz Szafoni + - Nucleo-F334R8: Add logic for zero latency high priority interrupts + example. From Mateusz Szafoni. + - Nucleo-F334R8: Add highpri example configuration. From Mateusz + Szafoni. + - STM32 F4 Discovery: Added support for the LIS3DSH accelerometer on + the STM32F4 Discovery rev. C boards. From Florian Olbrich. + - STM32 F4 Discovery: ROMFS for STM32F4 Discovery board. From Tomasz + Wozniak. + - STM32 F4 Discovery: Add a USB MSC configuration. From Alan Carvalho + de Assis. + - STM32 F4 Discovery: RNDIS support on STM32F4Discovery + DM-STF4BB. + NOTE: MAC address for the host side starts 0xaa. This assignment + scheme should be fixed later. From Masayuki Ishikawa. + - STM32 F4 Discovery: Add STM32F4 Discovery board support for + Nunchuck joystick. From Alan Carvalho de Assis. + - STM3240G-EVAL: Add a configuration for testing the Framebuffer + character driver using the LCD framebuffer front. + - STM3240G-EVAL: Mount procfs if enabled. + - STM3240G-EVAL: Add support for pdcurses and the pdcurses demo + programs in the 'fb' configuration. + - Clicker2-STM32: Adds SD card, automount, and syslog file + support and fixes a few minor issues. From Anthony Merlino. + - Clicker2-STM32: Adds support for USB RNDIS device. From Anthony + Merlino. + - Olimex STM32-H407: Add serial support on the on-board UEXT + connector. Add USART6 for UEXT connector. Add nsh_uext + configuration and README update. From Jan Pobrslo. + - Nucleo-F410RB: Add support for the nucleo-F410RB board. From + Gwenhael Goavec-Merou. + - STM32F429i-DISCO: Add framebuffer driver initialization. Add a + framebuffer (fb) configuration. + - STM32F429i-DISCO: Add logic to auto-mount procfs. Enable procfs in + all configurations that use NSH. + - STM32F429i-DISCO: Enable support for the STMPE811 touchscreen + controller. Enable touchscreen and also the touchscreen testa at + apps/examples/touchscreen in the fb configuration. + - STM32F429i-DISCO: Convert NxWM configuration to use LTDC + framebuffer driver instead of SPI serial. Also reduce number of + layers from 4 to 1 in fb configuration. Only one layer is used. + - STM32L476-MDK: Add support for the on-board LEDs. + - Nucleo-L496ZG: Add DFSDM initialization. From Juha Niskanen + - Nucleo-L496ZG: Add support for SDMMC driver. From Miha Vrhovnik. + - Nucleo-L496ZG: Enable I2C4 bus with i2ctool in NSH configuration. + From Jussi Kivilinna. + - Nucleo-L496ZG: Make HSE on Nucleo-L496ZG default to enable USB. + From Miha Vrhovnik. + - Nucleo-F746ZG: Use the serial console over /dev/ttyACM0 by default. + The Nucleo-F746ZG doesn't come with Arduio RS-232 shield, then it is + better to use the serial over the /dev/ttyACM0 that is created + automatically when the board is plugged in the computer. From Alan + Carvalho de Assis. + - Nucleo-144: Adds support for the Nucleo-144 boards with + STM32F722ZE. From Bob Feretich. + + * ZiLOG Z80 + + - z80/include: compiler.h, limits.h, types.h: Update SDCC/z80 files + to include support for long long, inline, __FILE__, and __func__. + + * C Library/Header Files: + + - include/: Add stdnoreturn.h. Holds definitions for the C11 + noreturn keyword. Applies to C too. + - include/netinet/tcp.h: Add trivial standard tcp.h header file. + - libc: Add support for readv() and writev(). + - libc: Adds tcflow(). + - libc: Add support for sigwait(). + - libnx: Changes to allow the font subsystem to be built without + enabling the entire graphics system (CONFIG_NX). Adds + CONFIG_NXFONTS and CONFIG_NXGLIB. Needed to duplicate some Kconfig + setting for NXFONTs if it can be configured and built independently + of NX. + + * Tools: + + - tools/configure.sh: Add special support so that you can start with a + windows native configuration and install on a different host (and + vice versa). + - tools/configure.c: Duplicate new functionaity added to configure.sh. + - tools/configure.sh: This commit adds a -m option for macOS. For + anyone not aware, Apple renamed OSX to macOS recently; thus the 'm' + instead of 'o'. This does not change the other uses of *_OSX to + macOS. From jeditekunum. + - tools/configure.c: Update functionality to match last change to + tools/configure.sh. + + * NSH: apps/nshlib: + + - apps/nshlib: mount command no long uses the non-standard OS + interface foreach_mountpoint(). Now simply cats /proc/fs/mount + when there are no arguments to the mount command. + - apps/nshlib: df command no long uses the non-standard OS interface + foreach_mountpoint(). Now simply cats /proc/fs/blocks or + /proc/fs/usage. + - apps/nshlib: The free commands no longer used mallinfo() to get + the state of the use heap. Two reasons: That is not useful + information in the kernel build. And (2) there are other memory + resources of interest in other configurations such as the Kernel + heap in PROTECTED and KERNEL builds, and the prog mem uses when + FLASH is used to hold modifiable data. The free command has been + extended to just dump the content of procfs entries and to include + all of these other memory resources of the procfs entries are + available. + + * Examples/Tests: apps/examples: + + - apps/examples/fb: Add a simple test for the framebuffer character + driver.. + - apps/examples/ostest: sem_open() now returns SEM_FAILED in the + event of a failure. + - examples/ostest: Extend cancellation test to make sure that + cancelable threads waiting on a message queue or on a signal can be + canceled. + - Added a simple reader example for the LIS3DSH acceleration sensor + on STM32F4Discovery. From Florian Olbrich. + - apps/examples/apa102: Add a Rainbow example for APA102 LED Strip. + From Alan Carvalho de Assis. + - apps/examples/flowc: Add a simple test of serial hardware flow + control. + - Add powerled driver example. From Mateusz Szafoni. + - apps/examples/ina219: A simple infinite loop that polls the INA219 + sensor and displays the measurements. From Sebastien Lorquet. + - apps/examples/alarm: Add options for reading alarm value and + canceling it. From Juha Niskanen. + - Add -n samples to lm75 app and replace Centigrade with Celsius. + From Alan Carvalho de Assis. + - apps/examples/adps9960: Add ADPS-9960 example. From Alan Carvalho + de Assis. + - apps/examples/obd2: Add OBD2 example application. From Alan + Carvalho de Assis. + - apps/examples/userfs: Add a test case for verifying UserFS. + - apps/examples/smps: Add SMPS driver example. From Mateusz Szafoni. + - apps/examples/pdcurses: Bring in pdcurses demos and make them + conform to the NuttX coding style. + - apps/examples/pdcurses: Add a very simple example that just shows + the entire character set (7-bit only). It adapts to the size of + the framebuffer and, hence, can be used with very tiny displays. + In fact it looks really dumb on big displays. + - apps/examples/nunchuck: Add Nunchuck example application. From + Alan Carvalho de Assis. + + * File System Utilities: apps/fsutils: + + - apps/fsutils/mkfatfs: Move mkfatfs from the OS to here. + + * Network Utilities: apps/netutils: + + - apps/netutils/netlib: Add netlib_ipv6adaptor() and + netlib_ipv4adaptor(). + - apps/netutils/netlib: Add helpers for reading the routing table: + netlib_read_ipv4route() and netlib_read_ipv6route(). + - apps/netutils/netlib: Add new utilities netlib_ipv[4|6]router() + that can be used to determine the IP address of a router that would + be used some some destination IP address that is not locally + accessible. + - apps/netutils/ftpc: Adds support for IPv6 and fixes various + transfer issues. From Anthony Merlino. + + * CANUtilities: apps/canutils: + + - apps/canutils/libobd2: Add libobd2 for NuttX. From Alan Carvalho + de Assis. + + * Graphics: apps/graphics: + + - graphics/traveler: Convert to use the framebuffer driver. + - apps/graphics/pdcurs34: This commit brings the public domain + pdcurses library into NuttX. NuttX graphics support based on the + framebuffer character drivers has been integrated. Input is + currently limited to a discrete joystick driver. + + * Wireless Utilities: apps/wireless: + + - apps/wireless/ieee802154/i8sak: Adds socket interface support. You + can now use both socket or char driver to control the MAC layer. + From Anthony Merlino. + - apps/wireless/ieee802154/i8sak: Adds sniffer port option and a few + other get/set parameters. From Anthony Merlino. + - apps/wireless/ieee802154/i8sak: Changes 'notif' to 'primitive' + corresponding to the changes in the Kernel. From Anthony Merlino. + - apps/wireless/ieee802154/i8sak: Channel setting is now saved + locally, so when performing a startpan or assoc, the channel + previously set is still used, even though the MAC layer gets reset. + From Anthony Merlino. + - apps/wireless/ieee802154/i8sak: Adds ability to get/set rxonidle + setting for MAC layer. From Anthony Merlino. + - apps/wireless/ieee802154/i8shark: Adds i8shark, a sniffer "adapter" + that captures all 802.15.4 traffic, packages it into a Wireshark ZEP + packet, and sends it to a host running Wireshark From Anthony + Merlino. + + * System Utilities (apps/system) + + - apps/system/ping and ping6: This commit removes the ping and ping6 + commands from NSH and replaces then with the apps/system/ping and + apps/system/ping6 built-in commands. The NSH ping[6] commands had + to be removed because they violated the portable POSIX OS interface. + The apps/system/png and ping6 command uses the sem-standard + IPPROTO_ICMP and IPPROTO_ICMP6 socket interfaces. + + * Platform-Specific Support (apps/platform) + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Task Environment Creation: Fix an error in the duplication of the + child tasks environment in the special case where the parent's + environment was created, but then all of the variables were unset. + In that case, there is still an allocation in place but the size of + the allocation is zero. This case was not being handled correctly + when a child task attempts to create its environment and inherit the + zero-size partent environment. Noted by Anthony Merlino. + - timer_create(): Fix watchdog resource leak if cannot allocate a new + timer. From Bruno Herrera. + - OS Internal Functions: Internal OS functions should not return error + information via the user errno variable: This includes functions + like file_seek(), file_read(), file_write(), etc. The complete list + is too long to duplicate here (please refer to the ChangeLog for + details). + - OS Internal Functions: Not only should internal OS functions not + modify the errno variable, they should never introduce cancellation + points: psock_connect(), psock_listen(), psock_getsockopt(), etc. + The list is too long to duplicate here (please refer to the + ChangeLog for details). + - OS Internal Functions: Create OS internal versions of many + applications functions that were used by the OS. The new versions + differ from the application interfaces in that (1) they do not + return error information via the errno variable, and (2) they never + create cancellation points. This includes new internal interfaces + like nxsem_init() that is like sem_init(), etc. There are too many + to list here (see the ChangeLog for details). + - Task Exit: task_exithook.c fails to link if signals are disabled + because was unconditionally trying to send the SIGCHLD signal to the + parent in certain configurations. Noted by Jeongchan Kim. + - memalign(): Fix heap corruption caused by using unaligned chunk + size. Unaligned nodes generated by memalign later cause heap + corruptions when nodes are shrink further (for example, 24 bytes -> + 8 bytes, when alignment is 16 bytes). From Jussi Kivilinna. + - SMP: In sched/sched/sched_cpuselect.c, in order to find the cpu + with the lowest priority thread, we have to remember the already + found lowest priority. Noted by Anonymous in Issue #75. + - spinlocks: Disable local interrupts in spin_setbit() and + spin_clrbit() in order to avoid a deadlock condition. From Masayuki + Ishikawa. + - atexit()/on_exit(): Clear atexit()/on_exit() function pointer + before calling it. On most archs, up_assert() calls exit() so + without this change, if atexit() function triggers an assertion we + are in endless loop. From Juha Niskanen. + + * File System/Block and MTD Drivers: + + - tmpfs: Fixed directory unlocking in tmpfs_opendir. From Dmitriy + Linikov. + - fcntl(): fcntl() did not return success fail for F_SETFL. Reported + by Jussi Kivilinna. + - tcdrain(): tcdrain() was recently added to the NuttX C library. + But there is a problem. The specification of tcdrain() requires + that it be a cancellation point. In order to do this, tcdrain was + moved from the C library into the OS and the addition cancellation + point hooks were added. In non-FLAT builds, access via system calls + is also now supported. + - FS FAT: Fix hard-fault when listing contents of FAT root. From + Jussi Kivilinna. + - procfs: Correct a problem that was causing an apparent directory to + be reported as a file instead of a directory by opendir. This + happened after adding these three new procfs entries: fs/block, + fs/mount, and fs/usage. Of course, there is no directory fs in this + case, only three files that have fs/ in their relative pathnames. + The logic was detecting that fs was the name of the enty to report, + but it was then declaring that fs was a file (because fs/block is of + type file). This was fixed by adding a check for matching lenghts. + i.e., if strlen(fs) != strlen(fs/block), then report fs as a + directory instead of a file. + - procfs: Fix uptime being clse to maximum 32-bit value in certain + config. From Juha Niskanen. + + * Binary Loader: + + - binfmt/: Don't schedule starthook if there are no constructors. + + * Graphics/Display Drivers: + + - LCD: ILI9341 initialize method not permitted to set errno. + + * Networking/Network Drivers: + + - Networking: net/netdev/netdev_ifconfig.c: Was not returning all of + the address info. + - Networking: In some cases, packets are still not sent behind the + router. I found that NuttX sends the ARP requests not to the router + but to the target. Mistake in file net/route/netdev_router.c. From + Aleksandr Kazantsev. + - SIOCGIFCONF and SIOCGLIFCONF IOCTL commands should only report on + network adatpors in the UP state. + - recvfrom(): Fix double leave_cancellation_point on error path. + From Jussi Kivilinna. + - send(): Verify that sock descriptor is valid. Fixes assertion when + using send on closed socket. From Jussi Kivilinna. + - sendto(): Remove assert check for null psock and buf input + pointers. Removes check as 'psock == NULL' altogether because that + checked for later in psock_send and psock_sendto. Change null check + for 'buf' so that it is handled same as in recvfrom.c (return + -EINVAL instead of assert). From Jussi Kivilinna. + - sockgetname() files need to include udp/udp.h and tcp/tcp.h or + otherwise NET_UDP_HAVE_STACK and NET_TCP_HAVE_STACK are undefined + and the logic is never compiled. Noted by Anthony Merlino. + - dup()/dup2(): There was a reference counting problem in the TPC + logic of net_clone(). net_clone() which is the common logic + underlying dup() and dup2() for sockets. When net_clone() calls + net_start_monitor() and net_start_monitor() returns a failure + (because the underlying TCP connection) then net_clone() must back + out the reference count on the structure. Problem noted by Pascal + Speck and this implementation of the solution is based on his + suggestion. + - close(): There was a possible recursion that could eventually + overflow the stack. The error occurred when closing the socket with + inet_close() while a socket callback was still queued. When the + socket callback was executed by devif_conn_event(), this resulted in + a call to psock_send_eventhandler() with TCP_CLOSE flag set which + then called tcp_lost_connection(). tcp_shutdown_monitor() then + called tcp_callback() again, which again called + psock_send_eventhandler(), and so on.... Noted by Pascal Speck. + Solution is also similar to a solution proposed by Pascal Speck. + - inet: Add check for protocol before handing out TCP and UDP sockets. + - IP Forwarding: Fixes typo that caused build error when IP + forwarding was enabled with CONFIG_NET_ICMPv6_NEIGHBOR enabled as + well. From Anthony Merlino. + - IP Forwarding: Do not add link layer header size to d_len inside + devif_forward(). From Anthony Merlino. + - TCP Networking: When CONFIG_NET_TCP_WRITE_BUFF=y there is a + situation where a NULL pointer may be dereferenced. In this + configuration, the TCP connection's 'semi-permanent' callback, + s_sndcb was nullified in tcp_close_disconnect. However, other logic + in tcp_lost_connection() attempt to use that callback reference + after it was nullifed. Fixed in tcp_lost_connectino() by adding a + NULL pointer change before the access. This was reported by Dmitriy + Linikov in Bitbucket Issue 72. + - UDP Broadcat: Fix some issues with regard to UDP broadcast + handling. This is Bitbucket Issue #77. + - ICMP: Fix an error in the poll logic. It was assumed that the + input parmeter pvconn was valid. It was not. Instead, the poll + logic must work like the sendto() and recvfrom() logic: It must + keep a copy of the conn structure in the private data. + - ICMPv6: Fixes several errors preventing icmpv6_radvertise.c from + being compiled. Fixes conversions to network byte order (namely + vlifetime, plifetime, mtu). IPv6 source address is set to + link-local IP address instead of the address in the netdev + structure. This is in compliance to RFC 4861. RA didn't work on + Linux before this change. Finally, router prefix and prefix length + are derived from the IPv6 address and netmask in the netdev + structure. This seems to make more sense than using a predefined, + separate prefix from the config. From Sakari Kapanen. + - ICMPV6: icmpv6_input() needs to set d_len to 0 after consuming echo + reply, otherwise, garbage will get sent out. From Anthony Merlino. + - ICMPV6: Fix an error in the poll logic. It was assumed that the + input parmeter pvconn was valid. It was not. Instead, the poll + logic must work like the sendto() and recvfrom() logic: It must + keep a copy of the conn structure in the private data. + - IGMPv2 Send: Fix incoming IGMP checksum calculation. From Louis + Mayencourt. + - ARP: Fix IGMP Ethernet address computation. From Louis Mayencourt. + + * Wireless/Wireless Drivers: + + - CC1101: CC1101 driver not permitted to set errno. + - 6LoWPAN: Correct an error in uncompressing multicast address. + - 6LoWPAN: Correct a bug in handling uncompressed frames (IPv6 + dispatch). Adds a separate local variable, protosize, to keep track + of the size of thep protocol header. + - 6LoWPAN: Fix an endian-ness problem in 6LoWPAN address + decompression. From Anthony Merlino. + - 6LoWPAN: The logic that extracts interface identifier from the IP + address needs to be generalized to handle cases where the address is + not a link local address. From Anthony Merlino. + + * Common Drivers: + + - Serial: 16550 UART driver IOCTL method must not set errno; it must + return a negated errno value. + - LIS3DSH: Added the argument parameter (FAR void *arg) to the + interrupt handler provided by the LIS3DSH driver to fit the + definition for ISRs in xcpt_t. Changed the check for working queue + availability in lis3dsh interrupt handler to use work_available() + and not crash in case of an overrun. From Florian Olbrich. + - LIS2DH: Fixes for self-test. From Jussi Kivilinna. + - LIS2DH: Fix use of obsolete dbg macro. From Jussi Kivilinna. + - LIS331DL: LIS331DL driver not permitted to set errno. + - HTS221: Power-on sensor for loading calibration data. From Jussi + Kivilinna. + - MCP2515: Fix the MCP2515 Bit Rate Prescale calculation. Fix BRP + for SET_BITTIMING ioctl as well. From Alan Carvalho de Assis. + - STMPE811: Fix GPIO operation of STMPE811 driver. + 1. STMPE811_GPIO_DIR was defined for register name and later was + redefined to be the pin direction mask for `stmpe811_gpioconfig`. + I decided to change register name to be STMPE811_GPIO_DIR_REG, and + keep pin direction mask STMPE811_GPIO_DIR, so that any external + code that already use this driver will be unchanged. + 2. The STMPE811 register GPIO_DIR uses bit value 1 for output and 0 + for input, but `stmpe811_gpioconfig` set the opposite. + 3. The call to `stmpe811_gpiowrite` from inside of + `stmpe811_gpioconfig` leaded to deadlock. + From Dmitriy Linikov. + - BQ2429X: Add BATIO_OPRTN_SYSON for enabling BATFET after SYSOFF. + From Jussi Kivilinna. + + * Simulation: + + - Simulation: Serial and console drivers are not permitted to set + the errno. + + * ARMv7-M: + + - ARM Stack Check: Fix assert panic when both TLS and interrupt stack + are enable. From Jussi Kivilinna. + + * Infineon XMC4xxx Drivers: + + - XMC4 USIC: Kconfig was not selecting XMC4_USIC for USIC1. From Alan + Carvalho de Assis. + - XMC4 UART: Fix XMC4xxx USIC UART sginal to be high level when in idle. + From Alan Carvalho de Assis. + - XMC4 UART:xmc4_uart_configure() expects the channel# not uartbase as + an input parameter. From Alan Carvalho de Assis. + - XMC4 UART: Enable RX/TX status. From Alan Carvalho de Assis. + - XMC4 UART: The Alternative Receive Interrupt was not being + configured. + + * Infineon XMC4xxx Boards: + + - XMC4500-Relax: Setup max. freq. 120MHz and setup pull-up to UART + RXD pin. From Alan Carvalho de Assis. + + * Microchip/Atmel SAMv7 Drivers: + + - SAMv7: DAC and ADC drivers are not permitted to set the errno. + - SAMv7: Correct an error in RX DMA setup. From Manish Kumar Sharma. + - SAMv7 USB: It is necessary to disable pre-emption and interrupts + around a loop that copies TX data into the hardware in order to + avoid a TX data underrun condition. From Anthony Merlino. + + * NXP/Freescale LPC31xx Drivers: + + - LPC31xx: Serial and console drivers are not permitted to set + the errno. + + * NXP/Freescale LPC43xx: + + - lpc43xx: lpc43_adc.c was being selected by the build system wehn + DAC was selected. + + * NXP/Freescale LPC43xx Drivers: + + - LPC43xx Ethernet: Fix some backward logic setting full-duplex and + 100mbps when autoconfiguration is disabled. Noted by Anonymous in + Issue #76. + - lpc43xx: UART_RX pins should be configured with input buffers + enabled. Otherwise it cannot be read. From Alexander Vasiljev. + + * STMicro STM32: + + - STM32 F2: Fixed build for STM32F20XX platforms when + CONFIG_STM32_DMACAPABLE is enabled. From Dmitriy Linikov. + - STM32 F4: Remove ltdc.h and dma2d.h. Those header files in that + location permitted inclusion into application space logic and, + hence, facilitated and encouraged calling into the OS and violating + the portable POSIX OS interface. The definitions in those header + files were move the appropriate location in the counterpart, + architecture specific files at arch/arm/src/stm32/dma2d.h and ltdc.h. + - STM32 L4: Build stm32l4_idle.c only if CONFIG_ARCH_IDLE_CUSTOM is + not enabled. From Jussi Kivilinna. + - STM32 F7: Remove ltdc.h and dma2d.h. Those header files in that + location permitted inclusion into application space logic and, + hence, facilitated and encouraged calling into the OS and violating + the portable POSIX OS interface. The definitions in those header + files were move the appropriate location in the counterpart, + architecture specific files at arch/arm/src/stm32f7/dma2d.h and + ltdc.h. + + * STMicro STM32 Drivers: + + - STM32: DAC and ADC drivers are not permitted to set the errno. + - STM32 ADC: Clear pending interrupts. From Mateusz Szafoni. + - STM32 CAN: Lower part of STM32 CAN driver + arch/arm/src/stm32/stm32_can.c uses all three hw tx mailboxes and + clears TXFP bit in the CAN_MCR register (it means transmission order + is defined by identifier and mailbox number). + This creates situation when order frames are put in upper part of + CAN driver (via can_write) and order frames are sent on bus can be + different (and I experience this in wild). Since CAN driver API + pretends to be "file like" I expect data to be read from fd the same + order it is written. So I consider described behaviour to be a bug. + Fixed by settin the TXFP bit in the CAN_MCR register (FIFO + transmit order). From comments by Alexey T, in Bitbucket Issue 73. + - STM32 HRTIM: Fix pclk calculation. From Mateusz Szafoni. + - STM32 HRTIM: Fix burst mode prescaler update. From Mateusz Szafoni. + - STM32 (alt) I2C: Ensure proper error handling. Injecting data + errors would cause the driver to continually reenter the isr with + BERR an RxNE. This fix allows the error to be cleared and + propagated to the waiting task. From David Sidrane. + - STM32: LTDC and DMA2D drivers are not permitted to set the errno. + - STM32 RTC: Workaround for potential subseconds race condition. In + all recent STM32 chips reading either RTC_SSR or RTC_TR is supposed + to lock the values in the higher-order calendar shadow registers + until RTC_DR is read. However many old chips have in their errata + this silicon bug (at least F401xB/C, F42xx, F43xx, L15xxE, L15xVD + and likely others): "When reading the calendar registers with + BYPSHAD=0, the RTC_TR and RTC_DR registers may not be locked after + reading the RTC_SSR register. This happens if the read operation is + initiated one APB clock period before the shadow registers are + updated. This can result in a non-consistency of the three + registers. Similarly, RTC_DR register can be updated after reading + the RTC_TR register instead of being locked." + - STM32 Serial: Do not stop processing input in SW flow-control + mode. From Juha Niskanen. + - STM32F33xxx ADC: Add some publicly visable interfaces and some + code to support injected channels. From Mateusz Szafoni. + - STM32F33xxx DMA: Add public interface to handle with DMA + interrupts. From Mateusz Szafoni. + - STM32F33xxx RCC: Fix CAN clock enable. From Mateusz Szafoni. + - stm32 F4 I2C: Ensure proper interrupt handling. Injecting data + errors that causes a STOP to be perceived by the driver, will + continually re-enter the isr with SB not set and BTF and RxNE set. + This changes allows the interrupts to be cleared and propagates a + I2C_SR1_TIMEOUT to the waiting task. From David Sidrane. + - STM32 L4 Serial: Do not stop processing input in SW flow-control + mode. From Juha Niskanen. + - STM32 F7: LTDC and DMA2D drivers are not permitted to set the errno. + - STM32 L4: DAC and ADC drivers are not permitted to set the errno. + - STM32 L4 DAC: Do not configure output pin if it is not used. From + Juha Niskanen. + - STM32 L4 RTC, PM: Small fixes to subseconds handling, ADC + power-management hooks + - STM32 F4 RTC: Fix reading alarm value that is more than 24h in + future. From Juha Niskanen + - STM32 L4 RTC: Fix reading alarm value that is more than 24h in + future. From Juha Niskanen + - STM32 L4 TIM: Fix compilation of timers with complementary outputs + when not PWM_MULTICHAN. From Juha Niskanen. + - STM32 L4 RCC: Restore backup-registers after backup-domain reset. + From Jussi Kivilinna. + - STM32 L4 RTC: Correct RTC_SSR and RTC_TR read ordering. In all + recent STM32 chips reading either RTC_SSR or RTC_TR is supposed to + lock the values in the higher-order calendar shadow registers until + RTC_DR is read. Change the register read ordering to match this and + don't keep a workaround for a hypothetical race condition (not in + any L4 errata, lets for once assume ST's silicon works as it is + documented...) + - STM32 L4 RTC: Init mode was never exited because nested locking in + rtc_synchwait() disabled backup domain access. From Juha Niskanen. + - STM32 L4 RTC: Use backup register magic value instead of INITS + bit. The INITS (bit 4) of RTC_ISR register cannot be used to + reliably detect backup domain reset. This is because we can operate + our device without ever initializing the year field in the RTC + calendar if our application does not care about correct date being + set. Hardware also clears the bit when RTC date is set back to year + 2000. From Juha Niskanen. + - STM32 L4 RTC: Put back the SSR race condition workaround. ST has + confirmed that the issue has not been fixed, and that it applies to + STM32 L4 too (was not in errata sheets due to documentation bug) See + discussion: https://community.st.com/thread/43710-issue-with-rtc-maximum-time-resolution . + From Juha Niskanen. + - STM32 F7 BBSRAM: Avoid assert in stm32_bbsram_savepanic. If panic + happens before stm32_bbsram is initialized, stm32_bbsram_savepanic + caused additional assert panic. Function has null pointer check, so + drop DEBUGASSERT. From Jussi Kivilinna. + - STM32 F7 I2C: fix I2C_M_NORESTART handling. From Jussi Kivilinna. + - STM32 F7 I2C: Restore bus frequency after I2C reset. Copy + frequency restoration fix from STM32L4 I2C driver to STM32F7 I2C + driver. From Jussi Kivilinna. + - STM32 F7 RTC: Fix reading alarm value that is more than 24h in + future. From Juha Niskanen + + * STMicro STM32 Boards: + + - STM32F334-DISCO: Add missing ram_vectors configuration in linker + script. From Mateusz Szafoni. + - Nucleo-F334R8: Add missing ram_vectors configuration in linker + script. From Mateusz Szafoni. + - Nucleo-F334R8: Add Missing ADC trigger configuration tot he highpri + configuration. From Mateusz Szafoni. + - STM3240G-EVAL: The timer frequencies (BOARD_TIMx_FREQUENCY) are + incorrectly defined inboard.h. Since the APB prescalers are set to + divide by 4 and 2 respectively, the frequencies should be "2xAPBx" + as said in the comment. The correct frequencies are already defined + but as STM32_APBx_TIMx_CLKIN. From Mattias Edlund. + - STM32F429i-DISCO: The ltdc configuration has been deleted because + it violated the portable POSIX OS interface. It used + apps/examples/ltdc and include ltdc.h and dma2d.h which were also + removed for the same reason. + + * ZiLOG Z80 + + - configs/z80sim and xtrs: Serial driver lower halfs ioctl methods + should return a negated errno value, not set the errno variable. + - z80 Make.defs: Fixes dependency generation with newest SDCC + compiler. + - configs/z80sim: Fix a naming problem. Also, don't try to build the + serial driver if CONFIG_NFILE_DESCRIPTOR=0. + - Z80: Makefile fix for use with current SDCC. + + * Build System + + - configs/: All defconfig filess that include + CONFIG_NET_ICMPv6_SOCKET=y need to select CONFIG_SYSTEM_PING6=y and + deselect CONFIG_DISABLE_POLL. + - configs/: All NX configuration... Because of recent changes to + libnx/nxfonts, Supported bit per pixel must be separated specified + for NXFONTs too and need to match the select BPP for NX. + - Build system: Fix CONFIG_BUILD_KERNEL logic directories that have + ubin and kbin subdirectories. Conditional logic was fine for + CONFIG_BUILD_FLAT and CONFIG_BUILD_PROTECTED but generated useless + dependencies if CONFIG_BUILD_KERNEL. + + * C Library/Header Files: + + - libc/stdio: Build the lib_noflush() and lib_snoflush() stubs even + if CONFIG_FILE_DESCRIPTORS=0. They may still be needed. + - libc and libnx: When the libraries are built into two libraries, a + user space library and a OS space library (as in the PROTECTED and + KERNEL build). Then the user space library must not use the OS + internal interfaces; similarly, the OS must avoid using the + userspace interfaces so that it does not muck the errno value or + create spurious cancellation points. + - libc/match: Use of exp() vs expf() in logf() caused function to be + slow. From Alan Carvalho de Assis. + - libnx: Fixes a memory leak that is caused because the client message + queue is not unlinked after the client disconnects from the NX + server. From Masayuki Ishikawa. + - sscanf(): Fix sscanf() character conversion (%c): do not add '\0' at + the end as for strings, cause, for example, parsing one character + will fill two bytes: character itself and zero one '\0' after it, so + will overflow one byte variable argument and corrupt memory for + variables allocated after it. From Oleg Evseev. + + * Tools + + - tools/: configure.sh and configure.c should redirect stdout to + /dev/null but should not suppress stderr output. + + * NSH: apps/nshlib: + + - apps/nshlib/: Avoid truncating the strcmp result in the parser + into a unsigned char variable. nshlib/nsh_netcmds.c: Check for + valid hostip before using it. From Bruno Herrera. + - apps/nshlib/: Fix resouce leak in 'dd' commenad when 'if=' or + 'of=' params are repeated in the command line. For example: + dd if=/dev/null if=/dev/zero of=/dev/null or + dd if=/dev/zero of=/dev/zero of=/dev/null. From Bruno Herrera. + - apps/nshlib: This commit eliminates the ping and ping6 commands + from NSH and replaces them with 'built-in' commands at + apps/system/ping and ping6. The original NSH version of ping[6] + commands violated the portable POSIX interface and, hence, had to + be removed. The new system/ping and ping6 built-in commands uses + the new IPPROTO_ICMP AF_INET and IPPROTO_ICMP6 AF_INET6 datagram + sockets to implement ping. + - apps/nshlib: Fix parsing of empty strings when CONFIG_NSH_CMDPARMS + is not defined. Problem noted by Juha Niskanen. + + * Examples/Tests: apps/examples: + + - All configurations that use NXIMAGE or NXHELLO must select + NX_MULTIUSER. All configurations that use examples/nxterm must + enable CONFIG_LIB_BOARDCTL. + - All configurations that use NXLINES must select NX_MULTIUSER. All + configurations that use the NX server need to have larger POSIX + messages. + - apps/examples/adc: Fix g_adcstate.count initialization. From + Masayuki Ishikawa. + - apps/examples/elf: Remove low-level interfaces and replace with + call to exec(). + - apps/examples/nxflat: Remove low-level interfaces and replace with + call to exec(). + - examples/ostest: Works around a bug in printf() when cancellation + points are enabled. printf() is a cancellation point because it + calls write(). This is correct according to OpenGroup.org. + However, printf holds the stdio library semaphore when it is + canceled and this leaves the semaphore in a bad state. No fix for + the printf bug yet. + - apps/examples/nx: The NX example no longer supports single user + mode. + - apps/examples/nxtext: The nxtext example no longer supports single + user mode. + - apps/examples/nxhello now supports only multiuser mode. + - apps/examples/nximage now supports only multiuser mode. + - examples/nxlines: Now supports only multiuser mode. + + * Network Utilities: apps/netutils: + + - apps/netutils/ftpc: Fix some crazy comparisons to determine is a + file is an absolute path. Noted by Anthony Merlino. + + * System Utilities (apps/system) + + - apps/system/i2ctool: Fixed i2ctool write operation in `no restart` + mode (flag `-n`). It seems that I2C driver has changed a bit since + i2ctool was written, so now i2ctool sends repeated start even if + `no restart` flag (-n) was passed to it. From Dmitriy Linikov. + +NuttX-7.24 Release Notes +------------------------ + +The 124th release of NuttX, Version 7.24, was made on March 2, 2018, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.24.tar.gz and +apps-7.24.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - SMP: Introduce spin_lock_irqsave() and spin_unlock_irqrestore(). + These APIs are simplified version of enter_critical_section() + and leave_critical_section() to protect data (e.g. registers) in + SMP mode. By using these APIs inside drivers, performance will + be improved. From Masayuki Ishikawa. + - System Timer: Replace critical section APIs with spinlock APIs. + (64bit only). If SMP=n or SMP=y && SPINLOCK_IRQ=n, this works + in the same way as before. If SMP=y && SPINLOCK_IRQ=y, performance + will be improved. From Masayuki Ishikawa. + - POSIX Timers: Replace critical section APIs with spin lock APIs in + clock_gettime.c. This change will improve performance for SMP + systems but nothing changes for non-SMP systems. In SMP mode, + the running TCB is not always at the g_readytorun.head. From + Masayuki Ishikawa. + - SMP: Introduce spin_lock_wo_note() and spin_unlock_wo_note(). These + APIs are used in sched_note.c to protect instrumentation data. The + difference between these APIs to exsiting spin_lock() and + spin_unlock() is that they do not perform instrumentation to avoid + recursive call when SCHED_INSTRUMENTATION_SPINLOCKS=y. From + Masayuki Ishikawa. + - Interrupts: Add a configuration option to show interrupt + information via a procfs file. + + * File Systems/Block and MTD Drivers + + - VFS: Add support for truncate() and ftruncate(). + - FAT, SmartFS, UserFS, UnionFS, TmpFS, NFS: Add truncate() support. + - FAT. Effectively handles the situation when a new file position is + within the current sector. Accelerates the work of the FS with a + multitude of operations to write small pieces of data within the + current sector. From Aleksandr Vyhovanec. + + * Graphics/Display Drivers: + + - HiletGo OLED: Add configuration support for HiletGo SSD1306 OLED. + - lcd/ft80x: This commit adds an FTDI/BridgeTek FT80x GUI driver. It + is untested (I don't even have hardware yet) and, hence, it is + marked as EXPERIMENTAL). + + * Networking/Network Drivers: + + - 6LoWPAN: Adds configuration options for specifying preloaded + address contexts for compression From Anthony Merlino. + - TCP: Introduce tcp receive window control based on I/O buffer. + NOTE: The algorithm is still experimental but useful for http + streaming. From Masayuki Ishikawa. + - UDP: Add an implementation of UDP write buffering. + - Routing Tables: Adding ftruncate() support eliminates an issue + in file-based routing table management system. + - Telnet: Add support for Telnet character mode From Masayuki + Ishikawa. + + * Other Common Device Drivers: + + - drivers/input/ft5x06.c: Add a driver for the FT5x06 capacitive, + multi-touch, touchscreen controller. + - drivers/input/ft5x06: Add a polled mode of operation for the FT5x06 + in attempt to work around the fact that the LPCXpresso-LPC54628 + chose a non-interrupt pin for the FT5x06 interrupt. Driver is still + not yet functional. + - drivers/power/bq2429x.c: Add trickle charging mode From Juha + Niskanen. + - drivers/sensors: Add support to MAX44009 ambient light sensor. + From Juha Niskanen. + - drivers/sensors: Added support for LIS3DH accelerometer sensor. + From Matt Thompson. + - drivers/eeprom: EEPROM driver for AT24xx compatible EEPROMs. + From Sebastien Lorquet. + + * Simulation + + - sim: Add support for a RAM MTD driver and initialization for use + with SmartFS. + - sim: Add support for testing NXFFS. + + * ARM: + + - ARMv7-A, ARMv7-R, ARMv7-M: Add atomic read-add-write and + read-subtract-write functions. + + * Infineon XMC4xxx: + + - XMC4xxx: Refactor PLL setup, refactored PLL/CLK config, easier, + checks for correctness, call go_os_start if STACK_COLORIZED, smarter + config of EXTCLK output freq. From David Alessio. + + * Infineon XMC4xxx Boards: + + - Add FPU to xmc4 ostest. Remove +x from makefiles, preserve + .gdbinit across make clean, add FPU support to ostest on xmc4, + add FPU test to ostest on xmc4 From David Alessio. + + * Microchip/Atmel SAMD/L Drivers: + + - SAMD: SAMD External Interrupt Controller (EIC) support From Matt + Thompson. + - SAMD/L: Added Analog Comparator basic initialization From Matt + Thompson. + - SAMD/L: Added FDPLL clock support. Fixed sequence of OSC32K + calibration setup. From Matt Thompson. + - SAMD/L: Added loading factory USB calibration data from NVRAM. + From Matt Thompson. + - SAMD/L: Added experimental DMA support to SPI driver. spi_exchange() + uses a pair of DMA channels for TX and RX. From Matt Thompson. + + * Microchip/Atmel SAM3/4 Boards: + + - Flip&Click SAM3X: Add board support for the Mikroe Flip&Click + SAM3X. + - Flip&Click SAM3X: Adds basic board support for the HiletGo OLED. + + * Microchip PIC32MZ + + - PIC32MZEF: Add architectural support for the PIC32MZEF family. + + * Microchip PIC32MZ Boards + + - Flip&Click PIC32MZ: Adds board support for the Mikroe Flip&Click + PIC32MZ board. + - Flip&Click PIC32MZ: Add board support for HiletGo OLED. + - Flip&Click PIC32MZ: Add an nxlines configuration for use in + testing the custom HiletGo Click board. + + * NXP Freescale LPC43xx Drivers: + + - LPC43xx: Adapt LPC176x RTC driver for the LPC43xx. From Gintaras + Drukteinis. + - LPC43xx: Add Windowed Watchdog Timer (WWDT) driver. Tested on + LPC4357 but should be compatible for all LPC43xx MCUs. + From Gintaras Drukteinis. + - Leverage the LPC54xx SD/MMC back to the LPC43xx (where it came from + originally). + + * NXP Freescale LPC43xx Boards: + + - Bambino-200e: Add LPC43 SDMMC board support to Bambino-200E. From + Alan Carvalho de Assis. + + * NXP Freescale LPC54xx: + + - LPC546xx: Added basic architectural support for the LPC546xx + family. + + * NXP Freescale LPC54xx Drivers: + + - LPC546xx: Basic NSH configuration includes support for UARTs, + SysTick timer, GPIOs, LEDs, and buttons + - LPC546xx: Additional drivers include EMC, I2C, Ethernet + - LPC546xx: Implement GPIO interrupt support. + - LPC546xx: And unverified SPI driver is included. + - LPC546xx: Ported LPC1788 LCD driver to use the LPC54xx pin. + - LPC546xx: Bring in LPC43xx SD/MMC driver from + https://github.com/Smoothieware/smoothie-nuttx/tree/master/nuttx/arch/arm/src/lpc43xx + and adapt for use with the LPC43xx + - LPC546xx: Add DMA driver ported from the LPC43xx GPDMA driver. + - LPC546xx: Bring in WWDT driver from LPC43. + - LPC546xx: Add an RTC driver and a RTC character driver lower half. + - LPC546xx: Add support for a random number generator. + - LPC546xx: Add an Ethernet driver. + + * NXP Freescale LP54xx Boards: + + - LCXpresso-LPC54628: Added support for the LPCXpresso-LPC54628 + board. The initial bring-up used a basic NSH port. + - LCXpresso-LPC54628: On-board SDRAM is also supported + - LCXpresso-LPC54628: Add support for I2C2 and for the I2C tool to + the NSH configuration. + - LCXpresso-LPC54628: Add support for the USER button. Enable the + apps/examples/button test in the NSH configuration. + - LCXpresso-LPC54628: Add the fb configuration for testing the LCD. + - LCXpresso-LPC54628: Add support for the the FT5x06 touchscreen + controller. Enable the driver as well as the apps/examples + touchscreen test. + - LCXpresso-LPC54628: Add an NxWM configuration. + - LCXpresso-LPC54628: Add logic to bring up SDMMC. + - LCXpresso-LPC54628: Add logic to register the RTC character driver + if it is enabled. Enable the RTC and RTC character driver in the + NSH configuration. + - LCXpresso-LPC54628: Add a netnsh configuration that was be used to + test the Ethernet driver. + - LCXpresso-LPC54628: Add LittlevGL graphics demo configuration. + + * On Semiconductor LC823450 + + - LC823450 SMP improvements: (1) Apply irq_spin APIs to + modifyregXX, (2) Do not use modifyreg32() to enable Mutex, (3) + Modify IRQ control for i2s. Apply irq_spin APIs to + dma/syscontrol/usbdev. From Masayuki Ishikawa. + - LC823450: LC823450 http streaming improvements: (1) Use spinlock + APIs in lc823450_gpio.c. (3) Fix a potential race condition in + up_enable_irq(), (3) Use spinlock APIs instead of critical section + APIs, (4) Enable HRT_TIMER in lc823450_timerisr.c. (5) Use spinlock + APIs instead of critical section APIs. (6) Fix race conditions in + dma/usbdev. From Masayuki Ishikawa. + - LC823450: Introduce DVFS. This version only supports manual mode + and Vdd1 is fixed to 1.2V. From Masayuki Ishikawa. + + * On Semiconductor LC823450 Drivers + + - LC823450: Refactor timer driver. Add MTM timer APIs for DVFS. + Introduce up_rtc_gettime() for CONFIG_RTC_HIRES. Introduce idle + time calculation in DVFS. Also, DVFS autonomous mode based on CPU + idle time is supported. NOTE: voltage control is still disabled. + From Masayuki Ishikawa. + + * On Semiconductor LC823450 Boards + + - LC823450-XGEVK: I2S interrupt will be handled on CPU0 with this + change. Assign CPU1 to lpwork. This change will improve load + balancing for networking with RNDIS. From Masayuki Ishikawa. + - LC823450-XGEVK: Enable SPINLOCK_IRQ and NXPLAYER in rndis. From + Masayuki Ishikawa. + - LC823450-XGEVK: LC823450 http streaming improvements: (1) In SMP + mode, H/W interrupts should be handled on CPU0 to avoid deadlocks. + (2) Call up_enable_irq() to assign CPU0 for IRQ handling. (3) + Enable HRT_TIMER, LC823450_MTM0_TICK, SPINLOCK_IRQ, (4) Enable + NET_TCP_RWND_CONTROL, NXPLAYER_HTTP_STREAMING_SUPPORT (rndis only) + From Masayuki Ishikawa. + - LC823450-XGEVK: Enable DVFS in lc823450_bringup.c. Enable DVFS + in audio and rndis. Add Telnet character mode to rndis. From + Masayuki Ishikawa. + - LC823450-XGEVK: Explicitly assign I2S IRQ handling to CPU0. From + Masayuki Ishikawa. + - LC823450-XGEVK: Enable RTC_HIRES instead of RTC_DATETIME (audio/ + rndis). Disable TCP_WRITE_BUFFERS and change SCHED_LPWORKPRIORITY + (rndis). Update SMP and DVFS related part. From Masayuki Ishikawa. + + * STMicro STM32: + + - STM32 F7: Add support for the STM32F72x/73x family. From Bob + Feretich. + + * STMicro STM32 Drivers: + + - STM32 HRTIM: Add interface to change outputs SET/RST configuration. + From Mateusz Szafoni. + - STM32 HRTIM: Add interface to get timer clock frequency, + calculation, add compare/capture registers significant bits + checking. From Mateusz Szafoni. + - STM32 HRTIM: Add interface to set timer frequency, fix slave timers + reset configuration, change POWER_INFO to TIMER_INFO From Mateusz + Szafoni. + - STM32 HRTIM: Add repetition support and fix enum overflow From + Mateusz Szafoni. + - STM32 HRTIM: Add HRTIM push-pull mode configuration. From + raiden00pl. + - STM32 FLASH: Add progmem support for STM32L15XX From Juha Niskanen. + + * STMicro STM32 Boards: + + - configs/photon: Adds BOARD_TIMn_FREQUENCY macros From Anthony + Merlino. + - configs/indium-f7: Adds support for the RAF Research Indium-F7 + board. From Bob Feretich. + - Rename the configs/stm32f0discovery board directory to + configs/stm32f051-discovery. There are others stm32f0discovery + boards with different MCUs and different peripherals on the board. + From Alan Carvalho de Assis. + - configs/stm32f072b-discovery: Adds support for stm32f072b-disco + board. This is the board. I added the LEDs of this board and tested + the compilation. From Alan Carvalho de Assis. + - configs/stm32f103-minimum: Add AT24 EEPROM support on STM32F103- + Minimum board From Alan Carvalho de Assis. + - configs/stm32f103-minimum: Add support to BMP180 on BluePill + (stm32f103-minimum) board. From Alan Carvalho de Assis. + - configs/stm32f334-disco: Add buck converter and boost converter + logic. From Mateusz Szafoni. + - configs/stm32f103-minimum: Add zerocross support to STM32F103- + Minimum board From Alan Carvalho de Assis. + - configs/stm32f103-minimum: Add OLED SSD1306 support to + STM332F103-Minimum From Alan Carvalho de Assis. + - configs/stm32f103-minimum: Add board support to MAX6675 Thermocouple + sensor From Alan Carvalho de Assis. + - configs/stm32f746g-disco: Add stm32f746g-disco Ethernet configuration. + Add USART1 support (connected to the USB virtual serial port) From + Louis Mayencourt. + - configs/viewtool-stm32f107: Add support for FT80X initialization. + Add ft80x configuration that will eventually be used for testing the + ft80x if I ever receive hardware. + + * Tools: + + - tools/logparser: Add a tool which will help me to convert git logs + to ChangeLog format. + + * NSH: apps/nshlib: + + - apps/nshlib: Add support for a truncate command. This will be used + to test the new ftruncate file system support. + - apps/nshlib: Add support for Telnet character mode. From Masayuki + Ishikawa. + - apps/nshlib: Add support for '-n' option to the echo command. From + Masayuki Ishikawa. + - apps/nshlib: Add irqinfo command. + + * Examples/Tests: apps/examples: + + - apps/examples/userfs: Add truncate() support for userfs. + - apps/examples/lvgldemo: Add lvgldemo example for LittlevGL. + - apps/examples/veml6070: Add VEML6070 Application Example. From + Alan Carvalho de Assis. + - apps/examples/bmp180: Add BMP180 application example. From Alan + Carvalho de Assis. + - apps/examples/ft80x: Add a test of the FT80x based on FTDI + SampleApp. Includes tests of GPU primitives and graphics co- + processor commands. + + * Network Utilities: apps/netutils: + + - apps/netutils/netlib: Add default route in netlib_set_dripv4addr(). + From Masayuki Ishikawa. + + * Graphics: apps/graphics: + + - apps/graphics/littlevgl: Add littlevgl library. From Alan Carvalho + de Assis. + - apps/graphics/ft80x: Add the FTDU FT80x GUI support library. + Consists of some display list helpers, audio helpers, touch helpers, + RAM access, register access etc. + + * System Utilities (apps/system) + + - apps/system/nxplayer: Add support for HTTP streaming in nxplayer. + From Masayuki Ishikawa. + - apps/system/setlogmask: Adds 'setlogmask' application that allows + you to set the syslog priority via a simple command. From Anthony + Merlino. + - apps/system/usbmsc: Added Kconfig options to configure write + protection for each LUN. From Fabio D'Urso. + - system/stackmonitor: Re-design the stack monitor so that it does not + make forbidden calls directly into the OS, breaking the portable POSIX + OS interface. It now properly uses the PROCFS file system to glean + information about stack usage. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - System Timer: Change the way that the 64-bit time is sampled. + Previously, we disabled interrupts before sampling the 64-bit + timer since the uint64_t access is not atomic on most CPUs. However, + disabling (local) interrupts does not work in the SMP case. In that + case, the timer interrupt may be running on only one of the CPUs; + disabling interrupts on a different CPU will provide no protection + from timer rollover. To work around this, logic was added that + samples 64-bit timer is sampled twice and if 32-bit rollover was + detected between samples, then loops until there is no rollover. + - POSIX Timers: In SMP mode, running TCB is not always at the head of + the g_readytorun list. This change removes DEBUGASSERT() to avoid + this condition. From Masayuki Ishikawa. + - Spinlocks: Add memory barrier operations in spin_unlock(). In ARM + document regarding memory barriers, SP_DMB() must be issued before + changing a spinlock state to SP_UNLOCKED. However, we found that + SP_DSB() is also needed to ensure that spin_unlock() works + correctly for network streaming aging test. From Masayuki Ishikawa. + - Sporadic Scheduler: Fix compiler error in Sporadic Scheduler when + priority inheritance is enabled. Noted by eunb.song@samsung.com + - Priority Inheritance: Fix some priority inheritance related issues + noted during review of logic. Also add some REVISIT comments for some issues noted in the design. + - boardctl: Remove the BOARDIOC_TSCTEST_TEARDOWN and + BOARDIOC_TSCTEST_SETUP boardctl() commands. Remove all + implementations of board_tsc_teardown(). Each board now initializes + the touchscreen controller as a normal part of its board bring-up. + board_tsc_setup() is gone; the touchscreen controller is now treated + like any other on-board device. + - configs: CONFIG_MAX_TASKS must be a power of 2. + - SMP: Introduce a new global IRQ clearing logic and tasklist + protection. The previous implementation of clearing global IRQ in + sched_addreadytorun() and sched_removereadytorun() was done too + early. As a result, nxsem_post() would have a chance to enter the + critical section even nxsem_wait() is still not in blocked state. + This patch moves clearing global IRQ controls from + sched_addreadytorun() and sched_removereadytorun() to + sched_resumescheduler() to ensure that nxsem_post() can enter the + critical section correctly. For this change, + sched_resumescheduler.c is always necessary for SMP configuration. + In addition, by this change, task_exit() had to be modified so that + it calls sched_resumescheduler() because it calls + sched_removescheduler() inside the function, otherwise it will cause + a deadlock. However, I encountered another DEBUGASSERT() in + sched_cpu_select() during HTTP streaming aging test on LC823450-XGEVK. + Actually sched_cpu_select() accesses the g_assignedtasks which might + be changed by another CPU. Similarly, other tasklists might be + modified simultaneously if both CPUs are executing scheduling logic. + To avoid this, I introduced tasklist protection APIs. With these + changes, SMP kernel stability has been much improved. From Masayuki + Ishikawa. + - SMP: Fix this_task() to be an atomic operation. In the previous + implementation, this_task() was defined in sched.h by using just a + macro current_task(this_cpu()). However, I found that this is not + atomic and actually sometimes switching CPU happened in executing + the macro when we tested audio steaming plus executing commands via + Telnet. This change resolves this issue by implementing atomic + this_task()in sched_thistask.c which is newly introduced. From + Masayuki Ishikawa. + - SMP: Implements a global scheduler lock capability as part of SMP + support. This allows the scheduler to be locked with no knowledge + or access to the TCB of the currently running task. This is + necessary because accessing the TCB of the currently running task + is, itself, a non-atomic operation. This global scheduler lock + capability was add just to support that atomic access to the TCB. + - SMP: Extend the last global lock change to work with the + LC823450-XGEVK which does not support the atomic fetch add but + does support disabling interprocessor interrupts. Disabling + interprocessor interrupts will also guarantee that the TCB address + calculation is atomic. + - SMP: Fix a infinite recursion problems that a recent changes + introduced into the i.MX6 SMP implementation. This is not seen + with the LC823450 because you can disable inter-processor interrupts + in that architecture; but you cannot in the ARMv7-A/GIC architecture. + - SMP: Remove SMP related logic in sig_dispatch.c. This change + prevents from a deadlock in up_schedulesigaction.c where inter-CPU + signal handling is actually implemented. arch/arm/src/armv7-m: Fix + signal handling for SMP. In previous implementation, signal handling + for SMP was incorrect. Thus, for example, if an inter-CPU signal + happened an incorrect tcb was signaled and caused ASSERT(). This + change fixes the issues and works for both inter-CPU signal handling + and signal handling on the same CPU. From Masayuki Ishikawa. + - Tasking: Add nxtask_create(). Kthread_create() and nxtask_create() + are internal OS functions and should not modify the errno variable. + Convert legitimate uses of task_create() to nxtask_create(). + Review handling of returned values from all uses of kthread_create() + (as well as nxtask_create()). + - Tasking: Threads started by board bring-up logic should be kernel + threads, not user tasks. + - Tasking: Threads started by drivers should be kernel threads, not + user tasks. + - Semaphore Usage: Added ECANCELED condition to DEBUGASSERT's + checking sem_wait result From Dmitriy Linikov. + + - errno: Add new internal OS function nxsched_setaffinity() that is + identical to sched_isetaffinity() except that it does not modify the + errno value. All usage of sched_setaffinity() within the OS is + replaced with nxsched_setaffinity(). + - errno: Internal functions sched_reprioritize() and + sched_setpriority() no longer modify the errno value. Also renamed + to nxsched_reprioritize() and sched_setpriority(). + - errno: Add new internal OS function nxsched_getscheduler() that is + identical to sched_getscheduler() except that it does not modify the + errno value. All usage of sched_getscheduler() within the OS is + replaced with nxsched_getscheduler(). + - errno: Add new internal OS function nxsched_setparam() that is + identical to sched_setparam() except that it does not modify the + errno value. All usage of sched_setparam() within the OS is + replaced with nxsched_setparam(). + - errno: Add new internal OS function nxsched_getparam() that is + identical to sched_getparam() except that it does not modify the + errno value (actually, the previous value erroneously neglected to + set the errno value to begin with, but this fixes both issues). All + usage of sched_getparam() within the OS is replaced with + nxsched_getparam(). + - errno: wd_start() is an internal OS function and should not set the + errno value. Reviewed and updated every call to wd_start() to + verify if return value is used and if so if the errno value is + accessed. + - errno: Fix several inappropriate accesses to get_errno() that were + missed in previous changes (some going back to nuttx-7.23). Add new + nxsched_setscheduler() and nxsched_getaffinity() which are + equivalent to their counterparts without the nx on front. These + versions do not modify the errno value. Changed all calls within + the OS to use these newer versions of the functions. + - errno: binfmt/, configs/, grahics/, libc/, mm/, net/, sched/: OS + references to the errno variable should always use the set_errno(), + get_errno() macros. + - drivers/, fs/ and libc/: OS references to the errno variable should + always use the set_errno(), get_errno() macros. + + * File System/Block and MTD Drivers: + + - FAT: CONFIG_FAT_MAXFNAME may not exceed NAME_MAX (CONFIG_NAME_MAX) + - NFS: Correctly infer file type. The file type is in struct + nfs_statinfo_s's ns_type field, not in the ns_mode field. From + Michael Jung. + - NFS: Fix buffer corruption. In case multiple read requests to the + NFS server are required to fill up the user provided buffer, + nfs_read() might write behind the end of said buffer. This is fixed + with this change. From Michael Jung. + - VFS: reopen() should return NULL when oflags is less than 0, not + equal to 0. Because negative value is returned on failure of + lib_mode2offlags() which converts the mode string into file open + mode flag. + - ProcFS: Fix an error in a common function that manages read data. + - drivers/mmcsd: Respect SDIO_CAPS_DMABEFOREWRITE on CMD25. From + Evgeniy Bobkov. + - AT24xx: Correct page size for AT24C02 part. From Alexander + Oryshchenko. + - mtd_config.c: Add still more error handling (to detect bad + underlying flash implementations). Remove MTD_ERASE that was + erasing data block instead of erase block. This is a partial + revert of 4f18b4. Reported-by: Pascal Speck + + * Graphics/Display Drivers: + + - drivers/lcd: Fix the default I2C address of SSD1306 OLED display + (7- vs 8-bit addressing) From Alan Carvalho de Assis. + - drivers/lcd: lcd_framebuffer.c does not need to include board- + specific board.h. + - include/lcd: Eliminate a warning from an SSD1306 header file by + adding a forward reference to struct i2c_master_s. From Sebastien + Lorquet. + + * Networking/Network Drivers: + + - ARP: Fix an error introduced when ICMP and ICMP6 socket support was + added in NuttX-7.3. A gratuitous ARP (or solicitation) was being + sent after receive of the ECHO replay (advertisement). + - ARP: Fix IGMP multicast address computation on Nuttx network stack. + This change fixes the IGMP address computation to allow multicast + UDP messages. The destination address was created with the incorrect + bytes of the given IPv4 address. From Louis Mayencourt. + - ioctl: The existence of the network driver ioctl() method should + depend on CONFIG_NETDEV_IOCTL rather than CONFIG_NETDEV_PHY_IOCTL. + The former enables the method, the later enables a subset of + possible driver IOCTLs. + - TCP: Write buffering logic should not wait for a free buffer if + the socket was opened non-blocking. + - TCP: Fixed bad return value handling in psock_tcp_send(). send() + expects psock_tcp_send() to return a negated errno value, not -1 + with the errno set (GN: I added same change for tcp_send_buffered.c + which has the same issue as tcp_send_unbuffered.c) From Pelle + Windestam. + - TCP: Fixes hardfault when network goes done and network monitoring + is in place. From Gianpaolo Ferroni Ariani. + - TCP: tcp_send_[un]buffered.c: Check routing table in + psock_send_addrchck(). Previously only ARP table was considered + when determining if the data will actually be sent. From Juho + Grundstrom. + - TCP: Generalize Juho Grundstrom's IPv4 change for IPv6 as well. + - UDP: Remove some conditional logic that was true if there is only a + single network device, but not true in the multi-device context. + - UDP: In sendto(), return EHOSTUNREACH if the network is down. + + * Common Drivers: + + - drivers/pipes: In poll logic, fix off-by-one error in calculation + of bytes in the buffer. Buffer calculation in pipe poll setup is + off-by-one when read index is larger than write index. This causes + poll() not getting POLLIN when buffer has one byte as calculation + gives zero bytes in buffer. From Jussi Kivilinna. + - drivers/audio: Improve stability of the WM8776 driver in SMP mode. + Apply irq_spin APIs to improve performance. Repeat to process a + message to avoid deadlock. From Masayuki Ishikawa. + - drivers/ioexpander: Fixed build of PCF8574 driver when its + interrupts aren't enabled by config. From Dmitriy Linikov. + - drivers/syslog: Fixes LOG_UPTO macro to include specified log level. + From Anthony Merlino. + - drivers/sensors: Fix HTS221 sensor reset with BOOT bit From Jussi + Kivilinna. + - drivers/loop: If we want to open read-only in losetup.c, flags + should be O_RDONLY not O_RDWR. From Fabio D'Urso. + - drivers/timers/ds3231.c: Correct some debug statements. From + Alexander Oryshchenko. + - drivers/sensors/lis2dh: Use realtime clock if monotonic is not + available From Juha Niskanen. + - drivers/i2c and drivers/spi: Fix compile error if + CONFIG_DISABLE_PSEUDOFS_OPERATIONS, fix bad NULL checks From Juha + Niskanen. + + * ARMv7-A: + + - Data Cache: Fix cp15_invalidate_dcache. In cases where more than + one dcache line was to be invalidated, a missing branch label + would result in a false branch target into cp15_flush_idcache. Also + the .size macro was fixed for both cp15_invalidate_dcache. From + Michael Jung. + - SMP: Port the signal-related SMP change by Masayuki Ishikawa to the + ARMv7-A family. + + * Extensa: + + - SMP: Port the signal-related SMP change by Masayuki Ishikawa to the + Xtensa family. + + * Infineon XMC4xxx Drivers: + + - XMC4xxx: Only setup USB clock when USB PLL is enabled From Alan + Carvalho de Assis. + - XMC4xxx: Fix USIC_BRG_SCLKCFG definition From Alan Carvalho + de Assis. + + * Microchip PIC32MZ + + - MIPS32: In up_idle, the kludge that was conditionally enabled if + the work queue was enable appears to be needed even when he work + queue is not enabled on the PIC32MZ. + - PIC32MZ: Fix some typos in debug instrumentation in pic32mz-gpio.c; + fix some typos related to UART5 configuration in pic32mz-serial.c. + + * Microchip/Atmel SAMD/L: + + - SPI: In sam_spibus_initialize(), the pinmux configuration was + smashing the previous CTRLA register configuration. There are + also some typos in samd_spi.h From Matt Thompson. + - SPI: Fixes g_spi2ops and g_spi2dev using incorrect values From Matt + Thompson. + - SPI: SPI must be disabled before changing the mode bits in CTRLA + register From Matt Thompson. + - DMA: Fix DMA controller support. From Matt Thompson. + + * NXP/Freescale LPC17xx Drivers: + + - LPC17xx: Disable LPC17 FDR when not used. If a boot loader set the + fractional divider (FDR) the baud rate in nuttx will be wrong + (multiplied by this fraction). So if it is not used, it should be + disabled. From Harald Gutsche. + + * NXP/Freescale Kinetis Drivers: + + - Kinetis: Correct some Ethernet PHY register bit tests for the + KSZ8081 PHY. From Stewart. + + * On Semiconductor LC823450 + + - arch/arm/src/LC823450: Add SP_DMB() into lc823450_testset.c. + In LC823450, ldrex and strex are not supported. So we implemented + up_testset() with H/W Mutex. However, there was a bug in memory + access order. This change ensures correct memory access order in + up_testset() for LC823450. From Masatoshi Tateishi. + + * STMicro STM32 Drivers: + + - STM32 F3 RCC: A flash wait state configuration. Flash latency must + be fixed according to sysclk frequency. If this operation is not + done or done after PLL configuration, the STM32 fail to continue + boot operation if the frequency if greater than 24MHz according to + the board variable STM32_SYSCLK_FREQUENCY. Tested on stm32f334-disco + board. From Gwenhael Goavec-Merou. + - STM32 RTC: Make STM32 usable with an external RTC. + - STM32 SPI: Removed unnecessary (and incorrect) speed limitation. + From Alexander Oryshchenko. + - STM32 SPI: I have a SPI bus with both Mode 0 and Mode 3 devices + on it. After performing SPI I/O to a Mode 0 device, switching to a + Mode 3 device locked up the SPI interface. Only zeroes would be + read. I traced the reason for the lock-up to arm/arm/src/stm32f7/stm32_spi.c function spi_setmode(). Changing + the mode causes a spurious SPI clock transmission that confuses the + stm32f7 SPI input hardware. This problem is solved by (1) changing + the SPI mode with SPI (and perhaps DMA) disabled, and (2) flushing + the receive FIFO if the mode change results in garbage in the FIFO. + From Bob Feretich. + - STM32 and STM32 F7: Remove confusing, redundant, and misleading + definitions of STM32_BKP_BASE from the F2, F3, and F4 memory + maps. Unlike the F1, these parts do not have a separate BKP address + region. The BKP registers are with the RTCC address regions. + stm32_bkp.h should only be used for STM32 F1. stm32_rtcc.h should be + used to access BKP registers on F2, F3, and F4. + - STM32 and STM32 F7: Architecture-specific code is not permitted to + modify the errno variable. + - STM32 F4 I2C: Correct some recent changes to STM32F4 I2C that broke + poll mode of operation. From Alexander Oryshchenko. + - STM32 F4 I2C: Corrections to STM32 F4 I2C to restore functionality. + From Alexander Oryshchenko. + - STM32 F4 I2C: Corrections to STM32 F4 I2C to fix the NORESTART + flag. From Alexander Oryshchenko. + - STM32 F7: Fixes a bug in multi-block SD-card operations on the + STM32F7 platform. DBLOCKSIZE must be the size of SD-card block, not + the total amount of transferred bytes. From Evgeniy Bobkov. + - STM32 F7: Fix undefined variable when using USART1 for other + purposes than UART (e.g. SPI). From Frank Benkert. + - STM32 F7: Backport RTC alarm setting changes from STM32L4. Most + notably this fixes RTC getting stuck issue when both alarms were + used. Root cause was writing RTC ISR register contents to RTC CR + register. From Juha Niskanen. + - STM32 L4 Flash: Change flash programming to use page buffer for + unaligned writes. From Juha Niskanen. + + * STMicro STM32 Boards: + + - Nucleo-L432KC: Fix some bogus logic noted by Fanda. + - configs/nucleo-* and configs/stm32l476vg-disco: Fix more + stm32_userleds.c bogus logic From Juha Niskanen. + - Nucleo-L432KC: Fixed nucleo-l432kc broken build when + CONFIG_USERLED_LOWER defined From Fanda. + - Nucleo-L432KC: Issue #85: /dev/userleds is not working for + Nucleo-L432KC fixed From Fanda Vacek. + - STM32F429I-Disco: Separate SPI4 from MTD init. I was trying to + attach a non-MTD peripheral to an STM32F429I Discovery Board's SPI4 + port and was hitting compilation problems, since CONFIG_MTD and + thus 'struct mtd_geometry_s' was not defined. This patch separates + SPI4 initialization logic from MTD initialization logic. From + Michael Jung. + - STM32F103-Minimum: Remove CONFIG_NX_LCDDRIVER dependence from + stm32_ssd1306.c From Alan Carvalho de Assis. + + * C Library/Header Files: + + - libc/stdio: In dtoa(), up_interrupt_context() is used in a debug + assertion. up_interrupt_context() is not available in the user-mode + phase of the PROTECTED or KERNEL build configurations. In those + configurations, enabling libc floating point support and debug + assertions will result in an undefined reference to + up_interrupt_context(). + - libc/netdb: Fixed parsing of DNS response packets having compressed + names ending with pointer. There were troubles parsing response + packets which have compression of QNAME/NAME field when only + trailing part of the name (not the whole name) is replaced with + pointer to another part of the packet. This commit fixes parsing of + such packets. Also I added checks to keep parsing only in bounds of + the read part of DNS response packet. From Dmitriy Linikov. + + * Tools + + - tools/*.c: Add #define _GNU_SOURCE to all C files that call + asprintf() to eliminate a warning. + - tools/cvsparser.c: Add a check to avoid access past the end + of a fixed size array + + * NSH: apps/nshlib: + + - apps/nshlib: Fix compile error when CONFIG_NSH_DISABLESCRIPT is not + defined. The field np_flags does not exist if scripting is disabled. + + * Examples/Tests: apps/examples: + + - apps/examples/touchscreen: Eliminate BOARDIOC_TSCTEST_SETUP. + + * Network Utilities: apps/netutils: + + - apps/netutils/ftpc: Fix some corner-cases that could cause FTP to + access past the end of valid data. + + * Wireless Utilities: apps/wireless: + + - apps/wireless/ieee802154/i8shark: Fixes special XBee compensation + by purposely chopping off the FCS. From Anthony Merlino. + +NuttX-7.25 Release Notes +------------------------ + +The 125th release of NuttX, Version 7.25, was made on June 3, 2018, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.25.tar.gz and +apps-7.25.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * File Systems/Block and MTD Drivers + + - fs/cromfs: Added CROMFS file system. CROMFS is a commpressed, in- + memory, read-only file system based on LZF. + - fs/vfs: Added support for checking if a descriptor is a socket in + fstat(). From Pelle Windestam. + + * Graphics/Display Drivers: + + - drivers/lcd: Remove support for the Nokia6100 LCD. That LCD uses a + 9-bit SPI interface (the 9th bit being the command/data bit that is + normally a discrete). That communication was never successfully + integrated. I now believe that it would would require some special + support from the low-level, MCU SPI driver to manage that 9th bit. + The deleted code is still available in the Obsoleted repository. + + * Networking/Network Drivers: + + - net/tcp: Added support for TCP Keepalive, add SO_KEEPALIVE socket + option. Added socket options needed to manage TCP-keepalive and TCP + state machine logic to detect if that the remote peer is alive. + - net/tcp: In tcp_input(), add the logic to detect, decode, and + respond to TCP Keep-Alive packets. + - net/tcp: Extended support for sending to non-blocking tcp sockets. + From Pelle Windestam. + - net/bluetooth: Added support for AF_BLUETOOTH sockets. + - drivers/net: Added TAP (network bridge) mode to tun.c. In the + previous implementation, TAP mode did not handle a packet correctly. + Also, the driver did not set the link layer type and could not + assign the interface name. This change fixes such issues and supports + TAP mode correctly. From Masayuki Ishikawa. + + * Wireless/Wireless Drivers: + + - wireless/ieee802154: Added basic MAC support for RX-ENABLE.request + primitive From Anthony Merlino. + - wireless/ieee802154: Added MAC ackreq flag to TX descriptor for use by + radio driver. The radio layer is responsible for a full "transaction". + Because of differences in radio capabilities, the radio must be + responsible for the handling of acks and retransmissions. This commit + simply passes the ackreq meta-data flag along to the radio. Also + Fixes bug where primitive was freed when it shouldn't have been, + causing double free call. From Anthony Merlino. + - wireless/bluetooth: Bring in the Bluetooth stack from the Intel/ + Zephyr arduino101_firmware_source-v1.tar package. + - drivers/bluetooth: Added re-architected version of the Bluetooth + UART driver from the Intel/Zephyr arduino101_firmware_source-v1.tar + package. + - include/nuttx/wireless: Added a setbaud() method to the HCI UART + lower half interface that can be used to change the default BAUD + selection. + - wireless/bluetooth and include/nutt/net: Added support for Bluetooth + IOCTL commands. + - drivers/wireless/bluetooth: Added a NULL device to support some very + low level testing on the Simulator. + - drivers/wireless/cc3000: Eliminate support for the CC3000 wireless + part because it doesn't use the USRSOCKET. From Alan Carvalho de + Assis. + - drivers/wireless/ieee80211: Added BCM43428 support. From hhuysqt. + + * Other Common Device Drivers: + + - drivers/1wire: Added 1-wire subsystem and ds28e17 driver From Juha + Niskanen. + - drivers/1wire: Added PM hooks and unlink support to sht21 sensor + (allowing hot-swappable I2C bus from 1-wire converter). Unlike most + other unlink implementations in NuttX drivers, this one does not + allow any I2C operations after unlink, making it possible to + deallocate the I2C bus. From Juha Niskanen. + - drivers/i2c: Added support for the pca9540bdp i2cmultiplexer. From + Giorgio Gro. + - drivers/power: Added pm_unregister From Juha Niskanen. + - drivers/power: Added generic upper-half motor driver From Mateusz + Szafoni. + - drivers/rgbled: Added support for multichannel PWM (multiple PWM + channels on a single timer) From Anthony Merlino. + - drivers/sensors: Added support for Sensirion SHT2x humidity sensor. + From Juha Niskanen. + - drivers/sensors: Added LSM330 SPI and ADXL372 drivers along with the + - drivers/sensors: Added support for INA3221 power sensor. This has a + 3 channel bus/shunt voltage pairs. From Anthony Merlino. + cluster driver infrastructure. From Bob Feratich. + - drivers/sensors: Added multiple MAX31855 sensors feature support. + From Tiago Almeida. + - drivers/wireless/cc1101.c: Driver improvements from from lihaichen. + - progmem interface: Discern r/w and erase page sizes. Introduce new + up_progmem_erasesize architecture API to be able to communicate the + read/write page size independently from erase page size. Implement + up_progmem_erasesize for all architectures that already support + progmem, assuming that for those architectures the sizes of both + read/write and erase pages are identical. From Michael Jung. + + * Simulation + + - configs/sim: Added a configuration that will support some limited + testing of the Bluetooth stack. + + * ARM: + + - ARM: All ARM architectures now support CONFIG_ARCH_IDLE_CUSTOM. + + * MIPS: + + - MIPS: All MIPS architectures now support CONFIG_ARCH_IDLE_CUSTOM. + + * Infineon XMC4xxx Drivers: + + - XMC4: Added SPI support for Infineon XMC45xx microcontroller. From + Alan Carvalho de Assis. + + * Infineon XMC4xxx Boards: + + - XMC4500-Relax: Added board support for SPI. From Alan Carvalho de + Assis. + + * Nordic NRF52: + + - NRF52: Initial support for the NRF52 including UART, Timer, and + GPIO support. From Janne Rosberg. + + * Nordic NRF52 Drivers: + + - NRF52: Added watchdog timer drivers. Includes significant + updates from Levin Li. + - NRF52: Added nRF52 Flash PROGMEM support From Alan Carvalho de + Assis. + + * Nordic NRF52 Boards: + + - configs/nrf52-pca10040: Added support for the NRF52-PCA10040 board + including LEDs and buttons From Janne Rosberg. + - configs/nrf52-pca10040: Added support for starting the watchdog + timer on the nRF52. From Alan Carvalho de Assis. + - configs/nrf52-pca10040: Added a configuration for testing the + watchdog timer. From Alan Carvalho de Assis. + + * NXP Freescale i.MX RT: + + - i.MX RT: Brings in basic support for the i.MX RT 1050 'crossover' + SoC. Includes timer and UART support. This port was the joint + effort of Janne Rosberg, Ivan Ucherdzhiev, and myself. I give + credit to Ivan for the kill because he is the one to held on to + the end. From Ivan Ucherdzhiev. + + * NXP Freescale i.MX RT Drivers: + + - i.MX RT: Added power management hooks. + - i.MX RT: Added eDMA support (unverified). + - i.MX RT: Added Ethernet driver. From Jake Choy. + - i.MX RT: Added cache operations to permit the Ethernet driver to + work with the D-Cache enabled, at least in write-through mode. + Added support for PHY interrupts and PHY IOCTLs. + + * NX FreescaleP i.MX RT Boards: + + - IMXRT1050-EVK: Added support for booting from the on board HYPER + Flash. From Ivan Ucherdzhiev. + - IMXRT1050-EVK: Added logic to support the board's user LED. From + Jake Choy. + - IMXRT1050-EVK: Added procfs auto-mount support in imxrt_bringup.c. + From Ivan Ucherdzhiev. + - IMXRT1050-EVK: Added LIBCXX test configuration. + - IMXRT1050-EVK: Added support for the imxrt1050-evk button. From + Jake Choy. + - MXRT1050-EVK: Added support for on-board NOR FLASH boot. From + Ivan Ucherdzhiev. + - IMXRT1050-EVK: Disable LED support because pins conflict with PHY. + Enable device statistics. Enable NSH ifup and ifdown commands. + Added an NSH configuration for testing Ethernet. + + * NXP Freescale Kinetis: + + - K28F: Added architecture support for the Kinetis K28F. + + * NXP Freescale Kinetis Drivers: + + - SDHC: Make Kinetis SDHC pullups work the same as the STM32 SDIO + pullups. + + * NXP Freescale Kinetis Boards: + + - Freedom-K28F. Added support for the Kinetis Freedom-K28F board. + + * NXP LPC17xx: + + - LPC17xx: Added support for ARMv7-M run time stack checking on NXP + LPC17xx MCUs based on CONFIG_ARMV7M_STACKCHECK. Basically copied + from STM32. From Michael Jung. + + * NXP LPC17xx Drivers: + + - LPC17xx: Added a configurable option to allow using a part of + LPC17xx's internal flash memory as a Memory Technology Device via + NuttX' mtd_progmem infrastructure. Tested with LPC1769. From + Michael Jung. + + * NXP LPC17xx Boards: + + - Olimex-LPC1766STK: Remove support for the Nokia6100 LCD. That + LCD uses a 9-bit SPI interface (the 9th bit being the command/data + bit that is normally a discrete). That communication was never + successfully integrated. + + * NXP LPC43xx Boards: + + - configs/bambino-200e: Added support for multiple MAX31855 sensors + to the bambino-200e. From Tiago Almeida. + + * OpenRISC + + - arch/or1k/src. Added basic architectural support for the OpenRISK + mor1kx architecture. The initial commit was verified on a Qemu + simulation but is otherwise untested. From Matt Thompson. + + * OpenRISC Board + + - configs/or1k. OpenRISK mor1kx Qemu simulation. From Matt Thompson. + + * STMicro STM32: + + - STM32: Added support for the STM32F401xB and STM32F401xC families. + + * STMicro STM32 Drivers: + + - STM32 HRTIM: Added HRTIM software capture trigger, added software + reset trigger, added outputs polarization configuration From + raiden00pl. + - STM32 ADC: Added ADC injected channels configuration. From Mateusz + Szafoni. + - STM32 HCIUART: Added a Bluetooth HCI UART lower half driver for the + STM32. + - STM32 HCIUART: Implement the setbaud() method for the STM32 HCI + UART interface. + - STM32 SDIO: Added support for SDIO card to SDIO driver. From + hhuysqt. + - STM32 SDIO: Added internal pull-up option for SDIO pins. From Alan + Carvalho de Assis. + - STM32 F2/F4 ADC: Added Vbat measurement to ADC driver for + STM32F20xx and STM32F4xxx. As with the MCU temperature and VREFINT + measurement, this change requires user to enable the corresponding + channel first. For Vbat channel the ioctl cmd is + IO_ENABLE_DISABLE_VBAT_CH, and its arg should be a pointer to bool + which must be true to enable and false to disable the Vbat channel. + Moreover, since Vbat input contains a built-in voltage divider, it + is highly suggested to disable Vbat input channel after measurement + is done in order to prevent battery drain through the divider. From + Dmitriy Linikov. + - STM32, STM32L4 1WIRE: Added one bit read and write to 1-wire + interface. This is needed for devices that require single bit + timeslot generation and for 1-Wire search algorithm triplets. From + Juha Niskanen. + - STM32 F3 SPI: Enable DMA for SPI on stm32f30xxx MCUs. From Michal + Lyszczek. + - STM32 L4 1WIRE: Ported 1wire driver from STM32. From Juha + Niskanen. + - STM32 L4 I2C/SPI/1WIRE: Added PM hooks to I2C, SPI and 1-wire From + Juha Niskanen. + - STM32 F7 RTC: Added CONFIG_RTC_PERIODIC support. Also makes the RTC + lowerhalf more like in STM32L4. From Juha Niskanen. + - STM32 F7 ADC/I2C/SPI: Added PM hooks to ADC, I2C and SPI. From + Juha Niskanen. + + * STMicro STM32 Boards: + + - Indium-F7: Removed support for the Indium-F7 board. This was done + for two reasons: (1) The board support was just clone of the + Nucleo-144 board support with naming changes. There has been no + support and no further development for the board support. (2) There + does not seem to be any available Indium-F7 board available to the + public anywhere on the Internet. There is not even a reference to + the board on the rafresearch.com web stie. + - Nucleo-L452RE: Added buttons example From Juha Niskanen. + - Nucleo-L476RG: Added support to Nokia LCD PCD8544 on nucleo-l476rg. + From Alan Carvalho de Assis. + - Nucleo-L476RG: Added nxdemo configuration to nucleo-l476rg using + PCD8544. From Alan Carvalho de Assis. + - Olimex-STM32-P407: Added a zmodem test configuration. + - Olimex-STM32-P407: Added the module configuration. + - Photon: Added RGB led support From Anthony Merlino. + - STM32F103-Minimum: Added support for DFU bootloader From Simon + Piriou. + - Spark: Removes Spark board configuration. Still available in the + Obsoleted repository. If there is no CC3000 support, then there is + no purpose in supporting the Spark either. + - STM32F334-Disco: Added buck/boost converter example configuration. + From Mateusz Szafoni. + - STM32F4 Discovery: Added support for multiple MAX31855 sensors to the + STM32F4 Discovery From Tiago Almeida. + - STM32F4 Discovery: Added support in bring-up logic to initialize the + HCI UART and register the HCI UART network device. + - STM32F4 Discovery: Added MAX7219 support to STM32F4Discovery board. + From Alan Carvalho de Assis. + - STM32F4 Discovery: Added board configuration for CS43L22 audio + example. From Alan Carvalho de Assis. + - STM32F4 Discovery: Added a module configuration for testing the + kernel module example with the STM32F4Discovery board. From Alan + Carvalho de Assis. + - STM32F429I-DISCO: Added a LittlevGL configuration for stm32f429i- + disco. From seyyah. + - STM32F746G-DISCO. Added clang support to stm32f746g-disco board. + From Goran Mekic. + - STM32L1 Discovery: Added support for the STM32L152RCT6 version of + the board. + + * TI TMS570: + + - TMS570: Added support for the TMS570LS3137ZWT. From Ivan Ucherdzhiev. + + * TI TMS570 Boards: + + - configs/tms570ls31x-usb-kit: Added support for the TI Hercules + TMS570LS31x USB Kit From Ivan Ucherdzhiev. + + * TI Tiva: + + - CC3200: Remove all support for the CC3200. This was a port that was + started but never completed. What good is partial CC3200 support + with no wireless support?. + + * TI Tiva Drivers: + + - EEPROM: Implements an EEPROM driver in compliance with MTD driver + as provided by NUTTX for TM4C1294. The EEPROM driver currently + supports only two functionalities - read bytes(multiple of 4) and + write bytes (multiple of 4). From Shirshak Sengupta. + - FLASH: Implemented Flash CONFIG_MTD_BYTE_WRITE for TM4c1294. + Implemented the tiva_write function which will write an arbitrary + number of bytes to flash (in multiple of 4). From Shirshak Sengupta. + - Serial: Added TERMIOS IOCTL support to the Tiva serial driver. + From Dmitry Sharihin. + + * TI Tiva Boards: + + - CC3200-Launchpad: Remove all support for the CC3200-Launchpad. + This was a port that was started but never completed. What good is + partial CC3200-Launchpad board support with no wireless support?. + + * Libraries/Header Files: + + - libs/: Moved all of the libraries under a common directory called + libs/ (libc, libnx, and libxx). This almost certainly break libcxx + for now. + - libs/libc/time: Added an implementation of clock(). + - libs/libc/lzf: Added a modified version of Marc Alexander Lehmann's + LIBLZF3.6 library From Boris Astardzhiev. + - libs/libc/unistd: Initial, minimal implementation of sysconf(). + Only sufficient to support the functionality of less standard + getdtabilesize(). From Michael Jung. + - libs/libdsp: Added DSP support library. From Mateusz Szafoni. + - include/sys: Added resource.h. + - include/nuttx/video: Add overlay support to framebuffer interface + definition. From Marco Krahl. + + * Tools: + + - tools/gencromfs.c: Added tools/gencromfs.c, a tool that can be used + to generate CROMFS file system images. + - tools/mkromfsimg.sh: Include an option in mkromfsimg.sh to ignore + FAT/RAMDISK. This permits you to build tiny systems with ROMFS but + with the rather large FAT FS support. From Alan Carvalho de Assis. + - tools/nxstyle.c: Added check for blank lines before and after single + line comments. From Bob Feretich. + - tools/sethost.sh: Added support for macOS. + - tools/uncrustify.cfg: An initial cut at an uncrustify C formatting + script from Gregory Nutt. Updated, corrected, and verified. From + Bob Feretich. + + * Build System: + + - Makefile: Added support for nconfig frontend for 'make nconfig'. + From Michal Lyszczek. + - configs/: Added definition of strip to many Make.defs files. + - staging/: Remove fixed lib/ subdirectory and its content. Replace + with new directory called staging/ that is created dynamically when + building and removed when 'make clean' is done. This both improves + the naming and eliminates a garbage directory from the repository. + - tools/: Move all build-related files (except the top-level Makefile) + into the tools/ sub-directory. This really cleans up the top-level + directory. + + * NSH: apps/nshlib: + + - apps/nshlib: Added the mkfatfs -r option which can be used to + specify the number of entries in the FAT12/FAT16 root directory. + From Boris Astardzhiev. + + * Examples/Tests: apps/examples: + + - apps/examples/adxl372_test and lxm330spi_test: Added ADXL372 and + LSM330 tests. From Bob Feretich. + - apps/examples/cc3000: Removed the CC3000 example. From Alan + Carvalho de Assis. + - apps/examples/cromfs: Added an example of how to build a CROMFS + file system image. + - apps/examples/elf: Extend the ELF program module demo so that you + can use compressed ELF programs with CROMFS. + - apps/examples/elf: Use strip command to make ELF binaries MUCH + smaller. Added an option to strip debug symbols even if the debug + symbols are enabled in the base code. + - apps/examples/max31855: Added an example to read multiple max31855 + sensors. From Tiago Almeida. + - apps/examples/netloop: Update network loopback example so that it + can be used to test TCP KeepAlive. + - apps/examples/nxdemo: Added nxdemo application From Alan Carvalho + de Assis. + - apps/examples/powerled: Added arch initialization. + - apps/examples/uavcan: Removed because apps/canutils/libuavcan is no + longer available. + + * System Utilities: apps/system + + - apps/system/lzf: Added the test case from Marc Alexander Lehmann's + LIBLZF3.6 librrary From Boris Astardzhiev. + - apps/system/embedlog: Support for embedlog data loggin package from + https://embedlog.kurwinet.pl/ From Michal Lyszczek. + - apps/system/zmodem: Added an option to enable hardware flow control + via termios. Allow stack size and priority to be configured. + - apps/system/zmodem: Call tcflush() before closing the serial port. + This is necessary because that close operation may hang if hardware + flow control is enabled. Consider this scenario: After the host + sz runs on the host, it exits and leaves CTS high. The target rz + completes, and tries to close the serial port. But if there is + buffered Tx data, then the close will hang when it tries to drain + the buffered Tx data since there is no where it can go. tcflush() + discards the buffered data and permits the close to continue. + There is additional logic in nuttx/drivers/serial needed to work + with this. + + * CAN Utilities: apps/canutils: + + - apps/canutils/libuavcan. Removed! libuavcan has not built for a + year or so. The basic problem is that as NuttX advances, the old + frozen version of libuavcan has become absolute because it violates + the portable POSIX OS interface. No one is maintaining the port so + there is no alternative but to remove it. + + * Network Utilities: apps/netutils: + + - apps/netutils/tftpc: Modified the TFTP client functions to use a + data read/write callback instead of a file. This allows TFTP to + write to arbitrary destination (in my case, a MTD device - for + firmware update). Two new functions are introduced for this, named + tftpget_cb and tftpput_cb. They are just made of most of the + existing code. The previously existing tftpget/tftpput functions + are now wrappers on the new ones, with callbacks that read/write + from files, so my modifications are backwards compatible with + existing applications, eg the associated nsh commands dont need to + be changed. From Sebastien Lorquet. + + * Wireless Utilities: apps/wireless: + + - apps/wireless/bluetooth/btsak: Added a Bluetooth debug tool. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - sched/sched: Fix a deadlock in SMP mode. Two months ago, I + introduced sched_tasklist_lock() and sched_tasklist_unlock() to + protect tasklists in SMP mode. This change works well for HTTP + audio streaming aging test with lc823450-xgevk. However, I found a + deadlock in the scheduler when I tried similar aging tests with DVFS + autonomous mode where CPU clock speed changed based on cpu load. In + this case, call sequences were as follows. To avoid this deadlock, + I added sched_tasklist_unlock() when calling up_cpu_pause() and + sched_addreadytorun(). Also, added sched_tasklist_lock() after the + call. Also added critical sections to lib_filesem.c, mm_sem.c, and + net_lock.c for SMP for SMP. From Masayuki Ishikawa. + - sched/sched: Change ordering of round-robin time slice check + (sched_process_scheduler()) and processing of wdog timers + (wd_timer()). wd_timer()'s callback function can change current + running task and, hence, must be done after the time slice check. + The time slice check will decrement the currently running task's + time slice allotment. If such a context switch occurs, then the + newly started task will lost one could of that allotment before it + even has a chance to run. From EunBong Song. + + * File System/Block and MTD Drivers: + + - fs/fat: In fs_stat(), when stat'ing the root directory, avoid + calculating the address of the root directory entry. The + calculation is bogus (but not harmful) because the root directory + does not have a directory entry. Noted by Boris Astardzhiev. + - fs/fat: Avoid calculating the bogus directory entry address for + the FAT root directory (since it has no directory entry). This + change should have no effect, other than making the logic clearer. + From Boris Astardzhiev. + - fs/mount: Fix wrong size reported by df -h. Reason is that size + in bytes is calculated always on uint32_t types and cards bigger + than 4GB will overflow uint32_t type. Solution is to use uint64_t + where possible. From Michal Lyszczek. + - fs/smartfs: Fix a hardfault in SmartFS. Problem occurred when + opening a file with O_CREAT (only) when the file arelready exists + but has a size of zero. From Michal Lyszczek. + - fs/vfs: Fix negative errno set in fs_open.c From Michal Lyszczek. + - drivers/mtd: Fixed a W25 driver w25_cacheflush sector bug. From + lihaichen. + - drivers/mtd: mtdconfig_register() returned OK instead of -ENOMEM on + failed allocation. From Michal Lyszczek. + + * Graphics/Display Drivers: + + - drivers/lcd/ft80x: ACTIVE host command appears to be formatted + differently than other host commands; Fix ROM CHIPID. Appears to + be big-ending, BCD. Fix some compile issues when debug features + are enabled. + - drivers/lcd/ft80x: Fix a typo that caused the driver to fail to + recognize the ft801 chip version. From Gregory Nutt. + - Review all board implementations of board_lcd_initialize(). The + NuttX convention is that all internal functions that return errors + as an 'int' must return a negated errno value on failure and a non- + negative value on success. Most were right but eight of them had + cloned logic that returns 1 on success and zero on failure. both + of which are interpreted as success by the caller since they are + non-negative. + + * Networking/Network Drivers: + + - net/tcp: Fixed problem with send() retrun value when using + nonblocking I/O over buffered tcp socket From Dmitriy Linikov. + - net/sixlowpan: Fix a nasty, byte-ordering/endian-ness problem. + The root cause has been found and corrected. And a half dozen + or so bandaid fixes were reverted. + - net/sixlowpan: Preserve big-endian (network order) when + uncompressing address. From Anthony Merlino. + - net/sixlowpan: TCP send should have PSH and ACK flags set when + sending. This matches the standard network (Ethernet) TCP send + logic. From Anthony Merlino. + - net/udp: Fix several issues using connected UDP sockets: sendto() + should not accept an address. Normally send() should be used with + connect UDP sockets instead. recvfrom() is no longer necessary. + recvfrom() and poll() should not reset to accept any addresses but + should, instead, only accept inputs and events from the connected + remote peer. On of these issues was noted by ??? + . Changes were made as summarized here: + http://www.masterraghu.com/subjects/np/introduction/unix_network_programming_v1.3/ch08lev1sec11.html + From Gregory Nutt. + - net/udp: Resolve race condition in connection-less UDP sockets with + read-ahead buffering. In connection-mode UDP sockets, a remote + address is retained in the UDP connection structure. This + determines both there send() will send the packets and which packets + recv() will be accepted. This same mechanism is used for + connection-less UDP sendto: A temporary remote address is written + into the connection structure to support the sendto() operation. + That address persists until the next recvfrom() when it is reset to + accept any address. When UDP read-ahead buffering is enabled, + however, that means that the old, invalid remote address can be left + in the connection structure for some time. This can cause read- + ahead buffer to fail, dropping UDP packets. Shortening the time + between when he remote address is reset (i.e., immediately after the + sendto() completes) is not a solution, that does not eliminate the + race condition; in only makes it smaller. With this change, a flag + was added to the connection structure to indicate if the UDP socket + is in connection mode or if it is connection-less. This change + effects only UDP receive operations: The remote address in the UDP + connection is always ignored if the UDP socket is not in connection- + mode. No for connection-mode sockets, that remote address behaves as + before. But for connection-less sockets, it is only used by sendto(). + + * Wireless/Wireless Drivers: + + - drivers/wiresless/ieee80211: Correct some initialization problems + with BCM43362 chip. From hhuysqt. + - drivers/ieee802154/xbee: Added a timeout to send logic to handle + case where XBee module fails to respond to a Transmit request with + a Transmit Status From Anthony Merlino. + + * Common Drivers: + + - Per OpenGroup.org, syslog -- and, hence, nonstandard vsyslog, and + debug wrappers -- does not return a value. Rename _vsyslog to + nx_vsyslog. Use internal nx_vsyslog in the few cases where a + return value is required. + - drivers/leds: Fixes RGB LED issues caused by uninitialized memory + with CONFIG_RGBLED_MULTICHAN. The uninitialized pwm_info_s struct + caused a rogue channel to be started causing errors in the pwm + driver From Anthony Merlino. + - drivers/sensors/lis2dh: Clear INT1 at SNIOC_WRITE_INT1THRESHOLD + ioctl. From Jussi Kivilinna. + - drivers/sensors/sht21: Changed I2C_TRANSFER return value so that + it return on zero on success, not the count of bytes transferred. + From Juha Niskanen. + - drivers/serial: Per Matias Edlund: I recently used the tcflush + function and found that it failed with ENOTTY. The reason is that + the TCFLSH case in the function uart_ioctl in the file + drivers/serial/serial.c does not update the ret value." On + success, the TCFLSH IOCTL logic needs to explicitly set the return + value (ret) to zero. + - drivers/serial: Added a timeout to uart_tcdrain(). Even if + tcflush() is used to discard buffered data, the close() can still + hang if (a) hardware flow control is enabled, (b) CTS == 1, and + (c) there is data stuck in the hardware Tx FIFO. tcflush() does + not currently clear the MCU serial drivers' hardware Tx FIFOs. + This is a workaround for that. + - drivers/sensors: Fix APDS9960 work queue BUG found by Kyle Lei. + From Alan Carvalho de Assis. + + * Simulator: + + - arch/sim: Various fixes necessary to build the simulator under + MSYS2. + + * ARMv7-R: + + - ARMv7-R: Corrected several ARMv7-R issues. From Ivan Ucherdzhiev. + + * Infineon XMC4xxx Boards: + + - XMC4500-Relax: Call xmc4_spidev_initialize() in xmc4_boot.c. From + Alan Carvalho de Assis. + + * NXP/Freescale LPC17xx Drivers: + + - LPC17xx USB: Fix USB device endpoint allocation bookkeeping. From + Michael Jung. + - LPC17xx USB: Freeing endpoints should be set the same allocations + as when endpoint was allocated. + - LPC17xx USB: Fix loss of RX initiatives. USB bulk endpoints are + double buffered on LPC17xx MCUs. This means that up to two packets + might be received on an OUT endpoint that can not be handled + immediately if the receive request queue is empty. Thus, + rxpending must be a counter not a boolean flag. From Michael Jung. + + * NXP/Freescale Kinetis Drivers: + + - Kinetis USG: USB device fixes: Use correct CONFIG OTG control, + Fix interrupt storm when cable is disconnected. The DM, DP state + were incorrect because the pulldowns were not enabled. Also the + pending asynchronous resume interrupt needed to be re-armed after + the suspend is in effect. This is now done in the isr. From David + Sidrane. + - Kinetis Serial: In kinetis_lowputc.c, fix esBRFA calculation + effecting baudrate. Previous BRFA was not cleared and or-ed into + new BRFA, hence, buadrate was wrong. Where Baud Rate Fractional + Divisor (BRFD) UART baud rate = clock / (16 * (SBR + BRFD)). From + David Sidrane. + - Kinetis Serial: In kinetis_lowputc.c, fixed parity settings. + Kinetis UART must be placed in 9 bit mode (M=1) with when 8 bit data + with parity is required. If left in 8 bit mode (M=0) with parity + then D7 of the TX/RX register becomes parity bit. Hence what is + called 9-bit or 8-bit Mode Select is a misnomer. 8 bit mode when + parity is enabled is realy 7 bit with parity. From David Sidrane. + + * NXP/Freescale Kinetis Boards: + + - configs/teensy-3.x: Remove CONFIG_USBDEV_DUALSPEED from the usbnsh + configuration. Hardware supports only FS. + + * NXP i.MX6 Drivers: + + - i.MX6: Bring in a few i.MX6 fixes that were committed to similar + files for the i.MX RT. + + * STMicro STM32: + + - STM32 F3: Problem: stm32f30xx hangs waiting for LSE to initialize. + Reason for hang is that operation of setting LSE_ON does not take + effect because there is no clock on PWR peripheral. This is + initialized later in the code From Michal Lyszczek. + + * STMicro STM32 Drivers: + + - STM32 and STM32 L4 1WIRE: In 1wire driver, do not write useless + WRITEBIT zero return value to const buffer From Juha Niskanen. + - STM32 HRTIM: Fixed capture_get function,. From raiden00pl. + - STM32 F3 ADC: Fixed bug in RCC reset logic that resets ADC1 + configuration when both ADC1 and ADC2 are in use From Mateusz + Szafoni. + - STM32 Ethernet: In case of PHY failure, usually because of the + lack of 25/50 MHz REFCLK input, the Ethernet block would lock up + in a while loop waiting for readiness, which will never happened. + This prevented the board from starting at all in the case of a PHY + failure. This commit adds a retry loop to avoid bricking the board + if the Ethernet block is unable to start. From Sebastien Lorquet. + - STM32 F7 SDMMC: Added support for the second SDMMC device. The + second SDMMC device was already supported but the clock was never + enabled. This fixes that. From William Douglas. + - STM32 Serial: Fix UART glitch when lowputc is enabled. From + Simon Piriou. + - STM32 USB: Skip recipient check for descriptor related + requests From Simon Piriou. + + * TI Tiva Drivers: + + - Tiva ADC: Fix compilation errors on Tiva ADC code when ADC is + enable. From Vinicius Maciel. + - Tiva Serial: Allow building of Tiva platform with no serial + console. From Dmitry Sharihin. + + * C Library/Header Files: + + - lib/libc/netdb: Fixed boundary conditions in dns_recv_response(). + Fixed typos in include/nuttx/net/dns.h. From Masayuki Ishikawa. + - libs/libc/modlib: Fixed backward test for an error in + modlib_verify.c. + + * Build System: + + - Makefiles: Eliminate the spurious errors reported by 'make + savedefconfig'. + - Makefile(s): There is a sort command in the 'make savedefconfig' + file. I found that sort behaves differently on different platforms + based on the environment variable LC_ALL. Now, Makefile.unix will + force LC_ALL=C just for the sort command so that we can all generate + equivalent defconfig files. + - Makefile(s): The clean_context target needs to invoke a + corresponding clean_context target in the apps/Makefile in order to + remove linkages. From Gregory Nutt. + - LibTargets.mk, tools/Config.mk: Drop executable bit on installed + libraries. The rules to install libraries under lib/ were modified + to use mode 0644 instead of the default 0755. From Andrey Zabolotnyi. + + * Examples/Tests: apps/examples: + + - apps/examples/ft80x: Fix some size calculations. Added option to + disable primitive tests. just too boring to have to watch over and + over again. Fix a typo in backlight fade logic; Fix error in + formatted display light debug dump output. + - apps/examples/ft80x: Text is handled by the coprocessor and, hence, + must use RAM_CMD, not RAM_DL. + - apps/examples/ft80x: Fix some errors in co-processor demos. Correct + an error in the spinner demo. + - apps/examples/nsh and posix_spawn: Must not call exec_setsymtab() + directly. That is a non-POSIX internal OS interface. + - apps/examples/ostest: Do not call AIO test without + CONFIG_EXAMPLES_OSTEST_AIO From Juha Niskanen. + - apps/examples/smps: Fix typos in Kconfig. All power, voltage, + current values were strings with no default. I assume they should + be 'int' with what default?. + - apps/examples/smps: Fixes in some printf and in Kconfig From + Mateusz Szafoni. + - apps/system/zmodem: Fix Makefile.host. It was broken when zmodem.h + was moved to apps/include/system. Fix an incompatibility with the way + that CRCs are calculated. + + * System Utilities: apps/system: + + - apps/system: Applications should use the standard clock() interface, + not the internal NuttX clock_systimer() interface. + - apps/system/stackmonitor: Fix comparison between pointer and zero + character constant. From Juha Niskanen. + + * Network Utilities: apps/netutils: + + - apps/netutils/netlib: Various fixes needed to get a clean netlib + build with Bluetooth only. + + * Wireless Utilities: apps/wireless: + + - apps/wireless: Applications should use the standard clock() + interface, not the internal NuttX clock_systimer() interface. + +NuttX-7.26 Release Notes +------------------------ + +The 126th release of NuttX, Version 7.26, was made on September 8, 2018, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.26.tar.gz and +apps-7.26.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - General: Eliminate use of the non-standard type systime_t and + replace it the equivalent, standard type clock_t From Gregory Nutt. + - General: Replace non critical PANIC with DEBUGPANIC to save the + code space From Xiang Xiao. + - General: Replace all ASSERT with DEBUGASSERT to save the code + space From Xiang Xiao. + - Initialization: Add option to mount block device for + INIT_FILEPATH case. From anchao. + - clock(): clock_systimer() is no longer a system interface. It has + been replaced with the equivalent, standard interface clock(). + Moved the implementation of clock() from the C library into the OS + core. This is necessary because it calls the (now) internal OS + function clock_systimer(). clock() is now accessed only via a + system call in certain configurations. From Gregory Nutt. + - clock Utilities: Move clock_timespec_[add|subtract] to + include/nuttx/clock.h From Xiang Xiao. + - Binary Loader: Add binfmt_initialize(). All binary formats are + now registered centrally vs. in board-specific logic. This + simplifies the usage of the binfmt subsystem. From Xiang Xiao. + - Binary Loader: Reference default symtab name to binfmt From anchao. + - mm: Add mm_heapmember function and reimplement kmm_heapmember base + on mm_heapmember since this function is very useful if multiple + heaps exist. From Xiang Xiao. + - mm: Add {kumm/kmm}_calloc API. Add calloc API for manage user + memory and kernel memory in Flat Build/Kernel Build without kernel + heap. From zhuyanlin. + - pthreads: Add support static pthread stack. Add standard + pthread_attr_setstack() and pthread_attr_getstack(). In all cases + where the stack is released, add check to see which allocator must + be used to free the stack: The user or the kernel allocator. From + xuanlin. + - Semaphores: Apply the semaphore wait function + nxsem_wait_uninterruptible(). This function is a wrapped version + of nxsem_wait() that is uninterruptible and convenient for use. + From liuhaiyang. + - Signals: Add default signal action to SIGKILL. From ligd. + - Signals: Update the signal default action logic to support + sigaction(). signaction() must be able to handle and input action + of SIG_DFL to setup the default signal action; it mast also return + SIG_DFL it is replacing the default action. From Gregory Nutt. + - Signals: Default Signal Actions. Change some types to + superficially simplify. Add configuration options to enabled + default signal behaviors on a per-signal basis. I don't think + users are prepared for SIGALRM to terminate the task (which is the + correct default behavior if you don't change it). Extend the + implementation of default signals so that it is totally table + driven and extensible by simply mondifying the content of const + tables. From Gregory Nutt. + - Signals: Add support for SIGINT in addition to SIGKILL. + - Signals: Add logic and an interface to determine if a signal can + be caught or ignored. sigaction now correctly returns EINVAL on + any attempt to catch or ignore such signals (only SIGKILL for now + and only if CONFIG_SIG_DEFAULT=y). From Gregory Nutt. + - Signals: Add support for default signal actions for SIGSTOP, + SIGSTP, and SIGCONT. Add procfs support to show stopped tasks. + From Gregory Nutt. + - Signals: Add nxsig_action() to solve a chicken and egg problem: + We needed to use sigaction to set default actions, but sigaction() + would refuse to set actions if the default actions could not be + caught or ignored. From Gregory Nutt. + - Signals: Add configuration option to selectively enabled/disable + default signal actions for SIGSTOP/SIGSTP/SIGCONT and SIGKILL/SIGINT. + - Signals: If a task/thread was already blocked when + SIGSTOP/SIGSTP was received, it will restart in the running state. + It will appear that to the task/thread that the blocked condition + was interrupt by a signal and returns the EINTR error. From + Gregory Nutt. + - Signals: Update signal default STOP action. If waitpid was + called with the WUNTRACED then wake up waitpid(). From Gregory + Nutt. + - IRQs: Monitor the IRQ execution time. This is very useful for + measuring the interrupt latency. From Xiang Xiao. + - IRQ Dispatch: Add support interrupt chains in NuttX. IRQ chain is + very useful in these cases: (1) Multiple hardware connect to the + same request line(e.g. PCI), (2) Need multiple driver to support + one hardware block (like Linux MFD) From zhuguangqing. + - Work Queue: Modify high priority work queue to support multiple + threads. From ligd. + - System Calls: Add support for getpeername() and get_sockname() + system calls. From Gregory Nutt. + - System Calls: svcall/sycall logic needs to get the ucontext + argument from R4 instead of stack since all syscall parameters pass + from registers in syscall.h From Xiang Xiao. + - CPU Load Measurement: Support the CPU load measurement using + timer_lowerhalf_s interface From Xiang Xiao. + - Assertions: Change CONFIG_BOARD_RESET_ON_CRASH to + CONFIG_BOARD_RESET_ON_ASSERT, arch/: Implement call to + board_reset() if in all implementations of up_assert() when + CONFIG_BOARD_RESET_ON_ASSERT=y. From Xiang Xiao. + - boardctl(): Add support for board_app_finalinitialize() From ligd. + - Architecture Interface: Add prototype for an architecture-specific + up_trigger_irq function. From dongjianli. + - Architecture Interface: Add the garbage collection hook so each + architecture can do custom memory cleanup if necessary. From Xiang + Xiao. + - Architecture Interface: Add architecture-specific prototypes for + conversions between physical and virtual address. From ligd. + + * File Systems/Block and MTD Drivers + + - ProcFS: Add support for a procfs entry that will permit examining + the environment of any task. From Gregory Nutt. + - ProcFS: Add support for proc/self/, a convenient way for getting + information about the currently running task. From Gregory Nutt. + - HostFS: Add support for open() append mode From anchao. + - HostFS: Add ftruncate support. From Xiang Xiao. + - HostFS: Remove ARCH_SIM dependence since other architectures + (e.g., arm semihosting) could support hostfs too From Xiang Xiao. + - HostFS: Support remote directory names without a trailing '/' + From ligd. + - HostFS: Add re-try when hostfs mount() fails From ligd. + - NFS: Update NFS client mount to VER3 From zhangyuan7. + - Partitions: Add PTABLE parser fs/partion: Add a partition parser + framework fs/driver/fs_blockpartition.c: Add + register_blockpartition for block partition From Xiang Xiao. + - MTD: Add gd25 driver From wangyanjiong. + - MTD: In MTD partitions, copy the partition name to internal + buffer so that the caller can free the name argument From Xiang + Xiao. + - MTD: Support initialization of an FTL block device with a custom + name From Xiang Xiao. + - MTD: FTL: Reduce size of stack buffer from 64 to a maximum size + as determined from NAME_MAX. From Gregory Nutt. + - VFS poll(): Send poll() notification when the Tx buffer is flushed + From ligd. + - VFS fstat(): Add file_fstat() function for internal OS use. From + ligd. + - VFS fcntl(): Add file_fcntl, psock_fcntl, and psock_dupsd for use + within the kernel. From Xiang Xiao. + - VFS dup2(): Addpsock_dupsd for use within the kernel. From Xiang + Xiao. + - VFS poll(): Add poll use in kernel space. From dongjianli. + - VFS select(): Make select be more consistent with Linux man page: + 'The timeout ... Some code calls select() with all three sets + empty, nfds zero, and a non-NULL timeout as a fairly portable way + to sleep with subsecond precision.' From anchao. + + * Networking/Network Drivers: + + - Sockets: Add getpeername() support From ligd. + - sockopt(): Move psock check from [get|set]sockopt to + psock_[get|set]sockopt From Xiang Xiao. + - getsockname(): Add psock_getsockname function From Xiang Xiao. + - Netlink Sockets: This brings in a fragmentary, experimental + implementation of NETLINK sockets. There is not too much to that + socket support on this initial commit, just the netlink socket + framework. However, I decided to bring it into master because + there is a enough that I would not want to lose what is in place. + And since it is dependent on CONFIG_EXPERIMENTAL, its presence on + master should be innocuous. From Gregory Nutt. + - Interface Indexes: Add driver interface index support. Add + implementation of if_nametoindex() and if indextoname(). Raw + AF_PACKET sockets now depend on CONFIG_NETDEV_IFINDEX. Add syscall + support for if_nametoindex() and if_indextoname(). Includes an + algorithm to prevent an interface index from being reused until all + network interfaces have by assigned once. The prevents removable + devices from being removed, unregistered and re-installed, + re-registered and keeping the same interface index. From Gregory + Nutt. + - Driver Interface: Add devif_loopback() to check the loopback + case where a packet is being sent to itself. Modify the net driver + to call this function in this case. This function will simply + re-inject the packet back into the network and the network driver + will not put anything on the wire. From Xiang Xiao. + - Network Devices: Remove all references to CONFIG_NET_USER_DEVFMT. + That feature is now unconditionally enabled. This was done because + (1) the feature does not require very much additional memory, and + (2) it causes confusion in the configuration due to the additional + complexity. Any network drivers that fail to zero the device + structure interface name field (d_ifname) because calling + netdev_register() will, however, get a nasty surprise. From + Gregory Nutt. + - Network Devices: Add support for Microchip LAN91C111 driver From + Xiang Xiao. + - Network Devices: netdev_findby_ipv[4|6]addr return + netdev_default() as last resort but don't return loopback device + if another network device is in the UP state. From Xiang Xiao. + - Network Device IOCTLs: Add si_ioctl callback and net_ioctl_arglen + so usrsock could forward the ioctl to the remote end/ From + dongjianli. + - IPv6: Rename g_ipv6_allzeroaddress with the more meaning + g_ipv6_unspecaddr since the all-zero address is the IPv6 + unspecified address (sometime IN6_ADDR_ANY). Replace more inline + tests for IPv6 multicast with common net_is_addr_mcast() macro. + From Gregory Nutt. + - ARP: arp_find() now checks if the target IP belongs to one of the + local network devices. From Xiang Xiao. + - ARP: Make the function arp_find() thread-safe. It now returns a + copy of the MAC address from the ARP table entry, rather than a + potentially unstable reference to the ARP table entry. From + Gregory Nutt. + - TCP: Re-work of TCP receive window size algorithm. The new logic + is based only on the ability to buffer TCP read-ahead data. From + Gregory Nutt. + - UDP: Add support for the UDP_BINDTODEVICE protocol socket option + From Sebastien Lorquet. + - Slip: Uncomment the prompt of NET_SLIP_PKTSIZE in Kconfig file. + From Xiang Xiao. + - USRSOCK: Combine some the duplicated logic. From Xiang Xiao. + - USRSOCK: Optimize option dependence From Xiang Xiao. + - USRSOCK: Add the listen/accept/getpeername/ioctl support From + dongjianli. + + * Other Common Device Drivers: + + - Analog DAC: Add driver for digital to analog converter DAC7571. + Nucleo-L422KC: Add support for a connect DAC7571 converter. From + Daniel Pereira Carvalho. + - Audio Interface: Change member samp of apb to pointer so driver + can customize sample buffer allocation From ZhongAn. + - Audio Interface: Add ioctl cmd 'AUDIOIOC_SETBUFFERINFO' so user + space could config the buffer From ZhongAn. + - Audio Interface: Add hardware format support From anchao. + - I2S Interface: Add i2s_rxchannels and i2s_txchannels methods to + the I2S lower half interface. From ZhongAn. + - Audio: Move the I2S character driver to a dedicated folder. From + Xiang Xiao. + - Audio: Add audio_i2s device driver. From ZhongAn. + - Audio: Add the composite audio driver From Xiang Xiao. + - Crypto: Move dev_urandom.c into new crypto folder. From Xiang + Xiao. + - GPIO driver: Add gpio_pin_unregister function to GPIO driver + driver/ioexpander: Add pinset struct to GPIO driver for interrupt + pins larger than 64. Initialize pintype/inttype when registering + ioexpander device. Add SETPINTYPE ioctl command to the GPIO + driver. From zhuyanlin. + - I2C Interface: Add a definition to distinguish a new START of + messages from a repeated start. No lower-half I2C drivers actually + implement this new flag bit, however. In I2C write/read logic use + new repeated START definition where appropriate. Rename + I2C_M_NORESTART to I2C_M_NOSTART since it may be used in other + contexts than a repeated start. Add comments to clarify setup for + repeated start. From Gregory Nutt. + - I2C: Add the standard speed macros. From dongjiuzhu. + - Leds: Add support to MAX7219 to control 7-segment displays. From + Alan Carvalho de Assis. + - Power: PM: Add pm_stay and pm_relax function so special apps(e.g. + mediaplayer) could disable suspend during playback much like linux + kernel counterpart From Xiang Xiao. + - Power: PM: Add pm_querystate function From zhuguangqing. + - Power: PM: Don't update the power state in work thread: (1) + Simplify the code logic and remove the work queue dependence, (2) + Power calculation is too simple to delay into the work queue From + Xiang Xiao. + - Power: PM: Decrease the power state in the reverse order. Since + the child driver need power off before parent driver. From + zhuguangqing. + - Power: PM: Make power manager service available as soon as + possible: (1) Initialize g_pmglobals at the definition, (2) skip + hold the lock if OS isn't ready From Xiang Xiao. + - Power: PM: Add PM_RESTORE to notify driver that device exit WFI + so the driver could restore state. For example, WDT may stop + counting before enter low power state and restore the counting + again in PM_RESTORE notification From zhuguangqing. + - Power: PM: Add timer to decrease PM level automatically. From + ligd. + - PTYs: Add support so that a PTY can poll for both IN/OUT event + simultaneously. From ligd. + - PWM: Move pwm.c into pwm folder From Xiang Xiao. + - RTC Interface: Extend struct rtc_time by adding. From Xiang + Xiao. tm_nsec if RTC supports hiresolution time. From Xiang Xiao. + - Sensors: Add support for Telair T6713 carbon dioxide sensor. From + Juha Niskanen. + - Sensors: Add support for LSM303AGR and LSM6DSL sensors From + DisruptiveNL. + - Sensors: Add driver for DHTxx sensor. From Ouss4. + - syslog: Enable a partial, crippled version of syslog_flush(); + Call syslog_flush() from assertion handling logic of all + architectures. From Gregory Nutt. + - syslog: Channel configuration. Decouple SYSLOG_SERIAL_CONSOLE and + ARCH_LOWPUTC. Since some hardware can output log to the special + debug channel not serial. From anchao. + - syslog: Support pre-pending a prefix string to log output if + enabled. This very useful to identify which CPU send out the log + in AMP SoC. From anchao. + - Serial: Add Ctrl-C/Ctrl-X support. From ligd. + - Serial: Support UART direct write for non console device From + xuanlin. + - Serial: It is no longer necessary to restrict Ctrl-C handling to + the FLAT build sched/signal: Add a new configuration option to + select signal default actions, separate handling of signal default + actions from both task startup logic and from the serial TTY + Ctrl-C logic. Add a signal set in the group structure to keep + track of what signals have been set to the default action. In + dispatching signals in PROTECTED or KERNEL mode, use this signal + set to determine if the default signal handler is attached and + dispatch the signal in kernel mode for the default actions. From + Gregory Nutt. + - Serial: Integrate new Ctrl-C logic with the ISIG flag in the + termios c_lflag. From Gregory Nutt. + - Serial: Use SIGINT instead of SIGKILL when control-C is pressed. + From Gregory Nutt. + - Serial: Add support for Ctrl-Z. This works just like the + recently added Ctrl-C support except that SIGSTP is sent when the + Ctrl-Z characters is encountered vs. SIGINT. From Gregory Nutt. + - 16550 UART: Add a configuration, analogous to the STM32 + configuration option, to suppress the NuttX standard re-ordering + for /dev/ttySN for special case of the 16550 UART. + - 16550 UART: Add CONFIG_SERIAL_UART_ARCH_MMIO option so the a + memory mapped device doesn't need to provide uart_getreg() and + uart_putreg() implementations. + - 16550 UART: Add stub implementations of DMA-related methods in the + 16550 UART v-table. From ligd. + - 16550 UART: Add serial termios handling From anchao. + - 16550 UART: Support 16550 auto hardware flow control + drivers/serial/uart_16550.c: Add configuration option + CONFIG_16550_SUPRESS_INITIAL_CONFIG. This is identical to the + standard configuration in arch/Kconfig + CONFIG_SUPPRESS_UART_CONFIG, but with scope of only the 16550 + driver. From Xiang Xiao. + - syslog: Make timestamp output same as linux kernel. It's very + useful if NuttX syslog retarget to Linux syslog. From Xiang Xiao. + - Timers: Add maxtimeout method to the struct timer_ops_s interface + From Xiang Xiao. + - Timers: Add a new method to the struct oneshot_operations_s + interface to get the current time from a oneshot timer driver (if + it is available from the lower half) From Xiang Xiao. + - Timers: Implement timer arch API on top of timer driver. From + Xiang Xiao. + - Timers: Implement alarm arch API on top of oneshot driver + interface. From Xiang Xiao. + - Timers: Implement RTC arch API on top of RTC driver interface. + From Xiang Xiao. + - CDC/ECM: Adds USB device support for CDC/ECM From Michael Jung. + - USB Host: Add support for the Maxim M3421E USB host driver. Not + yet fully tested. From Gregory Nutt. + + * General Architecture-Specific: + + - All architectures: Make sure the up_irq_enable() is available on + all architectures. From Gregory Nutt. + + * Simulation + + - Simulator Configurations: Add dsptest configuration. From Mateusz + Szafoni. + - Simulator: In network driver (1) Remove up_comparemac() check for + matching MAC address. Let's trust that the tap device just return + the packet which belong to us like other real network device + hardware. (2) Add network device statistics support. From Xiang Xiao. + + * ARM: + + - ARM (all): Add CONFIG_DEBUG_MEMFAULT to Kconfig. From Masayuki + Ishikawa. + - ARM: (1) Add semihost support for syslog, (2) Add semihost support + for HostFS From Gregory Nutt. + + * ARMv6-M: + + - ARMv6-M: Introduce CONFIG_DEBUG_HARDFAULT_INFO to up_hardfault.c + From Masayuki Ishikawa. + + * ARMv7-M: + + - ARMv7-M: Removes support for the dedicated vector handling from the + many older architectures. Only common vectors are now supported. + From Gregory Nutt. + - ARMv7-M: Introduce CONFIG_DEBUG_HARDFAULT_INFO to up_hardfault.c + From Masayuki Ishikawa. + - ARMv7-M: Implement SYSTICK timer driver From Xiang Xiao. + - Simulator: Add loadable demo for arch sim. From anchao. + - ARMv7-M: Add logic to trigger ARMv7-M interrupts and exceptions. + From Gregory Nutt (from sample logic by Xiang Xiao). + - ARMv7-M: Add NVIC definitions needed by up_trigger_irq(). From + Gregory Nutt. + + * ARMv7-R: + + - ARMv7-R: Add general interrupt controller. This is based on + ARMv7-A gic controller code. From EunBong Song. + - ARMv7-R: Add invalidate dcache in arm_head.S. From EunBong Song. + + * Infineon XMC4xxx Drivers: + + - XMC4 GPIO: Add a specific bit encoding to GPIO driver for + opendrain GPIO pin. From Alan Carvalho de Assis. + + * Infineon XMC4xxx Boards: + + - XMC4500-Relax: Add support to MAX6675 on XMC4500-Relax board. + From Alan Carvalho de Assis. + + * Microchip PIC32MX Boards; + + - PIC32MX: Update some PIC32MX configurations so that either the + MPLAB or Penguino toolchains may be used. From Gregory Nutt. + + * Microchip/Atmel SAMD2x/L2x: + + - SAMD2x/L2x: Rename all usage of samdl/SAMDL to samd2l2/SAMD2L2 to + make room in the name space for samd5e5/SAMD5E5 From Gregory Nutt. + + * Microchip/Atmel SAMD5x/E5x: + + - SAMD5x/E5: Add a port to the SAMD5x/E5x MCU family. From Gregory + Nutt. + + * Microchip/Atmel SAMD5x/E5x Drivers: + + - SAMD5x/E5x SPI/I2C: Bring in untested SPI and I2C drivers from + SAMD2L2. From Gregory Nutt. + - SAMD5x/E5x DMA: Leverage the SAMD2L2 DMA controller. From Gregory + Nutt. + - SAMD5x/E5x USB: Bring the SAMDL2 USB driver into the SAMD5E5 + port. From Gregory Nutt. + + * Microchip/Atmel SAMD5x/E5x Boards: + + - Metro M4: Add support for the Adafruit Metro M4 board. From + Gregory Nutt. + - Metro M4: Add an option to build the Metro M4 image to run out of + SRAM. This ought to be a safer and quicker way to do the initial + bring-up (having bricked the first Metro M4 due to a bad FLASH + image). From Gregory Nutt. + - Metro M4: Add a configuration option to use OSCULP32K instead of + XOSC32K. From Gregory Nutt. + - Metro M4: After some final fixes related to the SERCOM console, + the basic NSH configuration appears fully functional. From + Gregory Nutt. + - Metro M4: Verify the CMCC and enable it by default in the NSH + configuration. From Gregory Nutt. + + * Microchip/Atmel SAMv7 Drivers: + + - SAMv7 CAN: Add ability for CAN BUS_OFF autorecovery according + ISO11898-1:2015. With this change we added an ioctl for triggering + the autorecovery sequence for BUS_OFF to the CAN-driver and the + SAMV7 low-level driver. According the datasheet: If the device + goes Bus_Off, it will set MCAN_CCCR.INIT of its own accord, + stopping all bus activities. Once MCAN_CCCR.INIT has been cleared + by the processor (application), the device will then wait for 129 + occurrences of Bus Idle (129 * 11 consecutive recessive bits) + before resuming normal operation. At the end of the Bus_Off + recovery sequence, the Error Management Counters will be reset. + During the waiting time after the resetting of MCAN_CCCR.INIT, each + time a sequence of 11 recessive bits has been monitored, a Bit0 + Error code is written to MCAN_PSR.LEC, enabling the processor to + readily check up whether the CAN bus is stuck at dominant or + continuously disturbed and to monitor the Bus_Off recovery + sequence. MCAN_ECR.REC is used to count these sequences. From + Frank Benkert. + + * NXP Freescale i.MX RT Drivers: + + - i.MXRT RTC: Add support for the i.MXRT RTC. This is code complete + (with limited features and options) but untested. The HPRTC is + functional. However, if the LPSRTC is enabled, then there is a + hang during LPSRTC initialization. It appears that there is some + problem in providing clocking and initializing the LPSRTC domain. + From Gregory Nutt. + - i.MXRT SNVS: Add trivial SNVS from Rev 1. of the Reference Manual. + From Gregory Nutt. + - i.MXRT LSPI: IMXRT1050 LPSPI register and bit definitions added. + From Ivan Ucherdzhiev. + - i.MXRT Serial: IMXRT1050 LPUART TERMIOS support added. From Ivan + Ucherdzhiev. + + * NXP Freescale i.MX RT Boards: + + - IMXRT1050-EVK: Add knsh configuration. PROTECTED mode NSH build. + From Gregory Nutt. + + * NXP Freescale Kinetis: + + - Kinetis: Add DMA support. From David Sidrane. + + * NXP Freescale Kinetis Drivers: + + - Kinetis: Use circular DMA as an option to augment the RX FIFOs in + the Serial driver. From David Sidrane. + + * NXP LPC54xx: + + - LPC54xx: The LPC54608 can only run at a maximum frequency of + 180Mhz. This configuration requires uses the clk_in, external + crystal clock, to drive the PLL. When that input was selected, the + board bootup failed waiting for the PLL to lock. After referring + the driver from NXP, we should turn on power sources for the ext + clock if system pll input select clk_in. NOTE that the LPC54628 + did not require this step... perhaps because the system oscillator + power was already enabled. From kxjiang. + - LC823450: Add support for mpu and userspace LC823450-XGEVK: Add + kostest PROTECTED build LC823450-XGEVK: Add knsh PROTECTED build + From Masayuki Ishikawa. + + * NXP LPC54xx Boards: + + - Lpcxpresso-LPC54628: Update lvgl board config to use the new + version From Alan Carvalho de Assis. + + * On Semi LPC23450 Drivers: + + - LC823450 Bluetooth: Add lc823450 Bluetooth support. From Masayuki + Ishikawa. + - LC823450 I2S: Add tx start threshold to lc823450_i2s.c In + addition, lc823450_i2s_send() now accepts byte-aligned stream. + From Masayuki Ishikawa. + - LC823450 SPI: Add SPI flash driver for lc823450. NOTE: Only bus + accelerator mode is supported. From Masayuki Ishikawa. + - LC823450: Change C-Buffer under-level control. The under-level + setting was changed from 1KB to 55KB. In previous implementation, + the setting can be changed by the tx threshold but it is fixed at + startup. Also, check write size and adjust alignment if needed. + From Masayuki Ishikawa. + + * On Semi LPC23450 Boards: + + - LC823450-XGEVK: Add loopback test for digital MIC on lc823450 via + i2schar driver. From Masayuki Ishikawa. + - LC823450-XGEVK: Add lc832450 elf test. From Masayuki Ishikawa. + - LC823450-XGEVK: Add posix_spawn configuration From Masayuki + Ishikawa. + + * STMicro STM32: + + - STM32 L4: Add initial support to STM32L4+ chips From Juha Niskanen. + - STM32 H7: A partial port to the STMicro STM32H7 by Simon Laube was + brought in from the PX4 repositories. Numerous changes were + make(by Mateusz Szafone). The basic STM32 H7 NSH configuration is + now functional, thanks to Mateusz Szafoni. + + * STMicro STM32 Drivers: + + - STM32 F0, F1-F4, F7, L4, H7: Added Single Wire Kconfig variable. + From David Sidrane. + - STM32 DAC: Set OUTEN bit for DAC1CH2 and DAC2CH1 power/motor. + Direction parameter is now int8 + add overload fault. From Mateusz + Szafoni. + - STM32 F1-F4 ADC: Allow multiple channels without DMA on + STM32L15XX. From Juha Niskanen. + - STM32 F1: Add FLASH register definitions for F1 parts that have + dual banked FLASH. From Dmitriy Linikov. + - STM32 F2: Added progmem interface support for STM32 F2 From + Dmitriy Linikov. + - STM32 F4: Ports STM32 LTDC and STM32 DMA2D to use the + framebuffer interface From Marco Krahl. + - STM32 F7: This change ports Marco Krahl's STM32F4 framebuffer + overlays for the LTDC and DMA2D into the STM32F7. That driver was + same as the STM32 F4 driver. From Gregory Nutt. + - STM32 F7: Port input capture from stm32. From Juha Niskanen. + - STM32 F7 FLASH: Ported the STM32 F2/F4 driver to the STM32 F7 + platform. From Evgeniy Bobkov. + - STM32 F7 SDMMC: Add SDIO card support to SDMMC driver. From + Ramtin Amin. + - STM32 F7 Serial: Previous logic would invalidate the data cache as + each byte was read from the DMA buffer. This change adds logic to + invalidate the data cache less frequently by monitoring the state + of the Rx DMA buffer cache coherency and invalidating only regions + as necessary. From Evgeniy Bobkov. + - STM32 F7: Add up_stackcheck.c From Daniel Agar. + - STM32 F7: Port the low-level PM functions to STM32 F7. From Juha + Niskanen. + - STM32 L4: STM32L4 has fetchadd and testset From Juha Niskanen. + - STM32 L4: Added custom pin mapping for STM32L4X2XX processors. + From Daniel P. Carvalho. + - STM32 L4 FLASH: stm32l4xrxx: allow board to override flash wait + states From Juha Niskanen. + - STM32 L4: Some updates to analog peripherals ADC, COMP and DFSDM + for STM32L4XR From Juha Niskanen. + - STM32 L4: Add getstatus and getperiod() method to the timer + driver (includes coding standard changes made prior to commit) + From Goden Freemans. + - STM32 H7: Remove old references to RXDMA. Add configuration + - STM32 H7: Remove old references to RXDMA. Add configuration + option to select the Rx FIFO threshold level. From Gregory Nutt. + + * STMicro STM32 Boards: + + - STM32F103 Minimum: Add blackpill LED support From Russ Webber. + - Viewtool-STM32F107: Add a TCP performance test using + apps/examples/tcpblaster. From Gregory Nutt. + - Viewtool-STM32F107: Add support for the MAX3421E to the + Viewtool-STM32F107 board support From Gregory Nutt. + - STM32F334-DISCO: Use a PID controller from libdsp in the BuckBoost + driver. From Mateusz Szafoni. + - STM32F4-Discovery: Remove STM32F4BB dependence from RNDIS; add + RAMDISK support. From Alan Carvalho de Assis. + - STM32F4-Discovery Add board support for MAX7219 as numeric display + controller. From Alan Carvalho de Assis. + - Olimex-STM32-P407: Add kernel ELF (kelf) configuration. From + Gregory Nutt. + - Olimex-STM32-P407: Add a kmodule configuration that can be used + for testing installation of kernel modules in the protected build. + From Gregory Nutt. + - Olimex-STM32-P407: Add logic to support initialization of the + kernel module symbol table installed in the pass1/ directory during + the application phase of the build. The kmodule configuration + appears to be fully functional. From Gregory Nutt. + - Olimex-STM32-P407: Add board support for the DHTxx sensor. From + Ouss4. + - STM32F476G-DISCO: Add support for STM32F746G-disco board LCD. + From Marcin Wyrwas. + - STM32F476G-DISCO: Add a configuration to build working nxdemo + application From Fanda. + - STM32F476G-DISCO: Add support for STM32F746G-disco board SDRAM + Changed fb config to use SDRAM. From Marcin Wyrwas. + - STM32F476G-DISCO: Add touchscreen support and a LittlevGL demo for + STM32F746G-DISCO From Marcin Wyrwas. + - Nucleo-L476RG: Add support for an external SPI-driven SD card on + the Nucleo-L476RG. From Gregory Nutt. + - Nucleo-L476RG: Add support for LSM303AGR and LSM6DSL sensors From + DisruptiveNL. + - Nucleo-H743ZI: Use Nucleo Virtual console as default console in + the NSH configuration From Mateusz Szafoni. + - STM32L4R9-DISCO: Add stm32l4r9ai-disco support. From Juha Niskanen. + - B-L475E-IOT01A: Add timer driver support. From Goden Freemans. + + * Libraries/Header Files: + + - libc endian: Add support for endian.h. From Gregory Nutt. + - libc net: Add inet_aton() From Juha Niskanen. + - libc netdb: Add getaddrinfo() and friends. From Juha Niskanen. + - libc termios: Add lib_cfmakeraw.c From Masayuki Ishikawa. + - libc stdlib: Add implementation of random() and srandom(). From + Gregory Nutt. + - libc unistd: Add a crippled version of daemon(). From Gregory Nutt. + - libdsp: All floats with f-sufix libdsp: (1) add precision option + for library, (2) add debug option for library and assertions in + functions, (3) add current samples correction for SVM3, (4) add + some motor control specific functions, (5) add basic speed + observer, (6) fix phase shift in SMO observe, (7) add more logic to + FOC. From Mateusz Szafoni. + - include/nuttx/compiler.h, include/poll.h: Add logic to determine + if the compiler supports anonymous structures and unions. From + Gregory Nutt. + - include/nuttx/mutex.h: Add inline wrapper functions to more + clearly support semaphores when used as mutexs. From QianWenfa. + - include/nuttx/nuttx.h: Added nuttx.h header file which is + analogous to the linux.h header file. Currently, it contains on + the definition of the container_of() macro. From zhuyanlin. + - include/queue.h: Add dq_tail marco From zhuguangqing. + - include/stdio.h: Add prototypes for popen() and pclose(). Actual + implementation is in apps/system/popen() From Gregory Nutt. + - include/sys/param.h: Add a dummy sys/param.h header file. This is + not a standard file but is used by other systems and having the + dummy file may minimize some porting efforts. From Gregory Nutt. + + * Tools: + + - nuttx/tools/kconfig2html.c: Due to new usage, tool needs to be + able to handle configuration files with names other than Kconfig. + From Gregory Nutt. + - nuttx/tools/kconfig2html.c: Update tool to handle tristate types. + From Gregory Nutt. + - nuttx/tools/Config.mk: Add function CATFILE definition. Currently + only used in apps/builtin/Makefile. From Gregory Nutt. + - nuttx/tools/Config.mk: Add the recursive wildcard function, + RWILDCARD, to Config.mk. From Gregory Nutt. + - nuttx/tools/testbuild.sh: Add an option to specify the location of + nuttx directory. From Gregory Nutt. + - nuttx/tools/refresh.sh: Add a --prompt option that will let you + use --silent but will prompt before overwriting the original + defconfig. From Gregory Nutt. + - nuttx/tools/link.sh. Update link.sh per suggestions by Mark so + that it can be used with MSYS vs copydir.sh. From Gregory Nutt. + - nuttx/tools/mkexport.sh: Save the System.map file and User.map + file (if it exists) in the export package so that it can be used to + extract addresses. From Gregory Nutt. + - nuttx/tools/mkexport.sh: Save the name of the STRIP tool too. From + Gregory Nutt. + - nuttx/tools/nxstyle.c: Add capability to detect multiple blank + lines. Single spacing required by the coding standard. Also coding + standard fixes to server .c files for problems found during testing + nxstyle. From Gregory Nutt. + - apps/tools: Add +x to mksymtab.sh. From Masayuki Ishikawa. + - apps/tools/define.sh and define.bat: Move a copy of define.bat + and sh from nuttx/tools to apps/tools so that they will be + available for the import build. From Gregory Nutt. + + * Build System: + + - Apps/ Build System. The apps/ build system has undergone a major + renovation to better support building applications as ELF modules. + Module selections have changed from 'bool' to 'tristate' types. + This means that building an ELF now is as simple setting the value + to 'm'. This effort required many changes, too many to summarize + here. The solution was contributed by Masayuki Ishikawa, Anchao + An, and Xiang Xiao (and myself to a lesser extent). + - NuttX/ Build System: This change extends support for the two-pass + build. Its primary purpose is to incorporate source logic + generated by applications into the kernel phase of the build. + In the two pass build, the application logic is built during the + first phase, pass 1. In that phase, the application may generate + and install source files in the pass1/directory. The operating + system is built during phase 2 of the build. At that time, those + source files in the pass1/ directory will be built and incorporated + into the kernel address space. + The primary purpose of the pass1/ directory is to such + application-generated kernel symbol tables. For an example of the + use of this feature, look at + apps/examples/module/drivers/Makefile. Kernel symbol tables are + needed to support kernel modules. Of course, addition + board-specific logic in, say, configs//src would have to be + included to make use of the application-installed symbol tables. + From Gregory Nutt. + - Remove CONFIG_ARCH_CALIBRATION. It is awkward to use and no longer + necessary now that we have apps/examples/calib_udelay. From + Gregory Nutt. + - Build System: With recent changes to apps/ all configurations that + build applications as modules must now also select + CONFIG_APPS_LOADABLE. From anchao. + - Build System: Add dynamic application loadable support. From + anchao. + - Build System: Add configuration CONFIG_ARCH_GNU_NO_WEAKFUNCTIONS + to suppress use of weak functions. Some gnu derived toolchains do + not support weak symbols. From Xiang Xiao. + - Kconfig: Move 'option modules' from NSH_FILE_APPS to + BUILD_LOADABLE From anchao. + - apps/ Build System: Introduce a build system for loadable apps + for nsh. Add 'option modules' to NSH_FILE_APPS so that a user can + change an application configuration to tristate (y/n/m) + - apps/import: Add Makefile.symtab which can be used to compile the + dynamically created symbol table C file. Also adds + tools/mksymtab.sh. From Gregory Nutt. + + * NSH: apps/nshlib: + + - apps/nshlib: Add parsing support for back-slash quoted + characters. Currently only implemented properly if + CONFIG_NSH_ARGCAT is also selected. This commit is in response to + Bitbucket Issue 11 opened by Maciej Wjcik From Gregory Nutt. + - apps/nshlib: Add inverted logic support in the form of 'if ! + ' From Beat Kng. + - apps/nshlib: Expand reboot and poweroff commands to include a + second, optional mode argument From ligd. + - apps/nshlib: Add a force flag (-f) to mksmartfs command. SmartFS + will be formatted only if (1) the FLASH does not already hold a + SmartFS, or (2) the force flag is set. From Xiang Xiao. + - apps/nshlib: NSH prompt string is now configurable. nsh> is + still the default. From Xiang Xiao. + - apps/nshlib: Add control-C support for terminating built-in and + exec'ed file tasks. From ligd. + - apps/nshlib: Call BOARDIOC_FINALINIT after start-up script (or + immediately after BOARIOC_INIT is there is no start-up script). + From ligd. + - apps/nshlib: When using waitpid() to wait for a built-in + application or a file application to exit. Add the WUNTRACED + options to so the the waitpid() call will also be awakened if the + waited-for task is stopped as well. From Gregory Nutt. + + * NSH Builtins: apps/builtin: + + - apps/builtin/Makefile. This commit changes apps/builtin to search + the registry recursively. By supporting directories, external + projects can install the hooks into the registry and easily clean + them up and reinstall if something needs to be updated. Based on + an idea from Anthony Merlino. From Gregory Nutt. + + * Examples/Tests: apps/examples: + + - apps/examples/calib_udelay: Add tool for calibrating + CONFIG_BOARD_LOOPSPERMSEC From Juha Niskanen. + - apps/examples/dhtxx: Example for the DHTxx sensor. From Ouss4. + - apps/examples/dsptest: Add unit test for Nuttx DSP library From + Mateusz Szafoni. + - apps/examples/elf: CROMFS and ROMFS configuration currently only + usable in FLAT build. Add configuration to use ELF objects on + external media like SD card or USB drive instead. From Gregory + Nutt. + - apps/examples/elf: If the test ELF files are on media in + removable media such as SD or USB FLASH, the wait until the media + has been installed and initialized before starting the test. From + Gregory Nutt. + - apps/examples/fb: Adds example to test framebuffer overlay From + Marco Krahl. + - apps/examples/gps: Add GPS example using MINMEA lib From Alan + Carvalho de Assis. + - apps/examples/i2sloop: Add i2sloop application. This application + can be used to test I2S loopback like: ' nsh> i2sloop &'. From + Masayuki Ishikawa. + - apps/examples/lvgldemo: Update LVGL to version 5.1.1 From Alan + Carvalho de Assis. + - apps/examples/module: Add support for CROMFS and for stripping + symbols from ELF module binaries. From Gregory Nutt. + - apps/examples/module: Add support for automounting removable media. + This involves a wait for the block driver to become available + before performing the mount. From Gregory Nutt. + - apps/examples/module: When built in the PROTECTED or KERNEL + modes, the symbol table is not built by the application. That is + because the build will fail since the kernel module depends on + internal OS symbols thar are not available to the application + build. With this change the examples does not attempt to build + the kernel symbol table in these modes. Instead it just copies + the kernel module symbol table into the nuttx/pass1 directory + where it can be build directly into the OS during pass2 of the + build. From Gregory Nutt. + - apps/examples/ostest: Add a small test for SIGSTOP, SIGCONT, and + SIGKILL actions. From Gregory Nutt. + - apps/examples/popen: Add a test of popen/pclose. From Gregory + Nutt. + - apps/examples/powerled: Add arch initialization. From Mateusz + Szafoni. + - apps/examples/tcpblaster: Add TCP performance measurement test. + From Gregory Nutt. + + * System Utilities: apps/system + + - apps/system/cle: Usage improvements including command line + history (taken from readline) and support for addition control + characters. From mst. + - apps/system/i2c: Adapt to rename I2C_M_RESTART->i2C_M_START. + I2C_M_NOSTOP should be in flags of first message in every + write-read and write-write mesage sequence. From Gregory Nutt. + - apps/system/i2c: Allow registers besides 0x00 in the dev command. + From Jakob Haufe. + - apps/system/nsh: Add logic to automatically register an + application symbol table as part of NSH initialization. From + Masayuki Ishikawa. + - apps/system/nsh: The symbol table name and size variable names + can now be configured. From Gregory Nutt. + - apps/system/nsh: Move apps/examples/nsh to apps/system/nsh. It + has become so entrenched that it is hardly an example these days. + May as well formalized it as a system task. From Gregory Nutt. + - apps/system/nxplayer: Refactor nxplayer.c. Apply + netlib_parsehttpurl() and + remove unnecessary usleep(). From Masayuki Ishikawa. + - apps/system/nxplayer: Release buffer before session and release + semaphore in nxplayer_setvolume system/nxplayer/nxplayer.c: + Remove & for apb->samp reference. It is already a pointer. From Xiang Xiao. + - system/nxplayer/nxplayer.c: Add playraw command From ZhongAn. + - apps/system/nxrecorder: Add nxrecorder application From ZhongAn. + - apps/system/popen: Add an implementation of the standard popen() + and pclose() OS interfaces. These are implemented as applications + vs. part of the OS because they depend on NSH. Untested on + initial commit. From Gregory Nutt. + - apps/system/system and popen: Adapt so that these can be used in + the KERNEL build mode. In this case, simply replace task_spawn() + with posix_spawn(). This depends on the existence of some + environment where /bin/sh exists and can be used to execute one + NSH command. For the case of system(), this change was more + complete because it previously used task_create(). Now it uses + either task_spawn() or posix_spawn(), depending upon the + configuration. From Gregory Nutt. + - apps/system/taskset: Add taskset command for SMP systems. This + command can be used to retrieve or set a process's CPU affinity. + For example, + + nsh> taskset -p 4 + pid 4's current affinity mask: 2 + + nsh> taskset -p 3 4 + pid 4's current affinity mask: 3 + + nsh> taskset -p 1 busyloop & + + From Masayuki Ishikawa. + - apps/system/zmodem: Support -p for rz to change the folder + for the received file. Switch debug output from printf to + syslog. Send the next packet for ZME_ACK in ZMS_SENDING to avoid + rz on the host side stuck make send work reliable even without + hardware flow control. From Xiang Xiao. + + * Network Utilities: apps/netutils: + + - apps/netutils/dhcpc: Activates BINDTODEVICE if available. From + Sebastien Lorquet. + + * Wireless Utilities: apps/wireless: + + - apps/wireless/i8sak: i8sak daemon now gets shutdown if not in use. + Previously, once the i8sak daemon was started, by running any + command, it would stay running. This means that if you want to use + i8sak to setup your network, but then want exclusive access to the + char device, or network device, you have to manually shutdown the + i8sak daemon. Now the daemon stays active as long as required to + finish any commands, or stays open if a new command keeps it on, + but when all work is finished, it shuts down. From Anthony Merlino. + + * Filesystem Utilities: apps/fsutils: + + - mkfatfs: Clean up some name BS_ and MBR_ refer to the same record + and should use the same naming (MBR_). From Gregory Nutt. + - mkfatfs: Add definitions for the FAT boot record (FBR). From + Gregory Nutt. + - mksmartfs: Add a check to see if the SmartFS is already + formatted. From Xiang Xiao. + + * Graphic Utilities: apps/graphics: + + - graphics/littlevg/: Update LVGL to version 5.1.1 From Alan + Carvalho de Assis. + + * Test Utilities: apps/testing: + + - testing/unity: Add Unity - unit testing library from + ThrowTheSwitch.org. From Mateusz Szafoni. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Signals: Signal handlers maybe run with interrupts enabled or + disabled, depending on how the task the received the signal was + blocked. (i.e.: If sem_wait() is called, then we disable + interrupts, then block the currently running task). This could be + dangerous, because user code would be running with interrupts + disabled. + This change forces interrupts to be enabled in up_sigdeliver() + before executing the signal handler calling up_irq_enable() + explicitly. This is safe because, when we return to normal + execution, interrupts will be restored to their previous state when + the signal handler returns. From Gregory Nutt (Based on a + recommendation by Mark Shulte). + - Signals: Lock the scheduler while while killing the children so + that we do not lose priority and let the task group continue to + run in an indeterminate state. From Gregory Nutt. + - Groups: Fix a deadlock when loading an ELF From Masayuki Ishikawa. + - Groups: In some circumstances, group_killchildren() could have + called pthread_cancel() to kill a task. Also, the behavior would + not be as expected if a pthread had cancellation disabled. From Gregory Nutt. + - Posix Message Queues: mq_notify() fix - only part of struct copied + to internal structure. As source address the address of the struct + member sigev_value was used, and it is not located the start of the + struct. This leads to invalid data being copied to internal + structure. Both source and destination should be of type struct + sigevent* . From Simon Liedl. + - vfork(): vfork operation needs to allocate and copy the task + argument too. Also correction of the address correction cannot + depend on the stack pointer since it is not available in all + architectures. Rather calculate the offset from the stack + allocation pointer From Xiang Xiao. + - IRQ Dispatch: Ensure vector never points to NULL since interrupt + may happen before irq_initialize() From Xiang Xiao. + - Work Queue: workqueues don't need set global data to zero since + .bss is cleared automatically. Removing this unnecessary + initialization also avoids the loss the work items queued before + initialization. From ligd. + - Work Queue: Remove work queue polling delay to simplify the code + logic and save the power. From xuanlin. + - syslog: Fix syslog crash on 64bit simulation. From anchao. + - Pipes: Write to a pipe when there are no readers from the pipe + should return -EPIPE. From ligd. + - System Calls: Fix 6th parameter type of posix_spawnp in + syscall.csv From Masayuki Ishikawa. + - System Calls: Remove unused SYS_nnetsocket from syscall.h. Because + SYS_nnetsocket is not implemented so far, it should be removed so + that SYS_prctl can work correctly. From Masayuki Ishikawa. + - Binary Loader: Refactor binfmt_exec.c. This change also fixes an + argv issue for CONFIG_SCHED_ONEXIT=n or CONFIG_SCHED_HAVE_PARENT=n + From Masayuki Ishikawa. + - Binary Loader: Re-architect the way that loadable ELF or NXFLAT + modules are unloaded. Memory resources must be recovered when the + task loaded into memory exits. The original implementation used + the death-of-child SIGCHLD signal to perform the unload. There are + several problems with this: It is overly complex, it requires that + the parent task stay resident while the loaded task runs, and it + has fatal logic flaws in the protected and kernel model builds + because the user signal handler attempts to run in the kernel + address space. This corrects the issue using a mindlessly simply + BINFMT callback when the task exits. From Gregory Nutt. + - ELF Binary Loader: Set priority level to default if parent has no + priority. From anchao. + + * File System/Block and MTD Drivers: + + - Auto-mounter: Ignore return values from work_cancel(). From + Gregory Nutt. + - SmartFS: Fixed filesystem corruption when writing to small file + after open(... O_APPEND). From Dmitriy Linikov. + - SmartFS stat(): A previous change added support for checking if a + descriptor is a socket in fstat().' but it changed sys/stat.h in + way that breaks smartfs file-type stat flags. CROMFS is similarly + broken, as tools/gencromfs.c was not updated to match the + sys/stat.h changes. This commit fixes both issues. It probably is + not a good idea to use NuttX sys/stat.h bit-field values directly + in stored structure of filesystem. From Jussi Kivilinna. + - HostFS: Update duplicated definitions in HOSTFS that must match + NuttX values. From ligd. + - HostFS: Ensure f_type is equal to HOSTFS_MAGIC. From Xiang Xiao. + - ROMFS: Make romfs_devread32 more portable From anchao. + - TmpFS: Correct logic in tmpfs_ioctl() that extracts the priv state + structure from the file system structures. It was not getting the + right value and causing mmap() to fail. Noted by Jesse. From + Gregory Nutt. + - ProcFS network statistics: Was not handling the output correct for + the case of an IEEE 802.11 device. From Gregory Nutt. + - ProcFS IRQs: Fix occasional computation error when fracpart >= + 1000 From Xiang Xiao. + + * Networking/Network Drivers: + + - TAP/TUN: Fixed custom tun devname formatting. From Dmitriy Linikov. + - Network Drivers: This change attempts remove some long standard + confusion in naming and some actual problems that result from the + naming confusion. The basic problem is the standard MTU does not + include the size of the Ethernet header. For clarity, I changed + the naming of most things called MTU to PKTSIZE. For example, + CONFIG_NET_ETH_MTU is now CONFIG_NET_ETH_PKTSIZE. This makes the + user interface a little hostile. People think of an MTU of 1500 + bytes, but the corresponding packet is really 1514 bytes (including + the 14 byte Ethernet header). A more friendly solution would + configure the MTU (as before), but then derive the packet buffer + size by adding the MAC header length. Instead, we define the + packet buffer size then derive the MTU. + The MTU is not common currency in networking. On the wire, the + only real issue is the MSS which is derived from MTU by subtracting + the IP header and TCP header sizes (for the case of TCP). Now it + is derived for the PKTSIZE by subtracting the IP header, the TCP + header, and the MAC header sizes. So we should be all good and + without the recurring 14 byte error in MTU's and MSS's. From + Gregory Nutt. + - netdev: Fix.. Too many calls to net_unlock() From Gregory Nutt. + - IPv6: There are many different checks for IPv6 multicast + addresses. Most of the checks are different. RFC 3513 clearly + specifies how to detect an IPv6 multicast address: they should + begin with 0xffxx. I did not change some of the checks in + ipv6_input.c, however. In that file, the comments indicate that + the code should only pick of certain multicast address that begin + with 0xff02. From Gregory Nutt. + - ARP: Fix some backward logic in an if condition. From Gregory + Nutt. + - TCP Re-assembly: Rename CONFIG_TCP_REASSEMBLY to + CONFIG_IPv4_REASSEMBLY. Add some fixes to get a clean compile with + CONFIG_IPv4_REASSEMBLY enabled. There are several problems with + the current implementation: It is untested (and depends on + CONFIG_EXPERMIMENTAL). It uses some Ethernet specific definitions + (and depends on CONFIG_NET_ETHERNET). There is only a single + reassembly buffer. The last two issues prevent use of this feature + in any context where IPv4 packets may be reassembled for multiple + network devices concurrently). From Gregory Nutt. + - TCP: Set the default TCP MSS to the value required by RFC 879 and + never change it under any circumstance unless the remote host + requests a larger MSS via an option the TCP header. From Gregory + Nutt. + - TCP: Fix a deadlock condition that can occur when (1) all network + logic runs on a single work queue, (1) TCP write buffering is + enabled, and (2) we run out of IOBs. In this case, the TCP write + buffering logic was blocking on iob_alloc() with the network + locked. Since the network was locked, the device driver polls that + would provide take the write buffer data and release the IOBs could + not execute. This fixes the problem by unlocking the network lock + while waiting for the IOBs. From Gregory Nutt. + - TCP: Remove g_netstats.tcp.syndrop++ from tcp_data_event() From + Masayuki Ishikawa. + - TCP Monitor: Fix net unlock issue when tcp close. This bug could + leave the net locked. From zhangyuan7. + - UDP: When sending a broadcast (or multicast) packet do not attempt + to look up the device by the destination IP address. Rather, use + the locally bound address for these cases to select the correct + network device. From Gregory Nutt. + - UDP: Restore some legacy behavior that was lost with the + implementation of CONFIG_NET_UDP_BINDTODEVICE: If no device has a + local address when the broadcast packet is sent and the UDP socket + is not bound to a device, there select some arbitrary device. This + is certainly lunacy in the case where there are multiple network + devices registered because the wrong device will probably be + returned. It works find, however, for the legacy case where only a + single network device is registered. From Gregory Nutt. + - UDP: Fix for network byte-order issue when checking if an address + is a multicast address. From Jake Choy. + - USRSOCK: Correct of semaphore usage issues. From Gregory Nutt. + - USRSOCK: Fix re-definitions of struct iovec. From ligd. + - ICMP/ICMPv6 Connection: Change the type of id in + icmpv[6]_findconn to uint16_t From Xiang Xiao. + - ICMP/ICMPv6: Fix failure to poll ICMP socket issue. From + dongjianli. + + * Wireless/Wireless Drivers: + + - XBee: Fixes issue with timeouts. Timeouts were in ticks but + should have been in ms. This caused false triggers of timeout + causing redundant packets, etc. From Anthony Merlino. + - BCM43xx: Add missing logic to the BCM43xx IEEE 802.11 driver to + poll for more Tx data after the last transfer completes. From + Gregory Nutt. + - BCM43xx: Bring in some fixes from the 'Haywire' branch. From + Ramtin Amin. + + * Common Drivers: + + - Audio: Fix compile error in i2schar.c (CONFIG_DEBUG_ASSERTIONS=y) + From Masayuki Ishikawa. + - Audio I2S: Fix bad NULL pointer check From Juha Niskanen. + - Input: Fixed FT5x06 driver to correctly close (previously it + unregistered interrupt handler during close). From Marcin Wyrwas. + - MMC/SD: Fix an error that was causing SDIO multiple block + transfers from achieving full performance. From Bob Feretich. + - Sensors: Increases SPI frequency in MAX6675 from 400Khz to 4MHz. + From Alan Carvalho de Assis. + - Sensors: Remove comment references to touchscreens from ADXL345 + driver. From Russ Webber. + - Serial: Don't overwrite nwritten unconditionally on UART write + failure. From Xiang Xiao. + - Serial DMA: Move head/tail pointer reset to uart_recvchars_dma + since dma may be still transferring in the background. From Xiang + Xiao. + - Serial DMA: In DMA mode, the use of uart_disablexinit() is + insufficient to protect a critical section. + enter/leave_critical_section() must be used in those cases if + CONFIG_SERIAL_DMA=y From Xiang Xiao. + - Serial DMA: Fix typo error in uart_recvchars_dma() From Xiang Xiao. + - 16550 UART: u16550_txempty() should check UART_LSR_TEMT to avoid + some data left in the transmit FIFO From Xiang Xiao. + + * ARMv7-A: + + - ARMv7-A (and i.MX6): Add support for per-CPU IRQ and FIQ interrupt + stacks (bugfix). Add support so that up_assert will print the + correct interrupt stack on an assertion (FIQ stack is still not + printed). From Gregory Nutt. + + * ARMv7-R: + + - ARMv7-R: Fix some wrong configuration of program status + register. PSR_E_BIT bit should be set for big endian system. + PSR_A_BIT bis is set automatically as arm cortex-r4 reference + manual 3.7.4. So we don't need to set this bit. From EunBong Song. + - ARMv7-R: Fix some wrong MPU register definition. Change + MPU_RBAR_ADDR_MASK and MPU_RACR_TEX_SHIFT mask as arm cortex-r4 + reference manual. Region Base Address Register 0-4 bits are + reserved. MPU Region Access control register type 3-5 bits. From + EunBong Song. + + * ARMv7-M: + + - ARMv7-M, Cortex F7: Add a configuration to enable workaround for + r0p1 Errata 837070: Increasing priority using write to BASEPRI does + not take effect immediately. This update is required to be + serialized to the instruction stream meaning that after this update + completes, it takes effect immediately and no exceptions of lower + priority than the new boosted priority can pre-empt execution. + Because of this erratum, the priority boosting does not take place + immediately, allowing the instruction after the MSR to be + interrupted by an exception of lower priority than the new boosted + priority. This effect is only limited to the next instruction. + Subsequent instructions are guaranteed to see the new boosted + priority. This was raised in Bitbucket issue 113 from Vadzim + Dambrouski. From Gregory Nutt. + - ARMv7-M: MPU: mpu_log2regionceil needs take into account the + offset too From Xiang Xiao. + - ARMv7-M MPU: The prototype of mpu_log2regionfloor() changed; an + additional parameter was added. However, none of the calls to + mpu_log2regionfloor() were updated to pass the new, additional + parameter. From Gregory Nutt. + + * Infineon XMC4xxx Drivers: + + - XMC4 SPI: XMC4 SPI was working only for the first transfer From + Alan Carvalho de Assis. + + * Microchip/Atmel SAMv7 Drivers: + + - SAMv7 MCAN: Correct an error in the BUS_OFF reporting. In case of + BUS_OFF the old implementation was leading to a package storm. Now + it reports the error condition BUS_OFF only once. From Frank + Benkert. + + * NXP/Freescale LPC43xx Drivers: + + - LPC43xx CAN: Fix lpc43 CAN configuration. Configuration settings + were used and documented in README.txt files, but never in any + Kconfig file. From Gregory Nutt. + - LPC43xx: Make WWDT usable again. LPC43xx WWDT driver was not + updated when irq_dispatch grew an argument parameter. Also fixes + two typos and a naming inconsistency (WWDT vs. WWDG). From Jakob + Haufe. + + * NXP/Freescale Kinetis Drivers: + + - kinetis: USB0 fix interrupt storm on error. The ERROR bit of + USBx_ISTAT needed to be cleared once an error occurs. From David + Sidrane. + - Kinetis: SDHC fix SDIO driver so that DMA works. There were 2 + problems. The first was that the interrupt did test DINT and raise + a completion events. But since DINT is just an indication of DMA + completion, TC is a valid way to determine that the transfer is + complete. The second problem is that Software Reset For DAT Line + SDHC_SYSCTL[RSTD] clears the bits 24-0 in SDHC_PROTO this looses + the wide bus setting DTW From David Sidrane. + - Kinetis: (1) PIT add Liftime and Chaining, (2) flexcan fix + duplicate line and ordering, (3) kinetis_lowput.c LPUART data + format with parity fix. The 9-bit data mode is typically used with + parity to allow eight bits of data plus the parity, (4) lowputc + LPUART_BAUD_INIT has to be defined. Build fails with test case + enable LPUART0 and make UART1 console. If HAVE_LPUART_DEVICE is + defined then LPUART_BAUD_INIT has to be defined even if the LPUART + is not the console From David Sidrane. + - Kinetis: I2C ensure timeout on bus error. The code had a dead + wait on I2C_S_BUSY. Noise on the bus would cause the driver to + hang. Add timeout on invalid states of I2C_S_BUSY to allow the + upper layers do deal with restart or abort. From David Sidrane. + + * NXP i.MXRT Drivers: + + - i.MXRT Ethernet: I finally got the Ethernet CRC32 to work properly + after the FAE pointed me in the right direction: (1) Added CRC32 + functions for multicast address filtering, (2) Do not reset PHY + settings when doing an ifup, (2) Use chip's unique id as the device + MAC, and (4) Enable discard enet frames with errors at PHY layer. + From Jake Choy. + + * On Semi LC823450 Boards: + + - LC823450-XGEVK: Fix parallel build on lc823450-xgevk. This change + fixes an archive file (*.a) corruption by locking $(TOPDIR). + Please note that locking the current directory is insufficient + because some archive files such as libapps.a are specified with + absolute path. From Masayuki Ishikawa. + - LC823450-XGEVK: Change IOB related params for rndis. Since TCP + flow control scheme was changed, HTTP audio streaming has not been + working. These IOB params are not optimized but HTTP audio + streaming now works. From Masayuki Ishikawa. + + * STMicro STM32: + + - STM32 F7: Fix compile error caused by intentional use of fall + through From Daniel Agar. + + * STMicro STM32 Drivers: + + - STM32 F1-F4: Port Bob Feritich's change to STM32 F2 and F4 which + appear to have identical SD support and I/O compensation + requirements. + - STM32 F1-F4, STM32 F7, and STM32 L4: The STM32 RTC driver was + being selected by the global CONFIG_RTC option. That is in + correct. For example, if you want to disabled the STM32 RTC and + use an external RTC you cannot because the external RTC also + depends on the global CONFIG_RTC. The solution is to add a new + CONFIG_STM32xx_RTC configuration option the permits to you select + or deselect the STM32 RTC but still be able to selecte the external + RTC. From Gregory Nutt. + - STM32 F3 I2C: Fix compile error with I2C reset. From Juha + Niskanen. + - STM32 F7 Serial: Fix ioctl TIOCSSINGLEWIRE The TRM notes that UE + must be disabled in order to write HDSEL in USART_CR3. This was not + being done, so calls to TIOCSSINGLEWIRE were silently failing. + This change checks the state of UE in USART_CR1, clears the UE bit + before writing HDSEL, then re-enables it if neccesary. From Kurt + Kiefer. + - STM32 F7 DMA: DMA macros did not account for the increase from 8 + to 16 DMA channels. From Gregory Nutt. + - STM32 F7 I2C: I2C reset Configure I2C pins as GPIO output. Pins + were reset to inputs in the deinit(). This resets them to outputs. + From David Sidrane. + - STM32 F7: All of the SDMMC pins were set to 50 MHz, but not the + clock. This sets the clock to 50 MHz also. This combined with + turning on I/O compensation makes intermittent failures go away. + From Bob Feritich. + - STM32 F7: Port Bob Feritich's change to SDMMC2 and to all other + STM32 F7 architectures. Also add a configuration option to + automatically enable I/O compensation. From Gregory Nutt. + - STM32 F7 SDMMC: Fix data timeout errors with multi-block + transfers. From Bob Feretich. + - STM32 L4: Corrects some mistakes in pin definitions for the + STM32 L4 family. According to datasheet of STM32L496xx, STM32L475xx + and STM32L443XX the AF2 of PE14 is TIM1_BKIN2 not TIM2_BKIN. From + Daniel Pereira Carvalho. + - STM32 L4: Avoid using redundant CONFIG_STM32L4_STM32L4X2. This is + almost always same as CONFIG_STM32L4_STM32L4X3. Avoid duplication + to reduce macro clutter. This patch limits + CONFIG_STM32L4_STM32L4X2 usage to dependency tracking and pinmap. + Also enable ADC for CONFIG_STM32L4_STM32L4X5 (untested, but same + RM). From Juha Niskanen. + - STM32 H7 Serial: don't include stm32_dma.h From raiden00pl. + + * STMicro STM32 Boards: + + - STM32F4-Discovery: Fix pca9635pw LED driver compilation on + STM32F4-Discovery. From Alan Carvalho de Assis. + - STM32F4-Discovery: Krassimir Cheshmedzhiev claims that sys/types.h + needs to be included in the RGB LED file to avoid undeclared 'OK' + From Gregory Nutt. + - STM32F4-Discovery: Missing EXTERN(_vectors) in linker script. + From Gregory Nutt. + - Nucleo-L422KC: Fix RAM size; STM31L4x2xx has only 64Kb of RAM. + Remove references to I2C and SDIO: There is no I2C2 or SDIO on the + STM32F4x2xx. From Daniel P. Carvalho. + - Nucleo-L422KC: Fix stm32_userleds. After change LD2 to LD3 in + board.h stm32_userleds.c was broken. From Daniel P. Carvalho. + - Nucleo-L422KC: Fix TIMx clock configuration. Also removes + definitions related to timers not available in the STM32L432KC. + From Daniel Pereira Carvalho. + - Nucleo-L452RE: Fix TIMx clock configuration. This is cloned from + similar change to the Nucleo-L422KC. Also fixes DAC build + failure. From Juha Niskanen. + - B-L475E-IOT01A: Fix copy paste errors in names: + stm32_bringup->stm32l4_bringup. Noted by Freemans Goden. From + Gregory Nutt. + - STM32VL-Discovery: Changed the status LED to be the green one as + mentioned in the README file. Removed the global array for buttons + and replace it with the only button. Improve defconfig for the nsh + configuration. From Ouss4. + + * C Library/Header Files: + + - libc audio: Call nxsem_destroy in apb_free. From Xiang Xiao. + - libc netdb: The 'port' argument to the static alloc_ai() function + is always in network byte order. However, that static function was + still calling HTONS() on the port, incorrectly converting it back + to host byte order. From Gregory Nutt. + - libc netdb: Fix a link error in lib_gethostbynamer.c with protected + build. NOTE: g_lo_ipv4addr also exists in + net/loopback/lo_globals.c which can be linked with kernel build + only. From Masayuki Ishikawa. + - libc unistd : Fix backward conditional logic in Kconfig. From + Gregory Nutt. + - include/nuttx/compiler.h: Fix warning: __cplusplus is not defined. + Some gcc derived compiler do not define __cplusplus From Xiang + Xiao. + - include/nuttx/fs/binfs.h: Fix warning: Type defaults to 'int' in + declaration of 'mountpt_operations' From Xiang Xiao. + - include/nuttx/net/ethernet.h: Remove CONFIG_NET_ETHERNET guard + From Xiang Xiao. + - include/nuttx/semaphore.h: don't include nuttx/fs/fs.h. (1) Avoid + nested loops if CONFIG_SIG_EVTHREAD enabled, (2) semaphore.h + doesn't depends on fs.h. From Gregory Nutt. + - include/crc64.h: Fix warning: integer constant is too large for + its type From Xiang Xiao. + - include/limits.h and include/sys/types.h: Fix warning about + 'SIZE_MAX' redefined. include/nuttx/usb/audio.h: Fix warnings due + to '-' used whete '_' intended. From Xiang Xiao. + - include/spawn.h: Fix posix_spawnattr_destroy warning: 'the + address of attr will always evaluate as true' From Xiang Xiao. + - include/sys/types: Move wint_t and wctype_t from wchar.h to + types.h. This change is compatible as before since wchar.h + include types.h indirectly. This fixes a compilation error with + newlib's math.h: 'unknown type name wint_t' From Xiang Xiao. + - apps/include/netutils/netlib.h: Eliminate a warning about + AF_UNSPEC and AF_INET not defined. From Gregory Nutt. + + * Build System: + + - Build System: Fix parallel build in making context. This change + avoids running $(MKSYSCALL) and .context in parallel and ensures + that tools/mksyscall is built before it is actually used. From + Masayuki Ishikawa. + - Kconfig files: Fix several errors noted by Alex Denisov in + Bitbucket issue 115. From Gregory Nutt. + - apps Build System: Fix an error when building apps/ without + nuttx/, using only the NuttX export package and assuming that the + nuttx/ directory in not even present. In this case, the problem + fixed where the apps/Make.defs file was selecting tools from the + /tools directory which does not exist because TOPDIR=apps/import. + Instead, for this build case, I have not thought of any option but + to duplicate scripts as necessary in the apps/tools directory. + Also added a top-level target to compile the symbol table. Misc + fixes: quoting in scripts, some errors in script syntax. From + Gregory Nutt. + - apps/Application.mk: If a loadable module is generated the we + need to add logic to remove the loadable module in the 'make + clean' logic. From Gregory Nutt. + + * Tools: + + - nuttx/tools/Makefile.unix: Was not cleaning up export directory + if it was left from a failed export. From Gregory Nutt. + - apps/tools: Fix an error in mksymtab.sh From Masayuki Ishikawa. + + * NSH Library: apps/nshlib: + + - apps/nshlib: Fix 'while' and 'until' loop condition The loop + condition logic was inverted: 'while true; do echo "test"; done' + would exit immediately, while using 'until' would stay in the + loop. This is the opposite of how it is supposed to work. The + reason is that 'state' was set wrong because 'whilematch' is a + bool. From Beat Kng. + - apps/nshlib: I was able to cause an assertion with some typos in + testing the 'fi' command. Not an important thing, but this will + protect against the assertion. From Gregory Nutt. + - apps/nshlib: Increase the default configuration for the maximum + number of command line arguments to 7 (CONFIG_NSH_MAXARGUMENTS). + This is needed for 'mount' with the -o option. From Xiang Xiao. + - apps/nshlib: Do not dereference NULL 'pstate' in nsh_console.c. + From Juha Niskanen. + + * Examples/Tests: apps/examples: + + - apps/examples: Remove illegal calls into OS to initialize BINFMT + support. This must be moved to the board initialization logic + within the OS. From anchao. + - apps/examples/nettest: Fix typo: NET_LOOPBACK -> + CONFIG_NET_LOOPBACK nettest: Fix compilation error. Should enable + NET_SETSOCKOPT for preventing compilation error. From EunBong Song. + - apps/examples/ostest: Signal handling tests should use the same + configurable stack size as used in other tests, not + PTHREAD_STACK_DEFAULT. From Gregory Nutt. + - apps/examples/ostest: Attempt to make the nested signal test + compatible with the suspend/resume test. Some signals cannot be + caught when the suspend/resume configuration is in place. From + Gregory Nutt. + - apps/examples/smps: Fixes in some printf and in Kconfig. From + Mateusz Szafoni. + + * System Utilities: apps/system: + + - apps/system/cu: (1) Protect from possible re-definition of signal + values, (2) Fix CU ctrl-C hand when remote core hang. From ligd. + - apps/system/i2c: Fix a backward comparison in i2c_main.c. Noted + by Jakob Haufe. From Gregory Nutt. + - apps/system/nsh: Fix compile errors with + CONFIG_EXAMPLES_NSH_SYMTAB=y. From Masayuki Ishikawa. + - apps/system/ping and ping6: Send ID and seqno in network byte + order. From Xiang Xiao. + - apps/system/ping and ping6: Change dependency in ping and ping6 + Kconfig. These may be implemented in users sockets and, hence, + may need to be available even if ICMP and ICMPv6 sockets are not + support. From Xiang Xiao. + - apps/system/system: Add 'const' to make function prototype + compatible with OpenGroup.org requirement From Xiang Xiao. + - apps/system/zmodem: Fix error "sz_main.o: No such file or + directory" From Xiang Xiao. + + * Network Utilities: apps/netutils: + + - apps/netutils/ftpc: Fix handling of url-encoded strings From + Dmitriy Linikov. + - apps/netutils/ping: Remove unsupported ping. netutils/ping is not + supported anymore. It's better to remove this folder for + preventing confusing. ping is supported by system/ping. From + EunBong Song. + + * Wireless Utilities: apps/wireless: + + - apps/wireless/wapi: Remove dependency on CONFIG_EXPERIMENTAL from + Kconfig From Gregory Nutt. + + * GPS Utilities: apps/gpsutils: + + - apps/gpsutils/minmea: Include wchar.h in minmea.c file to fix + wint_t error From Alan Carvalho de Assis. + + * Interpreters: apps/interpreters: + + - Remove apps/interpreters/micropthon. There are several reasons + for this. (1) the current version 1.3.8 is very old and no one is + supporting it. (2) the port only includes the core micropython + logic and none of the Python libraries. As such it is useless in + any real application. (3) There have recently been compile + failures reported. It looks like this is due to changes in newlib + based toolchains that now bring in incompatible newlib header + files. See issue 104 at + https://bitbucket.org/nuttx/nuttx/issues/104/build-micropython-138-error. + With no one dedicated to the support of micropython, it can no + longer be carried in the NuttX apps/ repository. From Gregory Nutt. + +NuttX-7.27 Release Notes +------------------------ + +The 127th release of NuttX, Version 7.27, was made on November 14, 2018, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.27.tar.gz and +apps-7.27.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - Assertions: Add 'BOARD_ASSERT_RESET_VALUE' in config/Kconfig and + replace reboot status '0' to 'CONFIG_BOARD_ASSERT_RESET_VALUE'. From + Gregory Nutt. + - Assertions: up_registerdump capture the general register if not yet + saved and up_saveusercontext is implemented, the register dump is very + useful to find the cause of failure. From Xiang Xiao. + - Assertions: up_stackdump() dump the full stack if stack overflow the + stack info is very useful to find the backtrace From Xiang Xiao. + - binfmt/ and libs/libc: Make exepath_*() more common: Move + exepath_*() related code to libc/misc, rename exepath_ to envpath_, + and rename BINFMT_EXEPATH to LIB_ENVPATH. From nchao. + - CLOCK: Support CLOCK_MONOTONIC in clock_getres.c. From Xiang Xiao. + - Clock Timekeeping: Use clock_basetime() to initialize + g_clock_wall_time to get the best initial RTC value and initialize + g_clock_last_counter too since the hardware may not start counting + from zero. From Xiang Xiao. + - exit(): Add SCHED_EXIT_KILL_CHILDREN option to kill all child threads + when the main thread of a task exits. From nchao. + - IOBs: Add an IOB notifier that will notify any registered threads + that want to known when an IOB has been freed. This is basically just + a wrapper around the generic notifier. Includes a divider that can be + used to reduce the rate of IOB notifications. From Gregory Nutt. + - Memory Manager: In mm_free(), add DEBUGASSERT()'s to catch memory + corruption early. From Petteri Aimonen. + - Memory Manager: Add debug option CONFG_MM_FILL_ALLOCATIONS to fill + all mallocs() with recognizable value. From Petteri Aimonen. + - sched/signal and syscall/: Add support for pselect() and ppoll() + functions From dongjianli. + - Task Groups: group_foreachchild() now iterates in reverse order since + the callback (e.g. group_killchildren) may remove the tcb from list. + From zhangyuan7. + - WDOG Timer: Improve accuracy of wd_gettime() in tickless mode From + ligd. + - Work Queues: Add a generic notification facility that runs on a work + queue. The notication facility can notify a group of subscribers to + an event via callbacks. This API is for use within the OS only. From + Gregory Nutt. + + * File Systems/Block and MTD Drivers + + - FAT: Add CONFIG_FAT_LFN_ALIAS_HASH to speed up creating long + filenames. Long filenames on FAT file systems have associated 8.3 + character alias short filenames. The traditional form of these is + FILENA~1.EXT with a running count of the number of similar names. + However creating this unique count can take several seconds if there + are many similarly named files in the directory. Enabling + FAT_LFN_ALIAS_HASH uses an alternative format of FI0123~1.TXT where + the four digits are a hash of the original filename. This method is + similar to what is used by Windows 2000 and later. From Petteri + Aimonen. + - FAT: Add CONFIG_FAT_LFN_ALIAS_TRAILCHARS alternative format for 8.3 + filenames. Traditional format for long filename 8.3 aliases takes + first 6 characters of long filename. If this option is set to N > 0, + NuttX will instead take first 6-N and last N characters to form the + short name. This is useful for filenames like "datafile12.txt" where + the first characters would always remain the same. From Petteri + Aimonen. + - FAT: if block driver wait seems to be a long one, give time for other + threads to run. From Petteri Aimonen. + - file_open(): Add file_open() implementation with some fully-function, + interim, placeholder logic. Change occurrences of open() followed by + file_detach() in the OS to file_open(). From Gregory Nutt. + - MX25LF25635F: Add support to Macronix MX25LF25635F serial NOR flash + From David Sidrane. + - nx_open(): Add nx_open() which is the same as open() except that it + does not create a cancellation point nor does it modify the errno + variable. Change most other, non-controversial calls to open() to + nx_open(). From Gregory Nutt. + - file_ioctl(): Replace calls to ioctl() in the OS to file_ioctl(). + From Gregory Nutt. + - mount: Add mount() support for file systems that require MTD drivers + (vs. block drivers). From Gregory Nutt. + - mount: Add support for mounting a file system with either a block or + an MTD driver. From Xiang Xiao. + - MTD FTL: Support BIOC_FLUSH ioctl From Xiang Xiao. + - MTD FTL: Make READAHEAD and WRITEBUFFER work independently of each + other. There have cases we use writebuffer but not readbuffer, so the + write buffer must be flushed before read. Let rwb driver do it. From + zhuyanlin. + - MTD FTL: Allocate eblock only when it's really needed From Xiang Xiao. + - MTD FTL: Add support support unlink operation to avoid the memory + leak. From Xiang Xiao. + - MTD Partition: Add register_mtdpartition() for MTD partition From + Xiang Xiao. + - MTD Partition: Remove the hard code partition name length From Xiang + Xiao. + - MTD Proxy: Make MTD device accessible via a character driver proxy + like block devices From Xiang Xiao. + - ProcFS: Change output of the ProcFS 'env' file so that it looks more + like output from the 'env' command. From Gregory Nutt. + - ProcFS: Add support to provide MLD statistics at /proc/net/mld. From + Gregory Nutt. + - ProcFS: Remove MTD ProcFS and mtd_procfsoperations() since we can now + get the same information from inode From Xiang Xiao. + - ProcFS: Add /proc/version support to get version info From iuhaitao. + - ProcFS: Add support for named MTD drivers in the pseudo file system. + This will, eventually, allow us to mount file systems that need MTD + drivers without having to fake an intervening block driver. + - R/W Buffer: Don't queue work to flush write buffer if + CONFIG_DRVR_WRDELAY == 0 From Xiang Xiao. + - R/W Buffer: Improve the rwb_read/write overlap performance From + zhuyanlin. + - SIM HOSTFS: Support S_IFSOCK, DT_LNK, O_DIRECT and O_SYNC From Xiang + Xiao. + - SPIFFS: Brings in a NuttX port of version 0.3.7 of Peter Anderson's + SPIFFS flash file system into NuttX. From Gregory Nutt. + + * Networking/Network Drivers: + + - Network Configuration Add new configuration CONFIG_NET_MCASTGROUP. + This option is selected automatically if either CONFIG_NET_IGMP or + CONFIG_NET_MLD are selected. Most conditional logic based on + CONFIG_NET_IGMP replaced with conditioning on CONFIG_NET_MCASTGROUP. + From Gregory Nutt. + - Network Device: Add notification logic for the case where the network + goes down. From Gregory Nutt. + - Network Device: Rename netdev_dev_lladdrsize() to netdev_lladdrsize() + and move the prototype to include/nuttx/nex/netdev.h, giving is global + scope within the OS. From Xiang Xiao. + - ARP: Redesign ARP table aging to simplify the net initialization + From Xiang Xiao. + - ARP: Check ifname match before sending packet. From Xiang Xiao. + - ARP and ICMPv6: Double the delay time on each iteration for ARP/ICMP + to fight work jitter better. From Xiang Xiao. + - ICMP/ICMPv6: Add NET_ICMP[v6]_NO_STACK for usrsock case From Xiang + Xiao. + - ICMPv6: Encapsulate the link scope address generation into + icmpv6_linkipaddr() From Xiang Xiao. + - ICMPv6: Remove the coupling between ICMPv6 and Ethernet by moving all + Ethernet stuff to neighbor_ethernet_out.c and make the mac address as + first field. From Xiang Xiao. + - ICMPv6 MLD: Implement Multicast Listener Discovery (MLD) protocol based + on RFC 2710 and RFC 3810. From Gregory Nutt. + - ICMPv6 MLD: Implement MLDv1 compatibility mode. From Gregory Nutt. + - ICMPv6 MLD: Implement 'Other Querier Present Timer'. This timer is + used to revert to Querier mode if there is no other querier on the + network. From Gregory Nutt. + - IGMP: Backport some MLD design improvements/fixes. From Gregory Nutt. + - IPv4 setsockopt(): Add implementation for all IPv4 socket options that + have implemented IOCTL command counterparts. From Gregory Nutt. + - IPv4/6 Socket Options: Add framework to support IPv4 and IPv6 + protocol socket options (i.e., SOL_IP and SOL_IP6). Handling of these + socket options was a necessary step on the way to ICMPv6 MLD support. + From Gregory Nutt. + - ICMPv6 Autoconfiguration: Don't take the network device down when + reconfiguring only the IP address from within ICMPv6 logic. + Recommended by Xiang Xiao in order to avoid the long delays of + bringing some networks back up. Normally it is required that the + network be in the "down" state when re-configuring the network + interface. This is thought not to be a necessary here because: (1) + The ICMPv6 logic here runs with the network locked so there can be no + outgoing packets with bad source IP addresses from any asynchronous + network activity using the device being reconfigured. And (2) incoming + packets depend only upon the MAC filtering. Network drivers do not + use the IP address; they filter incoming packets using only the MAC + address which is not being changed here. From Gregory Nutt. + - IPv6 Input: Add logic to skip over the variable number of IPv6 + extension headers that may be present between the IPv6 header and the + transport layer header. The extension headers are simply ignored. + This is necessary because with MLD, certain incoming messages may + have, at a minimum, a Router Alert Hop-by-hop extension header. + Additional changes to ICMPv6, TCP, and UDP input to handle the offset + protocol headers. From Gregory Nutt. + - IPv6 Neighbor: Simplify the neighbor table aging process From Xiang + Xiao. + - IPv6 Neighbor: Simplify neighbor_dumpentry() implementation From + Xiang Xiao. + - IPv6 Neighbor: neighbor_lookup() checks if the target IP belongs to + one of the local network devices. From Xiang Xiao. + - IPv6 Neighbor: Support neighbor_out() for multiple link layer at the + same time From Xiang Xiao. + - IPv6 setsockopt(): Implement the IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP + socket options. From Gregory Nutt. + - TCP: Extend the TCP notification logic logic so that it will report + loss of connection events. From Gregory Nutt. + - SLIP: Add IPv6 support and fix minor issue From Xiang Xiao. + - TCP: Add TCP poll() logic to receive notifications when IOBs are + freed. From Gregory Nutt. + - TCP: In TCP backlog, add SOMAXCONN definition and implementation per + OpenGroup.org. From zhangyuan7. + - TCP/UDP: Extend send()/sendto() logic it also requires that at least + one IOB is also available to be able to send. From Gregory Nutt. + - TCP/UDP: Add notification logic when TCP or UDP read-ahead data is + buffered. From Gregory Nutt. + - TUN: Call ipv[4|6]_input dynamically by checking packet header and + remove the code duplication From Xiang Xiao. + + * Wireless/Wireless Drivers: + + - Broadcom IEEE 802.11: Add capability for Broadcom chips to get + firmware and CLM data from a mounted file system vs. in-memory data + structures. From Ramtin Amin. + - XBee IEEE 802.15.4: Add support for setting/getting tx power. From + Anthony Merlino. + + * Other Common Device Drivers: + + - GPIO: Support multiple registrations of GPIO signal events. From + Xiang Xiao. + - INA226: Add INA226 device driver. From Daniel P. Carvalho. + - MAX7219: Support all digits presented in the MAX7219 datasheet. From + Alan Carvalho de Assis. + - MLX90614: Add support for the Infrared Thermometer MLX90614 From + Alan Carvalho de Assis. + - RTC Driver: up_rtc_set_lowerhalf call clock_synchronize() for + external RTC. From Xiang Xiao. + - SYSLOG: Uncomment the g_syslog_channel->sc_flush call in + syslog_flush(). From Xiang Xiao. + - SYSLOG: syslog_initialize initialize dev/syslog too and call syslog + to add the prefix and timestamp. From Xiang Xiao. + - USB Composite and DFU drivers: Add support for Microsoft OS + descriptors. These Microsoft-only descriptors help in loading the + correct driver on Windows. They are especially helpful to give libusb + access to a custom device without having to manually configure/install + WinUSB driver. With this change DFU interface works automatically on + Windows 10 with dfu-util 0.9 and libusb 1.0.22. On Windows 7 it still + appears to need driver installation. From Petteri Aimonen. + - USB DFU Device: Add DFU Runtime driver for activating boot-loader + through USB command. From Petteri Aimonen. + - USB RNDIS Device: Account for CONFIG_NET_GUARDSIZE in allocation of + packet buffer allocation: Make USB device parameters configurable. + From Sakari Kapanen. + - USB RNDIS Composite Device: Fix strid comparison. Add support for + composite configuration. From Petteri Aimonen. + + * Microchip PIC32MX Boards; + + - PCBLOGIC-PIC32MX: Remove support for the PCB Logic PIC32MX board. I do + not find any references to PCB Logic on the web and I do not believe + that this breakout board is available any longer. From Gregory Nutt. + + * NXP Freescale i.MX RT: + + - i.MXRT: Added support for the i.MXRT 106x family. From David Sidrane. + + * NXP Freescale i.MX RT Drivers: + + - i.MXRT: Add LPI2C driver. From Ivan Ucherdzhiev. + - i.MXRT LPSPI: Add full support for the LPSPI in poll mode; includes a + minor fix for LPI2C. + - i.MXRT USDHC: Initial commit of the i.MXRT SDHC driver working in PIO + mode. From Dave Marples. + - i.MXRT USDHC: Complete the interrupt driven USDHC1 functionality for + the IMXRT EVKB. Improve SD card handling in the DMA case. From Dave + Marples. + + * NXP Freescale i.MX RT Boards: + + - IMXRT1060-EVK: Add support for the IMXRT1060-EVK. From David Sidrane. + + * NXP LPC17xx Boards: + + - Olimex-LPC1766STK: Add support to initialize a USB HID keyboard. Add + a configuration for testing the HID keyboard. From Gregory Nutt. + + * On Semi LPC23450 Drivers: + + - LC823450: MPU support for FLAT build From Masayuki Ishikawa. + + * STMicro STM32: + + - STM32: Add support for STM32F303xD/E. From Mateusz Szafoni. + - STM32 L4: Add initial support for STM32L412 and STM32L422 chips From + Juha Niskanen. + + * STMicro STM32 Drivers: + + - STM32 ADC: Major refactor: Use STM32 ADC IP core version and ADC + available functions instead of chip family names in conditional + compilation. Replace family specific ADC headers with STM32 ADC IP + core version headers. Configurable sample time supported for all + chips, not just L1. Enable/disable interrupts supported for all + chips, not just L1. Add ADC resolution configuration. From Mateusz + Szafoni. + - STM32 PWM: Improvements in STM32 PWM low level driver: Support + complementary outputs, dead-time configuration, output polarity and + IDLE state configuration. From Mateusz Szafoni. + - STM32 PWM: Break and lock configuration and some cosmetics From + Mateusz Szafoni. + - STM32 SPI. Enable separate DMA per SPI configuration From Daniel Agar. + - STM32 F7 FLASH: Allow programming OTP blocks through progmem + interface From Jussi Kivilinna. + - STM32 H7 I2C: Add I2C support for STM32H7. From raiden00pl. + - STM32 H7 RCC: Update RCC definitions, add SPI clock configuration and + some fixes in RCC. From raiden00pl. + - STM32 H7 SPI: Add basic SPI support for H7. Enable SYSCFG clock in + RCC. From Mateusz Szafoni. + + * STMicro STM32 Boards: + + - Nucleo-F302R8: Add support for Nucleo-F302R8 board From raiden00pl. + - Nucleo-F302R8: Add PWM support. From Mateusz Szafoni. + - Nucleo-F303ZE: Add basic support for nucleo-f303ze. From Mateusz + Szafoni. + - Nucleo-F303ZE: Support for ADC and ADC example. From Mateusz Szafoni. + - Nucleo-L432KC: Added support for AT45DB Serial Flash From Daniel P. + Carvalho. + - Nucleo-L432KC: Add support for the INA226. From Daniel P. Carvalho. + - Nucleo-H743ZI: Add NRF24L01 support. From Mateusz Szafoni. + - Olimex-STM32-P407: Add a HID keyboard configuration. From Gregory + Nutt. + - STM32F4-Discovery: Add MLX90614 support for the STM32F4-Discovery + board From Alan Carvalho de Assis. + - STM32F429I-DISCO: Add PWM support. From Mateusz Szafoni. + - STM32F429I-DISCO: Support for ADC and ADC example. From Mateusz + Szafoni. + + * MIPS32: + + - MIPS32 Toolchain.defs: Add toolchain flags for the pinguino toolchain + under Linux. From Ouss4. + + * RISC-V: + + - RISC-V GAP: This commit brings in support for the GAP8 architecture. + The GAP8 is a 1+8-core DSP-like RISC-V MCU. Also included is support + for the Gapuino GAP8 evaluation board. From hhuysqt. + + * Other Tools: + + - tools/tesbuild.sh: No longer installs and builds the NxWidgets + libraries. They are now a port of apps/. From Gregory Nutt. + + * Libraries/Header Files: + + - include/net and include/sys: Align the constant values with values in + the Linux kernel which makes targeting the usrsock server to Linux + kernel easier. From Xiang Xiao. + - include/netdb.h Add NO_ADDRESS definition From zhangyuan7. + - include/netinet/in.h: Adds definitions for IPPROTO_IPV6 socket + options to netinet/in.h. Adds missing fields to sockaddr_in6. Adds + struct ipv6-mreq. These changes all follow the opengroup standard for + netinet/in.h From Anthony Merlino. + - include/netinet/in.h: Add IPv4 SOL_IP socket options for symmetry + with IPv6 definitions added in a previous commit. Remove some + duplicate types from sys/sockio.h. From Gregory Nutt. + - include/netinet/in.h: Add other definitions required by + OpenGroup.org. From Gregory Nutt. + - include/netinet/in.h: Add Linux IP_PKTINFO and IPV6_PKTINFO + definitions. + - include/nuttx/net/ipv6ext.h: Create header file with all of the + definitions of IPv6 extension headers that I could find. From Gregory + Nutt. + - include/nuttx/net/mld.h: Add MLD header file based on RFC2710 and + RFC3810. From Gregory Nutt. + - include/sys/socket.h: With increased size of struct sockaddr_in6, the + size of struct sockaddr_storage in include/sys/socket.h must also be + increase so that it can contain the new, larger sockaddr_in6. From + Gregory Nutt. + + - libs/libc/misc: Add implementation of CRC8-CCITT. From Alan Carvalho + de Assis. + - libs/libc/modlib: Add per-module library symbol table support. From + nchao. + - libs/libc/net: Add basic implementation for recvmsg() and sendmsg() + per OpenGroup.org specification. From ligd. + - libs/libc/netdb: A few improvements to getaddrinfo: (1) Use the + protocol and socktype hints in returned address, (2) Ignore AI_PASSIVE + argument if hostname is not NULL From Anthony Merlino. + - libs/libc/netdb: Make DNS receive timeout configurable. From ligd. + - libs/libc/stdio: Eliminate recursive in conversion functions of + lib_vsprintf(). From Xiang Xiao. + - libs/libc/string: Add some new functions defined in POSIX.1-2017: + stpncpy(), strsignal(), psignal(), psiginfo(). From Gregory Nutt. + - libs/libc/string: Add memrchr() function From Xiang Xiao. + - libs/libc/string: Make strerror() return the string "Success" for + error = 0. From Petteri Aimonen. + + * Build System: + + - Makefile.unix/win: Remove deletion of Eclipse project files from make + distclean target. From Gregory Nutt. + - apps/Application.mk: Fix some build issues. (1) Unable to found + target 'context' when CONFIG_NSH_BUILTIN_APPS disabled. (2) Unable to + generate multiple programs. From Chao An. + - apps/Directory.mk: Fix distclean targets. Makefiles were not + removing generated Kconfig files. There was then no way to remove + this Kconfig files without manually deleting them one at a time. From + Gregory Nutt. + + * NSH: apps/nshlib: + + - apps/nshlib/, apps/examples/: Update to show newer file system + object types returned by stat(). From Gregory Nutt. + - apps/nshlib: Add support for the 'env' command. From Gregory + Nutt. + - apps/nshlib: Add support for NSH local variables if + CONFIG_NSH_VARS are set. These are like environment variables but + are local to NSH. The importance of this is that these variables + are *not* inherited when NSH creates a new task. The new command + 'export' was added. In this case, the NSH variable will be promoted + to an environment variable and will then be inherited by any tasks + executed by NSH. From Gregory Nutt. + - apps/nshlib: If CONFIG_NSH_VARS=y, the NSH 'set' command with no + argument will list all of the local NSH variables. From Gregory + Nutt. + + * Examples/Tests: apps/examples: + + - apps/examples/gpio: Align with GPIO driver update From wangyanjiong. + - apps/examples/ina226: Added INA226 example From Daniel P. Carvalho. + - apps/examples/mld: Add a test of MLD. Provides a mechanism for some + low-level bring-up of MLD. From Gregory Nutt. + - apps/examples/mlx90614: Add mlx90614 test example From Alan Carvalho + de Assis. + - apps/examples/mlx90614/: Include support to change device address on + mlx90614 From Alan Carvalho de Assis. + - apps/examples/fstest: Adapt the existing fstest example for SPIFFS: + For SPIFFS, add garbage collection and file system integrity IOCTL + calls. Call statfs() and show state of file system on each loop. Add + logic to dump logic content of SPIFFS. Ignore EINTR errors while + reading or writing. Add configuration option to customize stack + size. Detect when the media is full and stop writing files. Report + total file size. From Gregory Nutt. + - apps/examples/tcpblaster: Add an option to use poll() to pace input + or output. From Gregory Nutt. + - apps/examples/tcpblaster: Select CONFIG_LIBC_FLOATINGPOINT + automatically. Units in output are wrong: Not Kbps bus Kb/Sec. From + Gregory Nutt. + - apps/examples/udpblaster: Add option to use poll() on output (only). + From Gregory Nutt. + + * System Utilities: apps/system + + - apps/system/ping and apps/system/ping6: Set optind to zero in the + error case/. Move all ping preparation work into icmp_ping. Support + -W and -s option. Decouple the output from ping + logic. From Xiang Xiao. + - apps/system/ping and pings and apps/netutils/ping: Extract icmp ping + and icmpv6 ping6 logic from system/ to C-callable library in + netutils/. From ligd. + - apps/system/progmem: Remove this utility. It makes illegal direct + calls into the OS. From Gregory Nutt. + + * Network Utilities: apps/netutils: + + - apps/netutils/netlib and apps/examples/igmp: Adapt to use the + corrected, semi-standard version of struct ip_msfilter. From Gregory + Nutt. + - apps/netutils/chat and apps/examples/chat: 'constify' chat variables + and parameters From Xiang Xiao. + + * Wireless Utilities: apps/wireless: + + - apps/wireless/ieee802154/i8sak: Properly shuts down event thread. + From Anthony Merlino. + - apps/wireless/ieee802154/i8sak: Fixes i8sak name. Accidentally renamed + to i8ask in recent changes From Anthony Merlino. + - apps/wireless/ieee802154/i8sak: Adds support for getting/setting + transmit power. From Anthony Merlino. + + * Graphic Utilities: apps/graphics: + + - apps/graphics/NxWidgets: Move the NxWidgets repository into the apps/ + repository. Remove old apps/NxWidgets directory. Move NxWidgets + files into apps/graphics/NxWidgets. Integrate configuration/build + system. Fix file paths in file headers. Remove some duplicate + tools. Add new NxWidgets Unit Test configuration and build logic. + From Gregory Nutt. + - apps/graphics/NxWidgets: Add CNxString string + operator and + ::format() function. Add CNumericEdit option to include unit name + after the value. Make CNxWidget useWidgetStyle() public. From + Petteri Aimonen. + - apps/graphics/NxWidgets: Add CLabelGrid control for displaying text + in grid format. From Petteri Aimonen. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Clock: Remove g_monotonic_basetime and g_clock_monotonic_time since + we don't need ensure monotonic time start from zero as state here: + http://pubs.opengroup.org/onlinepubs/009696899/functions/clock_getres.html + From Xiang Xiao. + - Clock: Don't call up_timer_gettime in clock_gettime() and + clock_systimer() to ensure the return value from them consistent with + clock_systimespec From Xiang Xiao. + - Clock Initialization: clock_inittime() needs to be done with + CONFIG_SCHED_TICKLESS and clock_initialize should skip + clock_inittime() for external RTC case since the RTC isn't ready yet. + From Xiang Xiao. + - IOBs: Work around some issues with the IOB throttle semaphore. It + has some odd behaviors that can cause assertions in sem_post(). Also, + it seems to get outside of its range occasionally. Need to REVISIT + this. From Gregory Nutt. + - IOBs: iob_navail() was returning the number of free IOB chain queue + entries, not the number of free IOBs. Completely misnamed. From + Gregory Nutt. + - PM: Use the start time of state btime to calculate thrcnt; remove the + loop whose count may be very big after the long idle From ligd. + - PM Uninitialization: Fix pm_domain_s.stime un-initialize caused time + error. From ligd. + - sched_kfree() and sched_ufree(): This patch prevent heap corruption + in a corner case where memory is freed while switching contexts. This + change forces all de-allocations via sched_kfree() and sched_ufree() + to be delayed. Eliminating the immediate de-allocation prevents the + problem with the the re-entrant semaphore because the deallocation + always occurs on the worker thread, never on the suspended task. From + EunBong Song. + - sigsuspend(): sigsuspend() shouldn't eat the pending signal but + dispatch all instead From Xiang Xiao. + - task_restart(): Was restarting tasks with all signals set in the + sigprocmask set. Should have restarted with the sigprocmask cleared. + Noted by Jeongchan Kim From Gregory Nutt. + - unsetenv(): Fix and error in unsetenv() when un-setting the last of + the environment variables. From Gregory Nutt. + - waitpid(): Remove a bad error check. From Gregory Nutt. + + * File System/Block and MTD Drivers: + + - FAT: Fix file data corruption in fat_truncate(). From Petteri Aimonen. + - Partitions: Try MTDIOC_GEOMETRY IOCTL before bops's geometry. + From Xiang Xiao. + - MTD Progmem: Change up_progmem_npages() to up_progmem_neraseblocks(). + page is a unit for read/write operation. eraseblock is a unit for + erase operation. up_progmem_npages() is a little bit confusing + because it returns number of erase blocks in flash memory. This patch + changes up_progmem_npages to up_progmem_neraseblocks. + up_progmem_eraseblock erase a block. so it's better to return the + erase block size than page size. From EunBong Song. + - R/W Buffer: Fix a lock issue From Xiang Xiao. + - SmartFS: Current sector should have a space for next entry size. If + not, we should move to next sector. From EunBong Song. + + * Networking/Network Drivers: + + - 6LoWPAN: Fixes bug in uncompress_addr handling of odd postfix. This + affected multicast compress/uncompress since it's the only logic that + used an odd postfix. The odd byte needs to be handled first, not + last. From Anthony Merlino. + - ARP and ICMPv6: Don't call d_txavail directly since it may point to + NULL From Xiang Xiao. + - ICMPv6: icmpv6_neighbor() shouldn't use the out of scope + variable(dripaddr) From Xiang Xiao. + - IPv6 input: Fixes logic in ipv6_input to handle more than ff02::/16 + multicast addresses. Don't forward mcast packets if scope is not + appropriate From Anthony Merlino. + - IPv6 Input: Fix a logic error when the received IPv6 srcaddr is a + multicast address. Exiting logic only supported UDP multicast. But + MLD and certain other ICMPv6 packets also require acceptance of + multicast packets. From Gregory Nutt. + - TCP: In TPC recv window calculations, in order to receive data we + must not only have IOBs available, but we must also have at least one + IOB chain qentry available. Otherwise, we will advertise that we an + buffer a lot of data when, in fact, we cannot. This is an + experimental fix to a performance problem noted by Masayuki Ishikawa. + From Gregory Nutt. + - TCP: Fix compiler error and warning when CONFIG_NET_SENDFILE=y From + Xiang Xiao. + - TCP Input: Fix recovery when ackseq > unackseq. The comment near + this line says "reset the number of outstanding, unacknowledged + bytes". However, the code actually resets the whole TCP connection. + It was changed to the current form in commit f034d84ea1f with no + explanation of the intent. Recover the line to what it was before that + commit. From Sakari Kapanen. + - TCP Write Buffering: Fix buffer release handling on failed buffer + allocation. Attempt to release write buffer on failed TCP write I/O + buffer alloc and tryalloc failed to wrb->wb_iob assertion. From Harri + Luhtala + - TCP/UDP: In the POLLOUT poll logic, request an immediate Tx poll from + the network device bound to the socket. From Gregory Nutt. + - UDP: On a failure to find the destination device, fallback to + netdev_default device if the device is not found, rather than + arbitrary using the device at the head of the list of devices. From + Xiang Xiao. + - USRSOCK: Revert previous commit to re-allow combination of usrsock + and NuttX TCP/IP stack. For example, in case device has Ethernet and + mobile connectivity and NuttX TCP/IP stack is used when configured to + use Ethernet connection and usrsock when configured to use modem + (modem TCP/IP stack through usrsock). From Jussi Kivilinna. + - USRSOCK accept(): Mark newconn ready before issue accept request to + avoid the case that the request is discarded due to the socket being + in the invalid state From Xiang Xiao. + + * Wireless/Wireless Drivers: + + - Broadcom 802.11 Driver: There were two functions that have a address + issue. In bcmf_read_sbreg() and bcmf_write_sbreg(): + SBSDIO_SB_OFT_ADDR_MASK should be used before map address space. + Noted by Shao Li in Bitbucket issue #126. From Gregory Nutt. + - Broadcom 802.11 Driver: Remove incorrect OR condition. Always true. + Noted by Shao Li in Issue 127. From Gregory Nutt. + - NRF24L01: Fix compilation errors. From Mateusz Szafoni. + + * Other Common Drivers: + + - ALARM Upper Half: Fix alarm ISR error when no CONFIG_SCHED_TICKLESS + drivers/timers/arch_alarm.c: Use uint64_t to avoid alarm 32-bit + overflow. From ligd. + - MAX11802: Fix compilation errors and allow setting PULL and SAMPLE + registers. From Petteri Aimonen. + - S25FL1: During a MTDIOC_GEOMETRY ioctl call, the driver was + incorrectly reporting the blocksize to be the same as the erasesize. + The blocksize should be 256 (the page size). This patch fixes that, + and now the SmartFS configration is working. From Ken Pettit. + - SYSLOG: nx_syslog's return value should include the timestamp length + From Xiang Xiao. + - SYSLOG: syslog_putc() calls sc_force in idle task even if interrupt + buffer enabled. The following cases may hang randomly in the bring up + phase: (1) boot up process and (2) suspend/resume process. Either + case runs in the idle task context, so it's difficult to debug the + hang issue if these output go through the interrupt buffer. From + Xiang Xiao. + - SYSLOG: Ensure interrupt log doesn't interlace in normal log. Don't + call syslog_putc in syslog_default_write because syslog_putc will try + to empty the interrupt buffer every time. From Xiang Xiao. + - UART 16550: Fix UART flow control issue. UART_MCR_RTS need be high + even UART_MCR_AFCE is enabled From zhangyuan7. + - USB RNDIS Device: Fix buffer overrun check in rndis.c. The rndis + driver has been working since 13 Nov 2017. However, I finally found + that it depends on network and buffer configurations. If a receiving + TCP packet is divided into smaller ones based on USB max packet size, + this condition check works correctly. From Masayuki Ishikawa. + + * ARMv7-A: + + - ARMv7-A: Replicate the same fix was previously committed for the + ARMv7-R. From Gregory Nutt. + + * ARMv7-R: + + - ARMv7-R: Fix error in cp15_flash_dcache. Change mcrne to mcr for + unconditional dcache. From EunBong Song. + + * ARMv7-M: + + - ARMv7-M Interrupts: Correct all ARMv7-M architectures. Interrupts + were not be disabled correctly on power up. Writing zero to the NVIC + SET-ENABLE registers has no effect. In order to disable interrupts, + it is necessary to write all ones to the NVIC CLEAR-ENABLE register. + Noted by David Sidrane. From Gregory Nutt. + + * Broadcom BCM2708 Drivers: + + - BCM2708 Serial: Juha Niskanen's fix related to STM32 + CONFIG_SERIAL_OFLOWCONTROL also applies to cloned logic in BCM2708. + From Gregory Nutt. + + * Intel x86: + + - Qemu i486: Correct .bss, IDLE stack, heap organization. From Gregory + Nutt. + + * NXP/Freescale LPC43xx Drivers: + + - LPC43 Ethernet: Fix Ethernet TX_EN pin definitions. TX_EN on LPC43xx + can be routed via P0.1 and PC.4 in both MII and RMII mode. Before, + P0.1 was hard-coded for MII and PC.4 was hard-coded for RMII. Also, + the definitions used inconsistent naming (TXEN vs. TX_EN). From Jakob + Haufe. + - LPC43 Serial: Fix copy-paste error: g_usart1port->g_uart1port. From + Dave Marples. + - LPC43 SDMMC: Fix the LPC43 family SDMMC card access: Clocks were + wrongly configured, way too fast because there is no primary divider + on LPC4330, the LPC43_SDMMC_DELAY register was not being set, the + LPC43_SDMMC_BLKSIZ and LPC43_SDMMC_BYTECNT registers had the wrong + values. From Dave Marples. + - LPC43 SDMMC: Corrected a problem in lpc43_dmasendsetup(). There was + no linked DMA descriptor code on the send side. The end result was + stalls while sending multiple sectors. This commit adds that in and + the send code is working much better. From Dave Marples. + - LPC43 SDMMC: With these changes the SDMMC card for LPC43 is now + working properly: Timing was dependent on CPU speed rather than + absolute time, end of transfer handling was a bit mixed up. It is + possible for data to still be in the FIFO (i.e. not have reached the + card) when a next write is requested, so we need to wait for that to + complete. Interrupt Status could be carried over from one transfer + episode to the next, corrupting progress. Multi-descriptor DMA + writing simply wasn't implemented. From Dave Marples. + + * NXP/Freescale LPC43xx Boards: + + - Bambino-200E: Correct calculation of SDMMC clock configuration. The + LPC43 has no SDMMC source clock divider. Error noted by Dave + Marples. From Gregory Nutt. + + * NXP/Freescale Kinetis: + + - Kinetis: Remove all attempts to reprioritize interrupts. From Gregory + Nutt. + + * NXP/Freescale Kinetis Drivers: + + - Kinetis I2C: I2C On failed reset re-initialization I2C and clocking. + If a reset fails, we still must reinitializes the I2C block so that + subsequent transfers will not cause a hard-fault due to the clock + being off. If that transfer fails it can try to reset again. From + David Sidrane. + - Kinetis Serial: Juha Niskanen's fix related to STM32 + CONFIG_SERIAL_OFLOWCONTROL also applies to cloned logic in Kinetis. + From Gregory Nutt. + + * NXP i.MXRT Drivers: + + - i.MXRT Ethernet: The board would not come up if I ran Nuttx from cold. + I dumped the PHY registers to see what the differences were and the + PHY was coming up in NANDTree mode. This is a mode for testing + connectivity between the PHY and the MAC. Switching this mode off in + the PHY registers has fixed the problem. From Dave Marples. + - i.MXRT Ethernet: Fix a race condition in setting up the Ethernet Tx + transfer. From Dave Marples. + - i.MXRT Ethernet: Corrections for the i.MXRT Ethernet: (1) Now the + Ethernet is completely re-initialized when an error occurs by means of + taking the interface down and back up but the PHY is _not_ + renegotiated for that case because that is very time consuming and an + error in the Ethernet is no reflection on the state of the PHY + anyway. (2) Explicitly sets the expected PHY address to zero (this + could be moved into the config rather than searching for it which + takes ages, and it's zero anyway for this board (that's the broadcast + address, and anything that cannot respond on that has multiple PHYs, + so that would be a new board). (3) Allows for the renegotiation of + the PHY to be optional when a reset is needed. If a non-renegotiated + reset doesn't result in good comms to the PHY then it'll automatically + be escalated to a renegotiated one. (4) Only performs a reset for + errors that need it (the CRITICAL_ERROR define). The list of errors + that need reset are somewhat arbitrarily chosen based on my prejudices + and might need to be revisited, but certainly the jabber errors don't + need reset, the partial packet is thrown away by the layer above + anyway. (5) Re-loads the multicast table on reset. (6) Adds a bit + more logging into the imxrt Ethernet module. From Dave Marples. + - i.MXRT LPI2C: Fixes 2 bugs in the for IMXRT1050: (1) I2C time out and + did not send STOP condition when sending single byte, (2) I2C could + not receive bytes after repeated start. From Ivan Ucherdzhiev. + - i.MXRT LPSRTC: SVNC LPCR register bits 0 & 1 are NOT reserved and + are, in fact, needed to enabled the SRTC. Now the SRTC is working. + From Ivan Ucherdzhiev. + - LPC54 SDMMC: Add support for and SDMMC errata. It appears that now I + can read the SD card successfully, but I get CRC errors when writing + to the card. From Gregory Nutt. + - LPC54 SDMMC: Ported Dave Marples fixes LPC43 SDMMC to the LPC54. + From Gregory Nutt. + - i.MXRT WDOG: Typos in bit definitions, wdog registers are 16 bits, + wdog update has to be within 255 clocks of unlock, define board + clocking based on divisor and muxes. From David Sidrane. + + * NXP i.MXRT: + + - i.MXRT: clockconfig bug fix: Fixed logic that was not clearing bits + as ~ was missing in &= mask operations. Use values from the board.h + file so set the Mux that selects the clock sources. Use board + defined PODF values to select clock. Only configure USDHC2 clocks + when board defines clocks. From David Sidrane. + + * NXP i.MXRT Boards: + + - IMXRT1050-EVK: Previous committed implemented SPI-based MMC/SD card + support conditioned on CONFIG_MMCSD. This interferes with the + implementation of MMC/SD card support using the SDIO-based + peripheral. This commit renames that atypical support to *mmcsd_spi* + and conditions using the SPI-based support on CONFIG_MMCSD_SPI which + will then not interfere with the MMC/SD support that can be + conditioned on CONFIG_MMCSD_SDIO. From Gregory Nutt. + + * On Semi LC823450 Boards: + + - LC823450: Fix up_allocate_heap() in lc823450_allocateheap2.c. For + lc823450, heap area in flat build mode must start just after + _eronly. Because bss/data area is allocated in lower address than + text area in SRAM. See ld.scripts for details. Also, this change + removes unused up_allocateheap.c From Masayuki Ishikawa. + + * Silicon Labs EFM32 Drivers: + + - EFM32 Serial: Juha Niskanen's fix related to STM32 + CONFIG_SERIAL_OFLOWCONTROL also applies to cloned logic in EFM32. + From Gregory Nutt. + - EFM32 USB Device: The epin_configure() function used the same eptype + as the TxFIFO number for all endpoints. This should probably be the + physical EP number, not the EP type. Suggested by Key Two. From + Gregory Nutt. + + * STMicro STM32 Drivers: + + - STM32* SPI: Don't rely on SPI_CR1_SPE to determine if peripheral has + been initialized. This change is needed specifically for the case + where a boot loader sets the SPE bit before starting NuttX. In that + case, the test in the SPI driver is wrong. This change fixes that by + assuring that NuttX has booted and initialized at least once (whether + or not SPE is set) before the driver starts refusing to initialize. + From Anthony Merlino. + - STM32 F0, F7, H7, L4 Serial: Fix use of CONFIG_SERIAL_IFLOWCONTROL + where CONFIG_SERIAL_OFLOWCONTROL was intended. From Juha Niskanen. + - STM32 TIM: Don't use hard-coded UIF interrupt in some functions. + From raiden00pl. + - STM32 (FS/HS), STM32F7, and STM32L4 OTGFS/HS Device: The + epin_configure() function used the same eptype as the TxFIFO number + for all endpoints. This should probably be the physical EP number, + not the EP type. Suggested by Key Two. From Gregory Nutt. + - STM32 F2: Fixes Kconfig options to include all STM32F20XX processors, + not just STM32F207. Also removes redundant STM32_STM32F429 depends + from Kconfig. STM32F4XXX already does this. From Anthony Merlino. + - STM32 F4 DAC: STM32F407VG has only one DAC. NDAC=2 causes + compilation error when trying to use e.g. STM32_DAC1_CR macro. From + Petteri Aimonen. + - STM32 F7 Serial: Force invalidation of data cache after DMA re-enable + when returning from low-power mode From Juha Niskanen. + + * STMicro STM32 Boards: + + - B-L475E-IOT01A: Correct timer source clock frequencies. From Freemans + Goden. + - Nucleo-L432KC: Fix SPI pin definitions in board.h. From Daniel P. + Carvalho. + + * MIPS32: + + - CP0 Definitions: Fix some copy-paste errors that cause malformed + comments and syntax errors when certain CP0 CONFIG1 bits are + referenced. Note in Issue 123 by Anonymous. From Gregory Nutt. + - microMIPS: Reported by Anonymous in Bitbucket Issue #129: When MIPS + port is built for microMIPS and then loaded as an application, the + __start entry point is entered in microMIPS mode, but the CPU core + initialization code there misses to set the config3ISAOnExc bit to 1. + Subsequently, exceptions are entered in MIPS32 mode, but the code base + was built for microMIPS. + + * Microchip PIC32MZ: + + - PIC32MZ Startup: In pic32mz-head.S, initialize the global pointer in + all shadow sets. From Ouss4. + + * Microchip PIC32MZ Drivers: + + - PIC32MZ Serial: Fix a typo in assignment of TTYS0 to UART6 From Ouss4. + + * Simulation: + + - SIM Network Driver: Fix error 'invalid operands to binary &' From + Xiang Xiao. + + * C Library/Header Files: + + - Fix typographical error in endian.h and resource.h From anchao. + - include/net/if.h: Adds extern "C" guard in include/net/if.h From + Anthony Merlino. + - include/netinet/in.h: Per OpenGroup.org, type of sin_port in struct + sockaddr_in must be in_port_t vs uint16_t. NOTE: in_port_t is + typdef'ed as uint16_t anyway. From Gregory Nutt. + - include/nuttx: Fix definitions used to access OS functions within the + libraries. In the FLAT build, we must always set the errno and/or + create cancellation points because the same library functions are used + within the OS as are used by applications. This could cause issues + for the OS but corrects some problems at the user interface. Noted by + Federico Braghiroli in Bitbucket issue 121. From Gregory Nutt. + - include/nuttx/clock.h: Fix uptime wrong if DEBUG_FEATURES and + SCHED_TICKLESS enabled. From Xiang Xiao. + - include/nuttx/fs/fs.h: Fix some backward parameters in a new macro + definition. From Gregory Nutt. + - include/nuttx/fs/fs.h: Register_mtddriver should depend on CONFIG_MTD + not CONFIG_MTD_PARTITION From Xiang Xiao. + - include/sys/socket.h: Renumber the socket types. They must begin at + 1, not zero. Socket type zero has a special meaning for some + interfaces. For example, getaddrinfo() uses a socket type of zero to + many any type of socket. The is no standard name for the + any-type-socket, but macOS uses SOCK_UNSPEC. NuttX will do the same. + Issue noted by Anthony Merlino. From Gregory Nutt. + + - libs/libc: Correct some errors in psignal() and stpncpy(). From + Lokesh B V. + - libs/libc/math: Add variable convergence in log() and logf() to avoid + hangs caused by failure to converge for very specific input values. + Also includes a small change to log() and logf() that improves + accuracy and convergence time. From Rajan Gill. + - libs/libc/stdio: Fix conversion for format specifiers in sscanf() that + appear right after a floating point format specifier. When + performing a floating point conversion the parsing code could consume + more than required characters from the input buffer. This made + impossible to convert input of form "1.1K" using format "%f%c". Fix + the issue by advancing the input buffer with the actual characters + converted as a float point number. From Mihai Serban. + - libs/libc/stdio: Remove CONFIG_NOPRINTF_FIELDWIDTH. That option + does, indeed, make the printf family of functions much smaller. But + it also adds a lot of complexity and makes the functions + non-standard. Removing this might break some of the tinier platforms + but it is the best thing to do for long term maintenance for for + OpenGroup.org compliance. + - libs/libc/stdio: Update to vsprintf(). This resolves the integer + field width problem if Issue 35 for the cases of integer, long and + long long integer types. The output now matches the output form + glibc. From Gregory Nutt. + - libs/libc/string: Correct the return pointer value from stpncpy() for + the case where the NUL terminator is transferred. From Gregory Nutt. + - libs/libc/string: Fix strrchr() so that it considers null terminator + as part of string. From Petteri Aimonen. + - libs/libc/wqueue: Eliminate a race condition noted by Xiang Xiao. + Use sigprocmask() so that we do not lose a signal. From Gregory Nutt. + - libs/libnx/nxfonts: Fix kerning of 'I' in Sans17x22 font. From + Petteri Aimonen. + - libs/libnx/nxfonts: In nxfonts_getfont(), avoid unnecessary warnings + for other whitespace chars also. From Petteri Aimonen. + - libs/libnx/mxmu: NXMU now re-validates window pointer for mouse + events. NXMU caches the previous window pointer so that further mouse + events can be sent to the same window. However, if the window is + destroyed while mouse button is held down, the pointer may become + invalid and cause a crash. This patch revalidates the pointer before + using it. From Petteri Aimonen. + - libs/libnx/nxtk: nxtk_bitmapwindow: Fix warning message when bitmap is + fully off-screen. From Petteri Aimonen. + + * Build System: + + - Fix issue with libcxx build. This was changed multiple times, but + should be fixed now. From Anthony Merlino. + - configs/Makefile and tools/Config.mk: Move single file copy to the + new function COPYFILE. This fixes the Windows native build case when + there is no cp or cp does not recognize Windows paths. From Anatol + Ivanov. + - tools/Config.mk and tools/Makefile.win: Force use 'cmd' for shell + with windows native build From Anatol Ivanov. + - tools/Directories.mk: Correct the path to the installed libcxx + directory. From Gregory Nutt. + - tools/Makefile.win/unix: Staging directory (and its libraries) should + be removed on 'make clean' (issue noted by Dave Marples). From + Gregory Nutt. + + - apps/Directory.mk: If the current directory contains a Kconfig file + and MENUDESC is not defined, then Directory.mk must not trash the + Kconfig in the current directory. From Gregory Nutt. + - apps/Makefile: Fix Windows native build patch extension. From Anatol + Ivanov. + + * Other Tools: + + - tools/Config.mk: Fix an error in RWILDCARD implementation From + Anthony Merlino. + - tools/configure.c: Add missing '\n' in printf statement + - tools/configure.c: Add missed -g option to getopt() string. From + Anatol Ivanov. + - tools/configure.c and tools/configure.sh: Fix Windows native + pre-build kconfig-conf incompatibility. From Anatol Ivanov. + - tools/csvparser.h: Extend MAX_PARMSIZE to 256. Fixes this issue: + 70: Parameter too long: ... From Xiang Xiao. + - tools/link.bat: Fix .fakelink creation. From Anatol Ivanov. + - tools/mkdeps.c: Fix '\0' missing with MinGW. From Anatol Ivanov. + + * NSH Library: apps/nshlib: + + - apps/nshlib: Correct maximum number of arguments that can be provided + to the mksmartfs command. From Eunbong Song. + - apps/nshlib: Add fflush to nsh_consolewrite(). This resolves this + problem: 'cat /dev/ttyCP &' followed by 'echo ls >/dev/ttyCP'. In + that case we can't get the 'ls' result immediately, because 'cat' cmd + uses nsh_consolewrite() and that uses fwrite with no fflush. We can + get the 'ls' result after type '\n', because nsh will fflush output + when get '\n'. From ligd. + - apps/nshlib: nsh_catfile() should not append '\n' if the last char in + file is already '\n' From Xiang Xiao. + - apps/nshlib: Fix warning g_oldpwd defined but not used + [-Wunused-const-variable] in nsh_envcmds.c. From Xiang Xiao. + + * Examples/Tests: apps/examples: + + - apps/examples/adc/Kconfig: CONFIG_BOARDCTL_ADCTEST does not exist + anymore and should removed as a dependency. From Eunbong Song. + - apps/examples/webserver/Kconfig: The webserver "app" allows for DHCP + client to be enabled. However, the Kconfig infrastructure does not + contain EXAMPLES_WEBSERVER_DHCPC config. Based on patch from + "Anonymous" attached to Bitbucket Issue #130. From Gregory Nutt. + + * System Utilities: apps/system: + + - apps/system/hexed: Fix memory leak From zhuyanlin. + - apps/system/i2c: Fix i2c_msg freq initialization problem. Typo + prevented I2C frequency initialization in a struct i2c_msg. From + dongjiuzhu. + - apps/system/system: Fix warning when passing argument 6 of + 'task_spawn' from incompatible pointer type + [-Wincompatible-pointer-types] From Xiang Xiao. + + * Network Utilities: apps/netutils: + + - Correct some network-related configuration variable names. All *_MTU + defines were changes to *_PKTSIZE gut that was not reflected in + apps/ From Gregory Nutt. + - apps/netutils/netlib/netlib_parsehttpurl.c: Correct handling of long + URLs as noted in Bitbucket issue #119 (in the nuttx/ repository, not + the apps/ repository). From Gregory Nutt. + - apps/netutils/codecs: "dst" overflow protection when base64 string + ends with "=" From Aleksandr Vyhovanec. + - apps/include/netutils/ipmsfilter.h: Eliminate error generated by bad + pre-processor logic. From Gregory Nutt. + + * GPS Utilities: apps/graphics: + + - apps/graphics/NxWidgets: Fix garbage returned when + CCycleButton::getValue() is called after removeAllOptions(). + CScrollingPanel should not draw outside the widget area. From + Petteri Aimonen. + +NuttX-7.28 Release Notes +------------------------ + +The 128th release of NuttX, Version 7.28, was made on January 19, 2019, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.28.tar.gz and +apps-7.28.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - Critical Section Monitor: Adds data collection logic in support of + pre-task monitoring critical sections and pre-emption state. From Gregory + Nutt + - Critical Section Monitor: Add support for global pre-emption and + global critical sections to monitor as suggested by Xiang Xaio. From + Gregory Nutt + - Interrupt Time: Measurement of interrupt handler duration used to + be available only in Tickless mode since it used the high resolution + Tickless timer to measure interrupt time. This change adds + CONFIG_SCHED_IRQMONITOR_GETTIME which, if enabled, will force the + interrupt duration calculation to use the same high-resolution, + platform-specific timer as is used with the Critical Section Monitor. + This leads to two improvements: (1) You can now measure interrupt + duration in non-Tickless mode, and (2) in either mode, the interrupt + duration and the critical section measures will use the same + high-resolution timer and should, therefore, never be any discrepancy + due to different clock sources. From Gregory Nutt + - Context Switching Protection: Add debug assertions before each call + to up_block_task() to assure that there is no attempt to block an + IDLE task. From Dave Marples + - init Task: Allow the init task priority to be configurable. From + David Sidrane + - pthreads: Implement pthread_key_delete(). This involves some minor + changes to the group data structure. From Gregory Nutt + + * File Systems/Block and MTD Drivers + + - ProcFS: Extended the process ID ProcFS output to show per-thread + maximum time for pre-emption disabled and maximum time within a + critical section. From Gregory Nutt + - NXFFS: Pass unrecognized IOCTL commands to the contained MTD + driver. From Daniel P. Carvalho + - LittleFS: Adds an initial port the ARM mbed littlefs to NuttX. This does + not include FLASH formatting utilities. Depends on CONFIG_MTD_BYTE_WRITE. + From lihaichen + - AT25 MTD Driver: Added support for AT25DF081A serial flash chip. + From Marc Rosen + - MTD Configdata Device: Extends the MTD configdata device with the + following features / additions: + 1. Configurable option to use named config items instead of enumerated + ID/Instance numbers. + 2. Ability to iterate through the existing configdata items in the + /dev/config device. + 3. Ability to "unset" a configdata item. + 4. Ability to perform "flash_eraseall" on the /dev/config device. + From Ken Pettit + + * Networking/Network Drivers: + + - Telnet Driver: Add NAWS and poll interface to telnet for screen size + negotiation used with termcurses. From Ken Pettit + + * Wireless/Wireless Drivers: + + - BLE HIC Core: Add second RX work function From Lwazi Dube + - BLE IOCTL Commands: Add SIOCBTCONNECT and SIOCBTDISCONNECT ioctl + commands From Lwazi Dube + - CC2564: Add cc2564 HCI UART driver. From Lwazi Dube + + * Graphics/Display Drivers: + + - Sitronix ST7032i: Add support to Alphanumeric Sitronix ST7032i + display From Alan Carvalho de Assis + - NXP TDA19988: This commit brings in a complete, but untested, + implementation of a driver for the TI TDA19988 HDMI Encoder. This encoder + is used on the Beaglebone Black board. Since this driver is untested, it + requires CONFIG_EXPERIMENTAL in the configuration. From Gregory Nutt + + * Crypto: + + - crypto/aes.c: This change provides an improved AES cipher API in + addition to the existing routines. The reasons for this new API are: + 1) better performance, giving the possibility to avoid re-setting-up + the key for each AES block when the same key is used multiple times. + This is important for the current single user of AES, which is + related to storage and FTL. And 2) suitable for simultaneous use of + multiple AES keys, which will be required by the upcoming crypto + framework. It retains compatibility with the previous API, so there + is no need to change anything else right now. From Sebastien Lorquet + + * Other Common Device Drivers: + + - MMCSD SDIO: The mmcsd_sdio driver makes calls for dcache + invalidation through the chip specific architecture function + SDIO_DMARECVSETUP(). I changed the arch/arm/stm32f7 chips to use + arch_invalidate_dcache_by_addr() instead of arch_invalidate_dcache(). + + This commit includes additional changes to mmcsd_sdio.c. I + created SDIO_DMADELYDINVLDT() (DMA delayed invalidate) to + invalidate store-into mode dcaches after the DMA transfer. I + have been using SDIO_DMADELYDINVLDT() for several weeks now and + it has fixed the problems that I previously reported regarding + non-cache aligned buffer invalidation errors (for my store-through + dcache). However, it does not permit use of unaligned DMA buffers + for store-into mode dcaches. + + SDIO_DMADELYDINVLDT() is a NoOp unless the chip specific Kconfig + file selects CONFIG_ARCH_HAVE_SDIO_DELAYED_INVLDT. I have modified + all the stm32f7 chips to select it. From Bob Feretich + - SPI Lower Half Interface: Extend the HW features supported by SPI. + It now supports a deferred DMA trigger hardware configuration. From + Dave Marples + - DS28E17 1-Wire Driver: Optimize I2C write followed by read to same + address. From Juha Niskanen + - LMP92001: Add support for the TI LMP92001 Multi-channle DAC/ADC + device. From Abdelatif Guettouche. + - EEPROM Character Driver: Add support to Microchip AT24CM02 From + Alan Carvalho de Assis + - Microchip MCP73871: Add support to Microchip MPC73871 Battery Charger. + From Alan Carvalho de Assis + - MCP7941x: Add support for the Microchip MCP741x external RTC. From Ouss4 + - Sensirion SCD30: Driver for Sensirion SCD30 CO2 sensor. From Jussi + Kivilinna + - Sensirion SGP30: Driver for Sensirion SCD30 gas sensor. From Jussi + Kivilinna + - Sensirion SPS30: Driver for Sensirion SCD30 particulate matter sensor. + From Jussi Kivilinna + - USB CDC/ACM Device: When implemented usb cdc on nrf52840, I found + some issues with cdc driver: + 1. Lost data when receiving buffer is full; + 2. Low-water mask implement issue; + 3. Re-flush cdc buffer when enabling + 4. Serial dma is conflict with cdc , modify the serial.h + From Levin Li + + * MIPS32: + + - Configuration System: Allow Penguino for windows for the Windows + Ubuntu platform as well. + + * Maxim Integrated MAX326xx + + - MAX32660: Support for the MAX32660 was added (along with partial + support for other members of the MAX326xx family). The initial port + includes Clock configuration, timer, GPIO pin configuration, ICC, + and UART. Additional untested drivers are complete and ready for + testing: DMA, GPIO interrupts, SPI0 Master, TC, WDT. The following + drivers are not yet implemented: I2C and I2S. + + * Maxim Integrated MAX326xx boards + + - MAX32550-EVSYS: Basic support for the Maxim Integrated MAC3X660 + EVSYS is included. A basic NSH configuration is available and is + fully functional. Includes unverified support for an SPI0-based + SD card. + + * Microchip/Atmel SAMD21/L21 Drivers: + + - SAMD21/L21: Adds a complete ADC header file for SAMD21 and a partially + complete ADC header file for the SAML21. From Alexander Vasiliev + - SAMD21/L21: Export sam_i2c_master_initialize(int bus) to be used by + board config. From Alan Carvalho de Assis + + * Microchip PIC32MZ Drivers: + + - PIC32MZ I2C: Add support for the I2C bus. From Ouss4 + + * ARMv7-A + + - ARMv7-A MMU: Use TLBIMVA vs TLBIMVAAIS to invalidate the Cortex-A8 + cache. From Petro Karashchenko + + * ARMv7-M + + - Cortex-M7 Cache: This commit adds a new function + arch_invalidate_dcache_by_addr(). It takes the same parameters as + arch_invalidate_dcache(), but performs invalidation of only the lines + in cache that need to be invalidated. This new function could be + used as a a direct replacement for arch_invalidate_dcache(). From + Bob Feretich + - ARMv7-M: In the current implementation we only use very high + priority interrupts (levels 0, 0x10 and 0x20 in CORTEX-M speak) but + that means there are loads of lower priority ones that are + effectively unused. I have *not* changed the semantics of these + levels but have 'shifted' them to be based around the midpoint of the + available interrupts (0x80) rather than at the top end....that allows + for interrupts to be defined above (or, indeed, below) them as needed + by the application. This should have no functional effect on + existing code but adds in a clean capability to define higher + priority interrupts. From Dave Marples + + * Broadcom BCM2708: + + - BCM2708: Remove all support for the BCM2708/2835. This was added + only for support of the RaspberryPi Zero board which was previously + removed. The support was minimal and unverified. The removed files + can still be found in the Obsoleted directory. From Gregory Nutt + + * Broadcom BCM2708 Boards: + + - Raspberry Pi Zero: Remove the partial support for the Raspberry Pi + Zero. This port was started with the best of intentions but was + never completed. The board support can still be found in the + Obsoleted repository. From Gregory Nutt + + * Nordic NRF52 Boards: + + - Improve LED handling #if~#endif in nrf52_autoleds.c and + nrf52_userleds.c + Add Adafruit Feather nRF52 board LED support + Add Adafruit Feather nRF52 board + Add nrf52-generic + Replace 'pca10040' with 'generic' + Copy from nrf52-pca10040 to nrf52-generic + From Zou Hanya + + * NXP i.MX RT Drivers: + + - i.MXRT: Add PIT, GPT, and QIMER(TMR) header files From David Sidrane + - i.MXRT: Add FLEXPWM. From David Sidrane + - i.MXRT: Add ADC chip header From David Sidrane + - i.MXRT Build: Include up_systemreset and up_stackcheck.c From David Sidrane + - i.MXRT GPIO: Add GPIO Support Input daisy selection. From David Sidrane + - i.MXRT Serial: Support independent input and output flow control. From + David Sidrane + - i.MXRT USB: Use single define for USB pin definitions. From David Sidrane + - IMXRT106X: Add FLEXCAN3 to pinmux header file. From David Sidrane + + * NXP Freescale i.MX RT Boards: + + - IMXRT1050-EVK: GPIO device driver support added and tested by + Pavlina Koleva and Ivan Ucherdzhiev. From Pavlina Koleva + + * On Semi LPC23450: + + - LPC23450: Add support for SPI flash boot. Also, remove unnecessary + code for the SPI flash boot. From Masayuki Ishikawa + + * On Semi LPC23450 Boards: + + - LC823450-XGEVK: Add linker script for SPI flash boot. From + Masayuki Ishikawa + - LC823450-XGEVK: Enable NFS client for RNDIS configuration. Also, some + stack size were adjusted to work with NFS From Masayuki Ishikawa + + * Simulation + + - Critical Section Monitor: Add low level timer support for simulation. From + Gregory Nutt + + * STMicro STM32: + + - Configuration: Simplify ARM core selection logic From Mateusz Szafoni + - Configuration: USB Host is an option. From David Sidrane + - STM32 L0: Brings in initial support for the STM23 L0. From Mateusz + Szafoni + + * STMicro STM32 Drivers: + + - STM32 ADC: Configurable ADC DMA mode (one shot mode, circular + mode). From Mateusz Szafoni + - STM32 ADC: Start conversion on startup is now possible if TIM + triggering selected. This can be useful to start ADC TIM conversion + for ADC IPv2 when opening ADC device. + - STM32 DAC: Unified naming for DAC interfaces From Mateusz Szafoni + - STM32 DMA: Add interfaces to interact with high priority DMA + interrupts. From Mateusz Szafoni + - STM32 DMA: Use STM32 DMA IP core version instead of chip family + names. From Mateusz Szafoni + - STM32 DMA: Add support for DMA v1 CSELR support. From Mateusz Szafoni + - STM32 HRTIM: Do not enable timers on startup if option from Kconfig + selected and add interface to enable/disable timers. From Mateusz + Szafoni + - STM32 PWM: Add timer enable/disable and frequency update to + low-level ops. From Mateusz Szafoni + - STM32 SPI: Implements the new deferred DMA trigger feature. From + Dave Marples + - STM32 F0 Build: Rename the stm32f0 directory to stm32f0l0 to make a + space for STM32 L0. Rename files, functions and defines, removing + the f0_ from the names in order to make them MCU agnostic. From + Gregory Nutt + - STM32 F0 GPIO: Add support for GPIO EXTI. From Mateusz Sfafoni + - STM32 F2 FLASH: stm32_flash_writeprotect() supported the same for + STM32F20XX as STM32F4XXX From Anthony Merlino + - STM34 F7 DMA: stm32f7 enable separate DMA per SPI configuration + From Daniel Agar + - STM32 F7 QEncoder: Ported the QEncoder from F4 to F7. From Eduard + Niesner + - STM32 F7 SPI: Port Dave Marples STM32 deferred trigger enhancement + to the STM32 F7 SPI drivers. From Gregory Nutt + - STM32 H7 SPI: Port Dave Marples STM32 deferred trigger enhancement + to the STM32 H7 SPI drivers. From Gregory Nutt + - STM32 L4 SPI: Port Dave Marples STM32 deferred trigger enhancement + to the STM32 L4 SPI drivers. From Gregory Nutt + + * STMicro STM32 Boards: + + - B-L072Z-LRWAN1: Add basic support for b-l072z-lrwan1. Nucleo boards + use as default ST LINK MCO as clock input from MCU and for this + HSEBYP must be enabled. From Mateusz Szafoni + - Nucleo-F103RB: Add board support. From Mateusz Szafoni + - Nucleo-F103RB: Add ADC and PWM examples. From Mateusz Szafoni + - Nucleo-F207ZG: Add board support. From Mateusz Szafoni + - Nucleo-F207ZG: Add ADC and PWM examples. From Mateusz Szafoni + - Nucleo-F302R8: Add high priority ADC interrupts example to the + 'highpri' configuration. From Mateusz Szafoni + - Nucleo-F334R8: Add support for ADC injected sequence to the 'highpri' + configuration, add triggering from TIM1. From Mateusz Szafoni + - Nucleo-F334R8: Add example for the SPWM generation (custom STM32 PWM + usage). From Mateusz Szafoni + - Nucleo-F767ZI: Use on board USB UART as default console. Board is powered + by USB which can be used as UART link for upload and console. Previously + it was set to use Arduino shield which developer may not have. From Phil + Coval + - Nucleo-F767ZI: Add ethernet config based on nsh configuration plus + stm32f769i-disco/nsh-ethernet. From Phil Coval + - Nucleo-L073RZ: Add basic support for nucleo-l073rz. Nucleo boards + use as default ST LINK MCO as clock input from MCU and for this + HSEBYP must be enabled. From Mateusz Szafoni + - Nucleo-L152RE: Add board support. From Mateusz Szafoni + - STM32F4 Discovery: Add timing support for the critical section + monitor using the DWT CYCNT register. From Gregory Nutt + - STM32F4 Discovery: If the Critical Section Monitor, modify the + ITM_LAR register to assure that the DWT cycle counter is enabled. + Suggested by Dave Marples. From Gregory Nutt + - STM32F4 Discovery: Add board support to display ST7032i From Alan + Carvalho de Assis + - STM32F4 Discovery: Add loadable application build support in + Make.defs From Masayuki Ishikawa + - STM32F4 Discovery: Update RNDIS configuration: (1) Add NFS and adjusted + stack size for usermain and telnetd client. (2) Add support for loadable + application and ping. From Masayuki Ishikawa + - STM32F4 Discovery: Update nsh configuration: (1) Add + CONFIG_BOARD_INITIALIZE=y, (2) Add CONFIG_EXAMPLES_HELLO=y. From Masayuki + Ishikawa + - STM32F429I-DISCO: Add high priority ADC interrupts example to the + 'highpri' configuration. From Mateusz Szafoni + - configs/nucleo-l073rz: Support for nrf24l01. From Mateusz Sfafoni + + * TI CCxx: + + - CC13x0 family and CC13x2/CC26x2: Basic, minimal support was added + for these two chip families. This is a Work-In-Progress: There is + just enough logic in place to support a simple NSH configuration. + However, the port is still missing certain, necessary hooks into the + TI ROM-based 'DriverLib'. As a result, the support is not fully code + complete and is totally untested. Support for the CC26x2, which is + nearly identical to the CC13x2 is fragmentary. Stay tuned. + Hopefully full support will be available in NuttX 7.29. + + * TI CCxx Boards: + + - LAUNCHL-CC1312R1: Board support is available for the TI + LAUNCHL-CC1312R1. That board support consists only of an unverified + NSH configuration. The primary purpose of this port for the time + being is simply support the core architecture bring-up. + + * TI AM335x: + + - AM335x: Adds initial support for the TI AM355x family. + - AM335x: Add minimal wdog logic needed to disable the watchdog timer. + Otherwise, the board is rebooted after certain time expires while NuttX is + running. From Petro Karashchenko + - AM335x: Switch to DMTimer2 for system tick generation. U-Boot does not + enable DMTimer1ms clocks hence it is not possible to use it until + implementation in am335x_clockconfig.c is ready. From Petro Karashchenko + + * TI AM335x Boards: + + - Beaglebone Black: Initial port for BeagleBone Black board support + (TI AM335x family based on Cortex-A8). Includes a basic functional NSH + configuration . From Petro Karashchenko + + * TI Tiva: + + - LM3S9B92: Add support for LM3S9B92. From Lwazi Dube + + * TI Tiva Drivers: + + - Tiva HCI UART: Port bluetooth HCI uart interface from stm32 to tiva + From Lwazi Dube + + * TI Tiva Boards: + + - TM4C1294-Launchpad: Add IRQBUTTONS support to tm4c1294 launchpad. + From Lwazi Dube + + * Tools: + + - tools/convert-comments.c: Add a tool to convert C++-style comments + to C89 C-style comments. From Gregory Nutt + - tools/detab.c: Add detab.c which will convert all tabs in a file to + spaces. From Gregory Nutt + - tools/lowhex.c: Add lowhex.c that will convert hexadecimal constants + in a file to use lower case representation. From Gregory Nutt + - tools/mkconfig.c: Add definitions to distinguish between tristate + 'y' and 'm' options. From Gregory Nutt + - tools/nxstyle.c: Add logic to detect long lines. From Gregory Nutt + - tools/nxstyle.c: Add -h for help. From Gregory Nutt + + * Libraries/Header Files: + + - include/nuttx/lcd/edid.h: Add EDID definitions From Gregory Nutt + - libs/libc/netdb: Make DNS retries configurable From Juha Niskanen + - libs/libc/netdb: Harden query logic against DNS spoofing. This + commit implements most of the RFC 5452 guidelines for making DNS more + resilient. We now verify response matches against what was queried + and use unpredictable query IDs. It is also checked that response + come from correct DNS server. Also fixes a buffer overflow when + querying hostnames longer than CONFIG_NETDB_DNSCLIENT_NAMESIZE. From + Juha Niskanen + - libs/libc/netdb: Support multiple IP addresses per hostname From + Juha Niskanen + + * NSH: apps/nshlib: + + - apps/nshlib: Add support to use SLCD as NSH Console From Alan Carvalho de + Assis + - apps/nshlib: Add support for CROMFS start-up script. From David Sidrane + - apps/nshlib: Add var expansion in NSH parse. From Daniel Agar + - apps/nshlib: Display built-in apps using multi-column mode like the NSH + commands. From Ken Pettit + - apps/nshlib: In all multi-column help output, calculate an optimal column + width rather than using a hard-coded width that may or may not be + appropriate. Also make the number of rows presented dependent upon the + maximum width of the widest column. From Gregory Nutt + - apps/nshlib: Adds addroute command options for setting default gateway. + Like 'addroute default '. From Anthony Merlino + + * Examples/Tests: apps/examples: + + - apps/examples/battery: Add Battery Charger Monitor Example From Alan + Carvalho de Assis + + * System Utilities: apps/system + + - apps/system/configdata: Adds an "cfgdata" command which allows + manipulation of the /dev/config items via the command line. One such use + for this utility would be to set a "macaddr" configdata item, etc. The + utility is sort-of like a u-boot env variable edit function: + + For instance, to set a "macaddr" when the new CONFIG_MTD_CONFIG_NAMED + option is selected, you would do: + + nsh> cfgdata set macaddr [0xfc 0x01 0x0b 0x45 0xa1 0x12] + (The brackets denotes an array of bytes) + nsh> cfgdata set hostname myboard + + or using the old ID,INSTANCE numeric method: + + nsh> cfgdata set 0,0 [0xfc 0x01 0x0b 0x45 0xa1 0x12] + (The brackets denotes an array of bytes) + nsh> cfgdata set 1,0 myboard + + You can also display all config items: + + nsh> cfgdata print all + Name Len Data + macaddr 6 0xFC 0x01 0x0B 0x45 0xA1 0x12 + hostname 8 myboard + + From Ken Pettit + - apps/system/critmon: Add a daemon to monitor critical section usage. From + Gregory Nutt + - apps/system/nsh: Set NSH priority if the NSH task was scheduled at a + different priority than the configured priority. From Gregory Nutt + - apps/system/nxplayer: Introduce CONFIG_NXPLAYER_MAINTHREAD_STACKSIZE. From + Masayuki Ishikawa + - apps/system/termcurses: Addition of termcurses libraries in + apps/system/termcurses From Ken Pettit + - apps/system/vi: New feature additions + 1. Vi startup feature to prepend the current working directory to the + supplied filename if it does not start with '/' absolute path + specifier. This allows editing files in the current directory + without needing to fully qualify the filename. + 2. Standard '~' empty screen line characters for proper identification + of empty '\n' only lines at the end of the file. + 3. Moving into insert or append mode now prints '--INSERT--' in the + status line and clears it upon exit. + 4. Integration with termcurses to detect special keystrokes and to + handle terminal type differences. Haven't yet converted all vt100 + print codes to termcurses equivalents. + 5. Support for up, down, left, right arrows, page-up, page-down keys in + command mode. + 6. Added 'b' command to move cursor 'b'ack to previous word. Honors the + command repeat value for multiple word moves. + 7. Added 'w' command to move cursor to next 'w'ord. Honors the command + repeat value for multiple word moves. + 8. Added 'f' and 't' commands to find characters on the current line. + Honors the command repeat value. + 9. Added the find 'n'ext command to repeat the previous find operation. + 10. Added the 'H', 'M', and 'L' commands to move the cursor to top, + middle and bottom of the display. + 11. Extended yank/paste to manage a paste buffer with character mode in + addition to line mode. Character mode allows cut / paste of + individual characters or groups of characters vs. full lines. + 12. Added support in the 'd'elete and 'y'ank commands for character mode + deletions such as 'dw', 'dfa', '2yw', etc. + 13. Added support in paste routine for multiple paste using command value + argument. + 14. Added support for the 'D' and 'C' delete and change to end of line + commands. + 15. Added support for 's'ubstitute key ('x' followed by insert mode). + 16. Modified yank / paste allocation scheme to avoid repeated alloc and + free of paste buffer. Uses a minimum allocation size scheme and only + does free / realloc when paste does not fit. If the paste is smaller + than the current allocation and the current allocation is larger than + the threshold, then the buffer is freed and a smaller buffer + allocated. Otherwise the existing buffer is used. + 17. Support for 'P'aste before current cursor position. + 18. Support for '?' reverse search mode. + 19. Support for 'J'oin next line with current line command. + 20. Printing of current row,col in status line of display. + 21. Command repeat '.' support for commands that modifiy text. + 22. Support in replace / insert mode for arrow keys, PGUP / PGDN, HOME, + and END. Using these will cause the command repeat buffer to reset + such that only the last text addition after a cursor movement is saved. + 23. Added 'X' delete previous command. + 24. Added "gg" go to top of document command sequence. + 25. Added "ZZ" save and quit command (equivalent to :wq). + 26. Implemented '^' goto first non-whitespace on current line, along with + '+' and '-' goto first non-whitespace on next / previous line. + 27. Added CR / LF goto first non-whitespace on next line in command + mode. From Ken Pettit ? + + * Network Utilities: apps/netutils: + + - apps/netutils/webserver: The webserver/httpd app is was broken when script + support was enabled (CONFIG_NETUTILS_HTTPD_SCRIPT_DISABLE). The root cause + has been tracked down to the "Content-length" not being available ahead of + time in this case (length of -1 passed to send_headers() ). On the other + hand, the server closing the socket does not result in FIN being sent to + the browser either (FIN not supported by NuttX yet). + + Simple solution: Add support for HTTP Chunked Encoding to webserver/httpd. + The change is simple. It adds a configuration option to enable chunked + encoding. When enabled, the implementation will auto-detect the cases where + content length is not available ahead of time, and will automatically + engage chunked encoding transfers. + + Without this patch, the browser/client hangs forever, as it is expecting + more data. With this patch, the browser displays the content. From Vlado + Vidovic + + * Wireless Utilities: apps/wireless: + + - apps/wireless/bluetooth/btsak: Add connect and disconnect commands to + btsak. From Lwazi Dube + + * Graphic Utilities: apps/graphics: + + - apps/graphics/pdcurs34: Integration of termcurses into pdcurses, plus + pdcurses updates for multi-thread support From Ken Pettit + - apps/graphics/pdcurs34: Adds a configuration option to pdcurses to enable + line-drawing character (ALTCHARSET) when using the short 16-bit chtype. + This is done by limiting the characters to 7-bit ASCII values and using the + 8-th bit as the A_ALTCHARSET bit. This allows a significant RAM savings 4K + - 20K depending on terminal size) while still allowing the nicer + line-graphic characters for border drawing. From Ken Pettit + + * Testing: apps/testing: + + - apps/testing/ostest: Add test for pthread-specific data. From Gregory + Nutt + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Assertions: Identify the running task correctly when dumping task + state information. It takes time to switch to the target task after + g_readytorun has been modified. If panic/assert happen during this + period, the dump will contain the incorrect and confusing information + due to the difference between the real running task and the return + value of this_task(). This change resolve this problem by adding + g_running_task to track the real running task through the context + switch. From Xiang Xiao + - Assertions: Correct duplicated logic from commit + dbf01d12b7321d1b48b68d3b69842a853b049376. Checking for PID == zero + is not a valid way to test for the IDLE task in all configurations! + This is only true in the single CPU configuration. In multiple CPU + configurations, there will be a separate IDLE task for each CPU with + a different PID and an alternative check must be used. NOTE: The + logic fixed in some places still lacks sufficient intelligence in SMP + mode to find the right stack for the CPU IDLE thread and could still + show the wrong stack. From Gregory Nutt + - Interrupt Prioritization: Remove all driver-specific logic that may + set the interrupt priority to anything but the default. There is no + good reason to change the interrupt priority unless you just want to + debug a difficult problem. OR if you want to use high priority + interrupts. In that case the specific interrupt priorities will need + to be set by board-specific logic. From Gregory Nutt + - Memory Management: Revert "This patch prevent heap corruption as in + below case." This solution to the problem noted by EunBong Song + results in major memory fragmentation and out-of-memory + conditions on the PX4 platform. On that platform the lower priority + work queue is very low priority and essentially never runs when the + system is busy. As a result, the systems gets slowly starved of + memory until failures and bad behaviors begin to occur. From Gregory Nutt + - Memory Management: This is a replacement for EunBong Song's reverted + change. This change adds (1) logic in getpid() to return an error instead + of the PID if the (apparent) currently executing task is not marked as + RUNNING. Then (2) mm_trysemaphore() (the root implementation of both + kmm_trysemaphore() and umm_trysemaphore()) will know that the (apparent) + running task cannot be the holder of the semaphore. How could the + non-running task be trying to get the MM semaphore? I think only in the + exact scenario that Eunbong Song has described. So this new solution + should provide the same protection as the original change but without the + bad consequences to memory usage. From Gregory Nutt (with corrections + from David Sidrane) + - Memory Management: In implementation of calloc(), verify that the number of + elements times the size of an element will not overflow type size_t. This + is required by the SEI CERT C coding style and resolves anonymous Bitbucket + Issue #139 From Gregory Nutt + - sigtimedwait(): Remove unnecessary disable of pre-emption. From + Gregory Nutt + - _exit(): Update all architecture-specific _exit() implementations + so that they correctly call the scheduler instrumentation layer for + the new task that runs when the old one exits. This missing + instrumentation was confusing the Critical Section Monitor logic with + uses this instrumentation to track the state of critical sections. + From Gregory Nutt + - sched_foreach(): sched_foreach() should not have to hold the + critical section over the entire traversal. It should be acceptable + to simply only the critical section while one entry is being + processed (the caller can always call sched_foreach within a critical + section is greater stability is needed). From Gregory Nutt + - task_spawn(): Correct description of input parameters to + task_spawn_exec(). Noted by: JeongchanKim From Gregory Nutt + + * Crypto: + + - crtypo/: This change: + + Avoids the use of up_aesinitialize() entirely, which resolves + dependency problems, because this function does not make sure that + an actual hardware aes implementation was made available: each SoC + is now responsible to ensure the AES hardware is initialized before + first use. This applies to lpc43xx, stm32 and sam34. + + Remove definitions of the NEVER used aes_init and aes_update + operations. The new AES API will be more suitable. + + From Sebastien Lorquet + + * File System/Block and MTD Drivers: + + - opendir(): Corrects a problem with opendir() noted by Petteri + Aimonen in Bitbucket Issue 132: "opendir() fails for FAT filesystem + with trailing slash in path". I see the following behaviour on NuttX + 7.26, where I have SD card mounted on /flash and a directory called + "frm" on it: + + opendir("/flash") returns (DIR *) 0x1000c580 + opendir("/flash/") returns (DIR *) 0x1000c5d0 + opendir("/flash/frm") returns (DIR *) 0x1000c620 + opendir("/flash/frm/") returns (DIR *) 0x0 + + From POSIX specs for opendir(): "A pathname ... that ends with one or + more trailing slashes shall be resolved as if a single dot character + ( '.' ) were appended to the pathname." So for mount points, + opendir() works correctly, but for FAT32 filesystem it fails to open + directory if the path has a trailing slash... + + NOTE: You would not see this problem if you call opendir() indirectly + in NSH (like 'ls -R /') because NSH contains logic to remove trailing + '/' characters from paths. From Gregory Nutt + - dup()/dup2(): dup() and dup2() were broken some time back. + fs_dupfd() was return returning OK on success, not the file + descriptor of the duplicated fd. From David Sidrane + - ProcFS: Remove the unnecessary critical section From Xiang Xiao + - CROMFS: Fix hardfault. From David Sidrane + - SmartFS MTD Driver: Fix smart_write_alloc_sector sector size mapping. + Was not correctly calculating the encoded sector size for small (256) + byte or large (>= 4096 byte) sectors. Noted by Daniel P. Carvalho. + Fix from Ken Pettit + - AT25 MTD Driver: Fixed missing opening parenthesis. From Marc Rosen + - MTD Configdata MTD Driver: Check return value mtdconfig_readbytes(). + From Jussi Kivilinna + - S25FL1 MTD Driver: Minor change for the s25fl1 QSPI FLASH driver which + fixes additional sectorshift vs. pageshift confusion. From Ken Pettit + + * Networking/Network Drivers: + + - All network drivers! Change pre-processor logic that selects the + high priority work queue or gives preferential treatment to the high + priority work. All network logic must run on the low priority work + queue! Or suffer the consequences. From Gregory Nutt + - Socket Clone/Dup: On a failure to start the TCP monitor, the cloned + socket is closed but is not properly freed, leaving it attached to a + TCP connection structure with the wrong reference count. From + Gregory Nutt + - ARP: Fix whitespace after ARPHRD_IEEE80211 in ARP header file. From + Daniel Agar + - 6LoWPAN: Fixes decompression of ipaddr from MAC address. The logic + used to populate the IP from the radio address should match + sixlowpan_ipfromsaddr/sixlowpan_ipfromeaddr From Anthony Merlino + - 6LoWPAN: Fixes logic surrounding the Universal/Local bit. This bit + represents whether the IID is locally/globally administered. The U/L + bit is bit 1 of the MSB of the EUI-64. It should only be inverted in + cases where there is a full EUI-64. In cases where the IID is derived + from say, a short address, this bit should be forced to 0, indicating + that it is locally administered. See: + https://tools.ietf.org/html/rfc4291#section-2.5.1 + https://tools.ietf.org/html/rfc4944#section-6 + https://tools.ietf.org/html/rfc2464#section-4 + From Anthony Merlino + - 6LoWPAN: IEEE802.15.4 stores and uses addresses in little endian + order. From Anthony Merlino + - 6LoWPAN: Address comment regarding avoiding double lookup of address + context. From Anthony Merlino + - 6LoWPAN: Record and restore d_buf on entry/exit of sixlowpan_input. + This avoids an issue where d_buf gets set to NULL by 6LoWPAN, and + then is used by forwarding logic from another network interface + before getting set back to the drivers internal buffer. From Anthony + Merlino + - 6LoWPAN: sixlowpan_input should always return 0 if the incoming frame was + consumed. From Anthony Merlino + - TUN Driver: Fixes a problem reported by Masayuki Ishikwawa: Recently I + noticed that ARP response packet is corrupted when I tried to run + bluekitchen with the latest tun.c in TAP mode. If I revert commit + 8193c28e9126c9cb89042e80d6ebab7485a831e4, then it works again. From Xiang + Xiao + - Telnet Driver: Add missing logic to set read event flags in poll() + method. From Ken Pettit + + * Wireless/Wireless Drivers: + + - BLE: Fix uninitialized variables. From Lwazi Dube + - BLE GATT header file: Fix struct name. From Lwazi Dube + - BLE GATT: Remove unnecessary GATT ioctls From Lwazi Dube + + * Graphics/Display Drivers: + + - ST7032: Fix seek method. Was not taking into account the offset for the + SEEK_END case. Did not account for negative offsets. On errors, it was + clobbering the filep->f_pos setting. From Gregory Nutt + - PCF8574 Backpack: Fix seek method. Had the same problems as noted for + ST7032 driver. From Gregory Nutt + + * Common Drivers: + + - Button Upper Half: Fix two bad NULL checks From Juha Niskanen + - PWM Interface: Remove dependency on CONFIG_PWM for the upper-half + PWM header. This allows compilation for the lower-level PWM drivers + even if the upper-half PWM logic is not used. From Mateusz Szafoni + - Various I2C Drivers: In most I2C drivers, correct upper index value + in I2C trace dump. Eliminates the extra NONE event from the trace + dump output. From Ouss4 + - Battery Gauge: Add missing initialization of semaphore. From Alan + Carvalho de Assis + - Batter Charger: Add missing initialization of semaphore. From Alan + Carvalho de Assis + - MCP73871: Fix Microchip MCP73871 Battery Charger driver to register + correctly as a battery charger. The first element of a 'struct + battery_charger_dev_s' should be a pointer to operations structure. From + Alan Carvalho de Assis + - MCP794xx: Fix MCP794xx driver to wait for OSCRUN and fix tm_year. From + Abdelatif Guettouche + - Numerous files: Fixes usage of CONFIG_BIG_ENDIAN; should be + CONFIG_ENDIAN_BIG From Anthony Merlino + + * ARMv7-A: + + - ARMv7-A MMU: Fix end address calculation for mmu_invalidate_region() API + From Petro Karashchenko + + * ARMv7-M: + + - ITM: Fix missing space causing macro issues From Alan Carvalho de + Assis + - Common Exception Handlers: This commit changes the lazy and non-lazy + exception handler to remove a couple of cpsid instructions from them + on ARMv7-m. If my understanding is correct then these interrupt + manipulations aren't doing anything anyway because prioritization + stops secondary interrupts arriving and, even if they did work, they + would have introduced race conditions for the period of time between + the interrupt arriving and further interrupts being disabled. From + Dave Marples + - MPU/Protected Mode Build: Revert "arch/arm/armv7-m: MPU: + mpu_log2regionceil needs take into account the offset too". Masayuki + Ishikawa reports that this commit breaks ALL PROTECTED mode builds. It + violates the basic requirements of the use of the MPU in protected mode. + Those basic requirements are: + 1. The MPU region must be aligned to the base address of the memory + region being mapped (it may NEVER extend before the memory region). + That is, the following MUST always be zero: (base & ((1 << l2size) - 1)) + 2. The MPU region must never extend beyond the end of the memory region. + That is, the following must be true: size >= (1 << l2size) + From Gregory Nutt + + * Microchip PIC32MX Drivers: + + - PIC32MX Ethernet: Fix a comparison in a debug assertion. Should be + <= vs <. Noted by Anonymous in Bitbucket Issue 134. From Gregory Nutt + + * Microchip PIC32MZ: + + - PIC32MZ chip.h Header: Add a missing " in an error message. From Ouss4 + + * Microchip PIC32MZ Drivers: + + - PIC32MZ Ethernet: Fix a comparison in a debug assertion. Should be + <= vs <. Noted by Anonymous in Bitbucket Issue 134. From Gregory Nutt + + * Microchip/Atmel SAMD21/L21 + + - SAMD21/L21: Corrects behavior of the I2C_M_NOSTART flag. Also adds + a release a bus on RXNACK and corrects typo priv->flags to msg->flags + as priv->flags is never set. From Alexander Vasiliev + - SAMD21/L21: Fix SAMD2L2 arch to use calibrated oscillator value. Now + SAMD20 and SAMD21 should work fine without external crystal. Note that + SAML21 Xplained board has an external crystal and doesn't need this change, + unless you don't want to use the crystal. From Alexander Vasiliev + - SAMD21/L21 I2C Master: Adds calculation of a timeout and disables + interrupts in case of error. From Alexander Vasiliev + + * Microchip/Atmel SAMD21/L21 Boards + + - SAML21-Xplained: Fix removed MAXCOARSESTEP from saml21-xplained board. + From Alan Carvalho de Assis + + * Microchip/Atmel SAMD51/Ex + + - SAMD51/Ex: Alexander Vasiliev's fix to the SAMD21 I2C Master (commit + b1110ba91c549572e94c24ebed202643233deee3) should probably also be + applied to the SAMD51 I2C Master which is identical. From Gregory Nutt + + * Microchip/Atmel SAMV7 + + - SAMV7 Serial: Fix case where TTYS0 is not defined. From Ken Pettit + + * Maxim Integrated MAX326xx + + - MAX326xx: WFI instruction in IDLE loop seems to interfere with + stability. Commented out for now. Needs to be investigated further. + From Gregory Nutt + + * NXP i.MXRT Drivers: + + - i.MXRT FLEXPWM: Correct duplicated definitions From David Sidrane + - i.MXRT SERIAL: Fix TTYS0 defined definitions of higher numbered ports + From David Sidrane + - i.MXRT LPSPI: Removed unused clock, that borked the build. From David + Sidrane + - i.MXRT LPI2C: I2C Reset rework From David Sidrane + + * On Semi LC823450: + + - LC823450: Fix up_allocate_heap() in lc823450_allocateheap2.c. This + change fixes heap size and also implements up_addregion(). From + Masayuki Ishikawa + - LC823450: Fix go_os_start() in lc823450_start.c. I found a bug in + go_os_start() that it returns immediately because it does not compare + r1 to zero. This commit fixes this bug. Also, this commit fixes its + description. From Masayuki Ishikawa + - Other Architectures: Masayuki Ishikawa's change to go_os_start() was + also to all MCU-specific start-up functions that support + go_os_start(). From Gregory Nutt + + * On Semi LC823450 Boards: + + - LC823450-XEVK: Fix IOB params in rndis/defconfig. These parameters + work for HTTP audio streaming. From Masayuki Ishikawa + - LC823450-XGEVK: Change RNDIS MAC address assignment in rndis + configuration. In previous implementation, mac[0] was assigned to + 0xaa for RNDIS host to avoid MAC address conflicts with RNDIS + device.. However, I noticed that this assignment causes a random MAC + address generation on ubuntu16.04 or later which is inconvenient to + set up network interface. This new assignment scheme fixes this + issue. From Masayuki Ishikawa + - LC823450-XGEVK: Fix overlapped memory settings in memory.ld. From + Masayuki Ishikawa + + * STMicro STM32 Drivers: + + - STM32: Remove redundant STM32 family definitions from chip.h header + file. It is already done in arch/arm/src/stm32/Kconfig From Mateusz + Szafoni + - STM32 ADC: There is no DMA CFG bit for the basic IPv1 ADC. From + Mateusz Szafoni + - STM32 ADC: Refactor adc_reset. It should be easier to maintain this + code if it's divided into smaller functions From Mateusz Szafoni + - STM32 F0 Clocking: Fixes the problem in GPIO port clocks. Only port + A clock was enabled although the comment states otherwise. From Juha + Paalijrvi + - STM32 F7 I2C: I2C out of bounds access on priv->msgv. Error in if + statement. It was checking for msgc > 0. If message count is 1, only + index 0 is valid on priv->msgv. Therefore random values in memory + were used to set next_norestart. From David Sidrane + - STM32 H7 I2C: Applied David Sidrane's I2C fix to the identical logic + for STM32 H7. From Gregory Nutt + - STM32 L4 I2C: Applied David Sidrane's I2C fix to the identical logic + for STM32 L4. From Gregory Nutt + + * STMicro STM32 Drivers: + + - STM32 ADC: Fix RCC reset logic. From Mateusz Szafoni + - STM32 ADC: Fix compilation errors for chips with one ADV TIM. From + Mateusz Szafoni + - STM32 DMA: Add missing DMA channel configuration. + - STM32 PWM: STM32 MOE is not being appropriately handled for PWM for + advanced timers. It is only ever reset and so no PWM train is + generated. This change addresses this. Noted by Dave Marples. From + Mateusz Szafoni + - STM32 PWM: Fix compilation errors if the upper-half PWM logic is not + enabled. From Mateusz Szafoni + - STM32 SPI: STM32F446 & STM32F469 correct PC1 SPI assignments From + David Sidrane + - STM32 TIM: Fix compilation error if there is no TIM8. From Mateusz + Szafoni + - STM32 F0: Fix GPIO EXTI lines assignment for STM32 M0. From Mateuz Szafoni + - STM32 F3 I2C: Remove the extra NONE event from the trace dump + output. From Ouss4 + - STM32 F4 I2C: Remove the extra NONE event from the trace dump + output. From Ouss4 + - STM32 F7 I2C: Use clock_t for ticks instead of uint32_t to hold system + time. From Jussi Kivilinna + - STM32 L4 I2C: Use clock_t for ticks instead of uint32_t to hold system + time. From Jussi Kivilinna + + * STMicro STM32 Boards: + + - STM32F429I-DISCO: Fix lvgl demo removing STM32_FB_CMAP. From Alan + Carvalho de Assis + - STM32VL Discovery: Fix SRAM and FLASH size in the linker script. + There is STM32F100RB with 8KB RAM and 128KB FLASH on the STM32VL + Discovery kit. Invalid memory size could cause a hard fault. From + Matous Pokorny + - STM32VL Discovery: Fix memory size configuration and documentation. + There is STM32F100RB instead of STM32F100RC on the STM32 VL Discovery + kit. From Matous Pokorny + - Viewtool-STM32F107: Change RNDIS MAC address assignment in rndis + configuration. In previous implementation, mac[0] was assigned to + 0xaa for RNDIS host to avoid MAC address conflicts with RNDIS + device.. However, I noticed that this assignment causes a random MAC + address generation on ubuntu16.04 or later which is inconvenient to + set up network interface. This new assignment scheme fixes this + issue. From Masayuki Ishikawa + + * TI Tiva: + + - Tiva LM/TM4C Start-Up: Remove option CONFIG_TIVA_BOARD_CLOCKCONFIG. It is + not used and unnecessary. Fix some naming. up_clockconfig() is + inappropriate. Change tiva_clockconfig() to tiva_clock_reconfigure() + then we can change up_clockconfig() to tive_clock_configure(). From + Gregory Nutt + - Tiva LM/TM4C GPIO Interrupts: Fix tiva gpio interrupts From Lwazi Dube + - Tiva LM/TM4C: Improve GPIO interrupt support by removing unnecessary, + hard-coded per-MCU defines and using the existing Kconfig configuration + options instead. From Lwazi Dube + + * TI Tiva Drivers: + + - Tiva TM4C Serial: After commit + 51b78034ac8d1fdf598107bf4093f0beccd5b80b, my tiva console does not + work - enter key produces garbage characters. This commit fixes the + problem for me. From Lwazi Dube + + * C Library/Header Files: + + - include/dsp.h: Fix missing semicolon error in dsp.h From MYAPICI + - include/nuttx/compiler.h: Correct support of C-version-specific features. + Cannot depend on GCC version because -std=c89 may be used on comomand + line. Need instead to use __STDC_VERSION__ to determine if a feature is + supported. Also add conditional support inline, depending on C99. From + Gregory Nutt + - libs/libc/stdio: fread() should always set EOF if fewer than the + requested number of bytes was not read. Per Anthony Merlino. From + Gregory Nutt + + * Build System: + + - sched/irq/Make.defs: Fix warning about irq_csection.o appearing + multiple times in the same rule. From Gregory Nutt + + * Tools: + + - tools/gencromfs.c: "gencromfs.c:1171:3: warning: ignoring return + value of 'asprintf'", declared with attribute warn_unused_result + [-Wunused-result]. From David Sidrane + - tools/gencromfs.c: Fix build on macOS. From David Sidrane + + * NSH Library: apps/nshlib: + + - apps/nshlib: Fixes an error in the NSH parser. There was a bug when + executing an nsh shell script which contains a redirection. When the + command in the script is executed, it sets the vtbl->np.np_redirect flag + (as it should), but then doesn't restore it, leaving it set at the end of + the script execution. Then the vtbl->np.np_redirect flag is set when the + 'sh' command completes, causing a restore from un-initialized variables, + thus leading to a crash. See the code snippet below for an example test + case. + + Test case: + + NuttShell (NSH) + nsh> mkrd -s 1024 40 + nsh> mkfatfs /dev/ram0 + nsh> mount -t vfat /dev/ram0 /tmp + nsh> echo "echo 1 > /dev/null" > /tmp/test.sh + nsh> cat /tmp/test.sh + echo 1 > /dev/null + nsh> sh /tmp/test.sh + ... + + The nsh prompt doesn't get printed. You can type a couple of commands, + but then the system will crash because of bad pointers. From Ken Pettit + - apps/nshlib: Fix buffer overrun when redirected to a file. SAVE_SIZE + must be the same as sizeof(struct serialsave_s). From Masayuki Ishikawa + + * System Utilities: apps/system: + + - system/system.c: Fixes build error; There is no result variable, use + errcode instead. From Anthony Merlino + - apps/system/vi: Bug fixes: + 1. Deletion of last line in file using 'dd' caused infinite loop + searching for 'nextline'. Fixed. + 2. Insertion of line above 1st line using 'O' caused line to be + inserted on 2nd line. Fixed. + 3. Paste buffer from 'dd' was being free'd after the 'p'aste operation, + preventing multiple paste opportunity. Fixed. + 4. The cursor was not being bound to the line end and was allowed to + 'hover' over the '\n' EOL character. This caused wierd (relative to + standard vi) insertion locations and cursor movement with 'a'ppend + and 'i'nsert. Fixed. + 5. The 'vi_shrinkpos' position didn't take the end of file pointer into + account when calculating 'curpos', 'prevpos' variables causing + wierdness when deleting things near the end of the file. Fixed. + 6. The 'yy'ank command was improperly deleting the text from the + document instead of simply yanking to the paste buffer. Fixed. + 7. The 'dd'elete line funciton was not copying the deleted line to the + paste buffer as part of the delete operation. Fixed. + 8. The bottom line of the screen was sometimes being used for document + text and other times for command / find entry. Fixed by reserving + the bottom the bottom line for status / command only. + 9. When scrolling up / down through a file, the cursor position was not + preserved and moved further and further to the left column based on + the line lengths of the lines visited. Fixed. + 10. The display was being COMPLETELY redrawn with each keystroke, + causing the responsiveness to be unbearable. Fixed. Added logic to + dynamicall indicated which portions of the screen need to be updated + (full display, current line to end of screen, current line only, + none). + 11. The individual display line updates were being performed a character + at a time by calling the vi_putch() function, causing slow + performance, especially in telnet or USBCDC sessions where there is + a lot of overhead per packet. Fixed by calling vi_write() instead + with a block of characters with breaks as needed for TAB exansion. + 12. The forward delete 'x' operation allowed deletion through '\n' + characters causing lines to be joined. This is different from + standard vi where 'x' at the end of a line performs a delete + backward operation. Fixed. + 13. When in 'ex' or find sub-modes (':' or '/' bottom line modes), + hitting backspace with empty text did not return the operation to + command mode like it does in standard vi. Fixed. + 14. Performing a 'find' opertation would only search from the current + cursor position to the end of the file and did not wrap like in + standard vi. Fixed. + 15. Loading a file that was larger than the initial text allocation + would force a call to 'vi_extendtext', marking the file as modified + when in fact it hadn't even been loaded yet. Fixed. + 16. Combined vi_insert_mode and vi_replace_mode into a single function + to save code space since they are nearly identical routines. + 17. In command mode, backspace was deleting characters which is + different from standard vi. Backspace in command mode normally + simply moves the cursor left / to the previous line. Fixed. + 18. Added code to handle boundry conditions when the file is new and + commands are applied to an empty file. + 19. Fixed vi_shrinktext so it doesn't allocate a zero-length buffer when + the last character in the file is deleted. + 20. The 'x' command was not copying to the paste buffer. Fixed. + 21. Fixed parsecolon routine to properly deal with ":wq" command sequence. + From Ken Pettit + + * Wireless Utilities: apps/wireless: + + - apps/wireless/bluetooth/btsak: 'bt bnep0 info' outputs a reversed addr. It + should print BDAddr: aa:bb:cc:dd:ee:ff instead of BDAddr: + ff:ee:dd:cc:bb:aa. From Lwazi + - apps/wireless/bluetooth/btsak: Fix some errors in btsak. From Lwazi Dube + - apps/wireless/bluetooth/btsak/btsak_main.c: Fix address parsing. From + Lwazi Dube + - apps/wireless/bluetooth/btsak: Remove unnecessary gatt get commands. From + Lwazi Dube + - apps/wireless/bluetooth/btsak/btsak_scan.c: Fix reversed address. From + Lwazi Dube + - apps/wireless/ieee802154/i8sak: Fixes issues related to re-running + daemon. Releases lock when releasing daemon. Re-sets daemon_shutdown so + that a subsequent daemon launch does not immediately return. From Anthony + Merlino + +NuttX-7.29 Release Notes +------------------------ + +The 129th release of NuttX, Version 7.29, was made on March 25, 2019, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.29.tar.gz and +apps-7.29.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - Configuration: CONFIG_NFILE_DESCRIPTORS=0 can no longer be used to + disable the file system. NuttX with no file system does not make + sense and is no longer supported. From Gregory Nutt. + - Rename most internal OS functions from sched_* to nxsched_* to + indicate that they are NuttX internal functions (some renaming is + still needed). From Gregory Nutt. + - Rename all internal OS functions from task_* to nxtask_* to indicate + that they are NuttX internal functions. From Gregory Nutt. + - Rename sched_process_timer to nxsched_process_timer. Rename + sched_timer_expiration to nxsched_timer_expiration. Rename + sched_alarm_expiration to nxsched_alarm_expiration. Those are the + appropriate names for an internal sched/ function (still many named + incorrectly). From Gregory Nutt. + - Standardize naming: Rename os_start() to nx_start(), rename os_smp* + to nx_smp*, rename os_bringup to nx_bringup, rename all internal + static functions to begin with nx_ vs os_. From Gregory Nutt. + - Initialization: Remove the option CONFIG_BOARD_INITTHREAD. Now, if + CONFIG_BOARD_INITIALIZE is selected, then the board_initialize() + logic will ALWAYS run on an internal kernel thread. This will + prevent the problems people have had doing inappropriate + board_initialization on the IDLE thread. From Gregory Nutt. + - Initialization: Add support for CONFIG_BOARD_EARLY_INITIALIZE. If + this option is selected then nx_start() will call a board-provided + function board_early_initialize() immediately after calling + up_initialize(). Rename board_initialize() to + board_late_initialize(). From Gregory Nutt. + - Signal Delivery: Add a flag to the TCB to indicate that we are in a + signal handler. Use this flag to assure that a there is never + attempts to nest signal handling operations on a thread. This was + guaranteed before but when locking of pre-emption during signal + delivering was eliminated in a previous commit, there was a remote + possibility of an attempt to do nested signal handling. This flag + assures that there is only one signal handled at a time. From + Gregory Nutt. + - Signal Handler Security: The architecture-specific signal handler + return register state is saved and available on the user stack. + This commit reorders some logic so that certain, critical registers + are preserved in the TCB. This eliminates most malicious exploits + which more the return address, for example, but does not make the + logic 100% secure. From Gregory Nutt. + - Timer Interrupt Procssing: Add a configurable call out to a + user-provided function, 'timer hook', on each timer interrupt. From + Gregory Nutt. + - PM Activity: Add pm_staycount() API for get stay numbers. This + function is currently not used and a waste of FLASH space. From ligd. + - Pthreads: Add support for pthread_mutex_timedlock From Leif Jakob. + - Pthread Spinlocks: Add a very preliminary implementation of the new + POSIX pthread_spinlock_* interfaces. From Gregory Nutt. + - Critical Section Monitor: Remove SCHED_IRQMONITOR_GETTIME to + simplify the clock source selection: (1) Use up_critmon_gettime if + SCHED_IRQMONITOR, (2) Call clock_systimespec if SCHED_TICKLESS, (3) + Don't collect timing info for all other cases. From Xiang Xiao. + - Work Queue Notification: Notifier can now work with either lpwork + or hpwork. From Xiang Xiao. + - Protected Build: Add add a new field (us_heapend) to struct + userspace_s that labels the end of the heap. From Xiang Xiao. + + * Binary Loader/Kernal Modules/Shared Libraries + + - Shared Libraries: Implement dlerror() using strerror(). From Xiang + Xiao. + - Shared Libraries: Add LD_LIBRARY_PATH environment variable + support. From anchao. + - ELF Loaders: Optimize elf load speed: (1) Don't zero out memory, + (2) Reduce the initial buffer size to 32 bytes. From Xiang Xiao. + - ARM ELF Relocation: Add support for the R_ARM_THM_JUMP11 relocation + type. This relocation type may be generated when LTO optimization + is enabled. From anchao. + - ELF Modules: Add relocation buffer table to reduce filesystem + access. From anchao. + - ELF Modules: Add symbol buffer table to reduce filesystem access. + From anchao. + + * File Systems/Block and MTD Drivers + + - Filesystem Mount: Move the union inode_ops_u i_mtd field into the + mount section of inode_ops_u and remove the guard to simplify fs + which support both block and mtd. From Xiang Xiao. + - ROMFS: Add support to mount a ROMFS volume using an MTD driver + interface using the standard mount() operation. From Xiang Xiao. + - LittleFS: VFS wrapper improvement: (1) Support block device + interface, (2) support ioctl, stat and sync file operation, (3) + support forceformat and autoformat option, (4) update file->f_pos + and dir->fd_position, (5) remove the internal struct from dir, and + (6) remove mtd byte read/write requirement. From Xiang Xiao. + - UnionFS: Support mount of UnionFS from the NSH command line. From + Xiang Xiao. + + * Networking/Network Drivers: + + - UsrSock: Add mutual exclusion so that only user can perform a + socket request From zhangyuan7. + - UDP: Initialize callback address structure to avoid random values + in padding. From anchao. + + * Wireless/Wireless Drivers: + + - SX127x: Initial support for SX127x LoRA radio From Mateusz Szafoni. + + * Graphics/Display Drivers: + + - Graphics: Fix a naming collision: Ye olde nx_start that started + the NX graphics is now nxmu_start(). nxmu_start() is now + prototyped in nxmu.h (instead of nx.h). From Gregory Nutt. + - NX Server Startup: Extend nxmu_start() so that receives a display + number as an argument. This makes it possible to have multiple + instances of the NX server running on boards that support multiple + displays. Also includes updates to boardctl() to accept display + number paramters. From Gregory Nutt. + - Graphics: nx_openwindow() and nxtk_openwindow() now accept an + additional 'flag' parameter. This argument is current used only to + select a RAM backed, per-window framebuffer. From Gregory Nutt. + - Per-Window Framebuffers: Windows may now be optionally created + with a RAM frambuffer backing up the window content. Rending into + the window will result in rending into the backup framebuffer, then + updating the physical display from the framebuffer. The advantage + of this option is that the application that manages window will no + longer receive redraw() callbacks. Those calls normally occur when + a window "above" moves exposing a portion of the window below. If + this option is selected, then the system will redraw the exposed + portion of the window from the backup framebuffer without + intervention of the window applications. This greatly reduces the + complexity of the application and performance of the window at the + expense of increased memory usage. Redraw requests in other cases + are also suppressed: Changes to window position, size, etc. As a + consequence, some manual updates will be required when certain + events occurr (like removing a toolbar from a window). NOTE: A + significant amount of RAM, usually external SDRAM, may be required + to use per-window framebuffers. + + * Other Common Device Drivers: + + - Driver Notifications: Support signal notification through + SIGEV_THREAD in all drivers that provide signal notifications: + RTC, Joysticsks, buttons, Zero-Crossing, wireless, FT80x, Timer, + PHY. From Xiang Xiao. + - Watchdog Driver: Support auto-monitor service From Gregory Nutt. + - Timer and Alarm Drivers: Implement up_critmon_gettime and + up_critmon_convert and remove the critical section from + current_usec to infinite recursion. From Xiang Xiao. + - RTC Driver: Protect the RTC state with a semaphore. From Xiang + Xiao. + - Serial Upper Half: Call pm_activity() when characters are received + on a console device. From Gregory Nutt. + - MPU60x0: Initial support for TDK InvenSense MPU6000 and MPU6050 + 6-axis gyroscope and accelerometers. This commit supports SPI + media only. From Bill Gatliff. + - EEPROM Driver: Add configurable SPI eeprom frequency. From + Valmantas Paliksa. + - GPIO Driver: Support reading and writing gpio pins using cat and + echo. From Valmantas Paliksa. + - MCP2515: Add MCP2515 clock input config to KConfig. From + Valmantas Paliksa. + - MAX7456: Support for the Maxim MAX7456 on-screen-display chip. + From Bill Gatliff. + + * Common Board Logic: + + - boardctl(): up_testset() can now be accessed by applications via + the boardctl() interface rather than attempting to call it + directly. pthread Spinlocks are not available unless the + architecture supports the up_testset() operation. From Gregory + Nutt. + - boardctl(): Add support for BOARDIOC_NXTERM which can be used to + create an NxTerm terminal. From Gregory Nutt. + - boardctl(): Add boardctl() commands to replace direct calls to + nxterm_redraw() and nxterm_kbdin(). From Gregory Nutt. + + * Microchip PIC32MZ Drivers: + + - PIC32MZ Timers: Add support for the PIC32MZ timers (driver, + lowerhalf, freerun and oneshot) From Abdelatif Guettouche. + + * Common ARM Options: + + - arch/arm: Move FPU options to a common place and unify the usage + by removing ARCH_CORTEXRxF. From Xiang Xiao. + - arch/: Unify the cache interface for all architectures that + support a data cache. From Xiang Xiao. + - ARMv7-M/A/R: Add a architecture-specific new barriers.h header + file that provides the memory barrier definitions that were + previously in the (now unified) cache.h header files. From Gregory + Nutt. + + * ARMv7-A + + - ARMv7-A: Support thumb mode and fix interworking issue. From + zhangyuan7. + - ARMv7-A: Add weak attribute to arm_data_initialize so platform + could provide the new implementation as needed. From zhangyuan7. + - ARMv7-A: Add SCR bit definitions. From Xiang Xiao. + - ARMv7-A: Add mmu_l1_map_regions() to remove the code duplication. + From Xiang Xiao. + - ARMv7-A: Add the initial cortex-a7 architecture support From + zhangyuan7. + + * ARMv7-M + + - ARMv7-M: stackcheck allow faulting stack calculation to make it to + the up_assert reg dump From David Sidrane. + + * Microchip/Atmel SAMD21/L21 Drivers: + + - SAMD2/L2: Add RS485 support to SAMD2L2 serial. From Alan Carvalho + de Assis. + + * Misoc: + + - Minerva: Add support for the Minerva architecture. From Ramtin + Amin. + + * Misoc Boards: + + - misoc: Add support for an NSH configuration using the Verilator + board. From Ramtin Amin. + + * Nordic NRF52: + + - NRF52: 1. Added 52840 family support 2. Use common IRQ and memory + layout header file for 52832 & 52840. From Levin Li. + + * Nordic NRF52 Drivers: + + - NRF52 RNG: 1. added RNG device driver 2. added errdata to correct + temp which will be used by RNG module 3. use general task_trigger / + event_clear inline api for all driver. From Levin Li. + + * NXP i.MX RT Drivers: + + - i.MXRT XBAR: Add XBAR Support. From David Sidrane. + - i.MXRT USB: Add USB analog header file. From David Sidrane. + - i.MXRT OCOTP: Added OCOTP Support. From David Sidrane. + - i.MXRT LCD: Adds framebuffer support for the i.MXRT 1050. + Includes DCD initialization for SDRAM to provide space for the + framebufer. External code I used/ported is from NXP and is BSD + 3-clause license. From Johannes. + + * NXP i.MX RT Boards: + + - IMXRT1050-EVK: Adds framebuffer support for the i.MXRT 1050. + From Johannes. + + * NXP LPC17xx + + - LPC17xx: Add a configuration option to skip over the framebuffer + when adding DRAM to the heap. From Gregory Nutt. + + * NXP LPC17xx Boards + + - Open1788: Add a configuration to test NxTerms in the PROTECTED + mode. From Gregory Nutt. + - Open1788: Re-arrange PROTECTED mode link map to make more space + for large kernels with debug enabled. From Gregory Nutt. + - Open1788: Add a configuration for testing per-window frame buffers + using apps/examples/pwfb. From Gregory Nutt. + + * NXP LPC54xx Boards + + - LPCXpresso-LPC54628/pwfb: Add per-window framebuffer configuration + using apps/examples/pwfb. From Gregory Nutt. + - LPCXpresso-LPC54628: Add a configuration for addition per-window + framebuffer using apps/examples/pwlines. From Gregory Nutt. + + * STMicro STM32 Drivers: + + - STM32F0/L0 SPI: Add SPI support for F0. From Mateusz Szafoni. + - STM32 ADC, PWM and TIM: (1) configure injected channels external + trigger when ADC enabled, (2) update injected conversion queue of + context after configuration, (3) support for offset configuration, + and (6) support for advanced timers channel 5 and 6. From Mateusz + Szafoni. + - STM32 DFU Mode: Add logic to reboot the STM32 in DFU mode. + Current implementation only works for STM32F2 and F4. From Bill + Gatliff. + - STM32F7 LSE: Add configuration of LSE oscillator drive capability + From Jussi Kivilinna. + - STM32F7 I2C: Fix another memory access issue on a bus error. From + David Sidrane. + - STM32F7 TIM: Add OUTTOGGLE mode for STM32f7 timer From Valmantas + Paliksa. + - STM32F7 Timer Lower Half: Add timer lowerhalf driver for stm32f7. + From Valmantas Paliksa. + - STM32F7 ITM: Add ITM syslog support. From Valmantas Paliksa. + - STM32F7 CAN: Add CAN driver with support for three bxCAN + interfaces. From Valmantas Paliksa. + - STM32F7 QSPI: Add stm32f7 Quad SPI support. From Valmantas Paliksa. + - STM32L4 LSE: Ports Jussi Kivilinna's recent STM32F7 LSE change to + STM32L4. From Juha Niskanen (Haltian). + - STM32H7 I2C: Apply David Sidrane's fix for the STM32F7 to the + STM32H7. From Gregory Nutt. + - STM32H7 DMA: Rename DMA1/2 IRQ names to match those from other + STM32. Add auxiliary definitions. Add DMAMAP definitions for + MDMA, DMA1, DMA2 and BDMA. Add some address blocks. Change RCC + definitions to match other STM32 ports. Enable clock for MDMA and + BDMA. Rename DMA channel definitions. Separated files for MDMA, + DMA, BDMA and DMAMUX. Add missing definitions for MDMA, BDMA and + DMAMUX. SPI DMA mode. Add base addresses for D1, D2 and D3 + domain; use 2 bytes to specify memory region. Add D1 domain core + prescaler configuration. From Mateusz Szafoni. + - STM32H7 OTG: Initial OTG support for STM32H7 and some minor + improvements. Add support for HSI48 clock. From Mateusz Szafoni. + - STM32H7 Build: Initial support for protected build mode. From + Mateusz Szafoni. + - STM32L4 I2C: Apply David Sidrane's fix for the STM32F7 to the + STM32L4. From Gregory Nutt. + + * STMicro STM32 Boards: + + - B-L072Z-LRWAN1: Add SX127x configuration. From Mateusz Szafoni. + - Nucleo-F091RC: Add support for SX127x radio. From Mateusz Szafoni. + - Nucleo-F091RC: Add SX127x configuration. From Mateusz Szafoni. + - Nucleo-F207ZG: Add support for USB and initialize CDCACM if + configured. From Mateusz Szafoni. + - STM32F429I-DISCO: Add an apps/examples/examples/nxhello + configuration. From Gregory Nutt. + - Nucleo-F446RE: Add support for the Nucleo F446RE. From Sebastien + Lorquet. + - B-L072Z-LRWAN1: Use HSI as default clock source. From Mateusz + Szafoni. + - Nucleo-L073RZ: Add SX127x configuration. From Mateusz Szafoni. + - Nucleo-L073RZ: Port button logic from nucleo-f072 which appears to + be the same. From Gregory Nutt. + - Nucleo-L432KC: Add support for I2C driver initialization. From + Nikolay Semenov. + - Nucleo-H743ZI: Add support for USB and initialize CDCACM if + configured. From Mateusz Szafoni. + - OmnibusF4: Initial support for the OmnibusF4 family of flight + management units. "OmnibusF4" is not a product name per se, but + rather a design spec that many product vendors adhere to. The spec + defines the major components, and how those components are wired + into the microcontroller. Airbot is one such vendor, and they + publish a schematic here: http://bit.ly/obf4pro. Other software + that supports the OmnibusF4 family include Betaflight, iNAV, and + many others. PX4 recently added support as well, using their own, + non-upstreamed, bespoke port of NuttX. No code from those resources + is included in this port. From Bill Gatliff. + - OmnibusF4: Add MAX7546 support. From Bill Gatliff. + + * TI CCxx: + + - CC1312R1: Code complete and builds successfully. Stalled on + further radio development. I planned to integrate the IEEE 802.15.4 + radio interface, but the Cortex-M0 interface is not available with + an open license. + + * TI CCxx Boards: + + - LaunchXL-CC1312R1: Add support for on-board LEDs and buttons. The + LauchXL-CC1312R1 NSH Configuration is now fully functional. From + Gregory Nutt. + - LaunchXL-CC1310: Clone LED and button support from the + LaunchXL-CC1312R1. The number of LEDs and buttons as well as DIO + usage is identical (Still not functional). From Gregory Nutt. + + * Tools: + + - tools/rmcr.c: Add a tool to remove carriage returns and dangline + whitespace at the end of lines. From Gregory Nutt. + - tools/nxstyle.c: Can now detect if the C comment closing is not on + a separate line. From Gregory Nutt. + - tools/nxstyle.c: Make sure that all files begin with a comment on + line 1 (which should be the file header). From Gregory Nutt. + - tools/nxstyle.c: Add check for multiple definitions of local + variables on a line. From Gregory Nutt. + - tools/nxstyle.c: Beef up logic that detects multiple variable + definitions per line. From Gregory Nutt. + - tools/nxstyle.c: Add capability to detect CamelCase identifiers. + From Gregory Nutt. + - tools/nxstyle.c: Add logic to detect a blank line following a left + brace or a blank line preceding a right brace. From Gregory Nutt. + - tools/nxstyle.c: Don't complain about certain lowercase characters + in otherwise uppercase pre-processor identifers: IPv6, IPv4, + ICMPv6, IGMPv2, p as a decimal point, d signifying a divisor. It + was a bad idea to let the door open a crack for there. While they + improve readability, the inconsistently also causes other + problems. From Gregory Nutt. + + * Build System: + + - Makefiles: Modify tools/Makefiles to add a "Do not Edit" warning + on defconfig files From Alan Carvalho de Assis. + + * Libraries/Header Files: + + - lib_vsprintf() (Nano): Add newlib-nano lib_vsfprintf has been + added and is now the default support for the printf family. This + fprintf code was originally adapted from AVR libc and provides + improved floating point output support, including 'g' mode and + making 'f' mode include digits past the decimal by default. The + newlib version can be found here: + https://salsa.debian.org/electronics-team/toolchains/newlib-nano. + That project is GPL overall, but the newlib-nano printf portions + are BSD licensed as described in the COPYING.NEWLIB file. From + Keith Packard. + - lib_vsprintf() (Nano): Added support for long lont types. From + Johannes. + - lib_vsprintf() (Nano): Added hh type modifier (without extending + the flag variable). From Johannes. + - lib_vsprintf() (Nano): Adds configurable support for numbered + arguments. From Johannes. + - lib_vsprintf() (Nano): Cleaned naming and allow for leading zeros + in argument number (which doesn't make sense but should be). From Johannes. + - lib_vsprintf() (Legacy): Add support for %g format which, for + these purpose, is equivalent to %f except that trailing zeroes are + suppressed. From Gregory Nutt. + - vscanf(): Moved vscanf logic to lib_sscanf.c Switched to stream + interface (tricky, because the old implementation used massive read + ahead, which isn't suitable for streams, chars already read are + gone). Added hh, h, and ll modifiers. From Johannes. + - scanf() and fscanf(): Added scanf and fscanf based on enhanced + vscanf(). From Johannes. + - uname(): Add build date and time to uname output (like Linux). + From Gregory Nutt. + - strsep(): Add strsep BSD/Linux function. From Xiang Xiao. + - netdb: Hostname support no longer depends on CONFIG_NET since the + host name is also useful in the non-network environment. + CONFIG_NET_HOSTNAME changed to CONFIG_LIB_HOSTNAME. From Xiang Xiao. + - netdb: Support the nameserver change notification then we can pass + DNS info from server to client in usrsock case. From Xiang Xiao. + - include/fixedmath.h: Add macros for conversion between types + b16_t and type double From Gregory Nutt. + - include/limits.h: Define NL_ARGMAX (as well as some of the other + 'invariant values' per + http://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html). + From Johannes. + - linclude/limits.h: Add 'range 9 999999' to CONFIG_LIBC_NL_ARGMAX + to Kconfig. Per OpenGroup.org, the minimum value for NL_ARGMAX is + 9. From Gregory Nutt. + - include/nuttx/lcd/edid.h: Add extended EDID block IDs From + Gregory Nutt. + + * apps/ General: + + - apps/: Follow up the kernel signal-related change in various files + under examples/ and graphics/. From Xiang Xiao. + - apps/: Update for corrected name of standard header file. Should + be dlfcn.h, not dllfcn.h. From Gregory Nutt. + - apps/: The file system can no longer be disabled. Remove all + conditional logic based on CONFIG_NFILE_DESCRIPTORS==0 From + Gregory Nutt. + - apps/: Remove/replace all conditional logic based on + CONFIG_NSOCKET_DESCRIPTORS == 0. That value is always greater than + zero now. In places just replace with #ifdef CONFIG_NET. From + Gregory Nutt. + - apps/: Some updates due to NuttX renaming: + CONFIG_BOARD_INITIALIZE is now CONFIG_BOARD_LATE_INITIALIZE; + board_initialize() is now board_late_initialize(). From Gregory + Nutt. + - apps/: Graphics interfaces nx_openwindow() and nxtk_openwindow() + now accept an additional 'flag' parameter. From Gregory Nutt. + + * NSH: apps/nshlib: + + - apps/nshlib/nsh_netinit.c: Update for changes to signal + notification structures. From Gregory Nutt. + + * Examples/Tests: apps/examples: + + - apps/examples/ini_dumper: New example program. ini_dumper is + example program that dumps content of ini file in pretty ascii table. + It is using inih ini library in fsutils/inih. From Michal Lyszczek. + - apps/examples/modbusmaster: Add Simple Modbus master example. + This example only supports Read/Write HoldingRegisters, but it is + easy to extend it to support Read/Write Input/Coils/etc. + Originally creatd by Vytautas in 2016 and updated with minor fixes + for this commit. From Alan Carvalho de Assis. + - apps/examples/pwfb: Added a test/example at apps/examples/pwfb + that was used for initial testing of the per-window framebuffer + feature. From Gregory Nutt. + - apps/examples/pwlines: Added another a test/example at + apps/examples/pwlines that was used for further testing of the + per-window framebuffer feature. From Gregory Nutt. + - apps/examples/sx127x: Add sx127x demo From Mateusz Szafoni. + + * File System Utilities: apps/system + + - apps/fsutils/inih: New package. inih (INI Not Invented Here) is a + simple .INI file parser written in C. + https://github.com/benhoyt/inih. From Michal Lyszczek. + + * Network Utilities: apps/netutils: + + - apps/netutils/codecs/: Remove the big Base64 stack array. From + Xiang Xiao. + - apps/netutils/codecs/: Add base64_[de|en]code_length() API From + ligd. + + * System Utilities: apps/system + + - apps/system/cfgdata: Make builtin task stack size and priority + configurable. Set default to 2048 (from 1024) per recommendation + of Ken Pettit. From Gregory Nutt. + - apps/system/embedlog: Update to version 0.4.0. From Michal Lyszczek. + - apps/system/nxplayer and nxrecorder: Change 'int prio' to + 'unsigned int prio'. Required by changes to MQ function + prototypes. From Michal Lyszczek. + - apps/system/psmq: New package. psmq is publish subscribe message + queue. It's a set of programs and libraries to implement + publish/subscribe way of inter-process communication on top of + POSIX message queue. From Michal Lyszczek. + - apps/system/zmodem: Switch to the raw mode before transfer and + restore to the original setting after finishing the transfer. From + Xiang Xiao. + + * Testing: apps/testing: + + - apps/testing/: Move all file system tests from examples/ to + testing/ (cxxtest, fstest, nxffs, smart, smart_test, smp). From + Gregory Nutt. + - apps/testing/cxxtest: Add a README file. From Gregory Nutt. + - apps/testing/ostest: Add test of pthread_mutex_timedlock() From + Gregory Nutt. + - apps/testing/ostest: Fix several errors in the setvbuf() test. + From Gregory Nutt. + - apps/testing/scanftest: Port of Greg King's scanf test + (https://github.com/cc65). From Johannes. + + * Tools: apps/tools: + + - apps/tools/check-hash.sh: Add a tool check hash on downloaded + packages. From Michal Lyszczek. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Signals: Restructure nxsig_deliver() so that the signal handler is + not called with the pre-emption disabled (or, at least no with + pre-emption disabled by nxsig_deliver() itself). From Gregory Nutt. + - Critical Section Monitor: Move up_critmon_* to arch.h avoid the + duplicated declaration. From Xiang Xiao. + - Assertions: Architecture-specific assertion logic should dump CPU0 + IDLE stack only when PID equals 0. IDLE threads of other CPUs do + not need this special check. From Xiang Xiao. + - Message Queues: Change 'int prio' to 'unsigned int prio'. + According to open group specification, priority field in mq_* + functions should have unsigned type: + http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/mqueue.h.html. + From Michal Lyszczek. + - Timer Expiration: Fix macro SEC2TICK() 32-bits overflow by using + uint64_t in calculation. From ligd. + - Kernel Memory Manager: In mm/kmm_heap/kmm_kernel.c, remove unused, + duplicated kmm_heapmember(). From Xiang Xiao. + - User Memory Manager: Ensure all user allocation try sbrk before + fail From Xiang Xiao. + - waitid(): Could exit without leaving critical section on some + error conditions. From Gregory Nutt. + - IOBs: iob_allocwait() should decrease semcount manually. From + Xiang Xiao. + - IOBs: iob_copyin() should wait for each buffer and adjust the + return value of iob_copyin_internal return to simplify the code + From Xiang Xiao. + - IOB Notifier: Don't check iob_navail in iob_notifier_setup to + avoid a potential race condition. From Xiang Xiao. + - IOB Debug Dump: Format the whole line before log to avoid the + multiple timestamp prefix in each line. From Xiang Xiao. + - SHM: Convert bytes to pages by MM_NPAGES instead of MM_PGALIGNUP + From Xiang Xiao. + - SHM: shmget() should hould call shm_extend() to allocate the + physical memory. From Xiang Xiao. + - Page Allocator: mm/pgalloc: shouldn't just allocate one page + always. From Xiang Xiao. + - Granule Allocator: Fix the wrong data in g_1bit_info and make the + internal function static. From Xiang Xiao. + - srbk(): Fix a backward conditional test. Should call + mm_initialize() when brkaddr equal zero From Xiang Xiao. + - sbrk(): Pass ARCH_HEAP_VEND as maxbreak argument From Xiang Xiao. + - ELF Headers: Move elf related arch function to include/nuttx/elf.h + because the implementation is located in libs/libc/machine and in + order to avoid the conflict with the 3rd party libraries and clean + up the file inclusion: (1) Remove redundant elf32.h, (2) Remove + nuttx/binfmt/elf.h in libs/libc/machine, (2) Remove + nuttx/binfmt/elf.h in modlib, and (4) Rmove nuttx/module.h in + modlib. From Xiang Xiao. + - ELF Executables: If there is an address environment + (CONFIG_ARCH_ADDRENV), binfmt/elf doesn't need to free ctor/dtor + alloc since freeing the address environment releases the heap + automatically. From Xiang Xiao. + - ELF Configuration: Correct libcxx exception handling by + introducing the generic config(CXX_EXCEPTION and CXX_LIBSUPCXX) + From Xiang Xiao. + - ELF Loaders: Call umm_initialize as soon as possible otherwise + elf_loadctors/elf_loaddtors may fail to allocate memory. From + Xiang Xiao. + + * Crypto: + + - Crypto AES: After NuttX 7.28 crypto/aes.c would no longer + compile. From Gregory Nutt. + + * File System/Block and MTD Drivers: + + - open(): Fix not returning failure for block_proxy() call. From + David Sidrane. + - AIO: aio_cancel() needs to signal caller after success. Also fix + minor issue in the error handler. From Xiang Xiao. + - HostFS: Remove the unnecessary use of host_stat() in + hostfs_bind() From ligd. + - LittleFS: Fix a minor issue found in code review: (1) Replace + printf to finfo/fwarn/ferr, (2) Replace malloc/free to + kmm_malloc/kmm_free, (3) define LFS_NAME_MAX to NAME_MAX, (4) Check + the big endian using CONFIG_ENDIAN_BIG. From Xiang Xiao. + - LittleFS: VFS Lookahead should use bit unit not byte unit. From + Xiang Xiao. + - NxFLAT: Correct a double free debug assertion. This occurs when + groups are enabled: (1) once via binfmt_exit and unload_module, + and (2) once via sched_releasetcb(). this was corrected by adding + logic to free/unload the memory once and nullify the pointer so + that cannot be freed a second time. This commit resolves Bitbucket + issue #145. From Valmantas Palika. + - NxFLAT: File descriptor leaks when nxflat loading fails. From + Valmantas Palika. + - ProcFS: Fix typo in procfs uptime logic. From Sebastien Lorquet. + + * Networking/Network Drivers: + + - Network Configuration: The setup seems to support a network + without sockets (CONFIG_NSOCKET_DESCRIPTORS == 0). That is not the + case; if the network is enabled, sockets must be provided. From + Gregory Nutt. + - Networking: The value ERROR should never be returned from internal + OS functions. That is reserved for returning values to appliations + with the errno value set. Within the OS, errors are returned with + a negated errno value ALWAYS. From Gregory Nutt. + - Networking: The struct in_addr doesn't have the member sin_addr. + The function lib_lo_ipv6match() is for IPv6. Correct the function + it calls from lib_lo_ipv4matchto() to lib_lo_ipv6match(). Also add + CONFIG_NET_IPv6 for configuration. From Kejun ZHOU. + - TCP (buffered) send: Fix assertion crash when window size is + zero. From Gregory Nutt. + - ICMP/ICMPv6: Bind icmp callback from device to connection. + Resolves the issue that bind() could not be called before send() + From anchao. + - TUN/TAP Driver: Re-order all TUN/TAP driver state data. Not only + was was with wasting memory due to alignement requirements, it was + also causing network packet buffers to be improperly aligned + causing problems because the network requires 16-bit packet buffer + alignment for uint16_t accesses. This alignment problem was + discovered by Alan Carvalho de Assis. From Gregory Nutt. + - TUN/TAP Driver: Packet buffer size should include the configured + GUARD_SIZE. And, given how the buffers are allocated, the + allocation size must be an even number of 16-bit values to preserve + alignment. From Gregory Nutt. + - Local Sockets: In local_connect(), initialize lc_result before + giving lc_waitsem From zhangyuan7. + - Local Sockets: Fixed deadlock issue by replacing nxsem_wait() with + net_lockedwait() so that we do not wait with the network locked. + From zhangyuan7. + + * Graphics/Display Drivers: + + - NX Graphics: Remove naming associated with the now non-existent + NXFE graphics layer: Rename nxfe_reportposition to + nxmu_reportposition. Rename nxfe_redrawreq to nxmu_redrawreq. + Rename nxfe.h to nxmu.h. Rename nxfe_state_s to nxmu_state_s. + Rename nxfe_conn_s to nxmu_conn_s. From Gregory Nutt. + - NxTERM: Remove the nxterm_unregister interface. The correct way + to unregister a device is to unlink it. From Gregory Nutt. + - NxTerm: Needs to clear display initially. Otherwise, garbage from + previous display may still be present from preceding NxWM window. + From Gregory Nutt. + - Font Cache: Fix a memory leak in the font cache. With a busy + NxTerm display, this could drain off all the memory pretty quickly! + From Gregory Nutt. + - Graphics: Nothing under graphics/ should set the errno. From + Gregory Nutt. + - Graphics: Fix a coordinate system error in nx_filltrapezoid(). + When no clipping rectangle is falls, it falls back to use the + entire window as for the clip. However, that window must then then + be in window relative coordinates, not in absoute device + coordinates. From Gregory Nutt. + + * Common Board Logic: + + - boardctl(): Fix compiling error when set + CONFIG_BOARDCTL_IOCTL/CONFIG_BOARDCTL_UNIQUEID. From Kevin Liu. + + * Common Drivers: + + - INA3221: Fix errors in INA3221 register field addresses and + bitfield values. Signed value was losing its signed-ness due to + use of unsigned type for register. From Ken Pettit. + - Serial Upper Half: Initialize OPOST and ONLCR in uart_register. + From Xiang Xiao. + - Serial Upper Half: Don't reset the circular buffer on close since + DMA may still be transferring data in the background if the user + closes the handle too quickly and the handle is opened with + O_NONBLOCK. From Xiang Xiao. + - 16550 UART: Fix error: 'g_uart0port' undeclared. From Xiang Xiao. + - 16550 UART: Fix typo for UART1 flow field initialization From + Gregory Nutt. + - CDC/ACM HCD: Fixes to the IOCTL method in recovery of UART pointer + and in names of Termios-related field. From xhbm. + - USB Device: Fix type for USBDEV_TRACE_INITIALIDSET in Kconfig. + From Mateusz Szafoni. + - TCA64xx: Fix some errors in the TCA64XX driver. From Bruno + Schwander. + - SYSLOG RAMLog: Fix error: Conflicting types for 'ramlog_addchar' + From Xiang Xiao. + - NRF24L01: Fix uninitialized irq_work which was causing a + hard_fault on interrupt handler whenever something was sent from + nrf24l01_term From Petri Ahonen. + - MCP2515: Use kmm_zalloc to allocate device state structure. Fix + some compiler errors. From Valmantas Paliksa. + + * Architecture Common: + + - arch/ Common: Remove architecture-specific watchdog.h and + arm-elf.h because they are empty. The arm-elf header file was + never used; the empty watchdog.h header file was used in only one + place. From Xiang Xiao. + - arch/ Common: Move up_pminitialize() after timer_initialize() + From ligd. + - arch/ Common: Align semi-hosting call style with other syscalls in + architecture-specific syscall.h. From Xiang Xiao. + - arch/ Common: Every file that uses serial IOCTLs (TIOC*) must + explicity include nuttx/fs/ioctl.h. This was included previously + via sneak path in the now deleted arch/serial.h. From Gregory Nutt. + - arch/ Interfaces: Rename sched_process_cpuload to + nxsched_process_cpuload. All internal sched_ functions should be + prefixed with nx. From Valmantas Paliksa. + + * ARMv7-A: + + - ARMv7-A MMU: Updating the cp15_wrttb and cp15_wrdacr functions to + use inline assembly in the correct way. The incorrect method was + generating errors as ARMv7-a expects the MCR/MRC instructions to + provide registers as an argument(MRC p15, 0, , c2, c0, 0) and + the code was providing a constant value(and hence the build + error). From Bilal Wasim. + - ARMv7-A: Remove inclusion pg_macros.h for armv7-a since this + header file does not exist. From zhangyuan7. + - ARMv7-A: Guard some assembly files if configuration not selected. + From zhangyuan7. + - ARMv7-A GIC: Fix assemble error when including gic.h From Xiang + Xiao. + - ARMv7-A GIC: Don't use GIC_ICDDCR_ENABLEGRP1 for GIC NONSECURE + since this bit doesn't exist in this mode. From liuzhuang. + + * ARMv7-R: + + - ARMv7-R Syscall: In arch/arm/include/syscall.h, add missing + inclusion of arch/armv7-r/syscall.h for Cortex-R. From Xiang Xiao. + + * ARMv7-M: + + - ARMv7-M Initialization: As noted by Roland Takacs in Bitbucket + issue 141, there is a compilation error for STM32 if CONFIG_NET and + CONFIG_NETDEV_LATEINIT are selected. That was due in part to the + commit which extended up_netinitialize() with a + !defined(CONFIG_NETDEV_LATEINIT) guard but did not add the guard to + concrete implementations. I say "in part" because I don't think + that the original intent of commit 19e16cb was to enable an + alternative initialization of MCU internal Ethernet support but + rather to enable support of external Ethernet devices that may have + dependencies on, for example, SPI. However, this is still a proper + fix to avoid the compilation error that can occur with this + combination of configuration options. From Gregory Nutt. + - ARMv7-M Configuration: ARCH_HIPRI_INTERRUPT shouldn't select + ARMV7M_USEBASEPRI. First because that is a violation of the + layered nature of the Kconfig architecture, but also because then + Kconfig will generate errors when high priority interrupts are used + with other architectures. From Xiang Xiao. + - ARMv7-M Vector Table: Make the default NVIC_VECTAB_TBLOFF_MASK + safer. The base address of the new vector table must be aligned to + the size of the vector table extended to the next larger power of + 2. From Xiang Xiao. + - ARMv7-M RAM Vectors: Correct bad NVIC_VECTAB_TBLOFF_MASK + definitions in previous commit. Were missing bits in the mask. + Raised DEBUGASSERT in armv7-m/up_ramvec_initialize.c line: 144. + From Mateusz Szafoni. + + * Expressif ESP32 Drivers: + + - ESP32 Timer ISR: Fix backward comparison. From Gregory Nutt. + - ESP32 Serial: Fix some backward arguments. Correct 2-stop bit + setting. From Gregory Nutt. + + * Microchip/Atmel SAMD2x/L2x Drivers: + + - SAMD2/L2 Serial: SAMD2/L2 serial driver. It needs + sam_usart_enable(). to work From Alan Carvalho de Assis. + + * Microchip/Atmel SAMD3/4 Drivers: + + - SAM3/4 Ethernet: Port Anthony Merlino's SAMv7 fix to similar + Ethernet driver for the SAM3/4. From Gregory Nutt. + + * Microchip/Atmel SAMV7 Drivers: + + - SAMv7 SPI: Fix DMA Tx/Rx timeout issue. From Kevin Liu. + - SAMv7 QSPI: Compile error when set CONFIG_SAMV7_QSPI_DLYBCT. + From Kevin Liu. + - SAMv7 Ethernet: The logic for determining the number of queues for + SAMV71 must be extended. All SAMv7 parts increase the number of + queues from 3 to 6 at revision B, not just the SAMV71. From + Gregory Nutt. + - SAMv7 Ethernet: Fixes rxdesc index logic to handle Buffer Not + Available (BNA) condition. If a SOF is found, but no EOF, don't + move past the frame. Instead, keep the index at the SOF buffer + until the rest of the data is written. This fixes a receiver + lockup condition where the peripheral and this driver get out of + sync with there head pointers. In this case the driver has moved + past buffers it owns, without clearing ownership, which results in + the peripheral and driver in a deadlock with each other. From + Anthony Merlino. + + * Microchip/Atmel SAMA5Dx Drivers: + + - SAMA5Dx Ethernet: Port Anthony Merlino's SAMv7 fix to similar + Ethernet driver for the SAMA5Dx. From Gregory Nutt. + + * Microchip/Atmel SAMA5Dx Board: + + - SAMA5D2-XULT: Move console from FLEXCOM4 to UART1. FLEXCOM4 does + not work for the Arduino serial. UART1 is used with the VCOM + provided by the EDBG. From Gregory Nutt. + + * NXP i.MXRT: + + - i.MXRT Clock Configuration: If SDRAM is actived it was only + running at 40MHz. This was becaus imxrt_clockconfig.c changed the + SEMC clock divider after the DCD was configured. This commit + corrects that. From Johannes. + + * NXP i.MXRT Drivers: + + - i.MXRT GPT: Correct register offsets. From David Sidrane. + - i.MXRT TMR: Fix addressing and restructure using common offset. + From David Sidrane. + - i.MXRT ADC: Error in offset. From David Sidrane. + + * NXP/Freescacle Kinetis Boards: + + - Teensy-3.x: Fix a mismatch in types in defconfig. From Gregory + Nutt. + + * NXP LPC17xx: + + - LPC176x Clock Configuration: The code preserves undocumented + reserved bits only if board does not set them to keep previous + behavior for boards where developers (hopefully) know what values + should be set into these bits. From Pavel Pisa. + - LPC17xx Clock Configuration: The enable of EMC clocks has to be + preserved when already enabled by loader. EMC and related pins + configuration has to be skipped if the system is run from SDRAM. A + region of SDRAM which is used by system must not be used for heap. + From Pavel Pisa. + + * NXP LPC17xx Drivers: + + - LPC17xx CAN: The name can_txready clashes with Nuttx CAN core + global function. LPC178x has only single LPC17_SYSCON_PCLKSEL with + only single divisor. From Pavel Pisa. + + * NXP LPC17xx Boards: + + - Open1788: Add missing MPU configuration option. From Gregory Nutt. + + * On Semi LC823450 Boards: + + - LC823450-XGEVK: Remove -nostdinc to avoid build error From + Masayuki Ishikawa. + + * STMicro STM32: + + - STM32: Don't try including stm32_gpio.h from within chip/*.h + header files. Not only is bad style for a layered inclusion + system, but it doesn't always work. From Gregory Nutt. + + * STMicro STM32 Drivers: + + - STM32 PWM: Fix polarity and IDLE state configuration From Mateusz + Szafoni. + - STM32 ADC, PWM and TIM: (1) missing T1TRGO2 for JEXTSEL, (2) fix + sample time configuration for channels. The array index for + channels was missing, (3) fix TRGO/TRGO2 configuration, and (6) + support for advanced timers channel 5 and 6. From Mateusz Szafoni. + - STM32 Heap: Change 'if CONFIG_STM32_HAVE_CCM' to 'ifdef + CONFIG_STM32_HAVE_CCM' to avoid a warning when + CONFIG_STM32_HAVE_CCM is not defined. From Gregory Nutt. + - STM32 Oneshot Timer: Fix an error introduced be a previous timer + commit. From Maximilian Kriegleder + - STM32 Tickless Mode and Free-Running Timer: Apply Max's + stm32_oneshot.c fix to the tickless implementation and to the + freerunning time. From Mateusz Szafoni. + - STM32 PWM: Set CCPxP and CCPxNP bits if polarity is negative. + Missing commas in initializers could break compilation in certain + configurations. From Mateusz Szafoni. + - STM32F7 Interrupts: Add the missing macro STM32_IRQ_NIRQS used by + arch/arm/src/stm32f7/stm32_irq.c. From Kejun ZHOU. + - STM32H7 DMA: Fix AHB1 base adresses memory map. From Mateusz + Szafoni. + - STM32H7 SysTick: H7 appears to ignore the SysTick CLKSOURCE bit + and use the CPU clock in all cases. From Mateusz Szafoni. + + * STMicro STM32 Boards: + + - B-L072Z-LRWAN1: Fix typo in SPI1 pin definitions. From Mateusz + Szafoni. + - STM32F429I-DISCO: Handle multiple calls to the LCD + up_fbinitialize() function. From Gregory Nutt. + - STM32F769I-DISCO: Florian R. Hlzlwimmer reports that + stm32_appinitialize.c often has missing OK and NULL definitions. + This should be fixed by including sys/types.h where they are + defined. From GregoryN. + - STM32F769I-DISCO: Remove CONFIG_STM32F7_QUADSPI=y from the + configuration. This was apparently set before the implementation + was added. Now that the implementation was added, the configuration + will not build because it requires that QSPI GPIO pin definitions + be provided in the board.h header file. From Gregory Nutt. + + * TI AM335x Drivers: + + - AM335x Serial: Eliminate an error 'TIOCSBRK undeclared. From + Gregory Nutt. + + * C Library/Header Files: + + - strto*: In alll strto* function family, did't consume single '-' + or '+', allow sign in strotul(l)). From Johannes. + - getopt(): Add logic to reinitialize the stale context for the + FLAT/PROTECTED builds. In these builds getopt() global variables + may be shared by many tasks. If any task exits the getopt() loop + before all command line arguments have been parsed, then getopt() + global variables will be left in a bad state. The next time + getopt() is called, this logic should detect the bad state and + force the state of getopt() to be re-initialized so that it can be + reused. This logic is not full proof (it would fail, for example, + if you tried to parse the same command line twice) but should catch + the typical misuse cases. From Xiang Xiao. + - sscanf(): Initialized the lastc pointer to avoid the checks for + NULL. Removed a bug in the floating point parsing which allowed + several signs after each other. From Johannes. + - lib_vsprintf() (Legacy): No precision specifier resulted in + precision 0 but should be precision 6. From Johannes. + - lib_vsprintf() (Legacy): Correct justification for alternate forms + of %p and %P From ligd. + - lib_vsprintf() (Nano): Add long long support. + CONFIG_LIBC_LONG_LONG needs at least CONFIG_NANO_PRINTLEVEL 2. + Code size for compile without CONFIG_LIBC_LONG_LONG shouldn't be + affected. From Johannes. + - lib_vsprintf() (Nano): Remove CONFIG_LIBC_PRINT_MINIMAL. The + output in that configuration is unsatisfactory and inappropriate + for use with NuttX. For example, the output from many NSH commands + become corrupted and useless. Doesn't belong in this context. + From Gregory Nutt. + - libs/libc/symtab: Remove unused symtab_findorderedbyvalue(). From + Xiang Xiao. + - libs/libc/machine/arm: Fix the minor issue in libc arm machine + folder; MOVW/MOVT should use zero(not sign) extension. From Xiang + Xiao. + - libs/libc/libc.csv: Should be locale.h not local.h. From Joao + Matos. + - libs/libc/libc.csv: Needed logic for correct compilation if not + using CONFIG_LIBC_WCHAR. From Joao Matos. + - libxx: Always include libxx_cxa_guard.cxx in the build for for + uclibcxx. From zhangyuan7. + + - include/stdbool.h: Define bool only when __cplusplus isn't + defined. From Xiang Xiao. + - include/nuttx/list.h: Added a Linux-compatible list + implementation. From zhuyanlin. + - include/nuttx/irq.h: Fix enter_critical_section/spin_lock_irqsave + macro typo error and remove the duplicated inclusion of + arch/irq.h. From Xiang Xiao. + - include/dlfcn.h: Correct naming of standard header file. Should + be dlfcn.h, not dllfcn.h. From Gregory Nutt. + - include/nuttx/nx/nxmu.h: This header file could be lethal; it + declared an #error if CONFIG_DISABLE_MQUEUE=y. From Gregory Nutt. + - include/nuttx/compiler.h: Important fix for C++ users. + compiler.h was using the value of __STDC_VERSION__ to determine if + inline functions are supported or not. If not then the keyword + inline was defined out. Good for C but bad for C++ because C++ + does not define __STDC_VERSION__ at all. C++ applications may + draw in compiler.h indirectly via other head files and this can + result in C++ compiler problems since 'inline' is defined out. + This fix is to ignore the (undefined) __STDC_VERSION__ if + __cplusplus is defined. From Gregory Nutt. + - include/nuttx/elf.h: Adds missing extern "C" __cplusplus guard. + From Anthony Merlino. + - include/poll.h: Remove un-named union from 'struct pollfd'. It + is not required by OpenGroup.org and violates the NuttX C coding + standard because it is not C89 compatible. From Gregory Nutt. + - libs/libc/Makefile, libs/libnx/Makefile, and mm/Makefile: Remove + obj-path MKDEPS option since make dependency target (MT) is not + supported by some toolchains. From anchao. + - include/nuttx/compiler.h: Assume inline support if + __STDC_VERSION__ not defined. From Xiang Xiao. + + * Tools: + + - tools/convert-comments.c: Fix an error in handling of a blank C++ + comment before a comment block. From Gregory Nutt. + - tools/lowhex.c: Fix an initialization problem that was causing + some odd behavior at the beginning of lines. From Gregory Nutt. + - tools/nxstyle.c: Fix logic that detects if an operator is + correctly delimited with spaces. sched/: Various changes because + sched/ C files were used as Guinea Pigs to test nstyle.c. From + Gregory Nutt. + - tools/nxstyle.c: Was confusing hex constants with strings staring + with 'x'. Added logic to complain about hex constants containing + upper case characters. From Gregory Nutt. + - tools/nxstyle.c: Fix logic error that prevent detecion of '/' and + '/=' as operators. net/: Minor updates resulting from testing + tools/nxstyle. From Gregory Nutt. + + * NSH Library: apps/nshlib: + + - NSH Console: Fix copy paste errors. Some Kconfig configuration + names needed CONFIG_ prefix. From David Sidrane. + - nshlib/nsh_timcmds.c: Uninitialized struct tm caused 'date -s' to + fail. From Valmantas Palika. + + * Examples: apps/examples: + + - apps/examples/nxterm: Replace direct calls to nxtk_register() + with legal, indirect calls via boardctrl(BOARDIOC_NXTERM). + Replace calls to (deleted) nxterm_unregister(). The correct way + to delete a driver is by unlink'ing it. From Gregory Nutt. + - apps/examples/nxterm: Most configuration options were not + available in the Kconfig file. From Gregory Nutt. + - apps/examples/nxterm: Replace illegal direct calls to + nxterm_redraw() and nxterm_kbdin() with new boardctl() calls. + From Gregory Nutt. + - apps/examples/nxterm: NxWM passed the size of the NxTK sub-window + but nxterm example passed the size of the complete NxTK window. + They must be made consistent. From Gregory Nutt. + + * Graphics Utilities: apps/graphics: + + - apps/graphics/NxWidgets/nxwm: Correct an error in the type of the + return value in CCalibration. From Gregory Nutt. + - apps/graphics/NxWidgets/nxwm: Replace direct calls to + nxtk_register() with legal, indirect calls via + boardctrl(BOARDIOC_NXTERM). Replace calls to (deleted) + nxterm_unregister(). The correct way to delete a driver is by + unlink'ing it. From Gregory Nutt. + - apps/graphics/NxWidgets: Replace illegal direct calls to + nxterm_redraw() and nxterm_kbdin() with new boardctl() calls. + From Gregory Nutt. + + * Modbus: apps/modbus: + + - apps/modbus/Kconfig: Fix modbus master Kconfig. Modbus Master + ASCII compiles correctly. From Alan Carvalho de Assis. + + * Network Utilities: apps/netutils: + + - apps/netutils/dhcpc/dhcpc.c: Fix an error for DHCP REQUEST + receiving a NAK.In DHCP Request operation, no need to update + ciaddr to the client address and keep it as 0. From Kevin Liu. + + * System Utilities: apps/system: + + - apps/system/vi/vi.c: Fix an infinite loop bug that can show up in + some cases (plus a couple of other items). From Ken Pettit. + - apps/system/vi: Condition KEY_CMDMODE_REPEAT with + CONFIG_SYSTEM_VI_INCLUDE_COMMAND_REPEAT to avoid build error when + option is not selected. From Anthony Merlino. + - apps/system/nxplayer/nxplayer.c: Fix build error when only enable + CONFIG_AUDIO_EXCLUDE_VOLUME is enabled. From ZhongAn. + - apps/system/system/system.c: Correct a path name. From anchao. + - apps/system/taskset: Fix command arguments are not passed. From + Masayuki Ishikawa. + + * Testing: apps/testing: + + - apps/testing/ostest/timedmutex.c: pthread_mutex_timedlock() + returns EDTIMEDOUT on a timedout, not EAGAIN. From Gregory Nutt. + + * Tools: apps/tools: + + - apps/tools/mksymtab.sh: 'export LC_ALL=C' to get the traditional + sort order From anchao. + +NuttX-7.30 Release Notes +------------------------ + +The 130th release of NuttX, Version 7.30, was made on May 19, 2019, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.30.tar.gz and +apps-7.30.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - pthreads: Added non-standard pthread_get_stackaddr_np() and + pthread_get_stacksize_np(). From Joao Matos. + - boardctl(): Add a command to start the VNC server. From Gregory + Nutt. + - Signals: Remove references to CONFIG_DISABLE_SIGNALS in many + files. Signals can no longer be disabled. From Gregory Nutt. + + * Wireless/Wireless Drivers: + + - NRF24L01: Add support for "multicast" TX mode - no waiting for ACK + (needs to be enabled with fcntl SETTXPAYLOADNOACK) From Leif Jakob. + + * Graphics/Display Drivers: + + - NX Graphics: Add new server->client callback to notify the window + client of server events. Remove the old 'blocked' callback and just + make it one case of an 'event' callback. From Gregory Nutt. + - NX Graphics: Implement new interfaces nx_synch() and nxtk_synch(). + This are used to synchronize the NX server with the window client. + Currently most of the logic is equivalent to nx_block() and + nxtk_block(), but with slightly different semantics. They are + separate now because they are likely to diverge in the future. + From Gregory Nutt. + - NX Graphics: Add support for modal windows. From Gregory Nutt. + - NX Graphics: Implement a software cursor. The cursor behaves + like a "sprite", always at the top of the display with a + transparent background. Includes new NX interfaces to show/hide + the cursor, set the cursor image, and to move the cursor position. + From Gregory Nutt. + - NX Graphics: Added support for hiding windows. This features is + needed by Twm4Nx: When a window is iconified, the icon should + appear on the background and the window should disappear (i.e., be + hidden). The windows needs to remain healthy and to be updated in + all ways, but it cannot affect the display content. Conversely, + when the icon is clicked, the icon needs to be hidden on the + background and the window needs to be restored in its current + state (which may be different than the state of the window at the + time it was iconified. From Gregory Nutt. + - NX Graphics: Windows can now be created in the hidden state. + This can be used to clean up initial window presentation which may + involve several steps. This makes those steps all invisible until + nx[tk]_setvisibility() is called to make the windows visible. + From Gregory Nutt. + - NX Graphics: Add new NX interfaces to query if a window is hidden + or not. From Gregory Nutt. + - NxTerm IOCTLs: Replace specific interfaces between boardctl and + nxterm with a generalized IOCTL interface. From Gregory Nutt. + - NxTerm: Add a new IOCTL that can be used to inform NxTerm that + the size of a window has changed. From Gregory Nutt. + + * Other Common Device Drivers: + + - CAN Upper Half: Support multiple readers of the same port From + Valmantas Paliksa. + - MAX7456: Adds a read-only (for now) /dev/osd0/CM interface for + obtaining the chip's onboard NVM character map data. Use seek() + to position the cursor over a desired subset of bytes, or request + a large read to obtain the entire EEPROM memory contents. Values + are returned in binary form. Use hexdump, etc. to format them for + viewing. From Bill Gatliff. + - Serial Upper Half: The upper half serial driver configuration + CONFIG_SERIAL_DMA used to enable DMA on both RX and TX streams. + This was replaced with CONFIG_SERIAL_RXDMA and CONFIG_SERIAKL_TXDMA + which will permit supporting DMA on only one or both streams. + From Gregory Nutt. + - FUSB303: Add FUSB303 driver From Juha Niskanen. + + * Microchip PIC32MZ Drivers: + + - PIC32MZ GPIO: Adds support for edge detect mode. Slew Rate was + also added for completeness. From Abdelatif Guettouche. + + * Microchip/Atmel SAMv7 Boards + + - SAME70-xplained: Add a configuration for test Twm4Nx using VNC. + From Gregory Nutt. + + * Microchip LPCxx Drivers: + + - LPC17xx Ethernet: Added support for KSZ8081RNA PHY to LPC17xx + Ethernet driver. From jjlange. + - LPC17xx Ethernet: Added support for Ethernet PHY ioctl() on + LPC17xx. From jjlange. + + * NXP i.MX RT: + + - .i.MXRT1020: Gets imx1020 family support started. It is pretty + similar, but subtly different, to 1050/60 (less PLLs, less GPIO + banks, differently numbered ports etc. etc.). + + Moved each of the imxrt family-specific files into its own + subdirectory to tidy things up a bit, and remove the vast majority + of ifdefs from the mainline code. + + From Dave Marples. + + * NXP LPC54xx Drivers + + - LPC54xx USB FS Host: Bring in the USB FS OHCI driver from LPC17. + This is a quick'n'dirty port from LPC17 that I hope finish + sometime later. Currently, it is missing hardware clocking setup + and is not even hooked into the build system yet. From Gregory + Nutt. + + * NXP LPC54xx Boards + + - LPCXpresso-LPC54628: Add a Twm4Nx configuration. From Gregory Nutt. + + * Sony CXD56xx + + - CXD56xx: Add initial CXD56xx chip driver sources. From Nobuto + Kobayashi. + + * Sony CXD56xx Spresense Board + + - Spresense: Add Spresense board support. This is not the full + Spresense BSP from Sony, only the barebones logic to present an + NSH console. From Nobuto Kobayashi. + + * STMicro STM32: + + - STM32F7 Clocking: Add support for using the HSE in bypass mode, + configured by board.h From Anthony Merlino. + - STM32F7 Clocking: Added support for TICKLESS mode. From Valmantas + Paliksa. + - STM32H7 Backup Domain: Add backup domain control registers. From + Jukka Laitinen. + - STM32H7 Clocking: Set the STM32H7 default HSI pre-divider to 4. + The I2C driver currently assumes HSI clock to be 16MHz. From Jukka + Laitinen. + - STM32H7 Memorymap.: Add the STM32H7 SYSTEM_UID and DEBUGMCU_BASE + register definitions. From Jukka Laitinen. + - STM32L071x: Add support for STM32L071x. From Mateusz Szafoni. + + * STMicro STM32 Drivers: + + - STM32 OTGHS Host: Allow VBUS monitoring for the OTG_HS host + driver. From Jason Harris. + - STM32F0/L0 ADC: Initial ADC support for the STM32 M0 From Mateusz + Szafoni. + - STM32F0/LO I2C: Port STM32F7 I2C to STM32F0/L0, From Mateusz Szafoni. + - STM32F1 FLASH: As noted by Matias N, the FLASH base address used + was incorrect. It was using the address of the FLASH data, not + the address of the FLASH registers. From Gregory Nutt. + - STM32F3 I2C: Port STM32F7 I2C to STM32F3. From Mateusz Szafoni. + - STM32F7 Ethernet.c: Auto-generate Ethernet MAC address from + device unique ID. From Valmantas Paliksa. + - STM32F7 FLASH: Add flash block mapping support for progmem. From + Valmantas Paliksa. + - STM32F7 FMC: Updated stm32_fmc.h with more FMC definitions. From + Joao Matos. + - STM32F7 GPIO: Adds additional pin alternate function for SPI2. + From Anthony Merlino. + - STM32F7 PWM: Ported the PWM from F4 to F7. From Eduard Niesner. + - STM32F7 SDMMC: Support bypassing the input clock divider on the + SDMMC interface. This enables using the full clock speed provided + to the SDMMC interface with no dividing. From Anthony Merlino. + - STM32F7 SPI: Add SPI DMA threshold configuration. From Valmantas + Paliksa. + - STM32F7 UID: Add UID access. From Valmantas Paliksa. + - STM32F7 USB: USB High speed for STM32F7 series From Ramtin Amin. + - STM32H7 Ethernet: Add stm32h7 Ethernet driver. This is the + initial push for the Ethernet driver. The driver has been tested + to be working on a nucleo board. This is still WIP, it doesn't + for example do MAC filtering on HW level, but just receives all + Ethernet packets. From Jukka Laitinen. + - STM32H7 GPIO: Add the GPIO_ETH_RMII_RXD1 pinmap definition for + STM32H7. From Jukka Laitinen. + - STM32H7 SDMMC: Add STM32H7 SDMMC driver. It is mostly copied + from STM32F7, with modified register addresses and bits, and IDMA + dded. This is still WIP; it only works with IDMA. From Jukka + Laitinen. + - STM32H7 Timers: Add timer devices driver for STM32H7. This i + mostly a forklift from stm32f7 with some h7 specific + modifications. From Jukka Laitinen. + - STM32L0 AES: Add support for AES for L0. From Mateusz Szafoni. + - STM32L0 RND: Add support for RND. From Mateusz Szafoni. + - STM32L0 HSI48: Add support for HS148 for L0. Move HSI48 enable + from stm32_usbdev.c to stm32xx_rcc.c From Mateusz Szafoni. + - STM32L4 USB FS Device: Add USB FS device support. From Juha + Niskanen. + - STM32L4 HSI48: Port HSI48 from STM32F0/L0 From Juha Niskanen. + - STM32L4 CRS: Port CRS from STM32F0/L0 From Juha Niskanen. + + * STMicro STM32 Boards: + + - B-L072Z-LRWAN1: Add ADC example. From Mateusz Szafoni. + - B-L072Z-LRWAN1: Add nxlines_oled example (ssd1306). Add support + for the I2C tool From Mateusz Szafoni. + - Nucleo-144: Added STM32_RCC_DCKCFGR2_DSISRC definition to board.h. + From Joao Matos. + - Nucleo-144: Mount sysfs for ifconfig for f767-netnsh/defconfig. + Even if ifconfig is working to set IP, it will not work to display + NICs (without args) From Phil Coval. + - Nucleo-144: Add basic PWM support to nucleo-144 board. More PWMs + and multi channels support may be investigated and added later. + Tested on Nucleo-F767ZI. From Phil Coval. + - Nucleo-F303ZE: Add nxlines_oled example (ssd1306) From Mateusz + Szafoni. + - Nucleo-H743ZI: Enable the FPU. From Jason Harris. + - Nucleo-H743ZI: Add support for I2C devices: ssd1306, pca9635, + i2ctools From Mateusz Szafoni. + - Nucleo-H743ZI: Add default clock configuration for SDMMC for + Nucleo-H743ZI's board.h. From Jukka Laitinen. + - Nucleo-H743ZI: Add the input clock frequency definitions in + board.h for all the drivers. Assumes internal clock source for + all the timers. From Jukka Laitinen. + - STM32F4 Discovery: Keep c++ global constructor symbols From + Masayuki Ishikawa. + - Nucleo-L073RZ: Add MFRC522 support From Mateusz Szafoni. + - OmnibusF4: Add boardctl() reset logic. From Bill Gatliff. + - OmnibusF4: Add board_ioctl() which is needed only if + CONFIG_BOARDCTL_IOCTL=y is selected; Update NSH configuration + to enable board IOCTLs and DFU mode reset. From Bill Gatliff. + - STM32L Discovery: Add support for board_late_initialize(), Move + common initialization logic out of board_app_initialize() into new + file stm32_bringup.c From Gregory Nutt. + - STM32F103-Minimum: Add PROCFS automount support From Alan + Carvalho de Assis. + + * Libraries/Header Files: + + - include/alloca.h: Add alloca.h. Included limited implementation + of alloc() that is only available for GCC versions 3 and above. + From Joao Matos. + - include/cxx/cstdlib: Add std::random() From Gregory Nutt. + + * apps/ General: + + - Many locations: Remove references to CONFIG_DISABLE_SIGNALS. + Signals can no longer be disabled. From Gregory Nutt. + + * Examples/Tests: apps/examples: + + - apps/examples/fb: Add some awareness of overlays to + apps/examples/fb From Matthew Koch. + - apps/examples/lvgldemo. Update to Littlevgl 5.3. From Matthew + Koch. + - apps/examples/pwfb: Extend example to verify software cursors. + From Gregory Nutt. + - apps/examples/pwfb: Add options to reduce the number of windows. + This is helpful during debug to reduce the complexity. From + Gregory Nutt. + + * Network Utilities: apps/netutils: + + - apps/netutils/cjson: Support for the current version of cJSON. + From Mateusz Szafoni. + - apps/netutils/libcurl4nx: This is an initial commit libcurl4nx. + It is not complete yet, but I still wish to commit the unfinished + bits to describe the roadmap, and because it is already usable. It + will be updated and fixed in the future weeks and months, certainly + including POST support and later, SSL. From Sebastien Lorquet. + - apps/netutils/netinit. This commit removes the private network + initialization logic from NSH and puts in a common location at + apps/netutils/netinit. Now that netork initialization logic can be + used by applications that do not include NSH. From Gregory Nutt. + - apps/netutils/netlib: Add a more flexible version of + netlib_parsehttpurl(). This one can parse any URL, and is + extensible so future improvements keep the same API. From Sebastien + Lorquet. + + * System Utilities: apps/system + + - apps/system/spi: I needed a small test tool for spi in the style of + the I2C tool, but I didn't see one so I've hacked one out of the I2C + tool source. From Dave Marples. + + * Graphics: apps/graphics: + + - apps/graphics/twm4nx. This release introduces Twm4Nx. Twm4Nx is a + "port" of TWM, Tab Window Manager (or Tom's Window Manager) version + 1.0.10 to NuttX NX windows server. No, a port is not the right + word. It is are-design of TWM from the inside out to work with the + NuttX NX server and NXWidgets. The name Twm4Nx reflects this + legacy. But Twm4Nx is more a homage to TWM than a port of TWM. + + The original TWM was based on X11 which provides a rich set of + features. TWM provided titlebars, shaped windows, several forms of + icon management, user-defined macro functions, click-to-type and + pointer-driven keyboard focus, graphic contexts, and user-specified + key and pointer button bindings, etc. + + Twm4Nx, on the other hand is based on the NuttX NX server which + provides comparatively minimal support. Additional drawing support + comes from the NuttX NxWidgets library (which necessitated a + conversion to C++). + + Twm4Nx is greatly stripped down and targeted on small embedded systems + with minimal resources. For example, no assumption is made about the + availability of a file system; no .twmrc file is used. + + The state of the "port" is available in + apps/graphics/twm4mx/README.txt. To summarize: The port is fully + functional but probably only at an alpha release level. The only + missing critical feature is built-in touchscreen calibration. + + - apps/graphics/littlevgl. Update to Littlevgl 5.3. From Matthew + Koch. + - apps/graphics/nxglyphs: Put all NxWidgets and NxWM glyphs into a + common directory where they can eventually be shared. Decouple + from nxwidgets and nxwm so that they can be used elsewhere. + Creates include/graphics/nxglyphs.h From Gregory Nutt. + - apps/graphics/nxglyphs: Add some new cursor bitmap images. From + Gregory Nutt. + - apps/graphics/nxglyphs: Add mkcursor.c. Will auto-generate + cursor image header file from Gimp C output. From Gregory Nutt. + - apps/graphics/nxglyphs: Add 16x16 cursor images. 30x30 are kind + of large on small displays. From Gregory Nutt. + - apps/graphics/nxglyphs: Add a new resize cursor image. From + Gregory Nutt. + - apps/graphics/nxwm: Separate NxWidgets and NxWM into separate + directories. Remove old, common NxWidgets directory. From + Gregory Nutt. + - apps/graphics/nxwm: Move the NxWM unit test main() to apps/nxwm. + It is no longer a unit test, but the main startup entry point for + NxWM. From Gregory Nutt. + - apps/graphics/nxwidgets: Update NX window clients so that they + use the new 'event' callback (vs. the obsoleted 'blocked' callback). + From Gregory Nutt. + - apps/graphics/nxwidgets: Add a synchronize method to every window. + This is a wrapper arounc nx[tk]_sync and permits C++ applications + to synchronize with the NX server. From Gregory Nutt. + - apps/graphics/nxwidgets: Add support for modal windows. From + Gregory Nutt. + - apps/graphics/nxwidgets: Add cursor control methods to the + CNxServer class. From Gregory Nutt. + - apps/graphics/nxwidgets: Add a method to CButtonArray that will + allow us to dynamically resize the array (at the cost of losing all + button labels). From Gregory Nutt. + - apps/graphics/nxwidgets: Fix a possible deadlock condition when + waiting for window geometry data that will never come. Fixed by + re-requesting geometry data if we don't already have it. From + Gregory Nutt. + - apps/graphics/nxwidgets: Add handshake to + CWidgetControl::getWindowHandle() to avoid returning a NULL + handle. From Gregory Nutt. + - apps/graphics/nxwidgets: CNxTkWindow, CNxWindow, CNxServer: Add + support to create RAM backed windows. From Gregory Nutt. + - apps/graphics/nxwidgets: Add methods to all windows to query if a + window is visible or hidden. From Gregory Nutt. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Clock Initialization: A recent change broke Tickless mode for all + architectures. The original change was intended to handle the + case where up_timer_gettime may not start from zero case. The + side effect is that this changed to order of initialization of + clocking, breaking Tickless mode:: After this change the tickless + timer structures are used before they are initialized in + clock_inittime(). The commit has been reverted. + - pthread Stack Attribute: Fixed pthread_attr_get/setstacksize + param type to size_t. From Joao Matos. + - Signals: The abnormal termination signal handler was just calling + exit() conditionally when, for example, Ctrl-C is sent to a task. + The abnormal termination handler must obey the rules of cancellation + points: If cancelation is disabled, then the abnormal termination + logic must wait for cancelation to be re-enabled; If cancellation + is deferred then the abnormal termination logic may have to wait + for the victim task to enter or exit a cancellation point. From + Gregory Nutt. + - Syscall: Added support for munmap() syscall. From Joao Matos. + - Syscall: Fix a warning due to inconsistencies in return type in + syscall.csv. From Gregory Nutt. + - Syscall: Correct an error syscall.csv. Error occurred when + creating the munmap() proxy if CONFIG_FS_RAMMAP is not defined. + From Gregory Nutt. + + * File System/Block and MTD Drivers: + + - fs/littlefs/lfs.c: Fix lfs_format bug. In superblock disk root- + block assignment, the second must be root[1]. From YanLin Zhu. + + * Networking/Network Drivers: + + - getsockname(): Fix addrlen check in socket debug features. + Getsockname() checked erroneously a pointer agains 0, where the + intention was to dereference the pointer and to check the length. + This causes also a compilation failure if the code is compiled + with CONFIG_DEBUG_FEATURES and with -Werror flag set. From Jukka + Laitinen. + - Network Locking: net_lock() and net_restorelock() now return a + value. That values is the standard zero on success; negated errn + value on failure. This return value is only needed for + -ECANCELED. That cancellation indication needs to ripple all the + way back to the highest levels where the cancellation can be acted + on. This commit only adds the return value; it does not add + checking for the return values of net_lock() and net_restorelock() + at higher levels. That is required too. From Gregory Nutt. + - PHY Notification Driver: Change sprintf to strncpy in phy_notify. + On some platforms, the sprintf doesn't accept a const char* as a + format argument. From Jukka Laitinen. + - 6LoWPAN HC06: Correct an endian-ness problem in HC06 decompression. + From Ivan Ucherdzhiev. + + * Wireless/Wireless Drivers: + + - NRF24L01: Don't block in read if file descriptor is O_NONBLOCK. + From Leif Jakob. + + * Graphics/Display Drivers: + + - NX Graphics: Fix an error in coordinate system usage. Expected + rectangle in device coordinate frame, but was passing the + rectangle in window-relative coordinate frame. From Gregory Nutt. + - NX Graphics: Fix an oversight in the implementation of per-window + framebuffers. It is true that redraw callbacks can be suppressed + for all cases ... EXCEPT ONE: When the window is resized to a + larger size, then the newly exposed territory must be drawn for + the first time. From Gregory Nutt. + - NxTK: Fix an error in handling mouse events for framed windows. + When drawing, NX may report mouse positions outside of the Window. + The is only for NX windows, but the outside-the-side positions were + being discarded by nxtk_events(). From Gregory Nutt. + - NxTK: Refuse to open a toolbar of height zero or less. From + Gregory Nutt. + - Nxglib: Correct bogus logic in nxgl_interesting(). From Gregory + Nutt. + - VNC Server: Fix an error in color conversion. From Gregory Nutt. + + * Common Drivers: + + - APDS9960: Initial state of allocated structure was not being set. + Noted by Leif Jacob. From Gregory Nutt. + - MFRC522: In mfrc522_read uid.sak must be different from 0x04 not + as before from 0x00. SAK == 0x00 is a valid PICC type. Add + interface to read MIFARE Ultralight data From Mateusz Szafoni. + - Power: Fix build for battery gauge From Tom Kopriva. + - Syslog: In syslog buffered mode, avoid IOB alloc lock-up with + heavy network activity. This change alters the buffered syslog + logic to use 'iob_tryalloc' instead of blocking 'iob_alloc' to + avoid syslog printing from getting stuck when all IOBs are + depleted by network activity. An issue was seen when large + incoming TCP transfer uses free IOB buffers and processing + threads try to use syslog which then block at iob_alloc. From + Jussi Kivilinna. + - USB CDC/ACM Device: This fixes a problem where the host sent a + "get descriptor" message of type "standard" with a recipient of + type "interface". Since the composite driver would only pass + messages to the child interfaces when a message was not + "standard", this message was not handled. I changed the condition + so that the composite driver checks not only if this is a + "standard" message but if it is also directed to the device. + Otherwise, the handling is delegated to the children of the + composite device. From Matias N. + - USB HID: The usbhid_descriptor_s struct defined in hid.h included + some optional fields that should not be hard-defined as part of + that structure. An arbitrary number of optional entries could be + included in the descriptor, but that is not properly represented. + No code on NuttX currently depends on the structure definition + with an optional descriptor so it is safe to remove. From Matias N. + - USB MSC Device: Correct typo "const const" to "const". + arch/arm/src/stm32/stm32_i2s.c: In debug assertions, it on a + sample rate of 0, but based on other code comments this value + implies disabling the i2s master clock. From Jason Harris. + - Zerocross Driver: Fix some errors when debug assertions are + enabled. From Matous Pokorny. + - User Leds: Fix ledset validity check in ULEDIOC_SETALL ioctl. + From Jussi Kivilinna. + + * Architecture Common: + + - All board interfaces (those starting with board_) must be defined + in board-specific logic. Otherwise, they cannot be customized for + specialized usage by different boards. The board_reset() + interface was defined in architecture-specific logic that only + called up_systemreset(). That is useless! This change removes + the board_reset() implementation from the architecture-specific + code and re-implements it in the src/ directory of each board that + has CONFIG_BOARDCTL_RESET enabled. That is the correct functional + partitioning. From Gregory Nutt. + - Start-up: Remove dependency on CONFIG_ARCH_FPU for inclusion of + nvic.h in all other *_start.c files. From Gregory Nutt. + - Architecture initialization: up_initialize() needs to know about + ramlog_consoleinit() From Jason Harris. + + * Microchip PIC32MZ Drivers: + + - PIC32MZ GPIO: Corrects the gpioirq when mismatch mode is + selected. From Abdelatif Guettouche. + + * ARMv7-A: + + - ARMv7-A Build: Fix 'cc1: warning: switch -mcpu=cortex-a7 conflicts + with -march=armv7-a switch' From Xiang Xiao. + + * Nordic NRFxx + + - NRF52: Fix compiler error in nrf52832_errdata.c when following + C89. From Erik Englund. + + * STMicro STM32: + + - STM32 Configuration: It seems one option in the timer configuration + was lost at some point. From Matias N. + - STM32 start-up: Inclusion of nvic.h should not be conditioned on + CONFIG_ARCH_FPU. From Mateusz Szafoni. + - STM32H7 Clocking: Fixes for STM32H7 RCC definitions. From Jukka + Laitinen. + + * STMicro STM32 Drivers: + + - STM32F0/L USART: A few fixes for USART. From Mateusz Szafoni. + - STM32F1/F30 FLASH: RCC register access should not be offset by + FLASH register base. From Matias N. + - STM32F7 CAN: CAN fixes. From Valmantas Paliksa. + - STM32F7 I2C: I2C Interrupt storm fix. I2C track bad state. Now + we track bad state and so the SW reset only when it occurs. From + David Sidrane. + - STM32F7 OTG: Fixes some macros related to OTGFS/OTGHS preventing + OTGHS from working. From Anthony Merlino. + - STM32F7 OTG Device: Correct hard-coded FIFO size that is wrong + for OTG FS. From Ramtin Amin. + - STM32F7 QSPI: Fix QuadSPI interrupts. This commit essentially + replaces wrongly named configuration variable STM32F7_QSPI_INTERRUPTS + into CONFIG_STM32F7_QSPI_INTERRUPTS. Also fixes some getreg/ + putreg where register addresses were used instead of register + offsets From Pierre-Olivier Vauboin. + - STM32H7 I2C: Fix I2C4 compilation for STM32H7. From Jukka + Laitinen. + - STM32H7 UART: Fix compilation for UART7, UART8 and I2C4s. From + Jukka Laitinen. + - STM32L4 USB Device: Add missing PWR USBV enable, correct two USB + register bits From Juha Niskanen. + + * STMicro STM32 Boards: + + - STM32F103-Minimum: USB reset was not working appropriately since + the pin connected to D+ was incorrectly defined and the pullup/down + logic was reversed. From Matias N. + - Nucleo-l476RG: Fix some errors in GPIO logic when debug assertions + are enabled. From Matous Pokorny. + - Nucleo-L476RG: Add missing files of BMP180 example for Nucleo-L476RG. + From Fabian Justi. + - STM32F103-Minimum GPIO: Fix some errors when debug assertions are + enabled. From Matous Pokorny. + - STM32L4 PWM: Fix register addr, en_bit and resetbit for pwm timers. + From Fabian Justi. + - STM32F746G-DISCO: I2C1 config on stm32f746g-disco. Typo in + stm32f7/stm32_i2c.c From Matthew Koch. + + * C Library/Header Files: + + - include/limits.h: Remove the duplicate TMP_MAX definitions. The + standard requires that TMP_MAX defines be in stdio.h. From + Xiang Xiao. + - include/sys/select.h: Fix compiler error when + CONFIG_NSOCKET_DESCRIPTORS is undefined. From Xiang Xiao. + - include/signal.h: Add commented out definition of the si_addr + field. From Joao Matos. + - include/unistd.h: Fixed R_OK/X_OK definitions to match POSIX. + From Joao Matos. + + - libs/libc/locale: Improved error handling in setlocale(). From Joao + Matos. + - libs/libc: Fixed return code in uname(). From Joao Matos. + - libs/libc/stdio: Restore support for printing NULL string as + "(null)". Legacy printf supported printing "(null)" in place for + NULL string: printf("null: %s\n", NULL); => null: (null). This + commit restores this functionality for new printf library. From + Jussi Kivilinna. + + * Examples: apps/examples: + + - apps/examples/pca9635/pca9635_main.c: fix compilation error. From + Mateusz Szafoni. + + * Graphics Utilities: apps/graphics: + + - Various graphics apps (and apps/examples): If CONFIG_VNCSERVER=y, + don't call vnc_default_fbinitialize() directly. That is a violation + of the portable POSIX interface. Instead, call + boardctl(BOARDIOC_VNC_START);. From Gregory Nutt. + - apps/graphics/nxwidgets: CWidgetControl::handleLeftClick now + returns a value to indicate if the click was actually processed or + not. CWidgetControl::pollMouseEvents: Correct return value. From + Gregory Nutt. + - apps/graphics/nxwidgets/: NXWidgets::CNxWidgets: Fix some issues + with returned values. On setting the widget size or position, it was + returning false if there was no change in size or position. Many + places in the code were treating the false return value as an error. + From Gregory Nutt. + + * System Utilities: apps/system: + + - apps/system/nxplayer: Fix some logical errors from recent commits. + They broke the build of the nxplayer as a library vs. a task. + +NuttX-7.31 Release Notes +------------------------ + +The 131st release of NuttX, Version 7.31, was made on July 21, 2019, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-7.31.tar.gz and +apps-7.31.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: + + * Core OS: + + - poll(): Removed all references to CONFIG_DISABLE_POLL. The + standard POSIX poll() can no longer be disabled. From Gregory Nutt. + - LWL console: Add support for OpenOCD 'Lightweight Link' protocol + between a target and debugger for use when you need a console but + the target doesn't have a spare serial port or other available + resource. From Dave Marples. + + * Network/Network Drivers: + + - Socket Options: Previous change removed some incorrect SO_LINGER + socket option functionality. SO_LINGER was always enabled if + CONFIG_NET_SOLINGER was selected. This change implements a proper + version of SO_LINGER. It is based on new logic to drain the + buffered TX data, integrated with network event notification system. + Supports notification when UDP or TCP write buffer becomes empty. + From Gregory Nutt. + - Telnet Driver: Handle ctrl events (SIGINT, SIGSTP). From + Valmantas Paliksa. + - Telnet Driver: I/O thread now offloads reading from socket + from client thread to the I/O thread. From Valmantas Palika. + + * Wireless/Wireless Drivers: + + - GS2200M: Add support for Telit GS2200M Wi-Fi module From Masayuki + Ishikawa. + - GS2200M: Introduce CONFIG_WL_GS2200M_SPI_FREQUENCY. Also, changed + usleep(100) to up_udelay(100) to avoid invalid response. From + Masayuki Ishikawa. + - GS2200M: Add channel parameter for AP mode in gs2200m.c From + Masayuki Ishikawa. + + * Graphics/Video/Display Drivers: + + - Video Streaming: Add basic Video Stream and Capture implementation + based on the SPresence SDK code release From Alin Jerpelea. + - video/: Create video/ directory to hold non-driver video-related + logic. From Gregory Nutt. + - EDID: Add some initial EDID logic ported from FreeBSD. From + Gregory Nutt. + - EDID: Add logic to sort video modes by how close they are to the + preferred mode. This is part of the logic to pick the best possible + video mode. From Gregory Nutt. + - EDID/Video Modes: Separate EDID and from videomode management. + They really are separate things. From Gregory Nutt. + - EDID/Video Modes: Add debug functions to dump the EDID and + videomode content. From Gregory Nutt. + - VESA GTF: Bring VESA Generalized Timing Formula (GTF) from FreeBSD. + From Gregory Nutt. + - Video Modes: At some additional lookups from FreeBSD. Not + currently used in NuttX so ifdef'ed out for now. From Gregory Nutt. + - tda19988: Now uses the new common videomode structure of + include/nuttx/video/videomode.h as do other video components. From + Gregory Nutt. + - ILI9340: Add ILI9340 LCD Single Chip Driver. Required LCD driver + settings: LCD_MAXCONTRAST should be 255, but any value >0 and <=255 + will be accepted. LCD_MAXPOWER should be 1: 0=off, 1=on. From + Alin Jerpelea. + - LPM013M091A: Add JDI LPM013M091A LCD Driver. From Alin Jerpelea. + - ISX012: Add support for ISX012 Image sensor. From Alin Jerpelea. + + * Other Common Device Drivers: + + - SPI Interface: Added standard definitions for ADC SPI device ID. + From Daniel P. Carvalho. + - AK09911/AK09912: Add Asahi AK09911/AK09912 compass sensor over I2C + bus From Alin Jerpelea. + - AS726X: Add support for AS726X spectral sensor From Fabian Justi. + - BMI160: Add driver support for the Bosch BMI160 Inertial Measurement + sensor. This driver can be used with the BMI160 sensor connected + over SPI or I2C bus. From Alin Jerpelea. + - BMP280: Add Bosch BMP280 Barometic pressure sensor connected over + I2C bus. From Alin Jerpelea. + - INA3221: Adds INA3221_I2C_ADDRx macro helpers. From Anthony + Merlino. + - VL53L1x: Added support for VL53L1x TOF sensor. From Juan Flores. + + * Microchip PIC32MZ Drivers: + + - PIC32MZ DMA: Add DMA support. From Abdelatif Guettouche. + + * NXP i.MXRT Drivers: + + - i.MXRT EHCI: Add i.MXRT EHCI driver. From Dave Marples. + - i.MXRT USDHC: Implements SDIO and Multi-card support for i.MXRT. + From Dave Marples. + - i.MXRT USDHC: Implements USDHC1 & 2 selection on the imxrt. If + only one port is active (either 1 or 2) it will always be numbered + as 0, if both are active then USDHC1 will be number 0, USDHC2 will + be 1. From Dave Marples. + - i.MXRT Serial: Add TIOCSINVERT ioctls. From Beat Kng. + - i.MXRT Serial: Implemented RS485 RX/TX switching and RTS/CTS flow + control for the IMXRT family. It has been tested on 1020 but I + don't see any reason for issues on any other family member. From + Dave Marples. + + * NXP/Freescale Kinetis Drivers: + + - Kinetis Serial: Add UART signal inversion support From Beat Kng. + + * NXP LPC11xx: + + - LPC11xx: Support for the LPCXpresso-LPC1115 and for the LPC1115 + architecture in general was removed after NuttX-7.30. The LPC11 + port was never really used (to my knowledge) and was no longer + supported. A snapshot of the port is still available in the + Obsoleted repository. It can be brought back into the main + repository at any time if anyone is willing to provide support + for the architecture. From Gregory Nutt. + + * NXP LPC17xx Boards: + + - PNEV5180B: Add support for NXP Semiconductors' PN5180 NFC Frontend + Development Kit. This board is based on the NXP LPC1769 MCU. At + the moment there is just support for a minimal nsh configuration via + UART0. From Michael Jung. + - PNEV5180B: Add usbnsh configuration. This is basically the same as + the 'nsh' defconfig, but uses CDC/ACM as the NuttShell console + device. From Michael Jung. + - PNEV5180B: Adds NSH configuration with UART0 and eth0 via CDC/ECM + on USB device. From Michael Jung. + - PNEV5180B: Add new configuration includes a USB Composite Device + with both CDC/ACM and CDC/ECM. NuttShell provides a terminal via + CDC/ACM. A network interface (eth0) is provided via CDC/ECM. From + Michael Jung. + - PNEV5180B ROMFS: Auto-mount baked-in ROMFS image. Includes support + for linking a binary ROMFS image into the nuttx executable and for + mounting it during board bring-up. From Michael Jung. + - PNEV5180B PROTECTED: Add PROTECTED mode configuration with + NuttShell. From Michael Jung. + + * NXP LPC40xx: + + - LPC40xx: Add support for LPC40xx family chips. Renamed LPC17XX to + LPC17XX_40XX in directory, configuration, file names, etc., as + appropriate. Corrected a few peripheral definitions and pin + functions for the LPC17xx family. Added configuration options, chip + definitions, and additional pin functions for the LPC40xx family. + From jjlange. + + * NXP LPC40xx Boards: + + - LPC4088-Devkit: Added board configuration for Embedded Artists + LPC4088 Developer's kit. From jjlange. + - LPC4088-Quickstart: Added board configurations for Embedded Artists + LPC4088 Quickstart board. From jjlange. + + * NXP LPC54xx Boards + + - LPCXpresso-LPC54628: Enable DATE command in twm4nx1 and twm4nx2 + configurations. From Gregory Nutt. + + * Sony CXD56xx + + - CXD56xx: Adds (1) the HW pin configuration, (2) GPIO support for + CXD56xx, (3) GPIO interrupts, (4) clock support, (5) PMIC (Power + management integrated circuit) support (6) add a simple FIFO + scheduler that minimizes overhead, (6) Inter Core Communication. + From Alin Jerpelea. + - CXD56xx: Add Package Configuration. The CXD56xx can come in FCBGA + 185 pin or WLCSP 100 pin package. For each package we have to pick + the right pin setup. The default configuration is set to FCBGA 185 + pin package From Alin Jerpelea. + - CXD56xx: Add Power Management support From Alin Jerpelea. + - CXD56xx: (1) Add syscontrol, (2) Add the function to change the + clock speed, (3) Add pinctrl and clock ctrl functionality. From + Alin Jerpelea. + + * Sony CXD56xx Drivers: + + - CXD56xx USB: Add basic support for USB connectivity. From Alin + Jerpelea. + - CXD56xx SDHC: Add SDHCI driver for the CXD56xx. From Alin + Jerpelea. + - CXD56xx SPI: Add SPI support. From Alin Jerpelea. + - CXD56xx DMA: Add DMA support. From Alin Jerpelea. + - CXD56xx RTC: Add RTC support. From Alin Jerpelea. + - CXD56xx PWM: Add support for PWM. From Alin Jerpelea. + - CXD56xx Power Management: Add Power Management PROCFS support. From + Alin Jerpelea. + - CXD56xx Timer: Add Timer driver. From Alin Jerpelea. + - CXD56xx Watchdog Timer: Add watchdog timer support. From Alin + Jerpelea. + - CXD56xx UID: Add support to be able to read the HW UID. From Alin + Jerpelea. + - CXD56xx I2C: Add I2C support. From Alin Jerpelea. + - CXD56xx I2C: Add I2C character driver support. For testing + purposes, we use the CXD56_I2C_DRIVER to register the /dev/i2c[] + character devices. Add battery gauge and battery charger drivers. + Add SPI-based SP card support. From Alin Jerpelea. + - CXD56xx SCU: Add Sensor Control Unit (SCU); Use DMAC for reading + sensing data from SCU on CXD56xx chip. From Alin Jerpelea. + - CXD56xx ADC: Add ADC interface support. From Alin Jerpelea. + - CXD56xx eMMC: Add eMMC support for CXD56xx chip From Alin Jerpelea. + - CXD56xx Camera: Add driver for hardware image processor device to + enable the hardware image processor set CXD56_GE2D=true. From Alin + Jerpelea. + - CXD56xx CISIF: Add CISIF support to be able to use cameras. From + Alin Jerpelea. + - CXD56xx GNSS: Add GNSS device, add Geofence Support, add UART0 + interface. UART0 is an interface with hardware flow control in the + application subsystem. From Alin Jerpelea. + + * Sony CXD56xx Spresense Board: + + - Default Configurations: (1) We are using the framework to + initialize the CPU, (2) Enable PowerManager on SPresence board, (3) + Initialize the UART interfaces, (4) Enable clock management using + the CXD56 framework, (5) Use timerisr on the SPresence board, (6) + Enable USBDEV on Spresense board, (7) Enable SD Card support on + SPresence board, (8) Enable Mass Storage on Spresense board From + Alin Jerpelea. + - Default Configurations: Add support for RNDIS configuration. From + Masayuki Ishikawa. + - RTC: Enable RTC functionality on SPresence board From Alin + Jerpelea. + - SPI FLASH: Enable SPI Flash arch/arm/src/cdx56xx: (1) Group all + CXD56xx Options in one menu, (2) Add Storage Options menu and + Peripheral Support comment, (3) Add SPI Flash support From Alin + Jerpelea. + - Add SPI configuration for SPresence board. Enable PWM support on + SPresence board; The powermanager procfs is disabled by default and + need to be enabled by the CONFIG_CXD56_PM_PROCFS option. Timers can + be used on the SPresence board. Watchdog timer support also added. + From Alin Jerpelea. + - Add USERLED for SPresence board. From Alin Jerpelea. + - Enable I2CDEV for SPresence board. Add useful diagnostic LEDs on + the SPresence board. From Alin Jerpelea. + - Add support for Tilt GS2200M Wi-Fi module. From Masayuki Ishikawa. + - Remove SPI MMC/SD support and enable ADC support for SPresence + board. From Alin Jerpelea. + - Enable BMI160_I2C sensor over I2C on SPresence board. From Alin + Jerpelea. + - Add I2CTOOL support and extend GPIO for future use. Add delay + support for CXD56xx chip. For development is useful to register + I2C busses when the I2CTOOL is built. Enable GPIO interface on + the Spresense board. From Alin Jerpelea. + - Add use o the CXD56_I2C_DRIVER to register the /dev/i2c character + devices. Enable battery gauge and battery charger support. From + Alin Jerpelea. + - Enable UID functionality. To enable the UID functionality for + SPresence board set BOARDCTL_UNIQUEID in menuconfig. From Alin + Jerpelea. + - Add USBDEV_SETNOTIFYSIG signal ID. Set signal ID for notify USB + device connection status and supply current value. From Alin + Jerpelea. + - Register the procfs in the NSH configuration. This is a + configuration change in sync with the other ones. Enable + READLINE_CMD_HISTORY, enable by default SPI 4 and 5, and enable + SPI to keep all configurations in sync. From Alin Jerpelea. + - Add support for MSC and USB Composite device. Adds usbmsc + configuration. Spresense board does not have buttons and but a + template for gpio buttons that can be connected on the external + header From Alin Jerpelea. + - LCD: Add support for LPM013M091A LCD, add support for ILI9340 + LCD, add a new configuration to support an LCD. From Alin + Jerpelea. + - WiFi: Improve performance for webserver: (1) Enable SPI DMA for + both TX and RX, (2) Increase SPI clock speed from 4MHz to 10MHz, + (3) Increase buffer size for sendfile() from 512B to 1KBm abd (4) + Enable sendfile() for webserver. From Masayuki Ishikawa. + - MPY: Add MPY defconfig. From Alin Jerpelea. + - Update defconfigs rndis and wifi: Enable RTC and webserver with + directory listing support. Also, changed start year/month/day for + NuttX 2019. From Masayuki Ishikawa. + - Build nuttx.spk images. Enable nuttx.spk binary image that can be + flashed on SPresence board. From Alin Jerpelea. + - configs/SPresence: Add entry point for MPY. The entry point is + needed for the downstream projects based on SPresence. From Alin + Jerpelea. + - Enable internal flash storage for SPresence boards. The SmartFS + flash is mounted under /mnt/spif folder. From Alin Jerpelea. + - For compatibility with SDK we need to change the USER_ENTRYPOINT + in all configurations to spresense_main(). From Alin Jerpelea. + + * STMicro STM32: + + - STM32 Kconfig: Add MEDIUM_DENSITY selection. From Dave Marples. + - STM32 Kconfig: Add the missing STM32 LCD Clock Source Selections. + From Alan Carvalho de Assis. + - STM32G0: Initial support for STM32G0 family. From Mateusz Szafoni. + - STM32F0L0G0: Renamed directories STM32F0L0 to STM32F0L0G0 since + they now also supports the STM32G0 thanks to Mateusz Szafoni's + contribution From Gregory Nutt. + - STM32H7x3: Added ADC pins to pin map. From David Sidrane. + + * STMicro STM32 Drivers: + + - STM32 PWM: Add support for all PWM modes. Add an interface to + change PWM mode. Refactor pwm_mode_configure(). STM32_PWM_CHANx + corresponds to the timer channel and STM32_PWM_OUTx corresponds to + the timer channel output. Add CHAN5 and CHAN6 to + PWM_TIMx_NCHANNELS. Calculate thePWM_TIMx_NCHANNELS if + CONFIG_STM32_PWM_MULTICHAN is selected. From Mateusz Szafoni. + - STM32 FSM/FSCM: Split the STM32 FMC/FSMC functionality. Makes FMC + it's own thing rather than piggy backing on the FSMC code. The + peripherals have a few utility functions and this commits lets you + have a common architectural functions rather than having duplicate + functions in each board implementation. From Jason Harris. + - STM32F7 DTCM: Add procfs register From Daniel Agar. + - STM32F7 GPIO: Add GPIO driver. Code is inspired from STM32F3- + Discovery and Nucleo-L476RG platforms. Tested on Nucleo-F767ZI. + From Phil Coval. + - STM32F7 Serial: This adds the ability to invert and swap RX/TX on + STM32F7 UARTs. I added the TIOCGINVERT as well to reserve the IOCTL + number, but did not implement it. This is the same as for + TIOCGSINGLEWIRE. From Beat Kng. + - STM32L4 CRS: Make STM32L4 CRS synchronization source board + configurable. From Juha Niskanen. + - STM32L4 HSI48: Enable CRS_CR_CEN with CRS_CR_AUTOTRIMEN. From + Jussi Kivilinna. + - STM32L4 I2C: Add support for 16 and 120 MHz timings. Board can use + HSI16 clock for I2C From Juha Niskanen. + - STM32L4 PWR: Enable PWR peripheral for setting USV. From Jussi + Kivilinna. + - STM32L4 RCC: Use Range 1 Boost mode if SYSCLK is higher than 80 + MHz. From Juha Niskanen. + - STM32L4 Serial: Add TIOCSINVERT and TIOCSSWAP ioctls. From Beat + Kng. + - STM32H7 ADC: Added ADC Driver, ADC clocking. From David Sidrane. + - STM32H7 Ethernet: Fix typo in define. From Pierre-Olivier Vauboin. + - STM32H7 PWM: Port PWM from STM32 From Mateusz Szafoni. + - STM32H7 QEncoder: Ported the QEncoder from F7 to H7. From Eduard + Niesner. + - STM32H7 Serial: Add TIOCSINVERT and TIOCSSWAP ioctls. Ensure + TIOCSSINGLEWIRE is atomic and UE disabled. From Beat Kng. + + * STMicro STM32 Boards: + + - Olimex-STM32-E407: Added BMP180 initialization and a configuration + to test the BMP180. From Juan Flores. + - Olimex-STM32-E407: Add DAC support, add IN219 support, add timer + driver support. From Juan Flores. + - Olimex-STM32-E407: Add support for MRF24J40 radio. From Gregory + Nutt. + - Axoloti: Adds initial support for the Axoloti sound/music + synthesizer board. Board is based on STM32F427 SoC. See + http://www.axoloti.com/. From Jason Harris. + - Nucleo-G071RB: Initial support for nucleo-g071rb. From Mateusz + Szafoni. + - Nucleo-L432KC: Add new configuration settings for CRS + synchronization to board.h. From Juha Niskanen. + - Nucleo-L432KC: Add support for testing the ina219 current sensor. + From Sebastien Lorquet. + - Nucleo-L452RE: Add new configuration settings for CRS + synchronization to board.h. From Juha Niskanen. + - Nucleo-144: Add ROMFS support. Image was generated using genromfs + tool. Tested on Nucleo-F767ZI. From Phil Coval. + - Nucleo-144: Add reset feature. Code is derives from STM32F4- + Discovery. It can be enabled using CONFIG_BOARDCTL_RESET From Phil + Coval. + - Nucleo-L476RG: (1) Add I2C tool to board init, (2) Add support for + AS726X spectral sensor From Fabian Justi. + - Nucleo-L496ZG: Add new configuration settings for CRS + synchronization to board.h. From Juha Niskanen. + - STM32L476VG-Disco: Add new configuration settings for CRS + synchronization to board.h. From Juha Niskanen. + - STM32L4R9AI-Disco: Add ksh config, some updates for I2C, SPI and + DFSDM support. From Juha Niskanen. + - Nucleo-H743ZI: Add ADC support. From David Sidrane. + - STM32F769I-Disco PWM: Enable PWM support for stm32f769i-disco + board. + - STM32L-Discovery: Add button support for stm32Ldiscovery. Add + chronometer board config. From Alan Carvalho de Assis. + + * TI AM335x: + + - AM335x Clock Module: Add clock module registers definition. Switch + to DMTIMER1 for systick. From Petro Karashchenko. + + * TI AM335x Drivers: + + - AM335x CAN, LCD: Add register description files for DCAN and LCD. + From Petro Karashchenko. + - AM355x I2C: Add register description files for I2C (plus various + improvements to the WDOG register definitions) From Petro Karashchenko. + - AM355x MCSPI: Add register description files for MCSPI. From Petro + Karashchenko. + - AM355x LCDC: This change brings in an initial LCD driver into the + AM335x architecture. Ported from FreeBSD. From Gregory Nutt. + - AM335x Framebuffers: Add logic to map the framebuffer to a non-cached, + non-buffered memory region. From Gregory Nutt. + - AM335x LCDC: Add logic to get/set the module reference clock. From + Gregory Nutt. + + * TI AM335x Boards: + + - Beaglebone-Black LCD: Add a configuration for bringing up the LCDC + driver. From Gregory Nutt. + - Beaglebone-Black LCD: Framework (only) for TDA19988 and LCD support + for Beaglebone Black. Can't use TDA19988 yet because there is no I2C + driver. In the mean time, support LCD initialization using a fixed, + configurable video mode. From Gregory Nutt. + + * ZiLOG z16f ZNeo: + + - z16f ZNeo: Add support for the latest 5.2.1 version of the ZDS-II + toolchain. From Gregory Nutt. + + * ZiLOG eZ80Acclaim!: + + - Integrate support for the newest eZ80 ZDSII 5.3.0 toolchain. From + Gregory Nutt. + + * ZiLOG eZ80Acclaim! Drivers: + + - eZ80 RTC: Integrate and verify the RTC driver From Gregory Nutt. + - eZ80 RTC: Add an RTC lower half driver. From Gregory Nutt. + + * ZiLOG eZ80Acclaim! Boards: + + - MakerLisp: Add initial support for the MakerLisp eZ80 board. Ref: + https://makerlisp.com/ From Gregory Nutt. + - MakerLisp: Add hooks needed by SPI driver. Move SPI MMC/SD chip + selected configuration from ez80_lowinit.c to here as is done in + other NuttX architectures. This enables support for multiple + devices on the SPI bus. From Gregory Nutt. + - MakerLisp: Add Smart Flash Programmer project. From Gregory Nutt. + - MakerLisp: Enable Procfs, RTC, SPI-based SD support, task name, NSH + data command in NSH configuration.. From Gregory Nutt. + - MakerLisp: Use .ztgt files from MakerLisp SDK. From Gregory Nutt. + - MakerLisp: Add a tiny FLASH-resident loader that will load and + start applications in Intel HEX format from an SD card. From + Gregory Nutt. + - MakerLisp: Bring in a new configuration to support execution + entirely out of external SRAM. From Gregory Nutt. + - MakerLisp: Add an sdboot configuration that will load .hex files + from the SD card. From Gregory Nutt. + - MakerLisp: Add a linker script to support copying the NuttX image + from FLASH into external SRAM. From Gregory Nutt. + - MakerLisp: The VGA display controller and keyboard controller come + up by default emulating a terminal with 'newline mode' on. That is + newlines expance to carriage-return, newline. This change turns that + mode off. From Gregory Nutt. + + * Libraries/Header Files: + + - include/cxx/cstddef: Add C11++ std::nullptr_t From junmin-kim. + - libc netdb: Implemented the netdb functions getnameinfo(), + getservbyport(), and getservbyport_r(). From Michael Jung. + + * Documentation + + - Applied a style sheet to static HTML files. Put the TOC of each + document to the side, where it made sense (in some documents the + TOC was actually inside a section so it wasn't possible). In some + cases the TOC is built with a table, in others with a
      element, + so I had to accommodate for this. I also didn't go into collapsing, + although this could really help for some long TOCs. From Matias N. + - Coding Standard: Add a brief section summarizing the major + differences between the NuttX C and C++ coding standards. This is a + stop-gap measure in lieu of having a real C++ coding standard. From + Gregory Nutt. + - Coding Standard: Update requirements for indenting C pre-processor + statements. From Gregory Nutt. + - Coding Standard: Small change discouraging the practice of + enclosing the value argument of 'return' statements in parentheses. + From Gregory Nutt. + - COPYING. Tools in the tools/ directory are not intended for binary + redistribution and may not all conform to BSD licensing. From + Gregory Nutt. + + * Tools: + + - tools/ocdconsole.py: OCD TCL interface changed after version 0.10 + of OpenOCD. This change allows the script to work with both the + older and newer TCL interface. From Dave Marples. + - tools/nxstyle.c: Tool depends on the file under test containing + "Private Functions" or "Public Functions" block comments. Emit an + error if neither are present in a C source. From Gregory Nutt. + - tools/nxstyle.c: Bandaid-up logic that detects left brackets on the + same line in global structure/enumeration types and initializers. + From Gregory Nutt. + - tools/nxstyle.c: No warning for declarations that begin in column 1 + within 'extern "C"'. This is because the 'extern "C"' is conditioned + on __cplusplus so the declarations are not normally indented. From + Gregory Nutt. + - tools/: Add spk binary format. The .spk binary format is used on + SPresence and other boards based on the CXD56 arch. To enable this + binary format set in your config CONFIG_CXD56_BINARY=y. From Alin + Jerpelea. + - tools/: Add flash_writer for CXD56 boards. This flash writter is + using the xmodem for firmware transfer for flashing please use: + 'tools/flash_writer.py -s -c /dev/ttyUSB0 -d -b 115200 -n nuttx.spk'. + From Alin Jerpelea. + + * apps/ General: + + - Removed all references to CONFIG_DISABLE_POLL. The standard POSIX + poll() can no longer be disabled. From Gregory Nutt. + + * Examples/Tests: apps/examples: + + - apps/examples/abntcodi: Adds test/demo program for ABNT CODI + library. From Alan Carvalho de Assis. + - apps/examples/webserver: Update to compile with + CONFIG_NETUTILS_HTTPD_SENDFILE=y. Also some configs such as + CONFIG_NETUTILS_HTTPDFILESTATS can be selected by menuconfig. + From Masayuki Ishikawa. + - apps/examples/chrono: Add chronometer apps example. From Alan + Carvalho de Assis. + + * Network Utilities: apps/netutils: + + - apps/netutils/webserver: Add mp3 mime type to httpd.c. From + Masayuki Ishikawa. + - apps/netutils/webserver: Add directory listing to httpd. From + Masayuki Ishikawa. + - apps/netutils/webserver: Add web server info based on uname(). + From Masayuki Ishikawa. + + * Network Utilities: apps/wireless + + - apps/wireless/gs2200m: Add usrsock daemon for Tilt GS2200M Wi-Fi + module. From Masayuki Ishikawa. + - apps/wireless/gs2200m: Add channel parameter for AP mode. From + Masayuki Ishikawa. + + * Graphics: apps/graphics: + + - apps/graphics/nxglyphs: Add more modern looking button images for + the Twm4Nx CONTEMPORARY theme. From Gregory Nutt. + - apps/graphics/slcd: Adds a CSLcd class that will generate graphic + simulated segments of an SLCD display. From Gregory Nutt. + - apps/graphics/twm4nx: This change adds a calibration screen to + Twm4Nx. In addition to the Calibration screen port from NxWM, this + required extensions to the event handling logic to support (1) + receiving raw, uncalibrated touchscreen inputs, (2) shutting down + of externally controlled windows. From Gregory Nutt. + - apps/graphics/twm4nx: Move application-related files into different + directories to separate them from the core Twm4Nx files. From + Gregory Nutt. + - apps/graphics/twm4ndx: Compile out cursor support if we are using a + mouse. From Gregory Nutt. + - apps/graphics/twm4nx: Add an alternative COMPONTEMPORARY theme. + Still has some artifacts on the display. From Gregory Nutt. + - apps/graphics/twm4nx: Use custom CWidgetStyle to force Icon + background to match selected desktop background. From Gregory Nutt. + - apps/graphics/twm4nx: Add some definitions to support Themes. + Background image is now optional. From Gregory Nutt. + - apps/graphics/twm4nx: Add a configuration option to control the + number of buttons in one column of the Icon Manager. The Icon + anager no longer relies the default window width; now it + determines a preferred window width based primarily on the font + size. From Gregory Nutt. + - apps/graphics/tmw4nx: Add a CClock class that implements the + Twm4Nx digital clock based on the CSLcd simulated SLCD segements. + From Gregory Nutt. + - apps/graphics/twm4nx/README.txt: Add an overview of how to create + Twm4Nx applications. From Gregory Nutt. + + * Industry: apps/industry: + + - apps/industry/abnt_codi: Adds support for ABNT CODI library. This + is an energy meter protocol used in Brazil. From Alan Carvalho de + Assis. + +Bugfixes. Only the most critical bugfixes are listed here (see the +ChangeLog for the complete list of bugfixes and for additional, more +detailed bugfix information): + + * Core OS: + + - Semaphores: Fix a bad assertion in priority inheritance logic. + The comments state correctly that we cannot make any assumptions + about the number of holders of the semaphore, yet the code + asserts if there are any holders. This makes the code behave + closer to what the comments say. From Gregory Nutt. + - Memory Manager: Fix error that occurs when CONFIG_CPP_HAVE_VARARGS + is not defined. In that case, the arguments to the debug macro will + all be evaluated even though they are not used any variables that + are references must at least be defined. From Gregory Nutt. + - System Calls: Adapt the conditional compile logic on when to + include the vfork() syscall proxy and stub to the logic used for + vfork() itself. From Michael Jung. + - System Calls: Fixed SYS_mount syscall define when CONFIG_FS_READABLE + is undefined. From Joao Matos. + - waitpid(): In waitpid, remember to grab the exited child ptr. After + being unblocked in waitpid, the child pointer might be NULL. Modify + to use group_exitchild to get the pointer of recent exited child. + From Yang ChungFan. + + * File System/Block and MTD Drivers: + + - MMC/SD: Fixes bug where thread gets deadlocked due to recursive call + and addresses comment regarding events. When initializing the + MMCSD, if we are being told there is a card, but we fail to + initialize it, we should not re-register for an insertion event as + this will immediately cause us to call in again. Instead, we should + register for a removal event and wait for the card to be removed and + re-inserted. From Anthony Merlino. + + * Networking/Network Drivers: + + - UsrSock: Fix debug logs and remove DEBUGASSERT from + usrsockdev_do_request(). In a client mode, socket() will be the + first request for usrsockdev_do_request(). However, in a server + mode, the first request to accepted sockets will be recv() or other + which depend on applications. So I think we should remove thi + DEBUGASSERT from usrsockdev_do_request(). From Masayuki Ishikawa. + - ICMPV6 Autoconfig: Use ntohs() to convert IPv6 address from + network to host order int network debug output. From Bernd Walter. + - TCP Buffering: Fix TCP buffer send deadlock in iob_copyin() when + IOB buffers are exhausted and network lock is taken. From + Valmantas Paliksa. + - TCP Close: Fix TCP active close in inet_close.c. In previous + implementation, FIN packet was not sent when a socket is actively + closed (e.g. telnetd or webserver) without SO_LINGER. This issue + happens because the socket closing sequence waits for the + status.cl_sem only if lingering timeout is set. However, in many + server use-cases, SO_LINGER is not usually set and even in these + cases, FIN packet must be sent correctly. This changes the logic + in inet_close.c so that it can wait for status.cl_sem regardless + of SO_LINGER. Instead, if SO_LINGERis set, it waits for the + semaphore with timeout option. From Masayuki Ishikawa. + - UDP: Fix C89 compatibility problem. Empty initializers are not + permitted. Caused eZ80 build failure. From Gregory Nutt. + - Telnet: Fix a C89 non-compliance that was breaking the eZ80 build. + From Gregory Nutt. + + * Wireless/Wireless Drivers: + + - NRF24L01: Fix NRF24L01_NCMDS in ioctl.h. The last one in + nrf24l01.h is _WLCIOC(NRF24L01_FIRST + 15) From Masayuki Ishikawa. + - NRF24L01: Fix PIPENO/PKTLEN bitmask in RX FIFO header. In RX FIFO + header, the first byte should use 5 lsb to store PKTLEN and 3 msb + to store PIPENO. However, FIFO_PIPENO_SHIFT was set to 4 which + causes the lsb of pipe number to interfere with the received packet + size stored in the FIFO. This fix RX corruption when using pipe + number > 0. From Federico Braghiroli. + + * Graphics/Display Drivers: + + - Raising Windows: Fix a critical list handling bug in the graphics + system. When a lower-level window was raised while a model window + was in place, then list corruption could occur. From Gregory Nutt. + + * Common Drivers: + + - Serial: Limit the number of times that the poll semaphore is + incremented. From Dave Marples. + - USB Host: Remove duplicate const in USB Host files. From Adam + Porter. + - USB Host Composite: Class-specific descriptors were not available + if the interface is part of a composite device, since only interface + and endpoint descriptors are copied by usbhost_copyinterface(). + This change will copy any class-specific interface descriptors for + use in downstream class drivers. The loop was aborting due to + finding two interface descriptors back-to-back. From Adam Porter. + - USB Host Composite: The cfgdesc pointer was initialized after the + buffer had been advanced, so it was not pointing where it should. + The totallen operations at the end of the function ended up + overwriting memory belonging to the first copied interface + descriptor. From Adam Porter. + - USB MSC: Fix usbmsc_exportluns declaration. Fixes the following + error "...undefined reference to `usbmsc_exportluns'". From Alin + Jerpelea. + + * Architecture Common: + + - Rename all arch//src//chip directories to + arch//src//hardware. This eliminates a name collision + that is usually harmless but does cause problems at the time. The + problem is because the include path includes '.' and 'chip/.', + therefore an inclusion like '#include /src//chip and at arch//src/chip/chip. + From Gregory Nutt. + + * Board Common: + + - Default Configurations: Update configurations for changes to + apps/netutils/netinit configuration. MAC address configuration + was represented by type long long. That is a problem for + architectures that do not support type long long. Replaces by + two long configuration items. From + Gregory Nutt. + - Default Configurations: Change CONFIG_NSH_MACADDR to + CONFIG_NETINIT_MACADDR From Masayuki Ishikawa. + - Default Configurations: Fix mac address settings for RNDIS. + Recently CONFIG_NETINIT_MACADDR_2 and CONFIG_NETINIT_MACADDR_1 were + newly introduced instead of CONFIG_NETINIT_MACADDR. This change + conforms to this change. From Masayuki Ishikawa. + - Default Configurations: Kconfig files should not select + SCHED_WORKQUEUE since that is really only is only the logical OR if + SCHED_LPWORK and SCHED_HPWORK. Selecting it has no effect other + than to produce an erroneous configuration. From Gregory Nutt. + - Linker Scripts: Make sure sections are aligned to 32-bits in all LD + linker scripts. This fixes and issues noted specifically for the + SAMD21 by Bernd Walter, but should be applicable to all other LD + scripts as well. + - Linker Scripts: Add . = ALIGN(4); before every .data section, + add . = ALIGN(4); before every ARM.extab section, add . = ALIGN(4); + before every definition of __exidx_start, add . = ALIGN(4); before + every .init_section. Convert TABs to spaces in all ld linker + scripts. This just makes things easier to modify with scripts + because the files are more consistent. From Gregory Nutt. + - configs/Board.mk: Cannot call $(AR) directly. That works only with + GCC. It must, instead use the ARCHIVE command from Config.mk as do + other Makefiles. From Gregory Nutt. + + * MIPS32: + + - Fix a copy-paste error. On vfork, the GP register was being set to + the new SP value vs. the context GP value. NOTED in Bitbucket issue + 155. From Gregory Nutt. + - An older commit used CP0 register definitions that were not defined + in the NuttX cp0.h header file. Probably these were from the + Microchip hacked up GCC toolchain but are not generally available + outside that toolchain. Fix: Add definitions to NuttX cp0.h header + file. From Gregory Nutt. + + * Microchip PIC32MZ Drivers: + + - PIC32MZ GPIO: Use LAT instead of PORT when writing. From Ouss4. + + * Microchip/Atmal SAM3/SAM4 Drivers: + + - SAMD2/L2: Correct TC register bit field definitions used with + TC_CTRLBCLR and TC_CTRLSET registers. From Bernd Walter. + + * NXP LPC17xx Boards: + + - LPC17xx PROTECTED: On the LPC1769 there are two 16 KiB AHB SRAM + blocks, which are mapped back to back at physical address 0x2007C000 + and 0x20080000 (i.e. right below and right above a 512 KiB boundary). + Memory from those two blocks is considered continuous when assigned + to a heap. In the protected build mode, when the memory protection + unit is used, though, it must be split into two MPU regions. This + is because MPU regions must be naturally aligned, and the 32KiB + continuous address space of the two 16KiB AHB SRAM blocks does not + start at an address divisible by 32KiB. The only other + configurations that use protected build mode on lpc17xx are + currently open1788/knsh and open1788/knxterm. The LPC1788 has the + AHB SRAM blocks mapped more sanely (from an MPU region point of + view), which is probably why no problems emerged here. Both still + compile with my change and other than wasting an MPU region (which + would otherwise remain unused) should work fine. That said, I + have no hardware to confirm. From Michael Jung. + + * NXP LPC54xx Boards: + + - LPCXpresso-LPC54628: Modify the TWM configurations to properly + inject keyboard data. This way, in the case of multiple NxTERMs, + only the NxTerm at the top of the hierarchy gets the keyboard input. + Otherwise, it is not possible to use multiple NxTerms with each the + keyboard input going to a different NxTerm window. From Gregory + Nutt. + + * NXP i.MXRT Drivers: + + - i.MXRT Serial: Fix serial TIOCSINVERT From David Sidrane. + - i.MXRT USDHC: USDHC Stopgap Fix for build breakage From David + Sidrane. + - i.MXRT USDHC: Fix compiler error for CONFIG_IMXRT_USDHC1 && + !CONFIG_IMXRT_USDHC2 From David Sidrane. + + * On Semiconductor LC823450: + + - LC823450-XGEVK: Remove CPU assignment for LPWORK. This change will + reduce audio under-run when running dvfs auto mode. From Masayuki + Ishikawa. + + * SiLabs EFM32 Drivers: + + - EFM32 USB Host: Apply Adam Porter's STM32 fix to EFM32 which has + the same IP. From Gregory Nutt. + + * STMicro STM32: + + - STM32F1 Pinmap: Fix names for complementary PWM outputs From + Mateusz Szafoni. + - STM32L4: If SRAM3 is used as heap, do not power it off in stop 2 + mode. From Juha Niskanen. + + * STMicro STM32 Drivers: + + - STM32 ADC: Fix a compilation error when verbose analog debugging is + enabled for the STM32 ADC. not all STM32s have an SQR4 register. + From rajan gill. + - STM32 PWM: Fix pulse count for the number of counts greater than 128. + From Mateusz Szafoni. + - STM32 USB OTG FS/HS Host: In stm32_ctrlout() in the HS and FS host + drivers, the data buffer isn't sent. This patch passes the buffer + and buflen to the stm32_ctrl_senddata() function. With this change, + I am able to send MBIM control messages to my USB modem, and read the + response. From Adam Porter. + - STM32L4 USB: Fix USB device PMA accesses. USB PMA accesses are + done as 16-bit words on STM32L4 instead of 32-bit words on STM32L1. + From Jussi Kivilinna. + - STM32L4 OTG FS/HS: Fix constant using in comparison to determine + endpoint is interrupt type. From Adam Porter. + - STM32F7 OTG FS/HS: Fix constant using in comparison to determine + endpoint is interrupt type. From Adam Porter. + - STM32H7 PWM: Fix pulse count for the number of counts greater than 128. + From Mateusz Szafoni. + - STM32H7 Serial: Fix error when SINGLEWIRE or + CONFIG_STM32H7_SERIALBRK_BSDCOMPAT defined. From David Sidrane. + - STM32H7 SPI: Correct a typo in condition compilation. From + Jonathan Richner. + - STM32H7 Timer: Fixed compile errors with TIM13, TIM14, TIM7. From + David Sidrane. + - STM32H7 USB OTG FS/HS: Fix constant using in comparison to determine + endpoint is interrupt type. From Adam Porter. + - STM32G0 Serial: Fix STM32G0 error when SINGLEWIRE or SERIALBRK_BSDCOMPAT + defined (it reflects previous changes in STM32H7). From Mateusz Szafoni. + + * STMicro STM32 Boards: + + - Nucleo-L432KC: Shorten some long lines, fix i2c pinout. From + Sebastien Lorquet. + - STM32L476VG-Disco: Fix an error in defconfig files because a line + in the rcS file was longer than the configured NSH command line. + From Juha Niskanen. + - STM32L4R9AI-Disco: Fix an error in defconfig files because a line + in the rcS file was longer than the configured NSH command line. + From Juha Niskanen. + - OmnibusF4: Correct naming of a configuration variable for ROMFS. + From Phil Coval. + - Olimex-STM32-E407: Change initialization to match the way it is + done with other boards. From Gregory Nutt. + - Olimex-STM32-E407 SPI: Add SPI initialization logic. From Juan + Flores. + - STM32F4-Discovery ROMFS: Missing colon in declaration of local + variable. From Phil Coval. + - STM32F4-Discovery ROMFS: Correct naming of a configuration variable + for ROMFS. From Phil Coval. + - STM32F4-Discovery Build: Fix .ARM.exidx section overlap Source: + https://stackoverflow.com/questions/30778614/arm-none-eabi-ld-section-arm-exidx-overlaps-section-data. + From Alan Carvalho de Assis. + - STM32F4-Discovery PROTECTED: Fix a problem with undefined symbol + 'abort' from GCC library in PROTECTED build. Fix by moving libgcc + into recursive archive group between --start-group and --end-group. + Other kernel/Makefiles suffer from this same issue From Gregory + Nutt. + - Nucleo-H743ZI SPI: Correct typos in function naming. From Jonathan + Richner. + + * TI AM335x: + + - AM335x SYSCLK: Add a function to return a frequency of the system + clock. From Gregory Nutt. + - AM355x CM: Fix a typo in a macro name. From Gregory Nutt. + - AM355x LCD: Fix a few typos. Add things needed by the LCDC driver. + From Gregory Nutt. + + * TI Tiva Drivers: + + - Tiva Ethernet: Add a workaround for tiva with qemu. With qemu, + tiva_ifup() hangs because Ethernet link status can not be set + correctly. This change is a workaround to avoid this issue. From + Masayuki Ishikawa. + + * TI Tiva Boards: + + - TM4C1294-Launchpad: Fix syntax error in oocd.sh script. From + Nathan Hartman. + + * ZiLOG Common: + + - z80: up_addregion() must be prototyped in nuttx/mm/mm.h, not + up_internal.h. Various name changes to better conform to the coding + standard, naming conventions, and use by other architectures. From + Gregory Nutt. + + * ZiLOG Z80 Boards: + + - z80sim: Remove unused function up_earlyserialinit() from serial + driver. From Gregory Nutt. + + * ZiLOG z16f ZNeo: + + - z16f ZNeo: Replicate build changes make for eZ80 and z8 for ZNeo. + From Gregory Nutt. + - ZNeo compile fixes: Fix misuse of FAR which makes a difference on + this platform. Be consistent in use of WDOG_ID type. ZDS-II doesn't + like auto-conversions of struct wdog_s * to WDOG_ID (which is type + struct wdog_s *). From Gregory Nutt. + + * ZiLOG eZ80Acclaim!: + + - eZ80: Fix eZ80 compile problems due to New ZDS-II toolchain and + ongoing bit rot due to non-C89 code creeping into the core OS. From + Gregory Nutt. + - eZ80: Fix some backward conditional logic in Make.defs. From + Gregory Nutt. + - eZ80: Fix a logic error in vector initialization. From Gregory Nutt. + + * C Library/Header Files: + + - signal.h: Fix a C89 compliance problem that cause the eZ80 build to + fail. Empty structure and unions are not accepted by the compiler. + From Gregory Nutt. + - wqueue.h: Allow definitions even if work queues are not enabled. + This solves build failures when work queues are not enabled. From + Gregory Nutt. + - fixedmath.h: Regarding the single precision float to/from fixed + point conversions in fixedmath.h, I believe the floating point + literals should be appended with the letter 'f' to avoid (expensive) + conversions from single to double precision, and thereby also avoid + (expensive if done in SW) double point arithmetic (which is what is + happening upon inspection of my disassembly). From rajan gill. + + - stdio: Fix long long usage in all of the newer printf-related + logic: The selection CONFIG_LIBC_LONG_LONG must be ignored if the + architecture does not support long long types. From Gregory Nutt. + - gm_time_r(): Spurious reorganization of a loop in gm_time_r() to + work around and ZDD-II internal compiler error. Might be a little + bigger now, but is also probably a more structured use of C. From + Gregory Nutt. + - Debug: For platforms whose CPP tool does not support a variable + number arguments to pre-processor macros, we may still need to build + the debug functions even when CONFIG_DEBUG_FEATURES is not selected. + For example, __alert() may be needed if CONFIG_ARCH_STACKDUMP is + set. From Gregory Nutt. + + * Tools: + + - tools/nxstyle.c: Fix error in conditional logic that was preventing + detection bad brace alignment. Add logic to handle alignment of + braces in data initializers which following slightly different + indentation rules. From Gregory Nutt. + - tools/mkexport.sh: The mcu sub-directory chip/ was renamed to + hardware/ in late May of 2019. The mkexport.sh script that copies + these files was not updated, however, until now. Noted by Alin + Jerpelea. From Gregory Nutt. + + * NSH Library: apps/nshlib: + + - apps/nshlib: Fix all places where cle() and readline() are used. + readline() returns EOF on a failure. cle() returns a negated errno + value. Checking only for EOF causes failues to be missed (and + infinite loops ensuing). From Valmantas Paliksa. + - nshlib/nsh_parse.c: Fix a warning about an uninitialized variable + from the ZDS-II compiler. From Gregory Nutt. + - apps/nshlib/nsh_ddcmd.c: Seemingly nonsense change but somehow + works around a compilation error using the ZDS-II toolchain. It + was claiming that vtbl was undefined indd_outfopen(). From Gregory + Nutt. + + * Network Utilities: apps/netutils: + + - apps/netutils/netinit: MAC address configuration was represented + by type long long. That is a problem for architectures that do not + support type long long. Replaces by two long configuration items. + From Gregory Nutt. + - apps/netutils/telnetd/telnetd_daemon.c: Fix a C89 violation that + caused the eZ80 build to fail. From Gregory Nutt. + - apps/netutils/json: Removed. Replaced with apps/netutils/cjson. + From Gregory Nutt. + + * Graphics Utilities: apps/graphics: + + - apps/graphics/twm4nx: Fix an uninitialized variable that was + causing toolbar buttons to randomly come up enabled or disabled. + Remove some unused event definitions. From Gregory Nutt. + - apps/graphics/twm4nx: Fix a calibration screen startup issue. + Make an initial calibration screen optional. From Gregory Nutt. + - apps/graphics/twm4nx: Revise logic to detect clicks on the + background image. The original implementation had some side + effects. From Gregory Nutt. + - apps/graphics/twm4nx: Remove some remaining stuff from TWM that + was never used. Menus need to close after the 'terminal' selection + is made. Otherwise, the menu can become buried under a newly open + menu and not easily recovered. From Gregory Nutt. + - apps/graphics/twm4ndx: Add a 'critical' bit to the eventID. While + resizing, all events will be ignore except those marked critical. + From Gregory Nutt + - apps/graphics/twm4nx: CBackground now brings up the main menu if + the background image is clicked. This makes the behavior the same + across all of the background except when an icon is clicked. From + Gregory Nutt. + - apps/graphics/twm4nx: Fix a bug in placement of icons on the + desktop. When many windows are displayed, a bug in the looping logic + could cause an infinite loop. From Gregory Nutt. + - apps/graphics/twm4nx: Fix some errors found when enabling NX + keyboard support. The most important being that the mouse and + keyboard drivers need to be opened non-blocking. From Gregory Nutt. + +NuttX-8.1 Release Notes +------------------------ + +The 132nd release of NuttX, Version 8.1, was made on September 14, 2019, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-8.1.tar.gz and +apps-8.1.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +The major release version number is only incremented when there is a major +change to the OS that makes it more-or-less incompatible with preceding +versions. This release bumps the major version number from 7 to 8 due +primarily to a major reorganization in the what was the configs/ directory +in nuttx-7.31. That directory has been renamed boards/ and now has a +directory structure that mirrors the organization of the arch/ directory +for the most part: + + board/ - Holds all board-related information + board/ - Holds board-related information for all boards that use + the same CPU architecture. For example, all ARM-based boards will be + found under board/arm + board// - Holds board-related information for all boards + that use the same MCU chip family. For example, all STM32-based + boards will be found under board/arm/stm32 + board/// - Holds board-related information for a + specific board. This is analogous to the configs/ directory in + nuttx-7.31. So, for example, the STM32F4-Discovery board support that + was at configs/stm32f4disovery can now be found under + boards/arm/stm32/stm32f4discovery. + boards//// - All configurations for a + specific board can now be found together in this configs/ + subdirectory. So, continuing the example, the STM32F4-Discovery NSH + configuration can now be found at + boards/arm/stm32/stm32f4discovery/configs/nsh. + +In additional, common MCU logic can be found at board///common +and MCU common drivers can be found at board///common. Related +changes include changes to tools/, comments, and documentation that depend +on the board directory structure. + +This re-organization is the work of Alin Jerpelea. Not only did Alin do +this major directory re-organization, but he ran the code standard +compliance tool and corrected every .c and .h file under boards/ so that +they all correctly follow the NuttX coding style. These changes were very +extensive and, hence, will not be addressed individually in the ReleaseNotes. + +You have to give Alin credit for his effort to take on really big jobs and +stick with it until it is finished. Kudos! + +A more constrained re-organization of the drivers/ directory was also +contributed by Augusto Fraga Giachero. Augusto reorganized some driver +directories to make better functional associations and also to make space +for a new set of RF-related drivers. + +Additional new features and extended functionality: +--------------------------------------------------- + + * Core OS: + + - POSIX Message Queues: Add a test to verify that message queue is + closed by the same task group that opened it. If not, then list + corruption would result. This test is only performed if + CONFIG_DEBUG_FEATURES is enabled since it should not normally be an + issue: It would be a strange programming practice to open a + message queue in open task group, then close it in another. From + ???. + - Signal Notifications: Add configuration option to select either the + high-priority or low-priority work queue for SIG_EVTHREA + notifications. From ligd. + - System Calls: In order to support built-in in function in protected + mode, a task_spawn() system call must be supported. task_spawn() + and posix_spawn() are NuttX OS interfaces. In PROTECTED and KERNEL + build modes, then can be reached from applications only via a system + call. Unfortunately this is overly complex because there is a (soft) + limit of 6 parameters in a system call; task_spawn has seven + parameters. This is a soft limit but still difficult to extend + because it involves assembly language changes to numerous + architectures. Better to get more creative. Rather than extend the + maximum number of parameters across all architectures, I opted + instead to marshal the seven parameters into a structure and pass + only a single parameter: A pointer to the structure containing the + seven marshaled parameters. From Gregory Nutt. + - /etc/passwd and /etc/group: Improve the format of the /etc/passwd + file as used in the sim:nsh configuration. It is now a little + more similar to other systems and includes user and group IDs. Add + also an /etc/group file to support future testing. From Gregory + Nutt. + - User/Group IDs: Implement 'real' setuid, getuid, setgid, and getgid + interfaces is so configured (otherwise fall back to stubs that + support only the 'root' user ID and group. Once set, these IDs will + be inherited by all child task groups. From Gregory Nutt. + - Debug Output: Add debug macros for contactless. The various + contactless device drivers currently define device specific debug + macros within their local header files. This patch adds generic + ctls[info|warn|err] macros for the overall contactless subsystem to + be used in future drivers. Ported the existing contactless device + drivers to use these generic logging macros and fixed some logging + bugs along the way. From Michael Jung. + - IOB instrumentation. Introduces producer/consumer id to every IOB + call. This is so that the calls can be instrumented to monitor the + IOB resources and to collect usage statistics. From Anthony + Merlino. + - IOB ProcFS: Adding ProcFS support at /proc/iobinfo to show the data + collected from the IOB instrumentation. From Anthony Merlino. + - Versioning: Report GIT information via ProcFS. GIT info reported: + branch, version, GIT hash, hostname, user, build date. Integrates + into existing .version and ProcFS. From David Alessio. + + * File System/Block and MTD Drivers: + + - BinFS: The BinFS file system uses the same built-in library and + built-in arrays as does NSH. The built-in arrays are simple name- + value pairs that map built-in function names with the user-space + entry point. In the FLAT build, the built-in arrays are available + everywhere via the backdoor left open by the FLAT address space. + In the PROTECTED build, however, the kernel must maintain its own + reference to the user-space built-in array. This commit adds those + kernel globals and a new boardctl(BOARDIOC_BUILTINS) that can be + used by applications to the provide the built-in list reference to + the kernel. From Gregory Nutt. + - MMC/SD: Added support for MMC (eMMC) bigger than 2 GB (Tested with + IMXRT1050EVKB and samsung eMMC 16GB). + - AT24CSxx: Register a character driver for UUID of AT24CSxx chips. + Allows the UUID to read as a file or displayed from an nsh prompt with: + nsh> hexdump /dev/eeprom.uuid From David Alessio. + - Macronix FLASH: Add support for 4-byte addressing on >128Mb + Macronix flash parts From jjlange. + - MX25Rxx: Add support for 512B sectors. From Simon Piriou. + - SST26: Accept the 16MBit Flash when reading the JEDEC-ID at + initialization time. From Ouss4. + + * Network/Network Drivers: + + - IPv4 Options: Now handles reception of IPv4 packets with larger + IPv4 headers containing options. From Gregory Nutt. + - Sockets: Re-order the content of all address-family socket + 'connection' structures so that they begin with a common prologue. + This permits better use of logic for different address family + types. From Gregory Nutt. + - TCP: Make RTO and WAIT_TIME configurable. This fix is not really + correct: TCP RTO really should be calculated dynamically for each + TCP connection: http://sgros.blogspot.com/2012/02/calculating-tcp-rto.html. + From zhangyuan7. + - IP Forwarding: Check if interface is up early on when forwarding to + avoid extra work. As noticed in a previous wireless commit, when + forwarding is enabled and a packet comes in, the packet is attempted + to be sent on each other netdev without regard for whether it is in + the UP state. Of course this is eventually caught, but it can be + caught earlier to avoid unnecessary work, especially in the 6LoWPAN + case where a useless packet conversion will occur. From Anthony + Merlino. + - RNDIS: Expose option to change the number of write requests that + can be in flight. From Anthony Merlino. + - GS2200M: Add UDP support. From Masayuki Ishakawa + - GS2200M: Implement GS2200M_IOC_IFREQ IOCTL command. From Masayuki + Ishikawa. + - GS2200M: Enable NuttX's DHCP client instead of GS2200M's DHCP + client. From Masayuki Ishikawa. + - GS2200M: GS2200M now supports SIOCGIFHWADDR From Masayuki + Ishikawa. + + * Wireless/Wireless Drivers: + + - IEEE802.15.4 Network Driver: Allow 64-bit prefix to be configurable + when auto-configuring the IPv6 address during bring-up. Previously, + only the link-local prefix fe80::/64 was used. Also, put the + network in the DOWN state at the end of initialization. From + Anthony Merlino. + - IEEE 802.15.4 MAC: Adds support for energy detect. Adds support + for energy detect by introducing a new radio call/callback, as the + PHY layer is required to perform the energy detect. From Anthony + Merlino. + - IEEE 802.15.4 MAC: Adds support for getting/setting + macMaxFrameRetries via IOCTL. Add get support for rxonidle + attribute From Anthony Merlino. + - IEEE 802.15.4 MAC: Move the global iobuffer into the macnet struct + so that more than one macnet device can exist. From Anthony + Merlino. + - IEEE 802.15.4 MAC: Defer handling of extracting association + response to LPWORK queue. From Anthony Merlino. + - IEEE 802.15.4 Radios: Support dynamic FCS length. Adds + IEEE802154_ATTR_PHY_FCSLEN. This change introduces + IEEE802154_ATTR_PHY_FCSLEN which the radio layer can support to + set/get the FCS length that's added to the end of the frame. One + use case, in promiscuous mode, is to add back in the FCS of the + received frame by increasing the iob->io_len by the FCS length. + From Anthony Merlino. + - Xbee: Support "WR" AT command for writing parameters to non- + volatile memory. From Anthony Merlino. + - Xbee: Add configuration option for setting the default prefix + to use when bringing up the network and setting the IP address. + From Anthony Merlino. + + * Other Common Device Drivers: + + - RTC: If the RTC time is successfully set, then update the current + system time to match. From ligd. + - ADT7320: Add support for the ADT7320 temperature sensor. From + Augusto Fraga Giachero. + - DAC7554: Add support to the DAC7554 digital-to-analog converter. + From Augusto Fraga Giachero. + - DAT-31R5-SP+: Add support to the DAT-31R5-SP+ digital attenuator. + Creates a the new device driver directory drivers/rf/ to support + drivers related to RF peripherals. It also adds support for the + DAT-31R5-SP+ digital attenuator. From Augusto Fraga Giachero. + - ISL29023: Add basic driver of ISL29023 ambient light sensor. The + basic driver can set operational mode, range, and resolution. It + can also read lux value in continuous mode. Interrupt and the alarm + is not implemented. From Matous Pokorny. + - SHT3x: Add Sensirion SHT3x driver. From Markus Bernet. + + * Simulator: + + - Simulator Build: Even though the simulation has no "chips", it + needs to have CONFIG_ARCH_CHIP and chip sub-directories. Otherwise, + we would have to treat it as a special case in the build system + after the changes to the boards/ directory. From Gregory Nutt. + + * Microchip PIC32MZ: + + - PIC32MZ. Make the PLL input clock configurable. From Ouss4. + + * ARMv7-M + + - Add ARMv7-M setjmp/longjump functions. From David S. Alessio. + + * NXP i.MXRT: + + - i.MXRT Clocking: Enable TRACE clocks if the divider has been + defined in the board's board.h file. From Dave Marples. + + * NXP i.MXRT Drivers: + + - i.MXRT QEncoder: Adds quadrature encoder driver for IMXRT. From + Nicholas Chin. + - i.MXRT uSDHC: This change completes SDIO support for IMXRT, and + also adds support for WiFi using the AP6212A module based on Simon + Piriou's rather excellent work. The patch should also address + DavidS's concern about width setting for USDHC1 and 2. Testing of + the WiFi is minimal so far but functionality is proven. I'm + specifically not happy that the driver doesn't recover elegantly + from a DMA data checksum failure, but that is an issue that can be + dealt with in due course ... I'm trying to get the rest of the + interfaces fleshed out and the hardware proven so it can go for pre- + production build. I _think_ there's only Bluetooth and USB-device + left to implement now. From Dave Marples. + - i.MXRT uSDHC: IMXRT uSDHC driver cmd line reset logic modified. + From Ivan Ucherdzhiev. + + * NXP/Freescale Kinetis Drivers: + + - Kinetis Serial: Add possibility to specify pull-up instead of + open drain for serial single-wire mode. From Beat Kng. + + * NXP LPC17xx/40xx: + + - LPC17xx/40xx Build: Cortex-M system reset is applicable to + LPC17xx/40xx too. From Pavel Pisa. + + * NXP LPC17xx/40xx Drivers: + + - LPC17xx/40xx Ethernet: Follow the procedure listed in the + LPC176x/5x User Manual when reading from and writing to the PHY's + registers (section 10.11.14). I couldn't see any behavioral change + after this commit, but nonetheless is a good practice to follow the + manufacturer's recommended procedure. From Augusto Fraga Giachero. + + * NXP S31K1xx: + + - Added architecture support for the NXP S32K1xx family. Basic + support includes the boot up logic, clock configuration, LPUART + console, Systick timer, GPIO controls, and eDMA (unverified). + + * NXP S31K1xx Drivers: + + - S32K1xx eDMA Leverage eDMA logic from i.MXRT to S32K1XX. Appears + to be the same IP but with fewer channels and features than the + i.MXRT implementation. From Gregory Nutt. + - S32K1xx LPUART: Bring in the LPUART from i.MXRT. It is the same + IP. From Gregory Nutt. + - S32K1xx SysTick: Bring in Cortex-M0+ SysTick and interrupt handling + from samd2l2; bring in Cortex-M4F Systick and interrupt handling + from LPC54xx. From Gregory Nutt. + - S32K1xx GPIO: Bring in GPIO logic from Kinetis. Looks like similar + IP. From Gregory Nutt. + - S32K1xx Ethernet: Unverified port of the i.MXRT Ethernet driver to + the S32K1xx. The i.MXRT uses the same IP. From Gregory Nutt. + - S32K1xx LPSPI and LPI2C: Brings in the LPSPI and LPI2C peripheral + drivers from the i.MXRT which used the identical IP. From Gregory + Nutt. + + * NXP S31K1xx Boards: + + - S32K118EVB. This commit adds initial board support for the NXP + S32K118EVB development board. Currently supports only a minimal + NSH configuration. From Gregory Nutt. + - S32K118EVB: Implement board support for on-board LEDs and buttons. + This is taken from the Freedom-K66f with has the same LED and + button configuration as the S32K116EVB and uses the same GPIO IP. + LEDs, but not buttons, have have been verified. From Gregory Nutt. + - S32K146EVB: Adds initial board support for the S32K146EVB + development board. Currently supports a NSH configuration with a + richer feature set than the minimal configuration of the S32K118EVB. + From Gregory Nutt. + - S32K146EVB: Add support for execution out of SRAM. This is helpful + for bring-up when you want to avoid putting a lethal image in FLASH. + From Gregory Nutt. + - S32K148EVB: Add support for the NXP S32K148EVB development board. + Very similar to the S32K146EVB but with more on-chip memory and + hardware features. + + * Sony CXD56xx + + - CXD56xx: Migrate CXD56xx common code to the common/ directory: + Boot code, FLASH code, I2C driver, UID. From Alin Jerpelea. + - CXD56xx: Add SPH. The SPH is used by the ASMP implementation from + the SDK. From Alin Jerpelea. + + * Sony CXD56xx Drivers: + + - CXD56xx: Add sensors connected to the SCU on Spresense board: + o Avago APDS9930 Proximity and Ambient light Sensor. + o Rohm BH1721FVC Ambient Light Sensor. + o Rohm BH1745NUC Color Sensor. + o Rohm BM1383GLV/BM1383AGLV Pressure Sensor. + o Rohm BM1422GMV/BM1422AGMV Magnetic Sensor. + o Bosch BMI160 Sensor support. + o Bosch BMP280 Barometic Pressure Sensor. + o Kionix KX022/KX122 Acceleration Sensor. + o Murata LT1PA01 Proximity and Ambient light Sensor. + o Rohm RPR0521RS Proximity and Ambient light Sensor. + o BMI160: Add optional I2C address. + From Alin Jerpelea. + - CXD56xx: Add the sensor initialization for CXD56xx boards in the + common board folder: + o APDS9930: typo fix + o cxd56_ak09912 initialization. + o cxd56_bmi160 initialization. + o cxd56_apds9960 initialization. + o cxd56_bh1721fvc initialization. + o cxd56_bh1745nuc initialization. + o cxd56_bm1383glv initialization. + o cxd56_bm1422gmv initialization. + o cxd56_bmi160 initialization. + o cxd56_bmp280 initialization. + o cxd56_kx022 initialization. + o cxd56_lt1pa01 initialization. + o cxd56_rpr0521rs initialization. + o cxd56_sensors initialization. + o Backup Log driver. + o crashlog driver. + o Move gs2200m initialization. + o Move ili9340 initialization. + o Move lpm013m091a initialization. + From Alin Jerpelea. + + * Sony CXD56xx Spresense Board: + + - Spresense: Enable SmartFS and UDP support From Masayuki Ishikawa. + + * STMicro STM32: + + - STM32F4 PLLI2S: Add support to enable the I2S Phase Locked Loop on + STM32F427 and STM32F437 MCUs. From Michael Jung. + + * STMicro STM32 Drivers: + + - STM32 ADC: Add ADC calibration procedure for IP_ADC_V1. Tested on + STM32F100, and it magically increased result accuracy. STM32F103 + has the same calibration procedure. I am not sure about others. + From Matous Pokorny. + - STM32 SPI: TI Synchronous Serial Frame Format. The SPI macros on + STM32 MCUs now support the Texas Instruments Synchronous Serial + Frame Format protocol (TI protocol). Defined a new SPIDEV_MODETI + and add support for it in stm32_spi.c. From Michael Jung. + - STM32 UART: Serial add HW HS on UART 4 & 5. From David Sidrane. + - STM32 PWM: Configure multi-channel duty only if channel specified. + This allows you to update duty cycle for a single channel. From + Mateusz Szafoni. + - STM32F7 Ethernet: Add a timeout on MAC reset From David Sidrane. + - STM32F7 FLASH: Exposes stm32_flash_xxx functions. From Anthony + Merlino. + - STM32F7 PWM: Configure multi-channel duty only if channel specified. + This allows you to update duty cycle for a single channel. From + Mateusz Szafoni. + - STM32F7 UART: Serial add HW HS on UART 4 & 5. From David Sidrane. + - STM32H7 ADC: Fix internal channel numbers. From Markus Bernet. + - STM32H7 BBSRAM: Add BBSRAM support. From David Sidrane. + - STM32H7 DTCM: Port DTCM from F7 From David Sidrane. + - STM32H7 I2C: Select ARCH_HAVE_I2CRESET in configuration. From + David Sidrane. + - STM32H7 PWM: Configure multi-channel duty only if channel + specified. This allows you to update duty cycle for a single + channel. From Mateusz Szafoni. + - STM32H7 RCC: Fix RCC register definitions and typos for ADC/UART. + From Markus Bernet. + - STM32H7 RTC: Ported over F7 RTC. From David Sidrane. + - STM32H7 SPI: Allow more clock sources. From David Sidrane. + - STM32H7 UART: Serial add HW HS on UART 4 & 5. From David Sidrane. + - STM32H7 UART: Fix typo in UART8 configuration. From Markus Bernet. + - STM32H7 UID: Ported UID from F7 From David Sidrane. + - STM32L4 PWM: Configure multi-channel duty only if channel specified. + This allows you to update duty cycle for a single channel. From + Mateusz Szafoni. + - STM32L4 UART: Serial add HW HS on UART 4 & 5. From David Sidrane. + + * STMicro STM32 Boards: + + - B-L475E-IOT01A: Add mx25rxx memory chip and smartfs support in NSH + configuration. From Simon Piriou. + - LX_CPU: Add support for the PIKRON LX_CPU board. From Pavel Pisa. + - Nucleo-F303RE: Add basic NSH configuration. From Mateusz Szafoni. + - Nucleo-F303RE: Enable console on UART2 and set entry point to + nsh_main() in the PWM configuration. From Mateusz Szafoni. + - Nucleo-H743ZI: Add RTC support. From David Sidrane. + - Nucleo-L432KC: Added GPIO drivers for use with /apps/examples/gpio. + From Daniel P. Carvalho. + - Nucleo-L432KC: Added Zero Cross sensor to nucleo-l432kc. From + Daniel P. Carvalho. + + * TI Tiva: + + - Tiva: Add support for Tiva TM4C123AH6PM. From Nathan Hartman. + - Tiva Configuration: Modify preprocessor logic to support + configurations with no UART. Now similar to logic for other + architectures. From Nathan Hartman. + - Tiva Interrupts: Add handling for IRQs 128 thru 159. From Nathan + Hartman. + + * TI Tiva Drivers: + + - TM4C QEncoder: Reinstate TM4C qencoder driver and expand its + ioctls. Add TIVA_HAVE_QEI0, TIVA_HAVE_QEI1 as applicable to each + ARCH_CHIP_TM4C12*. Rewrite tiva_qe_setup(). Replace tiva_qe_ppr() + with tiva_qe_resetatppr(). Add tiva_qe_resetatmaxpos() and + tiva_qe_resetatindex(). Add missing definitions: + SIGMODE_QUADRATURE, SIGMODE_CLK_AND_DIR, SWAP_NO_SWAP, SWAP_PHA_PHB. + Rename TIVA QEI ioctl QEIOC_PPR to QEIOC_RESETATPPR; add TIVA QEI + ioctl identifiers QEIOC_RESETATMAXPOS, QEIOC_RESETATINDEX. From + Nathan Hartman. + + * TI Tiva Boards: + + - TM4C1294-Launchpad: Enables /dev/userleds in board bring-up for + tm4c1294-launchpad by calling userled_lower_initialize() in + tm4c_bringup(). From Nathan Hartman. + + * TI Tiva Drivers: + + - Tiva GPTM timers: Implement 16-bit PWM mode. Add + tiva_pwm16_sel_event() to choose GPTMCTL.TnEVENT value. Implement + tiva_pwm_mode16(). This also involved numerous corrections to the + 16-bit timer logic. Add tiva_timer16pwm_setperiodduty() to set + initial period, duty cycle, and enable interrupts if requested in + GPTM peripheral. Interrupts are not enabled in NVIC until + tiva_timer16_start() is called. Add tiva_timer16pwm_setduty() to + update duty cycle at any time. Add new TIMER_FLAG_* configuration + flags to enable configuring the 16-bit PWM feature. Extend type of + "flags" in tiva_timer32config_s and tiva_timer16config_s from 8- to + 32-bits to allow more flags. From Nathan Hartman. + + * Build System: + + - Export Build: Export all variables/files to support architecture + independent build against NSH. From Pavel Pisa. + - Application Export: This change too build tools allows to export + built-in applications registry into temporarily created directory + where export archive content is prepared. If the Makefile in apps/ + directory does not define export: target then error is print but + export continues without interruption. It would be more logical to + print warning but there is no way instruct apps make to not print + error. From Pavel Pisa. + - boards/Board.mk: Add support to pass dependency paths. From + Gregory Nutt. + + * Libraries/Header Files: + + - libs/libc/libc.csv: Add some missing C library functions. From + Pavel Pisa. + - libs/libc/libc.csv: Add ioctl() to fs_ioctl() wrapper for varidic + case. From Pavel Pisa. + - libs/libc/builtin/: Moves shared built-in information out of + binfmt/libbuiltin and into libs/libc/builtin where it can be shared + with applications. This should permit built-in application in the + PROTECTED build where binfmt/libbuiltin was not available in user + space. From Gregory Nutt. + - libs/libc/dirent/: Added alphasort() implementation, scandir() + implementation and DT_* definitions to include/dirent.h. Apparently + those definitions are not required by POSIX, but are part of + 4.3BSD and available in glibc as well. From Michael Jung. + - libs/libc/grp/: Added stubbed implementations of getgrgid, + getgrgid_r, getgrnam, getgrnam_r, and initgroups. These functions + are essentially stubs pretending that NuttX supported groups and + that the only configured group in the system was 'root' with gid 0. + The intend is not to provide meaningful new features, but to ease + porting of foreign source code to NuttX. From Michael Jung. + - libs/libc/machine/arm/armv7-m/: Add Cortex M4F machine optimized + fabsf and sqrtf. From David S. Alessio. + - libs/libc/pwd/: Added stubbed implementations. Added stubbed + implementations of getpwuid, getpwuid_r, getpwnam, and getpwnam_r. + These functions are essentially stubs pretending that NuttX + supported users and that the only configured user in the system + was 'root' with uid 0. The intend is not to provide meaningful + new features, but to ease porting of foreign source code to NuttX. + From Michael Jung. + - libs/libc/pwd and libs/libc/grp/: Modify to get user/group data + from /etc/passwd and /etc/group if so configured. From Gregory + Nutt. + - libs/libc/stdio/: Add support for the size_t integer qualifier 'z' + to the printf family. This is kind of tricky due the variety of + sizeof(size_t) on different platforms. From David Sidrane. + - libs/libc/unistd.h: Added stubbed implementations of setuid() and + setgid(). These functions are essentially stubs pretending that + NuttX supported users and groups and that the only configured user + and group in the system were both 'root' with a uid and a gid of 0, + respectively. The intent is not to provide meaningful new features, + but to ease porting of foreign source code to NuttX. From Michael + Jung. + - libs/libc/unistd/: Add getuid() and getgid() stubs to match + MichaelJung's setuid() and setgid(). From Gregory Nutt. + - libc/libc/unistd/: Add stubs for geteuid(), getegid(), seteuid(), + setegid(), setreuid(), and setregid(). NuttX does not currently + support effective user/group IDs, but these stubs will support + linkage of applications that expect these POSIX standard interfaces. + From Gregory Nutt. + + * Symbol Tables: + + - NuttX provides lists of available syscalls and library functions and + tools to process them. The lists can be used to build symbol table + which allows runtime program loading which can reuse functions + already compiled into NuttX system image. List processing, + compilation and linking to the final system image has been possible + only under manual control until now. Provided changes add option + (CONFIG_EXECFUNCS_GENERATE_SYSTEM_SYMTAB) to build complete list of + available functions and syscalls automatically. The symbolic table + is generated in form libsymtab.a which can be reused by application + or directly pull in when "g_symtab" and "g_nsymbols" variables are + requested by EXECFUNCS configuration. I have tried to follow + mechanisms for library compilation in different kernel protection + modes but tested only flat no-MMU build. The basic assumption is + that this library and libraries providing syscall stubs and C- + library functions are available in user-space context and initial + application (usually NSH) registers the symbol table through IOCTL. + The table can be reused then by another applications in their + address space as kernel allows. Simple for flat or protected mode, + I am not sure if really support in MMU mode. It is highly probable + that I have made some mistake, overlooked something, but the + functionality is optional (should not cause troubles in any mode if + disabled) and main purpose is to lower memory overhead when more + applications are loaded on memory constrained system which usually + use direct kernel calling without protection or address space + separation. If the table should be provided by kernel to + applications then makefiles has to be adjusted. From Pavel Pisa. + + * Tools: + + - tools/: Change preferred argument of configurations tools to use + ':' as the delimiter between and . This + is to emphasize that this is not a path; it is configuration + specification. The legacy '/' delimiter is still supported but + not recommend and not advertised. Updated configurations + instructions in README.txt files to show ':' delimiter vs '/' + delimiter. Update all configuration-related tools to accept ':' + separator between board and configuration name. From Gregory Nutt. + + * apps/ General: + + - Makefile: Added support for application-specific export target. + Used by nuttx/tools/mkexport.sh. From Pavel Pisa. + - apps/builtins: Move apps/builtins/builtin_forindex.c to + nuttx/libs/libc/builtin since it is required by kernel logic as + well. Other changes account for movement of builtin.h from + nuttx/include/nuttx/binfmt/built.h to nuttx/include/lib/builtin.h. + From Gregory Nutt. + + * Examples/Tests: apps/examples: + + - apps/examples/uid: Demo used to verify PASSWD and GROUP interfaces. + From Gregory Nutt. + - apps/examples/webserver/: Initialilze network and run forever only + if not built-in app. Infer from CONFIG_NSH_BUILTIN_APPS if we are a + NSH built-in app or not. If built-in app (CONFIG_NSH_BUILTIN_APPS + defined) then we assume network is initialized prior to webserver + starting and we exit on webserver failure. If running standalone + (CONFIG_NSH_BUILTIN_APPS is undefined) then behavior is unchanged: + webserver initializes network and runs forever. From Nathan Hartman. + + * Network Utilities: apps/fsutils: + + - apps/fsutils/passwd: Handle the improved the format of the + /etc/passwd file. It is now a little more similar to other systems. + From Gregory Nutt. + + * Network Utilities: apps/netutils: + + - apps/netutils/dhcpc: Add host name support to DHCP client. From + Masayuki Ishikawa. + + * Network Utilities: apps/wireless + + - apps/wireless/ieee802154/i8sak: I8sak improvements: (1) Adds + support for getting/setting maxretries and promsicuous mode from + i8sak, (2) Fixes a build warning and handles a few cases where a + fault can occur due to not catching missing arguments. From + Anthony Merlino. + - apps/wireless/ieee802154/i8sak: Allow setting the endpoint PAN ID. + From Anthony Merlino. + - apps/wireless/ieee802154/i8sak: Adds support for energy scan result + printout. From Anthony Merlino. + - apps/wireless/ieee802154/i8shark: Adds support for intentionally + suppressing passing the FCS so that Wireshark doesn't try to + validate it. From Anthony Merlino. + - apps/wireless/ieee802154/libmac: Adds support for getting/setting + the FCS length From Anthony Merlino. + - apps/wireless/gs2200m: Add UDP support to the GS2200M driver. From + Masayuki Ishikawa. + - apps/wireless/gs2200m: Add DHCP client handling in ioctl_request(). + From Masayuki Ishikawa. + - apps/wireless/gs2200m: ioctl_request() supports SIOCGIFHWADDR. + From Masayuki Ishikawa. + +Bugfixes: +--------- +Only the most critical bugfixes are listed here (see the ChangeLog for a +more complete list of bugfixes and for additional, more detailed bugfix +information): + + * Core OS: + + - Priority Inheritance: Fix a race in telnet with PRIORITY_INHERITANCE + and SCHED_HPWORK. Sometimes causes an assertion to fire incorrectly. + From David S. Alessio. + - Task Groups: Correct some naming. The NuttX task groups have been + using the acronym 'gid' and also the type 'gid_t' for the the task + group ID. That is incorrect. Than naming is reserved for use with + group permissions. So these were all named to grpid and grpid_t so + that it is clearer that these refer to NuttX task group IDs, and not + to group permissions. From Gregory Nutt. + - Task Termination: nxtask_signalparent() in task_exithook.c may + invalidate the group's parent task ID (tg_ppid) too soon. The + tg_ppid field is use only to remember the parent tasks ID so that it + can send the SIGCHLD signal to it. So it must stay valid until + SIGCHLD has been sent. In nxtask_signalparent(), it calls + nxtask_sigchild() to send SIGCHLD to the parent, then invalidates + tg_ppid. That would be okay, except that the SIGCHLD is only sent + when the last member of the group terminates. That is incorrect; + tg_ppid can be invalidated too soon and, as a consequence, SIGCHLD + would never be sent. Noted by Jeongchan Kim in the Google group: + https://groups.google.com/forum/#!topic/nuttx/SXd8fVwVKBk From + Gregory Nutt. + - sched_get_rr_interval(): sched_get_rr_interval() should return + {0,0} if round-robin scheduling is not selected for the task. From + Gregory Nutt. + - SMP Type Collision: The non-standard, non-portable type cpu_set_t + was created specifically to support the NuttX internal, SMP + implementation. Any resemblance to any other cpu_set_t would be + purely coincidental. However it appears that that coincidence has + occurred. cpu_set_t has an equivalent, non-standard, non-portable + type in the GNU C library. Compilation of libgnat expects this + non-standard type to be defined. Who am I to stand in the way of + progress? This commit removes the conditioning on CONFIG_SMP so + that cpu_set_t is typed (as a uint8_t) even if CONFIG_SMP is not + defined. Reference: Bitbucket issue 164. From Gregory Nutt. + - Binary Loader: Change some debug macros from berr() to binfo() + when dumping module data. The report of problems is important + during development but when it enables complete informative output + about load binaries then the important information can be easily + overlooked. The huge output sent to serial terminal slows loading + significantly as well. From Pavel Pisa. + - Power Management: Fix g_pmcount 16-bits overflow when + CONFIG_PM_XXENTER_COUNT set big value. From ligd. + - Timekeeping: Fix cases in time conversion that must be >= + NSEC_PER_SEC, not > NSEC_PER_SEC. From Gregory Nutt. + + * File System/Block and MTD Drivers: + + - opendir(): opendir() set errno to a negative value in one error + case. From Michael Jung. + - SmartFS: Update smartfs smart_scan() function. From Simon Piriou. + - ProcFS: Add missing LF to cpuload procfs output From David Alessio. + - MMC/SD: Copy/paste error fix in the SDIO-based block driver for + MMC. From Ivan Ucherdzhiev. + - MMC/SD: Correct a misplaced #endif in the SDIO-based driver. From + Gregory Nutt. + + * Networking/Network Drivers: + + - Ethernet Configuration: Ethernet packet buffer size cannot be + permitted to go below 1294 if IPv6 is selected. From Gregory Nutt. + - TCP RST: Fix outgoing RST packet with wrong ack number. From + biantao. + - TCP Close: Fix TCP close flow; free the connection after all TCP + close process finished. From zhangyuan7. + - UDP Broadcast: Remove net stack dependency from CONFIG_NET_BROADCAST. + This change allows us to use CONFIG_NET_BROADCAST without network + stack (i.e. usrsock application can use broadcast) From Masayuki + Ishikawa. + - UDP: Fixes a UDP send copy-paste error in the new SO_LINGER code: + CONFIG_TCP_NOTIFIER to CONFIG_UDP_NOTIFIER. From Juha Niskanen. + - TCP and UDP: Fix errors in the new implementation of SO_LINGER. + The tcp_drain() and udp_drain() functions were casting the working + argument to the wrong type, resulting in hangs and abnormal + behavior. There is a complexity in the TCP drain logic when the + remote peer closes the socket before all Tx data has been flushed. + Sometimes we are not notified of this case and wait the entire + timeout unnecessarily. There is a workaround in place in + tcp_txdrain(), but this really should be revisited. From Gregory + Nutt. + - 6LoWPAN: Removes unnecessary conversions that were happening due to + a misunderstanding of byte ordering with EUI-64. From Anthony + Merlino. + - RNDIS: Fix issue with DEBUGASSERT when using composite device and + endpoint numbers not being the default. From Anthony Merlino. + + * Wireless/Wireless Drivers: + + - wireless network devices: Attach radio to d_buf before registering + device to handle forwarding case. When CONFIG_NET_IPFORWARD is + enabled, and CONFIG_NET_6LOWPAN is being used, a packet that + attempts to get forwarded on the 6LoWPAN interface will require + that the radio's buffer be attached to d_buf. Otherwise an assertion + will fire. The underlying "radio" in this case is the + mac802154_netdev. This behavior has probably not been observed + because the buffer is normally attached in the periodic txpoll + worker. However, in my case, the 6LoWPAN interface was not UP yet, + and therefore the worker hadn't run yet. From Anthony Merlino. + - IEEE 802.15.4 MAC: Fixes issues with extended address. 1) Extended + address should be read-only. 2) Extended address should be placed + in frame in "reverse-canonical" order. The extended address is a + read-only attribute and thus an attempt to write the extended + address should be denied. Instead, the extended address should + really be either set by the PHY/radio itself, or provided at board + bring-up time to the radio layer. The MAC layer now pulls in the + extended address from the radio any time the MAC is reset. The + extended address is also supposed to be sent in the frame in + reverse-canonical order. This is very confusing in the standard and + it wasn't until I realized it was backwards in Wireshark that I + researched this further. Searching online I find documents from the + committee for suggestions/feedback on the future standard. It isn't + in the 2015 standard but a newer version of the standard will + presumably clarify this. It says that the extended address should be + written in reverse-canonical form, meaning the OUI comes last, not + first inside the frame. From Anthony Merlino. + - IEEE 802.15.4 MAC: Frame Version should have been 1, but was being + set to 3 when payload exceeds version 0 capabilities. Adds warning + to build to indicate what is noted in the menu for + CONFIG_MAC802154_NTXDESC From Anthony Merlino. + - IEEE 802.15.4 MAC: Fixes issue where the txdesc's ackreq flag was + not being set, despite the frame containing a Frame Control field + with ACKREQ bit set. From Anthony Merlino. + - Xbee: Fix logic to prevent deadlock scenario when there are no + available IOBs From Anthony Merlino (2018-12-21). + - Xbee: Change assumption about destination address mode for incoming + frames. If a short address has been assigned to our radio, then + assume we were addressed using that. Otherwise we were addressed + using our extended address. From Anthony Merlino. + - Xbee: Initialize the short address to the unspecified address and + query for the extended address on initialization. From Anthony + Merlino. + - Xbee: Adds CONFIG_XBEE_LOCKUP_WORKAROUND option and corresponding + logic to workaround an issue where the XBee locks up and stops + responding. This typically happens when there is a lot of data + being received over the link. When the XBee stops responding, many + times, querying the XBee kicks it out of this state. However, + occasionally the XBee is completely locked up and the XBee has to + be reset. This change handles these conditions by periodically + (if not naturally occurring) querying the XBee. If during any + query, the XBee does not respond within a certain number of + attempts, the XBee is reset. From Anthony Merlino. + - Xbee: Cancel query timeout upon receiving the expected response. + Add protection for race condition that can cause association + timeout to continue firing repeatedly From Anthony Merlino. + - Xbee: Detect lockup and reset XBee in xbee_req_data From Anthony + Merlino. + - Xbee: Fixes one instance of the use of IOBUSER_WIRELESS_MAC802154 + which isn't available without the software MAC layer. Instead we + use IOBUSER_WIRELESS_RAD802154 throughout the whole driver since it + is always available when IEEE 802.15.4 support is enable. From + Anthony Merlino. + + * Common Drivers: + + - pipes: Use inode reference counter instead of device reference + counter to handle dup(). I found that if I dup() a pipe, the + reference counter d_refs is not increased. If I close any of the + fd, backed by the same pipe, the pipe will be freed. This causes + any further usage on the fd referencing a non existent pipe. This + change uses the inode reference counter, which is properly + maintained during dup(). From Yang ChungFan. + - SPI Bitbang: Fix build error when the SPI bitbang variable width + support is enabled. From Augusto Fraga Giachero. + - GPIO Lower Half: Remove limitation when pintype > + GPIO_INTERRUPT_PIN. From ligd. + + * ARMv4/ARMv5 + + - Classic ARM7/ARM9: When performing stability test, the application + would cause kernel crash. When I trace the stack, I find that + register R1 has been changed, and its value is the same as register + CPSR. In up_fullcontextrestore.S, the restoration of R0 and R1 is + not atomic: 'msr cpsr r1 will enable interrupts and the recovery of + r0 and r1 may be interrupted and the value or R1 may be changed. + Fix is to use a single ldmia to restore R0, R1, and return via R15. + From Loyen Wang. + + * ARMv7-A + + - ARMv7-A: Fix typo and missing quotation for ARMv7-A. From Oki + Minabe. + - ARMv7-A: Fix double increment in armv7-a's + arm_addrenv_destroy_region(). From Oki Minabe. + - ARMv7-A: Fix L2 page table mask for ARMv7-A page allocator. From + Oki Minabe. + + * ARMv7-M + + - Interrupts. Removes the architecture-common + CONFIG_ARCH_INT_DISABLEALL configuration option (but which was + supported only by ARMv7-M). In the normal course of things, + interrupts must occasionally be disabled using the up_irq_save() + inline function to prevent contention in use of resources that may + be shared between interrupt level and non-interrupt level logic. + Now the question arises, if we are using BASEPRI to disable + interrupts and have high priority interrupts enabled + (CONFIG_ARCH_HIPRI_INTERRUPT=y), do we disable all interrupts except + SVCall (we cannot disable SVCall interrupts). Or do we only disable + the "normal" interrupts? If we are using the BASEPRI register to + disable interrupts, then the answer is that we must disable ONLY the + "normal interrupts". That is because we cannot disable SVCALL + interrupts and we cannot permit SVCAll interrupts running at a + higher priority than the high priority interrupts (otherwise, they + will introduce jitter in the high priority interrupt response time.) + Hence, if you need to disable the high priority interrupt, you will + have to disable the interrupt either at the peripheral that + generates the interrupt or at the NVIC. Disabling global interrupts + via the BASEPRI register cannot effect high priority interrupts. + From Gregory Nutt. + - ARMv7-M Priorities: In the 'normal' case, the priority of the + SVCALL interrupt was the same as the priority of the high priority + interrupt. This means that SVCALL interrupt processing can defer + the high priority interrupt and result in the jitter in that + interrupt response. Fix is to raise the priority of the high + priority interrupt above the priority of the SVCALL interrupt. + Suggested by Nathan Hartman. From Gregory Nutt. + + * Microchip i.MXRT Drivers: + + - i.MXRT ENC: Fix some errors in register bit definitions. Noted by + Arie de Muijnck. From Gregory Nutt. + - i.MXRT LPI2C: Slave addresses are now correctly shifted when + sending START. TX/RX FIFOs now discarded on error to prevent FIFO + underflow errors. Fixes error checking to use priv structure and + removes checking of BBF flag as it is not an error. From Nicholas + Chin. + + * Microchip PIC32MZ Drivers: + + - PIC32MZ SPI: Fix SPI Mode selection. CKE is the inversion of the + CPHA. From Ouss4. + + * Microchip/Atmel SAMD2x/SAML2x Drivers: + + - SAMD2/L2 I2C: Correct time calculation. From Bernd Walter. + + * Microchip/Atmel SAM3/SAM4: + + - SAM3/4: Add missing DMA configuration Kconfig setting. From Bernd + Walter. + + * NXP LPC17xx/40xx Drivers: + + - LPC17xx/40xx ADC: Only use PCLKSEL0 for ADC on LPC176x family. + From jjlange. + - LPC17xx/40xx Ethernet: Set speed back to 10Mbps if 10Mmbps link + negotiated. From Augusto Fraga Giachero. + - LPC17xx/40xx I2C: Abort I2C transfers if a timeout has occurred. + If a timeout has occurred in the middle of a I2C transfer, the next + I2C interrupt should abort any transfers and send a stop condition + to the corresponding I2C bus. Failure to do so will result in + memory corruption / undefined behavior as priv->msgs points to a + region of memory it doesn't owns anymore after lpc17_40_i2c_start + returns. From Augusto Fraga Giachero. + - LPC17xx/40xx I2C: Calculate the appropriate timeout for I2C + transfers. Depending on the bus frequency and transfer size, I2C + transactions can take quite a bit, so a fixed timeout is not a + good solution. Calculating the timeout at run time poses some + overhead but still better than aborting long transactions. From + Augusto Fraga Giachero. + + * NXP/Freescale Kinetis Drivers: + + - Kinetis I2C: i2c transfer ensure correct result returned. + kinetis_i2c_transfer released the mutex then fetched the state, + this resulted in returning the correct results. From David + Sidrane. + + * NXP LPC17xx/40xx Drivers: + + - LPC17xx/40xx CAN: If BOARD_CCLKSEL_DIVIDER is not equal to 1 on + LPC178x or LPC40xx then base clock rate is calculated incorrectly + because CCLK frequency does not correspond to PLL0 clock which is + used for PCLK. This is partially workaround solution. It would + be probably better to define BOARD_PCLK_FREQUENCY even for LPC176x + targets and use that to replace divisor by base_clock in up_dev_s. + From Pavel Pisa. + + * NXP LPC17xx/40xx Boards: + + - LPC17xx/40xx Ethernet: Add missing LPC17_40_PHY_CEMENT_DISABLE + variable to the lpc17xx/40xx Kconfig file. For some reason this + setting was not referenced anywhere except in the Ethernet driver. + From Augusto Fraga Giachero. + - LPC17xx/40xx Ethernet: Fix the initialization for DP83848x PHYs. + The DP83848x requires the RMII mode to be manually enabled through + the MII_DP83848C_RBR register. Before querying the speed and mode + it should wait for the link to be established. From Augusto Fraga + Giachero. + + * NXP i.MXRT Drivers: + + - i.MXRT LPUART: Fix some errors in the LPUART register definition + files. Correct naming of a function: up_earlyserialinit() should + be imxrt_earlyserialinit(). Remove prototypes for non-existent + serial initialization functions. From Gregory Nutt. + - i.MXRT USDHC: uSDHC typo fixes and command transfer error handling + modified. From Ivan Ucherdzhiev. + + * SiLabs EFM32 Drivers: + + - EFM32 OTG host: Adam Porter's various fixex for STM32 FS/HS + probably should be applied to EFM32 host which which has very + similar IP. From Gregory Nutt. + + * STMicro STM32: + + - STM327F Configuration: Kconfig add depends on BBSRAM. From David + Sidrane. + - STM32F7 Interrupts: Fix overwritten IRQ enable. System boot order + calls clock_initialize() then up_initialize(). clock_initialize() + was setting up the alarm IRQ up_initialize is initializing the NVIC. + This most likely worked in the past due to a bug in the NVIC + initialization code that failed to clear the Interrupt enables. + - STM32H7: Rix BBSRAM name in memory map. From David Sidrane. + - STM32H7: Removed f7 in file path. From David Sidrane. + + * STMicro STM32 Drivers: + + - STM32H7 BBSRAM: Fix issues causing no writes and hardfaults. From + David Sidrane. + - STM32H7 BBSRAM: Convince compiler to perform 32 bit write. From + David Sidrane. + - STM32F7 OTGHS: Fixes bad preprocessor logic preventing USB OTG HS + to work when used without external ULPI. From Anthony Merlino. + - STM32 OTGH[FS|HS] Host STM32 host only initiates transfer if + buflenl > 0. From Adam Porter. + - STM32F7/H7/L4 OTG host: Adam Porter's fix for STM32 FS/HS probably + should be applied to STM32 F7, H7, and L4 OTG host which are very + similar. From Gregory Nutt. + - STM32/F7/H7/L4: This change was required to get my devices + (CDC-MBIM) to enumerate. Initially the system timed out retrieving + the USB configuration descriptor. Ctrl IN requests got nothing but + NAKs. I found that the initial SETUP packet and corresponding IN + transfer were fine; it was the Status OUT phase that was getting the + NAK. After receiving a NAK on the Status OUT, the code would loop + back and issue another ctrl IN, which will always fail because the + data was already transferred before. Thus the entire transfer would + 'timeout'. The fix I implemented moves the DATANAK timeout loop to + only apply to the Status OUT. Both the ctrl IN and the Status OUT + need their own retry loops. From Adam Porter. + - STM32F7 SDMMC: If there is only one SDMMC it is slot 0 From David + Sidrane. + - STM32F7 USART1: USART1_RXDMA is dependent on STM32F7_DMA2 not + STM32F7_DMA1 From Anthony Merlino. + - STM32H7 DBGMCU: Memory Map DBGMCU is @ 0x5c001000 From David + Sidrane. + - STM32F7 SDMMC: Fix warning when DMA is not enabled. From David + Sidrane. + - STM32H7 Ethernet: Fix some errors in Ethernet MAC configuration. + From Markus Bernet. + - STM32H7 Ethernet: Correct stm32h7 mac address filtering. Correct + the MAC address 0 register definition and remove the 'receive all' + flag. Now the Ethernet driver only receives packets addressed to + correct MAC. From Jukka Laitinen. + - STM32H7 Ethernet: Correct memory corruption error. The Ethernet + driver initialization incorrectly wrote to DMACRXCR instead of + DMACSR when trying to clear the stopped flags. This caused + invalid buffer length in the DMACRXCR, causing DMA to overflow the + RX buffers when large packets are sent to the device. From Jukka + Laitinen. + - STM32H7 PWR: Ensure data is flushed on backup domain access + changes. From David Sidrane. + - STM32H7 Serial: Serial fix undefined with TERMIOS From David + Sidrane. + - STM32H7 UARTs: Fix UART7/8 typos. Fix bug in ETH_MACQTXFCR + configuration. From Markus Bernet. + + * STMicro STM32 Boards: + + - Multiple STM32 Boards: If CONFIG_SCHED_CRITMONITOR is selected, + then make sure that ITM and DWT resources are enabled before + accessing ITM and DWT registers. By default, these registers are + disabled. Suggested by Juha Niskanen. From Gregory Nutt. + - Nucleo-H743ZI: Correct logic that determines if the RTC driver is + available. Find in build testing. From Gregory Nutt. + - Nucleo-G071RB: Fix linker script to avoid .ARM.exidx section + overlap with .data From Daniel Pereira Volpato. + - Modify all linker scripts (all boards, all architectures) to use + solution from Daniel P. Volpato. From Alan Carvalho de Assis. + - Nucleo-L432KC ADC: Change analog pins definitions and correct DMA + related issue. From Daniel P. Carvalho. + + * TI Tiva: + + - Tiva Configuration: Rename TM4C123GH6PMI identifiers to + TM4C123GH6PM. Rationale: In terms of firmware programming, there + is no functional difference between these parts: TM4C123GH6PMI7, + TM4C123GH6PMI7R, TM4C123GH6PMT7, and TM4C123GH6PMT7R. From a + programming standpoint, all of the above parts are TM4C123GH6PM, + which means it doesn't make sense to differentiate between PM and + PMI. (The PM means 64-LQFP. The I means temperature range -40C to + +85C. It could be T meaning -40C to +105C. The R means it ships in + Tape and Reel packaging as opposed to Tray.) From Nathan Hartman. + - Tiva Configuration: Rename TM4C1294NC identifiers to TM4C1294NCPDT. + Rationale: TM4C1294NC is ambiguous: TM4C1294NCPDT is a 128-TQFP, + TM4C1294NCZAD is a 212-NFBGA. The TM4C1294NC part currently + supported by NuttX is the TM4C1294NCPDT used on the TI EK-TM4C1294XL + "Connected LaunchPad" (see configs/tm4c1294-launchpad). To ensure + the correct part is fully specified, this commit updates all + TM4C1294NC identifiers to TM4C1294NCPDT. From Nathan Hartman. + - Tiva Configuration: Fix TM4C129XNCZAD part number in Kconfig and + identifiers. Rationale: Fully specify that this is the 212-pin BGA + package (ZAD ending) and for consistency with earlier changes to + other Tiva TM4C12x part numbers in Kconfig names and identifiers. + From Nathan Hartman. + + * TI Tiva Drivers: + + - Tiva TM4C 1-Wire: Fix wrong description on define TIVA_1WIRE_BASE: + Was "EEPROM and Key Locker" (same as the item above). Now "1-Wire + Master Module." Make DMACTL symbols visible for TM4C123: Remove + "#ifdef CONFIG_ARCH_CHIP_TM4C129" guard around UART DMA Control + (DMACTL) symbols. These bits are valid on TM4C123 devices, as well + as on TM4C129. Also, improve the comment on UART_DMACTL_DMAERR. + From Nathan Hartman. + - Tiva GPIO Interrupts: LM3S, LM4F, TM4C: Fix GPIO IRQ error, ports + R, S, T. Preprocessor logic for CONFIG_TIVA_GPIOx_IRQS was setting/ + clearing port Q defines when it should act on ports R, S, T. + gpioport2irq() was missing handling for port T. From Nathan + Hartman. + - Tiva Timers: Fix minor errors in tiva_timerlib.c. Fix incorrect + preprocessor conditionals related to Kconfig defines: + CONFIG_TIVA_TIMER32_EDGECOUNT -> CONFIG_TIVA_TIMER16_EDGECOUNT, + CONFIG_TIVA_TIMER32_TIMECAP -> CONFIG_TIVA_TIMER16_TIMECAP, + CONFIG_TIVA_TIMER32_PWM -> CONFIG_TIVA_TIMER16_PWM. From Nathan + Hartman. + - Tiva Timers: Fix errors in low-level timer support. + tiva_gptm_configure() and tiva_gptm_release() were calling + tiva_emac_periphrdy() instead of tiva_gptm_periphrdy(). Fix + error in "abcde" description of bit flag defines. From Nathan + Hartman. + - Tiva Timers: Fix one code error and some comment errors. + tiva_timer16_setinterval(): Was DEBUGASSERTing on mode != + TIMER16_MODE. Fixed to DEBUGASSERT on mode == TIMER16_MODE. + From Nathan Hartman. + + * ZiLOG Z80 Boards: + + - z80sim Serial: Fix uart_dev_t initializer: pollfds[] is a array of + pointers and, hence, the NULL initializer must be included in braces. + Noted by Paul Osmialowski in Issue #160. From Gregory Nutt. + - z80sim Interrupts: Missed a name change up_irqinitialize to + z80_irq_initialize. From Gregory Nutt. + + * C Library/Header Files: + + - include/netinet/in.h: Rename __pad member to sin_zero in struct + sockaddr_in. Libwebsockets initializes the 'sin_zero' member of + sockaddr_in objects to zeros. Apparently, judging from mailing list + entries, there are platforms on which not doing this causes + undefined behavior. On NuttX compiling respective code is broken, + as the corresponding member variable is called '__pad'. Neither in + the 'nuttx' nor in the 'apps' repository did I find any reference to + this identifier. Thus, I believe its a safe bet to just rename it. + UNIX Network Programming states in this regard: "The POSIX + specification requires only three members in the structure: + sin_family, sin_addr, and sin_port. It is acceptable for a POSIX- + compliant implementation to define additional structure members, and + this is normal for an Internet socket address structure. Almost all + implementations add the sin_zero member so that all socket address + structures are at least 16 bytes in size." From Michael Jung. + + - libs/libc/libc.csv: Correct dependency of setlocale on + CONFIG_LIBC_LOCALE. From Pavel Pisa. + - libs/libc/machine/arm/armv7-m: Fix build error for ELF. From + Masayuki Ishikawa. + - libs/libc/math.csv: Correct format of some function entries. From + Pavel Pisa. + + * Tools: + + - tools/: Change all occurrences of /bin/(ba)sh in shell scripts to + /usr/bin/env bash which appears more portable From Manuel Sthn. + + * NSH Library: apps/nshlib: + + - apps/nshlib/: As noted by David S. Alessio, 'cat' should not output + any additional newline at the end of the cat'ed file content. This + additional newline was added to assure that the NSH prompt was + presented on a new line. However, that is not the correct behavior + of 'cat' per the IEEE std: "The standard output shall contain the + sequence of bytes read from the input files. Nothing else shall be + written to the standard output." Reference: + https://pubs.opengroup.org/onlinepubs/009695399/utilities/cat.html. + This commit changes the function nsh_catfile() which underlies the + 'cat' command and well as other NSH commands. Although this is the + correct behavior for 'cat' it may not be the correct behavior for + other commands implemented via nsh_catfile(). That remains to be + determined. From Gregory Nutt. + + * System Utilities: apps/system: + + - apps/system/cle/: ASCII DEL should be treated by Delete-Left. From + Dave Marples. + - apps/system/i2ctool: (1) Friendlier I2C "knock-knock" uses only + read request. While many I2C slave devices have multiple indexed + registers, some have only one register and it's not indexed. For + example, the I2C bus switch TCA9548A has only a Control Register, + attempting to index to "Reg[0]" alters its contents to 0x00 + disabling all subordinate buses. This patch fixes that problem by + simply trying to read something/anything from the slave. This also + helps coax out slaves with register files that start from a higher + index, i.e. the AT24CS0x, FLASH chips with a UUID that appears as a + 2nd I2C slave at (address+8), report their serial number at + Reg[80]-Reg[8F] and will NAK a read of Reg[0]. (2) Modify get/set + to prevent write of reg index if not specifed From David Alessio. + + * Network Utilities: apps/netutils: + + - apps/netutils/dhcpd: Fixes bug where hwaddr was being used instead + of ipaddr in the ARP update. This bug seems to have been introduced + three years ago during a rewrite to remove a direct OS call to arp. + I'm not sure how others have not run into issues with this. The + behavior I was observing was that the DHCPD would go to offer an IP + address, but then send a ARP request for the IP instead because it + didn't know where to send the data. From Anthony Merlino. + - apps/netutils/netinit/: Remove warnings. Unhook PHY notification + signal handler when cleaning up, if an error occurs after the signal + handler is put into place. From Nathan Hartman. + + * Wireless Utilities: apps/wireless: + + - apps/wireless/ieee802154/i8sak: Fixes conversion from extended + address to IPv6 address. From Anthony Merlino. + +NuttX-8.2 Release Notes +------------------------ + +The 133nd release of NuttX, Version 8.3, was made on November 16, 2019, +and is available for download from the Bitbucket.org website. Note +that release consists of two tarballs: nuttx-8.2.tar.gz and +apps-8.2.tar.gz. These are available from: + + https://bitbucket.org/nuttx/nuttx/downloads + https://bitbucket.org/nuttx/apps/downloads + +Both may be needed (see the top-level nuttx/README.txt file for build +information). + +Additional new features and extended functionality: +--------------------------------------------------- + + * Core OS: + + - Signals: Add support for SIGPIPE default action. SIGPIPE uses + SIG_SIGPIPE_ACTION which terminates process by default. It also + could be ignored. From liuhaitao. + - Spinlocks: Remove support for re-entrant spinlocks. They seemed + like a good idea, but they are never used. From Xiang Xiao. + - Memory Manager: Remove the assumption that one character equals + eight bits. From Xiang Xiao. + - Power Management: Historically, the NuttX PM subsystem has + consisted of two functional components: (1) an "Upper" part that + detects state changes based on a random walk driven by activity + levels, and (2) and "lower" part that implementst the state changes. + This change decouples that upper activity-based logic from the lower + random walk logic and allows use of other upper state detection + logic (such as a custom, application-specific state machine). From + Matias Nitsche. + - boardctl(): Expose power manager function through boardctl() + interface. From Xiang Xiao. + + * File System/Block and MTD Drivers: + + - GD25: Add support for a new FLASH vendor. From zhangbo_a. + - GD25: Add support for GD25 device with 256-Mbit capacity. From + YanLin Zhu. + - GD25: Add 4-byte address operation for capacity larger than + 128-Mbit. From YanLin Zhu. + - GD25: Add gd25_lock/unlock to case: enable 4-bytes address From + ligd. + - GD5F: Add gigadevice SPI NAND FLASH driver. From YanLin Zhu. + + * Networking/Network Drivers: + + - Networking: Use ntoh() when printing IPv6 addresses so that the + addresses appear in friendlier host order vs. network order. From + Bernd Walter. + - Netlink: Implement minimal NETLINK_ROUTE socket functionality that + can (for now) be use used to obtain a list of network devices, IPv4 + ARP and IPv6 Neighbor tables, and IPv4 and IPv6 routing tables. + From Gregory Nutt. + + * Wireless/Wireless Drivers: + + - BCM43438A1 Bluetooth: Add support for the BCM43438A1 Bluetooth + capability. From Dave Marples. + - HCIUART Shim: Add a serial 'shim' to allow any regular serial port + to support a Bluetooth H4 interface and to be used to drive a + Bluetooth device. From Dave Marples. + - BCM4343x HCIUART: BCM4343x HCIUART support. From Dave Marples. + - BCM43xxx: Move drivers/wireless/ieee80211/ to + drivers/wireless/ieee80211/bcm43xxx/ since the directory only + contains only BCM43362 and BCM43438 related code. From Xiang Xiao. + - GS2200M: Add reset handler to interface. Add reset and un-reset + sequence in driver. From Masayuki Ishikawa. + + * Audio/Audio Drivers: + + - Audio: Add message type to support audio trigger. From anchao. + + * Other Common Device Drivers: + + - Altair: Add support for the altair LTE modem driver. From Alin + Jerpelea. + - MCP2515: MCP2525 SPI STD-EXT ID fixes. From DisruptiveNL. + - OpenAMP: Brings in the drivers needed to support OpenAMP. These + changes were ported from https://github.com/FishsemiCode/nuttx. + This port was effort of a number of people, I rather arbitrarily + gave authorship to Guiding Li because he has the largest number of + fundamental quashed commits from the Xiamoi repository. From + Guiding Li. + + * Simulator: + + - Simulator: Add stack coloration feature. From ligd. + - Simulator: Report PM activity on simulated UART. From Matias + Nitsche. + - Simulator: Add host ftruncate() support. From chao.an. + - Simulator: Replace all CONFIG_DEV_CONSOLE with USE_DEVCONSOLE for + arch/sim and compile up_devconsole.c conditionally. From Xiang + Xiao. + - Simulator OpenAMP: Support OpenAMP between two simulator + instances. Please read rpserver/rpproxy section in + boards/sim/sim/sim/README.txt for more information. From chao.an. + + * ARMv7-M + + - ARMv7-M: Add BPIALL register address. From Dave Marples. + - ARMv7-M MPU: Add user peripheral helper + + * Atmel SAMD2/L2 Boards: + + - Arduino-M0: Add initial board support for the Arduino M0 which is + based on the SAMD21 chip. Include nsh and usbnsh configurations. + From Alan Carvalho de Assis. + + * NXP i.MXRT Drivers: + + - i.MXRT LCD: Add support for LCD. Clean up some LCD-related + interfaces. From Fabio Balzano. + - i.MXRT Serial: This change improves the performance of UART serial + ports on the IMXRT by enabling the RX & TX FIFOS and transmission on + the holding register being empty (TDRE) rather than transmission + being complete (TC). From Dave Marples. + - i.MXRT Pin Mux: This change separates out the pinmux and iomux + functions cleanly. For ease of conversion default IOMUX definitions + have been added into imxrt_iomux.h. The change effectively does two + things: (1) unifies the iomux definitions - previously some pins + had them, and some didn't. This effectively made it impossible to + use the pinmuxes without editing the header file in the standard + distribution tree. And (2) unifies the pin definitions so that every + pin now has a suffix. This makes it *much* easier to see when a pin + is in use in your code, because it will always have a definition in + your board.h file. From Dave Marples. + - IMXRT1020-EVK: Add support for the MIMXRT1021-EVK board. It + features nsh, netnsh and usdhc sample configurations. From Dave + Marples. + + * NXP i.MXRT Boards: + + - IMXRT1060-EVK: Add basic LCD support for the board IMXRT1060-EVK. + From Fabio Balzano. + - IMXRT1060-EVK: Added Littlevgl demo configuration into the + IMXRT1060-EVK board directory. From Fabio Balzano. + + * NXP/Freescale Kinetis Drivers: + + - Kinetis Ethernet: Add support for TJA1100 PHY. From David Sidrane. + + * NXP S31K1xx: + + - S32K1xx: Support configuration and initialization of the flash + configuration bytes. From Gregory + + * NXP S31K1xx Boards: + + - S32K1**EVB: Create a special FLASH section to hold the FLASH + configuration bytes. From Gregory Nutt. + - S32K146EVB: Added configuration script and instructions for using + Thread-Aware OpenOCD for the S32K146 with Eclipse. From Han + Raaijmakers. + + * Renesas RX65N: + + - RX65N: Adds a port of to the Renesas RX65N Micro-controller. This + port includes Serial (UART) driver (13 ports) and Ethernet + driver. From Anjana. + + * Renesas RX65N Boards: + + - RSK RX65N-2MB: Add support for the RSK RX65N-2MB board. From + Anjana. + - GR-Rose: Add support for the GR-Rose board. From Anjana. + + * Sony CXD56xx + + - CXD56xx CPU FIFO: Add configurations for CPU FIFO elements. From + Alin Jerpelea. + - CXD56xx Loader: Update loader and gnssfw ver. 17660. From Alin + Jerpelea. + - CXD56xx SMP: Add support for SMP. To run cxd56xx in SMP mode, new + boot loader which will be released later must be used. From + Masayuki Ishikawa. + - CXD56xx SMP: Add IRQ routing for SMP in cxd56_irq.c. In CXD56xx, + each external interrupt controller can be accessed from a local + APP_DSP (Cortex-M4F) only. This change supports IRQ routing for SMP + by calling up_send_irqreq() in both up_enable_irq() and + up_disable_irq(). From Masayuki Ishikawa. + + * Sony CXD56xx Drivers: + + - CXD56xx I2C: Add ability to set the i2c frequency to other than just + 100 or 400 Hz. From Alin Jerpelea. + - CXD56xx SDHCI: Reduce power consumption by stopping SD clock. Re- + enable SD clock during access to SD card. Improve GNSS low + sensitivity with SD card inserted. From Alin Jerpelea. + + * Sony CXD56xx Spresense Board: + + - CXD56xx Board Common: Add the Altair LTE modem support on the + Spresense board. From Alin Jerpelea. + - CXD56xx Board Common: Add Spresense Image Processor. Enable support + for accelerated format converter, rotation and so on. using the CXD5602 + image processing accelerator. + - Spresense: Add board specific pin configurations of CXD5602 pins to + fit Spresense board. From Takayoshi Koizumi. + - Spresense: Add a configuration option to select if an extension + board is attached to the SPresence. If there is no extension board + attached, the SPresense may run in a low-power mode by default (as + determined by the CONFIG_CXD56_CUSTOM_PINCONFIG option). If an + extension board is present, then the SPresense will need to run at a + higher power mode, selected by the new CONFIG_SPRESENSE_EXTENSION + option. From Gregory Nutt. + - Spresense Camera: Add ISX012 camera initialization and + configuration. From Alin Jerpelea. + - Spresense OS test: Enable ostest in rndis/defconfig and + wifi/defconfig. From Masayuki Ishikawa. + - Spresense: Add --gc-sections to LDFLAGS and add -ffunction-sections + and -fdata-sections to ARCHCFLAGS in scripts/Make.defs. From + Masayuki Ishikawa. + - Spresense SMP: Add smp configuration. From Masayuki Ishikawa. + - Spresense SCU: The SCU has to be initialized at bootup on Spresense + board because several functions depend on it. Add audio control + definitions. Add configuration for the audio implementation. From + Alin Jerpelea. + - Spresense: Add audio and board audio control implementation. From + Alin Jerpelea. + - Spresense: Sdd power_control and audio_tone_generator. Add a simple + way to control the audio buzzer with defined frequency for user-space + apps. From Alin Jerpelea. + - Spresense: Add the optional initialization of GNSS and GEOFENCE at + boot if the drivers are enabled From Alin Jerpelea. + - Spresense: Add LTE configuration. From Alin Jerpelea. + - Spresense: Enable high current mode for the Spresense Extension + board on all examples that have SDCARD support. From Alin Jerpelea. + - Spresense: Add lcd examples configuration. This is a configuration + for the basic nx examples From Alin Jerpelea. + + * STMicro STM32: + + - STM32F0/L0/G0: Add support for STM32G070xx family. From Daniel + Pereira Volpato. + - STM32F0/L0/G0 Power: Scale dynamic voltage and flash wait states + properly on STM32G0 chips. Included preliminary implementation of + PWR module VOS support. From Daniel Pereira Volpato. + - STM32L4R5ZI: Add support for the STM32L4R5ZI chip type. From Jussi + Kivilinna. + - STM32 L4+ DMA: Add DMA support for STM32L4+ series. From Jussi + Kivilinna. + - STM32 L4 Clocking: Enable "Range 1 boost" mode if any PLL freq + above 80 Mhz. From Jussi Kivilinna. + - STM32 L4 LPTIM: Add support for LPTIM timers on the STM32L4 as PWM + outputs. From Matias N. + - STM32 H7 Progmem: Add FLASH progmem support. From David Sidrane. + + * STMicro STM32 Drivers: + + - STM32 Serial: Single Wire add pull{up|down|none} via new IOCTL + command. From David Sidrane. + - STM32 F0/L0/G0 Serial: Single Wire add pull{up|down|none} via + new IOCTL command. From David Sidrane. + - STM32 F0/L0/G0 PWM: Add PWM support. From Daniel Pereira Volpato. + - STM32 G0 TIM: Support timers available on STM32G070. Includes TIM1 + PIOs, TIM driver lower-half. From Daniel Pereira Volpato. + - STM32 F7 Serial: Single Wire add pull{up|down|none} via new IOCTL + command. From David Sidrane. + - STM32 H7 BBSRAM: Exclude BBSRAM from cacheable when + CONFIG_ARMV7M_DCACHE. ST placed the STM32H7 BBSRAM in the SRAM + default memory region which is cacheable. This change sets the + BBSRAM memory range to non-cacheable. From David Sidrane. + - STM32 H7 SDMMC: Add SDMMC support and IDMA as well as interrupt + driven transmission. Support pull-ups and SDIO. From David Sidrane. + - STM32 H7 Serial: Single Wire add pull{up|down|none} via new IOCTL + command. From David Sidrane. + - STM32 L4 OTGFS: Enable OTGFS for STM32L4+ series. The OTGFS + peripheral on stm32l4x6 and stm32l4rxxx reference manual is exactly + the same. From Jussi Kivilinna. + - STM32L4 IDLE Loop: (1) Added BEGIN_IDLE()/END_IDLE() to stop call + so that we also get notification via LED of the STOP mode, (2) Added + the stm32l4_clockenable call as previously discussed, and (3) Added + call to pm_changestate() to inform drivers we're back to running + after the call to stm32l4_stop() returns. From Matias N. + - STM32 L4 Serial: Single Wire add pull{up|down|none} via new IOCTL + command. From David Sidrane. + + * STMicro STM32 Boards: + + - Nucleo-G070RB: Initial support for board STM32 NUCLEO-G070RB, + including NSH config. Enables PWR peripheral and set SYSCLK to + maximum frequency. From Daniel Pereira Volpato. + - Nucleo-G070RB: Enable basic timers. Add TIMx clock frequencies to + board.h. From Daniel Pereira Volpato. + - Nucleo-G070RB: Add PWM support and GPIO_TIM3_* mappings. Add a PWM + configuration. From Daniel Pereira Volpato. + - Nucleo-G070RB: Add button driver support, Add driver support. Add + GPIO configuration. From Daniel Pereira Volpato. + - Nucleo-L476RG: Add required definitions if libcxx is enabled. From + Matias N. + - Nucleo-L476RG: Add support for LPTIM timers as PWM outputs. From + Matias N. + - Nucleo-H743ZI: Added GPIO device driver for user-space apps. From + Heiko Demlang. + - olimex-stm32-e407: Newer Olimex E407 boards are populated with + STM32407ZE chips. From David Alessio. + - STM32F4-Discovery: Add support for external DS1307 module. From + Alan Carvalho de Assis. + - STM32F4-Discovery: Add support for MMCSD_SPI. This change works + with STM32F4 Discovery Shield plus microSD click From Masayuki + Ishikawa. + - STM32F4-Discovery: Add support for gs2200m. Works with mikroe + STM32F4 Discovery Shield (slot3) From Masayuki Ishikawa. + + * TI Tiva: + + - TM4C129ENCPDT: Add support for Tiva TM4C129ENCPDT. From Nathan + Hartman. + + * TI Tiva Boards: + + - TM4C123G-Launchpad: SPI CAN functionality on TM4C123GXL. From + DisruptiveNL. + + * Build System: + + - tools/Config.mk: Eliminate use of the built-in implicit rules. + From anchao. + - tools/Config.mk and Makefile.unix: Support the incremental build + for configuration change. From Xiang Xiao. + - tools/Config.mk: Support the ability to change the CFLAGS for + the compilation of a single file. Set special compiler options as + follows the rule: sourcefile + fixed suffix "_[A|C|CPP|CXX]FLAGS". + For example in apps/examples/hello/Makefile: + $(SRCDIR)/hello_main.c_CFLAGS = -DTEST. From Xiang Xiao. + - Configuration: Auto-select CONFIG_BUILD_LOADABLE when either + CONFIG_BUILD_KERNEL or CONFIG_BINFMT_LOADABLE is selected. From + Xiang Xiao. + + * Libraries/Header Files: + + - libs/libc: Add CONFIG_MODLIB_SYSTEM_SYMTAB to generate the symbol + table for dlopen/insmod. From Xiang Xiao. + - getdelim() and getline(): Add implementations of the POSIX + functions getdelim() and getline(). Because of how the function is + defined, getline() canot be used on platforms that use CR-LF lin + terminations. From Gregory Nutt. + - alarm(), setitimer(), and getitimer(): Implement alarm(), + setitimer() and getitimer() APIs. From liuhaitao. + + * Tools: + + - tools/mkexport.sh: Copy the essential build script files too and + move Make.defs/gnu-elf.ld into scripts like board folder layout. + From Xiang Xiao. + - tools/mkexport.sh: Should export full content for FLAT build even + with CONFIG_BUILD_LOADABLE. From Xiang Xiao. + - tools/testbuild.sh: Add an option to select the number of CPUs to + use with 'make' From Gregory Nutt. + - tools/indent.sh: Add a command line option to suppress reformatting + of comments. This is useful when comments are already correct + and/or contain formatted data such as tables or lists. From Gregory + Nutt. + - tools/nxstyle.c: Add detection of carriage returns. Improve + reporting of TABs. From Gregory Nutt. + - tools/nxstyle.c: Add logic to detect if there is a blank line + following the final right brace. From Gregory Nutt. + - tools/nxstyle.c: Eliminate false alarm errors on comments that are + to the right of code when the comment terminator is on the same + line as the last of the comment. From Gregory Nutt. + - tools/nxstyle.c: Eliminate false alarms when checking for + alignment of comments to the right of code. Fix check for C++ style + comments so that strings like http:// and https:// do not generate + false alarms. From Gregory Nutt. + - tools/nxstyle.c: Eliminate false positive 'Invalid character after + asterisk in comment block'. From Gregory Nutt. + + * apps/ Build System: + + - apps/ Build System: Numerous changes for improvements and general + clean-up of the apps/ build system. Too many small and individual + changes to list here. Includes many improvements related to loadable + modules and symbol table generation, removal of duplicated logic, + renaming of binary directories, use of cygpath, etc. From Xiang Xiao. + - apps/Application.mk: Support the ability to change the CFLAGS for + the compilation of a single file. Set special compiler options as + follows the rule: sourcefile + fixed suffix "_[A|C|CPP|CXX]FLAGS" + As an example in apps/examples/hello/Makefile: + $(SRCDIR)/hello_main.c_CFLAGS = -DTEST + From Xiang Xiao. + - apps/Application.mk and main.c files: Change builtin's entry point + from main to xxx_main by macro expansion. This change make the + entry point fully compliant with POSIX/ANSI standard. From Xiang + Xiao. + + * Examples/Tests: apps/examples: + + - apps/examples/audio_rttl: Add a simple RTTL player demo that is + able to play tunes according to an RTTL song. From Alin Jerpelea. + - apps/examples/bmi160: Add bmi160 example app. This app will read + the BM160 data and list it on the NSH console. From Alin Jerpelea. + - apps/examples/charger: Simple charger example that will display on + the console voltage and current values. From Alin Jerpelea. + - apps/examples/netlink_route: Add test/example of NETLINK_ROUTE + 'get' operations. From Gregory Nutt. + + * NuttShell: apps/nshlib: + + - apps/nshlib/: Add rptun cmd for boot remote core. From ligd. + - apps.nshlib/: Add a -t option to the arp command which will enable + printing the entire ARP table. From Gregory Nutt. + - apps/nshlib/: Add new NSH command, 'pmconfig'. From ligd. + + * System Utilities: apps/system: + + - apps/system/cle: Add basic color support to the CLE editor. + From Dave Marples. + - apps/system/i2c: While many I2C slave devices have multiple + indexed registers, some have only one register and it's not indexed. + For example, the I2C bus switch TCA9548A has only a Control + Register, attempting to index to "Reg[0]" alters its contents to + 0x00 disabling all subordinate buses. This change fixes that + problem by simply trying to read something/anything from the slave. + This also helps coax out slaves with register files that start from + a higher index, i.e. the AT24CS0x, FLASH chips with a UUID that + appears as a 2nd I2C slave at (address+8), report their serial + number at Reg[80]-Reg[8F] and will NAK a read of Reg[0]. Modified + get/set to prevent write of reg index if not specified. + - apps/system/i2c: Added a 'dump' command to issue a single + transaction to retrieve multiple bytes from an I2C slave and + register/offset. From David Alessio. + - apps/system/spi: Add options to specify devtype, id for chip + select. From David S. Alessio. + - apps/system/symtab: Remove system/symtab since the same + functionality exist in nuttx now. From Gregory Nutt. + - apps/system/usrsock_rpmsg: Add rpmsg based usrsock implementation. + From Jianli Dong. + + * Network Utilities: apps/netutils: + + - apps/netutils/cjson/: Update default version to 1.7.12. Previous + releases raise compilation warnings about redefined true/false. + From raiden00pl. + - apps/netutils/netlib/: Add a function to read the entire ARP table + using NETLINK_ROUTE protocol. From Gregory Nutt. + - apps/netutils/netlib/: Add support for retrieving a snapshot of the + IPv6 neighbor table using Netlink sockets. From Gregory Nutt. + - apps/netutils/netlib/: Add a utility function that will return a + list of all network devices in the UP state. From Gregory Nutt. + - apps/netutils/netlib/: Add function to retrieve routing tables + using Netlink. From Gregory Nutt. + +Bugfixes: +--------- +Only the most critical bugfixes are listed here (see the ChangeLog for a +more complete list of bugfixes and for additional, more detailed bugfix +information): + + * Core OS: + + - Signals: Fix undefined reference from sig_default.c to + sched_suspend() if CONFIG_SIG_SIGSTOP_ACTION is not defined. From + raiden00pl. + - waitpid(): Fix a NULL pointer dereference on race without + DEBUG_ASSERT. From David Alessio. + - WD Timers: Back out a kludge-workaround in wd_start for an SDCC + compiler problem fix back in Feb 2017. That workaround now appears + to conflict with newer GCC versions using (unsupported) warning + options and SDCC no longer needs the work-around. From Gregory + Nutt. + - clock_systimespec(): Fix early timespec overflow if using 32 bit + system timer. From Jens Grf. + - Spinlocks: spin_trylock handle memory barrier and instrumentation + correctly. From Xiang Xiao. + - Power Management: Fix a problem where a timer cannot start when it + encounters a very small pmtick. From ligd. + - boardctl(BOARDIOC_MKRD): This change corrects a problem with NSH: + NSH was calling the OS internal function ramdisk_register() in + violation of the portable POSIX interface. This change solves the + problem by introducing a new boardctl() function BOARDIOC_MKRD + which moves the RAM disk creation into the OS. From Gregory Nutt. + - boardctl(BOARDIOC_ROMDISK): Add support for the new + BOARDIOC_ROMDISK command. This allows applications to create ROMFS + block drivers without illegal direct calls to romdisk_register. + + * File System/Block and MTD Drivers: + + - SmartFS: Fix O_CREAT without O_TRUNC truncating existing file. + Also nothing in POSIX says that O_APPEND should prevent O_TRUNC. + From Juha Niskanen. + - SmartFS: Honor O_APPEND on writes. Also document pwrite() bug/ + limitation. From Juha Niskanen. + - GD25: spi_devid argument was not used in initialization. GD25 + driver was always using priv->spi_devid initialized to zero by + kmm_zalloc(). This change initializes it from the supplied function + argument. From Juha Niskanen. + - MMC/SD: Set wrbusy after success of all the operations. Any + failure could leave wrbusy set when it should not be if the + operation failed. From David Sidrane. + - MMC/SD: Enter a removed card state On a failure. If we fail to + read cardstatus in mmcsd_transferready consider this a hard error + and set the card to removed. From David Sidrane. + - MMC/SD (SDIO): Align DMA buffer for MBURST size. From David S. + Alessio. + + * Networking/Network Drivers: + + - Socket close(): Fixed problems noted by Bernd Walter: Eliminate an + incomplete test when a disconnection event happens. When a + disconnection event occurs, the close logic MUST always terminate + the wait. The conditional test was not incorrect, however, it + lacked 'else' logic and would simply ignore that disconnection event + in some cases. That is bad because there may not be another + disconnection event and that can lead to hangs (or at least very, + very long delays). From Gregory Nutt. + - ICMPv6: Dispatch ICMP_POLL to device's callback list too since + icmpv6_neighbor stills append the callback into this list. From + Gregory Nutt. + - ICMPv6: Decouple autoconfig and ICMPv6 socket to avoid an invalid + Kconfig combination. From Xiang Xiao. + - ICMPv6: cmpv6_autoconfig() error handling must not overwrite + overwrite the error code. From Xiang Xiao. + - TCP/UDP: Fix a chicken and egg problem by eliminating the check of + the arp/neighbor tables before packet transmission: + 1. For buffered TCP/UDP case, if CONFIG_NET_ARP_SEND / + CONFIG_NET_ARP_IPIN / CONFIG_NET_ICMPv6_NEIGHBOR isn't enabled + and the table doesn't contain the Ethernet address for the + destination IP address yet, then the logic will skip the real + transmission and then ARP/neighbor logic can't steal the final + buffer to generate the ARP/ICMPV6 packet. + 2. For all other case, the TCP layer or user program should already + contain the retransmit logic, the check is redundant and may + generate many duplicated packets if ARP/ICMPV6 response is too + slow because the cursor stop forward. If user is still concerned + about the very first packet lost, he could fix the issue by + enabling CONFIG_NET_ARP_SEND / CONFIG_NET_ICMPv6_NEIGHBOR. + From Xiang Xiao. + - UDP sendto(): Add a check for the device that is polling. In the + multiple network device case, this check is necessary to prevent + sending the UDP packet to the wrong device. From Gregory Nutt. + + * Wireless/Wireless Drivers: + + - MRF24J40: Correct erroneous isolation of address mode field and + subsequent bad comparison. From Gregory Nutt. + - GS2200M: Add SPI_SELECT() to _read/write_data() in gs2200m.c + - BCM43xx Wireless: In the SDIO interface, the behavior of the DMA + setup differs, depending on the hardware capability + SDIO_CAPS_DMABEFOREWRITE. If this capability is set, then the DMA + setup much be done before the transfer setup. Dave Marples + modified this file for the i.MXRT USDHC which does have the + SDIO_CAPS_DMABEFOREWRITE. Xiao Xiang reports that this change + breaks the Wifi on the Photon which does not report the + SDIO_CAPS_DMABEFOREWRITE and suggests reverting the change. In + reality both changes are correct but must be conditioned on the + DMA capability of the underlying SDIO device. From Gregory Nutt. + + * Common Drivers: + + - Various drivers (Cloned logic): On error, memory was freed, but + the error was not returned. It just continued as though no error + happened. From Petro Karashchenko. + - Serial: Fix data corruption when outputting data in SMP mode From + Masayuki Ishikawa. + - Serial: serial_io.c used signal numbers, but did not include + signal.h. This has no problems but missing signal definitions have + been seen in certain cases. From David Sidrane. + - Serial DMA: Avoid uart_xmitchars_done() move the tail bigger then + head. If ioctl(TCOFLUSH) occurs between uart_xmitchars_dma() and + uart_xmitchars_done(), TCOFLUSH will reset xmit buffer, then + uart_xmitchars_done() will move the 'tail' ahead of 'head', then + sends lots of wrong data. From ligd. + - mkfifo(): mkfifo() should return -1 and set errno on failure From + raiden00pl. + - RAMLog: Fix ramlog readers never awakened up when using ramlog as + syslog or console. We also make an attempt to avoid the thundering + herd problem if there are multiple readers/pollers. This change also + removes forcing CONFIG_RAMLOG_CRLF in nuttx/syslog/ramlog.h as there + is no point of wasting precious RAM for useless characters. From + Juha Niskanen. + - USB CDC/ACM: Fix memory leak of RX failsafe timer. From Juha + Niskanen. + - USB HID Keyboard device: Fix keyboard debounce algorithm used when + CONFIG_HIDKBD_NODEBOUNCE is undefined. From Jeff Theusch. + - USB HID Keyboard: Change default for CONFIG_HIDKBD_POLLUSEC per + recommendation of Jeff Theusch. From Gregory Nutt. + - VL53L1X IOCTLs: IOCTL commands for the VL53L1X did not follow the + sequence. Noted by Daniel Pereira de Carvalho. From Gregory Nutt. + - syslog: syslog_force does not set errno so do not test against it. + From Juha Niskanen. + - syslog: Fix assertion that assumes re-opened syslog file is the + same. Logic in syslog_file_channel() is calling syslog_initialize() + for the default syslog device as a recovery action after failed + syslog_dev_initialize(). From Juha Niskanen. + + * Simulator: + + - Simulator HostFS: Skip '.' and '..' in readdir' From Xiang Xiao. + - Simulator HostFS: Fix warning: 'mapflags' may be used uninitialized + in this function. From Xiang Xiao. + - Simulator Tickless: Correct the calculation of the Tickless timer + period. Fix some missing initialization of globals and missing + return values. From Matias N. + - Simulator: Add -m32 to HOSTLDFLAGS if enable CONFIG_SIM_M32. From + Xiang Xiao. + - Simulator PM: Fixes compilation for sim target when enabling power + management. From Matias N. + - Simulator Build: Fixes missing recursion into sim board directory + for dependency generation. From Matias N. + - Simulator SIMUART: Remove CONFIG_SIM_UART_DATAPOST for arch/sim. + It's very dangerous to call NuttX API from simuart_thread. From + Xiang Xiao. + + * ARMv7-A + + - ARMv7-A: Apply Masayuki Ishakawa's change for ARMv7-M to this SMP + architecture as well. From Gregory Nutt. + + * ARMv7-M + + - ARMv7-M: Fix a deadlock in up_sigdeliver() in SMP mode. In + previous implementation, up_disable_irq() was called before + recovering local context. However, I noticed a deadlock happens in + the following situation. For example, if up_sigdevliver() is in + progress on CPU0 and CPU1 has called up_cpu_paused to CPU0, hence + g_cpu_irqlock has been locked by CPU1, in this case, we would see a + deadlock in later call of enter_critical_section() to restore + irqcount. To avoid this situation, we need to call + enter_critical_section() to break the deadlock. From Masayuki + Ishikawa. + + * Atmel SAM3/4 Boards: + + - SAM4CM: Fix cpustart() implementation. In Cortex-M, offset 0 in + vector table stores initial stack pointer and offset 4 stores reset + vector. From Masayuki Ishikawa. + + * Atmel SAMA5Dx Boards: + + - SAMA5D4-EK: Fix bad conditional compilation for + board_app_initialize(). Should depend only on CONFIG_LIB_BOARDCTL, + CONFIG_BUILD_KERNEL is irrelevant. From Gregory Nutt. + + * Microchip i.MXRT: + + - i.MXRT WFI: WFI needs to be disabled on i.MXRT. We found the + reason: The imxrt1050 is configured to use SYSTICK for the kernel + timer, but SYSTICK cannot wake up the MCU from low-power modes. + Disable low-power modes on this MCU until we have support for an + alternative timer. Earlier versions of the board (EVK, not EVKB), + had A0 silicon which by default did not enter low-power mode on a + WFI. With this change in place together with the previous one my + system is stable, just using more power than it should. From Dave + Marples. + + * Microchip i.MXRT Drivers: + + - i.MXRT Serial: TC (Transmission complete) and TDRE (TX Buffer + Empty) were transposed in imxrt_serial.c. The end result was that + for unoptimized code everything worked fine, but optimized code got + itself into a real mess and continually fired interrupts. From Dave + Marples. + + * Microchip i.MXRT Boards: + + - IMXRT1020-EVK: Make naming of the LED consistent. In most places + it is referred to as LED1. In board.h it is referred to as + USERLED1. The i.MXRT1020-EVK hardware user guide (HUG) uses the + name USERLED. This command makes all names internally consistent + and consistent with the HUG. Noted by Alin Jerpelea. From Gregory + Nutt. + + * NXP/Freescale Kinetis Boards: + + - TWR-K60N512: Suppress errors related to card detect GPIO + configuration if SDHC support is not enabled. From Gregory Nutt. + + * NXP LPC17xx/40xx Drivers: + + - lpc17xx/40xx I2C: Respect the I2C_M_NOSTART flag. Sending a + restart condition when not requested will break other drivers that + depend on this behavior. From Augusto Fraga Giachero. + - LPC17xx/40xx Ethernet: Use usleep() instead of up_delay() for large + wait times. From Augusto Fraga Giachero. + + * NXP LPC54xx: + + - LPC54 Clocking: Fix PLL settings. For the lpc54628 Rev. E board + the PLL was not configured properly and the board would not boot + correctly. I checked the startup files from the official IDE and + inspected the assembly instructions for the libraries used. From + Andrei Stefanescu. + + * NXP i.MXRT Boards: + + - IMXRT1060-EVK: Fix FT5X06 CTRSTn pin configuration, increased + number of pollwaiters for the FT5X06, tuned resolution during + pointer dragging. From Fabio Balzano. + + * On Semiconductor Boards: + + - LC823450: Fix cpustart() implementation. In Cortex-M, offset 0 in + vector table stores initial stack pointer and offset 4 stores reset + vector. From Masayuki Ishikawa. + - LC823450-XGEVK: Fix build error for posix_spawn. From Masayuki + Ishikawa. + + * Sony CXD56xx: + + - CXD56xx Assertions: Replace some assertions with error return + values. From Alin Jerpelea. + - CXD56xx Interrupts: Fix hang-up when error interrupt occurs. From + Alin Jerpelea. + - CXD56xx Pin Configuration: PIN_AP_CLK is used as a port selector of + SDIO expander on the extension board, and is set output low in + initialization. Therefore, this pin cannot be used by the other + board. To avoid this restriction, remove this initial operation + because this pin is pulled down by default on the extension board. + From Alin Jerpelea. + - CXD56xx: Remove duplicate NVIC_SYSH redefinitions. The NVIC_SYSH + is already defined in nvicpri.h From Alin Jerpelea. + + * Sony CXD56xx Drivers: + + - CXD56xx SDHCI: Fix initial value of semaphore in sdhci driver. + From Alin Jerpelea. + + * Sony CXD56xx Boards: + + - Spresense: The SD Card TXS02612 port expander is hosted on the + Extension board and should not be enabled if the extension board is + not present. From Alin Jerpelea. + + * STMicro STM32: + + - STM32 F4 Pin Multiplex: Ethernet pin ETH_RMII_REF_CLK is an input. + From Gregory Nutt. + - STM32 H7 ADC: Fix typos in ADC register definitions. From Markus + Bernet. + - STM32 H7: Heap allocation, SRAM and SRAM1 are not continuous From + David Sidrane. + - STM32 H7 CRC: Add the CRC option in KConfig. From Eduard Niesner. + - STM32 H7 RCC: Add PLL3 Support and only enable PLLs if used. From + David Sidrane. + - STM32 L4x6xx RCC: This fix is needed if HSI clock is selected. + Otherwise when waking up from STOP mode, the MSI clock is selected + instead of the HSI clock. From Matias N. + + * STMicro STM32 Drivers: + + - STM32 USB Host: There was no relationship between + CONFIG_STM32_USBHOST and CONFIG_USBHOST, yet they they were used + interchangeably. This means that can (and did) get out of synch + causing link time failures. This change adds logic to select + CONFIG_USBHOST when CONFIG_STM32_USBHOST is selected, keeping the + two settings synchronized. Furthermore, since CONFIG_STM32_USBHOST + is the authoritative setting, all occurrences of CONFIG_USBHOST were + replaced with CONFIG_STM32_USBHOST. From Gregory Nutt. + - STM32 SDIO: SDIO Fix system hang on card eject. From David Sidrane. + - STM32 F7 Ethernet: Large Ethernet packet can leads network halt. + From Bazooka Joe. + - STM32F7 OTGHOST: OTGFS_EPTYPE_INTR should be OTG_EPTYPE_INTR. From + Gregory Nutt. + - STM32 F7 SDMMC: SDMMC Fix system hang on card eject. From David + Sidrane. + - STM32 L4 Firewall: Correct a test to determine if an address lies + in FLASH or not. Improper mask caused test to always fail. From + Gregory Nutt. + - STM32 H7 Ethernet: Bazooka Joe's fix to the STM32 F7 Ethernet + driver should be applied to the H7 as well. The other STM32 + Ethernet drivers already have the change. From Gregory Nutt. + - STM32 H7 Ethernet: Fix ETH_MACMDIOAR_CR_MASK bit mask. From Markus + Bernet. + - STM32 H7 SDMMC: SDMMC Fix system hang on card eject. From Gregory + Nutt. + - STM32 H7 FLASH: Flash driver BUG fixes. From David Sidrane. + - STM32 H7 TIM: Correct register bit definitions and alternate + functions. Fix other copy-paste definitions. From Daniel Pereira + Volpato. + - STM32 L4 SDMMC: SDMMC Fix system hang on card eject. From David + Sidrane. + + * STMicro STM32 Boards: + + - STM32F4-Discovery: Fix build error for posix_spawn. From Masayuki + Ishikawa. + + * TI Tiva: + + - TIVA IRQs: Fix wrong IRQ vector number. From Nathan Hartman. + - Tiva FLASH: Fix several mistakes in tiva_write(). (1) Fix wrong + use of && when & was intended. (2) Add compile- time warning + directive because according to this function's interface, it is + supposed to support unaligned writes and/or writes of arbitrary + numbers of bytes to FLASH. However, this function does NOT support + that at this time. This needs to be fixed. (3) Fix wrong + preprocessor conditional. Was written to use the 32-word write + buffer only for TM4C1294NCPDT. This buffer is available on all + M4C123 and TM4C129 parts. Now conditioned upon + CONFIG_ARCH_CHIP_TM4C123 or CONFIG_ARCH_CHIP_TM4C129. (4) Add + comments to document the intent of the above preprocessor logic. + From Nathan Hartman. + + * Xtensa + + - Xtensa: Apply Masayuki Ishakawa's change for ARMv7-M to this SMP + architecture as well. From Gregory Nutt. + + * Build System: + + - Makefiles: Change ${shell pwd} to $(CURDIR) since pwd doesn't exist + on Windows From Xiang Xiao. + - tools/Makefile.unix: Fix build error when issue 'make -B': "mkdir: + cannot create directory 'staging': File exists: + tools/Makefile.unix:269: recipe for target 'staging' failed". From + Xiang Xiao. + - All ARM linker scripts: Preface all _ebss definitions with '. = + ALIGN(4)'. Otherwise, the following .bss section may not be aligned + properly. From Gregory Nutt. + - MIPS Linker Scripts: The PIC32M* start-up code initializes .bss by + writing 16 bytes at a time in a loop. The start (_sbss) alignment + is only required to be 4 bytes since the write is done with 4 store + instructions. From Gregory Nutt. + - Top-level Kconfig: Add some protection so that you cannot select an + architecture-specific header file if the architecture does not + provide the header file. From Gregory Nutt. + - libc Kconfig: Should select the NuttX float.h file automatically + if the NuttX math library is selected. From Gregory Nutt. + - tools/Makefile.unix: Make COMMON_DIR work with + CONFIG_ARCH_BOARD_CUSTOM. From Xiang Xiao. + - tools/ Make fragments: Fix the various minor issue for NUTTXLIBS / + USERLIBS: (1) Remove libcxx duplication in FlatLibs.mk and from + kernel space, (2) Remove libpass1 from KernelLibs.mk since kernel + build doesn't support the two pass mode, and (3) Remove FSDIR + related comment since file system cannot be disabled now From Xiang + Xiao. + + * C Library/Header Files: + + - getcwd(): Remove stray sched_unlock(). Also fixes several typos. + From Juha Niskanen. + - date(), hostname(): Fix portability issue with date, hostname From + David Alessio. + - libs/libxx/Kconfig: Automatically select CONFIG_CLOCK_MONOTONIC when + CONFIG_LIBCXX is selected. Removed hardcoded -DCLOCK_MONOTONIC from + CFLAGS in Make.defs of several configurations. That definition is + now automatically adding this define when CONFIG_LIBCXX=y. From + Daniel Pereira Volpato. + - libs/libxx/Kconfig: CONFIG_LIBC_LOCALE is needed to build libcxx. + A math library is also needed, however, there are various ways to + provide a math library so CONFIG_LIBM is not now set. From Matias + N. + - libs/libc/symtab: Move symbol table generation into libc since the + address in symbol table should come from userspace binary for + PROTECTED build, not kernel binary. From Xiang Xiao. + - libs/libc/ Kconfig files: Disable EXECFUNCS_HAVE_SYMTAB for kernel + build. The symbol table doesn't have any meaning for kernel build + since all executable binary should be self contained. From Xiang + Xiao. + + - include/sys/time.h: According to earlier standards, usage of + select(), FD_CLR, FD_ISSET, FD_SET and FD_ZERO just need include + headers: sys/time.h, sys/types.h and unistd.h. So include + sys/select.h in time.h to compatible with it. Or mbedtls library + would build break in calling select() and FD_* related functions. + From liuhaitao. + + * Tools: + + - tools/configure.sh and configure.c: Do not remove CONFIG_SIM_M32 if + host is specified. From anchao. + - tools/Directories.mk: Remove FSDIRS/NOFSDIRS related logic/comments + since the file system can no longer be disabled now. From Xiang + Xiao. + - tools/Makefile.host: Add missing binaries from clean target. From + Gregory Nutt. + - tools/mkromfsimg.sh: Use sed to add const to ROMFS declarations so + that they lie in FLASH not RAM. From Bernd Walter. + - tools/nxstyle.c: Correct detection of missing blank line following + a block comment. From Gregory Nutt. + + * apps/ Build System: + + - Makefiles: Change ${shell pwd} to $(CURDIR) since pwd doesn't exist + on Windows From Xiang Xiao. + - Makefile: Fix warning: jobserver unavailable: using -j1. Add '+' to + parent make rule. From Xiang Xiao. + - apps/Application.mk: Correct an error in PATH usage. Use of + toolchain path causes make errors. From Gregory Nutt. + + * apps/tools: + + - tools/mkromfsimg.sh: Use sed to add const to ROMFS declarations so + that they like in FLASH not RAM. From Bernd Walter. + + * Examples: apps/examples: + + - apps/examples/mount: Replace illegal call to ramdisk_register() + with a call to boardctl(BOARDIOC_MKRD). From Gregory Nutt. + - apps/examples/nxlines/: Correct nxlines example program name. From + Gregory Nutt. + - apps/examples/nxterm/: PROGNAME, PRIORITY, STACKSIZE variable + names did not match declarations in Kconfig file. From Gregory + Nutt. + - apps/examples/romfs: Remove romfs_testdir.h. That file is + regenerated whenever the example is built and so should not be in + the repository. From Gregory Nutt. + + * Testing: apps/testing: + + - apps/testing/cxxtest/: Fix typo error in testing/cxxtest. From + Xiang Xiao. + - apps/testing/unity/: Fix the error when creating Make.dep. From + raiden00pl. + + * NSH Library: apps/nshlib: + + - apps/nshlib: Remove the inappropriate NSH_BUILTIN_APPS coupling. + From Xiang Xiao. + - apps/nshlib/: The NSH mkrd command was in violation of the NuttX + portable POSIX interface. It was calling the internal OS function + ramdisk_register() directly. Not only is this a violation of the + interface specification, but also prevents use of mkrd in PROTECTED + or KERNEL builds. With this change, the NSH mkrd command now uses + the BOARDIOC_MKRD boardctl() command. This command is available in + all build modes. The effect of this change is to move the heart of + the NSH mkrd command into to OS and provide user-space access via + boardctl(). From Gregory Nutt. + - apps/nshlib/: Replace direct calls to romdisk_register() with + indirect calls via boardioctl(BOARDIOC_ROMDISK). This not only + fixes the violation of the portable POSIX OS interface, but also + permits use of ROM disks in PROTECTED and KERNEL modes. From + Gregory Nutt. + - apps/nshlib/: Add missing NSH_DISABLE_DMESG from Kconfig. From + Juha Niskanen. + + * System Utilities: apps/system: + + - apps/system/cle/: This change modifies the cle to use the streams + file interface more consistently and has removed the observed race + conditions. It was previously a mix of streams and fileio. It + also simplifies the VT100 cursor position handling. From Dave + Marples. + - apps/system/composite: Remove usb serial loopback test code we can + achieve the same effect by cat or dd command. From Xiang Xiao. + - apps/system/cu/: (1) Fix early exit. getc(stdin) can return 0 the + first time around. (2) Set optind to zero. getopt() was being + left in a bad state, causing parsing errors on second use. (3) Fix + priority of cu_listen(). (4) Add suppor for -h. From David + Alessio. + - apps/system/lzf/: Check the protection by CONFIG_SYSTEM_LZF != + CONFIG_m (not elf binary) instead of CONFIG_KERNEL_BUILD. From + Xiang Xiao. + - apps/system/spi: Correctly parse exch txdata args, if any. Should + always call the board's deselect From David Alessio. + + * File System Utilities: apps/fsutils: + + - apps/fsutils/passwd/: Use named semaphore by checking + CONFIG_FS_NAMED_SEMAPHORES instead of CONFIG_KERNEL_BUILD. From + Xiang Xiao. + + * Network Utilities: apps/netutils: + + - apps/netutils/cjson/Makefile: Fix the error when creating + Make.dep. From raiden00pl. + + * Graphics: apps/graphics: + + - apps/graphics/twm4nx/: Fix a recently introduced error that broke + all Twm4Nx configurations. From Gregory Nutt. + - apps/graphics/traveler/: Replace direct calls to romdisk_register() + with indirect calls via boardioctl(BOARDIOC_ROMDISK). This not only + fixes the violation of the portable POSIX OS interface, but also + permits use of ROM disks in PROTECTED and KERNEL modes. From + Gregory Nutt. diff --git a/drivers/bch/bch.h b/drivers/bch/bch.h new file mode 100755 index 0000000..e1e0685 --- /dev/null +++ b/drivers/bch/bch.h @@ -0,0 +1,110 @@ +/**************************************************************************** + * drivers/bch/bch.h + * + * Copyright (C) 2008-2009, 2014-2015 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __DRIVERS_BCH_BCH_H +#define __DRIVERS_BCH_BCH_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include "fs/fs.h" +#include "disk.h" +#include "user_copy.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define bchlib_semgive(d) (void)sem_post(&(d)->sem) /* To match bchlib_semtake */ +#define MAX_OPENCNT (255) /* Limit of uint8_t */ +#define DIOC_GETPRIV (0x1000) + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +struct bchlib_s +{ + struct inode *inode; /* I-node of the block driver */ + uint32_t sectsize; /* The size of one sector on the device */ + unsigned long long nsectors; /* Number of sectors supported by the device */ + unsigned long long sector; /* The current sector in the buffer */ + sem_t sem; /* For atomic accesses to this structure */ + uint8_t refs; /* Number of references */ + bool dirty; /* true: Data has been written to the buffer */ + bool readonly; /* true: Only read operations are supported */ + bool unlinked; /* true: The driver has been unlinked */ + uint8_t *buffer; /* One sector buffer */ + los_disk *disk; + unsigned long long sectstart; +}; + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +EXTERN const struct file_operations_vfs bch_fops; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +EXTERN void bchlib_semtake(struct bchlib_s *bch); +EXTERN int bchlib_flushsector(struct bchlib_s *bch); +EXTERN int bchlib_readsector(struct bchlib_s *bch, unsigned long long sector); +EXTERN int bchlib_setup(const char *blkdev, bool readonly, void **handle); +EXTERN int bchlib_teardown(void *handle); +EXTERN ssize_t bchlib_read(void *handle, char *buffer, loff_t offset, size_t len); +EXTERN ssize_t bchlib_write(void *handle, const char *buffer, loff_t offset, size_t len); + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __DRIVERS_BCH_BCH_H */ diff --git a/drivers/bch/bchdev_driver.c b/drivers/bch/bchdev_driver.c new file mode 100755 index 0000000..2da55e6 --- /dev/null +++ b/drivers/bch/bchdev_driver.c @@ -0,0 +1,454 @@ +/**************************************************************************** + * drivers/bch/bchdev_driver.c + * + * Copyright (C) 2008-2009, 2014-2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "bch.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static int bch_open(struct file *filep); +static int bch_close(struct file *filep); +static off_t bch_seek(struct file *filep, off_t offset, int whence); +static ssize_t bch_read(struct file *filep, char *buffer, + size_t buflen); +static ssize_t bch_write(struct file *filep, const char *buffer, + size_t buflen); +static int bch_ioctl(struct file *filep, int cmd, + unsigned long arg); +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS +static int bch_unlink(struct inode *inode); +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +const struct file_operations_vfs bch_fops = +{ + bch_open, /* open */ + bch_close, /* close */ + bch_read, /* read */ + bch_write, /* write */ + bch_seek, /* seek */ + bch_ioctl, /* ioctl */ + NULL, /* mmap */ +#ifndef CONFIG_DISABLE_POLL + NULL, /* poll */ +#endif + bch_unlink, /* unlink */ +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: bch_open + * + * Description: Open the block device + * + ****************************************************************************/ + +static int bch_open(FAR struct file *filep) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct bchlib_s *bch; + int ret = OK; + + DEBUGASSERT(inode && inode->i_private); + bch = (FAR struct bchlib_s *)inode->i_private; + + /* Increment the reference count */ + + bchlib_semtake(bch); + if (bch->refs == MAX_OPENCNT) + { + ret = -EMFILE; + } + else + { + bch->refs++; + } + + bchlib_semgive(bch); + return ret; +} + +/**************************************************************************** + * Name: bch_close + * + * Description: close the block device + * + ****************************************************************************/ + +static int bch_close(FAR struct file *filep) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct bchlib_s *bch; + int ret = OK; + + DEBUGASSERT(inode && inode->i_private); + bch = (FAR struct bchlib_s *)inode->i_private; + + /* Flush any dirty pages remaining in the cache */ + + bchlib_semtake(bch); + (void)bchlib_flushsector(bch); + + /* Decrement the reference count (I don't use bchlib_decref() because I + * want the entire close operation to be atomic wrt other driver + * operations. + */ + + if (bch->refs == 0) + { + ret = -EIO; + } + else + { + bch->refs--; + + /* If the reference count decremented to zero AND if the character + * driver has been unlinked, then teardown the BCH device now. + */ + + if (bch->refs == 0 && bch->unlinked) + { + /* Tear the driver down now. */ + + ret = bchlib_teardown((FAR void *)bch); + + /* bchlib_teardown() would only fail if there are outstanding + * references on the device. Since we know that is not true, it + * should not fail at all. + */ + + DEBUGASSERT(ret >= 0); + if (ret >= 0) + { + /* Return without releasing the stale semaphore */ + + return OK; + } + } + } + + bchlib_semgive(bch); + return ret; +} + +/**************************************************************************** + * Name: bch_seek + ****************************************************************************/ + +static off_t bch_seek(FAR struct file *filep, off_t offset, int whence) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct bchlib_s *bch; + loff_t newpos; + int ret; + + DEBUGASSERT(inode && inode->i_private); + + bch = (FAR struct bchlib_s *)inode->i_private; + bchlib_semtake(bch); + + /* Determine the new, requested file position */ + + switch (whence) + { + case SEEK_CUR: + newpos = filep->f_pos + offset; + break; + + case SEEK_SET: + newpos = offset; + break; + + case SEEK_END: + newpos = (loff_t)bch->sectsize * bch->nsectors + offset; + break; + + default: + /* Return EINVAL if the whence argument is invalid */ + + bchlib_semgive(bch); + return -EINVAL; + } + + /* Opengroup.org: + * + * "The lseek() function shall allow the file offset to be set beyond the end + * of the existing data in the file. If data is later written at this point, + * subsequent reads of data in the gap shall return bytes with the value 0 + * until data is actually written into the gap." + * + * We can conform to the first part, but not the second. But return EINVAL if + * + * "...the resulting file offset would be negative for a regular file, block + * special file, or directory." + */ + + if (newpos >= 0) + { + filep->f_pos = newpos; + ret = newpos; + } + else + { + ret = -EINVAL; + } + + bchlib_semgive(bch); + return ret; +} + +/**************************************************************************** + * Name: bch_read + ****************************************************************************/ + +static ssize_t bch_read(FAR struct file *filep, FAR char *buffer, size_t len) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct bchlib_s *bch; + int ret; + + DEBUGASSERT(inode && inode->i_private); + bch = (FAR struct bchlib_s *)inode->i_private; + + bchlib_semtake(bch); + ret = bchlib_read(bch, buffer, filep->f_pos, len); + if (ret > 0) + { + filep->f_pos += len; + } + + bchlib_semgive(bch); + return ret; +} + +/**************************************************************************** + * Name: bch_write + ****************************************************************************/ + +static ssize_t bch_write(FAR struct file *filep, FAR const char *buffer, size_t len) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct bchlib_s *bch; + int ret = -EACCES; + + DEBUGASSERT(inode && inode->i_private); + bch = (FAR struct bchlib_s *)inode->i_private; + + if (!bch->readonly) + { + bchlib_semtake(bch); + ret = bchlib_write(bch, buffer, filep->f_pos, len); + if (ret > 0) + { + filep->f_pos += len; + } + + bchlib_semgive(bch); + } + + return ret; +} + +/**************************************************************************** + * Name: bch_ioctl + * + * Description: + * Handle IOCTL commands + * + ****************************************************************************/ + +static int bch_ioctl(FAR struct file *filep, int cmd, unsigned long arg) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct bchlib_s *bch; + int ret = -ENOTTY; + + DEBUGASSERT(inode && inode->i_private); + bch = (FAR struct bchlib_s *)inode->i_private; + + /* Process the call according to the command */ + + switch (cmd) + { + /* This isa request to get the private data structure */ + + case DIOC_GETPRIV: + { + FAR struct bchlib_s **bchr = + (FAR struct bchlib_s **)((uintptr_t)arg); + + bchlib_semtake(bch); + if (!bchr || bch->refs == MAX_OPENCNT) + { + ret = -EINVAL; + } + else + { + bch->refs++; + ret = LOS_CopyFromKernel(bchr, sizeof(char *), &bch, sizeof(char *)); + if (ret) + { + ret = -EFAULT; + } + else + { + ret = OK; + } + } + + bchlib_semgive(bch); + } + break; + + /* Otherwise, pass the IOCTL command on to the contained block driver. */ + + default: + { + struct inode *bchinode = bch->inode; + + /* Does the block driver support the ioctl method? */ + + los_disk *disk = bch->disk; + if (disk == NULL) + { + ret = -1; + break; + } + + if (pthread_mutex_lock(&disk->disk_mutex) != ENOERR) + { + PRINT_ERR("%s %d, mutex lock fail!\n", __FUNCTION__, __LINE__); + return -1; + } + if (disk->disk_status == STAT_INUSED) + { + if (bchinode->u.i_bops->ioctl != NULL) + { + ret = bchinode->u.i_bops->ioctl(bchinode, cmd, arg); + } + } + + if (pthread_mutex_unlock(&disk->disk_mutex) != ENOERR) + { + PRINT_ERR("%s %d, mutex unlock fail!\n", __FUNCTION__, __LINE__); + return -1; + } + } + break; + } + + return ret; +} + +/**************************************************************************** + * Name: bch_unlink + * + * Handle unlinking of the BCH device + * + ****************************************************************************/ + +static int bch_unlink(FAR struct inode *inode) +{ + FAR struct bchlib_s *bch; + int ret = OK; + + DEBUGASSERT(inode && inode->i_private); + bch = (FAR struct bchlib_s *)inode->i_private; + + /* Get exclusive access to the BCH device */ + + bchlib_semtake(bch); + + /* Indicate that the driver has been unlinked */ + + bch->unlinked = true; + + /* If there are no open references to the drvier then teardown the BCH + * device now. + */ + + if (bch->refs == 0) + { + /* Tear the driver down now. */ + + ret = bchlib_teardown((FAR void *)bch); + + /* bchlib_teardown() would only fail if there are outstanding + * references on the device. Since we know that is not true, it + * should not fail at all. + */ + + DEBUGASSERT(ret >= 0); + if (ret >= 0) + { + /* Return without releasing the stale semaphore */ + + return OK; + } + } + + bchlib_semgive(bch); + return ret; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ diff --git a/drivers/bch/bchdev_register.c b/drivers/bch/bchdev_register.c new file mode 100755 index 0000000..7e7dd5a --- /dev/null +++ b/drivers/bch/bchdev_register.c @@ -0,0 +1,84 @@ +/**************************************************************************** + * drivers/bch/bchdev_register.c + * + * Copyright (C) 2008-2009, 2012, 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include "bch.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: bchdev_register + * + * Description: + * Setup so that it exports the block driver referenced by 'blkdev' as a + * character device 'chardev' + * + ****************************************************************************/ + +int bchdev_register(FAR const char *blkdev, FAR const char *chardev, + bool readonly) +{ + FAR void *handle; + int ret; + + /* Setup the BCH lib functions */ + + ret = bchlib_setup(blkdev, readonly, &handle); + if (ret < 0) + { + PRINTK("ERROR: bchlib_setup failed: %d\n", -ret); + return ret; + } + + /* Then setup the character device */ + + ret = register_driver(chardev, &bch_fops, 0666, handle); + if (ret < 0) + { + PRINTK("ERROR: register_driver failed: %d\n", -ret); + (void)bchlib_teardown(handle); + handle = NULL; + } + + return ret; +} diff --git a/drivers/bch/bchdev_unregister.c b/drivers/bch/bchdev_unregister.c new file mode 100755 index 0000000..9a4d760 --- /dev/null +++ b/drivers/bch/bchdev_unregister.c @@ -0,0 +1,137 @@ +/**************************************************************************** + * drivers/bch/bchdev_unregister.c + * + * Copyright (C) 2008-2009, 2012, 2016, 2018 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "bch.h" + +#define _err PRINTK + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: bchdev_unregister + * + * Description: + * Unregister character driver access to a block device that was created + * by a previous call to bchdev_register(). + * + ****************************************************************************/ + +int bchdev_unregister(FAR const char *chardev) +{ + FAR struct bchlib_s *bch; + int fd; + int ret; + + /* Sanity check */ + + if (!chardev) + { + return -EINVAL; + } + + /* Open the character driver associated with chardev */ + + fd = open(chardev, O_RDONLY); + if (fd < 0) + { + _err("ERROR: Failed to open %s: %d\n", chardev, errno); + return -errno; + } + + /* Get a reference to the internal data structure. On success, we + * will hold a reference count on the state structure. + */ + + ret = ioctl(fd, DIOC_GETPRIV, (unsigned long)((uintptr_t)&bch)); + (void)close(fd); + + if (ret < 0) + { + _err("ERROR: ioctl failed: %d\n", errno); + return -errno; + } + + /* Lock out context switches. If there are no other references + * and no context switches, then we can assume that we can safely + * teardown the driver. + */ + + LOS_TaskLock(); + + /* Check if the internal structure is non-busy (we hold one reference). */ + + if (bch->refs > 1) + { + ret = -EBUSY; + goto errout_with_lock; + } + + /* Unregister the driver (this cannot suspend or we lose our non-preemptive + * state!). Once the driver is successfully unregistered, we can assume + * we have exclusive access to the state instance. + */ + + ret = unregister_driver(chardev); + if (ret < 0) + { + goto errout_with_lock; + } + + LOS_TaskUnlock(); + + /* Release the internal structure */ + + bch->refs = 0; + return bchlib_teardown(bch); + +errout_with_lock: + bch->refs--; + LOS_TaskUnlock(); + return ret; +} diff --git a/drivers/bch/bchlib_cache.c b/drivers/bch/bchlib_cache.c new file mode 100755 index 0000000..4c62087 --- /dev/null +++ b/drivers/bch/bchlib_cache.c @@ -0,0 +1,126 @@ +/**************************************************************************** + * drivers/bch/bchlib_cache.c + * + * Copyright (C) 2008-2009, 2014, 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include "bch.h" + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: bchlib_flushsector + * + * Description: + * Flush the current contents of the sector buffer (if dirty) + * + * Assumptions: + * Caller must assume mutual exclusion + * + ****************************************************************************/ + +int bchlib_flushsector(FAR struct bchlib_s *bch) +{ + int ret = OK; + + /* Check if the sector has been modified and is out of synch with the + * media. + */ + + if (bch->dirty) + { + /* Write the sector to the media */ + + ret = los_disk_write(bch->disk->disk_id, (FAR const void *)bch->buffer, bch->sector, 1); + if (ret < 0) + { + PRINTK("bchlib_flushsector Write failed: %d\n", ret); + return ret; + } + + /* The sector is now in sync with the media */ + + bch->dirty = false; + } + + return ret; +} + +/**************************************************************************** + * Name: bchlib_readsector + * + * Description: + * Flush the current contents of the sector buffer (if dirty) + * + * Assumptions: + * Caller must assume mutual exclusion + * + ****************************************************************************/ + +int bchlib_readsector(FAR struct bchlib_s *bch, unsigned long long sector) +{ + int ret = OK; + + if (bch->sector != sector) + { + ret = bchlib_flushsector(bch); + if (ret < 0) + { + return ret; + } + + bch->sector = (unsigned long long)-1; + ret = los_disk_read(bch->disk->disk_id, (FAR void *)bch->buffer, sector, 1); + if (ret < 0) + { + PRINTK("Read failed: %d\n", ret); + return ret; + } + bch->sector = sector; + } + return ret; +} + diff --git a/drivers/bch/bchlib_read.c b/drivers/bch/bchlib_read.c new file mode 100755 index 0000000..0c3960c --- /dev/null +++ b/drivers/bch/bchlib_read.c @@ -0,0 +1,212 @@ +/**************************************************************************** + * drivers/bch/bchlib_read.c + * + * Copyright (C) 2008-2009, 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include "bch.h" +#include + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: bchlib_read + * + * Description: + * Read from the block device set-up by bchlib_setup as if it were a character + * device. + * + ****************************************************************************/ + +ssize_t bchlib_read(FAR void *handle, FAR char *buffer, loff_t offset, size_t len) +{ + FAR struct bchlib_s *bch = (FAR struct bchlib_s *)handle; + size_t nsectors; + unsigned long long sector; + uint16_t sectoffset; + size_t nbytes; + size_t bytesread; + int ret; + + /* Get rid of this special case right away */ + + if (len < 1) + { + return 0; + } + + /* Convert the file position into a sector number an offset. */ + + sector = offset / bch->sectsize; + sectoffset = offset - sector * bch->sectsize; + + if (sector >= bch->nsectors) + { + /* Return end-of-file */ + + return 0; + } + + /* Read the initial partial sector */ + + bytesread = 0; + if (sectoffset > 0) + { + /* Read the sector into the sector buffer */ + + ret = bchlib_readsector(bch, sector + bch->sectstart); + if (ret < 0) + { + return bytesread; + } + + /* Copy the tail end of the sector to the user buffer */ + + if (sectoffset + len > bch->sectsize) + { + nbytes = bch->sectsize - sectoffset; + } + else + { + nbytes = len; + } + + ret = LOS_CopyFromKernel(buffer, len, &bch->buffer[sectoffset], nbytes); + if (ret != EOK) + { + PRINTK("ERROR: bchlib_read failed: %d\n", ret); + return bytesread; + } + + /* Adjust pointers and counts */ + + ++sector; + + if (sector >= bch->nsectors) + { + return nbytes; + } + + bytesread = nbytes; + buffer += nbytes; + len -= nbytes; + } + + /* Then read all of the full sectors following the partial sector directly + * into the user buffer. + */ + + if (len >= bch->sectsize) + { + nsectors = len / bch->sectsize; + if (sector + nsectors > bch->nsectors) + { + nsectors = bch->nsectors - sector; + } + ret = los_disk_read(bch->disk->disk_id, (FAR void *)buffer, sector + bch->sectstart, nsectors); + + if (ret < 0) + { + PRINTK("ERROR: Read failed: %d\n", ret); + return bytesread; + } + + /* Adjust pointers and counts */ + + sector += nsectors; + nbytes = nsectors * bch->sectsize; + bytesread += nbytes; + + if (sector >= bch->nsectors) + { + return bytesread; + } + + buffer += nbytes; + len -= nbytes; + } + + /* Then read any partial final sector */ + + if (len > 0) + { + /* Read the sector into the sector buffer */ + + ret = bchlib_readsector(bch, sector + bch->sectstart); + if (ret < 0) + { + return bytesread; + } + + /* Copy the head end of the sector to the user buffer */ + + ret = LOS_CopyFromKernel(buffer, len, bch->buffer, len); + if (ret != EOK) + { + PRINTK("ERROR: bchlib_read failed: %d\n", ret); + return bytesread; + } + + /* Adjust counts */ + + bytesread += len; + } + + return bytesread; +} diff --git a/drivers/bch/bchlib_sem.c b/drivers/bch/bchlib_sem.c new file mode 100755 index 0000000..fc0c4fd --- /dev/null +++ b/drivers/bch/bchlib_sem.c @@ -0,0 +1,63 @@ +/**************************************************************************** + * drivers/bch/bchlib_sem.c + * + * Copyright (C) 2008-2009, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include "bch.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: bch_semtake + ****************************************************************************/ + +void bchlib_semtake(FAR struct bchlib_s *bch) +{ + while (sem_wait(&bch->sem) != 0) + { + /* The only case that an error should occur here is if the wait was + * awakened by a signal. + */ + + LOS_ASSERT(get_errno() == EINTR); + } +} diff --git a/drivers/bch/bchlib_setup.c b/drivers/bch/bchlib_setup.c new file mode 100755 index 0000000..720c8fd --- /dev/null +++ b/drivers/bch/bchlib_setup.c @@ -0,0 +1,155 @@ +/**************************************************************************** + * drivers/bch/bchlib_setup.c + * + * Copyright (C) 2008-2009, 2011, 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "bch.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: bchlib_setup + * + * Description: + * Setup so that the block driver referenced by 'blkdev' can be accessed + * similar to a character device. + * + ****************************************************************************/ + +int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle) +{ + FAR struct bchlib_s *bch; + struct geometry geo; + los_part *part; + int ret; + + DEBUGASSERT(blkdev); + + /* Allocate the BCH state structure */ + + bch = (FAR struct bchlib_s *)zalloc(sizeof(struct bchlib_s)); + if (!bch) + { + PRINTK("ERROR: Failed to allocate BCH structure\n"); + return -ENOMEM; + } + + + /* Open the block driver */ + + ret = open_blockdriver(blkdev, readonly ? MS_RDONLY : 0, &bch->inode); + if (ret < 0) + { + PRINTK("ERROR: Failed to open driver %s: %d\n", blkdev, -ret); + goto errout_with_bch; + } + + DEBUGASSERT(bch->inode && bch->inode->u.i_bops && bch->inode->u.i_bops->geometry); + + ret = bch->inode->u.i_bops->geometry(bch->inode, &geo); + if (ret < 0) + { + PRINTK("ERROR: geometry failed: %d\n", -ret); + goto errout_with_bch; + } + + if (!geo.geo_available) + { + PRINTK("ERROR: geometry failed: %d\n", -ret); + ret = -ENODEV; + goto errout_with_bch; + } + + if (!readonly && (!bch->inode->u.i_bops->write || !geo.geo_writeenabled)) + { + PRINTK("ERROR: write access not supported\n"); + ret = -EACCES; + goto errout_with_bch; + } + + /* Save the geometry info and complete initialization of the structure */ + + (void)sem_init(&bch->sem, 0, 1); + bch->nsectors = geo.geo_nsectors; + bch->sectsize = geo.geo_sectorsize; + bch->sector = (size_t)-1; + bch->readonly = readonly; + bch->dirty = false; + bch->unlinked = false; + + part = los_part_find(bch->inode); + if (part != NULL) + { + bch->sectstart = part->sector_start; + bch->nsectors = part->sector_count; + bch->disk = get_disk(part->disk_id); + } + else + { + PRINTK("ERROR: los_part_find failed\n"); + ret = -ENODEV; + goto errout_with_bch; + } + + /* Allocate the sector I/O buffer */ + + bch->buffer = (FAR uint8_t *)malloc(bch->sectsize); + if (!bch->buffer) + { + PRINTK("ERROR: Failed to allocate sector buffer\n"); + ret = -ENOMEM; + goto errout_with_bch; + } + + *handle = bch; + return OK; + +errout_with_bch: + (void)sem_destroy(&bch->sem); + free(bch); + return ret; +} diff --git a/drivers/bch/bchlib_teardown.c b/drivers/bch/bchlib_teardown.c new file mode 100755 index 0000000..47425c0 --- /dev/null +++ b/drivers/bch/bchlib_teardown.c @@ -0,0 +1,90 @@ +/**************************************************************************** + * drivers/bch/bchlib_teardown.c + * + * Copyright (C) 2008-2009, 2011, 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include "bch.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: bchlib_teardown + * + * Description: + * Setup so that the block driver referenced by 'blkdev' can be accessed + * similar to a character device. + * + ****************************************************************************/ + +int bchlib_teardown(FAR void *handle) +{ + FAR struct bchlib_s *bch = (FAR struct bchlib_s *)handle; + + DEBUGASSERT(handle); + + /* Check that there are not outstanding reference counts on the object */ + + if (bch->refs > 0) + { + return -EBUSY; + } + + /* Flush any pending data to the block driver */ + + (void)bchlib_flushsector(bch); + + /* Close the block driver */ + + (void)close_blockdriver(bch->inode); + + /* Free the BCH state structure */ + + if (bch->buffer) + { + free(bch->buffer); + } + + (void)sem_destroy(&bch->sem); + free(bch); + return OK; +} + diff --git a/drivers/bch/bchlib_write.c b/drivers/bch/bchlib_write.c new file mode 100755 index 0000000..6140633 --- /dev/null +++ b/drivers/bch/bchlib_write.c @@ -0,0 +1,209 @@ +/**************************************************************************** + * drivers/bch/bchlib_write.c + * + * Copyright (C) 2008-2009, 2011, 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include "bch.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: bchlib_write + * + * Description: + * Write to the block device set-up by bchlib_setup as if it were a character + * device. + * + ****************************************************************************/ + +ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, loff_t offset, size_t len) +{ + FAR struct bchlib_s *bch = (FAR struct bchlib_s *)handle; + size_t nsectors; + unsigned long long sector; + uint16_t sectoffset; + size_t nbytes; + size_t byteswritten; + int ret; + + /* Get rid of this special case right away */ + + if (len < 1) + { + return 0; + } + + /* Convert the file position into a sector number and offset. */ + + sector = offset / bch->sectsize; + sectoffset = offset - sector * bch->sectsize; + + if (sector >= bch->nsectors) + { + return 0; + } + + /* Write the initial partial sector */ + + byteswritten = 0; + if (sectoffset > 0) + { + /* Read the full sector into the sector buffer */ + + ret = bchlib_readsector(bch, sector + bch->sectstart); + if (ret < 0) + { + return byteswritten; + } + + /* Copy the tail end of the sector from the user buffer */ + + if (sectoffset + len > bch->sectsize) + { + nbytes = bch->sectsize - sectoffset; + } + else + { + nbytes = len; + } + + ret = LOS_CopyToKernel(&bch->buffer[sectoffset], nbytes, buffer, nbytes); + if (ret != EOK) + { + PRINTK("ERROR: bchlib_write failed: %d\n", ret); + return byteswritten; + } + bch->dirty = true; + + /* Adjust pointers and counts */ + + sector++; + + if (sector >= bch->nsectors) + { + return nbytes; + } + + byteswritten = nbytes; + buffer += nbytes; + len -= nbytes; + } + + /* Then write all of the full sectors following the partial sector + * directly from the user buffer. + */ + + if (len >= bch->sectsize) + { + nsectors = len / bch->sectsize; + if (sector + nsectors > bch->nsectors) + { + nsectors = bch->nsectors - sector; + } + + /* Write the contiguous sectors */ + + ret = los_disk_write(bch->disk->disk_id, (FAR const void *)buffer, + sector + bch->sectstart, nsectors); + if (ret < 0) + { + PRINTK("ERROR: Write failed: %d\n", ret); + return byteswritten; + } + + /* Adjust pointers and counts */ + + sector += nsectors; + nbytes = nsectors * bch->sectsize; + byteswritten += nbytes; + + if (sector >= bch->nsectors) + { + return byteswritten; + } + + buffer += nbytes; + len -= nbytes; + } + + /* Then write any partial final sector */ + + if (len > 0) + { + /* Read the sector into the sector buffer */ + + ret = bchlib_readsector(bch, sector + bch->sectstart); + if (ret < 0) + { + return byteswritten; + } + + /* Copy the head end of the sector from the user buffer */ + + ret = LOS_CopyToKernel(bch->buffer, len, buffer, len); + if (ret != EOK) + { + PRINTK("ERROR: bchlib_write failed: %d\n", ret); + return byteswritten; + } + bch->dirty = true; + + /* Adjust counts */ + + byteswritten += len; + } + + /* Finally, flush any cached writes to the device as well */ + + ret = bchlib_flushsector(bch); + if (ret < 0) + { + PRINTK("ERROR: Flush failed: %d\n", ret); + return byteswritten; + } + + return byteswritten; +} + diff --git a/drivers/pipes/BUILD.gn b/drivers/pipes/BUILD.gn new file mode 100755 index 0000000..f222987 --- /dev/null +++ b/drivers/pipes/BUILD.gn @@ -0,0 +1,41 @@ +# Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020, Huawei Device Co., Ltd. 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. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "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 COPYRIGHT HOLDER OR +# CONTRIBUTORS 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. + +static_library("drivers_pipe") { + + sources = [ + "fifo.c", + "pipe.c", + "pipe_common.c", + ] + + include_dirs = [ + "./", + ] +} diff --git a/drivers/pipes/Makefile b/drivers/pipes/Makefile new file mode 100755 index 0000000..56f0fac --- /dev/null +++ b/drivers/pipes/Makefile @@ -0,0 +1,37 @@ +# Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020, Huawei Device Co., Ltd. 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. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "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 COPYRIGHT HOLDER OR +# CONTRIBUTORS 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. +include $(LITEOSTOPDIR)/config.mk + +MODULE_NAME := $(notdir $(shell pwd)) + +ifeq ($(LOSCFG_KERNEL_PIPE), y) + LOCAL_SRCS += $(wildcard ./*.c) +endif + +include $(MODULE) diff --git a/drivers/pipes/fifo.c b/drivers/pipes/fifo.c new file mode 100755 index 0000000..fd4b33f --- /dev/null +++ b/drivers/pipes/fifo.c @@ -0,0 +1,151 @@ +/**************************************************************************** + * drivers/pipes/fifo.c + * + * Copyright (C) 2008-2009, 2014-2015 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include + +#include + +#include "pipe_common.h" + +#if CONFIG_DEV_FIFO_SIZE > 0 + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static ssize_t fifo_map(FAR struct file* filep, FAR LosVmMapRegion *region) +{ + PRINTK("%s %d, mmap is not support\n", __FUNCTION__, __LINE__); + return 0; +} + +static const struct file_operations_vfs fifo_fops = +{ + pipecommon_open, /* open */ + pipecommon_close, /* close */ + pipecommon_read, /* read */ + pipecommon_write, /* write */ + NULL, /* seek */ + NULL, /* ioctl */ + fifo_map, /* mmap */ + NULL, /* poll */ +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS + pipecommon_unlink, /* unlink */ +#endif +}; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mkfifo2 + * + * Description: + * mkfifo() makes a FIFO device driver file with name 'pathname.' Unlike + * Linux, a NuttX FIFO is not a special file type but simply a device + * driver instance. 'mode' specifies the FIFO's permissions. + * + * Once the FIFO has been created by mkfifo(), any thread can open it for + * reading or writing, in the same way as an ordinary file. However, it + * must have been opened from both reading and writing before input or + * output can be performed. This FIFO implementation will block all + * attempts to open a FIFO read-only until at least one thread has opened + * the FIFO for writing. + * + * If all threads that write to the FIFO have closed, subsequent calls to + * read() on the FIFO will return 0 (end-of-file). + * + * NOTE: mkfifo2 is a special, non-standard, NuttX-only interface. Since + * the NuttX FIFOs are based in in-memory, circular buffers, the ability + * to control the size of those buffers is critical for system tuning. + * + * Input Parameters: + * pathname - The full path to the FIFO instance to attach to or to create + * (if not already created). + * mode - Ignored for now + * bufsize - The size of the in-memory, circular buffer in bytes. + * + * Returned Value: + * 0 is returned on success; otherwise, -1 is returned with errno set + * appropriately. + * + ****************************************************************************/ + +int mkfifo(FAR const char *pathname, mode_t mode) +{ + FAR struct pipe_dev_s *dev; + int ret; + size_t bufsize = 1024; + + if (mode > 0777) + { + return -EINVAL; + } + + if (pathname == NULL) + { + return -EINVAL; + } + + if (strlen(pathname) > PATH_MAX) + { + return -EINVAL; + } + + /* Allocate and initialize a new device structure instance */ + + dev = pipecommon_allocdev(bufsize, pathname); + if (!dev) + { + return -ENOMEM; + } + + ret = register_driver(pathname, &fifo_fops, mode, (FAR void *)dev); + if (ret != 0) + { + pipecommon_freedev(dev); + } + + return ret; +} + +#endif /* CONFIG_DEV_FIFO_SIZE > 0 */ diff --git a/drivers/pipes/pipe.c b/drivers/pipes/pipe.c new file mode 100755 index 0000000..96ed3a2 --- /dev/null +++ b/drivers/pipes/pipe.c @@ -0,0 +1,343 @@ +/**************************************************************************** + * drivers/pipes/pipe.c + * + * Copyright (C) 2008-2009, 2015, 2018 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "pipe_common.h" +#include "stdio.h" +#if CONFIG_DEV_PIPE_SIZE > 0 + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define MAX_PIPES 32 + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static int pipe_close(FAR struct file *filep); +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS +static int pipe_unlink(FAR struct inode *priv); +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static ssize_t pipe_map(FAR struct file* filep, FAR LosVmMapRegion *region) +{ + PRINTK("%s %d, mmap is not support\n", __FUNCTION__, __LINE__); + return 0; +} + +static const struct file_operations_vfs pipe_fops = +{ + pipecommon_open, /* open */ + pipe_close, /* close */ + pipecommon_read, /* read */ + pipecommon_write, /* write */ + NULL, /* seek */ + NULL, /* ioctl */ + pipe_map, /* mmap */ + pipecommon_poll, /* poll */ +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS + pipe_unlink, /* unlink */ +#endif +}; + +static sem_t g_pipesem = {NULL}; +static uint32_t g_pipeset = 0; +static uint32_t g_pipecreated = 0; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: pipe_allocate + ****************************************************************************/ + +static inline int pipe_allocate(void) +{ + int pipeno; + int ret = -ENFILE; + + for (pipeno = 0; pipeno < MAX_PIPES; pipeno++) + { + if ((g_pipeset & (1 << pipeno)) == 0) + { + g_pipeset |= (1 << pipeno); + ret = pipeno; + break; + } + } + + return ret; +} + +/**************************************************************************** + * Name: pipe_free + ****************************************************************************/ + +static inline void pipe_free(int pipeno) +{ + int ret; + + ret = sem_wait(&g_pipesem); + if (ret == OK) + { + g_pipeset &= ~(1 << pipeno); + (void)sem_post(&g_pipesem); + } +} + +/**************************************************************************** + * Name: pipe_close + ****************************************************************************/ + +static int pipe_close(FAR struct file *filep) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct pipe_dev_s *dev = inode->i_private; + int ret; + + if (dev == NULL) + { + return -EINVAL; + } + + /* Perform common close operations */ + + ret = pipecommon_close(filep); + if (ret == 0 && inode->i_crefs == 1) + { + /* Release the pipe when there are no further open references to it. */ + + pipe_free(dev->d_pipeno); + } + + return ret; +} + +/**************************************************************************** + * Name: pipe_unlink + ****************************************************************************/ + +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS +static int pipe_unlink(FAR struct inode *priv) +{ + FAR struct pipe_dev_s *dev = priv->i_private; + uint8_t pipeno = 0; + int ret; + + if (dev != NULL) + { + pipeno = dev->d_pipeno; + } + /* Perform common close operations */ + ret = pipecommon_unlink(priv); + if (ret == 0 && priv->i_crefs == 1) + { + (void)sem_wait(&g_pipesem); + g_pipecreated &= ~(1 << pipeno); + (void)sem_post(&g_pipesem); + /* Release the pipe when there are no further open references to it. */ + pipe_free(pipeno); + } + return ret; +} +#endif + + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: pipe2 + * + * Description: + * pipe() creates a pair of file descriptors, pointing to a pipe inode, + * and places them in the array pointed to by 'fd'. fd[0] is for reading, + * fd[1] is for writing. + * + * NOTE: mkfifo2 is a special, non-standard, NuttX-only interface. Since + * the NuttX FIFOs are based in in-memory, circular buffers, the ability + * to control the size of those buffers is critical for system tuning. + * + * Input Parameters: + * fd[2] - The user provided array in which to catch the pipe file + * descriptors + * bufsize - The size of the in-memory, circular buffer in bytes. + * + * Returned Value: + * 0 is returned on success; otherwise, -1 is returned with errno set + * appropriately. + * + ****************************************************************************/ + +int pipe(int fd[2]) +{ + FAR struct pipe_dev_s *dev = NULL; + char devname[16]; + int pipeno; + int errcode; + int ret; + size_t bufsize = 1024; + + /* Get exclusive access to the pipe allocation data */ + + ret = sem_wait(&g_pipesem); + if (ret < 0) + { + errcode = -ret; + goto errout; + } + + /* Allocate a minor number for the pipe device */ + + pipeno = pipe_allocate(); + if (pipeno < 0) + { + (void)sem_post(&g_pipesem); + errcode = -pipeno; + goto errout; + } + + /* Create a pathname to the pipe device */ + + snprintf_s(devname, sizeof(devname), sizeof(devname) - 1, "/dev/pipe%d", pipeno); + + /* Check if the pipe device has already been created */ + + if ((g_pipecreated & (1 << pipeno)) == 0) + { + /* No.. Allocate and initialize a new device structure instance */ + + dev = pipecommon_allocdev(bufsize, devname); + if (!dev) + { + (void)sem_post(&g_pipesem); + errcode = ENOMEM; + goto errout_with_pipe; + } + + dev->d_pipeno = pipeno; + + /* Register the pipe device */ + + ret = register_driver(devname, &pipe_fops, 0660, (FAR void *)dev); + if (ret != 0) + { + (void)sem_post(&g_pipesem); + errcode = -ret; + goto errout_with_dev; + } + + /* Remember that we created this device */ + + g_pipecreated |= (1 << pipeno); + } + + (void)sem_post(&g_pipesem); + + /* Get a write file descriptor */ + + fd[1] = open(devname, O_WRONLY); + if (fd[1] < 0) + { + errcode = -fd[1]; + goto errout_with_driver; + } + + /* Get a read file descriptor */ + + fd[0] = open(devname, O_RDONLY); + if (fd[0] < 0) + { + errcode = -fd[0]; + goto errout_with_wrfd; + } + + return OK; + +errout_with_wrfd: + close(fd[1]); + +errout_with_driver: + unregister_driver(devname); + +errout_with_dev: + if (dev) + { + pipecommon_freedev(dev); + } + +errout_with_pipe: + pipe_free(pipeno); + +errout: + set_errno(errcode); + return VFS_ERROR; +} + +int pipe_init() +{ + int ret = sem_init(&g_pipesem, 0, 1); + if (ret != 0) { + dprintf(" pipe_init failed!\n"); + } + return ret; +} + +#endif /* CONFIG_DEV_PIPE_SIZE > 0 */ diff --git a/drivers/pipes/pipe_common.c b/drivers/pipes/pipe_common.c new file mode 100755 index 0000000..e7ade69 --- /dev/null +++ b/drivers/pipes/pipe_common.c @@ -0,0 +1,816 @@ +/**************************************************************************** + * drivers/pipes/pipe_common.c + * + * Copyright (C) 2008-2009, 2011, 2015-2016, 2018 Gregory Nutt. All + * rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "linux/wait.h" +#include "fs/fs.h" +#include "fs_poll_pri.h" +#include + +#ifdef CONFIG_DEBUG_FEATURES +# include +#endif +#include +#include +#include "pipe_common.h" +#include "los_printf.h" +#include "user_copy.h" +#ifdef LOSCFG_KERNEL_PIPE + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* CONFIG_DEV_PIPEDUMP will dump the contents of each transfer into and out + * of the pipe. + */ + +#ifdef CONFIG_DEV_PIPEDUMP +# define pipe_dumpbuffer(m,a,n) lib_dumpbuffer(m,a,n) +#else +# define pipe_dumpbuffer(m,a,n) +#endif + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static void pipecommon_semtake(sem_t *sem); + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: pipecommon_semtake + ****************************************************************************/ + +static void pipecommon_semtake(FAR sem_t *sem) +{ + int ret; + + do + { + /* Take the semaphore (perhaps waiting) */ + + ret = sem_wait(sem); + + } + while (ret == -EINTR); +} + +/**************************************************************************** + * Name: pipecommon_pollnotify + ****************************************************************************/ + +static void pipecommon_pollnotify(FAR struct pipe_dev_s *dev, + pollevent_t eventset) +{ + if (eventset & POLLERR) + { + eventset &= ~(POLLOUT | POLLIN); + } + + notify_poll_with_key(&dev->wq, eventset); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: pipecommon_allocdev + ****************************************************************************/ + +FAR struct pipe_dev_s *pipecommon_allocdev(size_t bufsize, const char *name) +{ + FAR struct pipe_dev_s *dev; + int ret; + + if (bufsize > CONFIG_DEV_PIPE_MAXSIZE) + { + return NULL; + } + + /* Allocate a private structure to manage the pipe */ + + dev = (FAR struct pipe_dev_s *)malloc(sizeof(struct pipe_dev_s)); + if (dev) + { + /* Initialize the private structure */ + + (void)memset_s(dev, sizeof(struct pipe_dev_s), 0, sizeof(struct pipe_dev_s)); + ret = strcpy_s(dev->name, sizeof(dev->name), name); + if (ret < 0) + { + free(dev); + return NULL; + } + sem_init(&dev->d_bfsem, 0, 1); + sem_init(&dev->d_rdsem, 0, 0); + sem_init(&dev->d_wrsem, 0, 0); + LOS_ListInit(&dev->wq.poll_queue); + /* The read/write wait semaphores are used for signaling and, hence, + * should not have priority inheritance enabled. + */ + + dev->d_bufsize = bufsize; + } + + return dev; +} + +/**************************************************************************** + * Name: pipecommon_freedev + ****************************************************************************/ + +void pipecommon_freedev(FAR struct pipe_dev_s *dev) +{ + sem_destroy(&dev->d_bfsem); + sem_destroy(&dev->d_rdsem); + sem_destroy(&dev->d_wrsem); + free(dev); +} + +/**************************************************************************** + * Name: pipecommon_open + ****************************************************************************/ + +int pipecommon_open(FAR struct file *filep) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct pipe_dev_s *dev = inode->i_private; + int sval; + int ret; + + if (dev == NULL) + { + return -EINVAL; + } + + /* Make sure that we have exclusive access to the device structure. The + * sem_wait() call should fail only if we are awakened by a signal. + */ + + ret = sem_wait(&dev->d_bfsem); + if (ret < 0) + { + PRINT_ERR("ERROR: sem_wait failed: %d\n", ret); + return ret; + } + + /* If this the first reference on the device, then allocate the buffer. + * In the case of policy 1, the buffer already be present when the pipe + * is first opened. + */ + + if (inode->i_crefs == 1 && dev->d_buffer == NULL) + { + dev->d_buffer = (FAR uint8_t *)malloc(dev->d_bufsize); + if (!dev->d_buffer) + { + (void)sem_post(&dev->d_bfsem); + return -ENOMEM; + } + } + + + /* If opened for writing, increment the count of writers on the pipe instance */ + + if ((filep->f_oflags & O_WRONLY) != 0) + { + dev->d_nwriters++; + + /* If this this is the first writer, then the read semaphore indicates the + * number of readers waiting for the first writer. Wake them all up. + */ + + if (dev->d_nwriters == 1) + { + while (sem_getvalue(&dev->d_rdsem, &sval) == 0 && sval == 0) + { + sem_post(&dev->d_rdsem); + } + } + } + + /* If opened for reading, increment the count of reader on on the pipe instance */ + + if ((filep->f_oflags & O_WRONLY) == 0) + { + dev->d_nreaders++; + } + + /* If opened for read-only, then wait for either (1) at least one writer + * on the pipe (policy == 0), or (2) until there is buffered data to be + * read (policy == 1). + */ + + (void)sem_post(&dev->d_bfsem); + + if ((filep->f_oflags & O_WRONLY) == 0 && /* Read-only */ + dev->d_nwriters < 1 && /* No writers on the pipe */ + dev->d_wrndx == dev->d_rdndx) /* Buffer is empty */ + { + /* NOTE: d_rdsem is normally used when the read logic waits for more + * data to be written. But until the first writer has opened the + * pipe, the meaning is different: it is used prevent O_RDONLY open + * calls from returning until there is at least one writer on the pipe. + * This is required both by spec and also because it prevents + * subsequent read() calls from returning end-of-file because there is + * no writer on the pipe. + */ + + ret = sem_wait(&dev->d_rdsem); + if (ret < 0) + { + /* The sem_wait() call should fail only if we are awakened by + * a signal. + */ + + PRINT_ERR("ERROR: sem_wait failed: %d\n", ret); + + /* Immediately close the pipe that we just opened */ + + (void)pipecommon_close(filep); + } + } + + return ret; +} + +/**************************************************************************** + * Name: pipecommon_close + ****************************************************************************/ + +int pipecommon_close(FAR struct file *filep) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct pipe_dev_s *dev = inode->i_private; + int sval; + + if (dev == NULL || filep->f_inode->i_crefs <= 0) + { + return -EINVAL; + } + + /* Make sure that we have exclusive access to the device structure. + * NOTE: close() is supposed to return EINTR if interrupted, however + * I've never seen anyone check that. + */ + + pipecommon_semtake(&dev->d_bfsem); + + /* Decrement the number of references on the pipe. Check if there are + * still outstanding references to the pipe. + */ + + /* Check if the decremented inode reference count would go to zero */ + + if (inode->i_crefs > 1) + { + /* More references.. If opened for writing, decrement the count of + * writers on the pipe instance. + */ + + if ((filep->f_oflags & O_WRONLY) != 0) + { + /* If there are no longer any writers on the pipe, then notify all of the + * waiting readers that they must return end-of-file. + */ + + if (--dev->d_nwriters <= 0) + { + while (sem_getvalue(&dev->d_rdsem, &sval) == 0 && sval == 0) + { + sem_post(&dev->d_rdsem); + } + + /* Inform poll readers that other end closed. */ + + pipecommon_pollnotify(dev, POLLHUP); + } + } + + /* If opened for reading, decrement the count of readers on the pipe + * instance. + */ + + if ((filep->f_oflags & O_WRONLY) == 0) + { + if (--dev->d_nreaders <= 0) + { + if (PIPE_IS_POLICY_0(dev->d_flags)) + { + /* Inform poll writers that other end closed. */ + + pipecommon_pollnotify(dev, POLLERR); + } + } + } + } + + /* What is the buffer management policy? Do we free the buffer when the + * last client closes the pipe policy 0, or when the buffer becomes empty. + * In the latter case, the buffer data will remain valid and can be + * obtained when the pipe is re-opened. + */ + + else if (PIPE_IS_POLICY_0(dev->d_flags) || dev->d_wrndx == dev->d_rdndx) + { + /* Policy 0 or the buffer is empty ... deallocate the buffer now. */ + + free(dev->d_buffer); + dev->d_buffer = NULL; + + /* And reset all counts and indices */ + + dev->d_wrndx = 0; + dev->d_rdndx = 0; + dev->d_nwriters = 0; + dev->d_nreaders = 0; + } + + sem_post(&dev->d_bfsem); + return OK; +} + +/**************************************************************************** + * Name: pipecommon_read + ****************************************************************************/ + +ssize_t pipecommon_read(FAR struct file *filep, FAR char *buffer, size_t len) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct pipe_dev_s *dev = inode->i_private; + ssize_t nread = 0; + int sval; + int ret; + + if (dev == NULL) + { + return -EINVAL; + } + + if (len == 0) + { + return 0; + } + + if (len > MAX_READ_WRITE_LEN) + { + return -EINVAL; + } + + /* Make sure that we have exclusive access to the device structure */ + + ret = sem_wait(&dev->d_bfsem); + if (ret < 0) + { + return ret; + } + + /* If the pipe is empty, then wait for something to be written to it */ + + while (dev->d_wrndx == dev->d_rdndx) + { + /* If O_NONBLOCK was set, then return EGAIN */ + + if (filep->f_oflags & O_NONBLOCK) + { + sem_post(&dev->d_bfsem); + return -EAGAIN; + } + + /* If there are no writers on the pipe, then return end of file */ + + if (dev->d_nwriters <= 0) + { + sem_post(&dev->d_bfsem); + return 0; + } + + /* Otherwise, wait for something to be written to the pipe */ + + sem_post(&dev->d_bfsem); + ret = sem_wait(&dev->d_rdsem); + + if (ret < 0 || (ret = sem_wait(&dev->d_bfsem)) < 0) + { + return ret; + } + } + + /* Then return whatever is available in the pipe (which is at least one byte) */ + + nread = 0; + for (; ; ) + { + while ((size_t)nread < len && dev->d_wrndx != dev->d_rdndx) + { + ret = LOS_ArchCopyToUser(buffer, dev->d_buffer + dev->d_rdndx, sizeof(char)); + if (ret != 0) + { + sem_post(&dev->d_bfsem); + return -EFAULT; + } + buffer++; + if (++dev->d_rdndx >= dev->d_bufsize) + { + dev->d_rdndx = 0; + } + + nread++; + } + + /* If O_NONBLOCK was set, then break */ + + if (filep->f_oflags & O_NONBLOCK) + { + break; + } + + /* Is the read complete? */ + + if ((size_t)nread >= len) + { + break; + } + + /* wait for something to be written to the pipe */ + + sem_post(&dev->d_wrsem); + pipecommon_pollnotify(dev, POLLOUT); + sem_post(&dev->d_bfsem); + + ret = sem_wait(&dev->d_rdsem); + if (ret < 0) + { + return ret; + } + + ret = sem_wait(&dev->d_bfsem); + if (ret < 0) + { + return ret; + } + + /* If there are no writers on the pipe, then return end of file */ + + if (dev->d_nwriters <= 0) + { + sem_post(&dev->d_wrsem); + pipecommon_pollnotify(dev, POLLOUT); + sem_post(&dev->d_bfsem); + return nread; + } + } + + /* Notify all waiting writers that bytes have been removed from the buffer */ + + while (sem_getvalue(&dev->d_wrsem, &sval) == 0 && sval == 0) + { + sem_post(&dev->d_wrsem); + } + + /* Notify all poll/select waiters that they can write to the FIFO */ + + pipecommon_pollnotify(dev, POLLOUT); + sem_post(&dev->d_bfsem); + return nread; +} + +/**************************************************************************** + * Name: pipecommon_write + ****************************************************************************/ + +ssize_t pipecommon_write(FAR struct file *filep, FAR const char *buffer, + size_t len) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct pipe_dev_s *dev = inode->i_private; + ssize_t nwritten = 0; + ssize_t last; + int nxtwrndx; + int sval; + int ret; + + + if (dev == NULL) + { + return -EINVAL; + } + + /* Handle zero-length writes */ + + if (len == 0) + { + return 0; + } + + if (len > MAX_READ_WRITE_LEN) + { + return -EINVAL; + } + + /* REVISIT: "If all file descriptors referring to the read end of a pipe + * have been closed, then a write will cause a SIGPIPE signal to be + * generated for the calling process. If the calling process is ignoring + * this signal, then write(2) fails with the error EPIPE." + */ + + if (dev->d_nreaders <= 0) + { + return -EPIPE; + } + + /* At present, this method cannot be called from interrupt handlers. That + * is because it calls sem_wait (via pipecommon_semtake below) and + * sem_wait cannot be called from interrupt level. This actually + * happens fairly commonly IF [a-z]err() is called from interrupt handlers + * and stdout is being redirected via a pipe. In that case, the debug + * output will try to go out the pipe (interrupt handlers should use the + * _err() APIs). + * + * On the other hand, it would be very valuable to be able to feed the pipe + * from an interrupt handler! TODO: Consider disabling interrupts instead + * of taking semaphores so that pipes can be written from interrupt handlers + */ + + /* Make sure that we have exclusive access to the device structure */ + + ret = sem_wait(&dev->d_bfsem); + if (ret < 0) + { + return ret; + } + + /* Loop until all of the bytes have been written */ + + last = 0; + for (; ; ) + { + /* Calculate the write index AFTER the next byte is written */ + + nxtwrndx = dev->d_wrndx + 1; + if (nxtwrndx >= dev->d_bufsize) + { + nxtwrndx = 0; + } + + /* Would the next write overflow the circular buffer? */ + + if (nxtwrndx != dev->d_rdndx) + { + /* No... copy the byte */ + + + ret = LOS_ArchCopyFromUser(dev->d_buffer + dev->d_wrndx, buffer, sizeof(char)); + if (ret != 0) + { + sem_post(&dev->d_bfsem); + return -EFAULT; + } + buffer++; + dev->d_wrndx = nxtwrndx; + + /* Is the write complete? */ + + nwritten++; + if ((size_t)nwritten >= len) + { + /* Yes.. Notify all of the waiting readers that more data is available */ + while (sem_getvalue(&dev->d_rdsem, &sval) == 0 && sval == 0) + { + sem_post(&dev->d_rdsem); + } + + /* Notify all poll/select waiters that they can read from the FIFO */ + + pipecommon_pollnotify(dev, POLLIN); + + /* Return the number of bytes written */ + + sem_post(&dev->d_bfsem); + return len; + } + } + else + { + /* There is not enough room for the next byte. Was anything written in this pass? */ + + if (last < nwritten) + { + /* Yes.. Notify all of the waiting readers that more data is available */ + + while (sem_getvalue(&dev->d_rdsem, &sval) == 0 && sval == 0) + { + sem_post(&dev->d_rdsem); + } + + /* Notify all poll/select waiters that they can read from the FIFO */ + + pipecommon_pollnotify(dev, POLLIN); + } + + last = nwritten; + + /* If O_NONBLOCK was set, then return partial bytes written or EGAIN */ + + if (filep->f_oflags & O_NONBLOCK) + { + if (nwritten == 0) + { + nwritten = -EAGAIN; + } + + sem_post(&dev->d_bfsem); + return nwritten; + } + + /* There is more to be written.. wait for data to be removed from the pipe */ + + sem_post(&dev->d_bfsem); + pipecommon_semtake(&dev->d_wrsem); + pipecommon_semtake(&dev->d_bfsem); + } + } +} + +/**************************************************************************** + * Name: pipecommon_poll + ****************************************************************************/ + +int pipecommon_poll(FAR struct file *filep, poll_table *table) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct pipe_dev_s *dev = inode->i_private; + pollevent_t eventset; + pipe_ndx_t nbytes; + int ret = OK; + + if (dev == NULL || table == NULL) + { + return -EINVAL; + } + + /* Are we setting up the poll? Or tearing it down? */ + + pipecommon_semtake(&dev->d_bfsem); + + /* Should immediately notify on any of the requested events? + * First, determine how many bytes are in the buffer + */ + + if (dev->d_wrndx >= dev->d_rdndx) + { + nbytes = dev->d_wrndx - dev->d_rdndx; + } + else + { + nbytes = dev->d_bufsize + dev->d_wrndx - dev->d_rdndx; + } + + /* Notify the POLLOUT event if the pipe is not full, but only if + * there is readers. + */ + + eventset = 0; + if (((filep->f_oflags & O_WRONLY) != 0) && (nbytes < (dev->d_bufsize - 1))) + { + eventset |= POLLOUT; + } + + /* Notify the POLLIN event if the pipe is not empty */ + + if (((filep->f_oflags & O_WRONLY) == 0) && (nbytes > 0)) + { + eventset |= POLLIN; + } + + /* Notify the POLLHUP event if the pipe is empty and no writers */ + + if (nbytes == 0 && dev->d_nwriters <= 0) + { + eventset |= POLLHUP; + } + + /* Change POLLOUT to POLLERR, if no readers and policy 0. */ + + if ((eventset | POLLOUT) && + PIPE_IS_POLICY_0(dev->d_flags) && + dev->d_nreaders <= 0) + { + eventset |= POLLERR; + } + + ret = eventset & table->key; + if (ret == 0) + { + poll_wait(NULL, &dev->wq, table); + } + sem_post(&dev->d_bfsem); + + return ret; +} + +/**************************************************************************** + * Name: pipecommon_ioctl + ****************************************************************************/ + +int pipecommon_ioctl(FAR struct file *filep, int cmd, unsigned long arg) +{ + return -ENOSYS; +} + +/**************************************************************************** + * Name: pipecommon_unlink + ****************************************************************************/ + +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS +int pipecommon_unlink(FAR struct inode *inode) +{ + FAR struct pipe_dev_s *dev; + + if (inode == NULL || inode->i_private == NULL) + { + return -EINVAL; + } + + dev = (FAR struct pipe_dev_s *)inode->i_private; + + /* Are the any open references to the driver? */ + + if (inode->i_crefs == 1) + { + /* No.. free the buffer (if there is one) */ + + if (dev->d_buffer) + { + free(dev->d_buffer); + } + + /* And free the device structure. */ + unregister_driver(dev->name); + pipecommon_freedev(dev); + } + else + { + PRINTK("Device busy!\n"); + return -EBUSY; + } + + return OK; +} +#endif + +#endif /* LOSCFG_KERNEL_PIPE */ diff --git a/drivers/pipes/pipe_common.h b/drivers/pipes/pipe_common.h new file mode 100755 index 0000000..3574103 --- /dev/null +++ b/drivers/pipes/pipe_common.h @@ -0,0 +1,173 @@ +/**************************************************************************** + * drivers/pipe/pipe_common.h + * + * Copyright (C) 2008-2009, 2015-2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __DRIVERS_PIPES_PIPE_COMMON_H +#define __DRIVERS_PIPES_PIPE_COMMON_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Pipe/FIFO support */ + +/* Pipe/FIFO size */ + +#ifndef MAX_READ_WRITE_LEN +# define MAX_READ_WRITE_LEN 0x1000000 +#endif + +#ifndef CONFIG_DEV_PIPE_MAXSIZE +# define CONFIG_DEV_PIPE_MAXSIZE 1024 +#endif + +#if CONFIG_DEV_PIPE_MAXSIZE <= 0 +# undef CONFIG_PIPES +# undef CONFIG_DEV_PIPE_SIZE +# undef CONFIG_DEV_FIFO_SIZE +# define CONFIG_DEV_PIPE_SIZE 0 +# define CONFIG_DEV_FIFO_SIZE 0 +#endif + +#ifndef CONFIG_DEV_PIPE_SIZE +# define CONFIG_DEV_PIPE_SIZE 1024 +#endif + +#ifndef CONFIG_DEV_FIFO_SIZE +# define CONFIG_DEV_FIFO_SIZE 1024 +#endif + +/* Maximum number of threads than can be waiting for POLL events */ + +#ifndef CONFIG_DEV_PIPE_NPOLLWAITERS +# define CONFIG_DEV_PIPE_NPOLLWAITERS 2 +#endif + +/* Maximum number of open's supported on pipe */ + +#define CONFIG_DEV_PIPE_MAXUSER 255 + +/* d_flags values */ + +#define PIPE_FLAG_POLICY (1 << 0) /* Bit 0: Policy=Free buffer when empty */ +#define PIPE_FLAG_UNLINKED (1 << 1) /* Bit 1: The driver has been unlinked */ + +#define PIPE_POLICY_0(f) do { (f) &= ~PIPE_FLAG_POLICY; } while (0) +#define PIPE_POLICY_1(f) do { (f) |= PIPE_FLAG_POLICY; } while (0) +#define PIPE_IS_POLICY_0(f) (((f) & PIPE_FLAG_POLICY) == 0) +#define PIPE_IS_POLICY_1(f) (((f) & PIPE_FLAG_POLICY) != 0) + +#define PIPE_UNLINK(f) do { (f) |= PIPE_FLAG_UNLINKED; } while (0) +#define PIPE_IS_UNLINKED(f) (((f) & PIPE_FLAG_UNLINKED) != 0) + + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* Make the buffer index as small as possible for the configured pipe size */ + +#if CONFIG_DEV_PIPE_MAXSIZE > 65535 +typedef uint32_t pipe_ndx_t; /* 32-bit index */ +#elif CONFIG_DEV_PIPE_MAXSIZE > 255 +typedef uint16_t pipe_ndx_t; /* 16-bit index */ +#else +typedef uint8_t pipe_ndx_t; /* 8-bit index */ +#endif + +/* This structure represents the state of one pipe. A reference to this + * structure is retained in the i_private field of the inode whenthe pipe/fifo + * device is registered. + */ + +struct pipe_dev_s +{ + char name[PATH_MAX + 1]; + sem_t d_bfsem; /* Used to serialize access to d_buffer and indices */ + sem_t d_rdsem; /* Empty buffer - Reader waits for data write */ + sem_t d_wrsem; /* Full buffer - Writer waits for data read */ + pipe_ndx_t d_wrndx; /* Index in d_buffer to save next byte written */ + pipe_ndx_t d_rdndx; /* Index in d_buffer to return the next byte read */ + pipe_ndx_t d_bufsize; /* allocated size of d_buffer in bytes */ + uint8_t d_nwriters; /* Number of reference counts for write access */ + uint8_t d_nreaders; /* Number of reference counts for read access */ + uint8_t d_pipeno; /* Pipe minor number */ + uint8_t d_flags; /* See PIPE_FLAG_* definitions */ + uint8_t *d_buffer; /* Buffer allocated when device opened */ + wait_queue_head_t wq; /* It is a list if poll structures of threads waiting for driver events */ +}; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +# define EXTERN extern "C" +extern "C" +{ +#else +# define EXTERN extern +#endif + +struct file; /* Forward reference */ +struct inode; /* Forward reference */ + +FAR struct pipe_dev_s *pipecommon_allocdev(size_t bufsize, const char *name); +void pipecommon_freedev(FAR struct pipe_dev_s *dev); +int pipecommon_open(FAR struct file *filep); +int pipecommon_close(FAR struct file *filep); +ssize_t pipecommon_read(FAR struct file *, FAR char *, size_t); +ssize_t pipecommon_write(FAR struct file *, FAR const char *, size_t); +int pipecommon_ioctl(FAR struct file *filep, int cmd, unsigned long arg); +int pipecommon_poll(FAR struct file *filep, poll_table *fds); +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS +int pipecommon_unlink(FAR struct inode *priv); +#endif +int pipe_init(void); + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __DRIVERS_PIPES_PIPE_COMMON_H */ diff --git a/drivers/video/fb.c b/drivers/video/fb.c new file mode 100755 index 0000000..86eb106 --- /dev/null +++ b/drivers/video/fb.c @@ -0,0 +1,871 @@ +/**************************************************************************** + * graphics/fb/fb.c + * Framebuffer character driver + * + * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "stdio.h" +#include "stdlib.h" +#include "string.h" +#include "fb.h" +#include "fs/fs.h" +#include "assert.h" +#include "errno.h" +#include "user_copy.h" + +#define gerr PRINT_ERR + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/* This structure defines one framebuffer device. Note that which is + * everything in this structure is constant data set up and initialization + * time. Therefore, no there is requirement for serialized access to this + * structure. + */ + +struct fb_chardev_s +{ + FAR struct fb_vtable_s *vtable; /* Framebuffer interface */ + FAR void *fbmem; /* Start of frame buffer memory */ + size_t fblen; /* Size of the framebuffer */ + uint8_t plane; /* Video plan number */ + uint8_t bpp; /* Bits per pixel */ +}; + +#define FB_DEV_MAXNUM 32 +static struct fb_chardev_s *g_fb_dev[FB_DEV_MAXNUM] = {NULL}; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static int fb_open(FAR struct file *filep); +static int fb_close(FAR struct file *filep); +static ssize_t fb_read(FAR struct file *filep, FAR char *buffer, + size_t buflen); +static ssize_t fb_write(FAR struct file *filep, FAR const char *buffer, + size_t buflen); +static off_t fb_seek(FAR struct file *filep, off_t offset, int whence); +static int fb_ioctl(FAR struct file *filep, int cmd, unsigned long arg); +static ssize_t fb_mmap(FAR struct file* filep, FAR LosVmMapRegion *region); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static const struct file_operations_vfs fb_fops = +{ + fb_open, /* open */ + fb_close, /* close */ + fb_read, /* read */ + fb_write, /* write */ + fb_seek, /* seek */ + fb_ioctl, /* ioctl */ + fb_mmap, /* mmap */ +#ifndef CONFIG_DISABLE_POLL + NULL, /* poll */ +#endif +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS + NULL, /* unlink */ +#endif +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static ssize_t fb_mmap(FAR struct file *filep, FAR LosVmMapRegion *region) +{ + int ret = -EINVAL; + struct fb_chardev_s *fb; + struct fb_vtable_s *vtable; + + fb = (struct fb_chardev_s *)filep->f_inode->i_private; + if (fb == NULL) + { + return -ENODEV; + } + + vtable = fb->vtable; + if (vtable == NULL) + { + return -EINVAL; + } + + if (vtable->fb_mmap != NULL) + { + ret = vtable->fb_mmap(vtable, region); + } + + return ret; +} + +/**************************************************************************** + * Name: fb_open + * + * Description: + * This function is called whenever the framebuffer device is opened. + * + ****************************************************************************/ + +static int fb_open(FAR struct file *filep) +{ + DEBUGASSERT(filep != NULL && filep->f_inode != NULL); + struct fb_chardev_s *fb; + struct fb_vtable_s *vtable; + int ret = -EINVAL; + + fb = (struct fb_chardev_s *)filep->f_inode->i_private; + if (fb == NULL) + { + return -ENODEV; + } + + vtable = fb->vtable; + if (vtable == NULL) + { + return -EINVAL; + } + + if (vtable->fb_open) + { + ret = vtable->fb_open(vtable); + } + + return ret; +} + +/**************************************************************************** + * Name: fb_close + * + * Description: + * This function is called when the framebuffer device is closed. + * + ****************************************************************************/ + +static int fb_close(FAR struct file *filep) +{ + DEBUGASSERT(filep != NULL && filep->f_inode != NULL); + struct fb_chardev_s *fb; + struct fb_vtable_s *vtable; + int ret = -EINVAL; + + fb = (struct fb_chardev_s *)filep->f_inode->i_private; + if (fb == NULL) + { + return -ENODEV; + } + + vtable = fb->vtable; + if (vtable == NULL) + { + return -EINVAL; + } + + if (vtable->fb_release) + { + ret = vtable->fb_release(vtable); + } + + return ret; +} + +/**************************************************************************** + * Name: fb_read + ****************************************************************************/ + +static ssize_t fb_read(FAR struct file *filep, FAR char *buffer, size_t len) +{ + FAR struct inode *inode; + FAR struct fb_chardev_s *fb; + size_t start; + size_t end; + size_t size; + int ret; + + /* Get the framebuffer instance */ + + DEBUGASSERT(filep != NULL && filep->f_inode != NULL); + inode = filep->f_inode; + fb = (FAR struct fb_chardev_s *)inode->i_private; + + /* Get the start and size of the transfer */ + + start = filep->f_pos; + if (start >= fb->fblen) + { + return 0; /* Return end-of-file */ + } + + end = start + len; + if (end >= fb->fblen) + { + end = fb->fblen; + } + + size = end - start; + + /* And transfer the data from the frame buffer */ + + ret = LOS_ArchCopyToUser(buffer, fb->fbmem, size); + if (ret) + { + return -EFAULT; + } + filep->f_pos += size; + return size; +} + +/**************************************************************************** + * Name: fb_write + ****************************************************************************/ + +static ssize_t fb_write(FAR struct file *filep, FAR const char *buffer, + size_t len) +{ + FAR struct inode *inode; + FAR struct fb_chardev_s *fb; + size_t start; + size_t end; + size_t size; + int ret; + + /* Get the framebuffer instance */ + + DEBUGASSERT(filep != NULL && filep->f_inode != NULL); + inode = filep->f_inode; + fb = (FAR struct fb_chardev_s *)inode->i_private; + + /* Get the start and size of the transfer */ + + start = filep->f_pos; + if (start >= fb->fblen) + { + return -EFBIG; /* Cannot extend the framebuffer */ + } + + end = start + len; + if (end >= fb->fblen) + { + end = fb->fblen; + } + + size = end - start; + + /* And transfer the data into the frame buffer */ + + ret = LOS_ArchCopyFromUser(fb->fbmem, buffer, size); + if (ret) + { + return -EFAULT; + } + filep->f_pos += size; + return size; +} + +/**************************************************************************** + * Name: fb_seek + * + * Description: + * Seek the logical file pointer to the specified position. The offset + * is in units of pixels, with offset zero being the beginning of the + * framebuffer. + * + ****************************************************************************/ + +static off_t fb_seek(FAR struct file *filep, off_t offset, int whence) +{ + FAR struct inode *inode; + FAR struct fb_chardev_s *fb; + off_t newpos; + int ret; + + /* Get the framebuffer instance */ + + DEBUGASSERT(filep != NULL && filep->f_inode != NULL); + inode = filep->f_inode; + fb = (FAR struct fb_chardev_s *)inode->i_private; + + /* Determine the new, requested file position */ + + switch (whence) + { + case SEEK_CUR: + newpos = filep->f_pos + offset; + break; + + case SEEK_SET: + newpos = offset; + break; + + case SEEK_END: + newpos = fb->fblen + offset; + break; + + default: + /* Return EINVAL if the whence argument is invalid */ + + return -EINVAL; + } + + /* Opengroup.org: + * + * "The lseek() function shall allow the file offset to be set beyond the end + * of the existing data in the file. If data is later written at this point, + * subsequent reads of data in the gap shall return bytes with the value 0 + * until data is actually written into the gap." + * + * We can conform to the first part, but not the second. But return EINVAL if + * + * "...the resulting file offset would be negative for a regular file, block + * special file, or directory." + */ + + if (newpos >= 0) + { + filep->f_pos = newpos; + ret = newpos; + } + else + { + ret = -EINVAL; + } + + return ret; +} + +/**************************************************************************** + * Name: fb_ioctl + * + * Description: + * The standard ioctl method. + * + ****************************************************************************/ + +static int fb_ioctl(FAR struct file *filep, int cmd, unsigned long arg) +{ + FAR struct inode *inode; + FAR struct fb_chardev_s *fb; + int ret; + + /* Get the framebuffer instance */ + + DEBUGASSERT(filep != NULL && filep->f_inode != NULL); + inode = filep->f_inode; + fb = (FAR struct fb_chardev_s *)inode->i_private; + + /* Process the IOCTL command */ + + switch (cmd) + { + case FIOC_MMAP: /* Get color plane info */ + { + FAR void **ppv = (FAR void **)((uintptr_t)arg); + uintptr_t fbmem = (uintptr_t)fb->fbmem; + + /* Return the address corresponding to the start of frame buffer. */ + + ret = LOS_ArchCopyToUser(ppv, &fbmem, sizeof(uintptr_t)); + if (ret) + { + ret = -EFAULT; + } + } + break; + + case FBIOGET_VIDEOINFO: /* Get color plane info */ + { + struct fb_videoinfo_s vinfo; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->getvideoinfo != NULL); + ret = fb->vtable->getvideoinfo(fb->vtable, &vinfo); + if (ret == ENOERR) + { + ret = LOS_ArchCopyToUser((void *)arg, &vinfo, sizeof(struct fb_videoinfo_s)); + if (ret) + { + ret = -EFAULT; + } + } + } + break; + + case FBIOGET_PLANEINFO: /* Get video plane info */ + { + struct fb_planeinfo_s pinfo; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->getplaneinfo != NULL); + ret = fb->vtable->getplaneinfo(fb->vtable, fb->plane, &pinfo); + if (ret == ENOERR) + { + ret = LOS_ArchCopyToUser((void *)arg, &pinfo, sizeof(struct fb_planeinfo_s)); + if (ret) + { + ret = -EFAULT; + } + } + } + break; + +#ifdef CONFIG_FB_CMAP + case FBIOGET_CMAP: /* Get RGB color mapping */ + { + struct fb_cmap_s cmap; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->getcmap != NULL); + ret = fb->vtable->getcmap(fb->vtable, &cmap); + if (ret == ENOERR) + { + ret = LOS_ArchCopyToUser((void *)arg, &cmap, sizeof(struct fb_cmap_s)); + if (ret) + { + ret = -EFAULT; + } + } + } + break; + + case FBIOPUT_CMAP: /* Put RGB color mapping */ + { + struct fb_cmap_s cmap; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->putcmap != NULL); + ret = LOS_ArchCopyFromUser(&cmap, (const void *)arg, sizeof(struct fb_cmap_s)); + if (ret) + { + ret = -EFAULT; + break; + } + ret = fb->vtable->putcmap(fb->vtable, &cmap); + } + break; +#endif +#ifdef CONFIG_FB_HWCURSOR + case FBIOGET_CURSOR: /* Get cursor attributes */ + { + struct fb_cursorattrib_s attrib; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->getcursor != NULL); + ret = fb->vtable->getcursor(fb->vtable, &attrib); + if (ret == ENOERR) + { + ret = LOS_ArchCopyToUser((void *)arg, &attrib, sizeof(struct fb_cursorattrib_s)); + if (ret) + { + ret = -EFAULT; + } + } + } + break; + + case FBIOPUT_CURSOR: /* Set cursor attibutes */ + { + struct fb_setcursor_s cursor; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->setcursor != NULL); + ret = LOS_ArchCopyFromUser(&cursor, (const void *)arg, sizeof(struct fb_setcursor_s)); + if (ret) + { + ret = -EFAULT; + break; + } + ret = fb->vtable->setcursor(fb->vtable, &cursor); + } + break; +#endif + +#ifdef CONFIG_LCD_UPDATE + case FBIO_UPDATE: /* Update the LCD with the modified framebuffer data */ + { + struct nxgl_rect_s rect; + struct fb_planeinfo_s pinfo; + + DEBUGASSERT(fb->vtable != NULL && fb->vtable->getplaneinfo != NULL); + ret = LOS_ArchCopyFromUser(&rect, (const void *)arg, sizeof(struct nxgl_rect_s)); + if (ret) + { + ret = -EFAULT; + break; + } + ret = fb->vtable->getplaneinfo(fb->vtable, fb->plane, &pinfo); + if (ret >= 0) + { + nx_notify_rectangle((FAR NX_PLANEINFOTYPE *)&pinfo, &rect); + } + } + break; +#endif + +#ifdef CONFIG_FB_SYNC + case FBIO_WAITFORVSYNC: /* Wait upon vertical sync */ + { + ret = fb->vtable->waitforvsync(fb->vtable); + } + break; +#endif + +#ifdef CONFIG_FB_OVERLAY + case FBIO_SELECT_OVERLAY: /* Select video overlay */ + { + struct fb_overlayinfo_s oinfo; + + DEBUGASSERT(fb->vtable != NULL && fb->vtable->getoverlayinfo != NULL); + ret = fb->vtable->getoverlayinfo(fb->vtable, arg, &oinfo); + if (ret == OK) + { + fb->fbmem = oinfo.fbmem; + fb->fblen = oinfo.fblen; + fb->bpp = oinfo.bpp; + } + } + break; + + case FBIOGET_OVERLAYINFO: /* Get video overlay info */ + { + struct fb_overlayinfo_s oinfo; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->getoverlayinfo != NULL); + ret = LOS_ArchCopyFromUser(&oinfo, (const void *)arg, sizeof(struct fb_overlayinfo_s)); + if (ret) + { + ret = -EFAULT; + break; + } + ret = fb->vtable->getoverlayinfo(fb->vtable, oinfo.overlay, &oinfo); + if (ret == ENOERR) + { + ret = LOS_ArchCopyToUser((void *)arg, &oinfo, sizeof(struct fb_overlayinfo_s)); + if (ret) + { + ret = -EFAULT; + } + } + } + break; + + case FBIOSET_TRANSP: /* Set video overlay transparency */ + { + struct fb_overlayinfo_s oinfo; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->settransp != NULL); + ret = LOS_ArchCopyFromUser(&oinfo, (const void *)arg, sizeof(struct fb_overlayinfo_s)); + if (ret) + { + ret = -EFAULT; + break; + } + ret = fb->vtable->settransp(fb->vtable, &oinfo); + } + break; + + case FBIOSET_CHROMAKEY: /* Set video overlay chroma key */ + { + struct fb_overlayinfo_s oinfo; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->setchromakey != NULL); + ret = LOS_ArchCopyFromUser(&oinfo, (const void *)arg, sizeof(struct fb_overlayinfo_s)); + if (ret) + { + ret = -EFAULT; + break; + } + ret = fb->vtable->setchromakey(fb->vtable, &oinfo); + } + break; + + case FBIOSET_COLOR: /* Set video overlay color */ + { + struct fb_overlayinfo_s oinfo; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->setcolor != NULL); + ret = LOS_ArchCopyFromUser(&oinfo, (const void *)arg, sizeof(struct fb_overlayinfo_s)); + if (ret) + { + ret = -EFAULT; + break; + } + ret = fb->vtable->setcolor(fb->vtable, &oinfo); + } + break; + + case FBIOSET_BLANK: /* Blank or unblank video overlay */ + { + struct fb_overlayinfo_s oinfo; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->setblank != NULL); + ret = LOS_ArchCopyFromUser(&oinfo, (const void *)arg, sizeof(struct fb_overlayinfo_s)); + if (ret) + { + ret = -EFAULT; + break; + } + ret = fb->vtable->setblank(fb->vtable, &oinfo); + } + break; + + case FBIOSET_AREA: /* Set active video overlay area */ + { + struct fb_overlayinfo_s oinfo; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->setarea != NULL); + ret = LOS_ArchCopyFromUser(&oinfo, (const void *)arg, sizeof(struct fb_overlayinfo_s)); + if (ret) + { + ret = -EFAULT; + break; + } + ret = fb->vtable->setarea(fb->vtable, &oinfo); + } + break; + +#ifdef CONFIG_FB_OVERLAY_BLIT + case FBIOSET_BLIT: /* Blit operation between video overlays */ + { + struct fb_overlayblit_s blit; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->blit != NULL); + ret = LOS_ArchCopyFromUser(&blit, (const void *)arg, sizeof(struct fb_overlayblit_s)); + if (ret) + { + ret = -EFAULT; + break; + } + ret = fb->vtable->blit(fb->vtable, &blit); + } + break; + + case FBIOSET_BLEND: /* Blend operation between video overlays */ + { + struct fb_overlayblend_s blend; + + DEBUGASSERT(fb->vtable != NULL && + fb->vtable->blend != NULL); + ret = LOS_ArchCopyFromUser(&blend, (const void *)arg, sizeof(struct fb_overlayblend_s)); + if (ret) + { + ret = -EFAULT; + break; + } + ret = fb->vtable->blend(fb->vtable, &blend); + } + break; +#endif +#endif /* CONFIG_FB_OVERLAY */ + + default: + DEBUGASSERT(fb->vtable != NULL && fb->vtable->fb_ioctl != NULL); + ret = fb->vtable->fb_ioctl(fb->vtable, cmd, arg); + break; + } + + return ret; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: fb_register + * + * Description: + * Register the framebuffer character device at /dev/fbN where N is the + * display number if the devices supports only a single plane. If the + * hardware supports multiple color planes, then the device will be + * registered at /dev/fbN.M where N is the again display number but M + * is the display plane. + * + * Input Parameters: + * display - The display number for the case of boards supporting multiple + * displays or for hardware that supports multiple + * layers (each layer is consider a display). Typically zero. + * plane - Identifies the color plane on hardware that supports separate + * framebuffer "planes" for each color component. + * + * Returned Value: + * Zero (OK) is returned success; a negated errno value is returned on any + * failure. + * + ****************************************************************************/ + +int fb_register(int display, int plane) +{ + FAR struct fb_chardev_s *fb; + struct fb_videoinfo_s vinfo; + struct fb_planeinfo_s pinfo; +#ifdef CONFIG_FB_OVERLAY + struct fb_overlayinfo_s oinfo; +#endif + char devname[16]; + int nplanes; + int ret; + + if (display < 0 || display >= FB_DEV_MAXNUM) + return -EINVAL; + + /* Allocate a framebuffer state instance */ + + fb = (FAR struct fb_chardev_s *)malloc(sizeof(struct fb_chardev_s)); + if (fb == NULL) + { + return -ENOMEM; + } + + /* Initialize the frame buffer device. */ + + ret = up_fbinitialize(display); + if (ret < 0) + { + gerr("ERROR: up_fbinitialize() failed for display %d: %d\n", display, ret); + goto errout_with_fb; + } + + DEBUGASSERT((unsigned)plane <= UINT8_MAX); + fb->plane = plane; + + fb->vtable = up_fbgetvplane(display, plane); + if (fb->vtable == NULL) + { + gerr("ERROR: up_fbgetvplane() failed, vplane=%d\n", plane); + goto errout_with_fb; + } + + /* Initialize the frame buffer instance. */ + + DEBUGASSERT(fb->vtable->getvideoinfo != NULL); + ret = fb->vtable->getvideoinfo(fb->vtable, &vinfo); + if (ret < 0) + { + gerr("ERROR: getvideoinfo() failed: %d\n", ret); + goto errout_with_fb; + } + + nplanes = vinfo.nplanes; + DEBUGASSERT(vinfo.nplanes > 0 && (unsigned)plane < vinfo.nplanes); + + DEBUGASSERT(fb->vtable->getplaneinfo != NULL); + ret = fb->vtable->getplaneinfo(fb->vtable, plane, &pinfo); + if (ret < 0) + { + gerr("ERROR: getplaneinfo() failed: %d\n", ret); + goto errout_with_fb; + } + + fb->fbmem = pinfo.fbmem; + fb->fblen = pinfo.fblen; + fb->bpp = pinfo.bpp; + + /* Clear the framebuffer memory */ + + memset(pinfo.fbmem, 0, pinfo.fblen); + +#ifdef CONFIG_FB_OVERLAY + /* Initialize first overlay but do not select */ + + DEBUGASSERT(fb->vtable->getoverlayinfo != NULL); + ret = fb->vtable->getoverlayinfo(fb->vtable, 0, &oinfo); + if (ret < 0) + { + gerr("ERROR: getoverlayinfo() failed: %d\n", ret); + goto errout_with_fb; + } + + /* Clear the overlay memory. Necessary when plane 0 and overlay 0 + * different. + */ + + memset(oinfo.fbmem, 0, oinfo.fblen); +#endif + + /* Register the framebuffer device */ + + if (nplanes < 2) + { + (void)snprintf(devname, 16, "/dev/fb%d", display); + } + else + { + (void)snprintf(devname, 16, "/dev/fb%d.%d", display, plane); + } + + ret = register_driver(devname, &fb_fops, 0666, (FAR void *)fb); + if (ret < 0) + { + gerr("ERROR: register_driver() failed: %d\n", ret); + goto errout_with_fb; + } + + g_fb_dev[display] = fb; + + return OK; + +errout_with_fb: + free(fb); + return ret; +} + +int fb_unregister(int display) +{ + FAR struct fb_chardev_s *fb; + + if (display < 0 || display >= FB_DEV_MAXNUM) + return -EINVAL; + + fb = g_fb_dev[display]; + + up_fbuninitialize(display); + + free(fb); + g_fb_dev[display] = NULL; + + return 0; +} diff --git a/fs/dirent/fs_closedir.c b/fs/dirent/fs_closedir.c new file mode 100755 index 0000000..cd733c2 --- /dev/null +++ b/fs/dirent/fs_closedir.c @@ -0,0 +1,162 @@ +/**************************************************************************** + * fs/dirent/fs_closedir.c + * + * Copyright (C) 2007-2009, 2011, 2013-2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "dirent.h" +#include "errno.h" + +#include "stdlib.h" +#include "fs/fs.h" +#include "fs/dirent_fs.h" + +#include "inode/inode.h" + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: closedir + * + * Description: + * The closedir() function closes the directory stream associated with + * 'dirp'. The directory stream descriptor 'dirp' is not available after + * this call. + * + * Input Parameters: + * dirp -- An instance of type DIR created by a previous call to opendir(); + * + * Returned Value: + * The closedir() function returns 0 on success. On error, -1 is + * returned, and errno is set appropriately. + * + ****************************************************************************/ + +int closedir(FAR DIR *dirp) +{ + struct fs_dirent_s *idir = (struct fs_dirent_s *)dirp; +#ifndef CONFIG_DISABLE_MOUNTPOINT + struct inode *inode; +#endif + int ret; + + /* Verify that we were provided with a valid directory structure */ + + if (!idir || idir->fd_status != DIRENT_MAGIC) + { + ret = EBADF; + goto errout; + } + + /* A special case is when we enumerate an "empty", unused inode. That is + * an inode in the pseudo-filesystem that has no operations and no children. + * This is a "dangling" directory entry that has lost its childre. + */ + + if (idir->fd_root) + { + /* This is the 'root' inode of the directory. This means different + * things wih different filesystems. + */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT + inode = idir->fd_root; + + /* The way that we handle the close operation depends on what kind of + * root inode we have open. + */ + + if (INODE_IS_MOUNTPT(inode) && !DIRENT_ISPSEUDONODE(idir->fd_flags)) + { + /* The node is a file system mointpoint. Verify that the + * mountpoint supports the closedir() method (not an error if it + * does not) + */ + + if (inode->u.i_mops && inode->u.i_mops->closedir) + { + /* Perform the closedir() operation */ + + ret = inode->u.i_mops->closedir(inode, idir); + if (ret < 0) + { + ret = -ret; + goto errout_with_inode; + } + } + } + else +#endif + { + /* The node is part of the root pseudo file system, release + * our contained reference to the 'next' inode. + */ + + if (idir->u.pseudo.fd_next) + { + inode_release(idir->u.pseudo.fd_next); + } + } + + /* Release our references on the contained 'root' inode */ + + inode_release(idir->fd_root); + } + + /* Then release the container */ + + idir->fd_status = 0; + free(idir); + return OK; + +#ifndef CONFIG_DISABLE_MOUNTPOINT +errout_with_inode: + inode_release(inode); + free(idir); +#endif + +errout: + set_errno(ret); + return VFS_ERROR; +} diff --git a/fs/dirent/fs_opendir.c b/fs/dirent/fs_opendir.c new file mode 100755 index 0000000..44b0186 --- /dev/null +++ b/fs/dirent/fs_opendir.c @@ -0,0 +1,528 @@ +/**************************************************************************** + * fs/dirent/fs_opendir.c + * + * Copyright (C) 2007-2009, 2011, 2013-2014, 2017-2018 Gregory Nutt. All + * rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "dirent.h" +#include "string.h" +#include "assert.h" +#include "errno.h" + +#include "stdlib.h" +#include "fs/fs.h" +#include "fs/dirent_fs.h" + +#include "inode/inode.h" + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: open_mountpoint + * + * Description: + * Handle the case where the inode to be opened is within a mountpoint. + * + * Input Parameters: + * inode -- the inode of the mountpoint to open + * relpath -- the relative path within the mountpoint to open + * dir -- the dirent structure to be initialized + * + * Returned Value: + * On success, OK is returned; Otherwise, a positive errno is returned. + * + ****************************************************************************/ + +#ifndef CONFIG_DISABLE_MOUNTPOINT +static inline int open_mountpoint(FAR struct inode *inode, + FAR const char *relpath, + FAR struct fs_dirent_s *dir) +{ + int ret; + + /* The inode itself as the 'root' of mounted volume. The actually + * directory is at relpath into the* mounted filesystem. + * + * Verify that the mountpoint inode supports the opendir() method + */ + + if (!inode->u.i_mops || !inode->u.i_mops->opendir) + { + return ENOSYS; + } + + /* Take reference to the mountpoint inode. Note that we do not use + * inode_addref() because we already hold the tree semaphore. + */ + + inode->i_crefs++; + + /* Perform the opendir() operation */ + + ret = inode->u.i_mops->opendir(inode, relpath, dir); + if (ret < 0) + { + /* We now need to back off our reference to the inode. We can't + * call inode_release() to do that unless we release the tree + * semaphore. The following should be safe because: (1) after the + * reference count was incremented above it should be >=1 so it should + * not decrement below zero, and (2) we hold the tree semaphore so no + * other thread should be able to change the reference count. + */ + + inode->i_crefs--; + DEBUGASSERT(inode->i_crefs >= 0); + + /* Negate the error value so that it can be used to set errno */ + + return -ret; + } + + return OK; +} +#endif + +/**************************************************************************** + * Name: open_pseudodir + * + * Description: + * Handle the case where the inode to be opened is within the top-level + * pseudo-file system. + * + * Input Parameters: + * inode -- the inode of the mountpoint to open + * dir -- the dirent structure to be initialized + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void open_pseudodir(FAR struct inode *inode, FAR struct fs_dirent_s *dir) +{ + /* We have a valid pseudo-filesystem node. Take two references on the + * inode -- one for the parent (fd_root) and one for the child (fd_next). + * Note that we do not call inode_addref because we are holding the tree + * semaphore and that would result in deadlock. + */ + + inode->i_crefs++; + inode->i_child->i_crefs++; + dir->fd_root = inode; /* Save the inode where we start */ + dir->u.pseudo.fd_next = inode->i_child; /* This is the next node to use for readdir() */ + + /* Flag the inode as belonging to the pseudo-filesystem */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT + DIRENT_SETPSEUDONODE(dir->fd_flags); +#endif +} + +/**************************************************************************** + * Name: open_emptydir + * + * Description: + * Handle the case where the inode to be opened is an empty, directory node + * within the top-level pseudo-file system. That is, it has no operations + * and, therefore, it must be a directory node. But is has no children + * to be enumerated either. + * + * Input Parameters: + * dir -- the dirent structure to be initialized + * + * Returned Value: + * None + * + ****************************************************************************/ + +static inline void open_emptydir(FAR struct fs_dirent_s *dir) +{ + /* We have a valid, but empty pseudo-filesystem node. fd_next is NULL + * meaning that we are already at the end of the list of its children. + * fd_root is NULL so that if the directory is rewound, it will still be + * at the end of the list. + */ + /* Flag the inode as belonging to the pseudo-filesystem */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT + DIRENT_SETPSEUDONODE(dir->fd_flags); +#endif +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: opendir + * + * Description: + * The opendir() function opens a directory stream corresponding to the + * directory name, and returns a pointer to the directory stream. The + * stream is positioned at the first entry in the directory. + * + * Input Parameters: + * path -- the directory to open + * + * Returned Value: + * The opendir() function returns a pointer to the directory stream. On + * error, NULL is returned, and errno is set appropriately. + * + * EACCES - Permission denied. + * EMFILE - Too many file descriptors in use by process. + * ENFILE - Too many files are currently open in the + * system. + * ENOENT - Directory does not exist, or name is an empty + * string. + * ENOMEM - Insufficient memory to complete the operation. + * ENOTDIR - 'path' is not a directory. + * + ****************************************************************************/ + +FAR DIR *opendir(FAR const char *path) +{ + FAR struct inode *inode; + FAR struct fs_dirent_s *dir; + FAR const char *relpath; + int ret; + char *fullpath; + char *fullpath_bak; + + /* If we are given 'nothing' then we will interpret this as + * request for the root inode. + */ + + ret = vfs_normalize_path((const char *)NULL, path, &fullpath); + if (ret < 0) + { + ret = -ret; + goto errout; + } + fullpath_bak = fullpath; + + inode_semtake(); + + /* We don't know what to do with relative pathes */ + + if (*fullpath != '/') + { + ret = ENOTDIR; + goto errout_with_semaphore; + } + + /* Find the node matching the path. */ + + inode = inode_search((FAR const char **)&fullpath, (FAR struct inode**)NULL, + (FAR struct inode**)NULL, &relpath); + + /* Did we get an inode? */ + + if (inode == NULL) + { + /* 'path' does not exist. */ + + ret = ENOTDIR; + goto errout_with_semaphore; + } + + /* Allocate a type DIR -- which is little more than an inode + * container. + */ + + dir = (FAR struct fs_dirent_s *)zalloc(sizeof(struct fs_dirent_s)); + if (!dir) + { + /* Insufficient memory to complete the operation. */ + + ret = ENOMEM; + goto errout_with_semaphore; + } + + /* Populate the DIR structure and return it to the caller. The way that + * we do this depends on whenever this is a "normal" pseudo-file-system + * inode or a file system mountpoint. + */ + + dir->fd_position = 0; /* This is the position in the read stream */ + + /* The node is part of the root pseudo file system. Does the inode + * have a child? If so that the child would be the 'root' of a list + * of nodes under the directory. + */ + + FAR struct inode *child = inode->i_child; + if (!*relpath && child) + { + /* It looks we have a valid pseudo-filesystem directory node. */ + + open_pseudodir(inode, dir); + } + +#ifndef CONFIG_DISABLE_MOUNTPOINT + if (INODE_IS_MOUNTPT(inode)) + { + /* Yes, the node is a file system mountpoint */ + + dir->fd_root = inode; /* Save the inode where we start */ + + /* Open the directory at the relative path */ + + ret = open_mountpoint(inode, relpath, dir); + if (ret != OK) + { + goto errout_with_direntry; + } + } + else +#endif + + if (!*relpath && child == NULL) + { + if (inode->u.i_ops == NULL) + { + /* This is a dangling node with no children and no operations. Set + * up to enumerate an empty directory. + */ + + open_emptydir(dir); + } + else + { + ret = ENOTDIR; + goto errout_with_direntry; + } + } + else if (*relpath) + { + ret = ENOENT; + goto errout_with_direntry; + } + + dir->fd_status = DIRENT_MAGIC; + inode_semgive(); + free(fullpath_bak); + return ((DIR *)dir); + + /* Nasty goto's make error handling simpler */ + +errout_with_direntry: + free(dir); + +errout_with_semaphore: + inode_semgive(); + free(fullpath_bak); + +errout: + set_errno(ret); + return NULL; +} + +int do_opendir(const char *path, int oflags) +{ + int ret; + int fd; + FAR struct inode *inode = NULL; + FAR struct fs_dirent_s *dir = NULL; + FAR const char *relpath = NULL; + char *fullpath = NULL; + FAR struct file *filep = NULL; + FAR struct inode *child = NULL; + struct inode_search_s desc; + + /* If we are given 'nothing' then we will interpret this as + * request for the root inode. + */ + + ret = vfs_normalize_path((const char *)NULL, path, &fullpath); + if (ret < 0) + { + ret = -ret; + goto errout; + } + + /* We don't know what to do with relative pathes */ + + if (*fullpath != '/') + { + ret = ENOTDIR; + goto errout_with_path; + } + + /* Get an inode for this file */ + + SETUP_SEARCH(&desc, fullpath, false); + ret = inode_find(&desc); + if (ret < 0) + { + PRINTK("ERROR: Failed to find %s\n", fullpath); + + /* 'path' does not exist. */ + + ret = ENOTDIR; + goto errout_with_path; + } + inode = desc.node; + relpath = desc.relpath; + + /* Associate the inode with a file structure */ + + fd = files_allocate(inode, oflags, 0, NULL, 3); /* 3: file start fd */ + if (fd < 0) + { + ret = EMFILE; + goto errout_with_inode; + } + + /* Get the file structure corresponding to the file descriptor. */ + + ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + ret = EPERM; + + /* The errno value has already been set */ + goto errout_with_fd; + } + + /* Perform the driver open operation. NOTE that the open method may be + * called many times. The driver/mountpoint logic should handled this + * because it may also be closed that many times. + */ + + ret = OK; + filep->f_path = fullpath; /* The mem will free in close(fd); */ + filep->f_relpath = relpath; + + /* Allocate a type DIR -- which is little more than an inode + * container. + */ + + dir = (FAR struct fs_dirent_s *)zalloc(sizeof(struct fs_dirent_s)); + if (!dir) + { + /* Insufficient memory to complete the operation. */ + + ret = ENOMEM; + goto errout_with_fd; + } + + /* Populate the DIR structure and return it to the caller. The way that + * we do this depends on whenever this is a "normal" pseudo-file-system + * inode or a file system mountpoint. + */ + + dir->fd_position = 0; /* This is the position in the read stream */ + + /* The node is part of the root pseudo file system. Does the inode + * have a child? If so that the child would be the 'root' of a list + * of nodes under the directory. + */ + + child = inode->i_child; + if (!*relpath && child) + { + /* It looks we have a valid pseudo-filesystem directory node. */ + + open_pseudodir(inode, dir); + } + +#ifndef CONFIG_DISABLE_MOUNTPOINT + if (INODE_IS_MOUNTPT(inode)) + { + /* Yes, the node is a file system mountpoint */ + + dir->fd_root = inode; /* Save the inode where we start */ + + /* Open the directory at the relative path */ + + ret = open_mountpoint(inode, relpath, dir); + if (ret != OK) + { + goto errout_with_direntry; + } + } + else +#endif + + if (!*relpath && child == NULL) + { + if (inode->u.i_ops == NULL) + { + /* This is a dangling node with no children and no operations. Set + * up to enumerate an empty directory. + */ + + open_emptydir(dir); + } + else + { + ret = ENOTDIR; + goto errout_with_direntry; + } + } + else if (*relpath) + { + ret = ENOENT; + goto errout_with_direntry; + } + + dir->fd_status = DIRENT_MAGIC; + filep->f_dir = (struct fs_dirent_s *)dir; + return fd; + + /* Nasty goto's make error handling simpler */ + +errout_with_direntry: + free(dir); + +errout_with_fd: + files_release(fd); + +errout_with_inode: + inode_release(inode); + +errout_with_path: + free(fullpath); + +errout: + set_errno(ret); + return -1; +} diff --git a/fs/dirent/fs_readdir.c b/fs/dirent/fs_readdir.c new file mode 100755 index 0000000..6260e0e --- /dev/null +++ b/fs/dirent/fs_readdir.c @@ -0,0 +1,338 @@ +/**************************************************************************** + * fs/dirent/fs_readdir.c + * + * Copyright (C) 2007-2009, 2011, 2017-2018 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "string.h" +#include "dirent.h" +#include "errno.h" +#include "unistd.h" + +#include "fs/fs.h" +#include "fs/dirent_fs.h" + +#include "inode/inode.h" +#include "user_copy.h" + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: readpseudodir + ****************************************************************************/ + +static inline int readpseudodir(struct fs_dirent_s *idir) +{ + FAR struct inode *prev; + int ret; + + /* Check if we are at the end of the list */ + + if (!idir->u.pseudo.fd_next) + { + /* End of file and error conditions are not distinguishable with + * readdir. Here we return -ENOENT to signal the end of the + * directory. + */ + + return -ENOENT; + } + + /* Copy the inode name into the dirent structure */ + + ret = strncpy_s(idir->fd_dir.d_name, NAME_MAX + 1, idir->u.pseudo.fd_next->i_name, NAME_MAX); + if (ret != EOK) + { + return -ENAMETOOLONG; + } + + /* If the node has file operations, we will say that it is a file. */ + + idir->fd_dir.d_type = 0; + idir->fd_dir.d_off = idir->fd_position; + idir->fd_dir.d_reclen = sizeof(struct dirent); + if (idir->u.pseudo.fd_next->u.i_ops) + { +#ifndef CONFIG_DISABLE_MOUNTPOINT + if (INODE_IS_BLOCK(idir->u.pseudo.fd_next)) + { + idir->fd_dir.d_type |= DT_BLK; + } + if (INODE_IS_MOUNTPT(idir->u.pseudo.fd_next)) + { + idir->fd_dir.d_type |= DT_DIR; + } + else +#endif + { + idir->fd_dir.d_type |= DT_CHR; + } + } + + /* If the node has child node(s) or no operations, then we will say that + * it is a directory rather than a special file. NOTE: that the node can + * be both! + */ + + if (idir->u.pseudo.fd_next->i_child || !idir->u.pseudo.fd_next->u.i_ops) + { + idir->fd_dir.d_type |= DT_DIR; + } + + /* Now get the inode to vist next time that readdir() is called */ + + inode_semtake(); + + prev = idir->u.pseudo.fd_next; + idir->u.pseudo.fd_next = prev->i_peer; /* The next node to visit */ + + if (idir->u.pseudo.fd_next) + { + /* Increment the reference count on this next node */ + + idir->u.pseudo.fd_next->i_crefs++; + } + + inode_semgive(); + + if (prev) + { + inode_release(prev); + } + + return OK; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: do_readdir + * + * Description: + * The do_readdir() function returns a pointer to a dirent structure + * representing the next directory entry in the directory stream pointed + * to by dir. It returns NULL on reaching the end-of-file or if an error + * occurred. + * + * Input Parameters: + * dirp -- An instance of type DIR created by a previous call to opendir(); + * + * Returned Value: + * The do_readdir() function returns a pointer to a dirent structure, or NULL + * if an error occurs or end-of-file is reached. On error, errno is set + * appropriately. + * + * EBADF - Invalid directory stream descriptor dir + * + ****************************************************************************/ +static struct dirent *__readdir(DIR *dirp) +{ + FAR struct fs_dirent_s *idir = (struct fs_dirent_s *)dirp; + struct inode *inode_ptr = NULL; + int ret = 0; + + /* Verify that we were provided with a valid directory structure */ + + if (!idir || idir->fd_status != DIRENT_MAGIC) + { + ret = EBADF; + goto errout; + } + + /* A special case is when we enumerate an "empty", unused inode. That is + * an inode in the pseudo-filesystem that has no operations and no children. + * This is a "dangling" directory entry that has lost its children. + */ + + inode_ptr = idir->fd_root; + if (inode_ptr == NULL) + { + /* End of file and error conditions are not distinguishable + * with readdir. We return NULL to signal either case. + */ + + ret = ENOENT; + goto errout; + } + + /* The way we handle the readdir depends on the type of inode + * that we are dealing with. + */ + if (DIRENT_ISPSEUDONODE(idir->fd_flags)) + { + /* The node is part of the root pseudo file system */ + + ret = readpseudodir(idir); + if (!ret) + { + idir->fd_position++; + return &idir->fd_dir; + } + } + +#ifndef CONFIG_DISABLE_MOUNTPOINT + if (INODE_IS_MOUNTPT(inode_ptr)) + { + /* The node is a file system mointpoint. Verify that the mountpoint + * supports the readdir() method + */ + if (!inode_ptr->u.i_mops || !inode_ptr->u.i_mops->readdir) + { + ret = EACCES; + goto errout; + } + + /* Perform the readdir() operation */ + + ret = inode_ptr->u.i_mops->readdir(inode_ptr, idir); + if (!ret) + { + idir->fd_position++; + return &idir->fd_dir; + } + } +#endif + + ret = -ret; + +errout: + if (ret != OK) + { + set_errno(ret); + } + return (struct dirent *)NULL; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: readdir + * + * Description: + * The readdir() function returns a pointer to a dirent structure + * representing the next directory entry in the directory stream pointed + * to by dir. It returns NULL on reaching the end-of-file or if an error + * occurred. + * + * Inputs: + * dirp -- An instance of type DIR created by a previous call to opendir(); + * + * Return: + * The readdir() function returns a pointer to a dirent structure, or NULL + * if an error occurs or end-of-file is reached. On error, errno is set + * appropriately. + * + * EBADF - Invalid directory stream descriptor dir + * + ****************************************************************************/ + +FAR struct dirent *readdir(DIR *dirp) +{ + int ret; + int old_err = get_errno(); + struct dirent *de = __readdir(dirp); + + if (de == NULL) + { + ret = get_errno(); + /* Special case: ret = -ENOENT is end of file */ + + if (ret == ENOENT) + { + set_errno(old_err); + } + } + return de; +} + +/* readdir syscall routine */ + +int do_readdir(int fd, struct dirent **de, unsigned int count) +{ + struct dirent *de_src = NULL; + + /* Did we get a valid file descriptor? */ + +#if CONFIG_NFILE_DESCRIPTORS > 0 + FAR struct file *filep = NULL; + + if (de == NULL) + { + return -EINVAL; + } + + if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) + { + return -EBADF; + } + else + { + /* The descriptor is in a valid range to file descriptor... do the + * read. First, get the file structure. + */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + return -get_errno(); + } + + /* Then let do_readdir do all of the work */ + + de_src = __readdir(filep->f_dir); + if (de_src == NULL) + { + /* Special case: ret = -ENOENT is end of file */ + return -get_errno(); + } + *de = de_src; + + return sizeof(*de_src); + } +#endif + + return 0; +} diff --git a/fs/dirent/fs_rewinddir.c b/fs/dirent/fs_rewinddir.c new file mode 100755 index 0000000..4fad333 --- /dev/null +++ b/fs/dirent/fs_rewinddir.c @@ -0,0 +1,155 @@ +/**************************************************************************** + * fs/dirent/fs_rewinddir.c + * + * Copyright (C) 2007-2009, 2011, 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "dirent.h" +#include "errno.h" + +#include "fs/fs.h" +#include "fs/dirent_fs.h" + +#include "inode/inode.h" + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: rewindpseudodir + ****************************************************************************/ + +static inline void rewindpseudodir(struct fs_dirent_s *idir) +{ + struct inode *prev; + + inode_semtake(); + + /* Reset the position to the beginning */ + + prev = idir->u.pseudo.fd_next; /* (Save to delete later) */ + idir->u.pseudo.fd_next = idir->fd_root->i_child; /* The next node to visit */ + idir->fd_position = 0; /* Reset position */ + + /* Increment the reference count on the root=next node. We + * should now have two references on the inode. + */ + + idir->fd_root->i_child->i_crefs++; + inode_semgive(); + + /* Then release the reference to the old next inode */ + + if (prev != NULL) + { + inode_release(prev); + } +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: rewinddir + * + * Description: + * The rewinddir() function resets the position of the + * directory stream dir to the beginning of the directory. + * + * Input Parameters: + * dirp -- An instance of type DIR created by a previous + * call to opendir(); + * + * Returned Value: + * None + * + ****************************************************************************/ + +void rewinddir(FAR DIR *dirp) +{ + struct fs_dirent_s *idir = (struct fs_dirent_s *)dirp; +#ifndef CONFIG_DISABLE_MOUNTPOINT + struct inode *inode_ptr; +#endif + + /* Verify that we were provided with a valid directory structure, + * A special case is when we enumerate an "empty", unused inode (fd_root + * == 0). That is an inode in the pseudo-filesystem that has no + * operations and no children. This is a "dangling" directory entry that + * has lost its children. + */ + + if (!idir || !idir->fd_root || idir->fd_status != DIRENT_MAGIC) + { + set_errno(EBADF); + return; + } + + /* The way we handle the readdir depends on the type of inode + * that we are dealing with. + */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT + inode_ptr = idir->fd_root; + if (INODE_IS_MOUNTPT(inode_ptr)) + { + /* The node is a file system mointpoint. Verify that the mountpoint + * supports the rewinddir() method + */ + + if (inode_ptr->u.i_mops && inode_ptr->u.i_mops->rewinddir) + { + /* Perform the rewinddir() operation */ + + (void)inode_ptr->u.i_mops->rewinddir(inode_ptr, idir); + } + + /* Reset position for telldir() */ + + idir->fd_position = 0; + } + else +#endif + { + /* The node is part of the root pseudo file system */ + + rewindpseudodir(idir); + } +} diff --git a/fs/dirent/fs_seekdir.c b/fs/dirent/fs_seekdir.c new file mode 100755 index 0000000..568189a --- /dev/null +++ b/fs/dirent/fs_seekdir.c @@ -0,0 +1,242 @@ +/**************************************************************************** + * fs/dirent/fs_seekdir.c + * + * Copyright (C) 2007, 2008, 2011, 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/types.h" +#include "dirent.h" +#include "errno.h" + +#include "fs/fs.h" +#include "fs/dirent_fs.h" + +#include "inode/inode.h" + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: seekpseudodir + ****************************************************************************/ + +static inline void seekpseudodir(struct fs_dirent_s *idir, off_t offset) +{ + struct inode *curr; + struct inode *prev; + off_t pos; + + /* Determine a starting point for the seek. If the seek + * is "forward" from the current position, then we will + * start at the current poisition. Otherwise, we will + * "rewind" to the root dir. + */ + + if (offset < idir->fd_position) + { + pos = 0; + curr = idir->fd_root; + } + else + { + pos = idir->fd_position; + curr = idir->u.pseudo.fd_next; + } + + /* Traverse the peer list starting at the 'root' of the + * the list until we find the node at 'offset". If devices + * are being registered and unregistered, then this can + * be a very unpredictable operation. + */ + + inode_semtake(); + for (; curr && pos != offset; pos++, curr = curr->i_peer); + + /* Now get the inode to vist next time that readdir() is called */ + + prev = idir->u.pseudo.fd_next; + idir->u.pseudo.fd_next = curr; /* The next node to visit (might be null) */ + idir->fd_position = pos; /* Might be beyond the last dirent */ + + if (curr) + { + /* Increment the reference count on this next node */ + + curr->i_crefs++; + } + + inode_semgive(); + + if (prev) + { + inode_release(prev); + } +} + +/**************************************************************************** + * Name: seekmountptdir + ****************************************************************************/ + +#ifndef CONFIG_DISABLE_MOUNTPOINT +static inline void seekmountptdir(struct fs_dirent_s *idir, off_t offset) +{ + struct inode *inode; + off_t pos; + + /* Determine a starting point for the seek. If the seek + * is "forward" from the current position, then we will + * start at the current poisition. Otherwise, we will + * "rewind" to the root dir. + */ + + inode = idir->fd_root; + if (offset < idir->fd_position) + { + if (inode->u.i_mops && inode->u.i_mops->rewinddir) + { + /* Perform the rewinddir() operation */ + + inode->u.i_mops->rewinddir(inode, idir); + pos = 0; + } + else + { + /* We can't do the seek and there is no way to return + * an error indication. + */ + + return; + } + } + else + { + pos = idir->fd_position; + } + + /* This is a brute force approach... we will just read + * directory entries until we are at the desired position. + */ + + while (pos < offset) + { + if (!inode->u.i_mops || !inode->u.i_mops->readdir || + inode->u.i_mops->readdir(inode, idir) < 0) + { + /* We can't read the next entry and there is no way to return + * an error indication. + */ + + return; + } + + /* Increment the position on each successful read */ + + pos++; + } + + /* If we get here the directory position has been successfully set */ + + idir->fd_position = pos; +} +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: seekdir + * + * Description: + * The seekdir() function sets the location in the directory stream from + * which the next readdir() call will start. seekdir() should be used with + * an offset returned by telldir(). + * + * Input Parameters: + * dirp -- An instance of type DIR created by a previous + * call to opendir(); + * offset -- offset to seek to + * + * Returned Value: + * None + * + ****************************************************************************/ + +void seekdir(DIR *dirp, long offset) +{ + struct fs_dirent_s *idir = (struct fs_dirent_s *)dirp; + + /* Verify that we were provided with a valid directory structure, + * A special case is when we enumerate an "empty", unused inode (fd_root + * == 0). That is an inode in the pseudo-filesystem that has no + * operations and no children. This is a "dangling" directory entry that + * has lost its children. + */ + + if (!idir || !idir->fd_root || idir->fd_status != DIRENT_MAGIC) + { + set_errno(EBADF); + return; + } + + if (offset < 0) + { + set_errno(EINVAL); + return; + } + + /* The way we handle the readdir depends on the type of inode + * that we are dealing with. + */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT + if (INODE_IS_MOUNTPT(idir->fd_root)) + { + /* The node is a file system mointpoint */ + + seekmountptdir(idir, offset); + } + else +#endif + { + /* The node is part of the root pseudo file system */ + + seekpseudodir(idir, offset); + } +} diff --git a/fs/dirent/fs_telldir.c b/fs/dirent/fs_telldir.c new file mode 100755 index 0000000..4ed2419 --- /dev/null +++ b/fs/dirent/fs_telldir.c @@ -0,0 +1,88 @@ +/**************************************************************************** + * fs/dirent/fs_telldir.c + * + * Copyright (C) 2007-2008, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include "vfs_config.h" + +#include "sys/types.h" +#include "dirent.h" +#include "errno.h" + +#include "fs/fs.h" +#include "fs/dirent_fs.h" + +#include "inode/inode.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: telldir + * + * Description: + * The telldir() function returns the current location + * associated with the directory stream dirp. + * + * Inputs: + * dirp -- An instance of type DIR created by a previous + * call to opendir(); + * + * Return: + * On success, the telldir() function returns the current + * location in the directory stream. On error, -1 is + * returned, and errno is set appropriately. + * + * EBADF - Invalid directory stream descriptor dir + * + ****************************************************************************/ + +long telldir(FAR DIR *dirp) +{ + struct fs_dirent_s *idir = (struct fs_dirent_s *)dirp; + + if (!idir || !idir->fd_root) + { + set_errno(EBADF); + return (off_t)-1; + } + + /* Just return the current position */ + + return idir->fd_position; +} + diff --git a/fs/driver/fs_blockproxy.c b/fs/driver/fs_blockproxy.c new file mode 100755 index 0000000..f95431a --- /dev/null +++ b/fs/driver/fs_blockproxy.c @@ -0,0 +1,252 @@ +/**************************************************************************** + * fs/driver/fs_blockproxy.c + * + * Copyright (C) 2015-2018 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "fs/fs.h" + +#include "driver/blockproxy.h" + +#if !defined(CONFIG_DISABLE_MOUNTPOINT) +#ifdef LOSCFG_FS_VFS_BLOCK_DEVICE + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static uint32_t g_devno; +static sem_t g_devno_sem; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: unique_chardev + * + * Description: + * Create a unique temporary device name in the /dev/ directory of the + * pseudo-file system. We cannot use mktemp for this because it will + * attempt to open() the file. + * + * Input Parameters: + * None + * + * Returned Value: + * The allocated path to the device. This must be released by the caller + * to prevent memory links. NULL will be returned only the case where + * we fail to allocate memory. + * + ****************************************************************************/ + +static char *unique_chardev(void) +{ + struct stat statbuf; + char devbuf[16]; + uint32_t devno; + int ret; + + /* Loop until we get a unique device name */ + + for (; ;) + { + /* Get the semaphore protecting the path number */ + + while (sem_wait(&g_devno_sem) != 0) + { + /* The only case that an error should occur here is if the wait + * was awakened by a signal. + */ + + ret = get_errno(); + LOS_ASSERT(ret == EINTR); + } + + /* Get the next device number and release the semaphore */ + + devno = ++g_devno; + (void)sem_post(&g_devno_sem); + + /* Construct the full device number */ + + devno &= 0xffffff; + ret = snprintf_s(devbuf, 16, 14, "/dev/tmp%06lx", (unsigned long)devno); + /* length of the format string is 14 */ + if (ret < 0) + { + set_errno(ENAMETOOLONG); + return strdup(devbuf); + } + + /* Make sure that file name is not in use */ + + ret = stat(devbuf, &statbuf); + if (ret < 0) + { + DEBUGASSERT(errno == ENOENT); + return strdup(devbuf); + } + + /* It is in use, try again */ + } +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: block_proxy + * + * Description: + * Create a temporary char driver using drivers/bch to mediate character + * oriented accessed to the block driver. + * + * Input Parameters: + * blkdev - The path to the block driver + * oflags - Character driver open flags + * + * Returned Value: + * If positive, non-zero file descriptor is returned on success. This + * is the file descriptor of the nameless character driver that mediates + * accesses to the block driver. + * + * Errors that may be returned: + * + * ENOMEM - Failed to create a temporay path name. + * + * Plus: + * + * - Errors reported from bchdev_register() + * - Errors reported from open() or unlink() + * + ****************************************************************************/ + +int block_proxy(FAR const char *blkdev, int oflags) +{ + FAR char *chardev; + bool readonly; + int ret; + int fd; + + DEBUGASSERT(blkdev); + (void)sem_init(&g_devno_sem, 0, 1); + + /* Create a unique temporary file name for the character device */ + + chardev = unique_chardev(); + if (chardev == NULL) + { + PRINTK("ERROR: Failed to create temporary device name\n"); + (void)sem_destroy(&g_devno_sem); + return -ENOMEM; + } + + /* Should this character driver be read-only? */ + + readonly = (((unsigned int)oflags & O_ACCMODE) == O_RDONLY); + + /* Wrap the block driver with an instance of the BCH driver */ + + ret = bchdev_register(blkdev, chardev, readonly); + if (ret < 0) + { + PRINTK("ERROR: bchdev_register(%s, %s) failed: %d\n", blkdev, chardev, ret); + goto errout_with_chardev; + } + + /* Open the newly created character driver */ + + oflags =(unsigned int)oflags & (~(O_CREAT | O_EXCL | O_APPEND | O_TRUNC)); + fd = open(chardev, oflags); + if (fd < 0) + { + ret = -errno; + PRINTK("ERROR: Failed to open %s: %d\n", chardev, ret); + goto errout_with_bchdev; + } + + /* Unlink the character device name. The driver instance will persist, + * provided that CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y (otherwise, we have + * a problem here!) + */ + + ret = unlink(chardev); + if (ret < 0) + { + ret = -errno; + PRINTK("ERROR: Failed to unlink %s: %d\n", chardev, ret); + } + + ret = unregister_driver(chardev); + if (ret < 0 && ret != -EBUSY) + { + PRINTK("ERROR: Failed to unregister %s: %d\n", chardev, ret); + } + + /* Free the allocate character driver name and return the open file + * descriptor. + */ + + (void)free(chardev); + (void)sem_destroy(&g_devno_sem); + return fd; + +errout_with_bchdev: + (void)bchdev_unregister(chardev); + (void)unlink(chardev); + (void)unregister_driver(chardev); + +errout_with_chardev: + (void)free(chardev); + (void)sem_destroy(&g_devno_sem); + return ret; +} + +#endif +#endif /* !CONFIG_DISABLE_MOUNTPOINT */ diff --git a/fs/driver/fs_closeblockdriver.c b/fs/driver/fs_closeblockdriver.c new file mode 100755 index 0000000..768fffc --- /dev/null +++ b/fs/driver/fs_closeblockdriver.c @@ -0,0 +1,146 @@ +/**************************************************************************** + * fs/driver/fs_closeblockdriver.c + * + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in pathname and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of pathname 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "fs/fs.h" +#include "vfs_config.h" + +#include "debug.h" +#include "errno.h" + +#include "inode/inode.h" +#include "disk.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: close_blockdriver + * + * Description: + * Call the close method and release the inode + * + * Input Parameters: + * inode - reference to the inode of a block driver opened by open_blockdriver + * + * Returned Value: + * Returns zero on success or a negated errno on failure: + * + * EINVAL - inode is NULL + * ENOTBLK - The inode is not a block driver + * + ****************************************************************************/ + +int close_blockdriver(FAR struct inode *inode_ptr) +{ + int ret = 0; /* Assume success */ + los_part *part = NULL; + los_disk *disk = NULL; + + /* Sanity checks */ + + if (!inode_ptr || !inode_ptr->u.i_bops) + { + ret = -EINVAL; + goto errout; + } + + /* Verify that the inode is a block driver. */ + + if (!INODE_IS_BLOCK(inode_ptr)) + { + fdbg("inode is not a block driver\n"); + ret = -ENOTBLK; + goto errout; + } + + part = los_part_find(inode_ptr); + if (part != NULL) + { + disk = get_disk(part->disk_id); + if (disk == NULL) + { + ret = -EINVAL; + goto errout_with_inode; + } + + if (pthread_mutex_lock(&disk->disk_mutex) != ENOERR) + { + PRINT_ERR("%s %d, mutex lock fail!\n", __FUNCTION__, __LINE__); + inode_release(inode_ptr); + return -1; + } + if (disk->disk_status == STAT_INUSED) + { + /* Close the block driver. Not that no mutually exclusive access + * to the driver is enforced here. That must be done in the driver + * if needed. + */ + + if (inode_ptr->u.i_bops->close != NULL) + { + ret = inode_ptr->u.i_bops->close(inode_ptr); + } + } + + if (pthread_mutex_unlock(&disk->disk_mutex) != ENOERR) + { + PRINT_ERR("%s %d, mutex unlock fail!\n", __FUNCTION__, __LINE__); + inode_release(inode_ptr); + return -1; + } + + } + else + { + if ((inode_ptr->i_flags & FSNODEFLAG_DELETED) == 0 && inode_ptr->u.i_bops->close != NULL) + { + ret = inode_ptr->u.i_bops->close(inode_ptr); + } + } + +errout_with_inode: + + /* Then release the reference on the inode */ + + inode_release(inode_ptr); + +errout: + return ret; +} diff --git a/fs/driver/fs_devsyslog.c b/fs/driver/fs_devsyslog.c new file mode 100755 index 0000000..c3e6fb4 --- /dev/null +++ b/fs/driver/fs_devsyslog.c @@ -0,0 +1,544 @@ +/**************************************************************************** + * fs/driver/fs_devsyslog.c + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "los_task.h" +#include "vfs_config.h" +#include "sys/types.h" +#include "stdint.h" +#include "stdio.h" +#include "unistd.h" +#include "fcntl.h" +#include "semaphore.h" +#include "assert.h" +#include "fs/fs.h" +#include "inode/inode.h" + +#if defined(CONFIG_SYSLOG) && defined(CONFIG_SYSLOG_CHAR) + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Open the device/file write-only, try to create (file) it if it doesn't + * exist, if the file that already exists, then append the new log data to + * end of the file. + */ + +#define SYSLOG_OFLAGS (O_WRONLY | O_CREAT | O_APPEND) + +/* An invalid thread ID */ + +#define NO_HOLDER ((pid_t)-1) + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/* This enumeration represents the state of the SYSLOG device interface */ + +enum syslog_state_e +{ + SYSLOG_UNINITIALIZED = 0, /* SYSLOG has not been initialized */ + SYSLOG_INITIALIZING, /* SYSLOG is being initialized */ + SYSLOG_REOPEN, /* SYSLOG open failed... try again later */ + SYSLOG_FAILURE, /* SYSLOG open failed... don't try again */ + SYSLOG_OPENED, /* SYSLOG device is open and ready to use */ +}; + +/* This structure contains all SYSLOGing state information */ + +struct syslog_dev_s +{ + uint8_t sl_state; /* See enum syslog_state_e */ + sem_t sl_sem; /* Enforces mutually exclusive access */ + pid_t sl_holder; /* PID of the thread that holds the semaphore */ + struct file sl_file; /* The syslog file structure */ +}; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* This is the device structure for the console or syslogging function. */ + +static struct syslog_dev_s g_sysdev; +static const uint8_t g_syscrlf[2] = +{ + '\r', '\n' +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: syslog_takesem + * + * Description: + * Write to the syslog device + * + ****************************************************************************/ + +static inline int syslog_takesem(void) +{ + pid_t me = getpid(); + int ret; + + /* Does this thread already hold the semaphore? That could happen if + * we wer called recursively, i.e., if the logic kicked off by + * syslog_write() where to generate more debug output. Return an error + * in that case. + */ + + if (g_sysdev.sl_holder == me) + { + /* Return an error (instead of deadlocking) */ + + return -EWOULDBLOCK; + } + + /* Either the semaphore is available or is currently held by another + * thread. Wait for it to become available. + */ + + ret = sem_wait(&g_sysdev.sl_sem); + if (ret < 0) + { + return -get_errno(); + } + + /* We hold the semaphore. We can safely mark ourself as the holder + * of the semaphore. + */ + + g_sysdev.sl_holder = me; + return OK; +} + +/**************************************************************************** + * Name: syslog_givesem + * + * Description: + * Write to the syslog device + * + ****************************************************************************/ + +static inline void syslog_givesem(void) +{ +#ifdef CONFIG_DEBUG + pid_t me = getpid(); + DEBUGASSERT(g_sysdev.sl_holder == me); +#endif + + /* Relinquish the semaphore */ + + g_sysdev.sl_holder = NO_HOLDER; + (void)sem_post(&g_sysdev.sl_sem); +} + +/**************************************************************************** + * Name: syslog_write + * + * Description: + * Write to the syslog device + * + ****************************************************************************/ + +static inline ssize_t syslog_write(FAR const void *buf, size_t nbytes) +{ + FAR struct inode *inode_ptr; + + /* Let the driver perform the write */ + + inode_ptr = g_sysdev.sl_file.f_inode; + return inode_ptr->u.i_ops->write(&g_sysdev.sl_file, (const char *)buf, nbytes); +} + +/**************************************************************************** + * Name: syslog_flush + * + * Description: + * Flush any buffer data in the file system to media. + * + ****************************************************************************/ + +#ifndef CONFIG_DISABLE_MOUNTPOINT +static inline void syslog_flush(void) +{ + FAR struct inode *inode_ptr = g_sysdev.sl_file.f_inode; + + /* Is this a mountpoint? Does it support the sync method? */ + + if (INODE_IS_MOUNTPT(inode_ptr) && inode_ptr->u.i_mops->sync) + { + /* Yes... synchronize to the stream */ + + (void)inode_ptr->u.i_mops->sync(&g_sysdev.sl_file); + } +} +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: syslog_initialize + * + * Description: + * Initialize to use the character device (or file) at + * CONFIG_SYSLOG_DEVPATH as the SYSLOG sink. + * + * NOTE that this implementation excludes using a network connection as + * SYSLOG device. That would be a good extension. + * + ****************************************************************************/ + +int syslog_initialize(void) +{ + FAR struct inode *inode_ptr; + FAR const char *relpath = NULL; + int ret; + struct inode_search_s desc; + + /* At this point, the only expected states are SYSLOG_UNINITIALIZED or + * SYSLOG_REOPEN.. Not SYSLOG_INITIALIZING, SYSLOG_FAILURE, SYSLOG_OPENED. + */ + + DEBUGASSERT(g_sysdev.sl_state == SYSLOG_UNINITIALIZED || + g_sysdev.sl_state == SYSLOG_REOPEN); + + g_sysdev.sl_state = SYSLOG_INITIALIZING; + + /* Try to open the device. + * + * Note that we cannot just call open. The syslog device must work on all + * threads. Open returns a file descriptor that is valid only for the + * task that opened the device (and its pthread children). Instead, we + * essentially re-implement the guts of open() here so that we can get to + * the thread-independent structures of the inode. + */ + + /* Get an inode for this file/device */ + + SETUP_SEARCH(&desc, CONFIG_SYSLOG_DEVPATH, false); + ret = inode_find(&desc); + + /* Get the search results */ + + if (ret < 0) + { + /* The inode was not found. In this case, we will attempt to re-open + * the device repeatedly. The assumption is that the device path is + * valid but that the driver has not yet been registered. + */ + + g_sysdev.sl_state = SYSLOG_REOPEN; + return -EACCES; + } + inode_ptr = desc.node; + relpath = desc.relpath; + + /* Verify that the inode is valid and either a character driver or a + * mountpoint. + */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT + if ((!INODE_IS_DRIVER(inode_ptr) && !INODE_IS_MOUNTPT(inode_ptr))) +#else + if (!INODE_IS_DRIVER(inode_ptr)) +#endif + { + ret = -ENXIO; + goto errout_with_inode; + } + + /* Make sure that the "entity" at this inode supports write access */ + + if (!inode_ptr->u.i_ops || !inode_ptr->u.i_ops->write) + { + ret = -EACCES; + goto errout_with_inode; + } + + /* Initialize the file structure */ + + g_sysdev.sl_file.f_oflags = SYSLOG_OFLAGS; + g_sysdev.sl_file.f_pos = 0; + g_sysdev.sl_file.f_inode = inode_ptr; + + /* Perform the low-level open operation. */ + + ret = OK; + if (inode_ptr->u.i_ops->open) + { + /* Is the inode a mountpoint? */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT + if (INODE_IS_MOUNTPT(inode_ptr)) + { + /* Yes. Open the device write-only, try to create it if it + * doesn't exist, if the file that already exists, then append the + * new log data to end of the file. + */ + + ret = inode_ptr->u.i_mops->open(&g_sysdev.sl_file, relpath, + SYSLOG_OFLAGS, 0666); + } + + /* No... then it must be a character driver in the NuttX pseudo- + * file system. + */ + + else +#endif + { + ret = inode_ptr->u.i_ops->open(&g_sysdev.sl_file); + } + } + + /* Was the file/device successfully opened? */ + + if (ret < 0) + { + ret = -ret; + goto errout_with_inode; + } + + /* The SYSLOG device is open and ready for writing. */ + + (void)sem_init(&g_sysdev.sl_sem, 0, 1); + g_sysdev.sl_holder = NO_HOLDER; + g_sysdev.sl_state = SYSLOG_OPENED; + return OK; + +errout_with_inode: + inode_release(inode_ptr); + g_sysdev.sl_state = SYSLOG_FAILURE; + return ret; +} + +/**************************************************************************** + * Name: syslog_putc + * + * Description: + * This is the low-level system logging interface. The debugging/syslogging + * interfaces are syslog() and lowsyslog(). The difference is is that + * the syslog() function writes to syslogging device (usually fd=1, stdout) + * whereas lowsyslog() uses a lower level interface that works from + * interrupt handlers. This function is a a low-level interface used to + * implement lowsyslog(). + * + ****************************************************************************/ + +int syslog_putc(int ch) +{ + ssize_t nbytes; + uint8_t uch; + int errcode; + int ret; + + /* Ignore any output: + * + * (1) Before the SYSLOG device has been initialized. This could happen + * from debug output that occurs early in the boot sequence before + * syslog_initialize() is called (SYSLOG_UNINITIALIZED). + * (2) While the device is being initialized. The case could happen if + * debug output is generated while syslog_initialize() executes + * (SYSLOG_INITIALIZING). + * (3) While we are generating SYSLOG output. The case could happen if + * debug output is generated while syslog_putc() executes + * (This case is actually handled inside of syslog_semtake()). + * (4) Any debug output generated from interrupt handlers. A disadvantage + * of using the generic character device for the SYSLOG is that it + * cannot handle debug output generated from interrupt level handlers. + * (5) Any debug output generated from the IDLE loop. The character + * driver interface is blocking and the IDLE thread is not permitted + * to block. + * (6) If an irrecoverable failure occurred during initialization. In + * this case, we won't ever bother to try again (ever). + * + * NOTE: That the third case is different. It applies only to the thread + * that currently holds the sl_sem sempaphore. Other threads should wait. + * that is why that case is handled in syslog_semtake(). + */ + + /* Cases (4) and (5) */ + + if (OS_INT_ACTIVE || getpid() == 0) + { + errcode = ENOSYS; + goto errout_with_errcode; + } + + /* We can save checks in the usual case: That after the SYSLOG device + * has been successfully opened. + */ + + if (g_sysdev.sl_state != SYSLOG_OPENED) + { + /* Case (1) and (2) */ + + if (g_sysdev.sl_state == SYSLOG_UNINITIALIZED || + g_sysdev.sl_state == SYSLOG_INITIALIZING) + { + errcode = EAGAIN; /* Can't access the SYSLOG now... maybe next time? */ + goto errout_with_errcode; + } + + /* Case (6) */ + + if (g_sysdev.sl_state == SYSLOG_FAILURE) + { + errcode = ENXIO; /* There is no SYSLOG device */ + goto errout_with_errcode; + } + + /* syslog_initialize() is called as soon as enough of the operating + * system is in place to support the open operation... but it is + * possible that the SYSLOG device is not yet registered at that time. + * In this case, we know that the system is sufficiently initialized + * to support an attempt to re-open the SYSLOG device. + * + * NOTE that the scheduler is locked. That is because we do not have + * fully initialized semaphore capability until the SYSLOG device is + * successfully initialized + */ + + LOS_TaskLock(); + if (g_sysdev.sl_state == SYSLOG_REOPEN) + { + /* Try again to initialize the device. We may do this repeatedly + * because the log device might be something that was not ready + * the first time that syslog_initializee() was called (such as a + * USB serial device that has not yet been connected or a file in + * an NFS mounted file system that has not yet been mounted). + */ + + ret = syslog_initialize(); + if (ret < 0) + { + LOS_TaskUnlock(); + errcode = -ret; + goto errout_with_errcode; + } + } + + LOS_TaskUnlock(); + DEBUGASSERT(g_sysdev.sl_state == SYSLOG_OPENED); + } + + /* Ignore carriage returns */ + + if (ch == '\r') + { + return ch; + } + + /* The syslog device is ready for writing and we have something of + * value to write. + */ + + ret = syslog_takesem(); + if (ret < 0) + { + /* We probably already hold the semaphore and were probably + * re-entered by the logic kicked off by syslog_write(). + * We might also have been interrupted by a signal. Either + * way, we are outta here. + */ + + errcode = -ret; + goto errout_with_errcode; + } + + /* Pre-pend a newline with a carriage return. */ + + if (ch == '\n') + { + /* Write the CR-LF sequence */ + + nbytes = syslog_write(g_syscrlf, 2); + + /* Synchronize the file when each CR-LF is encountered (i.e., + * implements line buffering always). + */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT + if (nbytes > 0) + { + syslog_flush(); + } +#endif + } + else + { + /* Write the non-newline character (and don't flush) */ + + uch = (uint8_t)ch; + nbytes = syslog_write(&uch, 1); + } + + syslog_givesem(); + + /* Check if the write was successful. If not, nbytes will be + * a negated errno value. + */ + + if (nbytes < 0) + { + errcode = -ret; + goto errout_with_errcode; + } + + return ch; + +errout_with_errcode: + if (errcode != 0) + { + set_errno(errcode); + } + return EOF; +} + +#endif /* CONFIG_SYSLOG && CONFIG_SYSLOG_CHAR */ diff --git a/fs/driver/fs_findblockdriver.c b/fs/driver/fs_findblockdriver.c new file mode 100755 index 0000000..166c991 --- /dev/null +++ b/fs/driver/fs_findblockdriver.c @@ -0,0 +1,134 @@ +/**************************************************************************** + * fs/driver/fs_findblockdriver.c + * + * Copyright (C) 2008, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in pathname and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of pathname 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/types.h" +#include "sys/mount.h" +#include "debug.h" +#include "errno.h" + +#include "fs/fs.h" + +#include "inode/inode.h" +#include "driver/driver.h" +#include "string.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: find_blockdriver + * + * Description: + * Return the inode of the block driver specified by 'pathname' + * + * Input Parameters: + * pathname - The full path to the block driver to be located + * mountflags - If MS_RDONLY is not set, then driver must support write + * operations (see include/sys/mount.h) + * ppinode - Address of the location to return the inode reference + * + * Returned Value: + * Returns zero on success or a negated errno on failure: + * + * ENOENT - No block driver of this name is registered + * ENOTBLK - The inode associated with the pathname is not a block driver + * EACCESS - The MS_RDONLY option was not set but this driver does not + * support write access + * + ****************************************************************************/ + +int find_blockdriver(FAR const char *pathname, int mountflags, + FAR struct inode **ppinode) +{ + FAR struct inode *inode_ptr = NULL; + int ret = 0; /* Assume success */ + struct inode_search_s desc; + + /* Sanity checks */ + +#ifdef CONFIG_DEBUG + if (pathname == NULL || ppinode == NULL) + { + ret = -EINVAL; + goto errout; + } +#endif + + + /* Find the inode registered with this pathname */ + SETUP_SEARCH(&desc, pathname, false); + ret = inode_find(&desc); + if (ret < 0) + { + ret = -EACCES; + goto errout; + } + /* Get the search results */ + inode_ptr = desc.node; + + /* Verify that the inode is a block driver. */ + + if (!INODE_IS_BLOCK(inode_ptr)) + { + fdbg("%s is not a block driver\n", pathname); + ret = -ENOTBLK; + goto errout_with_inode; + } + + /* Make sure that the inode supports the requested access */ + + if (inode_ptr->u.i_bops == NULL || inode_ptr->u.i_bops->read == NULL || + (inode_ptr->u.i_bops->write == NULL && (mountflags & MS_RDONLY) == 0)) + { + fdbg("%s does not support requested access\n", pathname); + ret = -EACCES; + goto errout_with_inode; + } + + *ppinode = inode_ptr; + return OK; + +errout_with_inode: + inode_release(inode_ptr); +errout: + return ret; +} diff --git a/fs/driver/fs_openblockdriver.c b/fs/driver/fs_openblockdriver.c new file mode 100755 index 0000000..d263f04 --- /dev/null +++ b/fs/driver/fs_openblockdriver.c @@ -0,0 +1,170 @@ +/**************************************************************************** + * fs/driver/fs_openblockdriver.c + * + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in pathname and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of pathname 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "debug.h" +#include "errno.h" +#include "fs/fs.h" + +#include "inode/inode.h" +#include "driver/driver.h" +#include "disk.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: open_blockdriver + * + * Description: + * Return the inode of the block driver specified by 'pathname' + * + * Input Parameters: + * pathname - the full path to the block driver to be opened + * mountflags - if MS_RDONLY is not set, then driver must support write + * operations (see include/sys/mount.h) + * ppinode - address of the location to return the inode reference + * + * Returned Value: + * Returns zero on success or a negated errno on failure: + * + * EINVAL - pathname or pinode is NULL + * ENOENT - No block driver of this name is registered + * ENOTBLK - The inode associated with the pathname is not a block driver + * EACCESS - The MS_RDONLY option was not set but this driver does not + * support write access + * + ****************************************************************************/ + +int open_blockdriver(FAR const char *pathname, int mountflags, + FAR struct inode **ppinode) +{ + FAR struct inode *inode_ptr = NULL; + los_part *part = NULL; + los_disk *disk = NULL; + int ret; + + /* Minimal sanity checks */ + +#ifdef CONFIG_DEBUG + if (ppinode == NULL) + { + ret = -EINVAL; + goto errout; + } +#endif + + /* Find the inode associated with this block driver name. find_blockdriver + * will perform all additional error checking. + */ + + ret = find_blockdriver(pathname, mountflags, &inode_ptr); + if (ret < 0) + { + fdbg("Failed to file %s block driver\n", pathname); + goto errout; + } + + /* Open the block driver. Note that no mutually exclusive access + * to the driver is enforced here. That must be done in the driver + * if needed. + */ + + part = los_part_find(inode_ptr); + if (part != NULL) + { + disk = get_disk(part->disk_id); + if (disk == NULL) + { + ret = -EINVAL; + goto errout_with_inode; + } + + if (pthread_mutex_lock(&disk->disk_mutex) != ENOERR) + { + PRINT_ERR("%s %d, mutex lock fail!\n", __FUNCTION__, __LINE__); + inode_release(inode_ptr); + return -1; + } + if (disk->disk_status == STAT_INUSED) + { + + if (inode_ptr->u.i_bops->open != NULL) + { + ret = inode_ptr->u.i_bops->open(inode_ptr); + if (ret < 0) + { + fdbg("%s driver open failed\n", pathname); + (void)pthread_mutex_unlock(&disk->disk_mutex); + goto errout_with_inode; + } + } + } + + if (pthread_mutex_unlock(&disk->disk_mutex) != ENOERR) + { + PRINT_ERR("%s %d, mutex unlock fail!\n", __FUNCTION__, __LINE__); + inode_release(inode_ptr); + return -1; + } + + } + else + { + if ((inode_ptr->i_flags & FSNODEFLAG_DELETED) == 0 && inode_ptr->u.i_bops->open != NULL) + { + ret = inode_ptr->u.i_bops->open(inode_ptr); + if (ret < 0) + { + fdbg("%s driver open failed\n", pathname); + goto errout_with_inode; + } + } + } + + *ppinode = inode_ptr; + return OK; + +errout_with_inode: + inode_release(inode_ptr); +errout: + return ret; +} diff --git a/fs/driver/fs_registerblockdriver.c b/fs/driver/fs_registerblockdriver.c new file mode 100755 index 0000000..864d9d1 --- /dev/null +++ b/fs/driver/fs_registerblockdriver.c @@ -0,0 +1,118 @@ +/**************************************************************************** + * fs/driver/fs_registerblockdriver.c + * + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/types.h" +#include "errno.h" + +#include "fs/fs.h" + +#include "inode/inode.h" +#include "string.h" + +#ifndef CONFIG_DISABLE_MOUNTPOINT + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: register_blockdriver + * + * Description: + * Register a block driver inode the pseudo file system. + * + * Input parameters: + * path - The path to the inode to create + * bops - The block driver operations structure + * mode - inmode priviledges (not used) + * priv - Private, user data that will be associated with the inode. + * + * Returned Value: + * Zero on success (with the inode point in 'inode'); A negated errno + * value is returned on a failure (all error values returned by + * inode_reserve): + * + * EINVAL - 'path' is invalid for this operation + * EEXIST - An inode already exists at 'path' + * ENOMEM - Failed to allocate in-memory resources for the operation + * + ****************************************************************************/ + +int register_blockdriver(FAR const char *path, + FAR const struct block_operations *bops, + mode_t mode, FAR void *priv) +{ + FAR struct inode *node; + int ret; + + if (path == NULL || strlen(path) >= PATH_MAX || strncmp("/dev/", path, DEV_PATH_LEN) != 0) + { + return EINVAL; + } + + /* Insert an inode for the device driver -- we need to hold the inode + * semaphore to prevent access to the tree while we this. This is because + * we will have a momentarily bad true until we populate the inode with + * valid data. + */ + + inode_semtake(); + ret = inode_reserve(path, &node); + if (ret >= 0) + { + /* We have it, now populate it with block driver specific information. */ + + INODE_SET_BLOCK(node); + + node->u.i_bops = bops; +#ifdef LOSCFG_FILE_MODE + node->i_mode = mode; +#endif + node->i_private = priv; + ret = OK; + } + + inode_semgive(); + return ret; +} + +#endif /* !CONFIG_DISABLE_MOUNTPOINT */ + diff --git a/fs/driver/fs_registerdriver.c b/fs/driver/fs_registerdriver.c new file mode 100755 index 0000000..f2f907d --- /dev/null +++ b/fs/driver/fs_registerdriver.c @@ -0,0 +1,112 @@ +/**************************************************************************** + * fs/driver/fs_registerdriver.c + * + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/types.h" +#include "errno.h" + +#include "fs/fs.h" + +#include "inode/inode.h" +#include "string.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: register_driver + * + * Description: + * Register a character driver inode the pseudo file system. + * + * Input Parameters: + * path - The path to the inode to create + * fops - The file operations structure + * mode - inmode priviledges (not used) + * priv - Private, user data that will be associated with the inode. + * + * Returned Value: + * Zero on success (with the inode point in 'inode'); A negated errno + * value is returned on a failure (all error values returned by + * inode_reserve): + * + * EINVAL - 'path' is invalid for this operation + * EEXIST - An inode already exists at 'path' + * ENOMEM - Failed to allocate in-memory resources for the operation + * + ****************************************************************************/ + +int register_driver(FAR const char *path, FAR const struct file_operations_vfs *fops, + mode_t mode, FAR void *priv) +{ + FAR struct inode *node; + int ret; + + if (path == NULL || strlen(path) >= PATH_MAX || strncmp("/dev/", path, DEV_PATH_LEN) != 0) + { + return -EINVAL; + } + + /* Insert a dummy node -- we need to hold the inode semaphore because we + * will have a momentarily bad structure. + */ + + inode_semtake(); + ret = inode_reserve(path, &node); + if (ret >= 0) + { + /* We have it, now populate it with driver specific information. + * NOTE that the initial reference count on the new inode is zero. + */ + + INODE_SET_DRIVER(node); + + node->u.i_ops = fops; +#ifdef LOSCFG_FILE_MODE + node->i_mode = mode & (S_IRWXU|S_IRWXG|S_IRWXO); +#endif + node->i_private = priv; + ret = OK; + } + + inode_semgive(); + return ret; +} diff --git a/fs/driver/fs_unregisterblockdriver.c b/fs/driver/fs_unregisterblockdriver.c new file mode 100755 index 0000000..27a9110 --- /dev/null +++ b/fs/driver/fs_unregisterblockdriver.c @@ -0,0 +1,73 @@ +/**************************************************************************** + * fs/driver/fs_unregisterblockdriver.c + * + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "fs/fs.h" + +#include "inode/inode.h" +#include "string.h" +#include "errno.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: unregister_blockdriver + * + * Description: + * Remove the block driver inode at 'path' from the pseudo-file system + * + ****************************************************************************/ + +int unregister_blockdriver(const char *path) +{ + int ret; + + if (path == NULL || strlen(path) >= PATH_MAX || strncmp("/dev/", path, DEV_PATH_LEN) != 0) + { + return EINVAL; + } + + inode_semtake(); + ret = inode_remove(path); + inode_semgive(); + return ret; +} diff --git a/fs/driver/fs_unregisterdriver.c b/fs/driver/fs_unregisterdriver.c new file mode 100755 index 0000000..2870efa --- /dev/null +++ b/fs/driver/fs_unregisterdriver.c @@ -0,0 +1,73 @@ +/**************************************************************************** + * fs/driver/fs_unregisterdriver.c + * + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "fs/fs.h" + +#include "inode/inode.h" +#include "string.h" +#include "errno.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: unregister_driver + * + * Description: + * Remove the character driver inode at 'path' from the pseudo-file system + * + ****************************************************************************/ + +int unregister_driver(FAR const char *path) +{ + int ret; + + if (path == NULL || strlen(path) >= PATH_MAX || strncmp("/dev/", path, DEV_PATH_LEN) != 0) + { + return -EINVAL; + } + + inode_semtake(); + ret = inode_remove(path); + inode_semgive(); + return ret; +} diff --git a/fs/fs_initialize.c b/fs/fs_initialize.c new file mode 100755 index 0000000..c742c07 --- /dev/null +++ b/fs/fs_initialize.c @@ -0,0 +1,62 @@ +/**************************************************************************** + * fs/fs_initialize.c + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "inode.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: fs_initialize + * + * Description: + * This is called from the OS initialization logic to configure the file + * system. + * + ****************************************************************************/ + +void fs_initialize(void) +{ + /* Initial inode, file, and VFS data structures */ + + inode_initialize(); +} diff --git a/fs/inode/fs_files.c b/fs/inode/fs_files.c new file mode 100755 index 0000000..b8bd5ab --- /dev/null +++ b/fs/inode/fs_files.c @@ -0,0 +1,1001 @@ +/**************************************************************************** + * fs/inode/fs_files.c + * + * Copyright (C) 2007-2009, 2011-2013, 2016-2017 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include "unistd.h" +#include "vfs_config.h" + +#include "sys/types.h" +#include "string.h" +#include "semaphore.h" +#include "assert.h" +#include "errno.h" + +#include "fs/fs.h" +#include "fs/file.h" +#include "stdio.h" +#include "stdlib.h" +#include "inode/inode.h" +#include "los_mux.h" +#include "fs/fd_table.h" +#ifdef LOSCFG_NET_LWIP_SACK +#include "lwip/sockets.h" +#include "fs_file.h" +#endif +#include "los_process_pri.h" +#include "los_vm_filemap.h" +#define ferr PRINTK + +#if CONFIG_NFILE_DESCRIPTORS > 0 +struct filelist tg_filelist; +#endif + +#if CONFIG_NFILE_STREAMS > 0 +struct streamlist tg_streamlist; +#endif + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +struct filelist *sched_getfiles(void) +{ +#if CONFIG_NFILE_DESCRIPTORS > 0 + return &tg_filelist; +#else + return NULL; +#endif +} + +/* 32: An unsigned int takes 32 bits */ + +static unsigned int bitmap[CONFIG_NFILE_DESCRIPTORS / 32 + 1] = {0}; + +static void set_bit(int i, void *addr) +{ + unsigned int tem = (unsigned int)i >> 5; /* Get the bitmap subscript */ + unsigned int *addri = (unsigned int *)addr + tem; + unsigned int old = *addri; + old = old | (1UL << ((unsigned int)i & 0x1f)); /* set the new map bit */ + *addri = old; +} + +static void clear_bit(int i, void *addr) +{ + unsigned int tem = (unsigned int)i >> 5; /* Get the bitmap subscript */ + unsigned int *addri = (unsigned int *)addr + tem; + unsigned int old = *addri; + old = old & ~(1UL << ((unsigned int)i & 0x1f)); /* Clear the old map bit */ + *addri = old; +} + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: _files_semtake + ****************************************************************************/ + +static void _files_semtake(FAR struct filelist *list) +{ + /* Take the semaphore (perhaps waiting) */ + + while (sem_wait(&list->fl_sem) != 0) + { + /* The only case that an error should occur here is if the wait was + * awakened by a signal. + */ + + LOS_ASSERT(get_errno() == EINTR); + } +} + +/**************************************************************************** + * Name: _files_semgive + ****************************************************************************/ + +#define _files_semgive(list) (void)sem_post(&list->fl_sem) + +/**************************************************************************** + * Name: _files_close + * + * Description: + * Close an inode (if open) + * + * Assumuptions: + * Caller holds the list semaphore because the file descriptor will be freed. + * + ****************************************************************************/ + +static int _files_close(FAR struct file *filep) +{ + struct inode *inode = filep->f_inode; + int ret = OK; + + /* Check if the struct file is open (i.e., assigned an inode) */ + + if (inode) + { + if (filep->f_oflags & O_DIRECTORY) + { + ret = closedir(filep->f_dir); + if (ret != OK) + { + return ret; + } + } + else + { + /* Close the file, driver, or mountpoint. */ + + if (inode->u.i_ops && inode->u.i_ops->close) + { + /* Perform the close operation */ + + ret = inode->u.i_ops->close(filep); + if (ret != OK) + { + return ret; + } + } + } + + /* And release the inode */ + + inode_release(inode); + + /* Release the path of file */ + + free(filep->f_path); + + /* Release the file descriptor */ + + filep->f_magicnum = 0; + filep->f_oflags = 0; + filep->f_pos = 0; + filep->f_path = NULL; + filep->f_priv = NULL; + filep->f_inode = NULL; + filep->f_refcount = 0; + filep->f_mapping = NULL; + filep->f_dir = NULL; + } + + return ret; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: files_initialize + * + * Description: + * This is called from the FS initialization logic to configure the files. + * + ****************************************************************************/ + +void files_initialize(void) +{ +} + +/**************************************************************************** + * Name: files_initlist + * + * Description: Initializes the list of files for a new task + * + ****************************************************************************/ + +void files_initlist(FAR struct filelist *list) +{ + DEBUGASSERT(list); + + /* Initialize the list access mutex */ + + (void)sem_init(&list->fl_sem, 0, 1); +} + +/**************************************************************************** + * Name: files_releaselist + * + * Description: + * Release a reference to the file list + * + ****************************************************************************/ + +void files_releaselist(FAR struct filelist *list) +{ + int i; + + DEBUGASSERT(list); + + /* Close each file descriptor .. Normally, you would need take the list + * semaphore, but it is safe to ignore the semaphore in this context because + * there should not be any references in this context. + */ + + for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) + { + (void)_files_close(&list->fl_files[i]); + } + + /* Destroy the semaphore */ + + (void)sem_destroy(&list->fl_sem); +} + +/**************************************************************************** + * Name: file_dup2 + * + * Description: + * Assign an inode to a specific files structure. This is the heart of + * dup2. + * + * Equivalent to the non-standard fs_dupfd2() function except that it + * accepts struct file instances instead of file descriptors and it does + * not set the errno variable. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is return on + * any failure. + * + ****************************************************************************/ + +int file_dup2(FAR struct file *filep1, FAR struct file *filep2) +{ + FAR struct filelist *list = NULL; + FAR struct inode *inode_ptr = NULL; + char *fullpath = NULL; + const char *relpath = NULL; + int err; + int len; + int ret; + struct inode_search_s desc; + + if (!filep1 || !filep1->f_inode || !filep2) + { + err = EBADF; + goto errout; + } + + list = sched_getfiles(); + DEBUGASSERT(list); + /* The file list can be NULL under two cases: (1) One is an obscure + * cornercase: When memory management debug output is enabled. Then + * there may be attempts to write to stdout from malloc before the group + * data has been allocated. The other other is (2) if this is a kernel + * thread. Kernel threads have no allocated file descriptors. + */ + + if (list != NULL) + { + _files_semtake(list); + } + + /* If there is already an inode contained in the new file structure, + * close the file and release the inode. + */ + + ret = _files_close(filep2); + if (ret < 0) + { + /* An error occurred while closing the driver */ + + goto errout_with_ret; + } + + len = strlen(filep1->f_path); + if ((len == 0) || (len >= PATH_MAX)) + { + ret = -EINVAL; + goto errout_with_ret; + } + + fullpath = (char *)zalloc(len + 1); + if (fullpath == NULL) + { + ret = -ENOMEM; + goto errout_with_ret; + } + + /* Increment the reference count on the contained inode */ + + inode_ptr = filep1->f_inode; + + /* Then clone the file structure */ + + filep2->f_oflags = filep1->f_oflags; + filep2->f_pos = filep1->f_pos; + filep2->f_inode = inode_ptr; + filep2->f_priv = filep1->f_priv; + + (void)strncpy_s(fullpath, len + 1, filep1->f_path, len); + SETUP_SEARCH(&desc, fullpath, false); + if (inode_find(&desc) < 0) + { + ret = -EACCES; + free(fullpath); + goto errout_with_ret; + } + relpath = desc.relpath; + filep2->f_path = fullpath; + filep2->f_relpath = relpath; + + /* Call the open method on the file, driver, mountpoint so that it + * can maintain the correct open counts. + */ + + if (inode_ptr->u.i_ops) + { +#ifndef CONFIG_DISABLE_MOUNTPOINT + if (INODE_IS_MOUNTPT(inode_ptr)) + { + /* Dup the open file on the in the new file structure */ + + if (inode_ptr->u.i_mops->dup) + { + ret = inode_ptr->u.i_mops->dup(filep1, filep2); + } + else + { + ret = -ENOSYS; + } + } + else +#endif + { + /* (Re-)open the pseudo file or device driver */ + + if (inode_ptr->u.i_ops->open) + { + ret = inode_ptr->u.i_ops->open(filep2); + } + else + { + ret = -ENOSYS; + } + } + + /* Handle open failures */ + + if (ret < 0) + { + goto errout_with_inode; + } + } + + if (list != NULL) + { + _files_semgive(list); + } + return OK; + + /* Handle various error conditions */ + +errout_with_inode: + + inode_release(filep2->f_inode); + free(filep2->f_path); + filep2->f_oflags = 0; + filep2->f_pos = 0; + filep2->f_inode = NULL; + filep2->f_priv = NULL; + filep2->f_path = NULL; + filep2->f_relpath = NULL; + +errout_with_ret: + err = -ret; + _files_semgive(list); + +errout: + set_errno(err); + return VFS_ERROR; +} + +#define FILE_START_FD 3 + +static inline unsigned int files_magic_generate(void) +{ + static unsigned int files_magic = 0; + return files_magic++; +} + +/**************************************************************************** + * Name: files_allocate + * + * Description: + * Allocate a struct files instance and associate it with an inode instance. + * Returns the file descriptor == index into the files array. + * + ****************************************************************************/ + +int files_allocate(FAR struct inode *inode_ptr, int oflags, off_t pos,void* priv, int minfd) +{ + FAR struct filelist *list = NULL; + unsigned int *p = NULL; + unsigned int mask; + unsigned int i; + struct files_struct *process_files = NULL; + + /* minfd should be a positive number,and 0,1,2 had be distributed to stdin,stdout,stderr */ + + if (minfd < FILE_START_FD) + { + minfd = FILE_START_FD; + } + i = (unsigned int)minfd; + + list = sched_getfiles(); + DEBUGASSERT(list); + + _files_semtake(list); + + while (i < CONFIG_NFILE_DESCRIPTORS) + { + p = ((unsigned int *)bitmap) + (i >> 5); /* Gets the location in the bitmap */ + mask = 1 << (i & 0x1f); /* Gets the mask for the current bit int bitmap */ + if ((~(*p) & mask)) + { + set_bit(i, bitmap); + list->fl_files[i].f_oflags = oflags; + list->fl_files[i].f_pos = pos; + list->fl_files[i].f_inode = inode_ptr; + list->fl_files[i].f_priv = priv; + list->fl_files[i].f_refcount = 1; + list->fl_files[i].f_mapping = NULL; + list->fl_files[i].f_dir = NULL; + list->fl_files[i].f_magicnum = files_magic_generate(); + process_files = OsCurrProcessGet()->files; + if (process_files) + { + FD_SET(i, process_files->fdt->open_fds); + } + else + { + PRINT_ERR("process files is NULL, %s %d\n", __FUNCTION__ ,__LINE__); + _files_semgive(list); + return VFS_ERROR; + } + _files_semgive(list); + return (int)i; + } + i++; + } + + + _files_semgive(list); + return VFS_ERROR; +} + +static int files_close_internal(int fd, LosProcessCB *processCB) +{ + FAR struct filelist *list = NULL; + int ret = OK; + struct files_struct *process_files = NULL; + + /* 0,1,2 fd is not opened in system, no need to close them */ + + if ((fd >= STDIN_FILENO) && (fd <= STDERR_FILENO)) + { + return OK; + } + + /* Get the thread-specific file list. It should never be NULL in this + * context. + */ + + list = sched_getfiles(); + DEBUGASSERT(list != NULL); + + /* If the file was properly opened, there should be an inode assigned */ + + if (fd < 0 || fd >= CONFIG_NFILE_DESCRIPTORS || !list->fl_files[fd].f_inode) + { + return -EBADF; + } + + /* Perform the protected close operation */ + + _files_semtake(list); + process_files = processCB->files; + if (process_files) + { + FD_CLR(fd, process_files->fdt->open_fds); + } + else + { + PRINT_ERR("process files is NULL, %s %d\n", __FUNCTION__ ,__LINE__); + _files_semgive(list); + return -EINVAL; + } + if (list->fl_files[fd].f_mapping) + { + OsFileCacheFlush(list->fl_files[fd].f_mapping); + dec_mapping(list->fl_files[fd].f_mapping); + } + list->fl_files[fd].f_refcount--; + + /* The filep->f_refcount may not be zero here, when the filep is shared in parent-child processes. + so, upon closing the filep in current process, relevant region must be released immediately */ + + OsVmmFileRegionFree(&list->fl_files[fd], processCB); + + if (list->fl_files[fd].f_refcount == 0) + { + ret = _files_close(&list->fl_files[fd]); + if (ret == OK) + { + clear_bit(fd, bitmap); + } + } + + _files_semgive(list); + return ret; +} + +/**************************************************************************** + * Name: files_close + * + * Description: + * Close an inode (if open) + * + * Assumuptions: + * Caller holds the list semaphore because the file descriptor will be freed. + * + ****************************************************************************/ + +int files_close(int fd) +{ + return files_close_internal(fd, OsCurrProcessGet()); +} + +/**************************************************************************** + * Name: files_release + * + * Assumuptions: + * Similar to files_close(). Called only from open() logic on error + * conditions. + * + ****************************************************************************/ + +void files_release(int fd) +{ + FAR struct filelist *list = NULL; + struct files_struct *process_files = NULL; + + list = sched_getfiles(); + DEBUGASSERT(list); + + if (fd >=0 && fd < CONFIG_NFILE_DESCRIPTORS) + { + _files_semtake(list); + + list->fl_files[fd].f_magicnum = 0; + list->fl_files[fd].f_oflags = 0; + list->fl_files[fd].f_inode = NULL; + list->fl_files[fd].f_pos = 0; + list->fl_files[fd].f_refcount = 0; + list->fl_files[fd].f_path = NULL; + list->fl_files[fd].f_relpath = NULL; + list->fl_files[fd].f_priv = NULL; + list->fl_files[fd].f_mapping = NULL; + list->fl_files[fd].f_dir = NULL; + + process_files = OsCurrProcessGet()->files; + if (process_files) + { + FD_CLR(fd, process_files->fdt->open_fds); + } + clear_bit(fd, bitmap); + _files_semgive(list); + } +} + +struct inode * files_get_openfile(int fd) +{ + FAR struct filelist *list = NULL; + unsigned int *p = NULL; + unsigned int mask; + + list = sched_getfiles(); + DEBUGASSERT(list); + + p = ((unsigned int *)bitmap) + ((unsigned int)fd >> 5); /* Gets the location in the bitmap */ + mask = 1 << ((unsigned int)fd & 0x1f); /* Gets the mask for the current bit int bitmap */ + if ((~(*p) & mask)) + { + return NULL; + } + + return list->fl_files[fd].f_inode; +} + +int alloc_fd(int minfd) +{ + FAR struct filelist *list = NULL; + unsigned int *p = NULL; + unsigned int mask; + unsigned int i; + + /* minfd should be a positive number,and 0,1,2 had be distributed to stdin,stdout,stderr */ + + if (minfd < FILE_START_FD) + { + minfd = FILE_START_FD; + } + i = (unsigned int)minfd; + + list = sched_getfiles(); + DEBUGASSERT(list); + + _files_semtake(list); + + while (i < CONFIG_NFILE_DESCRIPTORS) + { + p = ((unsigned int *)bitmap) + (i >> 5); /* Gets the location in the bitmap */ + mask = 1 << (i & 0x1f); /* Gets the mask for the current bit int bitmap */ + if ((~(*p) & mask)) + { + set_bit(i, bitmap); + _files_semgive(list); + return (int)i; + } + i++; + } + _files_semgive(list); + return VFS_ERROR; +} + +void clear_fd(int fd) +{ + clear_bit(fd, bitmap); +} + +int close_files(struct inode *inode) +{ + int fd = 0; + int ret = 0; + FAR struct inode *open_file_inode = NULL; + + for (fd = FILE_START_FD; fd < CONFIG_NFILE_DESCRIPTORS; fd++) + { + open_file_inode = files_get_openfile(fd); + if (open_file_inode && (open_file_inode == inode)) + { + ret = files_close(fd); + if (ret < 0) + { + return -EBUSY; + } + } + } + + return 0; +} + +void files_refer(int fd) +{ + FAR struct filelist *list = sched_getfiles(); + if (!list || fd < 0 || fd >= CONFIG_NFILE_DESCRIPTORS) + { + return; + } + _files_semtake(list); + list->fl_files[fd].f_refcount++; + _files_semgive(list); +} + +static void copy_fds(const struct fd_table_s *new_fdt, const struct fd_table_s *old_fdt) +{ + unsigned int sz; + + sz = new_fdt->max_fds * sizeof(struct file_table_s); + if (sz) + { + (void)memcpy_s(new_fdt->ft_fds, sz, old_fdt->ft_fds, sz); + } + (void)memcpy_s(new_fdt->open_fds, sizeof(fd_set), old_fdt->open_fds, sizeof(fd_set)); + (void)memcpy_s(new_fdt->proc_fds, sizeof(fd_set), old_fdt->proc_fds, sizeof(fd_set)); +} + +static void copy_fd_table(struct fd_table_s *new_fdt, struct fd_table_s *old_fdt) +{ + copy_fds((const struct fd_table_s *)new_fdt, (const struct fd_table_s *)old_fdt); + for (int i = 0; i < new_fdt->max_fds; i++) + { + if (FD_ISSET(i, new_fdt->open_fds)) + { + files_refer(i); + } +#if defined(LOSCFG_NET_LWIP_SACK) + if (FD_ISSET(i, new_fdt->proc_fds)) + { + int sysFd = GetAssociatedSystemFd(i); + if (sysFd >= CONFIG_NFILE_DESCRIPTORS && sysFd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS)) + { + socks_refer(sysFd); + } + } +#endif + } +} + +static struct fd_table_s * alloc_fd_table(unsigned int numbers) +{ + struct fd_table_s *fdt; + void *data; + + fdt = LOS_MemAlloc(m_aucSysMem0, sizeof(struct fd_table_s)); + if (!fdt) + { + goto out; + } + fdt->max_fds = numbers; + if (!numbers) + { + fdt->ft_fds = NULL; + fdt->open_fds = NULL; + fdt->proc_fds = NULL; + return fdt; + } + data = LOS_MemAlloc(m_aucSysMem0, numbers * sizeof(struct file_table_s)); + if (!data) + { + goto out_fdt; + } + fdt->ft_fds = data; + + /* 0,1,2 be distributed to stdin,stdout,stderr default */ + fdt->ft_fds[STDIN_FILENO].sysFd = STDIN_FILENO; + fdt->ft_fds[STDOUT_FILENO].sysFd = STDOUT_FILENO; + fdt->ft_fds[STDERR_FILENO].sysFd = STDERR_FILENO; + for (int i = STDERR_FILENO + 1; i < numbers; i++) + { + fdt->ft_fds[i].sysFd = -1; + } + + data = LOS_MemAlloc(m_aucSysMem0, sizeof(fd_set)); + if (!data) + { + goto out_arr; + } + (VOID)memset_s(data, sizeof(fd_set), 0, sizeof(fd_set)); + fdt->open_fds = data; + FD_SET(STDIN_FILENO, fdt->open_fds); + FD_SET(STDOUT_FILENO, fdt->open_fds); + FD_SET(STDERR_FILENO, fdt->open_fds); + + data = LOS_MemAlloc(m_aucSysMem0, sizeof(fd_set)); + if (!data) + { + goto out_all; + } + (VOID)memset_s(data, sizeof(fd_set), 0, sizeof(fd_set)); + fdt->proc_fds = data; + FD_SET(STDIN_FILENO, fdt->proc_fds); + FD_SET(STDOUT_FILENO, fdt->proc_fds); + FD_SET(STDERR_FILENO, fdt->proc_fds); + + (void)sem_init(&fdt->ft_sem, 0, 1); + + return fdt; + +out_all: + (VOID)LOS_MemFree(m_aucSysMem0, fdt->open_fds); +out_arr: + (VOID)LOS_MemFree(m_aucSysMem0, fdt->ft_fds); +out_fdt: + (VOID)LOS_MemFree(m_aucSysMem0, fdt); +out: + return NULL; +} + +struct files_struct *alloc_files(void) +{ + struct files_struct *files = LOS_MemAlloc(m_aucSysMem0, sizeof(struct files_struct)); + if (!files) + { + ferr("malloc file_struct error\n"); + return NULL; + } + files->count = 1; + files->file_lock = 0; + files->next_fd = 3; +#ifdef VFS_USING_WORKDIR + spin_lock_init(&files->workdir_lock); + memset_s(files->workdir, PATH_MAX, 0, PATH_MAX); + files->workdir[0] = '/'; +#endif + files->fdt = alloc_fd_table(NR_OPEN_DEFAULT); + if (!files->fdt) + { + ferr("malloc fdt error\n"); + (VOID)LOS_MemFree(m_aucSysMem0, files); + return NULL; + } + + return files; +} + +struct files_struct *dup_fd(struct files_struct *old_files) +{ + struct fd_table_s *old_fdt = NULL; + struct fd_table_s *new_fdt = NULL; + struct files_struct *files = NULL; + if((old_files == NULL) || (old_files->fdt == NULL) || (old_files->fdt->max_fds == 0)) + { + return alloc_files(); + } + files = LOS_MemAlloc(m_aucSysMem0, sizeof(struct files_struct)); + if(!files) + { + ferr("malloc file_struct error\n"); + return NULL; + } + files->count = 1; + files->file_lock = 0; + files->next_fd = old_files->next_fd; +#ifdef VFS_USING_WORKDIR + spin_lock_init(&files->workdir_lock); + memset_s(files->workdir, PATH_MAX, 0, PATH_MAX); + strncpy_s(files->workdir, PATH_MAX - 1, old_files->workdir, PATH_MAX - 1); +#endif + old_fdt = old_files->fdt; + new_fdt = alloc_fd_table(old_fdt->max_fds); + if(new_fdt == NULL) + { + PRINT_ERR("alloc fd_table failed\n"); + (VOID)LOS_MemFree(m_aucSysMem0, files); + return NULL; + } + copy_fd_table(new_fdt, old_fdt); + files->fdt = new_fdt; + + return files; +} + +/**************************************************************************** + * Name: delete_files + * + * Description: + * Close a processCB's files specified by processCB and files + * + * Assumuptions: + * processCB->files may != files and processCB may != current processCB. + * + ****************************************************************************/ +void delete_files(LosProcessCB *processCB, struct files_struct *files) +{ + if (files == NULL || processCB == NULL) + { + return; + } + + if (files->fdt == NULL) + { + goto out_file; + } + + for (int i = 0; i < files->fdt->max_fds; i++) + { + if (FD_ISSET(i, files->fdt->open_fds)) + { + files_close_internal(i, processCB); + } +#if defined(LOSCFG_NET_LWIP_SACK) + if (FD_ISSET(i, files->fdt->proc_fds)) + { + int sysFd = GetAssociatedSystemFd(i); + if (sysFd >= CONFIG_NFILE_DESCRIPTORS && sysFd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS)) + { + close(sysFd); + } + } +#endif + } + + (VOID)sem_destroy(&files->fdt->ft_sem); + (VOID)LOS_MemFree(m_aucSysMem0, files->fdt->ft_fds); + (VOID)LOS_MemFree(m_aucSysMem0, files->fdt->open_fds); + (VOID)LOS_MemFree(m_aucSysMem0, files->fdt->proc_fds); + (VOID)LOS_MemFree(m_aucSysMem0, files->fdt); +out_file: + (VOID)LOS_MemFree(m_aucSysMem0, files); + return; +} + +struct files_struct *create_files_snapshot(const struct files_struct *old_files) +{ + struct fd_table_s *old_fdt = NULL; + struct fd_table_s *new_fdt = NULL; + struct files_struct *files = NULL; + if ((old_files == NULL) || (old_files->fdt == NULL) || (old_files->fdt->max_fds == 0)) + { + return NULL; + } + files = LOS_MemAlloc(m_aucSysMem0, sizeof(struct files_struct)); + if (!files) + { + PRINT_ERR("malloc file_struct error\n"); + return NULL; + } + files->count = 1; + files->file_lock = 0; + files->next_fd = old_files->next_fd; +#ifdef VFS_USING_WORKDIR + spin_lock_init(&files->workdir_lock); + memset_s(files->workdir, PATH_MAX, 0, PATH_MAX); + strncpy_s(files->workdir, PATH_MAX - 1, old_files->workdir, PATH_MAX - 1); +#endif + old_fdt = old_files->fdt; + new_fdt = alloc_fd_table(old_fdt->max_fds); + if (new_fdt == NULL) + { + PRINT_ERR("alloc fd_table failed\n"); + (VOID)LOS_MemFree(m_aucSysMem0, files); + return NULL; + } + copy_fds((const struct fd_table_s *)new_fdt, (const struct fd_table_s *)old_fdt); + files->fdt = new_fdt; + + return files; + +} + +void delete_files_snapshot(struct files_struct *files) +{ + if (files == NULL) + { + return; + } + if (files->fdt == NULL) + { + goto out_file; + } + + (VOID)sem_destroy(&files->fdt->ft_sem); + (VOID)LOS_MemFree(m_aucSysMem0, files->fdt->ft_fds); + (VOID)LOS_MemFree(m_aucSysMem0, files->fdt->open_fds); + (VOID)LOS_MemFree(m_aucSysMem0, files->fdt->proc_fds); + (VOID)LOS_MemFree(m_aucSysMem0, files->fdt); +out_file: + (VOID)LOS_MemFree(m_aucSysMem0, files); + return; +} diff --git a/fs/inode/fs_foreachinode.c b/fs/inode/fs_foreachinode.c new file mode 100755 index 0000000..70d6be5 --- /dev/null +++ b/fs/inode/fs_foreachinode.c @@ -0,0 +1,231 @@ +/**************************************************************************** + * fs/inode/fs_foreachinode.c + * + * Copyright (C) 2012-2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "stdio.h" +#include "stdlib.h" +#include "string.h" +#include "errno.h" +#include "fs/fs.h" +#include "inode/inode.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Is it better to allocate the struct inode_path_s from the heap? or + * from the stack? This decision depends on how often this is down and + * how much stack space you can afford. + */ + +#define ENUM_INODE_ALLOC 1 + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/* This structure manages the full path to the inode. */ + +struct inode_path_s +{ + foreach_inode_t handler; + FAR void *arg; + char path[CONFIG_PATH_MAX]; +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: foreach_inodelevel + * + * Description: + * This is the recursive 'heart' of foreach_inode. It will visit each + * inode at this level in the hierarchy and recurse handle each inode + * at the next level down. + * + * Assumptions: + * The caller holds the inode semaphore. + * + ****************************************************************************/ + +static int foreach_inodelevel(FAR struct inode *node, struct inode_path_s *info) +{ + int ret = OK; + + /* Visit each node at this level */ + + for (; node; node = node->i_peer) + { + /* Give the next inode to the callback */ + + ret = info->handler(node, info->path, info->arg); + + /* Break out of the loop early if the handler returns a non-zero + * value. + */ + + if (ret != 0) + { + break; + } + + /* If there is a level 'beneath' this one, then recurse to visit all + * of the inodes at that level. + */ + + if (node->i_child) + { + /* Construct the path to the next level */ + + int pathlen = strlen(info->path); + int namlen = strlen(node->i_name) + 1; + + /* Make sure that this would not exceed the maximum path length */ + + if (pathlen + namlen >= PATH_MAX) + { + ret = -ENAMETOOLONG; + break; + } + + /* Append the path segment to this inode and recurse */ + + ret = snprintf_s(&info->path[pathlen], CONFIG_PATH_MAX - pathlen, + CONFIG_PATH_MAX - pathlen - 1, "/%s", node->i_name); + if (ret < 0) + { + ret = -ENAMETOOLONG; + break; + } + + ret = foreach_inodelevel(node->i_child, info); + + /* Truncate the path name back to the correct length */ + + info->path[pathlen] = '\0'; + + /* Return early if the handler at the lower level returned a non- + * zero value + */ + + if (ret != 0) + { + break; + } + } + } + + /* Return the result of the traversal. */ + + return ret; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ +/**************************************************************************** + * Name: foreach_inode + * + * Description: + * Visit each inode in the pseudo-file system. The traversal is terminated + * when the callback 'handler' returns a non-zero value, or when all of + * the inodes have been visited. + * + * NOTE 1: Use with caution... The pseudo-file system is locked throughout + * the traversal. + * NOTE 2: The search algorithm is recursive and could, in principle, use + * an indeterminant amount of stack space. This will not usually be a + * real work issue. + * + ****************************************************************************/ + +int foreach_inode(foreach_inode_t handler, FAR void *arg) +{ +#ifdef ENUM_INODE_ALLOC + FAR struct inode_path_s *info; + int ret; + + /* Allocate the mountpoint info structure */ + + info = (FAR struct inode_path_s *)malloc(sizeof(struct inode_path_s)); + if (!info) + { + return -ENOMEM; + } + + /* Initialize the info structure */ + + info->handler = handler; + info->arg = arg; + info->path[0] = '\0'; + + /* Start the recursion at the root inode */ + + inode_semtake(); + ret = foreach_inodelevel(g_root_inode, info); + inode_semgive(); + + /* Free the info structure and return the result */ + + free(info); + return ret; + +#else + struct inode_path_s info; + int ret; + + /* Initialize the info structure */ + + info.handler = handler; + info.arg = arg; + info.path[0] = '\0'; + + /* Start the recursion at the root inode */ + + inode_semtake(); + ret = foreach_inodelevel(g_root_inode, &info); + inode_semgive(); + + return ret; + +#endif +} + diff --git a/fs/inode/fs_inode.c b/fs/inode/fs_inode.c new file mode 100755 index 0000000..76d43b0 --- /dev/null +++ b/fs/inode/fs_inode.c @@ -0,0 +1,188 @@ +/**************************************************************************** + * fs/inode/fs_inode.c + * + * Copyright (C) 2007-2009, 2011-2012, 2016-2017 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "assert.h" +#include "errno.h" +#include "semaphore.h" +#include "stdlib.h" +#include "fs/fs.h" +#include "unistd.h" + +#include "inode/inode.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define NO_HOLDER ((pid_t)-1) + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/* Implements a re-entrant mutex for inode access. This must be re-entrant + * because there can be cycles. For example, it may be necessary to destroy + * a block driver inode on umount() after a removable block device has been + * removed. In that case umount() holds the inode semaphore, but the block + * driver may callback to unregister_blockdriver() after the un-mount, + * requiring the semaphore again. + */ + +struct inode_sem_s +{ + sem_t sem; /* The semaphore */ + pid_t holder; /* The current holder of the semaphore */ + int16_t count; /* Number of counts held */ +}; + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static struct inode_sem_s g_inode_sem; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: inode_initialize + * + * Description: + * This is called from the OS initialization logic to configure the file + * system. + * + ****************************************************************************/ + +void inode_initialize(void) +{ + /* Initialize the semaphore to one (to support one-at-a-time access to the + * inode tree). + */ + + (void)sem_init(&g_inode_sem.sem, 0, 1); + g_inode_sem.holder = NO_HOLDER; + g_inode_sem.count = 0; + + /* Initialize files array (if it is used) */ + +#ifdef CONFIG_HAVE_WEAKFUNCTIONS + if (files_initialize != NULL) +#endif + { + files_initialize(); + } +} + +/**************************************************************************** + * Name: inode_semtake + * + * Description: + * Get exclusive access to the in-memory inode tree (g_inode_sem). + * + ****************************************************************************/ + +void inode_semtake(void) +{ + pid_t me; + + /* Do we already hold the semaphore? */ + + me = getpid(); + if (me == g_inode_sem.holder) + { + /* Yes... just increment the count */ + + g_inode_sem.count++; + DEBUGASSERT(g_inode_sem.count > 0); + } + + /* Take the semaphore (perhaps waiting) */ + + else + { + while (sem_wait(&g_inode_sem.sem) != 0) + { + /* The only case that an error should occur here is if the wait + * was awakened by a signal. + */ + + LOS_ASSERT(get_errno() == EINTR); + } + + /* No we hold the semaphore */ + + g_inode_sem.holder = me; + g_inode_sem.count = 1; + } +} + +/**************************************************************************** + * Name: inode_semgive + * + * Description: + * Relinquish exclusive access to the in-memory inode tree (g_inode_sem). + * + ****************************************************************************/ + +void inode_semgive(void) +{ + DEBUGASSERT(g_inode_sem.holder == getpid()); + + /* Is this our last count on the semaphore? */ + + if (g_inode_sem.count > 1) + { + /* No.. just decrement the count */ + + g_inode_sem.count--; + } + + /* Yes.. then we can really release the semaphore */ + + else + { + g_inode_sem.holder = NO_HOLDER; + g_inode_sem.count = 0; + (void)sem_post(&g_inode_sem.sem); + } +} diff --git a/fs/inode/fs_inodeaddref.c b/fs/inode/fs_inodeaddref.c new file mode 100755 index 0000000..11040ce --- /dev/null +++ b/fs/inode/fs_inodeaddref.c @@ -0,0 +1,67 @@ +/**************************************************************************** + * fs/inode/fs_inodeaddref.c + * + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include "inode/inode.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: inode_addref + * + * Description: + * Increment the reference count on an inode (as when a file descriptor + * is dup'ed). + * + ****************************************************************************/ + +void inode_addref(FAR struct inode *inode) +{ + if (inode) + { + inode_semtake(); + inode->i_crefs++; + inode_semgive(); + } +} diff --git a/fs/inode/fs_inodefind.c b/fs/inode/fs_inodefind.c new file mode 100755 index 0000000..98d7240 --- /dev/null +++ b/fs/inode/fs_inodefind.c @@ -0,0 +1,93 @@ +/**************************************************************************** + * fs/inode/fs_inodefind.c + * + * Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "inode/inode.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: inode_find + * + * Description: + * This is called from the open() logic to get a reference to the inode + * associated with a path. This is accomplished by calling inode_search(). + * inode_find() is a simple wrapper around inode_search(). The primary + * difference between inode_find() and inode_search is that inode_find() + * will lock the inode tree and increment the reference count on the inode. + * + ****************************************************************************/ + +int inode_find(FAR struct inode_search_s *desc) +{ + int ret; + FAR const char *path = desc->path; + FAR const char **relpath = &(desc->relpath); + FAR struct inode **peer = &(desc->peer); + FAR struct inode **parent = &(desc->parent); + /* Find the node matching the path. If found, increment the count of + * references on the node. + */ + + inode_semtake(); + desc->node = inode_search(&path, peer, parent, relpath); + if (desc->node != NULL) + { + /* Found it */ + + FAR struct inode *node = desc->node; + + /* Increment the reference count on the inode */ + + node->i_crefs++; + ret = 0; + } + else + { + ret = -1; + } + inode_semgive(); + return ret; +} \ No newline at end of file diff --git a/fs/inode/fs_inoderelease.c b/fs/inode/fs_inoderelease.c new file mode 100755 index 0000000..2e1a3d7 --- /dev/null +++ b/fs/inode/fs_inoderelease.c @@ -0,0 +1,91 @@ +/**************************************************************************** + * fs/inode/fs_inoderelease.c + * + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "errno.h" +#include "stdlib.h" +#include "fs/fs.h" +#include "inode/inode.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: inode_release + * + * Description: + * This is called from close() logic when it no longer refers to the inode. + * + ****************************************************************************/ + +void inode_release(FAR struct inode *node) +{ + if (node) + { + /* Decrement the references of the inode */ + + inode_semtake(); + if (node->i_crefs) + { + node->i_crefs--; + } + + /* If the subtree was previously deleted and the reference + * count has decrement to zero, then delete the inode + * now. + */ + + if (node->i_crefs <= 0 && (node->i_flags & FSNODEFLAG_DELETED) != 0) + { + /* If the inode has been properly unlinked, then the peer pointer + * should be NULL. + */ + + inode_free(node->i_child); + (void)LOS_MemFree(m_aucSysMem0, node); + inode_semgive(); + } + else + { + inode_semgive(); + } + } +} + diff --git a/fs/inode/fs_inoderemove.c b/fs/inode/fs_inoderemove.c new file mode 100755 index 0000000..2e5d885 --- /dev/null +++ b/fs/inode/fs_inoderemove.c @@ -0,0 +1,169 @@ +/**************************************************************************** + * fs/inode/fs_inoderemove.c + * + * Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "errno.h" +#include "stdlib.h" +#include "fs/fs.h" +#include "inode/inode.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: inode_unlink + * + * Description: + * Given a path, remove a the node from the in-memory, inode tree that the + * path refers to. This is normally done in preparation to removing or + * moving an inode. + * + * In symbolic links in the pseduo file system are enabled, then this + * logic will follow the symbolic links up until the terminal node. Then + * that link in removed. So if this the terminal node is a symbolic link, + * the symbolic link node will be removed, not the target of the link. + * + * Assumptions/Limitations: + * The caller must hold the inode semaphore + * + ****************************************************************************/ + +FAR struct inode *inode_unlink(FAR const char *path) +{ + const char *name = path; + FAR struct inode *node; + FAR struct inode *peer; + FAR struct inode *parent; + + /* Verify parameters. Ignore null paths and relative paths */ + + if (path == NULL || *path == '\0' || path[0] != '/') + { + return NULL; + } + + /* Find the node to unlink */ + + node = inode_search(&name, &peer, &parent, (const char **)NULL); + if (node) + { + /* If peer is non-null, then remove the node from the right of + * of that peer node. + */ + + if (peer) + { + peer->i_peer = node->i_peer; + } + + /* If parent is non-null, then remove the node from head of + * of the list of children. + */ + + else if (parent) + { + parent->i_child = node->i_peer; + } + + /* Otherwise, we must be removing the root inode. */ + + else + { + g_root_inode = node->i_peer; + } + + node->i_peer = NULL; + } + + return node; +} + +/**************************************************************************** + * Name: inode_remove + * + * Description: + * Given a path, remove a the node from the in-memory, inode tree that the + * path refers to and free all resources related to the inode. If the + * inode is in-use, then it will be unlinked, but will not be freed until + * the last reference to the inode is released. + * + * Assumptions/Limitations: + * The caller must hold the inode semaphore + * + ****************************************************************************/ + +int inode_remove(FAR const char *path) +{ + FAR struct inode *node; + + /* Find the inode and unlink it from the in-memory inode tree */ + + node = inode_unlink(path); + if (node) + { + /* Found it! But we cannot delete the inode if there are references + * to it + */ + + if (node->i_crefs) + { + /* In that case, we will mark it deleted, when the filesystem + * releases the inode, we will then, finally delete the subtree + */ + + node->i_flags |= FSNODEFLAG_DELETED; + return -EBUSY; + } + else + { + /* And delete it now -- recursively to delete all of its children. + * Since it has been unlinked, then the peer pointer should be NULL. + */ + + inode_free(node->i_child); + (void)LOS_MemFree(m_aucSysMem0, node); + return OK; + } + } + + /* The node does not exist */ + + return -ENOENT; +} diff --git a/fs/inode/fs_inodereserve.c b/fs/inode/fs_inodereserve.c new file mode 100755 index 0000000..d905bf7 --- /dev/null +++ b/fs/inode/fs_inodereserve.c @@ -0,0 +1,320 @@ +/**************************************************************************** + * fs/inode/fs_registerreserve.c + * + * Copyright (C) 2007-2009, 2011-2012, 2015, 2017 Gregory Nutt. All + * rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "assert.h" +#include "errno.h" + +#include "stdlib.h" +#include "fs/fs.h" +#include "fs/dirent_fs.h" +#include "string.h" +#include "inode/inode.h" +#include "capability_api.h" +#include "fs_other.h" + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: check_name + ****************************************************************************/ + +static bool check_name(FAR const char *name) +{ + while (*name != '\0') + { + if ((*name == '/') && *(name+1) != '\0') + { + return false; + } + name ++; + } + return true; +} + +/**************************************************************************** + * Name: inode_namelen + ****************************************************************************/ + +static int inode_namelen(FAR const char *name) +{ + const char *tmp = name; + while (*tmp && *tmp != '/') + { + tmp++; + } + + return tmp - name; +} + +/**************************************************************************** + * Name: inode_namecpy + ****************************************************************************/ + +static void inode_namecpy(char *dest, const char *src) +{ + while (*src && *src != '/') + { + *dest++ = *src++; + } + + *dest = '\0'; +} + +/**************************************************************************** + * Name: inode_alloc + ****************************************************************************/ + +static FAR struct inode *inode_alloc(FAR const char *name) +{ + FAR struct inode *node; + int namelen; + + namelen = inode_namelen(name); + node = (FAR struct inode*)LOS_MemAlloc(m_aucSysMem0, FSNODE_SIZE(namelen)); + if (node) + { + (void)memset_s(node, FSNODE_SIZE(namelen), 0, FSNODE_SIZE(namelen)); + inode_namecpy(node->i_name, name); + } + + return node; +} + +/**************************************************************************** + * Name: IsInRootfs + ****************************************************************************/ + +bool IsInRootfs(const char *relpath) +{ + bool ret = true; + char *name = NULL; + char *path = NULL; + struct stat statInfo; + + if ((!g_root_inode->u.i_mops) || (!g_root_inode->u.i_mops->stat)) { + return false; + } + + name = strdup(relpath); + if (name) { + path = strsep(&name, "/"); + if (g_root_inode->u.i_mops->stat(g_root_inode, path, &statInfo) == -ENOENT) { + ret = false; + } + free(path); + } + + return ret; +} + +/**************************************************************************** + * Name: inode_insert + ****************************************************************************/ + +static void inode_insert(FAR struct inode *node, + FAR struct inode *peer, + FAR struct inode *parent) +{ + /* If peer is non-null, then new node simply goes to the right + * of that peer node. + */ + + if (peer) + { + node->i_peer = peer->i_peer; + peer->i_peer = node; + } + + /* If parent is non-null, then it must go at the head of its + * list of children. + */ + + else if (parent) + { + node->i_peer = parent->i_child; + parent->i_child = node; + } + + /* Otherwise, this must be the new root_inode */ + + else + { + node->i_peer = g_root_inode; + g_root_inode = node; + } +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: inode_reserve + * + * Description: + * Reserve an (initialized) inode the pseudo file system. The initial + * reference count on the new inode is zero. + * + * Input Parameters: + * path - The path to the inode to create + * inode - The location to return the inode pointer + * + * Returned Value: + * Zero on success (with the inode point in 'inode'); A negated errno + * value is returned on failure: + * + * EINVAL - 'path' is invalid for this operation + * EEXIST - An inode already exists at 'path' + * ENOMEM - Failed to allocate in-memory resources for the operation + * + * Assumptions: + * Caller must hold the inode semaphore + * + ****************************************************************************/ + +int inode_reserve(FAR const char *path, FAR struct inode **inode_ptr) +{ + FAR const char *name = path; + FAR const char *relpath; + FAR struct inode *pathnode; + FAR struct inode *left; + FAR struct inode *parent; + + /* Assume failure */ + + DEBUGASSERT(path && inode_ptr); + *inode_ptr = NULL; + + /* Handle paths that are interpreted as the root directory */ + + if (!*path || path[0] != '/') + { + return -EINVAL; + } + + /* Find the location to insert the new subtree */ + + pathnode = inode_search(&name, &left, &parent, &relpath); + if (pathnode) + { + if (!*(relpath)) + { + /* It is an error if the node already exists in the tree */ + + return -EEXIST; + } +#ifndef CONFIG_DISABLE_MOUNTPOINT + else if (INODE_IS_MOUNTPT(pathnode)) + { + if ((pathnode != g_root_inode) || IsInRootfs(relpath)) + { + /* The node cannot be a child of a mounted point, except the root node. */ + + return -EINVAL; + } + } +#endif + } + else + { + /* not find pathnode and the node is not g_root_inode express you have no access authority */ + + if (g_root_inode != NULL) + { + return -EACCES; + } + } + + if (check_name(name) == false) + { + /* check the path has no '/' symbol, prevent to create multilevel directory */ + + return -EINVAL; + } + + /* Now we now where to insert the subtree */ + + for (; ; ) + { + FAR struct inode *node; + + /* Create a new node -- we need to know if this is the + * the leaf node or some intermediary. We can find this + * by looking at the next name. + */ + + FAR const char *next_name = inode_nextname(name); + if (*next_name) + { + /* Insert an operationless node */ + + node = inode_alloc(name); + if (node) + { + inode_insert(node, left, parent); + + /* Set up for the next time through the loop */ + + name = next_name; + left = NULL; + parent = node; + continue; + } + } + else + { + node = inode_alloc(name); + if (node) + { + inode_insert(node, left, parent); + *inode_ptr = node; + return OK; + } + } + + /* We get here on failures to allocate node memory */ + + return -ENOMEM; + } +} \ No newline at end of file diff --git a/fs/inode/fs_inodesearch.c b/fs/inode/fs_inodesearch.c new file mode 100755 index 0000000..6864e0c --- /dev/null +++ b/fs/inode/fs_inodesearch.c @@ -0,0 +1,338 @@ +/**************************************************************************** + * fs/inode/fs_inodesearch.c + * + * Copyright (C) 2007-2009, 2011-2012, 2016-2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "assert.h" +#include "errno.h" +#include "semaphore.h" +#include "stdlib.h" +#include "fs/fs.h" + +#include "fs_other.h" +#include "inode/inode.h" +/**************************************************************************** + * Public Data + ****************************************************************************/ + +FAR struct inode *g_root_inode = NULL; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: _inode_compare + * + * Description: + * Compare two inode names + * + ****************************************************************************/ + +static int _inode_compare(FAR const char *fname, FAR struct inode *node) +{ + char *nname = node->i_name; + + if (!nname) + { + return 1; + } + + if (!fname) + { + return -1; + } + + for (; ; ) + { + /* At the end of the node name? */ + + if (!*nname) + { + /* Yes.. also at the end of find name? */ + + if (!*fname || *fname == '/') + { + /* Yes.. return match */ + + return 0; + } + else + { + /* No... return find name > node name */ + + return 1; + } + } + + /* At end of the find name? */ + + else if (!*fname || *fname == '/') + { + /* Yes... return find name < node name */ + + return -1; + } + + /* Check for non-matching characters */ + + else if (*fname > *nname) + { + return 1; + } + else if (*fname < *nname) + { + return -1; + } + + /* Not at the end of either string and all of the + * characters still match. keep looking. + */ + + else + { + fname++; + nname++; + } + } +} + + + +/**************************************************************************** + * Name: inode_search + * + * Description: + * Find the inode associated with 'path' returning the inode references + * and references to its companion nodes. + * + * Assumptions: + * The caller holds the g_inode_sem semaphore + * + * TODO: Nuttx 8.2 inode_search() uses struct inode_search_s as parameter + ****************************************************************************/ + +FAR struct inode *inode_search(FAR const char **path, + FAR struct inode **peer, + FAR struct inode **parent, + FAR const char **relpath) +{ + FAR const char *name = *path; + FAR struct inode *ret_inode = NULL; + FAR struct inode *node = g_root_inode; + FAR struct inode *left = NULL; + FAR struct inode *above = NULL; + + while (node) + { + int result = _inode_compare(name, node); + + /* Case 1: The name is less than the name of the node. + * Since the names are ordered, these means that there + * is no peer node with this name and that there can be + * no match in the fileystem. + */ + + if (result < 0) + { + node = NULL; + break; + } + + /* Case 2: the name is greater than the name of the node. + * In this case, the name may still be in the list to the + * "right" + */ + + else if (result > 0) + { + left = node; + node = node->i_peer; + } + + /* The names match */ + + else + { + /* Now there are three more possibilities: + * (1) This is the node that we are looking for or, + * (2) The node we are looking for is "below" this one. + * (3) This node is a mountpoint and will absorb all request + * below this one + */ + + name = inode_nextname(name); + + if (!INODE_IS_MOUNTPT(g_root_inode)) + { + /* This g_root_inode is not a mountpoint and will handle the + * remaining part of the pathname + */ + + if (relpath != NULL) + { + ret_inode = node; + *relpath = name; + } + } + + if (INODE_IS_MOUNTPT(node)) + { + /* This node is a mountpoint and will handle the + * remaining part of the pathname + */ + + if (relpath != NULL) + { + ret_inode = node; + *relpath = name; + } + } + + if (!*name) + { + /* We are at the end of the path, so this must be the + * node we are looking for + */ + ret_inode = node; + if (relpath != NULL) + { + *relpath = name; + } + break; + } + else + { + /* More to go, keep looking at the next level "down" */ + above = node; + left = NULL; + if ((g_root_inode != NULL) && VfsPermissionCheck(node->i_uid, node->i_gid, node->i_mode, EXEC_OP)) + { + /* If g_root_inode has set and node has not execution authority, while break */ + + ret_inode = NULL; + node = NULL; + break; + } + + node = node->i_child; + } + } + } + + /* The node may or may not be null as per one of the following four cases + * cases: + * + * With node = NULL + * + * (1) We went left past the final peer: The new node name is larger + * than any existing node name at that level. + * (2) We broke out in the middle of the list of peers because the name + * was not found in the ordered list. + * (3) We went down past the final parent: The new node name is + * "deeper" than anything that we currently have in the tree. + * + * With node != NULL + * + * (4) When the node matching the full path is found + */ + + if (peer != NULL) + { + *peer = left; + } + + if (parent != NULL) + { + *parent = above; + } + + *path = name; + return ret_inode; +} + +/**************************************************************************** + * Name: inode_free + * + * Description: + * Free resources used by an inode + * + ****************************************************************************/ + +void inode_free(FAR struct inode *node) +{ + if (node != NULL) + { + inode_free(node->i_peer); + inode_free(node->i_child); + (VOID)LOS_MemFree(m_aucSysMem0, node); + } +} + +/**************************************************************************** + * Name: inode_nextname + * + * Description: + * Given a path with node names separated by '/', return the next path + * segment name. + * + ****************************************************************************/ + +FAR const char *inode_nextname(FAR const char *name) +{ + /* Search for the '/' delimiter or the NUL terminator at the end of the + * path segment. + */ + + while (*name != '\0' && *name != '/') + { + name++; + } + + /* If we found the '/' delimiter, then the path segment we want begins at + * the next character (which might also be the NUL terminator). + */ + + while (*name == '/') + { + name++; + } + + return name; +} diff --git a/fs/inode/inode.h b/fs/inode/inode.h new file mode 100755 index 0000000..671d56f --- /dev/null +++ b/fs/inode/inode.h @@ -0,0 +1,482 @@ +/**************************************************************************** + * fs/inode/inode.h + * + * Copyright (C) 2007, 2009, 2012, 2014, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __FS_INODE_H +#define __FS_INODE_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "sys/types.h" +#include "dirent.h" +#include "limits.h" +#include "fs/fs.h" +#include "fs/file.h" +#include "fs/fs_operation.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#define DEV_PATH_LEN 5 + + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Inode i_flag values */ + +#define FSNODEFLAG_TYPE_MASK 0x00000007 /* Isolates type field */ +#define FSNODEFLAG_TYPE_DRIVER 0x00000000 /* Character driver */ +#define FSNODEFLAG_TYPE_BLOCK 0x00000001 /* Block driver */ +#define FSNODEFLAG_TYPE_MOUNTPT 0x00000002 /* Mount point */ +#define FSNODEFLAG_TYPE_SPECIAL 0x00000004 /* Special OS type */ +#define FSNODEFLAG_TYPE_NAMEDSEM 0x00000004 /* Named semaphore */ +#define FSNODEFLAG_TYPE_MQUEUE 0x00000005 /* Message Queue */ +#define FSNODEFLAG_TYPE_SHM 0x00000006 /* Shared memory region */ +#define FSNODEFLAG_DELETED 0x00000008 /* Unlinked */ + +#define INODE_IS_TYPE(i,t) \ + (((i)->i_flags & FSNODEFLAG_TYPE_MASK) == (t)) +#define INODE_IS_SPECIAL(i) \ + (((i)->i_flags & FSNODEFLAG_TYPE_SPECIAL) != 0) + +#define INODE_IS_DRIVER(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_DRIVER) +#define INODE_IS_BLOCK(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_BLOCK) +#define INODE_IS_MOUNTPT(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_MOUNTPT) +#define INODE_IS_NAMEDSEM(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_NAMEDSEM) +#define INODE_IS_MQUEUE(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_MQUEUE) +#define INODE_IS_SHM(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_SHM) + +#define INODE_GET_TYPE(i) ((i)->i_flags & FSNODEFLAG_TYPE_MASK) +#define INODE_SET_TYPE(i,t) \ + do \ + { \ + (i)->i_flags = ((i)->i_flags & ~FSNODEFLAG_TYPE_MASK) | (t); \ + } \ + while (0) + +#define INODE_SET_DRIVER(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_DRIVER) +#define INODE_SET_BLOCK(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_BLOCK) +#define INODE_SET_MOUNTPT(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_MOUNTPT) +#define INODE_SET_NAMEDSEM(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_NAMEDSEM) +#define INODE_SET_MQUEUE(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_MQUEUE) +#define INODE_SET_SHM(i) INODE_SET_TYPE(i,FSNODEFLAG_TYPE_SHM) + +/* Mountpoint fd_flags values */ + +#define DIRENTFLAGS_PSEUDONODE 1 + +#define DIRENT_SETPSEUDONODE(f) do (f) |= DIRENTFLAGS_PSEUDONODE; while (0) +#define DIRENT_ISPSEUDONODE(f) (((f) & DIRENTFLAGS_PSEUDONODE) != 0) + +#ifdef CONFIG_PSEUDOFS_SOFTLINKS + +# define SETUP_SEARCH(d,p,n) \ + do \ + { \ + (d)->path = (p); \ + (d)->node = NULL; \ + (d)->peer = NULL; \ + (d)->parent = NULL; \ + (d)->relpath = NULL; \ + (d)->linktgt = NULL; \ + (d)->buffer = NULL; \ + (d)->nofollow = (n); \ + } \ + while (0) + +# define RELEASE_SEARCH(d) \ + if ((d)->buffer != NULL) \ + { \ + kmm_free((d)->buffer); \ + (d)->buffer = NULL; \ + } + +#else + +# define SETUP_SEARCH(d,p,n) \ + do \ + { \ + (d)->path = (p); \ + (d)->node = NULL; \ + (d)->peer = NULL; \ + (d)->parent = NULL; \ + (d)->relpath = NULL; \ + } \ + while (0) + +# define RELEASE_SEARCH(d) + +#endif + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* This is the type of the argument to inode_search(). + * + * path - INPUT: Path of inode to find + * OUTPUT: Residual part of path not traversed + * node - INPUT: (not used) + * OUTPUT: On success, holds the pointer to the inode found. + * peer - INPUT: (not used) + * OUTPUT: The inode to the "left" of the inode found. + * parent - INPUT: (not used) + * OUTPUT: The inode to the "above" of the inode found. + * relpath - INPUT: (not used) + * OUTPUT: If the returned inode is a mountpoint, this is the + * relative path from the mountpoint. + * linktgt - INPUT: (not used) + * OUTPUT: If a symobolic link into a mounted file system is + * detected while traversing the path, then the link + * will be converted to a mountpoint inode if the + * mountpoint link is in an intermediate node of the + * path or at the final node of the path with nofollow=true. + * nofollow - INPUT: true: terminal node is returned; false: if the + * terminal is a soft link, then return the inode of + * the link target. + * - OUTPUT: (not used) + * buffer - INPUT: Not used + * - OUTPUT: May hold an allocated intermediate path which is + * probably of no interest to the caller unless it holds + * the relpath. + */ + +struct inode_search_s +{ + FAR const char *path; /* Path of inode to find */ + FAR struct inode *node; /* Pointer to the inode found */ + FAR struct inode *peer; /* Node to the "left" for the found inode */ + FAR struct inode *parent; /* Node "above" the found inode */ + FAR const char *relpath; /* Relative path into the mountpoint */ +#ifdef CONFIG_PSEUDOFS_SOFTLINKS + FAR const char *linktgt; /* Target of symbolic link if linked to a directory */ + FAR char *buffer; /* Path expansion buffer */ + bool nofollow; /* true: Don't follow terminal soft link */ +#endif +}; + +/* Callback used by foreach_inode to traverse all inodes in the pseudo- + * file system. + */ + +typedef int (*foreach_inode_t)(FAR struct inode *node, + FAR char dirpath[PATH_MAX], + FAR void *arg); + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +extern FAR struct inode *g_root_inode; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: inode_initialize + * + * Description: + * This is called from the OS initialization logic to configure the file + * system. + * + ****************************************************************************/ + +void inode_initialize(void); + +/**************************************************************************** + * Name: inode_semtake + * + * Description: + * Get exclusive access to the in-memory inode tree (tree_sem). + * + ****************************************************************************/ + +void inode_semtake(void); + +/**************************************************************************** + * Name: inode_semgive + * + * Description: + * Relinquish exclusive access to the in-memory inode tree (tree_sem). + * + ****************************************************************************/ + +void inode_semgive(void); + +/**************************************************************************** + * Name: inode_search + * + * Description: + * Find the inode associated with 'path' returning the inode references + * and references to its companion nodes. + * + * If a mountpoint is encountered in the search prior to encountering the + * terminal node, the search will terminate at the mountpoint inode. That + * inode and the relative path from the mountpoint, 'relpath' will be + * returned. + * + * inode_search will follow soft links in path leading up to the terminal + * node. Whether or no inode_search() will deference that terminal node + * depends on the 'nofollow' input. + * + * If a soft link is encountered that is not the terminal node in the path, + * that link WILL be deferenced unconditionally. + * + * Assumptions: + * The caller holds the g_inode_sem semaphore + * + ****************************************************************************/ + +FAR struct inode *inode_search(FAR const char **path, + FAR struct inode **peer, + FAR struct inode **parent, + FAR const char **relpath); + +/**************************************************************************** + * Name: inode_find + * + * Description: + * This is called from the open() logic to get a reference to the inode + * associated with a path. This is accomplished by calling inode_search(). + * inode_find() is a simple wrapper around inode_search(). The primary + * difference between inode_find() and inode_search is that inode_find() + * will lock the inode tree and increment the reference count on the inode. + * + ****************************************************************************/ + +int inode_find(FAR struct inode_search_s *desc); + +/**************************************************************************** + * Name: inode_stat + * + * Description: + * The inode_stat() function will obtain information about an 'inode' in + * the pseudo file system and will write it to the area pointed to by 'buf'. + * + * The 'buf' argument is a pointer to a stat structure, as defined in + * , into which information is placed concerning the file. + * + * Input Parameters: + * inode - The indoe of interest + * buf - The caller provide location in which to return information about + * the inode. + * + * Returned Value: + * Zero (OK) returned on success. Otherwise, a negated errno value is + * returned to indicate the nature of the failure. + * + ****************************************************************************/ + +struct stat; /* Forward reference */ +int inode_stat(FAR struct inode *inode, FAR struct stat *buf); + +/**************************************************************************** + * Name: inode_free + * + * Description: + * Free resources used by an inode + * + ****************************************************************************/ + +void inode_free(FAR struct inode *node); + +/**************************************************************************** + * Name: inode_nextname + * + * Description: + * Given a path with node names separated by '/', return the next node + * name. + * + ****************************************************************************/ + +const char *inode_nextname(FAR const char *name); + +bool IsInRootfs(const char *relpath); + +/**************************************************************************** + * Name: inode_reserve + * + * Description: + * Reserve an (initialized) inode the pseudo file system. + * + * NOTE: Caller must hold the inode semaphore + * + * Input Parameters: + * path - The path to the inode to create + * inode - The location to return the inode pointer + * + * Returned Value: + * Zero on success (with the inode point in 'inode'); A negated errno + * value is returned on failure: + * + * EINVAL - 'path' is invalid for this operation + * EEXIST - An inode already exists at 'path' + * ENOMEM - Failed to allocate in-memory resources for the operation + * + ****************************************************************************/ + +int inode_reserve(FAR const char *path, FAR struct inode **inode); + +/**************************************************************************** + * Name: inode_unlink + * + * Description: + * Given a path, remove a the node from the in-memory, inode tree that the + * path refers to. This is normally done in preparation to removing or + * moving an inode. + * + * Assumptions/Limitations: + * The caller must hold the inode semaphore + * + ****************************************************************************/ + +FAR struct inode *inode_unlink(FAR const char *path); + +/**************************************************************************** + * Name: inode_remove + * + * Description: + * Given a path, remove a the node from the in-memory, inode tree that the + * path refers to and free all resources related to the inode. If the + * inode is in-use, then it will be unlinked, but will not be freed until + * the last reference to the inode is released. + * + * Assumptions/Limitations: + * The caller must hold the inode semaphore + * + ****************************************************************************/ + +int inode_remove(FAR const char *path); + +/**************************************************************************** + * Name: inode_addref + * + * Description: + * Increment the reference count on an inode (as when a file descriptor + * is dup'ed). + * + ****************************************************************************/ + +void inode_addref(FAR struct inode *inode); + +/**************************************************************************** + * Name: inode_release + * + * Description: + * This is called from close() logic when it no longer refers to the inode. + * + ****************************************************************************/ + +void inode_release(FAR struct inode *inode); + +/**************************************************************************** + * Name: foreach_inode + * + * Description: + * Visit each inode in the pseudo-file system. The traversal is terminated + * when the callback 'handler' returns a non-zero value, or when all of + * the inodes have been visited. + * + * NOTE 1: Use with caution... The pseudo-file system is locked throughout + * the traversal. + * NOTE 2: The search algorithm is recursive and could, in principle, use + * an indeterminant amount of stack space. This will not usually be a + * real work issue. + * + ****************************************************************************/ + +int foreach_inode(foreach_inode_t handler, FAR void *arg); + +/**************************************************************************** + * Name: files_initialize + * + * Description: + * This is called from the FS initialization logic to configure the files. + * + ****************************************************************************/ + +void weak_function files_initialize(void); + +/**************************************************************************** + * Name: files_allocate + * + * Description: + * Allocate a struct files instance and associate it with an inode instance. + * Returns the file descriptor == index into the files array. + * + ****************************************************************************/ + +int files_allocate(FAR struct inode *inode, int oflags, off_t pos,void *priv, int minfd); + +/**************************************************************************** + * Name: files_close + * + * Description: + * Close an inode (if open) + * + * Assumuptions: + * Caller holds the list semaphore because the file descriptor will be freed. + * + ****************************************************************************/ + +int files_close(int fd); + +/**************************************************************************** + * Name: files_release + * + * Assumuptions: + * Similar to files_close(). Called only from open() logic on error + * conditions. + * + ****************************************************************************/ + +void files_release(int fd); + +int vfs_normalize_path(const char *directory, const char *filename, char **pathname); +int vfs_normalize_pathat(int fd, const char *filename, char **pathname); + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ +#endif /* __FS_INODE_H */ diff --git a/fs/mount/fs_foreachmountpoint.c b/fs/mount/fs_foreachmountpoint.c new file mode 100755 index 0000000..b219b27 --- /dev/null +++ b/fs/mount/fs_foreachmountpoint.c @@ -0,0 +1,173 @@ +/**************************************************************************** + * fs/mount/fs_foreachmountpoint.c + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/statfs.h" + +#include "stdio.h" +#include "stdlib.h" +#include "string.h" +#include "assert.h" +#include "errno.h" + +#include "fs/fs.h" + +#include "inode/inode.h" + +#ifndef CONFIG_DISABLE_MOUNTPOINT + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/* This structure just remembers the final consumer of the mountpoint + * information (and its argument). + */ + +struct enum_mountpoint_s +{ + foreach_mountpoint_t handler; + FAR void *arg; +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static int mountpoint_filter(FAR struct inode *node, + FAR char dirpath[PATH_MAX], FAR void *arg) +{ + FAR struct enum_mountpoint_s *info = (FAR struct enum_mountpoint_s *)arg; + struct statfs statbuf; + int pathlen; + int namlen; + int ret = OK; + + DEBUGASSERT(node && info && info->handler); + + /* Check if the inode is a mountpoint. Mountpoints must support statfs. + * If this one does not for some reason, then it will be ignored. + * + * The root node is a special case: It has no operations (u.i_mops == NULL) + */ + + if (INODE_IS_MOUNTPT(node) && node->u.i_mops && node->u.i_mops->statfs) + { + /* Yes... get the full path to the inode by concatenating the inode + * name and the path to the directory containing the inode. + */ + + pathlen = strlen(dirpath); + namlen = strlen(node->i_name) + 1; + + /* Make sure that this would not exceed the maximum path length */ + + if (pathlen + namlen >= PATH_MAX) + { + return -ENAMETOOLONG; + } + + /* Append the inode name to the directory path */ + + ret = snprintf_s(&dirpath[pathlen], PATH_MAX - pathlen, PATH_MAX - pathlen - 1, "/%s", node->i_name); + if (ret < 0) + { + return -ENAMETOOLONG; + } + + /* Get the status of the file system */ + + ret = node->u.i_mops->statfs(node, &statbuf); + if (ret == OK) + { + /* And pass the full path and file system status to the handler */ + + ret = info->handler(dirpath, &statbuf, info->arg); + } + + /* Truncate the path name back to the correct length */ + + dirpath[pathlen] = '\0'; + } + + return ret; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: foreach_mountpoint + * + * Description: + * Visit each mountpoint in the pseudo-file system. The traversal is + * terminated when the callback 'handler' returns a non-zero value, or when + * all of the mountpoints have been visited. + * + * This is just a front end "filter" to foreach_inode() that forwards only + * mountpoint inodes. It is intended to support the mount() command to + * when the mount command is used to enumerate mounts. + * + * NOTE 1: Use with caution... The pseudo-file system is locked throughout + * the traversal. + * NOTE 2: The search algorithm is recursive and could, in principle, use + * an indeterminant amount of stack space. This will not usually be a + * real work issue. + * + ****************************************************************************/ + +int foreach_mountpoint(foreach_mountpoint_t handler, FAR void *arg) +{ + struct enum_mountpoint_s info; + + /* Let foreach_inode do the real work */ + + info.handler = handler; + info.arg = arg; + + return foreach_inode(mountpoint_filter, (FAR void *)&info); +} + +#endif diff --git a/fs/mount/fs_mount.c b/fs/mount/fs_mount.c new file mode 100755 index 0000000..605916d --- /dev/null +++ b/fs/mount/fs_mount.c @@ -0,0 +1,392 @@ +/**************************************************************************** + * fs/mount/fs_mount.c + * + * Copyright (C) 2007-2009, 2011-2013, 2015, 2017-2019 Gregory Nutt. All + * rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/mount.h" +#include "string.h" +#include "errno.h" +#include "assert.h" +#include "debug.h" + +#include "fs/fs.h" + +#include "inode/inode.h" +#include "stdlib.h" +#include "driver/driver.h" +#if defined(LOSCFG_FS_JFFS) +#include "mtd_partition.h" +#endif +#ifdef LOSCFG_FS_FAT_VIRTUAL_PARTITION +#include "errcode_fat.h" +#endif +#include "los_tables.h" + +/* At least one filesystem must be defined, or this file will not compile. + * It may be desire-able to make filesystems dynamically registered at + * some time in the future, but at present, this file needs to know about + * every configured filesystem. + */ + +#ifdef CONFIG_FS_READABLE + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ +/* In the canonical case, a file system is bound to a block driver. However, + * some less typical cases a block driver is not required. Examples are + * pseudo file systems (like BINFS or PROCFS) and MTD file systems (like NXFFS). + * + * These file systems all require block drivers: + */ + +#define BLKDRVR_NOT_MOUNTED 2 + +extern struct fsmap_t g_fsmap[]; +LOS_HAL_TABLE_BEGIN(g_fsmap, fsmap); + +extern struct fsmap_t g_fsmap_end; +LOS_HAL_TABLE_END(g_fsmap_end, fsmap); + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mount_findfs + * + * Description: + * find the specified filesystem + * + ****************************************************************************/ + +static const struct fsmap_t *mount_findfs(const char *filesystemtype) +{ + struct fsmap_t *m = NULL; + + for (m = &g_fsmap[0]; m != &g_fsmap_end; ++m) + { + if (m->fs_filesystemtype && + strcmp(filesystemtype, m->fs_filesystemtype) == 0) + { + return m; + } + } + + return (const struct fsmap_t *)NULL; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mount + * + * Description: + * mount() attaches the filesystem specified by the 'source' block device + * name into the root file system at the path specified by 'target.' + * + * Return: + * Zero is returned on success; -1 is returned on an error and errno is + * set appropriately: + * + * EACCES A component of a path was not searchable or mounting a read-only + * filesystem was attempted without giving the MS_RDONLY flag. + * EBUSY 'source' is already mounted. + * EFAULT One of the pointer arguments points outside the user address + * space. + * EINVAL 'source' had an invalid superblock. + * ENODEV 'filesystemtype' not configured + * ENOENT A pathname was empty or had a nonexistent component. + * ENOMEM Could not allocate a memory to copy filenames or data into. + * ENOTBLK 'source' is not a block device + * + ****************************************************************************/ + +int mount(const char *source, const char *target, + const char *filesystemtype, unsigned long mountflags, + const void *data) +{ + int ret; + void *fshandle = NULL; + int errcode = 0; + char *fullpath = NULL; + char *fullpath_bak = NULL; + + struct inode *blkdrvr_inode = NULL; + struct inode *mountpt_inode = NULL; + const struct fsmap_t *fsmap = NULL; + const struct mountpt_operations *mops = NULL; + +#if defined(LOSCFG_FS_JFFS) + mtd_partition *partition = NULL; +#endif + + if (filesystemtype == NULL) + { + errcode = EINVAL; + goto errout; + } + + /* Verify required pointer arguments */ + + DEBUGASSERT(target && filesystemtype); + + ret = vfs_normalize_path((const char *)NULL, target, &fullpath); + if (ret < 0) + { + PRINT_ERR("Failed to get fullpath,target: %s\n", target); + errcode = -ret; + goto errout; + } + fullpath_bak = fullpath; + + /* Find the specified filesystem. Try the block driver file systems first */ + + if ((fsmap = mount_findfs(filesystemtype)) == NULL || + (fsmap->is_bdfs && !source)) + { + PRINT_ERR("Failed to find file system %s\n", filesystemtype); + errcode = ENODEV; + free(fullpath_bak); + goto errout; + } + + mops = fsmap->fs_mops; + + if (fsmap->is_bdfs && source) + { + /* Make sure that a block driver argument was provided */ + + DEBUGASSERT(source); + + /* Find the block driver */ + + ret = find_blockdriver(source, mountflags, &blkdrvr_inode); + if (ret < 0) + { + PRINT_ERR("Failed to find block driver %s\n", source); + errcode = -ret; + free(fullpath_bak); + goto errout; + } + } + + /* Insert a dummy node -- we need to hold the inode semaphore + * to do this because we will have a momentarily bad structure. + */ + + inode_semtake(); + + mountpt_inode = inode_search((const char **)&fullpath, (struct inode **)NULL, (struct inode **)NULL, \ + (const char **)NULL); + + /* The mount point must be an existed inode. */ + + if (mountpt_inode == NULL) + { + PRINT_ERR("Failed to find valid mountpoint %s\n", target); + errcode = EINVAL; + goto errout_with_semaphore; + } + + /* The mount point must be a dangling node with no children and + * no operations. If this inode is mounted, or it has children + * (except "/"), or it has operations, it cannot be mounted. + */ + + if (INODE_IS_MOUNTPT(mountpt_inode) || (mountpt_inode->i_child && strcmp(target, "/")) || mountpt_inode->u.i_ops) + { + PRINT_ERR("Can't to mount to this inode %s\n", target); + errcode = EINVAL; + goto errout_with_semaphore; + } + + mountpt_inode ->mountflags = mountflags; + + /* Bind the block driver to an instance of the file system. The file + * system returns a reference to some opaque, fs-dependent structure + * that encapsulates this binding. + */ + + if (mops->bind == NULL) + { + /* The filesystem does not support the bind operation ??? */ + + fdbg("ERROR: Filesystem does not support bind\n"); + errcode = EINVAL; + goto errout_with_mountpt; + } + + /* Increment reference count for the reference we pass to the file system */ + + if (blkdrvr_inode != NULL) + { + blkdrvr_inode->i_crefs++; + + /* On failure, the bind method returns -errorcode */ + + if (blkdrvr_inode->e_status != STAT_UNMOUNTED) + { + fdbg("ERROR: The node is busy\n"); + errcode = EBUSY; + blkdrvr_inode->i_crefs--; + goto errout_with_mountpt; + } + } +#if defined(LOSCFG_FS_JFFS) + if (fsmap->is_mtd_support && (blkdrvr_inode != NULL)) + { + partition = (mtd_partition *)blkdrvr_inode->i_private; + partition->mountpoint_name = (char *)zalloc(strlen(target) + 1); + if (partition->mountpoint_name == NULL) + { + errcode = ENOMEM; + blkdrvr_inode->i_crefs--; + goto errout_with_mountpt; + } + + (void)strncpy_s(partition->mountpoint_name, strlen(target) + 1, target, strlen(target)); + partition->mountpoint_name[strlen(target)] = '\0'; + } +#endif + mountpt_inode ->mountflags = mountflags; + ret = mops->bind(blkdrvr_inode, data, &fshandle, fullpath_bak); +#ifdef LOSCFG_FS_FAT_VIRTUAL_PARTITION + if (ret >= VIRERR_BASE) + { + errcode = ret; + } + else +#endif + if (ret != 0) + { + /* The inode is unhappy with the blkdrvr for some reason. Back out + * the count for the reference we failed to pass and exit with an + * error. + */ + + fdbg("ERROR: Bind method failed: %d\n", ret); + if (blkdrvr_inode != NULL) + { + blkdrvr_inode->i_crefs--; + } + + errcode = -ret; +#if defined(LOSCFG_FS_JFFS) + if (fsmap->is_mtd_support && (blkdrvr_inode != NULL) && (partition != NULL)) + { + free(partition->mountpoint_name); + partition->mountpoint_name = NULL; + } +#endif + goto errout_with_mountpt; + } + + /* We have it, now populate it with driver specific information. */ + + INODE_SET_MOUNTPT(mountpt_inode); + + mountpt_inode->u.i_mops = mops; + mountpt_inode->i_private = fshandle; +#ifdef LOSCFG_FILE_MODE + struct stat statinfo = {0}; + if ((g_root_inode != mountpt_inode) && (stat(target, &statinfo) == 0)) + { + mountpt_inode->i_mode = statinfo.st_mode; + mountpt_inode->i_uid = statinfo.st_uid; + mountpt_inode->i_gid = statinfo.st_gid; + } + +#endif + + if (blkdrvr_inode) + { + blkdrvr_inode->e_status = STAT_MOUNTED; + } + inode_semgive(); + + /* We can release our reference to the blkdrver_inode, if the filesystem + * wants to retain the blockdriver inode (which it should), then it must + * have called inode_addref(). There is one reference on mountpt_inode + * that will persist until umount() is called. + */ + + if (blkdrvr_inode != NULL) + { + inode_release(blkdrvr_inode); + } + + free(fullpath_bak); + +#ifdef LOSCFG_FS_FAT_VIRTUAL_PARTITION + if (errcode >= VIRERR_BASE) + { + set_errno(errcode); + } +#endif + + return OK; + + /* A lot of goto's! But they make the error handling much simpler */ + +errout_with_mountpt: + (void)inode_remove(fullpath); + +errout_with_semaphore: + inode_semgive(); + if (blkdrvr_inode != NULL) + { + inode_release(blkdrvr_inode); + } + free(fullpath_bak); + +errout: + set_errno(errcode); + return VFS_ERROR; +} + +#endif /* CONFIG_FS_READABLE */ diff --git a/fs/mount/fs_umount.c b/fs/mount/fs_umount.c new file mode 100755 index 0000000..cdfaf9b --- /dev/null +++ b/fs/mount/fs_umount.c @@ -0,0 +1,238 @@ +/**************************************************************************** + * fs/mount/fs_umount.c + * + * Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/mount.h" +#include "errno.h" +#include "fs/fs.h" + +#include "inode/inode.h" +#include "stdlib.h" + +#include "string.h" +#include "disk.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Variables + ****************************************************************************/ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: umount + * + * Description: + * umount() detaches the filesystem mounted at the path specified by + * 'target.' + * + * Return: + * Zero is returned on success; -1 is returned on an error and errno is + * set appropriately: + * + * EACCES A component of a path was not searchable or mounting a read-only + * filesystem was attempted without giving the MS_RDONLY flag. + * EBUSY The target could not be unmounted because it is busy. + * EFAULT The pointer argument points outside the user address space. + * + ****************************************************************************/ + +int umount(const char *target) +{ + FAR struct inode *mountpt_inode = NULL; + FAR struct inode *blkdrvr_inode = NULL; + int errcode = OK; + int status; + char *fullpath = NULL; + const char *relpath = NULL; + struct inode_search_s desc; + int ret; + /* Verify required pointer arguments */ + + if (target == NULL) + { + errcode = EFAULT; + goto errout; + } + + /* Get a absolute path*/ + + errcode = vfs_normalize_path((const char *)NULL, target, &fullpath); + if (errcode < 0) + { + errcode = -errcode; + goto errout; + } + + /* Find the mountpt */ + SETUP_SEARCH(&desc, fullpath, false); + ret = inode_find(&desc); + if (ret < 0) + { + errcode = EACCES; + free(fullpath); + goto errout; + } + mountpt_inode = desc.node; + relpath = desc.relpath; + + /* Verify that the inode is a mountpoint */ + + if (!INODE_IS_MOUNTPT(mountpt_inode)) + { + errcode = EINVAL; + goto errout_with_mountpt; + } + + /* Verfy the path is a mountpoint path or file path*/ + + if ((relpath != NULL) && strlen(relpath)) + { + errcode = EPERM; + goto errout_with_mountpt; + } + + /* Unbind the block driver from the file system (destroying any fs + * private data. + */ + + if (mountpt_inode->u.i_mops->unbind == NULL) + { + /* The filesystem does not support the unbind operation ??? */ + + errcode = EINVAL; + goto errout_with_mountpt; + } + + inode_semtake(); /* Hold the semaphore through the unbind logic */ + if (mountpt_inode->i_crefs == 1) + { + status = mountpt_inode->u.i_mops->unbind(mountpt_inode->i_private, &blkdrvr_inode); + if (status < 0) + { + /* The inode is unhappy with the blkdrvr for some reason */ + + errcode = -status; + goto errout_with_semaphore; + } + else if (status > 0) + { + errcode = EBUSY; + goto errout_with_semaphore; + } + } + else + { + errcode = EBUSY; + goto errout_with_semaphore; + } + /* Successfully unbound */ + + mountpt_inode->i_private = NULL; + mountpt_inode->u.i_ops= (const struct file_operations_vfs *)NULL; + mountpt_inode->i_flags = 0; + + inode_release(mountpt_inode); + + /* Successfully unbound, remove the mountpoint inode from + * the inode tree. The inode will not be deleted yet because + * there is still at least reference on it (from the mount) + */ + + if (blkdrvr_inode) + { + blkdrvr_inode->e_status = STAT_UNMOUNTED; + } + + inode_semgive(); + + /* Did the unbind method return a contained block driver */ + + if (blkdrvr_inode) + { + inode_release(blkdrvr_inode); + } + + free(fullpath); + return OK; + + /* A lot of goto's! But they make the error handling much simpler */ + +errout_with_semaphore: + inode_semgive(); +errout_with_mountpt: + mountpt_inode->i_crefs--; + if (blkdrvr_inode) + { + inode_release(blkdrvr_inode); + } + free(fullpath); +errout: + set_errno(errcode); + return VFS_ERROR; +} + +int umount2(const char* __target, int __flags) +{ + /* TODO: __flags need to be support */ + if (__flags) { + set_errno(ENOSYS); + return VFS_ERROR; + } + return umount(__target); +} + diff --git a/fs/nfs/nfs.h b/fs/nfs/nfs.h new file mode 100755 index 0000000..b6328e7 --- /dev/null +++ b/fs/nfs/nfs.h @@ -0,0 +1,146 @@ +/**************************************************************************** + * fs/nfs/nfs.h + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved. + * Author: Jose Pablo Rojas Vargas + * Gregory Nutt + * + * Leveraged from OpenBSD: + * + * Copyright (c) 1989, 1993, 1995 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Rick Macklem at The University of Guelph. + * + * 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. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __FS_NFS_NFS_H +#define __FS_NFS_NFS_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "nfs_mount.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define NFS_TICKS 1 /* Number of system ticks */ +#define NFS_HZ CLOCKS_PER_SEC /* Ticks/sec */ +#define NFS_TIMEO (1 * NFS_HZ) /* Default timeout = 1 second */ +#define NFS_MINTIMEO (1 * NFS_HZ) /* Min timeout to use */ +#define NFS_MAXTIMEO (60 * NFS_HZ) /* Max timeout to backoff to */ +#define NFS_TIMEOUTMUL 2 /* Timeout/Delay multiplier */ +#define NFS_MAXREXMIT 10 /* Stop counting after this many */ +#define NFS_RETRANS 5 /* Num of retrans for soft mounts */ +#define NFS_WSIZE (8192 * 4) /* Def. write data size <= 8192 */ +#define NFS_RSIZE (8192 * 4) /* Def. read data size <= 8192 */ +#define NFS_READDIRSIZE 1024 /* Def. readdir size */ +#define NFS_NPROCS 23 + +/* Ideally, NFS_DIRBLKSIZ should be bigger, but I've seen servers with + * broken NFS/ethernet drivers that won't work with anything bigger (Linux..) + */ + +#define NFS_DIRBLKSIZ 1024 /* Must be a multiple of DIRBLKSIZ */ + +/* Increment NFS statistics */ + +#ifdef CONFIG_NFS_STATISTICS +# define nfs_statistics(n) do { nfsstats.rpccnt[n]++; } while (0) +#else +# define nfs_statistics(n) +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +typedef void (*NFSMOUNT_HOOK)(struct nfs_args*); +extern uint32_t nfs_true; +extern uint32_t nfs_false; +extern NFSMOUNT_HOOK g_NFSMOUNT_HOOK; +extern uint32_t nfs_xdrneg1; +#ifdef CONFIG_NFS_STATISTICS +extern struct nfsstats nfsstats; +#endif + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* NFS statistics structure */ + +struct nfsstats +{ + uint64_t rpccnt[NFS_NPROCS]; +}; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ +extern void nfs_mux_take(FAR struct nfsmount *nmp); +extern void nfs_mux_release(FAR struct nfsmount *nmp); +extern int nfs_checkmount(FAR struct nfsmount *nmp); +extern int nfs_fsinfo(FAR struct nfsmount *nmp); +extern int nfs_request(struct nfsmount *nmp, int procnum, + FAR void *request, size_t reqlen, + FAR void *response, size_t resplen); +extern int nfs_lookup(FAR struct nfsmount *nmp, FAR const char *filename, + FAR struct file_handle *fhandle, + FAR struct nfs_fattr *obj_attributes, + FAR struct nfs_fattr *dir_attributes); +extern int nfs_findnode(FAR struct nfsmount *nmp, FAR const char *relpath, + FAR struct file_handle *fhandle, + FAR struct nfs_fattr *obj_attributes, + FAR struct nfs_fattr *dir_attributes); +extern int nfs_finddir(FAR struct nfsmount *nmp, FAR const char *relpath, + FAR struct file_handle *fhandle, + FAR struct nfs_fattr *attributes, FAR char *filename); +extern void nfs_attrupdate(FAR struct nfsnode *np, + FAR struct nfs_fattr *attributes); +extern int nfs_mount(const char *server_ip_and_path, const char *mount_path, + unsigned int uid, unsigned int gid); + + +#ifdef __cplusplus +#if __cplusplus +} +#endif /*__cplusplus */ +#endif /*__cplusplus */ + +#endif /* _NFS_NFS_H */ diff --git a/fs/nfs/nfs_mount.h b/fs/nfs/nfs_mount.h new file mode 100755 index 0000000..59aa15e --- /dev/null +++ b/fs/nfs/nfs_mount.h @@ -0,0 +1,178 @@ +/**************************************************************************** + * fs/nfs/nfs_mount.h + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved. + * Author: Jose Pablo Rojas Vargas + * Gregory Nutt + * + * Leveraged from OpenBSD: + * + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Rick Macklem at The University of Guelph. + * + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __FS_NFS_NFS_MOUNT_H +#define __FS_NFS_NFS_MOUNT_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include "rpc.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* NFS mount option flags */ + +#define NFSMNT_SOFT (1 << 0) /* Soft mount (hard is default) */ +#define NFSMNT_WSIZE (1 << 1) /* Set write size */ +#define NFSMNT_RSIZE (1 << 2) /* Set read size */ +#define NFSMNT_TIMEO (1 << 3) /* Set initial timeout */ +#define NFSMNT_RETRANS (1 << 4) /* Set number of request retries */ +#define NFSMNT_READDIRSIZE (1 << 5) /* Set readdir size */ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* Mount structure. One mount structure is allocated for each NFS mount. This + * structure holds NFS specific information for mount. + */ + +struct nfsmount +{ + struct nfsnode *nm_head; /* A list of all files opened on this mountpoint */ + struct nfsdir_s *nm_dir; /* A list of all directories opened on this mountpoint */ + pthread_mutex_t nm_mux; /* Used to assure thread-safe access */ + nfsfh_t nm_fh; /* File handle of root dir */ + char nm_path[NFS_MOUNT_PATH_MAX_SIZE]; /* server's path of the directory being mounted */ + struct nfs_fattr nm_fattr; /* nfs file attribute cache */ + struct rpcclnt *nm_rpcclnt; /* RPC state */ + int32_t nm_so; /* RPC socket */ + struct sockaddr nm_nam; /* Addr of server */ + bool nm_mounted; /* true: The file system is ready */ + uint8_t nm_fhsize; /* Size of root file handle (host order) */ + uint8_t nm_sotype; /* Type of socket */ + uint8_t nm_retry; /* Max retries */ + uint32_t nm_timeo; /* Timeout value (in system clock ticks) */ + uint16_t nm_rsize; /* Max size of read RPC */ + uint16_t nm_wsize; /* Max size of write RPC */ + uint16_t nm_readdirsize; /* Size of a readdir RPC */ + uint16_t nm_buflen; /* Size of I/O buffer */ + + /* Set aside memory on the stack to hold the largest call message. NOTE + * that for the case of the write call message, it is the reply message that + * is in this union. + */ + + union + { + struct rpc_call_pmap pmap; + struct rpc_call_mount mountd; + struct rpc_call_create create; + struct rpc_call_lookup lookup; + struct rpc_call_read read; + struct rpc_call_remove removef; + struct rpc_call_rename renamef; + struct rpc_call_mkdir mkdir; + struct rpc_call_rmdir rmdir; + struct rpc_call_readdir readdir; + struct rpc_call_fs fsstat; + struct rpc_call_setattr setattr; + struct rpc_call_fs fs; + struct rpc_reply_write write; + } nm_msgbuffer; + + /* I/O buffer (must be a aligned to 32-bit boundaries). This buffer used for all + * reply messages EXCEPT for the WRITE RPC. In that case it is used for the WRITE + * call message that contains the data to be written. This buffer must be + * dynamically sized based on the characteristics of the server and upon the + * configuration of the NuttX network. It must be sized to hold the largest + * possible WRITE call message or READ response message. + */ + + uint32_t nm_iobuffer[1]; /* Actual size is given by nm_buflen */ +}; + +/* The size of the nfsmount structure will debug on the size of the allocated I/O + * buffer. + */ + +#define SIZEOF_nfsmount(n) (sizeof(struct nfsmount) + ((n + 3) & ~3) - sizeof(uint32_t)) + +/* Mount parameters structure. This structure is use in nfs_decode_args funtion before one + * mount structure is allocated in each NFS mount. + */ + +struct nfs_mount_parameters +{ + uint32_t timeo; /* Timeout value (in deciseconds) */ + uint8_t retry; /* Max retries */ + uint16_t rsize; /* Max size of read RPC */ + uint16_t wsize; /* Max size of write RPC */ + uint16_t readdirsize; /* Size of a readdir RPC */ +}; + +struct nfs_args +{ + uint8_t addrlen; /* Length of address */ + uint8_t sotype; /* Socket type */ + uint8_t flags; /* Flags, determines if following are valid: */ + uint8_t timeo; /* Time value in deciseconds (with NFSMNT_TIMEO) */ + uint8_t retrans; /* Times to retry send (with NFSMNT_RETRANS) */ + uint16_t wsize; /* Write size in bytes (with NFSMNT_WSIZE) */ + uint16_t rsize; /* Read size in bytes (with NFSMNT_RSIZE) */ + uint16_t readdirsize; /* readdir size in bytes (with NFSMNT_READDIRSIZE) */ + char *path; /* Server's path of the directory being mount */ + struct sockaddr addr; /* File server address (requires 32-bit alignment) */ +}; + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif diff --git a/fs/nfs/nfs_node.h b/fs/nfs/nfs_node.h new file mode 100755 index 0000000..e22a5e7 --- /dev/null +++ b/fs/nfs/nfs_node.h @@ -0,0 +1,99 @@ +/**************************************************************************** + * fs/nfs/nfs_node.h + * + * Copyright (C) 2012-2013, 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved. + * Author: Jose Pablo Rojas Vargas + * Gregory Nutt + * + * Leveraged from OpenBSD: + * + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Rick Macklem at The University of Guelph. + * + * 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. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __FS_NFS_NFS_NODE_H +#define __FS_NFS_NFS_NODE_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "nfs_proto.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Flags for struct nfsnode n_flag */ + +#define NFSNODE_OPEN (1 << 0) /* File is still open */ +#define NFSNODE_MODIFIED (1 << 1) /* Might have a modified buffer */ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* There is a unique nfsnode allocated for each active file. An nfsnode is + * 'named' by its file handle. + */ + +struct nfsnode +{ + struct nfsnode *n_next; /* Retained in a singly linked list. */ + uint8_t n_crefs; /* Reference count (for nfs_dup) */ + uint8_t n_type; /* File type */ + uint8_t n_fhsize; /* Size in bytes of the file handle */ + uint8_t n_flags; /* Node flags */ + uint16_t n_mode; /* File mode for fstat() */ + time_t n_mtime; /* File modification time */ + time_t n_ctime; /* File creation time */ + nfsfh_t n_fhandle; /* NFS File Handle */ + uint64_t n_size; /* Current size of file */ + int n_oflags; /* Flags provided when file was opened */ + loff_t n_fpos; /* NFS File position */ + struct file *n_filep; /* File pointer from VFS */ +}; + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif /* __FS_NFS_NFS_NODE_H */ diff --git a/fs/nfs/nfs_proto.h b/fs/nfs/nfs_proto.h new file mode 100755 index 0000000..d9e0f2c --- /dev/null +++ b/fs/nfs/nfs_proto.h @@ -0,0 +1,637 @@ +/**************************************************************************** + * fs/nfs/nfs_proto.h + * + * Copyright (C) 2012, 2018 Gregory Nutt. All rights reserved. + * Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved. + * Author: Jose Pablo Rojas Vargas + * Gregory Nutt + * + * Leveraged from OpenBSD: + * + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Rick Macklem at The University of Guelph. + * + * 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. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __FS_NFS_NFS_PROTO_H +#define __FS_NFS_NFS_PROTO_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Constants as defined in the Sun NFS Version 2 and 3 specs. + * "NFS: Network File System Protocol Specification" RFC1094 + * and in the "NFS: Network File System Version 3 Protocol + * Specification" + */ + +#define NFS_PORT 2049 +#define NFS_PROG 100003 +#define NFS_VER2 2 +#define NFS_VER3 3 +#define NFS_VER4 4 +#define NFS_MAXDGRAMDATA 32768 +#define MAXBSIZE 64000 +#define NFS_MAXDATA MAXBSIZE +#define NFS_MAXPATHLEN 1024 +#define NFS_MAXNAMLEN 255 +#define NFS_MAXPKTHDR 404 +#define NFS_MAXPACKET (NFS_MAXPKTHDR + NFS_MAXDATA) +#define NFS_MINPACKET 20 +#define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */ +#define NFS_MOUNT_PATH_MAX_SIZE PATH_MAX + +/* Stat numbers for rpc returns (version 2 and 3) */ + +#define NFS_OK 0 +#define NFSERR_PERM 1 +#define NFSERR_NOENT 2 +#define NFSERR_IO 5 +#define NFSERR_NXIO 6 +#define NFSERR_ACCES 13 +#define NFSERR_EXIST 17 +#define NFSERR_XDEV 18 /* Version 3 only */ +#define NFSERR_NODEV 19 +#define NFSERR_NOTDIR 20 +#define NFSERR_ISDIR 21 +#define NFSERR_INVAL 22 /* Version 3 only */ +#define NFSERR_FBIG 27 +#define NFSERR_NOSPC 28 +#define NFSERR_ROFS 30 +#define NFSERR_MLINK 31 /* Version 3 only */ +#define NFSERR_NAMETOL 63 +#define NFSERR_NOTEMPTY 66 +#define NFSERR_DQUOT 69 +#define NFSERR_STALE 70 +#define NFSERR_REMOTE 71 /* Version 3 only */ +#define NFSERR_WFLUSH 99 /* Version 2 only */ +#define NFSERR_BADHANDLE 10001 /* The rest Version 3 only */ +#define NFSERR_NOT_SYNC 10002 +#define NFSERR_BAD_COOKIE 10003 +#define NFSERR_NOTSUPP 10004 +#define NFSERR_TOOSMALL 10005 +#define NFSERR_SERVERFAULT 10006 +#define NFSERR_BADTYPE 10007 +#define NFSERR_JUKEBOX 10008 +#define NFSERR_TRYLATER NFSERR_JUKEBOX +#define NFSERR_STALEWRITEVERF 30001 /* Fake return for nfs_commit() */ + +#define NFSERR_RETVOID 0x20000000 /* Return void, not error */ +#define NFSERR_AUTHERR 0x40000000 /* Mark an authentication error */ +#define NFSERR_RETERR 0x80000000 /* Mark an error return for V3 */ + +/* Sizes in bytes of various NFS RPC components */ + +#define NFSX_UNSIGNED 4 + +/* Specific to NFS Version 3 */ + +#define NFSX_V3FH (sizeof (fhandle_t)) /* size this server uses */ +#define NFSX_V3FHMAX 64 /* max. allowed by protocol */ +#define NFSX_V3FATTR 84 +#define NFSX_V3SATTR 60 /* max. all fields filled in */ +#define NFSX_V3SRVSATTR (sizeof (struct nfsv3_sattr)) +#define NFSX_V3POSTOPATTR (NFSX_V3FATTR + NFSX_UNSIGNED) +#define NFSX_V3WCCDATA (NFSX_V3POSTOPATTR + 8 * NFSX_UNSIGNED) +#define NFSX_V3COOKIEVERF 8 +#define NFSX_V3WRITEVERF 8 +#define NFSX_V3CREATEVERF 8 +#define NFSX_V3STATFS 52 +#define NFSX_V3FSINFO 48 +#define NFSX_V3PATHCONF 24 + +/* NFS RPC procedure numbers (before version mapping) */ + +#define NFSPROC_NULL 0 +#define NFSPROC_GETATTR 1 +#define NFSPROC_SETATTR 2 +#define NFSPROC_LOOKUP 3 +#define NFSPROC_ACCESS 4 +#define NFSPROC_READLINK 5 +#define NFSPROC_READ 6 +#define NFSPROC_WRITE 7 +#define NFSPROC_CREATE 8 +#define NFSPROC_MKDIR 9 +#define NFSPROC_SYMLINK 10 +#define NFSPROC_MKNOD 11 +#define NFSPROC_REMOVE 12 +#define NFSPROC_RMDIR 13 +#define NFSPROC_RENAME 14 +#define NFSPROC_LINK 15 +#define NFSPROC_READDIR 16 +#define NFSPROC_READDIRPLUS 17 +#define NFSPROC_FSSTAT 18 +#define NFSPROC_FSINFO 19 +#define NFSPROC_PATHCONF 20 +#define NFSPROC_COMMIT 21 +#define NFSPROC_NOOP 22 +#define NFS_NPROCS 23 + +/* Constants used by the Version 3 protocol for various RPCs */ + +#define NFSV3SATTRTIME_DONTCHANGE 0 +#define NFSV3SATTRTIME_TOSERVER 1 +#define NFSV3SATTRTIME_TOCLIENT 2 + +#define NFSV3ACCESS_READ 0x01 +#define NFSV3ACCESS_LOOKUP 0x02 +#define NFSV3ACCESS_MODIFY 0x04 +#define NFSV3ACCESS_EXTEND 0x08 +#define NFSV3ACCESS_DELETE 0x10 +#define NFSV3ACCESS_EXECUTE 0x20 + +#define NFSV3WRITE_UNSTABLE 0 +#define NFSV3WRITE_DATASYNC 1 +#define NFSV3WRITE_FILESYNC 2 + +#define NFSV3CREATE_UNCHECKED 0 +#define NFSV3CREATE_GUARDED 1 +#define NFSV3CREATE_EXCLUSIVE 2 + +#define NFSV3FSINFO_LINK 0x01 +#define NFSV3FSINFO_SYMLINK 0x02 +#define NFSV3FSINFO_HOMOGENEOUS 0x08 +#define NFSV3FSINFO_CANSETTIME 0x10 + +/* Conversion macros */ + +#define vtonfsv3_mode(m) txdr_unsigned((m) & 07777) +#define nfstov_mode(a) (fxdr_unsigned(u_int16_t, (a))&07777) +#define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((int32_t)(a))]) +#define nfsv3tov_type(a) nv3tov_type[fxdr_unsigned(uint32_t,(a))&0x7] + +/* Mode bit values */ + +#define NFSMODE_IXOTH (1 << 0) /* Execute permission for others on a file */ +#define NFSMODE_IWOTH (1 << 1) /* Write permission for others */ +#define NFSMODE_IROTH (1 << 2) /* Read permission for others */ +#define NFSMODE_IXGRP (1 << 3) /* Execute permission for group on a file */ +#define NFSMODE_IWGRP (1 << 4) /* Write permission for group */ +#define NFSMODE_IRGRP (1 << 5) /* Read permission for group */ +#define NFSMODE_IXUSR (1 << 6) /* Execute permission for owner on a file */ +#define NFSMODE_IWUSR (1 << 7) /* Write permission for owner */ +#define NFSMODE_IRUSR (1 << 8) /* Read permission for owner */ +#define NFSMODE_SAVETEXT (1 << 9) /* Save swapped text */ +#define NFSMODE_ISGID (1 << 10) /* Set group ID on execution */ +#define NFSMODE_ISUID (1 << 11) /* Set user ID on execution */ + +#define DIRENT_NFS_MAXHANDLE 64 /* Maximum length of an NFSv3 file handle */ +#define DIRENT_NFS_VERFLEN 8 /* Length of the copy verifier */ + +/* File identifier */ + +#define MAXFIDSZ 16 + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* File types */ + +typedef enum +{ + NFNON = 0, /* Unknown type */ + NFREG = 1, /* Regular file */ + NFDIR = 2, /* Directory */ + NFBLK = 3, /* Block special device file */ + NFCHR = 4, /* Character special device file */ + NFLNK = 5, /* Symbolic link */ + NFSOCK = 6, /* Socket */ + NFFIFO = 7 /* Named FIFO */ +} nfstype; + +/* File Handle variable is up to 64 bytes for version 3. This structures a + * ariable sized and are provided only for setting aside maximum memory + * allocations for a file handle. + */ + +struct nfsfh +{ + uint8_t fh_bytes[NFSX_V3FHMAX]; +}; +typedef struct nfsfh nfsfh_t; +#define SIZEOF_nfsfh_t(n) (n) + +struct nfsv3_time +{ + uint32_t nfsv3_sec; + uint32_t nfsv3_nsec; +}; +typedef struct nfsv3_time nfstime3; + +/* Quads are defined as arrays of 2 longs to ensure dense packing for the + * protocol and to facilitate xdr conversion. + */ + +struct nfs_uquad +{ + uint32_t nfsuquad[2]; +}; +typedef struct nfs_uquad nfsuint64; + +/* NFS Version 3 special file number. */ + +struct nfsv3_spec +{ + uint32_t specdata1; + uint32_t specdata2; +}; +typedef struct nfsv3_spec nfsv3spec; + +/* File attributes and setable attributes. These structures cover both + * NFS version 2 and the version 3 protocol. Note that the union is only + * used so that one pointer can refer to both variants. These structures + * go out on the wire and must be densely packed, so no quad data types + * are used. (all fields are longs or u_longs or structures of same) + */ + +struct nfs_fattr +{ + uint32_t fa_type; + uint32_t fa_mode; + uint32_t fa_nlink; + uint32_t fa_uid; + uint32_t fa_gid; + nfsuint64 fa_size; + nfsuint64 fa_used; + nfsv3spec fa_rdev; + nfsuint64 fa_fsid; + nfsuint64 fa_fileid; + nfstime3 fa_atime; + nfstime3 fa_mtime; + nfstime3 fa_ctime; +}; + +/* NFS Version 3 sattr structure for the new node creation case. This is the + * maximum size of the attributes; the actual size may vary if values are not + * include. + */ + +struct nfsv3_sattr +{ + uint32_t sa_modefollows; /* TRUE: Mode value follows */ + uint32_t sa_mode; /* Mode value */ + uint32_t sa_uidfollows; /* TRUE: Uid value follows */ + uint32_t sa_uid; /* Uid value */ + uint32_t sa_gidfollows; /* TRUE: Mode value follows */ + uint32_t sa_gid; /* Mode value */ + uint32_t sa_sizefollows; /* TRUE: Size value follows */ + uint32_t sa_size; /* Size value */ + uint32_t sa_atimetype; /* Don't change, use server timer, or use client time */ + nfstime3 sa_atime; /* Client time */ + uint32_t sa_mtimetype; /* Don't change, use server timer, or use client time */ + nfstime3 sa_mtime; /* Client time */ +}; + +struct nfs_statfs +{ + uint32_t attributes_follow; + struct nfs_fattr obj_attributes; + nfsuint64 sf_tbytes; + nfsuint64 sf_fbytes; + nfsuint64 sf_abytes; + nfsuint64 sf_tfiles; + nfsuint64 sf_ffiles; + nfsuint64 sf_afiles; + uint32_t sf_invarsec; +}; + +struct nfs_statfs_ctx +{ + nfsuint64 sf_tbytes; + nfsuint64 sf_fbytes; + nfsuint64 sf_abytes; + nfsuint64 sf_tfiles; + nfsuint64 sf_ffiles; + nfsuint64 sf_afiles; + uint32_t sf_invarsec; +}; + + +struct entry3 +{ + uint32_t file_id[2]; + uint32_t name_len; + uint8_t *contents; + uint32_t cookie[2]; + struct entry3 *next; +}; + +struct nfsdir_s +{ + struct nfsdir_s* nfs_next; /* A list of opened directories. */ + uint8_t nfs_fhsize; /* Length of the file handle */ + uint8_t nfs_fhandle[DIRENT_NFS_MAXHANDLE]; /* File handle (max size allocated) */ + uint8_t nfs_verifier[DIRENT_NFS_VERFLEN]; /* Cookie verifier */ + uint32_t nfs_cookie[2]; /* Cookie */ + struct fs_dirent_s *nfs_dir; /* Directory pointer from VFS */ + struct entry3 *nfs_entries; /* Directory pointer from VFS */ +}; + +struct post_attr +{ + uint32_t obj_attribute_follow; + struct nfs_fattr attributes; +}; + +struct nfsv3_fsinfo +{ + struct post_attr obj_attributes; + uint32_t fs_rtmax; + uint32_t fs_rtpref; + uint32_t fs_rtmult; + uint32_t fs_wtmax; + uint32_t fs_wtpref; + uint32_t fs_wtmult; + uint32_t fs_dtpref; + nfsuint64 fs_maxfilesize; + nfstime3 fs_timedelta; + uint32_t fs_properties; +}; + +struct nfs_fsinfo +{ + uint32_t fs_rtmax; + uint32_t fs_rtpref; + uint32_t fs_rtmult; + uint32_t fs_wtmax; + uint32_t fs_wtpref; + uint32_t fs_wtmult; + uint32_t fs_dtpref; + nfsuint64 fs_maxfilesize; + nfstime3 fs_timedelta; + uint32_t fs_properties; +}; + +/* NFS procedures args */ + +struct wcc_attr +{ + nfsuint64 size; + nfstime3 mtime; + nfstime3 ctime; +}; + +struct wcc_data +{ + uint32_t wcc_attr_follows; /* True if data follows */ + struct wcc_attr before; + uint32_t nfs_attr_follow; /* True if attributes present */ + struct nfs_fattr after; +}; + +struct file_handle +{ + uint32_t length; + nfsfh_t handle; +}; +#define SIZEOF_file_handle(n) (sizeof(uint32_t) + SIZEOF_nfsfh_t(n)) + +struct diropargs3 +{ + struct file_handle fhandle; /* Variable length */ + uint32_t length; /* Size of name[] */ + uint32_t name[(NAME_MAX+3) >> 2]; /* Variable length */ +}; + +struct CREATE3args +{ + struct diropargs3 where; + uint32_t create_mode; + struct nfsv3_sattr how; +}; + +struct CREATE3resok +{ + uint32_t handle_follows; /* True, handle follows */ + struct file_handle fhandle; /* Variable length */ + uint32_t attributes_follows; /* True, attributes follows */ + struct nfs_fattr attributes; /* File attributes */ + struct wcc_data dir_wcc; +}; + +/* The actual size of the lookup argument is variable. These structures are, therefore, + * only useful in setting aside maximum memory usage for the LOOKUP arguments. + */ + +struct LOOKUP3filename +{ + uint32_t namelen; /* Size of name[] */ + uint32_t name[(NAME_MAX+3) >> 2]; /* Variable length */ +}; + +struct LOOKUP3args +{ + struct file_handle dirhandle; /* Variable length */ + struct LOOKUP3filename name; /* Variable length */ +}; + +struct SETATTR3args +{ + struct file_handle fhandle; /* Variable length */ + struct nfsv3_sattr new_attributes; /* Variable length */ + uint32_t guard; /* Guard value */ +}; + +struct SETATTR3resok +{ + struct wcc_data wcc_data; +}; + +/* Actual size of LOOKUP3args */ + +#define SIZEOF_LOOKUP3filename(b) (sizeof(uint32_t) + (((b)+3) & ~3)) +#define SIZEOF_LOOKUP3args(a,b) (SIZEOF_file_handle(a) + SIZEOF_LOOKUP3filename(b)) + +struct LOOKUP3resok +{ + struct file_handle fhandle; + uint32_t obj_attributes_follow; + struct nfs_fattr obj_attributes; + uint32_t dir_attributes_follow; + struct nfs_fattr dir_attributes; +}; + +struct READ3args +{ + struct file_handle fhandle; /* Variable length */ + uint64_t offset; + uint32_t count; +}; + +struct nfs_rdhdr_s +{ + uint32_t attributes_follow; + struct nfs_fattr attributes; /* Will not be present if attributes_follow == 0 */ + uint32_t count; /* Number of bytes read */ + uint32_t eof; /* Non-zero if at the end of file */ + uint32_t length; /* Length of data (same as count?) */ +}; + +struct READ3resok +{ + struct nfs_rdhdr_s hdr; + uint8_t data[1]; /* Actual data size depends on count */ +}; +#define SIZEOF_READ3resok(n) (sizeof(struct nfs_rdhdr_s) + (n)) + +struct nfs_wrhdr_s +{ + struct file_handle fhandle; /* Variable length */ + uint64_t offset; + uint32_t count; + uint32_t stable; +}; + +struct WRITE3args +{ + struct nfs_wrhdr_s hdr; + uint8_t data[1]; /* Actual data size depends on count */ +}; +#define SIZEOF_WRITE3args(n) (sizeof(struct nfs_wrhdr_s) + (n)) + +struct WRITE3resok +{ + struct wcc_data file_wcc; + uint32_t count; + uint32_t committed; + uint8_t verf[NFSX_V3WRITEVERF]; +}; + +struct REMOVE3args +{ + struct diropargs3 object; +}; + +struct REMOVE3resok +{ + struct wcc_data dir_wcc; +}; + +struct RENAME3args +{ + struct diropargs3 from; + struct diropargs3 to; +}; + +struct RENAME3resok +{ + struct wcc_data fromdir_wcc; + struct wcc_data todir_wcc; +}; + +struct MKDIR3args +{ + struct diropargs3 where; + struct nfsv3_sattr how; +}; + +struct MKDIR3resok +{ + uint32_t handle_follows; /* True, handle follows */ + struct file_handle fhandle; /* Variable length */ + uint32_t attributes_follows; /* True, attributes follows */ + struct nfs_fattr attributes; /* Directory attributes */ + struct wcc_data dir_wcc; +}; + +struct RMDIR3args +{ + struct diropargs3 object; +}; + +struct RMDIR3resok +{ + struct wcc_data dir_wcc; +}; + +/* The actual size of the lookup argument is variable. This structures is, therefore, + * only useful in setting aside maximum memory usage for the LOOKUP arguments. + */ + +struct READDIR3args +{ + struct file_handle dir; /* Variable length */ + nfsuint64 cookie; + uint8_t cookieverf[NFSX_V3COOKIEVERF]; + uint32_t count; +}; + +/* The READDIR reply is variable length and consists of multiple entries, each + * of form: + * + * EOF - OR - + * + * File ID (8 bytes) + * Name length (4 bytes) + * Name string (varaiable size but in multiples of 4 bytes) + * Cookie (8 bytes) + * next entry (4 bytes) + */ + +struct READDIR3resok +{ + uint32_t attributes_follow; + struct nfs_fattr dir_attributes; + uint8_t cookieverf[NFSX_V3COOKIEVERF]; + uint32_t value_follows; + uint32_t reply[1]; /* Variable length reply begins here */ +}; + +#define SIZEOF_READDIR3resok(n) \ + (sizeof(uint32_t) + sizeof(struct nfs_fattr) + \ + NFSX_V3COOKIEVERF + sizeof(uint32_t) + (n)) + +struct FS3args +{ + struct file_handle fsroot; +}; + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif /* __FS_NFS_NFS_PROTO_H */ + diff --git a/fs/nfs/nfs_util.c b/fs/nfs/nfs_util.c new file mode 100755 index 0000000..110b414 --- /dev/null +++ b/fs/nfs/nfs_util.c @@ -0,0 +1,571 @@ +/**************************************************************************** + * fs/nfs/nfs_util.c + * + * Copyright (C) 2012-2013, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include "vfs_config.h" +#include "dirent.h" +#include "rpc.h" +#include "nfs.h" +#include "nfs_node.h" +#include "xdr_subs.h" +#undef OK +#define OK 0 + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static inline int nfs_pathsegment(FAR const char **path, FAR char *buffer, + FAR char *terminator) +{ + FAR const char *src = *path; + FAR char *dest = buffer; + int nbytes = 0; + char ch; + + /* Loop until the name is successfully parsed or an error occurs */ + + for (; ; ) + { + /* Get the next byte from the path */ + + ch = *src++; + + /* Check if this the last byte in this segment name */ + + if (ch == '\0' || ch == '/') + { + /* This logic just supports "//" sequences in the path name */ + + if (ch == '\0' || nbytes > 0) + { + /* NULL terminate the parsed path segment */ + + *dest = '\0'; + + /* Return next path and the terminating character */ + + *terminator = ch; + *path = src; + return OK; + } + + /* Just skip over any leading '/' characters */ + } + else if (nbytes >= NAME_MAX) + { + ferr("ERROR: File name segment is too long: %d\n", *path); + return ENAMETOOLONG; + } + else + { + /* Save next character in the accumulated name */ + + *dest++ = ch; + nbytes++; + } + } +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: nfs_mux_take + ****************************************************************************/ + +void nfs_mux_take(struct nfsmount *nmp) +{ + (void)pthread_mutex_lock(&nmp->nm_mux); +} + +/**************************************************************************** + * Name: nfs_mux_release + ****************************************************************************/ + +void nfs_mux_release(struct nfsmount *nmp) +{ + (void)pthread_mutex_unlock(&nmp->nm_mux); +} + +/**************************************************************************** + * Name: nfs_checkmount + * + * Description: Check if the mountpoint is still valid. + * + * The caller should hold the mountpoint semaphore + * + ****************************************************************************/ + +int nfs_checkmount(struct nfsmount *nmp) +{ + struct nfsnode *file; + + /* If the nm_mounted flag is false, then we have already handled the loss + * of the mount. + */ + + DEBUGASSERT(nmp); + if (!nmp->nm_mounted) + { + /* Make sure that this is flagged in every opened file */ + + for (file = nmp->nm_head; file; file = file->n_next) + { + file->n_flags &= ~NFSNODE_OPEN; + } + + return ENODEV; + } + + return 0; +} + +/**************************************************************************** + * Name: nfs_request + * + * Description: + * Perform the NFS request. On successful receipt, it verifies the NFS level of the + * returned values. + * + * Returned Value: + * Zero on success; a positive errno value on failure. + * + ****************************************************************************/ + +int nfs_request(struct nfsmount *nmp, int procnum, + FAR void *request, size_t reqlen, + FAR void *response, size_t resplen) +{ + struct rpcclnt *clnt = nmp->nm_rpcclnt; + struct nfs_reply_header replyh; + int error; + +tryagain: + error = rpcclnt_request(clnt, procnum, NFS_PROG, NFS_VER3, + request, reqlen, response, resplen); + if (error != 0) + { + ferr("ERROR: rpcclnt_request failed: %d\n", error); + return error; + } + + memcpy(&replyh, response, sizeof(struct nfs_reply_header)); + + if (replyh.nfs_status != 0) + { + /* NFS_ERRORS are the same as NuttX errno values */ + + error = fxdr_unsigned(uint32_t, replyh.nfs_status); + return error; + } + + if (replyh.rpc_verfi.authtype != 0) + { + error = fxdr_unsigned(int, replyh.rpc_verfi.authtype); + + if (error == EAGAIN) + { + error = 0; + goto tryagain; + } + + ferr("ERROR: NFS error %d from server\n", error); + return error; + } + + finfo("NFS_SUCCESS\n"); + return OK; +} + +/**************************************************************************** + * Name: nfs_lookup + * + * Description: + * Given a directory file handle, and the path to file in the directory, + * return the file handle of the path and attributes of both the file and + * the directory containing the file. + * + * NOTE: The LOOKUP call differs from other RPC messages in that the + * call message is variable length, depending upon the size of the path + * name. + * + ****************************************************************************/ + +int nfs_lookup(struct nfsmount *nmp, FAR const char *filename, + FAR struct file_handle *fhandle, + FAR struct nfs_fattr *obj_attributes, + FAR struct nfs_fattr *dir_attributes) +{ + FAR uint32_t *ptr; + uint32_t value; + int reqlen; + int namelen; + int error = 0; + + DEBUGASSERT(nmp && filename && fhandle); + + /* Get the length of the string to be sent */ + + namelen = strlen(filename); + if (namelen > NAME_MAX) + { + ferr("ERROR: Length of the string is too long: %d\n", namelen); + return E2BIG; + } + + /* Initialize the request */ + + ptr = (FAR uint32_t *)&nmp->nm_msgbuffer.lookup.lookup; + reqlen = 0; + + /* Copy the variable length, directory file handle */ + + *ptr++ = txdr_unsigned(fhandle->length); + reqlen += sizeof(uint32_t); + + memcpy(ptr, &fhandle->handle, fhandle->length); + reqlen += fhandle->length; + ptr += uint32_increment(fhandle->length); + + /* Copy the variable-length file name */ + + *ptr++ = txdr_unsigned(namelen); + reqlen += sizeof(uint32_t); + + memcpy(ptr, filename, namelen); + reqlen += uint32_alignup(namelen); + + /* Request LOOKUP from the server */ + + nfs_statistics(NFSPROC_LOOKUP); + error = nfs_request(nmp, NFSPROC_LOOKUP, + (FAR void *)&nmp->nm_msgbuffer.lookup, reqlen, + (FAR void *)nmp->nm_iobuffer, nmp->nm_buflen); + + if (error) + { + ferr("ERROR: nfs_request failed: %d\n", error); + return error; + } + + /* Return the data to the caller's buffers. NOTE: Here we ignore the + * the exact layout of the rpc_reply_lookup structure. File handles + * may differ in size whereas struct rpc_reply_lookup uses a fixed size. + */ + + ptr = (FAR uint32_t *)&((FAR struct rpc_reply_lookup *)nmp->nm_iobuffer)->lookup; + + /* Get the length of the file handle */ + + value = *ptr++; + value = fxdr_unsigned(uint32_t, value); + if (value > NFSX_V3FHMAX) + { + ferr("ERROR: Bad file handle length: %d\n", value); + return EIO; + } + + /* Return the file handle */ + + fhandle->length = value; + memcpy(&fhandle->handle, ptr, value); + ptr += uint32_increment(value); + + /* Check if there are object attributes and, if so, copy them to the user + * buffer + */ + + value = *ptr++; + if (value) + { + if (obj_attributes) + { + memcpy(obj_attributes, ptr, sizeof(struct nfs_fattr)); + } + + ptr += uint32_increment(sizeof(struct nfs_fattr)); + } + + /* Check if there are directory attributes and, if so, copy them to the + * user buffer + */ + + value = *ptr++; + if (value && dir_attributes) + { + memcpy(dir_attributes, ptr, sizeof(struct nfs_fattr)); + } + + return OK; +} + +/**************************************************************************** + * Name: nfs_findnode + * + * Description: + * Given a path to something that may or may not be in the file system, + * return the handle of the directory entry of the requested object. + * + * Returned Value: + * Zero on success; a positive errno value on failure. + * + ****************************************************************************/ + +int nfs_findnode(struct nfsmount *nmp, FAR const char *relpath, + FAR struct file_handle *fhandle, + FAR struct nfs_fattr *obj_attributes, + FAR struct nfs_fattr *dir_attributes) +{ + FAR const char *path = relpath; + char buffer[NAME_MAX + 1]; + char terminator; + uint32_t tmp; + int error; + + /* Start with the file handle of the root directory. */ + + fhandle->length = nmp->nm_fhsize; + memcpy(&fhandle->handle, &nmp->nm_fh, nmp->nm_fhsize); + + /* If no path was provided, then the root directory must be exactly what + * the caller is looking for. + */ + + if (*path == '\0' || strlen(path) == 0) + { + /* Return the root directory attributes */ + + if (obj_attributes) + { + memcpy(obj_attributes, &nmp->nm_fattr, sizeof(struct nfs_fattr)); + } + + if (dir_attributes) + { + memcpy(dir_attributes, &nmp->nm_fattr, sizeof(struct nfs_fattr)); + } + + return OK; + } + + /* This is not the root directory. Loop until the directory entry corresponding + * to the path is found. + */ + + for (; ; ) + { + /* Extract the next path segment name. */ + + error = nfs_pathsegment(&path, buffer, &terminator); + if (error != OK) + { + /* The filename segment contains is too long. */ + + ferr("ERROR: nfs_pathsegment of \"%s\" failed after \"%s\": %d\n", + relpath, buffer, error); + return error; + } + + /* Look-up this path segment */ + + error = nfs_lookup(nmp, buffer, fhandle, obj_attributes, dir_attributes); + if (error != OK) + { + ferr("ERROR: nfs_lookup of \"%s\" failed at \"%s\": %d\n", + relpath, buffer, error); + return error; + } + + /* If the terminator character in the path was the end of the string + * then we have successfully found the directory entry that describes + * the path. + */ + + if (!terminator) + { + /* Return success meaning that the description the matching + * directory entry is in fhandle, obj_attributes, and dir_attributes. + */ + + return OK; + } + + /* No.. then we have found one of the intermediate directories on + * the way to the final path target. In this case, make sure + * the thing that we found is, indeed, a directory. + */ + + tmp = fxdr_unsigned(uint32_t, obj_attributes->fa_type); + if (tmp != NFDIR) + { + /* Ooops.. we found something else */ + + ferr("ERROR: Intermediate segment \"%s\" of \'%s\" is not a directory\n", + buffer, path); + return ENOTDIR; + } + } +} + +/**************************************************************************** + * Name: nfs_finddir + * + * Description: + * Given a path to something that may or may not be in the file system, + * return the handle of the entry of the directory containing the requested + * object. + * + * Returned Value: + * Zero on success; a positive errno value on failure. + * + ****************************************************************************/ + +int nfs_finddir(struct nfsmount *nmp, FAR const char *relpath, + FAR struct file_handle *fhandle, + FAR struct nfs_fattr *attributes, FAR char *filename) +{ + FAR const char *path = relpath; + uint32_t tmp; + char terminator; + int error; + + /* Verify that a path was provided */ + + if (*path == '\0' || strlen(path) == 0) + { + /* Return the root directory attributes */ + + return ENOENT; + } + + /* Start with the file handle of the root directory. */ + + fhandle->length = nmp->nm_fhsize; + memcpy(&fhandle->handle, &nmp->nm_fh, nmp->nm_fhsize); + memcpy(attributes, &nmp->nm_fattr, sizeof(struct nfs_fattr)); + + /* Loop until the directory entry containing the path is found. */ + + for (; ; ) + { + /* Extract the next path segment name. */ + + error = nfs_pathsegment(&path, filename, &terminator); + if (error != OK) + { + /* The filename segment contains is too long. */ + + ferr("ERROR: nfs_pathsegment of \"%s\" failed after \"%s\": %d\n", + relpath, filename, error); + return error; + } + + /* If the terminator character in the path was the end of the string + * then we have successfully found the directory that contains the name + * of interest. + */ + + if (!terminator) + { + /* Return success meaning that the description of the directory + * containing the object is in fhandle and attributes. + */ + + return OK; + } + + /* Look-up the next path segment */ + + error = nfs_lookup(nmp, filename, fhandle, attributes, NULL); + if (error != OK) + { + ferr("ERROR: fs_lookup of \"%s\" failed at \"%s\": %d\n", + relpath, filename, error); + return error; + } + + /* Make sure the thing that we found is, indeed, a directory. */ + + tmp = fxdr_unsigned(uint32_t, attributes->fa_type); + if (tmp != NFDIR) + { + /* Ooops.. we found something else */ + + ferr("ERROR: Intermediate segment \"%s\" of \'%s\" is not a directory\n", + filename, path); + return ENOTDIR; + } + } +} + +/**************************************************************************** + * Name: nfs_attrupdate + * + * Description: + * Update file attributes on write or after the file is modified. + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void nfs_attrupdate(FAR struct nfsnode *np, FAR struct nfs_fattr *attributes) +{ + struct timespec ts; + + /* Save a few of the files attribute values in file structure (host order) */ + + np->n_type = fxdr_unsigned(uint8_t, attributes->fa_type); + np->n_mode = fxdr_unsigned(uint16_t, attributes->fa_mode); + np->n_size = fxdr_hyper(&attributes->fa_size); + + fxdr_nfsv3time(&attributes->fa_mtime, &ts); + np->n_mtime = ts.tv_sec; + + fxdr_nfsv3time(&attributes->fa_ctime, &ts); + np->n_ctime = ts.tv_sec; +} diff --git a/fs/nfs/nfs_vfsops.c b/fs/nfs/nfs_vfsops.c new file mode 100755 index 0000000..d1f2c73 --- /dev/null +++ b/fs/nfs/nfs_vfsops.c @@ -0,0 +1,3523 @@ +/**************************************************************************** + * fs/nfs/nfs_vfsops.c + * + * Copyright (C) 2012-2013, 2015, 2017-2018 Gregory Nutt. All rights reserved. + * Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved. + * Author: Jose Pablo Rojas Vargas + * Gregory Nutt + * + * Leveraged from OpenBSD: + * + * Copyright (c) 1989, 1993, 1995 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Rick Macklem at The University of Guelph. + * + * 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. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "lwip/opt.h" +#include "lwip/sockets.h" +#include "vfs_config.h" +#include "dirent.h" +#include "fs/fs.h" +#include "fs/dirent_fs.h" +#include "nfs.h" +#include "nfs_node.h" +#include "xdr_subs.h" +#include "los_tables.h" +#include "inode/inode.h" +#include "los_vm_filemap.h" +#include "user_copy.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifdef LOSCFG_FS_NFS +/* The V3 EXCLUSIVE file creation logic is not fully supported. */ + +#define USE_GUARDED_CREATE 1 + +/* include/nuttx/fs/dirent.h has its own version of these lengths. They must + * match the NFS versions. + */ + +#if NFSX_V3FHMAX != DIRENT_NFS_MAXHANDLE +# error "Length of file handle in fs_dirent_s is incorrect" +#endif + +#if NFSX_V3COOKIEVERF != DIRENT_NFS_VERFLEN +# error "Length of cookie verify in fs_dirent_s is incorrect" +#endif + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/* Use to pass file information to nfs_stat_common() */ + +struct nfs_statinfo_s +{ + uint16_t ns_mode; /* File access mode */ + uint8_t ns_type; /* File type */ + uint64_t ns_size; /* File size */ + time_t ns_atime; /* Time of last access */ + time_t ns_mtime; /* Time of last modification */ + time_t ns_ctime; /* Time of last status change */ +}; + +#define MIN_IPv4_UDP_MSS (IP_FRAG_MAX_MTU - (14 + 20)) /* (Ethernet MTU - (Eth header size + IP header size)) */ + +#define FILENAME_MAX_LEN 50 + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +uint32_t nfs_true; +uint32_t nfs_false; +uint32_t nfs_xdrneg1; +NFSMOUNT_HOOK g_NFSMOUNT_HOOK = (NFSMOUNT_HOOK)(UINTPTR)NULL; + +#ifdef CONFIG_NFS_STATISTICS +struct nfsstats nfsstats; +#endif + +/**************************************************************************** + * Private Type Definitions + ****************************************************************************/ + +#define NFS_DIR_ENTRY_MALLOC(entry) \ + do \ + { \ + entry = (struct entry3 *)malloc(sizeof(struct entry3)); \ + if (entry == NULL) \ + { \ + fvdbg("malloc failed\n"); \ + error = ENOMEM; \ + goto errout_with_memory; \ + } \ + (void)memset_s(entry, sizeof(struct entry3), 0, sizeof(struct entry3)); \ + } \ + while (0) + +#define NFS_DIR_ENTRY_FREE(entry) \ + do \ + { \ + free(entry->contents); \ + entry->contents = NULL; \ + free(entry); \ + entry = NULL; \ + } \ + while (0) + + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static int nfs_filecreate(FAR struct nfsmount *nmp, + FAR struct nfsnode *np, FAR const char *relpath, + int oflags, mode_t mode); +static int nfs_filetruncate(FAR struct nfsmount *nmp, + FAR struct nfsnode *np, uint32_t length); +static int nfs_fileopen(FAR struct nfsmount *nmp, + FAR struct nfsnode *np, FAR const char *relpath, + int oflags, mode_t mode); + +static int nfs_open(FAR struct file *filep, const char *relpath, + int oflags, mode_t mode); +static int nfs_close(FAR struct file *filep); +static ssize_t nfs_read(FAR struct file *filep, char *buffer, size_t buflen); +static ssize_t nfs_write(FAR struct file *filep, const char *buffer, + size_t buflen); +static off_t nfs_seek(FAR struct file *filep, off_t offset, int whence); +static loff_t nfs_seek64(FAR struct file *filep, loff_t offset, int whence); +static int nfs_dup(FAR const struct file *oldp, FAR struct file *newp); +static int nfs_opendir(struct inode *mountpt, const char *relpath, + struct fs_dirent_s *dir); +static int nfs_closedir(FAR struct inode *mountpt, FAR struct fs_dirent_s *dir); +static int nfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir); +static int nfs_rewinddir(FAR struct inode *mountpt, + FAR struct fs_dirent_s *dir); +static void nfs_decode_args(FAR struct nfs_mount_parameters *nprmt, + FAR struct nfs_args *argp); +static int nfs_bind(FAR struct inode *blkdriver, const void *data, + void **handle, FAR const char *realpath); +static int nfs_unbind(void *handle, FAR struct inode **blkdriver); +static int nfs_statfs(FAR struct inode *mountpt, + FAR struct statfs *buf); +static int nfs_remove(FAR struct inode *mountpt, + FAR const char *relpath); +static int nfs_mkdir(FAR struct inode *mountpt, + FAR const char *relpath, mode_t mode); +static int nfs_rmdir(FAR struct inode *mountpt, + FAR const char *relpath); +static int nfs_rename(FAR struct inode *mountpt, + FAR const char *oldrelpath, FAR const char *newrelpath); +static void nfs_stat_common(FAR struct nfs_statinfo_s *info, + FAR struct stat *buf); +static int nfs_stat(struct inode *mountpt, FAR const char *relpath, + FAR struct stat *buf); + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* nfs vfs operations. */ + +const struct mountpt_operations nfs_operations = +{ + nfs_open, /* open */ + nfs_close, /* close */ + nfs_read, /* read */ + nfs_write, /* write */ + nfs_seek, /* seek */ + NULL, /* ioctl */ + OsVfsFileMmap, /* mmap */ + + NULL, /* sync */ + nfs_dup, /* dup */ + NULL, /* fstat */ + NULL, /* truncate */ + + nfs_opendir, /* opendir */ + nfs_closedir, /* closedir */ + nfs_readdir, /* readdir */ + nfs_rewinddir, /* rewinddir */ + + nfs_bind, /* bind */ + nfs_unbind, /* unbind */ + nfs_statfs, /* statfs */ + NULL, /* virstatfs */ + nfs_remove, /* unlink */ + nfs_mkdir, /* mkdir */ + nfs_rmdir, /* rmdir */ + nfs_rename, /* rename */ + nfs_stat, /* stat */ + NULL, /* for utime */ + NULL, /* chattr */ + nfs_seek64, /* seek64 */ + NULL, /* getlabel */ + NULL, /* fallocate */ + NULL, /* fallocate64 */ + NULL, /* truncate64 */ + NULL, /* fscheck */ + NULL, /* map_pages */ + NULL, /* readpage */ + NULL, /* writepage */ +}; + +FSMAP_ENTRY(nfs_fsmap, "nfs", nfs_operations, FALSE, FALSE); + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: nfs_filecreate + * + * Description: + * Create a file. This is part of the file open logic that is executed if + * the user asks to create a file. + * + * Returned Value: + * 0 on success; a positive errno value on failure. + * + ****************************************************************************/ + +static int nfs_filecreate(FAR struct nfsmount *nmp, FAR struct nfsnode *np, + FAR const char *relpath, int oflags, mode_t mode) +{ + struct file_handle fhandle; + struct nfs_fattr fattr; + char filename[NAME_MAX + 1]; + FAR uint32_t *ptr; + uint32_t tmp; + int namelen; + int reqlen; + int error; + + /* Find the NFS node of the directory containing the file to be created */ + + error = nfs_finddir(nmp, relpath, &fhandle, &fattr, filename); + if (error != OK) + { + ferr("ERROR: nfs_finddir returned: %d\n", error); + return error; + } + + /* Create the CREATE RPC call arguments */ + + ptr = (FAR uint32_t *)&nmp->nm_msgbuffer.create.create; + reqlen = 0; + + /* Copy the variable length, directory file handle */ + + *ptr++ = txdr_unsigned(fhandle.length); + reqlen += sizeof(uint32_t); + + memcpy(ptr, &fhandle.handle, fhandle.length); + reqlen += (int)fhandle.length; + ptr += uint32_increment(fhandle.length); + + /* Copy the variable-length file name */ + + namelen = strlen(filename); + + *ptr++ = txdr_unsigned(namelen); + reqlen += sizeof(uint32_t); + + memcpy(ptr, filename, namelen); + ptr += uint32_increment(namelen); + reqlen += uint32_alignup(namelen); + + /* Set the creation mode */ + +#ifdef USE_GUARDED_CREATE + *ptr++ = htonl(NFSV3CREATE_GUARDED); +#else + *ptr++ = htonl(NFSV3CREATE_EXCLUSIVE); +#endif + + reqlen += sizeof(uint32_t); + + /* Mode information is not provided if EXCLUSIVE creation is used. + * in this case, we must call SETATTR after successfully creating + * the file. + */ + +#ifndef USE_GUARDED_CREATE + if ((oflags & O_CREAT) == 0) +#endif + { + /* Set the mode. NOTE: Here we depend on the fact that the NuttX and NFS + * bit settings are the same (at least for the bits of interest). + */ + + *ptr++ = nfs_true; /* True: mode value follows */ + reqlen += sizeof(uint32_t); + + tmp = mode & (NFSMODE_IWOTH | NFSMODE_IROTH | NFSMODE_IWGRP | + NFSMODE_IRGRP | NFSMODE_IWUSR | NFSMODE_IRUSR); + *ptr++ = txdr_unsigned(tmp); + reqlen += sizeof(uint32_t); + + /* Set the user ID to zero */ + + *ptr++ = nfs_true; /* True: Uid value follows */ + *ptr++ = 0; /* UID = 0 (nobody) */ + reqlen += 2*sizeof(uint32_t); + + /* Set the group ID to one */ + + *ptr++ = nfs_true; /* True: Gid value follows */ + *ptr++ = htonl(1); /* GID = 1 (nogroup) */ + reqlen += 2*sizeof(uint32_t); + + /* Set the size to zero */ + + *ptr++ = nfs_true; /* True: Size value follows */ + *ptr++ = 0; /* Size = 0 */ + *ptr++ = 0; + reqlen += 3*sizeof(uint32_t); + + /* Don't change times */ + + *ptr++ = htonl(NFSV3SATTRTIME_DONTCHANGE); /* Don't change atime */ + *ptr++ = htonl(NFSV3SATTRTIME_DONTCHANGE); /* Don't change mtime */ + reqlen += 2*sizeof(uint32_t); + } + + /* Send the NFS request. Note there is special logic here to handle version 3 + * exclusive open semantics. + */ + + do + { + nfs_statistics(NFSPROC_CREATE); + error = nfs_request(nmp, NFSPROC_CREATE, + (FAR void *)&nmp->nm_msgbuffer.create, reqlen, + (FAR void *)nmp->nm_iobuffer, nmp->nm_buflen); + } +#ifdef USE_GUARDED_CREATE + while (0); +#else + while (((oflags & O_CREAT) != 0) && error == EOPNOTSUPP); +#endif + + /* Check for success */ + + if (error == OK) + { + /* Parse the returned data */ + + ptr = (FAR uint32_t *)&((FAR struct rpc_reply_create *) + nmp->nm_iobuffer)->create; + + /* Save the file handle in the file data structure */ + + tmp = *ptr++; /* handle_follows */ + if (!tmp) + { + ferr("ERROR: no file handle follows\n"); + return EINVAL; + } + + tmp = *ptr++; + tmp = fxdr_unsigned(uint32_t, tmp); + DEBUGASSERT(tmp <= NFSX_V3FHMAX); + + np->n_fhsize = (uint8_t)tmp; + memcpy(&np->n_fhandle, ptr, tmp); + ptr += uint32_increment(tmp); + + /* Save the attributes in the file data structure */ + + tmp = *ptr; /* handle_follows */ + if (!tmp) + { + fwarn("WARNING: no file attributes\n"); + } + else + { + /* Initialize the file attributes */ + + nfs_attrupdate(np, (FAR struct nfs_fattr *)ptr); + } + + /* Any following dir_wcc data is ignored for now */ + } + + return error; +} + +/**************************************************************************** + * Name: nfs_fileopen + * + * Description: + * Truncate an open file to zero length. This is part of the file open + * logic. + * + * Returned Value: + * 0 on success; a positive errno value on failure. + * + ****************************************************************************/ + +static int nfs_filetruncate(FAR struct nfsmount *nmp, + FAR struct nfsnode *np, uint32_t length) +{ + FAR uint32_t *ptr; + int reqlen; + int error; + + finfo("Truncating file\n"); + + /* Create the SETATTR RPC call arguments */ + + ptr = (FAR uint32_t *)&nmp->nm_msgbuffer.setattr.setattr; + reqlen = 0; + + /* Copy the variable length, directory file handle */ + + *ptr++ = txdr_unsigned(np->n_fhsize); + reqlen += sizeof(uint32_t); + + memcpy(ptr, &np->n_fhandle, np->n_fhsize); + reqlen += (int)np->n_fhsize; + ptr += uint32_increment(np->n_fhsize); + + /* Copy the variable-length attributes */ + + *ptr++ = nfs_false; /* Don't change mode */ + *ptr++ = nfs_false; /* Don't change uid */ + *ptr++ = nfs_false; /* Don't change gid */ + *ptr++ = nfs_true; /* Use the following size */ + *ptr++ = length; /* Truncate to the specified length */ + *ptr++ = 0; + *ptr++ = htonl(NFSV3SATTRTIME_TOSERVER); /* Use the server's time */ + *ptr++ = htonl(NFSV3SATTRTIME_TOSERVER); /* Use the server's time */ + *ptr++ = nfs_false; /* No guard value */ + reqlen += 9 * sizeof(uint32_t); + + /* Perform the SETATTR RPC */ + + nfs_statistics(NFSPROC_SETATTR); + error = nfs_request(nmp, NFSPROC_SETATTR, + (FAR void *)&nmp->nm_msgbuffer.setattr, reqlen, + (FAR void *)nmp->nm_iobuffer, nmp->nm_buflen); + if (error != OK) + { + ferr("ERROR: nfs_request failed: %d\n", error); + return error; + } + + /* Indicate that the file now has zero length */ + + np->n_size = 0; + return OK; +} + +/**************************************************************************** + * Name: nfs_fileopen + * + * Description: + * Open a file. This is part of the file open logic that attempts to open + * an existing file. + * + * Returned Value: + * 0 on success; a positive errno value on failure. + * + ****************************************************************************/ + +static int nfs_fileopen(FAR struct nfsmount *nmp, FAR struct nfsnode *np, + FAR const char *relpath, int oflags, mode_t mode) +{ + struct file_handle fhandle; + struct nfs_fattr fattr; + uint32_t tmp; + int error = 0; + + /* Find the NFS node associate with the path */ + + error = nfs_findnode(nmp, relpath, &fhandle, &fattr, NULL); + if (error != OK) + { + ferr("ERROR: nfs_findnode returned: %d\n", error); + return error; + } + + /* Check if the object is a directory */ + + tmp = fxdr_unsigned(uint32_t, fattr.fa_type); + if (tmp == NFDIR) + { + /* Exit with EISDIR if we attempt to open a directory */ + + ferr("ERROR: Path is a directory\n"); + return EISDIR; + } + + /* Check if the caller has sufficient privileges to open the file */ + + if ((oflags & O_WRONLY) != 0) + { + /* Check if anyone has priveleges to write to the file -- owner, + * group, or other (we are probably "other" and may still not be + * able to write). + */ + + tmp = fxdr_unsigned(uint32_t, fattr.fa_mode); + if ((tmp & (NFSMODE_IWOTH | NFSMODE_IWGRP | NFSMODE_IWUSR)) == 0) + { + ferr("ERROR: File is read-only: %08x\n", tmp); + return EACCES; + } + } + + /* It would be an error if we are asked to create the file exclusively */ + + if ((oflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) + { + /* Already exists -- can't create it exclusively */ + + ferr("ERROR: File exists\n"); + return EEXIST; + } + + /* Initialize the file private data. + * + * Copy the file handle. + */ + + np->n_fhsize = (uint8_t)fhandle.length; + memcpy(&np->n_fhandle, &fhandle.handle, fhandle.length); + + /* Save the file attributes */ + + nfs_attrupdate(np, &fattr); + + /* If O_TRUNC is specified and the file is opened for writing, + * then truncate the file. This operation requires that the file is + * writable, but we have already checked that. O_TRUNC without write + * access is ignored. + */ + + if ((oflags & O_TRUNC) && (oflags & (O_WRONLY | O_RDWR))) + { + /* Truncate the file to zero length. I think we can do this with + * the SETATTR call by setting the length to zero. + */ + + return nfs_filetruncate(nmp, np, 0); + } + + return OK; +} + +/**************************************************************************** + * Name: nfs_fileupdate + * + * Description: + * This is to update the file attributes like size, type. This sends a LOOKUP msg of nfs + * to get latest file attributes. + * + * Returned Value: + * 0 on success; a positive errno value on failure. + * + ****************************************************************************/ + +static int nfs_fileupdate(FAR struct nfsmount *nmp, struct nfsnode *np, + FAR const char *relpath) +{ + struct file_handle fhandle; + struct nfs_fattr fattr; + int error; + + /* Find the NFS node associate with the path */ + + error = nfs_findnode(nmp, relpath, &fhandle, &fattr, (struct nfs_fattr *)NULL); + if (error != OK) + { + fdbg("ERROR: nfs_findnode returned: %d\n", error); + return error; + } + + /* Update the file handle */ + + error = memcpy_s(&np->n_fhandle, NFSX_V3FHMAX, &fhandle.handle, fhandle.length); + if (error != EOK) + { + return ENOBUFS; + } + + np->n_fhsize = fhandle.length; + + /* Save the file attributes */ + + nfs_attrupdate(np, &fattr); + + return OK; +} + +/**************************************************************************** + * Name: nfs_open + * + * Description: + * If oflags == O_CREAT it creates a file, if not it check to see if the + * type is ok and that deletion is not in progress. + * + * Returned Value: + * 0 on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int nfs_open(FAR struct file *filep, FAR const char *relpath, + int oflags, mode_t mode) +{ + struct nfsmount *nmp; + struct nfsnode *np; + int error; + + /* Sanity checks */ + + DEBUGASSERT(filep->f_inode != NULL); + + /* Get the mountpoint inode reference from the file structure and the + * mountpoint private data from the inode structure + */ + + nmp = (FAR struct nfsmount *)filep->f_inode->i_private; + DEBUGASSERT(nmp != NULL); + + /* Pre-allocate the file private data to describe the opened file. */ + + np = (struct nfsnode *)malloc(sizeof(struct nfsnode)); + if (!np) + { + ferr("ERROR: Failed to allocate private data\n"); + return ENOMEM; + } + + (void)memset_s(np, sizeof(struct nfsnode), 0, sizeof(struct nfsnode)); + + /* Check if the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + ferr("ERROR: nfs_checkmount failed: %d\n", error); + goto errout_with_mutex; + } + + /* Try to open an existing file at that path */ + + error = nfs_fileopen(nmp, np, relpath, oflags, mode); + if (error != OK) + { + /* An error occurred while trying to open the existing file. Check if + * the open failed because the file does not exist. That is not + * necessarily an error; that may only mean that we have to create the + * file. + */ + + if (error != ENOENT) + { + ferr("ERROR: nfs_findnode failed: %d\n", error); + goto errout_with_mutex; + } + + /* The file does not exist. Check if we were asked to create the file. If + * the O_CREAT bit is set in the oflags then we should create the file if it + * does not exist. + */ + + if ((oflags & O_CREAT) == 0) + { + /* Return ENOENT if the file does not exist and we were not asked + * to create it. + */ + + ferr("ERROR: File does not exist\n"); + error = ENOENT; + goto errout_with_mutex; + } + + /* Create the file */ + + error = nfs_filecreate(nmp, np, relpath, oflags, mode); + if (error != OK) + { + ferr("ERROR: nfs_filecreate failed: %d\n", error); + goto errout_with_mutex; + } + } + + /* Initialize the file private data (only need to initialize + * non-zero elements) + */ + + np->n_crefs = 1; + + /* Attach the private data to the struct file instance */ + + filep->f_priv = np; + + /* Then insert the new instance at the head of the list in the mountpoint + * tructure. It needs to be there (1) to handle error conditions that effect + * all files, and (2) to inform the umount logic that we are busy. We + * cannot unmount the file system if this list is not empty! + */ + + np->n_next = nmp->nm_head; + nmp->nm_head = np; + + np->n_flags |= (NFSNODE_OPEN | NFSNODE_MODIFIED); + np->n_oflags = oflags; + + if (filep->f_oflags & O_APPEND) + { + np->n_fpos = np->n_size; + } + else + { + np->n_fpos = 0; + } + filep->f_pos = np->n_fpos; + np->n_filep = filep; + + nfs_mux_release(nmp); + return OK; + +errout_with_mutex: + if (np) + { + free(np); + } + + nfs_mux_release(nmp); + return -error; +} + +/**************************************************************************** + * Name: nfs_close + * + * Description: + * Close a file. + * + * Returned Value: + * 0 on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int nfs_close(FAR struct file *filep) +{ + FAR struct nfsmount *nmp; + FAR struct nfsnode *np; + FAR struct nfsnode *prev; + FAR struct nfsnode *curr; + int ret; + + /* Sanity checks */ + + DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL); + + /* Recover our private data from the struct file instance */ + + nmp = (FAR struct nfsmount *) filep->f_inode->i_private; + np = (FAR struct nfsnode *) filep->f_priv; + + DEBUGASSERT(nmp != NULL); + + /* Get exclusive access to the mount structure. */ + + nfs_mux_take(nmp); + + /* Decrement the reference count. If the reference count would not + * decrement to zero, then that is all we have to do. + */ + + if (np->n_crefs > 1) + { + np->n_crefs--; + ret = OK; + } + + /* There are no more references to the file structure. Now we need to + * free up all resources associated with the open file. + * + * First, find our file structure in the list of file structures + * containted in the mount structure. + */ + + else + { + /* Assume file structure will not be found. This should never happen. */ + + ret = -EINVAL; + + for (prev = NULL, curr = nmp->nm_head; + curr; + prev = curr, curr = curr->n_next) + { + /* Check if this node is ours */ + + if (np == curr) + { + /* Yes.. remove it from the list of file structures */ + + if (prev) + { + /* Remove from mid-list */ + + prev->n_next = np->n_next; + } + else + { + /* Remove from the head of the list */ + + nmp->nm_head = np->n_next; + } + + /* Then deallocate the file structure and return success */ + + free(np); + filep->f_priv = NULL; + ret = OK; + break; + } + } + } + + nfs_mux_release(nmp); + + /* Drop the NFS file page cache if no one, except me, is working on it, to ensure + * the close-to-open cache consistency for NFS files. + * And because the outer "files_close" has locked the global file list already, + * we use the nolock version here. + */ + + (void)remove_mapping_nolock(filep->f_path, filep); + + return ret; +} + +/**************************************************************************** + * Name: nfs_read + * + * Returned Value: + * The (non-negative) number of bytes read on success; a negated errno + * value on failure. + * + ****************************************************************************/ + +static ssize_t nfs_read(FAR struct file *filep, char *buffer, size_t buflen) +{ + FAR struct nfsmount *nmp; + FAR struct nfsnode *np; + struct rpc_reply_read *read_response; + size_t readsize; + size_t tmp; + size_t bytesread; + size_t reqlen; + FAR uint32_t *ptr; + int error = 0; + + finfo("Read %d bytes from offset %d\n", buflen, filep->f_pos); + + /* Sanity checks */ + + DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL); + + /* Recover our private data from the struct file instance */ + + nmp = (FAR struct nfsmount *)filep->f_inode->i_private; + np = (FAR struct nfsnode *)filep->f_priv; + + DEBUGASSERT(nmp != NULL); + + /* Make sure that the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + ferr("ERROR: nfs_checkmount failed: %d\n", error); + goto errout_with_mutex; + } + + fvdbg("File attributes before update, file size %d, file type %d\n", np->n_size, np->n_type); + + error = nfs_fileupdate(nmp, np, filep->f_relpath); + if (error != OK) + { + fdbg("nfs_fileupdate failed: %d\n", error); + goto errout_with_mutex; + } + + fvdbg("File attributes after update, file size %d, file type %d\n", np->n_size, np->n_type); + + /* Get the number of bytes left in the file and truncate read count so that + * it does not exceed the number of bytes left in the file. + */ + + tmp = np->n_size - filep->f_pos; + if (buflen > tmp) + { + buflen = tmp; + finfo("Read size truncated to %d\n", buflen); + } + + /* Now loop until we fill the user buffer (or hit the end of the file) */ + + for (bytesread = 0; bytesread < buflen; ) + { + /* Make sure that the attempted read size does not exceed the RPC maximum */ + + readsize = buflen - bytesread; + if (readsize > nmp->nm_rsize) + { + readsize = nmp->nm_rsize; + } + + /* Make sure that the attempted read size does not exceed the IO buffer size */ + + tmp = SIZEOF_rpc_reply_read(readsize); + if (tmp > nmp->nm_buflen) + { + readsize -= (tmp - nmp->nm_buflen); + } + + /* Initialize the request */ + + ptr = (FAR uint32_t *)&nmp->nm_msgbuffer.read.read; + reqlen = 0; + + /* Copy the variable length, file handle */ + + *ptr++ = txdr_unsigned((uint32_t)np->n_fhsize); + reqlen += sizeof(uint32_t); + + memcpy(ptr, &np->n_fhandle, np->n_fhsize); + reqlen += (int)np->n_fhsize; + ptr += uint32_increment((int)np->n_fhsize); + + /* Copy the file offset */ + + txdr_hyper((uint64_t)filep->f_pos, ptr); + ptr += 2; + reqlen += 2*sizeof(uint32_t); + + /* Set the readsize */ + + *ptr = txdr_unsigned(readsize); + reqlen += sizeof(uint32_t); + + /* Perform the read */ + + finfo("Reading %d bytes\n", readsize); + nfs_statistics(NFSPROC_READ); + error = nfs_request(nmp, NFSPROC_READ, + (FAR void *)&nmp->nm_msgbuffer.read, reqlen, + (FAR void *)nmp->nm_iobuffer, nmp->nm_buflen); + if (error) + { + ferr("ERROR: nfs_request failed: %d\n", error); + goto errout_with_mutex; + } + + /* The read was successful. Get a pointer to the beginning of the NFS + * response data. + */ + + read_response = (struct rpc_reply_read *)nmp->nm_iobuffer; + readsize = fxdr_unsigned(uint32_t, read_response->read.hdr.count); + + /* Copy the read data into the user buffer */ + + if (LOS_CopyFromKernel(buffer, buflen, (const void *)read_response->read.data, readsize) != 0) + { + error = EINVAL; + goto errout_with_mutex; + } + + /* Update the read state data */ + + filep->f_pos += readsize; + np->n_fpos += readsize; + bytesread += readsize; + buffer += readsize; + + /* Check if we hit the end of file */ + + if (read_response->read.hdr.eof != 0) + { + break; + } + } + + finfo("Read %d bytes\n", bytesread); + nfs_mux_release(nmp); + return bytesread; + +errout_with_mutex: + nfs_mux_release(nmp); + return -error; +} + +/**************************************************************************** + * Name: nfs_write + * + * Returned Value: + * The (non-negative) number of bytes written on success; a negated errno + * value on failure. + * + ****************************************************************************/ + +static ssize_t nfs_write(FAR struct file *filep, const char *buffer, + size_t buflen) +{ + struct nfsmount *nmp; + struct nfsnode *np; + loff_t f_pos; + size_t writesize; + size_t bufsize; + size_t byteswritten; + size_t reqlen; + FAR uint32_t *ptr; + uint32_t tmp; + int committed = NFSV3WRITE_UNSTABLE; + int error; + + /* Sanity checks */ + + DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL); + + /* Recover our private data from the struct file instance */ + + nmp = (FAR struct nfsmount *)filep->f_inode->i_private; + np = (FAR struct nfsnode *)filep->f_priv; + + DEBUGASSERT(nmp != NULL); + + /* Make sure that the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + ferr("ERROR: nfs_checkmount failed: %d\n", error); + goto errout_with_mutex; + } + + if (filep->f_oflags & O_APPEND) + { + if (nfs_fileupdate(nmp, np, filep->f_relpath) == OK) + { + f_pos = np->n_size; + } + else + { + error = EAGAIN; + goto errout_with_mutex; + } + } + else + { + f_pos = np->n_fpos; + } + + /* Check if the file size would exceed the range of off_t */ + + if (np->n_size + buflen < np->n_size) + { + error = EFBIG; + goto errout_with_mutex; + } + + fvdbg("Write %d bytes to offset %d\n", buflen, np->n_fpos); + + /* Now loop until we send the entire user buffer */ + + writesize = 0; + for (byteswritten = 0; byteswritten < buflen; ) + { + /* Make sure that the attempted write size does not exceed the RPC + * maximum. + */ + + writesize = buflen - byteswritten; + if (writesize > nmp->nm_wsize) + { + writesize = nmp->nm_wsize; + } + + /* Make sure that the attempted read size does not exceed the IO + * buffer size. + */ + + bufsize = SIZEOF_rpc_call_write(writesize); + if (bufsize > nmp->nm_buflen) + { + writesize -= (bufsize - nmp->nm_buflen); + } + + /* Initialize the request. Here we need an offset pointer to the write + * arguments, skipping over the RPC header. Write is unique among the + * RPC calls in that the entry RPC calls messasge lies in the I/O buffer + */ + + ptr = (FAR uint32_t *)&((FAR struct rpc_call_write *) + nmp->nm_iobuffer)->write; + reqlen = 0; + + /* Copy the variable length, file handle */ + + *ptr++ = txdr_unsigned((uint32_t)np->n_fhsize); + reqlen += sizeof(uint32_t); + + memcpy(ptr, &np->n_fhandle, np->n_fhsize); + reqlen += (int)np->n_fhsize; + ptr += uint32_increment((int)np->n_fhsize); + + /* Copy the file offset */ + + txdr_hyper((uint64_t)f_pos, ptr); + ptr += 2; + reqlen += 2*sizeof(uint32_t); + + /* Copy the count and stable values */ + + *ptr++ = txdr_unsigned(writesize); + *ptr++ = txdr_unsigned((uint32_t)committed); + reqlen += 2*sizeof(uint32_t); + + /* Copy a chunk of the user data into the I/O buffer */ + + *ptr++ = txdr_unsigned(writesize); + reqlen += sizeof(uint32_t); + if (LOS_CopyToKernel(ptr, writesize, buffer, writesize) != 0) + { + error = EINVAL; + goto errout_with_mutex; + } + + reqlen += uint32_alignup(writesize); + + /* Perform the write */ + + nfs_statistics(NFSPROC_WRITE); + error = nfs_request(nmp, NFSPROC_WRITE, + (FAR void *)nmp->nm_iobuffer, reqlen, + (FAR void *)&nmp->nm_msgbuffer.write, + sizeof(struct rpc_reply_write)); + if (error) + { + ferr("ERROR: nfs_request failed: %d\n", error); + goto errout_with_mutex; + } + + /* Get a pointer to the WRITE reply data */ + + ptr = (FAR uint32_t *)&nmp->nm_msgbuffer.write.write; + + /* Parse file_wcc. First, check if WCC attributes follow. */ + + tmp = *ptr++; + if (tmp != 0) + { + /* Yes.. WCC attributes follow. But we just skip over them. */ + + ptr += uint32_increment(sizeof(struct wcc_attr)); + } + + /* Check if normal file attributes follow */ + + tmp = *ptr++; + if (tmp != 0) + { + /* Yes.. Update the cached file status in the file structure. */ + + nfs_attrupdate(np, (FAR struct nfs_fattr *)ptr); + ptr += uint32_increment(sizeof(struct nfs_fattr)); + } + + /* Get the count of bytes actually written */ + + tmp = fxdr_unsigned(uint32_t, *ptr); + ptr++; + + if (tmp < 1 || tmp > writesize) + { + error = EIO; + goto errout_with_mutex; + } + + writesize = tmp; + f_pos += writesize; + filep->f_pos = f_pos; + np->n_fpos = f_pos; + + /* Update the read state data */ + + if (filep->f_pos > (loff_t)np->n_size) + { + np->n_size = f_pos; + } + byteswritten += writesize; + buffer += writesize; + } + + nfs_mux_release(nmp); + return byteswritten; + +errout_with_mutex: + nfs_mux_release(nmp); + return -error; +} + + +static off_t nfs_seek(FAR struct file *filep, off_t offset, int whence) +{ + FAR struct nfsmount *nmp; + FAR struct nfsnode *np; + int error; + off_t position; + + fvdbg("Seek started, offset %d whence %d current file pos %lld\n", offset, whence, filep->f_pos); + + /* Sanity checks */ + + DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL); + + /* Recover our private data from the struct file instance */ + + nmp = (FAR struct nfsmount *)filep->f_inode->i_private; + np = (FAR struct nfsnode *)filep->f_priv; + + DEBUGASSERT(nmp != NULL); + + /* Make sure that the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + fdbg("nfs_checkmount failed: %d\n", error); + goto errout_with_mutex; + } + + + filep->f_pos = np->n_fpos; + switch (whence) + { + case SEEK_SET: /* The offset is set to offset bytes. */ + position = offset; + break; + + case SEEK_CUR: /* The offset is set to its current location plus offset bytes. */ + position = offset + (off_t)np->n_fpos; + break; + + case SEEK_END: /* The offset is set to the size of the file plus offset bytes. */ + position = offset + np->n_size; + break; + + default: + error = EINVAL; + goto errout_with_mutex; + } + + /* Attempts to set the position beyound the end of file will + * work if the file is open for write access. + */ + + if ((position > (off_t)np->n_size) && ((np->n_oflags & O_WRONLY) == 0) && + ((np->n_oflags & O_RDWR) == 0)) + { + position = np->n_size; + } + + /* position less than 0 should be reset to 0 */ + + if (position < 0) + { + position = 0; + } + + np->n_fpos = (loff_t)position; + filep->f_pos = np->n_fpos; + if (position > (off_t)np->n_size) + { + np->n_size = (loff_t)position; + } + + fvdbg("Seek finished, offset %d whence %d current file pos %lld\n", offset, whence, filep->f_pos); + nfs_mux_release(nmp); + return (off_t)filep->f_pos; + +errout_with_mutex: + nfs_mux_release(nmp); + return -error; +} + +static loff_t nfs_seek64(FAR struct file *filep, loff_t offset, int whence) +{ + FAR struct nfsmount *nmp; + FAR struct nfsnode *np; + int error; + loff_t position; + + fvdbg("Seek started, offset %d whence %d current file pos %d\n", offset, whence, filep->f_pos); + + /* Sanity checks */ + + DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL); + + /* Recover our private data from the struct file instance */ + + nmp = (FAR struct nfsmount *)filep->f_inode->i_private; + np = (FAR struct nfsnode *)filep->f_priv; + + DEBUGASSERT(nmp != NULL); + + /* Make sure that the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + fdbg("nfs_checkmount failed: %d\n", error); + goto errout_with_mutex; + } + + filep->f_pos = np->n_fpos; + switch (whence) + { + case SEEK_SET: /* The offset is set to offset bytes. */ + position = offset; + break; + + case SEEK_CUR: /* The offset is set to its current location plus offset bytes. */ + position = offset + np->n_fpos; + break; + + case SEEK_END: /* The offset is set to the size of the file plus offset bytes. */ + position = offset + np->n_size; + break; + + default: + error = EINVAL; + goto errout_with_mutex; + } + + /* Attempts to set the position beyound the end of file will + * work if the file is open for write access. + */ + + if ((position > (off_t)np->n_size) && ((np->n_oflags & O_WRONLY) == 0) && + ((np->n_oflags & O_RDWR) == 0)) + { + position = np->n_size; + } + + /* position less than 0 should be reset to 0 */ + + if (position < 0) + { + position = 0; + } + + np->n_fpos = position; + filep->f_pos = np->n_fpos; + if (position > (loff_t)np->n_size) + { + np->n_size = (uint64_t)position; + } + + fvdbg("Seek finished, offset %d whence %d current file pos %d\n", offset, whence, filep->f_pos); + nfs_mux_release(nmp); + return filep->f_pos; + +errout_with_mutex: + nfs_mux_release(nmp); + return -error; +} + +/**************************************************************************** + * Name: nfs_dup + * + * Description: + * Duplicate open file data in the new file structure. + * + ****************************************************************************/ + +static int nfs_dup(FAR const struct file *oldp, FAR struct file *newp) +{ + struct nfsmount *nmp; + FAR struct nfsnode *np; + int error; + + finfo("Dup %p->%p\n", oldp, newp); + + /* Sanity checks */ + + DEBUGASSERT(oldp->f_priv != NULL && oldp->f_inode != NULL); + + /* Recover our private data from the struct file instance */ + + nmp = (FAR struct nfsmount *)oldp->f_inode->i_private; + np = (FAR struct nfsnode *)oldp->f_priv; + + DEBUGASSERT(nmp != NULL); + + /* Check if the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + ferr("ERROR: nfs_checkmount failed: %d\n", error); + nfs_mux_release(nmp); + return -error; + } + + /* Increment the reference count on the NFS node structure */ + + DEBUGASSERT(np->n_crefs < 0xff); + np->n_crefs++; + + /* And save this as the file data for the new node */ + + newp->f_priv = np; + + nfs_mux_release(nmp); + return OK; +} + +/**************************************************************************** + * Name: nfs_opendir + * + * Description: + * Open a directory for read access + * + * Returned Value: + * 0 on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int nfs_opendir(struct inode *mountpt, const char *relpath, + struct fs_dirent_s *dir) +{ + struct nfsmount *nmp; + struct file_handle fhandle; + struct nfs_fattr obj_attributes; + struct nfsdir_s *nfs_dir; + uint32_t objtype; + int error; + + finfo("relpath: \"%s\"\n", relpath ? relpath : "NULL"); + + /* Sanity checks */ + + DEBUGASSERT(mountpt != NULL && mountpt->i_private != NULL && dir); + + /* Recover our private data from the inode instance */ + + nmp = mountpt->i_private; + + /* Make sure that the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + ferr("ERROR: nfs_checkmount failed: %d\n", error); + goto errout_with_mutex; + } + + /* Find the NFS node associate with the path */ + + error = nfs_findnode(nmp, relpath, &fhandle, &obj_attributes, NULL); + if (error != OK) + { + ferr("ERROR: nfs_findnode failed: %d\n", error); + goto errout_with_mutex; + } + + /* The entry is a directory */ + + objtype = fxdr_unsigned(uint32_t, obj_attributes.fa_type); + if (objtype != NFDIR) + { + ferr("ERROR: Not a directory, type=%d\n", objtype); + error = ENOTDIR; + goto errout_with_mutex; + } + + /* Save the directory information in struct fs_dirent_s so that it can be + * used later when readdir() is called. + */ + + nfs_dir = (struct nfsdir_s *)malloc(sizeof(struct nfsdir_s)); + if (!nfs_dir) + { + error = ENOMEM; + goto errout_with_mutex; + } + + nfs_dir->nfs_fhsize = (uint8_t)fhandle.length; + nfs_dir->nfs_cookie[0] = 0; + nfs_dir->nfs_cookie[1] = 0; + + DEBUGASSERT(fhandle.length <= DIRENT_NFS_MAXHANDLE); + (void)memcpy_s(nfs_dir->nfs_fhandle, DIRENT_NFS_MAXHANDLE, &fhandle.handle, DIRENT_NFS_MAXHANDLE); + + dir->u.fs_dir = (fs_dir_s)nfs_dir; + error = OK; + + nfs_dir->nfs_next = nmp->nm_dir; + nmp->nm_dir = nfs_dir; + nfs_dir->nfs_dir = dir; + nfs_dir->nfs_entries = NULL; + +errout_with_mutex: + nfs_mux_release(nmp); + return -error; +} + +static int nfs_closedir(FAR struct inode *mountpt, FAR struct fs_dirent_s *dir) +{ + struct nfsmount *nmp; + FAR struct nfsdir_s *prev; + FAR struct nfsdir_s *curr; + struct nfsdir_s *nfs_dir; + struct entry3 *entry_pos; + int ret; + + /* Sanity checks */ + + DEBUGASSERT(mountpt != NULL && mountpt->i_private != NULL && dir); + + /* Recover our private data from the inode instance */ + + nmp = (struct nfsmount *)mountpt->i_private; + + nfs_dir = (struct nfsdir_s *)(dir->u.fs_dir); + + DEBUGASSERT(nmp != NULL); + + /* Get exclusive access to the mount structure. */ + + nfs_mux_take(nmp); + + for (entry_pos = nfs_dir->nfs_entries; entry_pos != NULL; entry_pos = nfs_dir->nfs_entries) + { + nfs_dir->nfs_entries = entry_pos->next; + NFS_DIR_ENTRY_FREE(entry_pos); + } + + /* Assume file structure will not be found. This should never happen. */ + + ret = -EINVAL; + + for (prev = (struct nfsdir_s *)NULL, curr = nmp->nm_dir; + curr; + prev = curr, curr = curr->nfs_next) + { + /* Check if this node is ours */ + + if (nfs_dir == curr) + { + /* Yes.. remove it from the list of file structures */ + + if (prev) + { + /* Remove from mid-list */ + + prev->nfs_next = nfs_dir->nfs_next; + } + else + { + /* Remove from the head of the list */ + + nmp->nm_dir= nfs_dir->nfs_next; + } + + /* Then deallocate the file structure and return success */ + + free(nfs_dir); + nfs_dir = NULL; + ret = OK; + break; + } + } + nfs_mux_release(nmp); + + return ret; /*lint !e438*/ +} + +/**************************************************************************** + * Name: nfs_readdir + * + * Description: Read from directory + * + * Returned Value: + * 0 on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int nfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir) +{ + struct nfsmount *nmp; + struct file_handle fhandle; + struct nfs_fattr obj_attributes; + struct nfsdir_s *nfs_dir; + struct entry3 *entry; + struct entry3 *entry_pos; + + /* Use 2 cookies */ + + uint32_t cookies[2]; + uint32_t tmp; + uint32_t *ptr; + size_t d_name_size; + int reqlen; + int error = 0; + + finfo("Entry\n"); + + /* Sanity checks */ + + DEBUGASSERT(mountpt != NULL && mountpt->i_private != NULL); + + /* Recover our private data from the inode instance */ + + nmp = mountpt->i_private; + + /* Make sure that the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + ferr("ERROR: nfs_checkmount failed: %d\n", error); + goto errout_with_mutex; + } + + /* Request a block directory entries, copying directory information from + * the dirent structure. + */ + + nfs_dir = (struct nfsdir_s *)dir->u.fs_dir; + cookies[0] = 0; + cookies[1] = 0; + + if (!nfs_dir->nfs_entries) + { + entry_pos = nfs_dir->nfs_entries; + do + { + ptr = (FAR uint32_t *)&nmp->nm_msgbuffer.readdir.readdir; + reqlen = 0; + + /* Copy the variable length, directory file handle */ + + *ptr++ = txdr_unsigned((uint32_t)nfs_dir->nfs_fhsize); + reqlen += sizeof(uint32_t); + + (void)memcpy_s(ptr, nfs_dir->nfs_fhsize, nfs_dir->nfs_fhandle, nfs_dir->nfs_fhsize); + reqlen += (int)nfs_dir->nfs_fhsize; + ptr += uint32_increment((int)nfs_dir->nfs_fhsize); + + /* Cookie and cookie verifier */ + + ptr[0] = cookies[0]; + ptr[1] = cookies[1]; + ptr += 2; + reqlen += 2 * sizeof(uint32_t); + + (void)memcpy_s(ptr, DIRENT_NFS_VERFLEN, nfs_dir->nfs_verifier, DIRENT_NFS_VERFLEN); + ptr += uint32_increment(DIRENT_NFS_VERFLEN); + reqlen += DIRENT_NFS_VERFLEN; + + /* Number of directory entries (We currently only process one entry at a time) */ + + *ptr = txdr_unsigned((uint32_t)nmp->nm_readdirsize); + reqlen += sizeof(uint32_t); + + /* And read the directory */ + + nfs_statistics(NFSPROC_READDIR); + error = nfs_request(nmp, NFSPROC_READDIR, + (FAR void *)&nmp->nm_msgbuffer.readdir, reqlen, + (FAR void *)nmp->nm_iobuffer, nmp->nm_buflen); + if (error != OK) + { + fdbg("ERROR: nfs_request failed: %d\n", error); + goto errout_with_mutex; + } + + /* A new group of entries was successfully read. Process the + * information contained in the response header. This information + * includes: + * + * 1) Attributes follow indication - 4 bytes + * 2) Directory attributes - sizeof(struct nfs_fattr) + * 3) Cookie verifier - NFSX_V3COOKIEVERF bytes + * 4) Values follows indication - 4 bytes + */ + + ptr = (uint32_t *)&((FAR struct rpc_reply_readdir *)nmp->nm_iobuffer)->readdir; + + /* Check if attributes follow, if 0 so Skip over the attributes */ + + tmp = *ptr++; + if (tmp != 0) + { + /* Attributes are not currently used */ + + ptr += uint32_increment(sizeof(struct nfs_fattr)); + } + + + /* Save the verification cookie */ + + (void)memcpy_s(nfs_dir->nfs_verifier, DIRENT_NFS_VERFLEN, ptr, DIRENT_NFS_VERFLEN); + ptr += uint32_increment(DIRENT_NFS_VERFLEN); + + /* Check if values follow. If no values follow, then the EOF indication + * will appear next. + */ + + tmp = *ptr++; + if (tmp == 0) + { + /* No values follow, then the reply should consist only of a 4-byte + * end-of-directory indication. + */ + + tmp = *ptr++; + if (tmp != 0) + { + fvdbg("End of directory\n"); + error = ENOENT; + } + + /* What would it mean if there were not data and we not at the end of + * file? + */ + + else + { + fvdbg("No data but not end of directory?\n"); + error = EAGAIN; + } + + goto errout_with_mutex; + } + + + /* If we are not at the end of the directory listing, then a set of entries + * will follow the header. Each entry is of the form: + * + * File ID (8 bytes) + * Name length (4 bytes) + * Name string (varaiable size but in multiples of 4 bytes) + * Cookie (8 bytes) + * next entry (4 bytes) + */ + + do + { + NFS_DIR_ENTRY_MALLOC(entry); + + /* There is an entry. Skip over the file ID and point to the length */ + + entry->file_id[0] = *ptr++; + entry->file_id[1] = *ptr++; /*lint !e662 !e661*/ + + + /* Get the length and point to the name */ + + tmp = *ptr++; /*lint !e662 !e661*/ + entry->name_len = fxdr_unsigned(uint32_t, tmp); + entry->contents = (uint8_t *)malloc(entry->name_len + 1); + if (!entry->contents) + { + free(entry); + entry = NULL; + goto errout_with_memory; + } + (void)memset_s(entry->contents, entry->name_len + 1, 0, entry->name_len + 1); + + error = strncpy_s((char *)entry->contents, entry->name_len + 1, (const char *)ptr, entry->name_len); + if (error != EOK) + { + free(entry->contents); + entry->contents = NULL; + free(entry); + entry = NULL; + error = ENOBUFS; + goto errout_with_memory; + } + /* Increment the pointer past the name (allowing for padding). ptr + * now points to the cookie. + */ + + ptr += uint32_increment(entry->name_len); + + /* Save the cookie and increment the pointer to the next entry */ + + entry->cookie[0] = *ptr++; + entry->cookie[1] = *ptr++; + + /* Get the file attributes associated with this name and return + * the file type. + */ + + if (strcmp((char *)entry->contents, ".") == 0 || strcmp((char *)entry->contents, "..") == 0) + { + NFS_DIR_ENTRY_FREE(entry); + continue; + } + + if (!nfs_dir->nfs_entries) + { + entry_pos = entry; + nfs_dir->nfs_entries = entry; + } + else + { + entry_pos->next = entry; + entry_pos = entry; + } + } + while (*ptr++); + if (entry_pos) + { + cookies[0] = entry_pos->cookie[0]; + cookies[1] = entry_pos->cookie[1]; + } + + } + while (!(*ptr)); + + fvdbg("End of directory\n"); + if (!nfs_dir->nfs_entries) + { + error = ENOENT; + goto errout_with_mutex; + } + + NFS_DIR_ENTRY_MALLOC(entry); + + /* There is an entry. Skip over the file ID and point to the length */ + + entry->file_id[0] = (uint32_t)EOF; + if (!entry_pos) + { + error = ENOENT; + NFS_DIR_ENTRY_FREE(entry); + goto errout_with_mutex; + } + entry_pos->next = entry; + entry_pos = entry; + } + + entry_pos = nfs_dir->nfs_entries; + if (nfs_dir->nfs_entries->file_id[0] == (uint32_t)EOF) + { + fvdbg("End of directory\n"); + error = ENOENT; + free(nfs_dir->nfs_entries); + nfs_dir->nfs_entries = NULL; + goto errout_with_mutex; + } + + d_name_size = sizeof(dir->fd_dir.d_name); + error = memcpy_s(dir->fd_dir.d_name, d_name_size, (const char *)entry_pos->contents, (size_t)entry_pos->name_len); + if (error != EOK) + { + error = ENOBUFS; + goto errout_with_memory; + } + if (entry_pos->name_len >= d_name_size) + { + dir->fd_dir.d_name[d_name_size - 1] = '\0'; + } + else + { + dir->fd_dir.d_name[entry_pos->name_len] = '\0'; + } + + nfs_dir->nfs_entries = entry_pos->next; + NFS_DIR_ENTRY_FREE(entry_pos); + + fvdbg("name: \"%s\"\n", dir->fd_dir.d_name); + fhandle.length = (uint32_t)nfs_dir->nfs_fhsize; + (void)memcpy_s(&fhandle.handle, DIRENT_NFS_MAXHANDLE, nfs_dir->nfs_fhandle, DIRENT_NFS_MAXHANDLE); + + error = nfs_lookup(nmp, dir->fd_dir.d_name, &fhandle, &obj_attributes, NULL); + if (error != OK) + { + ferr("ERROR: nfs_lookup failed: %d\n", error); + goto errout_with_memory; + } + + /* Set the dirent file type */ + + tmp = fxdr_unsigned(uint32_t, obj_attributes.fa_type); + switch (tmp) + { + default: + case NFNON: /* Unknown type */ + case NFSOCK: /* Socket */ + case NFLNK: /* Symbolic link */ + break; + + case NFREG: /* Regular file */ + dir->fd_dir.d_type = DT_REG; + break; + + case NFDIR: /* Directory */ + dir->fd_dir.d_type = DT_DIR; + break; + + case NFBLK: /* Block special device file */ + dir->fd_dir.d_type = DT_BLK; + break; + + case NFFIFO: /* Named FIFO */ + case NFCHR: /* Character special device file */ + dir->fd_dir.d_type = DT_CHR; + break; + } + dir->fd_dir.d_off = dir->fd_position; + dir->fd_dir.d_reclen = (uint16_t)sizeof(struct dirent); + finfo("type: %d->%d\n", (int)tmp, dir->fd_dir.d_type); + + nfs_mux_release(nmp); + return OK; + +errout_with_memory: + for (entry_pos = nfs_dir->nfs_entries; entry_pos != NULL; entry_pos = nfs_dir->nfs_entries) + { + nfs_dir->nfs_entries = entry_pos->next; + NFS_DIR_ENTRY_FREE(entry_pos); + } +errout_with_mutex: + nfs_mux_release(nmp); + return -error; +} + +/**************************************************************************** + * Name: nfs_rewinddir + * + * Description: + * Reset the directory traveral logic to the first entry in the open + * directory. + * + * Returned Value: + * 0 on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int nfs_rewinddir(FAR struct inode *mountpt, FAR struct fs_dirent_s *dir) +{ + struct nfsmount *nmp; + struct nfsdir_s *nfs_dir; + struct entry3 *entry_pos; + finfo("Entry\n"); + + /* Sanity checks */ + + DEBUGASSERT(mountpt != NULL && mountpt->i_private != NULL && dir != NULL); + + nmp = (struct nfsmount *)mountpt->i_private; + nfs_mux_take(nmp); + + /* Reset the NFS-specific portions of dirent structure, retaining only the + * file handle. + */ + + nfs_dir = (struct nfsdir_s *)dir->u.fs_dir; + (void)memset_s(nfs_dir->nfs_verifier, DIRENT_NFS_VERFLEN, 0, DIRENT_NFS_VERFLEN); + nfs_dir->nfs_cookie[0] = 0; + nfs_dir->nfs_cookie[1] = 0; + for (entry_pos = nfs_dir->nfs_entries; entry_pos != NULL; entry_pos = nfs_dir->nfs_entries) + { + nfs_dir->nfs_entries = entry_pos->next; + NFS_DIR_ENTRY_FREE(entry_pos); + } + nfs_mux_release(nmp); + return OK; +} + +/**************************************************************************** + * Name: nfs_decode_args + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void nfs_decode_args(FAR struct nfs_mount_parameters *nprmt, + FAR struct nfs_args *argp) +{ + int maxio; + + /* Get the selected timeout value */ + + if ((argp->flags & NFSMNT_TIMEO) != 0 && argp->timeo > 0) + { + uint32_t tmp = ((uint32_t)argp->timeo * NFS_HZ + 5) / 10; + if (tmp < NFS_MINTIMEO) + { + tmp = NFS_MINTIMEO; + } + else if (tmp > NFS_MAXTIMEO) + { + tmp = NFS_MAXTIMEO; + } + + nprmt->timeo = tmp; + } + + /* Get the selected retransmission count */ + + if ((argp->flags & NFSMNT_RETRANS) != 0 && argp->retrans > 1) + { + if (argp->retrans < NFS_MAXREXMIT) + { + nprmt->retry = argp->retrans; + } + else + { + nprmt->retry = NFS_MAXREXMIT; + } + } + + if ((argp->flags & NFSMNT_SOFT) == 0) + { + nprmt->retry = NFS_MAXREXMIT + 1; /* Past clip limit */ + } + + /* Get the maximum amount of data that can be transferred in one packet */ + + if ((argp->sotype == SOCK_DGRAM) != 0) + { + maxio = NFS_MAXDGRAMDATA; + } + else + { + ferr("ERROR: Only SOCK_DRAM is supported\n"); + maxio = NFS_MAXDATA; + } + + /* Get the maximum amount of data that can be transferred in one write transfer */ + + if ((argp->flags & NFSMNT_WSIZE) != 0 && argp->wsize > 0) + { + nprmt->wsize = argp->wsize; + + /* Round down to multiple of blocksize */ + + nprmt->wsize &= ~(NFS_FABLKSIZE - 1); + if (nprmt->wsize <= 0) + { + nprmt->wsize = NFS_FABLKSIZE; + } + } + + if (nprmt->wsize > maxio) + { + nprmt->wsize = maxio; + } + + if (nprmt->wsize > MAXBSIZE) + { + nprmt->wsize = MAXBSIZE; + } + + /* Get the maximum amount of data that can be transferred in one read transfer */ + + if ((argp->flags & NFSMNT_RSIZE) != 0 && argp->rsize > 0) + { + nprmt->rsize = argp->rsize; + + /* Round down to multiple of blocksize */ + + nprmt->rsize &= ~(NFS_FABLKSIZE - 1); + if (nprmt->rsize <= 0) + { + nprmt->rsize = NFS_FABLKSIZE; + } + } + + if (nprmt->rsize > maxio) + { + nprmt->rsize = maxio; + } + + if (nprmt->rsize > MAXBSIZE) + { + nprmt->rsize = MAXBSIZE; + } + + /* Get the maximum amount of data that can be transferred in directory transfer */ + + if ((argp->flags & NFSMNT_READDIRSIZE) != 0 && argp->readdirsize > 0) + { + nprmt->readdirsize = argp->readdirsize; + + /* Round down to multiple of blocksize */ + + nprmt->readdirsize &= ~(NFS_DIRBLKSIZ - 1); + if (nprmt->readdirsize < NFS_DIRBLKSIZ) + { + nprmt->readdirsize = NFS_DIRBLKSIZ; + } + } + else if (argp->flags & NFSMNT_RSIZE) + { + nprmt->readdirsize = nprmt->rsize; + } + + if (nprmt->readdirsize > maxio) + { + nprmt->readdirsize = maxio; + } +} + +/**************************************************************************** + * Name: nfs_bind + * + * Description: + * This implements a portion of the mount operation. This function allocates + * and initializes the mountpoint private data and gets mount information + * from the NFS server. The final binding of the private data (containing + * NFS server mount information) to the mountpoint is performed by mount(). + * + * Returned Value: + * 0 on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int nfs_bind(FAR struct inode *blkdriver, FAR const void *data, + FAR void **handle, FAR const char *relpath) +{ + FAR struct nfs_args *argp = (FAR struct nfs_args *)data; + FAR struct nfsmount *nmp; + struct rpcclnt *rpc; + struct rpc_call_fs getattr; + struct rpc_reply_getattr resok; + struct nfs_mount_parameters nprmt; + uint32_t buflen; + uint32_t pathlen; + uint32_t tmp; + int error = 0; + pthread_mutexattr_t attr; + + DEBUGASSERT(data && handle); + + /* Set default values of the parameters. These may be overridden by + * settings in the argp->flags. + */ + + nprmt.timeo = NFS_TIMEO; + nprmt.retry = NFS_RETRANS; + nprmt.wsize = NFS_WSIZE; + nprmt.rsize = NFS_RSIZE; + nprmt.readdirsize = NFS_READDIRSIZE; + + nfs_decode_args(&nprmt, argp); + + /* Determine the size of a buffer that will hold one RPC data transfer. + * First, get the maximum size of a read and a write transfer. + */ + + pathlen = strlen(argp->path); + if (pathlen >= NFS_MOUNT_PATH_MAX_SIZE) { + return -ENAMETOOLONG; + } + + buflen = SIZEOF_rpc_call_write(nprmt.wsize); + tmp = SIZEOF_rpc_reply_read(nprmt.rsize); + + /* The buffer size will be the maximum of those two sizes */ + + if (tmp > buflen) + { + buflen = tmp; + } + + /* But don't let the buffer size exceed the MSS of the socket type. + * + * In the case where there are multiple network devices with different + * link layer protocols, each network device may support a different + * UDP MSS value. Here we arbitrarily select the minimum MSS for + * that case. + */ + + /* Create an instance of the mountpt state structure */ + + nmp = (FAR struct nfsmount *)malloc(SIZEOF_nfsmount(buflen)); + if (!nmp) + { + ferr("ERROR: Failed to allocate mountpoint structure\n"); + return -ENOMEM; + } + + (void)memset_s(nmp, SIZEOF_nfsmount(buflen), 0, SIZEOF_nfsmount(buflen)); + + /* Save the allocated I/O buffer size */ + + nmp->nm_buflen = (uint16_t)buflen; + + nmp->nm_so = -1; + + /* Initialize the allocated mountpt state structure. */ + + (void)pthread_mutexattr_init(&attr); + (void)pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + error = pthread_mutex_init(&nmp->nm_mux, &attr); + if (error) + { + return -error; + } + + /* Initialize NFS */ + + nfs_true = txdr_unsigned(TRUE); + nfs_false = txdr_unsigned(FALSE); + nfs_xdrneg1 = txdr_unsigned(-1); + + rpcclnt_init(); + + /* Set initial values of other fields */ + + nmp->nm_timeo = nprmt.timeo; + nmp->nm_retry = nprmt.retry; + nmp->nm_wsize = nprmt.wsize; + nmp->nm_rsize = nprmt.rsize; + nmp->nm_readdirsize = nprmt.readdirsize; + nmp->nm_fhsize = NFSX_V3FHMAX; + + (void)strncpy_s(nmp->nm_path, sizeof(nmp->nm_path), argp->path, pathlen); + (void)memcpy_s(&nmp->nm_nam, sizeof(struct sockaddr), &argp->addr, argp->addrlen); + + /* Set up the sockets and per-host congestion */ + + nmp->nm_sotype = argp->sotype; + + if (nmp->nm_sotype == SOCK_DGRAM || nmp->nm_sotype == SOCK_STREAM) + { + /* Connection-less... connect now */ + + /* Create an instance of the rpc state structure */ + + rpc = (struct rpcclnt *)malloc(sizeof(struct rpcclnt)); + if (!rpc) + { + ferr("ERROR: Failed to allocate rpc structure\n"); + error = ENOMEM; + goto bad; + } + + (void)memset_s(rpc, sizeof(struct rpcclnt), 0, sizeof(struct rpcclnt)); + + finfo("Connecting\n"); + + /* Translate nfsmnt flags -> rpcclnt flags */ + + rpc->rc_path = nmp->nm_path; + rpc->rc_name = &nmp->nm_nam; + rpc->rc_sotype = nmp->nm_sotype; + rpc->rc_retry = nmp->nm_retry; + rpc->rc_so = -1; + + nmp->nm_rpcclnt = rpc; + + error = rpcclnt_connect(nmp->nm_rpcclnt); + if (error != OK) + { + ferr("ERROR: nfs_connect failed: %d\n", error); + goto bad; + } + } + + nmp->nm_mounted = true; + nmp->nm_so = nmp->nm_rpcclnt->rc_so; + nmp->nm_head = NULL; + nmp->nm_dir = NULL; + nmp->nm_fhsize = nmp->nm_rpcclnt->rc_fhsize; + memcpy(&nmp->nm_fh, &nmp->nm_rpcclnt->rc_fh, sizeof(nfsfh_t)); + + /* Get the file attributes */ + + getattr.fs.fsroot.length = txdr_unsigned(nmp->nm_fhsize); + memcpy(&getattr.fs.fsroot.handle, &nmp->nm_fh, sizeof(nfsfh_t)); + + error = nfs_request(nmp, NFSPROC_GETATTR, + (FAR void *)&getattr, /* sizeof(struct FS3args) */ + (sizeof(getattr.fs.fsroot.length) + nmp->nm_fhsize), + (FAR void *)&resok, sizeof(struct rpc_reply_getattr)); + if (error) + { + ferr("ERROR: nfs_request failed: %d\n", error); + goto bad; + } + + /* Save the file attributes */ + + memcpy(&nmp->nm_fattr, &resok.attr, sizeof(struct nfs_fattr)); + + /* Mounted! */ + + *handle = (FAR void *)nmp; + nfs_mux_release(nmp); + + finfo("Successfully mounted\n"); + return OK; + +bad: + if (nmp) + { + /* Disconnect from the server */ + + if (nmp->nm_rpcclnt) + { + rpcclnt_disconnect(nmp->nm_rpcclnt); + free(nmp->nm_rpcclnt); + nmp->nm_rpcclnt = NULL; + } + + /* Free connection-related resources */ + + (void)pthread_mutex_destroy(&nmp->nm_mux); + + free(nmp); + nmp = NULL; + } + + return -error; /*lint !e438*/ +} + +/**************************************************************************** + * Name: nfs_unbind + * + * Description: This implements the filesystem portion of the umount + * operation. + * + * Returned Value: + * 0 on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int nfs_unbind(FAR void *handle, FAR struct inode **blkdriver) +{ + FAR struct nfsmount *nmp = (FAR struct nfsmount *)handle; + int error; + + finfo("Entry\n"); + DEBUGASSERT(nmp); + + /* Get exclusive access to the mount structure */ + + nfs_mux_take(nmp); + + /* Are there any open files? We can tell if there are open files by looking + * at the list of file structures in the mount structure. If this list + * not empty, then there are open files and we cannot unmount now (or a + * crash is sure to follow). + */ + + if (nmp->nm_head != NULL || nmp->nm_dir != NULL) + { + ferr("ERROR; There are open files: %p or directories: %p\n", nmp->nm_head, nmp->nm_dir); + + /* This implementation currently only supports unmounting if there are + * no open file references. + */ + + error = EBUSY; + goto errout_with_mutex; + } + + /* No open file... Umount the file system. */ + + error = rpcclnt_umount(nmp->nm_rpcclnt); + if (error) + { + ferr("ERROR: rpcclnt_umount failed: %d\n", error); + goto errout_with_mutex; + } + + /* Disconnect from the server */ + + rpcclnt_disconnect(nmp->nm_rpcclnt); + + /* And free any allocated resources */ + + nfs_mux_release(nmp); + (void)pthread_mutex_destroy(&nmp->nm_mux); + free(nmp->nm_rpcclnt); + nmp->nm_rpcclnt = NULL; + free(nmp); + nmp = NULL; + + return -error; + +errout_with_mutex: + nfs_mux_release(nmp); + return -error; +} + +/**************************************************************************** + * Name: nfs_fsinfo + * + * Description: + * Return information about root directory. + * + * Returned Value: + * 0 on success; positive errno value on failure + * + * Assumptions: + * The caller has exclusive access to the NFS mount structure + * + ****************************************************************************/ + +int nfs_fsinfo(FAR struct nfsmount *nmp) +{ + struct rpc_call_fs fsinfo; + struct rpc_reply_fsinfo fsp; + struct nfs_fsinfo *rep_info; + uint32_t pref; + uint32_t max; + int error = 0; + + fsinfo.fs.fsroot.length = txdr_unsigned(nmp->nm_fhsize); + fsinfo.fs.fsroot.handle = nmp->nm_fh; + + /* Request FSINFO from the server */ + + nfs_statistics(NFSPROC_FSINFO); + error = nfs_request(nmp, NFSPROC_FSINFO, + (FAR void *)&fsinfo, sizeof(struct FS3args), + (FAR void *)&fsp, sizeof(struct rpc_reply_fsinfo)); + if (error) + { + return error; + } + + if (txdr_unsigned(fsp.fsinfo.obj_attributes.obj_attribute_follow) == 1) + { + rep_info = (struct nfs_fsinfo *)&fsp.fsinfo.fs_rtmax; + } + else + { + rep_info = (struct nfs_fsinfo *)((void *)(&fsp.fsinfo.obj_attributes.attributes)); + } + + /* Save the root file system attributes */ + +#if 0 + memcpy(&nmp->nm_fattr. &fsp.obj_attributes, sizeof(struct nfs_fattr)); +#endif + + pref = fxdr_unsigned(uint32_t, rep_info->fs_wtpref); + if (pref < nmp->nm_wsize) + { + nmp->nm_wsize = (pref + NFS_FABLKSIZE - 1) & ~(NFS_FABLKSIZE - 1); + } + + max = fxdr_unsigned(uint32_t, rep_info->fs_wtmax); + if (max < nmp->nm_wsize) + { + nmp->nm_wsize = max & ~(NFS_FABLKSIZE - 1); + if (nmp->nm_wsize == 0) + { + nmp->nm_wsize = max; + } + } + + pref = fxdr_unsigned(uint32_t, rep_info->fs_rtpref); + if (pref < nmp->nm_rsize) + { + nmp->nm_rsize = (pref + NFS_FABLKSIZE - 1) & ~(NFS_FABLKSIZE - 1); + } + + max = fxdr_unsigned(uint32_t, rep_info->fs_rtmax); + if (max < nmp->nm_rsize) + { + nmp->nm_rsize = max & ~(NFS_FABLKSIZE - 1); + if (nmp->nm_rsize == 0) + { + nmp->nm_rsize = max; + } + } + + pref = fxdr_unsigned(uint32_t, rep_info->fs_dtpref); + if (pref < nmp->nm_readdirsize) + { + nmp->nm_readdirsize = (pref + NFS_DIRBLKSIZ - 1) & ~(NFS_DIRBLKSIZ - 1); + } + + if (max < nmp->nm_readdirsize) + { + nmp->nm_readdirsize = max & ~(NFS_DIRBLKSIZ - 1); + if (nmp->nm_readdirsize == 0) + { + nmp->nm_readdirsize = max; + } + } + + return OK; +} + +/**************************************************************************** + * Name: nfs_statfs + * + * Description: + * Return filesystem statistics + * + * Returned Value: + * 0 on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int nfs_statfs(FAR struct inode *mountpt, FAR struct statfs *sbp) +{ + FAR struct nfsmount *nmp; + FAR struct rpc_call_fs *fsstat; + FAR struct rpc_reply_fsstat *sfp; + FAR struct nfs_statfs_ctx *stfp; + int error = 0; + uint64_t tquad; + + /* Sanity checks */ + + DEBUGASSERT(mountpt && mountpt->i_private); + + /* Get the mountpoint private data from the inode structure */ + + nmp = (FAR struct nfsmount *)mountpt->i_private; + + /* Check if the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + ferr("ERROR: nfs_checkmount failed: %d\n", error); + goto errout_with_mutex; + } + + /* Fill in the statfs info */ + + sbp->f_type = NFS_SUPER_MAGIC; + + error = nfs_fsinfo(nmp); + if (error) + { + fdbg("ERROR: nfs_fsinfo failed: %d\n", error); + goto errout_with_mutex; + } + + fsstat = &nmp->nm_msgbuffer.fsstat; + fsstat->fs.fsroot.length = txdr_unsigned(nmp->nm_fhsize); + memcpy(&fsstat->fs.fsroot.handle, &nmp->nm_fh, sizeof(nfsfh_t)); + + nfs_statistics(NFSPROC_FSSTAT); + error = nfs_request(nmp, NFSPROC_FSSTAT, + (FAR void *)fsstat, sizeof(struct FS3args), + (FAR void *)nmp->nm_iobuffer, nmp->nm_buflen); + if (error) + { + goto errout_with_mutex; + } + + sfp = (FAR struct rpc_reply_fsstat *)nmp->nm_iobuffer; + if (txdr_unsigned(sfp->fsstat.attributes_follow) == 1) + { + stfp = (FAR struct nfs_statfs_ctx *)&sfp->fsstat.sf_tbytes; + } + else + { + stfp = (FAR struct nfs_statfs_ctx *)&sfp->fsstat.obj_attributes; + } + + sbp->f_bsize = NFS_FABLKSIZE; + tquad = fxdr_hyper(&stfp->sf_tbytes); /*lint !e571*/ + sbp->f_blocks = tquad / (uint64_t) NFS_FABLKSIZE; + tquad = fxdr_hyper(&stfp->sf_fbytes); /*lint !e571*/ + sbp->f_bfree = tquad / (uint64_t) NFS_FABLKSIZE; + tquad = fxdr_hyper(&stfp->sf_abytes); /*lint !e571*/ + sbp->f_bavail = tquad / (uint64_t) NFS_FABLKSIZE; + tquad = fxdr_hyper(&stfp->sf_tfiles); /*lint !e571*/ + sbp->f_files = tquad; + tquad = fxdr_hyper(&stfp->sf_ffiles); /*lint !e571*/ + sbp->f_ffree = tquad; + sbp->f_namelen = NAME_MAX; + +errout_with_mutex: + nfs_mux_release(nmp); + return -error; +} + +/**************************************************************************** + * Name: nfs_remove + * + * Description: + * Remove a file + * + * Returned Value: + * 0 on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int nfs_remove(struct inode *mountpt, const char *relpath) +{ + FAR struct nfsmount *nmp; + struct file_handle fhandle; + struct file_handle obj_fhandle; + struct nfs_fattr fattr; + struct nfs_fattr obj_fattr; + char filename[NAME_MAX + 1]; + FAR uint32_t *ptr; + uint32_t f_type; + int namelen; + int reqlen; + int error; + + /* Sanity checks */ + + DEBUGASSERT(mountpt && mountpt->i_private); + + /* Get the mountpoint private data from the inode structure */ + + nmp = (FAR struct nfsmount *)mountpt->i_private; + + /* Check if the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + ferr("ERROR: nfs_checkmount failed: %d\n", error); + goto errout_with_mutex; + } + + /* Find the NFS node of the directory containing the file to be deleted */ + + error = nfs_finddir(nmp, relpath, &fhandle, &fattr, filename); + if (error != OK) + { + ferr("ERROR: nfs_finddir returned: %d\n", error); + goto errout_with_mutex; + } + + /* Check whether the file to be deleted is a directory */ + + memcpy(&obj_fhandle, &fhandle, sizeof(struct file_handle)); + error = nfs_lookup(nmp, filename, &obj_fhandle, &obj_fattr, NULL); + if (error != OK) + { + ferr("ERROR: nfs_lookup returned: %d\n", error); + goto errout_with_mutex; + } + f_type = fxdr_unsigned(uint32_t, obj_fattr.fa_type); + if (f_type == NFDIR) + { + ferr("ERROR: try to remove a directory\n"); + error = NFSERR_ISDIR; + goto errout_with_mutex; + } + + /* Create the REMOVE RPC call arguments */ + + ptr = (FAR uint32_t *)&nmp->nm_msgbuffer.removef.remove; + reqlen = 0; + + /* Copy the variable length, directory file handle */ + + *ptr++ = txdr_unsigned(fhandle.length); + reqlen += sizeof(uint32_t); + + memcpy(ptr, &fhandle.handle, fhandle.length); + reqlen += (int)fhandle.length; + ptr += uint32_increment(fhandle.length); + + /* Copy the variable-length file name */ + + namelen = strlen(filename); + + *ptr++ = txdr_unsigned(namelen); + reqlen += sizeof(uint32_t); + + memcpy(ptr, filename, namelen); + reqlen += uint32_alignup(namelen); + + /* Perform the REMOVE RPC call */ + + nfs_statistics(NFSPROC_REMOVE); + error = nfs_request(nmp, NFSPROC_REMOVE, + (FAR void *)&nmp->nm_msgbuffer.removef, reqlen, + (FAR void *)nmp->nm_iobuffer, nmp->nm_buflen); + +errout_with_mutex: + nfs_mux_release(nmp); + return -error; +} + +/**************************************************************************** + * Name: nfs_mkdir + * + * Description: + * Create a directory + * + * Returned Value: + * 0 on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int nfs_mkdir(struct inode *mountpt, const char *relpath, mode_t mode) +{ + struct nfsmount *nmp; + struct file_handle fhandle; + struct nfs_fattr fattr; + char dirname[NAME_MAX + 1]; + FAR uint32_t *ptr; + uint32_t tmp; + int namelen; + int reqlen; + int error; + + /* Sanity checks */ + + DEBUGASSERT(mountpt && mountpt->i_private); + + /* Get the mountpoint private data from the inode structure */ + + nmp = (FAR struct nfsmount *) mountpt->i_private; + + /* Check if the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + ferr("ERROR: nfs_checkmount: %d\n", error); + goto errout_with_mutex; + } + + /* Find the NFS node of the directory containing the directory to be created */ + + error = nfs_finddir(nmp, relpath, &fhandle, &fattr, dirname); + if (error != OK) + { + ferr("ERROR: nfs_finddir returned: %d\n", error); + goto errout_with_mutex; + } + + /* Format the MKDIR call message arguments */ + + ptr = (FAR uint32_t *)&nmp->nm_msgbuffer.mkdir.mkdir; + reqlen = 0; + + /* Copy the variable length, directory file handle */ + + *ptr++ = txdr_unsigned(fhandle.length); + reqlen += sizeof(uint32_t); + + memcpy(ptr, &fhandle.handle, fhandle.length); + ptr += uint32_increment(fhandle.length); + reqlen += (int)fhandle.length; + + /* Copy the variable-length directory name */ + + namelen = strlen(dirname); + + *ptr++ = txdr_unsigned(namelen); + reqlen += sizeof(uint32_t); + + memcpy(ptr, dirname, namelen); + ptr += uint32_increment(namelen); + reqlen += uint32_alignup(namelen); + + /* Set the mode. NOTE: Here we depend on the fact that the NuttX and NFS + * bit settings are the same (at least for the bits of interest). + */ + + *ptr++ = nfs_true; /* True: mode value follows */ + reqlen += sizeof(uint32_t); + + if (!mode) + { + mode = (NFSMODE_IXOTH | NFSMODE_IROTH | + NFSMODE_IXGRP | NFSMODE_IRGRP | + NFSMODE_IXUSR | NFSMODE_IWUSR | NFSMODE_IRUSR); + } + tmp = mode & (NFSMODE_IXOTH | NFSMODE_IWOTH | NFSMODE_IROTH | + NFSMODE_IXGRP | NFSMODE_IWGRP | NFSMODE_IRGRP | + NFSMODE_IXUSR | NFSMODE_IWUSR | NFSMODE_IRUSR); + *ptr++ = txdr_unsigned(tmp); + reqlen += sizeof(uint32_t); + + /* Set the user ID to zero */ + + *ptr++ = nfs_true; /* True: Uid value follows */ + *ptr++ = 0; /* UID = 0 (nobody) */ + reqlen += 2*sizeof(uint32_t); + + /* Set the group ID to one */ + + *ptr++ = nfs_true; /* True: Gid value follows */ + *ptr++ = htonl(1); /* GID = 1 (nogroup) */ + reqlen += 2*sizeof(uint32_t); + + /* No size */ + + *ptr++ = nfs_false; /* False: No size value follows */ + reqlen += sizeof(uint32_t); + + /* Don't change times */ + + *ptr++ = htonl(NFSV3SATTRTIME_DONTCHANGE); /* Don't change atime */ + *ptr++ = htonl(NFSV3SATTRTIME_DONTCHANGE); /* Don't change mtime */ + reqlen += 2*sizeof(uint32_t); + + /* Perform the MKDIR RPC */ + + nfs_statistics(NFSPROC_MKDIR); + error = nfs_request(nmp, NFSPROC_MKDIR, + (FAR void *)&nmp->nm_msgbuffer.mkdir, reqlen, + (FAR void *)nmp->nm_iobuffer, nmp->nm_buflen); + if (error) + { + ferr("ERROR: nfs_request failed: %d\n", error); + } + +errout_with_mutex: + nfs_mux_release(nmp); + return -error; +} + +/**************************************************************************** + * Name: nfs_rmdir + * + * Description: + * Remove a directory + * + * Returned Value: + * 0 on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int nfs_rmdir(struct inode *mountpt, const char *relpath) +{ + struct nfsmount *nmp; + struct file_handle fhandle; + struct nfs_fattr fattr; + char dirname[NAME_MAX + 1]; + FAR uint32_t *ptr; + int namelen; + int reqlen; + int error; + + /* Sanity checks */ + + DEBUGASSERT(mountpt && mountpt->i_private); + + /* Get the mountpoint private data from the inode structure */ + + nmp = (struct nfsmount *)mountpt->i_private; + + /* Check if the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + ferr("ERROR: nfs_checkmount failed: %d\n", error); + goto errout_with_mutex; + } + + /* Find the NFS node of the directory containing the directory to be removed */ + + error = nfs_finddir(nmp, relpath, &fhandle, &fattr, dirname); + if (error != OK) + { + ferr("ERROR: nfs_finddir returned: %d\n", error); + goto errout_with_mutex; + } + + /* Set up the RMDIR call message arguments */ + + ptr = (FAR uint32_t *)&nmp->nm_msgbuffer.rmdir.rmdir; + reqlen = 0; + + /* Copy the variable length, directory file handle */ + + *ptr++ = txdr_unsigned(fhandle.length); + reqlen += sizeof(uint32_t); + + memcpy(ptr, &fhandle.handle, fhandle.length); + reqlen += (int)fhandle.length; + ptr += uint32_increment(fhandle.length); + + /* Copy the variable-length directory name */ + + namelen = strlen(dirname); + + *ptr++ = txdr_unsigned(namelen); + reqlen += sizeof(uint32_t); + + memcpy(ptr, dirname, namelen); + reqlen += uint32_alignup(namelen); + + /* Perform the RMDIR RPC */ + + nfs_statistics(NFSPROC_RMDIR); + error = nfs_request(nmp, NFSPROC_RMDIR, + (FAR void *)&nmp->nm_msgbuffer.rmdir, reqlen, + (FAR void *)nmp->nm_iobuffer, nmp->nm_buflen); + +errout_with_mutex: + nfs_mux_release(nmp); + return -error; +} + +static int nfs_getfilename(char *dstpath, unsigned int dstpathLen, const char *srcpath, unsigned int maxlen) +{ + int ret; + char *path; + unsigned int len; + + if (srcpath == NULL) + { + return ENOBUFS; + } + + len = strlen(srcpath); + if (len > maxlen) + { + return ENOBUFS; + } + + if (len == 0) + { + *dstpath = '\0'; + return OK; + } + + path = (char *)srcpath + len - 1; + + while (len > 0 && *path != '/') + { + len--; + path--; + } + + /* When copy path, skip the 1 '/' in NFS URL, for example 'nfs://server/a/b' */ + + ret = strncpy_s(dstpath, dstpathLen, path + 1, strlen(path + 1)); + if (ret != EOK) + { + return ENOBUFS; + } + return OK; +} + +static int nfs_compare_type(struct nfsmount *nmp, const char *oldrelpath, + const char *newrelpath) +{ + struct file_handle fhandle; + struct nfs_fattr stOld_attributes; + struct nfs_fattr stNew_attributes; + int ret; + const char *ch1 = oldrelpath; + const char *ch2 = newrelpath; + + while (*ch1 == *ch2) + { + if (*ch1 == '\0' || *ch2 == '\0') + { + break; + } + ch1++; + ch2++; + } + + if ((*ch1 == '/' && *ch2 == '\0') || (*ch2 == '/' && *ch1 == '\0')) + { + return 1; + } + + ret = nfs_findnode(nmp, oldrelpath, &fhandle, &stOld_attributes, (struct nfs_fattr *)NULL); + if (ret != OK && ret != ENOTDIR) + { + fdbg("ERROR: old path nfs_findnode failed: %d\n", ret); + return 1; + } + ret = nfs_findnode(nmp, newrelpath, &fhandle, &stNew_attributes, (struct nfs_fattr *)NULL); + if (ret != OK) + { + fdbg("ERROR: new path nfs_findnode failed: %d\n", ret); + return 0; + } + + /* if two value are equal which should return 0;it is not equal should return 1 */ + + return stOld_attributes.fa_type != stNew_attributes.fa_type; +} + +/**************************************************************************** + * Name: nfs_rename + * + * Description: + * Rename a file or directory + * + * Returned Value: + * 0 on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int nfs_rename(struct inode *mountpt, const char *oldrelpath, + const char *newrelpath) +{ + struct nfsmount *nmp; + struct nfsnode *np; + struct nfsdir_s *nd; + struct file_handle from_handle; + struct file_handle to_handle; + char directory[NAME_MAX + 1]; + char from_name[NAME_MAX + 1]; + char to_name[NAME_MAX + 1]; + char *fullpath; + char *relpath; + struct nfs_fattr fattr; + FAR uint32_t *ptr; + int namelen; + int reqlen; + int error; + + /* Sanity checks */ + + DEBUGASSERT(mountpt && mountpt->i_private); + + /* Get the mountpoint private data from the inode structure */ + + nmp = (struct nfsmount *)mountpt->i_private; + + /* Check if the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + ferr("ERROR: nfs_checkmount returned: %d\n", error); + goto errout_with_mutex; + } + + /* Find the NFS node of the directory containing the 'from' object */ + + error = nfs_finddir(nmp, oldrelpath, &from_handle, &fattr, from_name); + if (error != OK) + { + ferr("ERROR: nfs_finddir returned: %d\n", error); + goto errout_with_mutex; + } + fdbg("nfs_finddir oldrelpath:%s, fattr->fa_type:%x, from_name: %s\n", + oldrelpath, fattr.fa_type, from_name); + + for (nd = nmp->nm_dir; nd; nd = nd->nfs_next) + { + char filename[FILENAME_MAX_LEN] = {}; + error = nfs_getfilename(filename, sizeof(filename), nd->nfs_dir->fd_dir.d_name, NAME_MAX); + if (error != OK) + { + goto errout_with_mutex; + } + if (strcmp(filename, from_name) == 0) + { + break; + } + } + for (np = nmp->nm_head; np; np = np->n_next) + { + char filename[FILENAME_MAX_LEN] = {}; + error = nfs_getfilename(filename, sizeof(filename), np->n_filep->f_relpath, PATH_MAX - 1); + if (error != OK) + { + goto errout_with_mutex; + } + if (strcmp((const char *)filename, from_name) == 0) + { + break; + } + } + + if (!np && !nd) + { + fdbg("INFO: not opened\n"); + } + + /* Find the NFS node of the directory containing the 'from' object */ + + error = nfs_finddir(nmp, newrelpath, &to_handle, &fattr, to_name); + if (error != OK) + { + ferr("ERROR: nfs_finddir returned: %d\n", error); + goto errout_with_mutex; + } + fdbg("nfs_finddir newrelpath:%s, fattr->fa_type:%x, to_name: %s\n", + newrelpath, fattr.fa_type, to_name); + + /* compare new and old type */ + + error = nfs_compare_type(nmp, oldrelpath, newrelpath); + if (error != OK) + { + fdbg("ERROR: nfs_compare_type returned: %d\n", error); + goto errout_with_mutex; + } + + /* Format the RENAME RPC arguments */ + + ptr = (FAR uint32_t *)&nmp->nm_msgbuffer.renamef.rename; + reqlen = 0; + + /* Copy the variable length, 'from' directory file handle */ + + *ptr++ = txdr_unsigned(from_handle.length); + reqlen += sizeof(uint32_t); + + memcpy(ptr, &from_handle.handle, from_handle.length); + reqlen += (int)from_handle.length; + ptr += uint32_increment(from_handle.length); + + /* Copy the variable-length 'from' object name */ + + namelen = strlen(from_name); + + *ptr++ = txdr_unsigned(namelen); + reqlen += sizeof(uint32_t); + + memcpy(ptr, from_name, namelen); + reqlen += uint32_alignup(namelen); + ptr += uint32_increment(namelen); + + /* Copy the variable length, 'to' directory file handle */ + + *ptr++ = txdr_unsigned(to_handle.length); + reqlen += sizeof(uint32_t); + + memcpy(ptr, &to_handle.handle, to_handle.length); + ptr += uint32_increment(to_handle.length); + reqlen += (int)to_handle.length; + + /* Copy the variable-length 'to' object name */ + + namelen = strlen(to_name); + + *ptr++ = txdr_unsigned(namelen); + reqlen += sizeof(uint32_t); + + memcpy(ptr, to_name, namelen); + reqlen += uint32_alignup(namelen); + + /* Perform the RENAME RPC */ + + nfs_statistics(NFSPROC_RENAME); + error = nfs_request(nmp, NFSPROC_RENAME, + (FAR void *)&nmp->nm_msgbuffer.renamef, reqlen, + (FAR void *)nmp->nm_iobuffer, nmp->nm_buflen); + if (error != OK) + { + fdbg("ERROR: nfs_request returned: %d\n", error); + goto errout_with_mutex; + } + + if (np) + { + error = strncpy_s(directory, NAME_MAX + 1, np->n_filep->f_path, np->n_filep->f_relpath - np->n_filep->f_path); + directory[np->n_filep->f_relpath - np->n_filep->f_path] = '\0'; + if (error != EOK) + { + error = ENOBUFS; + goto errout_with_mutex; + } + error = vfs_normalize_path(directory, newrelpath, &fullpath); + if (error < 0) + { + error = -error; + fdbg("ERROR: vfs_normalize_path returned: %d\n", error); + goto errout_with_mutex; + } + + relpath = strstr(fullpath, newrelpath); + if (relpath == NULL) + { + fdbg("ERROR: relpath is not sub in fullpath.\n", error); + free(fullpath); + goto errout_with_mutex; + } + + /* Update the path of old file. */ + + free(np->n_filep->f_path); + np->n_filep->f_path = fullpath; + np->n_filep->f_relpath = relpath; + } + else if (nd) + { + error = memcpy_s(nd->nfs_dir->fd_dir.d_name, strlen(to_name) + 1, to_name, strlen(to_name) + 1); + if (error != EOK) + { + error = ENOBUFS; + goto errout_with_mutex; + } + } + +errout_with_mutex: + nfs_mux_release(nmp); + return -error; +} + +/**************************************************************************** + * Name: nfs_stat_common + * + * Description: + * Return information about the file system object described by 'info' + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void nfs_stat_common(FAR struct nfs_statinfo_s *info, + FAR struct stat *buf) +{ + mode_t mode; + + /* Here we exploit the fact that most mode bits are the same in NuttX + * as in the NFSv3 spec. + */ + + mode = info->ns_mode & + (NFSMODE_IXOTH | NFSMODE_IWOTH | NFSMODE_IROTH | + NFSMODE_IXGRP | NFSMODE_IWGRP | NFSMODE_IRGRP | + NFSMODE_IXUSR | NFSMODE_IWUSR | NFSMODE_IRUSR); + + /* Handle the cases that are not the same */ + + if ((info->ns_mode & NFSMODE_ISGID) != 0) + { + mode |= S_ISGID; + } + + if ((info->ns_mode & NFSMODE_ISUID) != 0) + { + mode |= S_ISUID; + } + + /* Now OR in the file type */ + + switch (info->ns_type) + { + default: + case NFNON: /* Unknown type */ + break; + + case NFREG: /* Regular file */ + mode |= S_IFREG; + break; + + case NFDIR: /* Directory */ + mode |= S_IFDIR; + break; + + case NFBLK: /* Block special device file */ + mode |= S_IFBLK; + break; + + case NFCHR: /* Character special device file */ + mode |= S_IFCHR; + break; + + case NFLNK: /* Symbolic link */ + mode |= S_IFLNK; + break; + + case NFSOCK: /* Socket */ + mode |= S_IFSOCK; + break; + + case NFFIFO: /* Named pipe */ + mode |= S_IFMT; + break; + } + + buf->st_mode = mode; + buf->st_uid = 0; + buf->st_gid = 0; + buf->st_size = (off_t)info->ns_size; + buf->st_blksize = 0; + buf->st_blocks = 0; + buf->st_mtime = info->ns_mtime; + buf->st_atime = info->ns_atime; + buf->st_ctime = info->ns_ctime; +} + +/**************************************************************************** + * Name: nfs_stat + * + * Description: + * Return information about the file system object at 'relpath' + * + * Returned Value: + * 0 on success; a negated errno value on failure. + * + ****************************************************************************/ + +static int nfs_stat(struct inode *mountpt, const char *relpath, + struct stat *buf) +{ + struct nfsmount *nmp; + struct file_handle fhandle; + struct nfs_fattr obj_attributes; + struct nfs_statinfo_s info; + struct timespec ts; + int error; + + /* Sanity checks */ + + DEBUGASSERT(mountpt && mountpt->i_private); + + /* Get the mountpoint private data from the inode structure */ + + nmp = (FAR struct nfsmount *)mountpt->i_private; + DEBUGASSERT(nmp && buf); + + /* Check if the mount is still healthy */ + + nfs_mux_take(nmp); + error = nfs_checkmount(nmp); + if (error != OK) + { + ferr("ERROR: nfs_checkmount failed: %d\n", error); + goto errout_with_mutex; + } + + /* Get the file handle attributes of the requested node */ + + error = nfs_findnode(nmp, relpath, &fhandle, &obj_attributes, NULL); + if (error != OK) + { + ferr("ERROR: nfs_findnode failed: %d\n", error); + goto errout_with_mutex; + } + + /* Extract the file mode, file type, and file size. */ + + info.ns_mode = fxdr_unsigned(uint16_t, obj_attributes.fa_mode); + info.ns_type = fxdr_unsigned(uint8_t, obj_attributes.fa_type); + info.ns_size = fxdr_hyper(&obj_attributes.fa_size); + + /* Extract time values as type time_t in units of seconds */ + + fxdr_nfsv3time(&obj_attributes.fa_mtime, &ts); + info.ns_mtime = ts.tv_sec; + + fxdr_nfsv3time(&obj_attributes.fa_atime, &ts); + info.ns_atime = ts.tv_sec; + + fxdr_nfsv3time(&obj_attributes.fa_ctime, &ts); + info.ns_ctime = ts.tv_sec; + + /* Then update the stat buffer with this information */ + + nfs_stat_common(&info, buf); + +errout_with_mutex: + nfs_mux_release(nmp); + return -error; +} + +int nfs_mount(const char *server_ip_and_path, const char *mount_path, + unsigned int uid, unsigned int gid) +{ + struct nfs_args nfs_args = {0}; + char *server_ip_addr; + char *server_nfs_path; + int found_colon = 0; + unsigned int pos; + int ret = -1; + struct sockaddr_in *nfs_srv_addr; + size_t len; + + rpcclnt_setuidgid(uid, gid); + + len = strlen(server_ip_and_path); + for (pos = 0; pos < len; pos++) + { + if (*(server_ip_and_path + pos) == ':') + { + found_colon = 1; + break; + } + } + + if (!found_colon) + { + set_errno(ENOENT); + goto nfs_mount_out; + } + + server_ip_addr = (char *)malloc(pos + 1); + if (server_ip_addr == NULL) + { + PRINTK("malloc failure\n"); + set_errno(ENOMEM); + goto nfs_mount_out; + } + + ret = strncpy_s(server_ip_addr, pos + 1, server_ip_and_path, pos); + if (ret != EOK) + { + set_errno(ENOBUFS); + goto nfs_free_node_out; + } + *(server_ip_addr + pos) = '\0'; + server_nfs_path = (char *)(server_ip_and_path + pos + 1); + + (void)memset_s(&nfs_args, sizeof(nfs_args), 0, sizeof(nfs_args)); + + if (g_NFSMOUNT_HOOK != NULL) + { + g_NFSMOUNT_HOOK(&nfs_args); + } + + nfs_args.path = server_nfs_path; /* server nfs dir */ + + nfs_srv_addr = (struct sockaddr_in *)&nfs_args.addr; + nfs_srv_addr->sin_family = AF_INET; + ret = inet_pton(AF_INET, server_ip_addr, &nfs_srv_addr->sin_addr.s_addr); + if (ret != 1) + { + ret = -1; + set_errno(ECONNREFUSED); + goto nfs_free_node_out; + } + nfs_srv_addr->sin_port = htons(PMAPPORT); + + nfs_args.addrlen = sizeof(nfs_args.addr); +#if (NFS_PROTO_TYPE == NFS_IPPROTO_TCP) + nfs_args.sotype = SOCK_STREAM; +#elif (NFS_PROTO_TYPE == NFS_IPPROTO_UDP) + nfs_args.sotype = SOCK_DGRAM; +#endif + + PRINTK("Mount nfs on %s:%s, uid:%d, gid:%d\n", server_ip_addr, server_nfs_path, uid, gid); + ret = mount((const char *)NULL, mount_path, "nfs", 0, &nfs_args); + +nfs_free_node_out: + free(server_ip_addr); + +nfs_mount_out: + if (ret) + { + perror("mount nfs error"); + return -1; + } + PRINTK("Mount nfs finished.\n"); + return 0; +} + +#endif diff --git a/fs/nfs/rpc.h b/fs/nfs/rpc.h new file mode 100755 index 0000000..20b875e --- /dev/null +++ b/fs/nfs/rpc.h @@ -0,0 +1,566 @@ +/**************************************************************************** + * fs/nfs/rpc.h + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved. + * Author: Jose Pablo Rojas Vargas + * Gregory Nutt + * + * Leveraged from OpenBSD: + * + * copyright (c) 2003 + * the regents of the university of michigan + * all rights reserved + * + * permission is granted to use, copy, create derivative works and redistribute + * this software and such derivative works for any purpose, so long as the name + * of the university of michigan is not used in any advertising or publicity + * pertaining to the use or distribution of this software without specific, + * written prior authorization. if the above copyright notice or any other + * identification of the university of michigan is included in any copy of any + * portion of this software, then the disclaimer below must also be included. + * + * this software is provided as is, without representation from the university + * of michigan as to its fitness for any purpose, and without warranty by the + * university of michigan of any kind, either express or implied, including + * without limitation the implied warranties of merchantability and fitness for + * a particular purpose. the regents of the university of michigan shall not be + * liable for any damages, including special, indirect, incidental, or + * consequential damages, with respect to any claim arising out of or in + * connection with the use of the software, even if it has been or is hereafter + * advised of the possibility of such damages. + * + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Rick Macklem at The University of Guelph. + * + * 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 the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __FS_NFS_RPC_H +#define __FS_NFS_RPC_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include "nfs_proto.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Version # */ + +#define RPC_VER2 2 + +/* Authentication */ + +#define RPCAUTH_NULL 0 +#define RPCAUTH_UNIX 1 +#define RPCAUTH_SHORT 2 +#define RPCAUTH_KERB4 4 +#define RPCAUTH_MAXSIZ 400 +#define RPCVERF_MAXSIZ 12 + /* For Kerb, can actually be 400 */ +#define RPCAUTH_UNIXGIDS 16 + +#define NFS_IPPROTO_TCP 6 +#define NFS_IPPROTO_UDP 17 +#define NFS_PROTO_TYPE NFS_IPPROTO_TCP + +#if (NFS_PROTO_TYPE == NFS_IPPROTO_TCP) +#define NFS_PROTOTYPE IPPROTO_TCP /* Default protocol to provide */ +#elif (NFS_PROTO_TYPE == NFS_IPPROTO_UDP) +#define NFS_PROTOTYPE IPPROTO_UDP +#endif + +/* There is an argument we can set in nfs server influences the port number we can use. + * When it is "secure", nfs use port number under 1024. + * When it is "insecure", nfs use port number over 1024. + * And "secure" is default. + */ + +#define RPCCONN_MAXPORT 1023 +#define RPCCONN_MINPORT 256 + + +/* Constants associated with authentication flavours. */ + +#define RPCAKN_FULLNAME 0 +#define RPCAKN_NICKNAME 1 + +/* RPC Constants */ + +#define RPC_CALL 0 +#define RPC_REPLY 1 +#define RPC_MSGACCEPTED 0 +#define RPC_MSGDENIED 1 +#define RPC_PROGUNAVAIL 1 +#define RPC_PROGMISMATCH 2 +#define RPC_PROCUNAVAIL 3 +#define RPC_GARBAGE 4 + +#define RPC_MISMATCH 0 +#define RPC_AUTHERR 1 + +/* Authentication failures */ + +#define AUTH_BADCRED 1 +#define AUTH_REJECTCRED 2 +#define AUTH_BADVERF 3 +#define AUTH_REJECTVERF 4 +#define AUTH_TOOWEAK 5 + +/* Sizes of RPC header parts */ + +#define RPC_SIZ 24 +#define RPC_REPLYSIZ 28 +#define RPC_RPATH_MAXSIZE NFS_MOUNT_PATH_MAX_SIZE + +#if (NFS_PROTO_TYPE == NFS_IPPROTO_TCP) +#define RPC_RMSIZE 4 +#define RPC_RM_FLAGMENT_LAST_FLAG 0x80000000 +#define RPC_RM_FLAGMENT_LEN_MASK 0x7FFFFFFF +#elif (NFS_PROTO_TYPE == NFS_IPPROTO_UDP) +#define RPC_RMSIZE 0 +#endif + +/* RPC Prog definitions */ + +#define RPCPROG_MNT 100005 +#define RPCMNT_VER1 1 +#define RPCMNT_VER3 3 +#define RPCMNT_MOUNT 1 +#define RPCMNT_DUMP 2 +#define RPCMNT_UMOUNT 3 +#define RPCMNT_UMNTALL 4 +#define RPCMNT_EXPORT 5 +#define RPCMNT_NAMELEN 255 +#define RPCMNT_PATHLEN 1024 +#define RPCPROG_NFS 100003 + +/* RPC definitions for the portmapper. */ + +#define PMAPPORT 111 +#define PMAPPROG 100000 +#define PMAPVERS 2 + +#define PMAPPROC_NULL 0 +#define PMAPPROC_SET 1 +#define PMAPPROC_UNSET 2 +#define PMAPPROC_GETPORT 3 +#define PMAPPROC_DUMP 4 +#define PMAPPROC_CALLIT 5 + +#define RPC_SUCCESS 0 + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* Global RPC statistics */ + +#ifdef CONFIG_NFS_STATISTICS +struct rpcstats +{ + int rpcretries; + int rpcrequests; + int rpctimeouts; + int rpcinvalid; +}; +#endif + +/* PMAP headers */ + +struct call_args_pmap +{ + uint32_t prog; + uint32_t vers; + uint32_t proc; + uint32_t port; +}; + +struct call_result_pmap +{ + uint32_t port; +}; + +/* MOUNTD headers */ + +struct call_args_mount +{ + uint32_t len; + char rpath[RPC_RPATH_MAXSIZE]; +}; + +struct call_args_umount +{ + uint32_t len; + char rpath[RPC_RPATH_MAXSIZE]; +}; + + + +/* Generic RPC call headers */ + +enum auth_flavor +{ + AUTH_NONE = 0, + AUTH_SYS = 1, + AUTH_SHORT = 2, + AUTH_DES = 3, + AUTH_MAX + + /* and more to be defined */ +}; + +struct call_result_mount +{ + uint32_t status; + struct file_handle fhandle; + uint32_t authlen; + uint32_t autolist[AUTH_MAX]; +}; + +/* Generic RPC call headers */ + +struct rpc_auth_info +{ + uint32_t authtype; /* auth type */ + uint32_t authlen; /* auth length */ +}; + +struct auth_unix +{ + uint32_t stamp; + uint32_t hostname_len; + + /* use n uint32_t(s) to store CONFIG_NFS_MACHINE_NAME_SIZE bytes */ + + uint32_t hostname[(CONFIG_NFS_MACHINE_NAME_SIZE + sizeof(uint32_t) - 1) / sizeof(uint32_t)]; + uint32_t uid; + uint32_t gid; + uint32_t gidlist; + uint32_t gidlist_value; +}; + +struct rpc_call_header +{ +#if (NFS_PROTO_TYPE == NFS_IPPROTO_TCP) + uint32_t rp_recmark; /* fragment header */ +#endif + uint32_t rp_xid; /* request transaction id */ + int32_t rp_direction; /* call direction (0) */ + uint32_t rp_rpcvers; /* RPC version (2) */ + uint32_t rp_prog; /* program */ + uint32_t rp_vers; /* version */ + uint32_t rp_proc; /* procedure */ + struct rpc_auth_info rpc_auth; + struct auth_unix rpc_auth_unix; + struct rpc_auth_info rpc_verf; +}; + +struct rpc_call_pmap +{ + struct rpc_call_header ch; + struct call_args_pmap pmap; +}; + +struct rpc_call_mount +{ + struct rpc_call_header ch; + struct call_args_mount mount; +}; + +struct rpc_call_umount +{ + struct rpc_call_header ch; + struct call_args_umount umount; +}; + +struct rpc_call_create +{ + struct rpc_call_header ch; + struct CREATE3args create; +}; + +struct rpc_call_lookup +{ + struct rpc_call_header ch; + struct LOOKUP3args lookup; +}; +#define SIZEOF_rpc_call_lookup(n) (sizeof(struct rpc_call_header) + SIZEOF_LOOKUP3args(n)) + +struct rpc_call_read +{ + struct rpc_call_header ch; + struct READ3args read; +}; + +struct rpc_call_write +{ + struct rpc_call_header ch; + struct WRITE3args write; /* Variable length */ +}; +#define SIZEOF_rpc_call_write(n) (sizeof(struct rpc_call_header) + SIZEOF_WRITE3args(n)) + +struct rpc_call_remove +{ + struct rpc_call_header ch; + struct REMOVE3args remove; +}; + +struct rpc_call_rename +{ + struct rpc_call_header ch; + struct RENAME3args rename; +}; + +struct rpc_call_mkdir +{ + struct rpc_call_header ch; + struct MKDIR3args mkdir; +}; + +struct rpc_call_rmdir +{ + struct rpc_call_header ch; + struct RMDIR3args rmdir; +}; + +struct rpc_call_readdir +{ + struct rpc_call_header ch; + struct READDIR3args readdir; +}; + +struct rpc_call_setattr +{ + struct rpc_call_header ch; + struct SETATTR3args setattr; +}; + +struct rpc_call_fs +{ + struct rpc_call_header ch; + struct FS3args fs; +}; + +/* Generic RPC reply headers */ + +struct rpc_reply_header +{ +#if (NFS_PROTO_TYPE == NFS_IPPROTO_TCP) + uint32_t rp_recmark; /* fragment header */ +#endif + uint32_t rp_xid; /* Request transaction id */ + uint32_t rp_direction; /* Call direction (1) */ + uint32_t type; + struct rpc_auth_info rpc_verfi; + uint32_t status; +}; + +struct nfs_reply_header +{ +#if (NFS_PROTO_TYPE == NFS_IPPROTO_TCP) + uint32_t rp_recmark; /* fragment header */ +#endif + uint32_t rp_xid; /* Request transaction id */ + uint32_t rp_direction; /* Call direction (1) */ + uint32_t type; + struct rpc_auth_info rpc_verfi; + uint32_t status; + uint32_t nfs_status; +}; + +struct rpc_reply_pmap +{ + struct rpc_reply_header rh; + struct call_result_pmap pmap; +}; + +struct rpc_reply_mount +{ + struct rpc_reply_header rh; + struct call_result_mount mount; +}; + +struct rpc_reply_umount +{ + struct rpc_reply_header rh; +}; + +struct rpc_reply_create +{ + struct rpc_reply_header rh; + uint32_t status; + struct CREATE3resok create; +}; + +struct rpc_reply_lookup +{ + struct rpc_reply_header rh; + uint32_t status; + struct LOOKUP3resok lookup; +}; + +struct rpc_reply_write +{ + struct rpc_reply_header rh; + uint32_t status; + struct WRITE3resok write; /* Variable length */ +}; + +struct rpc_reply_read +{ + struct rpc_reply_header rh; + uint32_t status; + struct READ3resok read; /* Variable length */ +}; + +#define SIZEOF_rpc_reply_read(n) \ + (sizeof(struct rpc_reply_header) + sizeof(uint32_t) + \ + SIZEOF_READ3resok(n)) + +struct rpc_reply_remove +{ + struct rpc_reply_header rh; + uint32_t status; + struct REMOVE3resok remove; +}; + +struct rpc_reply_rename +{ + struct rpc_reply_header rh; + uint32_t status; + struct RENAME3resok rename; +}; + +struct rpc_reply_mkdir +{ + struct rpc_reply_header rh; + uint32_t status; + struct MKDIR3resok mkdir; +}; + +struct rpc_reply_rmdir +{ + struct rpc_reply_header rh; + uint32_t status; + struct RMDIR3resok rmdir; +}; + +struct rpc_reply_readdir +{ + struct rpc_reply_header rh; + uint32_t status; + struct READDIR3resok readdir; +}; + +#define SIZEOF_rpc_reply_readdir(n) \ + (sizeof(struct rpc_reply_header) + sizeof(uint32_t) + \ + SIZEOF_READDIR3resok(n)) + +struct rpc_reply_fsinfo +{ + struct rpc_reply_header rh; + uint32_t status; + struct nfsv3_fsinfo fsinfo; +}; + +struct rpc_reply_fsstat +{ + struct rpc_reply_header rh; + uint32_t status; + struct nfs_statfs fsstat; +}; + +struct rpc_reply_getattr +{ + struct rpc_reply_header rh; + uint32_t status; + struct nfs_fattr attr; +}; + +struct rpc_reply_setattr +{ + struct rpc_reply_header rh; + uint32_t status; + struct SETATTR3resok setattr; +}; + +struct rpcclnt +{ + nfsfh_t rc_fh; /* File handle of the root directory */ + unsigned int rc_fhsize; /* File size of the root directory */ + char *rc_path; /* Server's path of the mounted directory */ + uint32_t xid; + struct sockaddr *rc_name; + int rc_so; /* RPC socket */ + + bool rc_timeout; /* Receipt of reply timed out */ + uint8_t rc_sotype; /* Type of socket */ + uint8_t rc_retry; /* Max retries */ +}; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +void rpcclnt_init(void); +int rpcclnt_connect(FAR struct rpcclnt *rpc); +void rpcclnt_disconnect(FAR struct rpcclnt *rpc); +int rpcclnt_umount(FAR struct rpcclnt *rpc); +void rpcclnt_safedisconnect(FAR struct rpcclnt *rpc); +int rpcclnt_request(FAR struct rpcclnt *rpc, int procnum, int prog, int version, + FAR void *request, size_t reqlen, + FAR void *response, size_t resplen); +void rpcclnt_setuidgid(uint32_t uid, uint32_t gid); + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif /* __FS_NFS_RPC_H */ diff --git a/fs/nfs/rpc_clnt.c b/fs/nfs/rpc_clnt.c new file mode 100755 index 0000000..c3b6960 --- /dev/null +++ b/fs/nfs/rpc_clnt.c @@ -0,0 +1,1132 @@ +/**************************************************************************** + * fs/nfs/rpc_clnt.c + * + * Copyright (C) 2012-2013, 2018 Gregory Nutt. All rights reserved. + * Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved. + * Author: Jose Pablo Rojas Vargas + * Gregory Nutt + * + * Leveraged from OpenBSD: + * + * Copyright (c) 2004 The Regents of the University of Michigan. + * All rights reserved. + * + * Copyright (c) 2004 Weston Andros Adamson . + * Copyright (c) 2004 Marius Aamodt Eriksen . + * 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. Neither the name of the University nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``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 REGENTS OR CONTRIBUTORS 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. + * + * Copyright (c) 1989, 1991, 1993, 1995 The Regents of the University of + * California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by Rick Macklem at + * The University of Guelph. + * + * 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 the + * University of California, Berkeley and its contributors. 4. Neither the + * name of the University nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include "lwip/opt.h" +#include "lwip/sockets.h" +#include "xdr_subs.h" +#include "nfs_proto.h" +#include "rpc.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Increment RPC statistics */ + +#ifdef CONFIG_NFS_STATISTICS +# define rpc_statistics(n) do { rpcstats.n++; } while (0) +#else +# define rpc_statistics(n) +#endif + +#undef OK +#define OK 0 + +#define RPCCLNT_FH_LEN 4 +#define RPCCLNT_RECV_BUF_MAX_LEN 64 +#define RPCCLNT_CONNECT_MAX_RETRY_TIMES 1024 + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* Static data, mostly RPC constants in XDR form */ + +static uint32_t rpc_reply; +static uint32_t rpc_call; +static uint32_t rpc_vers; +static uint32_t rpc_msgdenied; +static uint32_t rpc_mismatch; +static uint32_t rpc_auth_unix; +static uint32_t rpc_msgaccepted; +static uint32_t rpc_autherr; +static uint32_t rpc_auth_null; +static uint32_t nfs_uid, nfs_gid; + +/* Global statics for all client instances. Cleared by NuttX on boot-up. */ + +#ifdef CONFIG_NFS_STATISTICS +static struct rpcstats rpcstats; +#endif + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static int rpcclnt_send(FAR struct rpcclnt *rpc, int procid, int prog, + FAR void *call, int reqlen); +static int rpcclnt_receive(FAR struct rpcclnt *rpc, struct sockaddr *aname, + int proc, int program, void *reply, size_t resplen); +static int rpcclnt_reply(FAR struct rpcclnt *rpc, int procid, int prog, + void *reply, size_t resplen); +static uint32_t rpcclnt_newxid(void); +static void rpcclnt_fmtheader(FAR struct rpc_call_header *ch, + uint32_t xid, int procid, int prog, int vers, size_t reqlen); +static int rpcclnt_reconnect(FAR struct rpcclnt *rpc, struct sockaddr *saddr); + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: rpcclnt_send + * + * Description: + * This is the nfs send routine. + * + * Returned Value: + * Returns zero on success or a (positive) errno value on failure. + * + ****************************************************************************/ + +static int rpcclnt_send(FAR struct rpcclnt *rpc, int procid, int prog, + FAR void *call, int reqlen) +{ + ssize_t nbytes; + int ret = OK; + + /* Send the call message + * + * On success, psock_sendto returns the number of bytes sent; + * On failure, it returns -1 with the specific error in errno. + */ + + nbytes = sendto(rpc->rc_so, call, reqlen, 0, + rpc->rc_name, sizeof(struct sockaddr)); + if (nbytes < 0) + { + /* psock_sendto failed */ + + ret = get_errno(); + ferr("ERROR: psock_sendto failed: %d\n", ret); + } + + return ret; +} + +#if (NFS_PROTO_TYPE == NFS_IPPROTO_UDP) +#define CONFIG_NFS_RECV_TIMEOUT 200 /* udp-nfs recv timeout in milli seconds */ + +/**************************************************************************** + * Name: rpcclnt_receive + * + * Description: + * Receive a Sun RPC Request/Reply. Only for SOCK_DGRAM + * + ****************************************************************************/ + +static int rpcclnt_receive(FAR struct rpcclnt *rpc, FAR struct sockaddr *aname, + int proc, int program, FAR void *reply, + size_t resplen) +{ + ssize_t nbytes; + int error = 0; + int ret; + fd_set fdreadset; + struct timeval timeval = {0}; + socklen_t fromlen = sizeof(struct sockaddr); + uint32_t xid; +retry: + FD_ZERO(&fdreadset); + FD_SET((uint32_t)(rpc->rc_so), &fdreadset); + + timeval.tv_sec = (CONFIG_NFS_RECV_TIMEOUT / 1000); + timeval.tv_usec = (CONFIG_NFS_RECV_TIMEOUT % 1000) * 1000; + + ret = select(rpc->rc_so + 1, &fdreadset, 0, 0, &timeval); + if (ret == 0) + { + fdbg("ERROR: rpcclnt_receive select nothing\n"); + return EAGAIN; + } + else if (ret < 0) + { + error = get_errno(); + fdbg("ERROR: rpcclnt_receive select error %d\n", error); + return error; + } + + nbytes = recvfrom(rpc->rc_so, reply, resplen, 0, aname, &fromlen); + if (nbytes <= (ssize_t)sizeof(xid)) + { + error = get_errno(); + fdbg("ERROR: psock_recvfrom failed: %d\n", error); + goto retry; + } + + error = memcpy_s((void *)&xid, sizeof(xid), ((char *)reply + RPC_RMSIZE), sizeof(xid)); + if (error != EOK) + { + return ENOBUFS; + } + + if (fxdr_unsigned(uint32_t, xid) != rpc->xid) + { + fdbg("ERROR: psock_recvfrom a wrong packet\n"); + goto retry; + } + + return error; +} + +#elif (NFS_PROTO_TYPE == NFS_IPPROTO_TCP) +#define CONFIG_NFS_RECV_TIMEOUT 5000 /* tcp-nfs recv timeout in milli seconds */ + +/**************************************************************************** + * Name: rpcclnt_receive + * + * Description: + * Receive a Sun RPC Request/Reply. Only for SOCK_STREAM + * + ****************************************************************************/ + +static int rpcclnt_receive(FAR struct rpcclnt *rpc, FAR struct sockaddr *aname, + int proc, int program, FAR void *reply, + size_t resplen) +{ + ssize_t nbytes; + size_t offset = 0; + size_t hdrlen = 0; + uint32_t total = 0; + int error; + int ret; + fd_set fdreadset; + struct timeval timeval = {0}; + socklen_t fromlen = sizeof(struct sockaddr); + + do + { + FD_ZERO(&fdreadset); + FD_SET((uint32_t)(rpc->rc_so), &fdreadset); + + timeval.tv_sec = (CONFIG_NFS_RECV_TIMEOUT / 1000); + timeval.tv_usec = (CONFIG_NFS_RECV_TIMEOUT % 1000) * 1000; + + ret = select(rpc->rc_so + 1, &fdreadset, 0, 0, &timeval); + if (ret == 0) /* no reply */ + { + fdbg("ERROR: rpcclnt_receive select nothing\n"); + return EAGAIN; + } + else if (ret < 0) /* select error */ + { + error = get_errno(); + fdbg("ERROR: rpcclnt_receive select error %d\n", error); + return error; + } + + nbytes = recvfrom(rpc->rc_so, (char *)reply + offset, resplen - offset, 0, aname, &fromlen); + if (nbytes < 0) + { + error = get_errno(); + fdbg("ERROR: rpcclnt_receive recvfrom error %d\n", error); + return error; + } + else if (nbytes == 0) + { + /* connection closed by peer side */ + + fdbg("ERROR: rpcclnt_receive connection closed by peer\n"); + return EIO; + } + else + { + offset += nbytes; + + /* parse fragment header */ + + if (offset == 0 || hdrlen < sizeof(struct rpc_reply_header)) + { + hdrlen += nbytes; + + /* unlikely */ + + if (hdrlen < sizeof(struct rpc_reply_header)) + { + continue; + } + + error = memcpy_s(&total, RPC_RMSIZE, reply, RPC_RMSIZE); + if (error != EOK) + { + return ENOBUFS; + } + total = (fxdr_unsigned(uint32_t, total) & RPC_RM_FLAGMENT_LEN_MASK) + RPC_RMSIZE; + } + } + } + while (offset < total); + + return 0; +} +#endif + +/**************************************************************************** + * Name: rpcclnt_reply + * + * Description: + * Received the RPC reply on the socket. + * + ****************************************************************************/ + +static int rpcclnt_reply(FAR struct rpcclnt *rpc, int procid, int prog, + FAR void *reply, size_t resplen) +{ + int error; + + /* Get the next RPC reply from the socket */ + + error = rpcclnt_receive(rpc, rpc->rc_name, procid, prog, reply, resplen); + if (error != 0) + { + ferr("ERROR: rpcclnt_receive returned: %d\n", error); + + /* For UDP, If we failed because of a timeout, then try sending the CALL + * message again. While for TCP, just return errno. + */ + +#if (NFS_PROTO_TYPE == NFS_IPPROTO_UDP) + if (error == EAGAIN || error == ETIMEDOUT) + { + rpc->rc_timeout = true; + } +#endif + } + + /* Get the xid and check that it is an RPC replysvr */ + + else + { + FAR struct rpc_reply_header *replyheader = + (FAR struct rpc_reply_header *)reply; + + if (replyheader->rp_direction != rpc_reply) + { + ferr("ERROR: Different RPC REPLY returned\n"); + rpc_statistics(rpcinvalid); + error = EPROTO; + } + } + + return error; +} + +/**************************************************************************** + * Name: rpcclnt_newxid + * + * Description: + * Get a new (non-zero) xid + * + ****************************************************************************/ +extern VOID LOS_GetCpuCycle(UINT32 *puwCntHi, UINT32 *puwCntLo); + +static uint32_t seed_gen_func(void) +{ + uint32_t seedhsb, seedlsb; + LOS_GetCpuCycle(&seedhsb, &seedlsb); + return seedlsb; +} + +static uint32_t rpcclnt_newxid(void) +{ + static uint32_t rpcclnt_xid = 0; + static uint32_t rpcclnt_xid_touched = 0; + + if ((rpcclnt_xid == 0) && (rpcclnt_xid_touched == 0)) + { + unsigned int seed = seed_gen_func(); + srand(seed); + rpcclnt_xid = rand(); + rpcclnt_xid_touched = 1; + } + else + { + int xidp = 0; + do + { + xidp = rand(); + } + while ((xidp % 256) == 0); + + rpcclnt_xid += xidp; + } + + return rpcclnt_xid; +} + +/**************************************************************************** + * Name: rpcclnt_alivecheck + * + * Description: + * Check if the connection is alive + * + ****************************************************************************/ + +static int rpcclnt_alivecheck(struct rpcclnt *rpc) +{ + fd_set rfd; + int recvlen; + char buf[RPCCLNT_RECV_BUF_MAX_LEN]; + const int bufsize = RPCCLNT_RECV_BUF_MAX_LEN; + int ret; + int sockfd = rpc->rc_so; + struct timeval timeout; + + FD_ZERO(&rfd); + if (sockfd < 0) + { + return ENETDOWN; + } + FD_SET((uint32_t)sockfd, &rfd); + + timeout.tv_sec = 0; + timeout.tv_usec = 0; + + /* no wait */ + + ret = select(sockfd + 1, &rfd, NULL, NULL, &timeout); + if (ret < 0) + { + fvdbg("ERROR rpc_alivecheck : select failure\n"); + return get_errno(); + } + + if (sockfd) + { + if (FD_ISSET((uint32_t)sockfd, &rfd)) + { + recvlen = recv(sockfd, buf, bufsize, 0); + if (recvlen <= 0) + { + (void)close(rpc->rc_so); + rpc->rc_so = -1; + } + else + { + fvdbg("ERROR rpc_alivecheck : recv unsolocit %d data from server\n", recvlen); + return ENOTSOCK; + } + } + } + + return 0; +} + +/**************************************************************************** + * Name: rpcclnt_fmtheader + * + * Description: + * Format the common part of the call header + * + ****************************************************************************/ + +static void rpcclnt_fmtheader(FAR struct rpc_call_header *ch, + uint32_t xid, int prog, int vers, int procid, size_t reqlen) +{ + unsigned int high = 0; + unsigned int low = 0; + int error; + + LOS_GetCpuCycle(&high, &low); + + /* Format the call header */ + +#if (NFS_PROTO_TYPE == NFS_IPPROTO_TCP) + ch->rp_recmark = txdr_unsigned(0x80000000 | (reqlen - RPC_RMSIZE)); +#endif + ch->rp_xid = txdr_unsigned(xid); + ch->rp_direction = rpc_call; + ch->rp_rpcvers = rpc_vers; + ch->rp_prog = txdr_unsigned(prog); + ch->rp_vers = txdr_unsigned(vers); + ch->rp_proc = txdr_unsigned(procid); + + ch->rpc_auth.authtype = rpc_auth_unix; + ch->rpc_auth.authlen = htonl(sizeof(ch->rpc_auth_unix)); + ch->rpc_auth_unix.stamp = txdr_unsigned((uint32_t)(((UINT64)high << 32) + low)); + ch->rpc_auth_unix.hostname_len = htonl(CONFIG_NFS_MACHINE_NAME_SIZE); + (void)memset_s(ch->rpc_auth_unix.hostname, sizeof(ch->rpc_auth_unix.hostname), + 0, sizeof(ch->rpc_auth_unix.hostname)); + error = memcpy_s(ch->rpc_auth_unix.hostname, sizeof(ch->rpc_auth_unix.hostname), + CONFIG_NFS_MACHINE_NAME, CONFIG_NFS_MACHINE_NAME_SIZE); + if (error != EOK) + { + return; + } + ch->rpc_auth_unix.uid = htonl(nfs_uid); + ch->rpc_auth_unix.gid = htonl(nfs_gid); + ch->rpc_auth_unix.gidlist = htonl(1); + ch->rpc_auth_unix.gidlist_value = nfs_gid; + + /* rpc_verf part (auth_null) */ + + ch->rpc_verf.authtype = rpc_auth_null; + ch->rpc_verf.authlen = 0; +} + +static int rpcclnt_reconnect(FAR struct rpcclnt *rpc, struct sockaddr *saddr) +{ + int errval; + int error; + +#if (NFS_PROTO_TYPE == NFS_IPPROTO_TCP) + extern long random(void); + unsigned short tport = 0; + unsigned short trycount = 0; + struct sockaddr_in sock_in; + + rpcclnt_disconnect(rpc); + + error = socket(rpc->rc_name->sa_family, rpc->rc_sotype, IPPROTO_TCP); + if (error < 0) + { + fdbg("ERROR: psock_socket failed: %d", get_errno()); + return -error; + } + + rpc->rc_so = error; + sock_in.sin_family = AF_INET; + sock_in.sin_addr.s_addr = INADDR_ANY; + trycount = RPCCLNT_CONNECT_MAX_RETRY_TIMES; + + do + { + errval = 0; + trycount--; + tport = random() % (RPCCONN_MAXPORT - RPCCONN_MINPORT) + RPCCONN_MINPORT; + sock_in.sin_port = htons(tport); + error = bind(rpc->rc_so, (struct sockaddr *)&sock_in, sizeof(sock_in)); + if (error < 0) + { + errval = get_errno(); + fdbg("ERROR: psock_bind failed: %d\n", errval); + } + } + while (errval == EADDRINUSE && trycount > 0); + + if (error) + { + fdbg("ERROR: psock_bind failed: %d, port = %d\n", errval, tport); + goto bad; + } +#endif + error = connect(rpc->rc_so, saddr, sizeof(*saddr)); + if (error < 0) + { + errval = get_errno(); + fdbg("ERROR: psock_connect failed [port=%d]: %d\n", + ntohs(((struct sockaddr_in *)saddr)->sin_port), errval); + goto bad; + } + return error; +bad: + rpcclnt_disconnect(rpc); + return errval; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: rpcclnt_init + * + * Description: + * Initialize the RPC client + * + ****************************************************************************/ + +void rpcclnt_init(void) +{ + /* RPC constants how about actually using more than one of these! */ + + rpc_reply = txdr_unsigned(RPC_REPLY); + rpc_vers = txdr_unsigned(RPC_VER2); + rpc_call = txdr_unsigned(RPC_CALL); + rpc_msgdenied = txdr_unsigned(RPC_MSGDENIED); + rpc_msgaccepted = txdr_unsigned(RPC_MSGACCEPTED); + rpc_mismatch = txdr_unsigned(RPC_MISMATCH); + rpc_autherr = txdr_unsigned(RPC_AUTHERR); + rpc_auth_unix = txdr_unsigned(RPCAUTH_UNIX); + rpc_auth_null = txdr_unsigned(RPCAUTH_NULL); + + finfo("RPC initialized\n"); +} + +/**************************************************************************** + * Name: rpcclnt_connect + * + * Description: + * Initialize sockets for a new RPC connection. We do not free the + * sockaddr if an error occurs. + * + ****************************************************************************/ + +int rpcclnt_connect(struct rpcclnt *rpc) +{ + extern long random(void); + int error; + struct sockaddr *saddr; + struct sockaddr_in sin; + struct sockaddr_in *sa; + + union + { + struct rpc_call_pmap sdata; + struct rpc_call_mount mountd; + } request; + + union + { + struct rpc_reply_pmap rdata; + struct rpc_reply_mount mdata; + } response; + + uint16_t trycount; + uint16_t tport = 0; + int errval; + + finfo("Connecting\n"); + + /* Create the socket */ + + saddr = rpc->rc_name; + + /* Create an instance of the socket state structure */ + + error = socket(saddr->sa_family, rpc->rc_sotype, NFS_PROTOTYPE); + if (error < 0) + { + fdbg("ERROR: psock_socket failed: %d", get_errno()); + return -error; + } + + rpc->rc_so = error; + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = INADDR_ANY; + trycount = RPCCLNT_CONNECT_MAX_RETRY_TIMES; + + do + { + errval = 0; + trycount--; + tport = random() % (RPCCONN_MAXPORT - RPCCONN_MINPORT) + RPCCONN_MINPORT; + sin.sin_port = htons(tport); + + error = bind(rpc->rc_so, (struct sockaddr *)&sin, sizeof(sin)); + if (error < 0) + { + errval = get_errno(); + ferr("ERROR: psock_bind failed: %d\n", errval); + } + } + while (errval == EADDRINUSE && trycount > 0); + + if (error) + { + ferr("ERROR: psock_bind failed: %d, port = %d\n", errval, tport); + goto bad; + } + + /* Protocols that do not require connections could be optionally left + * unconnected. That would allow servers to reply from a port other than + * the NFS_PORT. + */ + + error = connect(rpc->rc_so, saddr, sizeof(*saddr)); + if (error < 0) + { + error = get_errno(); + ferr("ERROR: psock_connect to PMAP port failed: %d", error); + goto bad; + } + + /* Do the RPC to get a dynamic bounding with the server using ppmap. + * Get port number for MOUNTD. + */ + + request.sdata.pmap.prog = txdr_unsigned(RPCPROG_MNT); + request.sdata.pmap.vers = txdr_unsigned(RPCMNT_VER3); + request.sdata.pmap.proc = txdr_unsigned(NFS_PROTOTYPE); + request.sdata.pmap.port = 0; + + error = rpcclnt_request(rpc, PMAPPROC_GETPORT, PMAPPROG, PMAPVERS, + (FAR void *)&request.sdata, sizeof(struct call_args_pmap), + (FAR void *)&response.rdata, sizeof(struct rpc_reply_pmap)); + if (error != 0) + { + ferr("ERROR: rpcclnt_request failed: %d\n", error); + goto bad; + } + + sa = (FAR struct sockaddr_in *)saddr; + sa->sin_port = htons(fxdr_unsigned(uint32_t, response.rdata.pmap.port)); + + error = rpcclnt_reconnect(rpc, saddr); + if (error != 0) + { + fdbg("ERROR: rpcclnt_reconnect failed: %d\n", error); + goto bad; + } + + /* Do RPC to mountd. */ + + error = memset_s(&request, sizeof(request), 0, sizeof(request)); + if (error != EOK) + { + error = ENOBUFS; + goto bad; + } + error = strncpy_s(request.mountd.mount.rpath, sizeof(request.mountd.mount.rpath), + rpc->rc_path, RPC_RPATH_MAXSIZE - 1); + if (error != EOK) + { + error = ENOBUFS; + goto bad; + } + request.mountd.mount.len = txdr_unsigned(sizeof(request.mountd.mount.rpath)); + + error = rpcclnt_request(rpc, RPCMNT_MOUNT, RPCPROG_MNT, RPCMNT_VER3, + (FAR void *)&request.mountd, + sizeof(struct call_args_mount), + (FAR void *)&response.mdata, + sizeof(struct rpc_reply_mount)); + if (error != 0) + { + ferr("ERROR: rpcclnt_request failed: %d\n", error); + goto bad; + } + + error = fxdr_unsigned(uint32_t, response.mdata.mount.status); + if (error != 0) + { + ferr("ERROR: Bad mount status: %d\n", error); + goto bad; + } + + rpc->rc_fhsize = fxdr_unsigned(uint32_t, response.mdata.mount.fhandle.length); + memcpy(&rpc->rc_fh, &response.mdata.mount.fhandle.handle, rpc->rc_fhsize); + + /* Do the RPC to get a dynamic bounding with the server using PMAP. + * NFS port in the socket. + */ + + sa->sin_port = htons(PMAPPORT); + + error = rpcclnt_reconnect(rpc, saddr); + if (error != 0) + { + fdbg("ERROR: rpcclnt_reconnect failed: %d\n", error); + goto bad; + } + + request.sdata.pmap.prog = txdr_unsigned(NFS_PROG); + request.sdata.pmap.vers = txdr_unsigned(NFS_VER3); + request.sdata.pmap.proc = txdr_unsigned(NFS_PROTOTYPE); + request.sdata.pmap.port = 0; + + error = rpcclnt_request(rpc, PMAPPROC_GETPORT, PMAPPROG, PMAPVERS, + (FAR void *)&request.sdata, + sizeof(struct call_args_pmap), + (FAR void *)&response.rdata, + sizeof(struct rpc_reply_pmap)); + if (error != 0) + { + ferr("ERROR: rpcclnt_request failed: %d\n", error); + goto bad; + } + + sa->sin_port = htons(fxdr_unsigned(uint32_t, response.rdata.pmap.port)); + + error = rpcclnt_reconnect(rpc, saddr); + if (error != 0) + { + fdbg("ERROR: rpcclnt_reconnect failed: %d\n", error); + goto bad; + } + + return OK; + +bad: + rpcclnt_disconnect(rpc); + return error; +} + +/**************************************************************************** + * Name: rpcclnt_disconnect + * + * Description: + * Disconnect from the NFS server. + * + ****************************************************************************/ + +void rpcclnt_disconnect(struct rpcclnt *rpc) +{ + if (rpc->rc_so != -1) + { + (void)lwip_close(rpc->rc_so); + rpc->rc_so = -1; + } +} + +/**************************************************************************** + * Name: rpcclnt_umount + * + * Description: + * Un-mount the NFS file system. + * + ****************************************************************************/ + +int rpcclnt_umount(struct rpcclnt *rpc) +{ + struct sockaddr *saddr; + struct sockaddr_in *sa; + + union + { + struct rpc_call_pmap sdata; + struct rpc_call_umount mountd; + } request; + + union + { + struct rpc_reply_pmap rdata; + struct rpc_reply_umount mdata; + } response; + + int error; + + saddr = rpc->rc_name; + sa = (FAR struct sockaddr_in *)saddr; + + /* Do the RPC to get a dynamic bounding with the server using ppmap. + * Get port number for MOUNTD. + */ + + sa->sin_port = htons(PMAPPORT); + + error = rpcclnt_reconnect(rpc, saddr); + if (error != 0) + { + fdbg("ERROR: rpcclnt_reconnect failed: %d\n", error); + goto bad; + } + + request.sdata.pmap.prog = txdr_unsigned(RPCPROG_MNT); + request.sdata.pmap.vers = txdr_unsigned(RPCMNT_VER3); + request.sdata.pmap.proc = txdr_unsigned(NFS_PROTOTYPE); + request.sdata.pmap.port = 0; + + error = rpcclnt_request(rpc, PMAPPROC_GETPORT, PMAPPROG, PMAPVERS, + (FAR void *)&request.sdata, + sizeof(struct call_args_pmap), + (FAR void *)&response.rdata, + sizeof(struct rpc_reply_pmap)); + if (error != 0) + { + ferr("ERROR: rpcclnt_request failed: %d\n", error); + goto bad; + } + + sa->sin_port = htons(fxdr_unsigned(uint32_t, response.rdata.pmap.port)); + + error = rpcclnt_reconnect(rpc, saddr); + if (error != 0) + { + fdbg("ERROR: rpcclnt_reconnect failed: %d\n", error); + goto bad; + } + + /* Do RPC to umountd. */ + + (void)strncpy_s(request.mountd.umount.rpath, sizeof(request.mountd.umount.rpath), + rpc->rc_path, sizeof(request.mountd.umount.rpath) - 1); + request.mountd.umount.rpath[sizeof(request.mountd.umount.rpath) - 1] = 0; + request.mountd.umount.len = txdr_unsigned(sizeof(request.mountd.umount.rpath)); + + error = rpcclnt_request(rpc, RPCMNT_UMOUNT, RPCPROG_MNT, RPCMNT_VER3, + (FAR void *)&request.mountd, + sizeof(struct call_args_umount), + (FAR void *)&response.mdata, + sizeof(struct rpc_reply_umount)); + if (error != 0) + { + ferr("ERROR: rpcclnt_request failed: %d\n", error); + goto bad; + } + + return OK; + +bad: + + /* No need to close the socket here, if umount failed. user has to call nfs_unbind again */ + + return error; +} + +/**************************************************************************** + * Name: rpcclnt_request + * + * Description: + * Perform the RPC request. Logic formats the RPC CALL message and calls + * rpcclnt_send to send the RPC CALL message. It then calls rpcclnt_reply() + * to get the response. It may attempt to re-send the CALL message on + * certain errors. + * + * On successful receipt, it verifies the RPC level of the returned values. + * (There may still be be NFS layer errors that will be deted by calling + * logic). + * + ****************************************************************************/ + +int rpcclnt_request(FAR struct rpcclnt *rpc, int procnum, int prog, + int version, FAR void *request, size_t reqlen, + FAR void *response, size_t resplen) +{ + struct rpc_reply_header *replymsg; + uint32_t tmp; +#if (NFS_PROTO_TYPE == NFS_IPPROTO_UDP) + int retries; +#endif + int error = 0; + + /* Get a new (non-zero) xid */ + + rpc->xid = rpcclnt_newxid(); + + /* Get the full size of the message (the size of variable data plus the size of + * the messages header). + */ + + reqlen += sizeof(struct rpc_call_header); + + /* Initialize the RPC header fields */ + + rpcclnt_fmtheader((FAR struct rpc_call_header *)request, + rpc->xid, prog, version, procnum, reqlen); + + /* Send the RPC call messsages and receive the RPC response. For UDP-RPC, A limited + * number of re-tries will be attempted, but only for the case of response + * timeouts. While for TCP-RPC, no retry attempted. + */ + +#if (NFS_PROTO_TYPE == NFS_IPPROTO_UDP) + retries = 0; + do + { + /* Do the client side RPC. */ + + rpc_statistics(rpcrequests); + rpc->rc_timeout = false; + + /* Send the RPC CALL message */ + + error = rpcclnt_send(rpc, procnum, prog, request, reqlen); + if (error != OK) + { + finfo("ERROR rpcclnt_send failed: %d\n", error); + } + + /* Wait for the reply from our send */ + + else + { + error = rpcclnt_reply(rpc, procnum, prog, response, resplen); + if (error != OK) + { + finfo("ERROR rpcclnt_reply failed: %d\n", error); + } + } + + retries++; + } + while (rpc->rc_timeout && retries <= rpc->rc_retry); + + if (error != OK) + { + ferr("ERROR: RPC failed: %d\n", error); + return error; + } + +#else + + /* check tcp connection alive or not as server would close connection if long time no data transfer */ + + if (rpc->rc_so != -1) + { + error = rpcclnt_alivecheck(rpc); + if (error != OK) + { + fvdbg("ERROR rpc_alivecheck failed: %d\n", error); + return error; + } + } + + /* reconnect due to previous connection down */ + + if (rpc->rc_so == -1) + { + error = rpcclnt_reconnect(rpc, rpc->rc_name); + if (error != OK) + { + fvdbg("ERROR rpcclnt_send failed: %d\n", error); + return error; + } + } + + rpc_statistics(rpcrequests); + + /* Send the RPC CALL message */ + + error = rpcclnt_send(rpc, procnum, prog, request, reqlen); + if (error != OK) + { + rpcclnt_disconnect(rpc); + fvdbg("ERROR rpcclnt_send failed: %d\n", error); + return error; + } + + /* Wait for the reply from our send */ + + error = rpcclnt_reply(rpc, procnum, prog, response, resplen); + if (error != OK) + { + rpcclnt_disconnect(rpc); + fvdbg("ERROR rpcclnt_reply failed: %d\n", error); + return error; + } + +#endif + + /* Break down the RPC header and check if it is OK */ + + replymsg = (FAR struct rpc_reply_header *)response; + + tmp = fxdr_unsigned(uint32_t, replymsg->type); + if (tmp == RPC_MSGDENIED) + { + tmp = fxdr_unsigned(uint32_t, replymsg->status); + switch (tmp) + { + case RPC_MISMATCH: + ferr("ERROR: RPC_MSGDENIED: RPC_MISMATCH error\n"); + return EOPNOTSUPP; + + case RPC_AUTHERR: + ferr("ERROR: RPC_MSGDENIED: RPC_AUTHERR error\n"); + return EACCES; + + default: + return EOPNOTSUPP; + } + } + else if (tmp != RPC_MSGACCEPTED) + { + return EOPNOTSUPP; + } + + tmp = fxdr_unsigned(uint32_t, replymsg->status); + if (tmp == RPC_SUCCESS) + { + finfo("RPC_SUCCESS\n"); + } + else if (tmp == RPC_PROGMISMATCH) + { + ferr("ERROR: RPC_MSGACCEPTED: RPC_PROGMISMATCH error\n"); + return EOPNOTSUPP; + } + else if (tmp > 5) + { + ferr("ERROR: Unsupported RPC type: %d\n", tmp); + return EOPNOTSUPP; + } + + return OK; +} + +void rpcclnt_setuidgid(uint32_t uid, uint32_t gid) +{ + nfs_uid = uid; + nfs_gid = gid; +} diff --git a/fs/nfs/xdr_subs.h b/fs/nfs/xdr_subs.h new file mode 100755 index 0000000..48c0ccd --- /dev/null +++ b/fs/nfs/xdr_subs.h @@ -0,0 +1,140 @@ +/**************************************************************************** + * fs/nfs/xdr_subs.h + * Definitions for Sun RPC Version 2, from + * "RPC: Remote Procedure Call Protocol Specification" RFC1057 + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved. + * Author: Jose Pablo Rojas Vargas + * Gregory Nutt + * + * Leveraged from OpenBSD: + * + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Rick Macklem at The University of Guelph. + * + * 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. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __FS_NFS_XDR_SUBS_H +#define __FS_NFS_XDR_SUBS_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "lwip/sockets.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Macros used for conversion to/from xdr representation by nfs... + * These use the MACHINE DEPENDENT routines ntohl, htonl + * As defined by "XDR: External Data Representation Standard" RFC1014 + * + * To simplify the implementation, we use ntohl/htonl even on big-endian + * machines, and count on them being `#define'd away. Some of these + * might be slightly more efficient as int64_t copies on a big-endian, + * but we cannot count on their alignment anyway. + */ + +#define fxdr_unsigned(t, v) ((t)ntohl(v)) +#define txdr_unsigned(v) (htonl(v)) + +#define fxdr_nfsv2time(f, t) \ +{ \ + (t)->tv_sec = ntohl(((struct nfsv2_time *)(f))->nfsv2_sec); \ + if (((struct nfsv2_time *)(f))->nfsv2_usec != 0xffffffff) \ + (t)->tv_nsec = 1000 * ntohl(((struct nfsv2_time *)(f))->nfsv2_usec); \ + else \ + (t)->tv_nsec = 0; \ +} + +#define txdr_nfsv2time(f, t) \ +{ \ + ((struct nfsv2_time *)(t))->nfsv2_sec = htonl((f)->tv_sec); \ + if ((f)->tv_nsec != -1) \ + ((struct nfsv2_time *)(t))->nfsv2_usec = htonl((f)->tv_nsec / 1000); \ + else \ + ((struct nfsv2_time *)(t))->nfsv2_usec = 0xffffffff; \ +} + +#define fxdr_nfsv3time(f, t) \ +{ \ + (t)->tv_sec = ntohl(((struct nfsv3_time *)(f))->nfsv3_sec); \ + (t)->tv_nsec = ntohl(((struct nfsv3_time *)(f))->nfsv3_nsec); \ +} + +#define fxdr_nfsv3time2(f, t) { \ + (t)->nfsv3_sec = ntohl(((struct nfsv3_time *)(f))->nfsv3_sec); \ + (t)->nfsv3_nsec = ntohl(((struct nfsv3_time *)(f))->nfsv3_nsec); \ +} + +#define txdr_nfsv3time(f, t) \ +{ \ + ((struct nfsv3_time *)(t))->nfsv3_sec = htonl((f)->tv_sec); \ + ((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->tv_nsec); \ +} + +#define txdr_nfsv3time2(f, t) \ +{ \ + ((struct nfsv3_time *)(t))->nfsv3_sec = htonl((f)->nfsv3_sec); \ + ((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->nfsv3_nsec); \ +} + +#define fxdr_hyper(f) \ + ((((uint64_t)ntohl(((uint32_t *)(f))[0])) << 32) | \ + (uint64_t)(ntohl(((uint32_t *)(f))[1]))) + +#define txdr_hyper(f, t) \ +{ \ + ((uint32_t *)(t))[0] = htonl((uint32_t)((f) >> 32)); \ + ((uint32_t *)(t))[1] = htonl((uint32_t)((f) & 0xffffffff)); \ +} + +/* Macros for dealing with byte data saved in uint32_t aligned memory */ + +#define uint32_aligndown(b) ((b) & ~3) +#define uint32_alignup(b) (((b) + 3) & ~3) +#define uint32_increment(b) (((b) + 3) >> 2) + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif /* __FS_NFS_XDR_SUBS_H */ diff --git a/fs/tmpfs/fs_tmpfs.c b/fs/tmpfs/fs_tmpfs.c new file mode 100755 index 0000000..f57c788 --- /dev/null +++ b/fs/tmpfs/fs_tmpfs.c @@ -0,0 +1,2390 @@ +/**************************************************************************** + * fs/tmpfs/fs_tmpfs.c + * + * Copyright (C) 2015, 2017-2018 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "fs/dirent_fs.h" +#include "los_tables.h" +#include "fs_tmpfs.h" +#include "los_vm_filemap.h" +#include "user_copy.h" + +#ifdef LOSCFG_FS_RAMFS + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* +#if CONFIG_FS_TMPFS_DIRECTORY_FREEGUARD <= CONFIG_FS_TMPFS_DIRECTORY_ALLOCGUARD +# warning CONFIG_FS_TMPFS_DIRECTORY_FREEGUARD needs to be > ALLOCGUARD +#endif + +#if CONFIG_FS_TMPFS_FILE_FREEGUARD <= CONFIG_FS_TMPFS_FILE_ALLOCGUARD +# warning CONFIG_FS_TMPFS_FILE_FREEGUARD needs to be > ALLOCGUARD +#endif +*/ +#define tmpfs_lock_file(tfo) \ + (tmpfs_lock_object((FAR struct tmpfs_object_s *)tfo)) +#define tmpfs_lock_directory(tdo) \ + (tmpfs_lock_object((FAR struct tmpfs_object_s *)tdo)) +#define tmpfs_unlock_file(tfo) \ + (tmpfs_unlock_object((FAR struct tmpfs_object_s *)tfo)) +#define tmpfs_unlock_directory(tdo) \ + (tmpfs_unlock_object((FAR struct tmpfs_object_s *)tdo)) + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/* TMPFS helpers */ + +static void tmpfs_lock_reentrant(FAR struct tmpfs_sem_s *sem); +static void tmpfs_lock(FAR struct tmpfs_s *fs); +static void tmpfs_unlock_reentrant(FAR struct tmpfs_sem_s *sem); +static void tmpfs_unlock(FAR struct tmpfs_s *fs); +static void tmpfs_lock_object(FAR struct tmpfs_object_s *to); +static void tmpfs_unlock_object(FAR struct tmpfs_object_s *to); +static void tmpfs_release_lockedobject(FAR struct tmpfs_object_s *to); +static void tmpfs_release_lockedfile(FAR struct tmpfs_file_s *tfo); +static struct tmpfs_dirent_s *tmpfs_find_dirent(FAR struct tmpfs_directory_s *tdo, + FAR const char *name); +static int tmpfs_remove_dirent(FAR struct tmpfs_directory_s *tdo, + FAR struct tmpfs_object_s *to); +static int tmpfs_add_dirent(FAR struct tmpfs_directory_s **tdo, + FAR struct tmpfs_object_s *to, FAR const char *name); +static FAR struct tmpfs_file_s *tmpfs_alloc_file(void); +static int tmpfs_create_file(FAR struct tmpfs_s *fs, + FAR const char *relpath, FAR struct tmpfs_file_s **tfo); +static FAR struct tmpfs_directory_s *tmpfs_alloc_directory(void); +static int tmpfs_create_directory(FAR struct tmpfs_s *fs, + FAR const char *relpath, FAR struct tmpfs_directory_s **tdo); +static int tmpfs_find_object(FAR struct tmpfs_s *fs, + FAR const char *relpath, FAR struct tmpfs_object_s **object, + FAR struct tmpfs_directory_s **parent); +static int tmpfs_find_file(FAR struct tmpfs_s *fs, + FAR const char *relpath, + FAR struct tmpfs_file_s **tfo, + FAR struct tmpfs_directory_s **parent); +static int tmpfs_find_directory(FAR struct tmpfs_s *fs, + FAR const char *relpath, + FAR struct tmpfs_directory_s **tdo, + FAR struct tmpfs_directory_s **parent); + +/* File system operations */ + +static int tmpfs_open(FAR struct file *filep, FAR const char *relpath, + int oflags, mode_t mode); +static int tmpfs_close(FAR struct file *filep); +static ssize_t tmpfs_read(FAR struct file *filep, FAR char *buffer, + size_t buflen); +static ssize_t tmpfs_write(FAR struct file *filep, FAR const char *buffer, + size_t buflen); +static off_t tmpfs_seek(FAR struct file *filep, off_t offset, int whence); +static loff_t tmpfs_seek64(FAR struct file *filep, loff_t offset, int whence); +static int tmpfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg); +static int tmpfs_dup(FAR const struct file *oldp, FAR struct file *newp); + +static int tmpfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, + FAR struct fs_dirent_s *dir); +static int tmpfs_closedir(FAR struct inode *mountpt, + FAR struct fs_dirent_s *dir); +static int tmpfs_readdir(FAR struct inode *mountpt, + FAR struct fs_dirent_s *dir); +static int tmpfs_rewinddir(FAR struct inode *mountpt, + FAR struct fs_dirent_s *dir); +static int tmpfs_bind(FAR struct inode *blkdriver, FAR const void *data, + FAR void **handle, FAR const char *realpath); +static int tmpfs_unbind(FAR void *handle, FAR struct inode **blkdriver); +static int tmpfs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf); +static int tmpfs_unlink(FAR struct inode *mountpt, FAR const char *relpath); +static int tmpfs_mkdir(FAR struct inode *mountpt, FAR const char *relpath, + mode_t mode); +static int tmpfs_rmdir(FAR struct inode *mountpt, FAR const char *relpath); +static int tmpfs_rename(FAR struct inode *mountpt, FAR const char *oldrelpath, + FAR const char *newrelpath); +static void tmpfs_stat_common(FAR struct tmpfs_object_s *to, + FAR struct stat *buf); +static int tmpfs_stat(FAR struct inode *mountpt, FAR const char *relpath, + FAR struct stat *buf); + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +const struct mountpt_operations tmpfs_operations = +{ + tmpfs_open, /* open */ + tmpfs_close, /* close */ + tmpfs_read, /* read */ + tmpfs_write, /* write */ + tmpfs_seek, /* seek */ + tmpfs_ioctl, /* ioctl */ + OsVfsFileMmap, /* mmap */ + NULL, /* sync */ + tmpfs_dup, /* dup */ + NULL, /* fstat */ + NULL, /* truncate */ + + tmpfs_opendir, /* opendir */ + tmpfs_closedir, /* closedir */ + tmpfs_readdir, /* readdir */ + tmpfs_rewinddir, /* rewinddir */ + + tmpfs_bind, /* bind */ + tmpfs_unbind, /* unbind */ + tmpfs_statfs, /* statfs */ + NULL, /* virstafs */ + tmpfs_unlink, /* unlink */ + tmpfs_mkdir, /* mkdir */ + tmpfs_rmdir, /* rmdir */ + tmpfs_rename, /* rename */ + tmpfs_stat, /* stat */ + NULL, /* utime */ + NULL, /* chattr */ + tmpfs_seek64, /* seek64 */ + NULL, /* getlabel */ + NULL, /* fallocate */ + NULL, /* fallocate64 */ + NULL, /* truncate64 */ + NULL, /* fscheck */ + NULL, /* map_pages */ + NULL, /* readpage */ + NULL, /* writepage */ +}; + +static struct tmpfs_s tmpfs_superblock = {0}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: tmpfs_timestamp + ****************************************************************************/ + +static time_t tmpfs_timestamp(void) +{ + struct timeval tv; + + (void)gettimeofday(&tv, (struct timezone *)NULL); + + return (time_t)(tv.tv_sec); +} + +/**************************************************************************** + * Name: tmpfs_lock_reentrant + ****************************************************************************/ + +static void tmpfs_lock_reentrant(FAR struct tmpfs_sem_s *sem) +{ + pid_t me; + + /* Do we already hold the semaphore? */ + + me = getpid(); + if (me == sem->ts_holder) + { + /* Yes... just increment the count */ + + sem->ts_count++; + DEBUGASSERT(sem->ts_count > 0); + } + + /* Take the semaphore (perhaps waiting) */ + + else + { + while (sem_wait(&sem->ts_sem) != 0) + { + /* The only case that an error should occur here is if the wait + * was awakened by a signal. + */ + + DEBUGASSERT(get_errno() == EINTR); + } + + /* No we hold the semaphore */ + + sem->ts_holder = me; + sem->ts_count = 1; + } +} + +/**************************************************************************** + * Name: tmpfs_lock + ****************************************************************************/ + +static void tmpfs_lock(FAR struct tmpfs_s *fs) +{ + tmpfs_lock_reentrant(&fs->tfs_exclsem); +} + +/**************************************************************************** + * Name: tmpfs_lock_object + ****************************************************************************/ + +static void tmpfs_lock_object(FAR struct tmpfs_object_s *to) +{ + tmpfs_lock_reentrant(&to->to_exclsem); +} + +/**************************************************************************** + * Name: tmpfs_unlock_reentrant + ****************************************************************************/ + +static void tmpfs_unlock_reentrant(FAR struct tmpfs_sem_s *sem) +{ + DEBUGASSERT(sem->ts_holder == getpid()); + + /* Is this our last count on the semaphore? */ + + if (sem->ts_count > 1) + { + /* No.. just decrement the count */ + + sem->ts_count--; + } + + /* Yes.. then we can really release the semaphore */ + + else + { + sem->ts_holder = TMPFS_NO_HOLDER; + sem->ts_count = 0; + sem_post(&sem->ts_sem); + } +} + +/**************************************************************************** + * Name: tmpfs_unlock + ****************************************************************************/ + +static void tmpfs_unlock(FAR struct tmpfs_s *fs) +{ + tmpfs_unlock_reentrant(&fs->tfs_exclsem); +} + +/**************************************************************************** + * Name: tmpfs_unlock_object + ****************************************************************************/ + +static void tmpfs_unlock_object(FAR struct tmpfs_object_s *to) +{ + tmpfs_unlock_reentrant(&to->to_exclsem); +} + +/**************************************************************************** + * Name: tmpfs_release_lockedobject + ****************************************************************************/ + +static void tmpfs_release_lockedobject(FAR struct tmpfs_object_s *to) +{ + DEBUGASSERT(to && to->to_refs > 0); + + /* Is this a file object? */ + + if (to->to_type == TMPFS_REGULAR) + { + tmpfs_release_lockedfile((FAR struct tmpfs_file_s *)to); + } + else + { + to->to_refs--; + tmpfs_unlock_object(to); + } +} + +/**************************************************************************** + * Name: tmpfs_release_lockedfile + ****************************************************************************/ + +static void tmpfs_release_lockedfile(FAR struct tmpfs_file_s *tfo) +{ + DEBUGASSERT(tfo && tfo->tfo_refs > 0); + + /* If there are no longer any references to the file and the file has been + * unlinked from its parent directory, then free the file object now. + */ + + if (tfo->tfo_refs == 1 && (tfo->tfo_flags & TFO_FLAG_UNLINKED) != 0) + { + sem_destroy(&tfo->tfo_exclsem.ts_sem); + kmm_free(tfo->tfo_data); + kmm_free(tfo); + } + + /* Otherwise, just decrement the reference count on the file object */ + + else + { + tfo->tfo_refs--; + tmpfs_unlock_file(tfo); + } +} + +/**************************************************************************** + * Name: tmpfs_find_dirent + ****************************************************************************/ + +static struct tmpfs_dirent_s *tmpfs_find_dirent(FAR struct tmpfs_directory_s *tdo, + FAR const char *name) +{ + LOS_DL_LIST *node; + struct tmpfs_dirent_s *tde; + + /* Search the list of directory entries for a match */ + + for (node = tdo->tdo_entry.pstNext; node != &tdo->tdo_entry; node = node->pstNext) + { + tde = (struct tmpfs_dirent_s *)node; + if (tde->tde_inuse == true && strcmp(tde->tde_name, name) == 0) + { + return tde; + } + } + + /* Return NULL if not found */ + + return NULL; +} + +/**************************************************************************** + * Name: tmpfs_remove_dirent + ****************************************************************************/ + +static int tmpfs_remove_dirent(FAR struct tmpfs_directory_s *tdo, + FAR struct tmpfs_object_s *to) +{ + struct tmpfs_dirent_s *tde; + + /* Search the list of directory entries for a match */ + + tde = to->to_dirent; + if (tde == NULL) + { + return -ENONET; + } + + /* Free the object name */ + + if (tde->tde_name != NULL) + { + kmm_free(tde->tde_name); + tde->tde_name = NULL; + } + + if (tdo->tdo_count == 0) + { + LOS_ListDelete(&tde->tde_node); + kmm_free(tde); + } + else + { + tde->tde_inuse = false; + tde->tde_object = NULL; + } + + tdo->tdo_nentries--; + return OK; +} + +/**************************************************************************** + * Name: tmpfs_add_dirent + ****************************************************************************/ + +static int tmpfs_add_dirent(FAR struct tmpfs_directory_s **tdo, + FAR struct tmpfs_object_s *to, + FAR const char *name) +{ + FAR struct tmpfs_directory_s *parent; + FAR struct tmpfs_dirent_s *tde; + FAR char *newname; + + /* Copy the name string so that it will persist as long as the + * directory entry. + */ + + newname = strdup(name); + if (newname == NULL) + { + return -ENOSPC; + } + + tde = (FAR struct tmpfs_dirent_s *)malloc(sizeof(struct tmpfs_dirent_s)); + if (tde == NULL) + { + free(newname); + return -ENOSPC; + } + + tde->tde_object = to; + tde->tde_name = newname; + tde->tde_inuse = true; + to->to_dirent = tde; + + /* Save the new object info in the new directory entry */ + + parent = *tdo; + LOS_ListTailInsert(&parent->tdo_entry, &tde->tde_node); + parent->tdo_nentries++; + + /* Update directory times */ + + parent->tdo_ctime = parent->tdo_mtime = tmpfs_timestamp(); + + return OK; +} + +/**************************************************************************** + * Name: tmpfs_alloc_file + ****************************************************************************/ + +static FAR struct tmpfs_file_s *tmpfs_alloc_file(void) +{ + FAR struct tmpfs_file_s *tfo; + size_t allocsize; + + /* Create a new zero length file object */ + + allocsize = sizeof(struct tmpfs_file_s); + tfo = (FAR struct tmpfs_file_s *)kmm_malloc(allocsize); + if (tfo == NULL) + { + return NULL; + } + + /* Initialize the new file object. NOTE that the initial state is + * locked with one reference count. + */ + + tfo->tfo_atime = tmpfs_timestamp(); + tfo->tfo_mtime = tfo->tfo_atime; + tfo->tfo_ctime = tfo->tfo_atime; + tfo->tfo_type = TMPFS_REGULAR; + tfo->tfo_refs = 1; + tfo->tfo_flags = 0; + tfo->tfo_size = 0; + tfo->tfo_data = NULL; + + tfo->tfo_exclsem.ts_holder = getpid(); + tfo->tfo_exclsem.ts_count = 1; + if (sem_init(&tfo->tfo_exclsem.ts_sem, 0, 0) != 0) + { + PRINT_ERR("%s %d, sem_init failed!\n", __FUNCTION__, __LINE__); + kmm_free(tfo); + return NULL; + } + + return tfo; +} + +/**************************************************************************** + * Name: tmpfs_create_file + ****************************************************************************/ + +static int tmpfs_create_file(FAR struct tmpfs_s *fs, + FAR const char *relpath, + FAR struct tmpfs_file_s **tfo) +{ + FAR struct tmpfs_directory_s *parent; + FAR struct tmpfs_file_s *newtfo; + struct tmpfs_dirent_s *tde; + FAR char *copy; + FAR char *name; + int ret; + + /* Duplicate the path variable so that we can modify it */ + + copy = strdup(relpath); + if (copy == NULL) + { + return -ENOSPC; + } + + /* Separate the path into the file name and the path to the parent + * directory. + */ + + name = strrchr(copy, '/'); + if (name == NULL) + { + /* No subdirectories... use the root directory */ + + name = copy; + parent = (FAR struct tmpfs_directory_s *)fs->tfs_root.tde_object; + + /* Lock the root directory to emulate the behavior of tmpfs_find_directory() */ + + tmpfs_lock_directory(parent); + parent->tdo_refs++; + } + else + { + /* Terminate the parent directory path */ + + *name++ = '\0'; + + /* Locate the parent directory that should contain this name. + * On success, tmpfs_find_directory() will lock the parent + * directory and increment the reference count. + */ + + ret = tmpfs_find_directory(fs, copy, &parent, NULL); + if (ret < 0) + { + goto errout_with_copy; + } + } + + /* Verify that no object of this name already exists in the directory */ + + tde = tmpfs_find_dirent(parent, name); + if (tde != NULL) + { + /* Something with this name already exists in the directory. + * OR perhaps some fatal error occurred. + */ + + ret = -EEXIST; + goto errout_with_parent; + } + + /* Allocate an empty file. The initial state of the file is locked with one + * reference count. + */ + + newtfo = tmpfs_alloc_file(); + if (newtfo == NULL) + { + ret = -ENOSPC; + goto errout_with_parent; + } + + /* Then add the new, empty file to the directory */ + + ret = tmpfs_add_dirent(&parent, (FAR struct tmpfs_object_s *)newtfo, name); + if (ret < 0) + { + goto errout_with_file; + } + + /* Release the reference and lock on the parent directory */ + + parent->tdo_refs--; + tmpfs_unlock_directory(parent); + + /* Free the copy of the relpath and return success */ + + kmm_free(copy); + *tfo = newtfo; + return OK; + + /* Error exits */ + +errout_with_file: + sem_destroy(&newtfo->tfo_exclsem.ts_sem); + kmm_free(newtfo); + +errout_with_parent: + parent->tdo_refs--; + tmpfs_unlock_directory(parent); + +errout_with_copy: + kmm_free(copy); + return ret; +} + +/**************************************************************************** + * Name: tmpfs_alloc_directory + ****************************************************************************/ + +static FAR struct tmpfs_directory_s *tmpfs_alloc_directory(void) +{ + FAR struct tmpfs_directory_s *tdo; + size_t allocsize; + + allocsize = sizeof(struct tmpfs_directory_s); + tdo = (FAR struct tmpfs_directory_s *)kmm_malloc(allocsize); + if (tdo == NULL) + { + return NULL; + } + + /* Initialize the new directory object */ + + tdo->tdo_atime = tmpfs_timestamp(); + tdo->tdo_mtime = tdo->tdo_mtime; + tdo->tdo_ctime = tdo->tdo_mtime; + tdo->tdo_type = TMPFS_DIRECTORY; + tdo->tdo_refs = 0; + tdo->tdo_nentries = 0; + tdo->tdo_count = 0; + LOS_ListInit(&tdo->tdo_entry); + + tdo->tdo_exclsem.ts_holder = TMPFS_NO_HOLDER; + tdo->tdo_exclsem.ts_count = 0; + if (sem_init(&tdo->tdo_exclsem.ts_sem, 0, 1) != 0) + { + PRINT_ERR("%s %d, sem_init failed!\n", __FUNCTION__, __LINE__); + kmm_free(tdo); + return NULL; + } + return tdo; +} + +/**************************************************************************** + * Name: tmpfs_create_directory + ****************************************************************************/ + +static int tmpfs_create_directory(FAR struct tmpfs_s *fs, + FAR const char *relpath, + FAR struct tmpfs_directory_s **tdo) +{ + FAR struct tmpfs_directory_s *parent; + FAR struct tmpfs_directory_s *newtdo; + struct tmpfs_dirent_s *tde; + FAR char *copy; + FAR char *name; + int ret; + + /* Duplicate the path variable so that we can modify it */ + + copy = strdup(relpath); + if (copy == NULL) + { + return -ENOSPC; + } + + /* Separate the path into the file name and the path to the parent + * directory. + */ + + name = strrchr(copy, '/'); + if (name == NULL) + { + /* No subdirectories... use the root directory */ + + name = copy; + parent = (FAR struct tmpfs_directory_s *)fs->tfs_root.tde_object; + + tmpfs_lock_directory(parent); + parent->tdo_refs++; + } + else + { + /* Terminate the parent directory path */ + + *name++ = '\0'; + + /* Locate the parent directory that should contain this name. + * On success, tmpfs_find_directory() will lockthe parent + * directory and increment the reference count. + */ + + ret = tmpfs_find_directory(fs, copy, &parent, NULL); + if (ret < 0) + { + goto errout_with_copy; + } + } + + /* Verify that no object of this name already exists in the directory */ + + tde = tmpfs_find_dirent(parent, name); + if (tde != NULL) + { + /* Something with this name already exists in the directory. + * OR perhaps some fatal error occurred. + */ + + ret = -EEXIST; + + goto errout_with_parent; + } + + /* Allocate an empty directory object. NOTE that there is no reference on + * the new directory and the object is not locked. + */ + + newtdo = tmpfs_alloc_directory(); + if (newtdo == NULL) + { + ret = -ENOSPC; + goto errout_with_parent; + } + + /* Then add the new, empty file to the directory */ + + ret = tmpfs_add_dirent(&parent, (FAR struct tmpfs_object_s *)newtdo, name); + if (ret < 0) + { + goto errout_with_directory; + } + + /* Free the copy of the relpath, release our reference to the parent directory, + * and return success + */ + + parent->tdo_refs--; + tmpfs_unlock_directory(parent); + kmm_free(copy); + + /* Return the (unlocked, unreferenced) directory object to the caller */ + + if (tdo != NULL) + { + *tdo = newtdo; + } + + return OK; + + /* Error exits */ + +errout_with_directory: + sem_destroy(&newtdo->tdo_exclsem.ts_sem); + kmm_free(newtdo); + +errout_with_parent: + parent->tdo_refs--; + tmpfs_unlock_directory(parent); + +errout_with_copy: + kmm_free(copy); + return ret; +} + +/**************************************************************************** + * Name: tmpfs_find_object + ****************************************************************************/ + +static int tmpfs_find_object(FAR struct tmpfs_s *fs, + FAR const char *relpath, + FAR struct tmpfs_object_s **object, + FAR struct tmpfs_directory_s **parent) +{ + FAR struct tmpfs_object_s *to = NULL; + FAR struct tmpfs_dirent_s *tde; + FAR struct tmpfs_directory_s *tdo = NULL; + FAR struct tmpfs_directory_s *next_tdo; + FAR char *segment; + FAR char *next_segment; + FAR char *tkptr; + FAR char *copy; + + /* Make a copy of the path (so that we can modify it via strtok) */ + + copy = strdup(relpath); + if (copy == NULL) + { + return -ENOSPC; + } + + /* Traverse the file system for any object with the matching name */ + + to = fs->tfs_root.tde_object; + next_tdo = (FAR struct tmpfs_directory_s *)fs->tfs_root.tde_object; + tdo = next_tdo; + for (segment = strtok_r(copy, "/", &tkptr); + segment != NULL; + segment = next_segment) + { + /* Get the next segment after the one we are currently working on. + * This will be NULL is we are working on the final segment of the + * relpath. + */ + + next_segment = strtok_r(NULL, "/", &tkptr); + + /* Search the next directory. */ + + tdo = next_tdo; + + /* Find the TMPFS object with the next segment name in the current + * directory. + */ + + tde = tmpfs_find_dirent(tdo, segment); + if (tde == NULL) + { + /* No object with this name exists in the directory. */ + + kmm_free(copy); + return -ENOENT; + } + + to = tde->tde_object; + + /* Is this object another directory? */ + + if (to->to_type != TMPFS_DIRECTORY) + { + /* No. Was this the final segment in the path? */ + + if (next_segment == NULL) + { + /* Then we can break out of the loop now */ + + break; + } + + /* No, this was not the final segement of the relpath. + * We cannot continue the search if any of the intermediate + * segments do no correspond to directories. + */ + + kmm_free(copy); + return -ENOTDIR; + } + + /* Search this directory for the next segement. If we + * exit the loop, tdo will still refer to the parent + * directory of to. + */ + + next_tdo = (FAR struct tmpfs_directory_s *)to; + } + + /* When we exit this loop (successfully), to will point to the TMPFS + * object associated with the terminal segment of the relpath. + * Increment the reference count on the located object. + */ + + /* Free the dup'ed string */ + + kmm_free(copy); + + /* Return what we found */ + + if (parent) + { + if (tdo != NULL) + { + /* Get exclusive access to the parent and increment the reference + * count on the object. + */ + + tmpfs_lock_directory(tdo); + tdo->tdo_refs++; + } + + *parent = tdo; + } + + if (object) + { + if (to != NULL) + { + /* Get exclusive access to the object and increment the reference + * count on the object. + */ + + tmpfs_lock_object(to); + to->to_refs++; + } + + *object = to; + } + + return OK; +} + +/**************************************************************************** + * Name: tmpfs_find_file + ****************************************************************************/ + +static int tmpfs_find_file(FAR struct tmpfs_s *fs, + FAR const char *relpath, + FAR struct tmpfs_file_s **tfo, + FAR struct tmpfs_directory_s **parent) +{ + FAR struct tmpfs_object_s *to; + int ret; + + /* Find the object at this path. If successful, tmpfs_find_object() will + * lock both the object and the parent directory and will increment the + * reference count on both. + */ + + ret = tmpfs_find_object(fs, relpath, &to, parent); + if (ret >= 0) + { + /* We found it... but is it a regular file? */ + + if (to->to_type != TMPFS_REGULAR) + { + /* No... unlock the object and its parent and return an error */ + + tmpfs_release_lockedobject(to); + + if (parent) + { + FAR struct tmpfs_directory_s *tdo = *parent; + + tdo->tdo_refs--; + tmpfs_unlock_directory(tdo); + } + + ret = -EISDIR; + } + + /* Return the verified file object */ + + *tfo = (FAR struct tmpfs_file_s *)to; + } + + return ret; +} + +/**************************************************************************** + * Name: tmpfs_find_directory + ****************************************************************************/ + +static int tmpfs_find_directory(FAR struct tmpfs_s *fs, + FAR const char *relpath, + FAR struct tmpfs_directory_s **tdo, + FAR struct tmpfs_directory_s **parent) +{ + FAR struct tmpfs_object_s *to; + int ret; + + /* Find the object at this path */ + + ret = tmpfs_find_object(fs, relpath, &to, parent); + if (ret >= 0) + { + /* We found it... but is it a regular file? */ + + if (to->to_type != TMPFS_DIRECTORY) + { + /* No... unlock the object and its parent and return an error */ + + tmpfs_release_lockedobject(to); + + if (parent) + { + FAR struct tmpfs_directory_s *tmptdo = *parent; + + tmptdo->tdo_refs--; + tmpfs_unlock_directory(tmptdo); + } + + ret = -ENOTDIR; + } + + /* Return the verified file object */ + + *tdo = (FAR struct tmpfs_directory_s *)to; + } + + return ret; +} + +/**************************************************************************** + * Name: tmpfs_open + ****************************************************************************/ + +static int tmpfs_open(FAR struct file *filep, FAR const char *relpath, + int oflags, mode_t mode) +{ + FAR struct inode *inode; + FAR struct tmpfs_s *fs; + FAR struct tmpfs_file_s *tfo; + off_t offset; + int ret; + + finfo("filep: %p\n", filep); + DEBUGASSERT(filep->f_priv == NULL && filep->f_inode != NULL); + + if (oflags & O_DIRECTORY) + { + return -EINVAL; + } + + /* Get the mountpoint inode reference from the file structure and the + * mountpoint private data from the inode structure + */ + + inode = filep->f_inode; + fs = inode->i_private; + + DEBUGASSERT(fs != NULL && fs->tfs_root.tde_object != NULL); + + /* Get exclusive access to the file system */ + + tmpfs_lock(fs); + + /* Skip over any leading directory separators (shouldn't be any) */ + + for (; *relpath == '/'; relpath++); + + /* Find the file object associated with this relative path. + * If successful, this action will lock both the parent directory and + * the file object, adding one to the reference count of both. + * In the event that -ENOENT, there will still be a reference and + * lock on the returned directory. + */ + + ret = tmpfs_find_file(fs, relpath, &tfo, NULL); + if (ret >= 0) + { + /* The file exists. We hold the lock and one reference count + * on the file object. + * + * It would be an error if we are asked to create it exclusively + */ + + if ((oflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) + { + /* Already exists -- can't create it exclusively */ + + ret = -EEXIST; + goto errout_with_filelock; + } + + /* Check if the caller has sufficient privileges to open the file. + * REVISIT: No file protection implemented + */ + + /* If O_TRUNC is specified and the file is opened for writing, + * then truncate the file. This operation requires that the file is + * writeable, but we have already checked that. O_TRUNC without write + * access is ignored. + */ + + if (oflags & O_TRUNC) + { + /* Truncate the file to zero length (if it is not already + * zero length) + */ + + if (tfo->tfo_size > 0 && tfo->tfo_data != NULL) + { + kmm_free(tfo->tfo_data); + tfo->tfo_size = 0; + tfo->tfo_data = (char *)NULL; + } + + /* Update file times */ + + tfo->tfo_mtime = tfo->tfo_ctime = tmpfs_timestamp(); + } + } + + /* ENOENT would be returned by tmpfs_find_file() if the full directory + * path was found, but the file was not found in the final directory. + */ + + else if (ret == -ENOENT) + { + /* The file does not exist. Were we asked to create it? */ + + if ((oflags & O_CREAT) == 0) + { + /* No.. then we fail with -ENOENT */ + + ret = -ENOENT; + goto errout_with_fslock; + } + + /* Yes.. create the file object. There will be a reference and a lock + * on the new file object. + */ + + ret = tmpfs_create_file(fs, relpath, &tfo); + if (ret < 0) + { + goto errout_with_fslock; + } + } + + /* Some other error occurred */ + + else + { + goto errout_with_fslock; + } + + /* Save the struct tmpfs_file_s instance as the file private data */ + + filep->f_priv = tfo; + + /* In write/append mode, we need to set the file pointer to the end of the + * file. + */ + + offset = 0; + if (oflags & O_APPEND) + { + offset = tfo->tfo_size; + } + + filep->f_pos = offset; + + /* Unlock the file file object, but retain the reference count */ + + tmpfs_unlock_file(tfo); + tmpfs_unlock(fs); + return OK; + + /* Error exits */ + +errout_with_filelock: + tmpfs_release_lockedfile(tfo); + +errout_with_fslock: + tmpfs_unlock(fs); + return ret; +} + +/**************************************************************************** + * Name: tmpfs_close + ****************************************************************************/ + +static int tmpfs_close(FAR struct file *filep) +{ + FAR struct tmpfs_file_s *tfo; + + finfo("filep: %p\n", filep); + DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL); + + /* Recover our private data from the struct file instance */ + + tfo = filep->f_priv; + + /* Get exclusive access to the file */ + + tmpfs_lock_file(tfo); + + /* Decrement the reference count on the file */ + + if (tfo->tfo_refs > 0) + { + tfo->tfo_refs--; + } + else + { + return -EPERM; + } + + filep->f_priv = NULL; + + /* If the reference count decremented to zero and the file has been + * unlinked, then free the file allocation now. + */ + + if (tfo->tfo_refs == 0 && (tfo->tfo_flags & TFO_FLAG_UNLINKED) != 0) + { + /* Free the file object while we hold the lock? Weird but this + * should be safe because the object is unlinked and could not + * have any other references. + */ + + (void)sem_destroy(&tfo->tfo_exclsem.ts_sem); + kmm_free(tfo->tfo_data); + kmm_free(tfo); + return OK; + } + + /* Release the lock on the file */ + + tmpfs_unlock_file(tfo); + return OK; +} + +/**************************************************************************** + * Name: tmpfs_read + ****************************************************************************/ + +static ssize_t tmpfs_read(FAR struct file *filep, FAR char *buffer, + size_t buflen) +{ + FAR struct tmpfs_file_s *tfo; + ssize_t nread; + loff_t startpos; + loff_t endpos; + + finfo("filep: %p buffer: %p buflen: %lu\n", + filep, buffer, (unsigned long)buflen); + DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL); + + /* Recover our private data from the struct file instance */ + + tfo = filep->f_priv; + if (filep->f_pos >= tfo->tfo_size || buflen == 0) + { + return 0; + } + + /* Get exclusive access to the file */ + + tmpfs_lock_file(tfo); + + /* Handle attempts to read beyond the end of the file. */ + + startpos = filep->f_pos; + nread = buflen; + endpos = startpos + buflen; + + if (endpos > tfo->tfo_size) + { + endpos = tfo->tfo_size; + nread = endpos - startpos; + } + + /* Copy data from the memory object to the user buffer */ + + if (LOS_CopyFromKernel(buffer, buflen, &tfo->tfo_data[startpos], nread) != 0) + { + tmpfs_unlock_file(tfo); + return -EINVAL; + } + filep->f_pos += nread; + + /* Update the node's access time */ + + tfo->tfo_atime = tmpfs_timestamp(); + + /* Release the lock on the file */ + + tmpfs_unlock_file(tfo); + return nread; +} + +/**************************************************************************** + * Name: los_set_ramfs_unit + ****************************************************************************/ + +static spinlock_t tmpfs_alloc_unit_lock; +bool is_tmpfs_lock_init = false; +unsigned int g_tmpfs_alloc_unit = 0; + +void los_set_ramfs_unit(off_t size) +{ + if (is_tmpfs_lock_init && size >= 0) + { + spin_lock(&tmpfs_alloc_unit_lock); + g_tmpfs_alloc_unit = size; + spin_unlock(&tmpfs_alloc_unit_lock); + } +} + +/**************************************************************************** + * Name: tmpfs_write + ****************************************************************************/ + +static ssize_t tmpfs_write(FAR struct file *filep, FAR const char *buffer, + size_t buflen) +{ + FAR struct tmpfs_file_s *tfo; + ssize_t nwritten; + loff_t startpos; + loff_t endpos; + int ret; + int alloc; + char *data; + + finfo("filep: %p buffer: %p buflen: %lu\n", + filep, buffer, (unsigned long)buflen); + DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL); + + if (buflen == 0) + { + return 0; + } + + /* Recover our private data from the struct file instance */ + + tfo = filep->f_priv; + + /* Get exclusive access to the file */ + + tmpfs_lock_file(tfo); + + /* Handle attempts to write beyond the end of the file */ + + startpos = filep->f_pos; + nwritten = buflen; + endpos = startpos + buflen; + + if (startpos < 0) + { + ret = -EPERM; + goto errout_with_lock; + } + + if (endpos > tfo->tfo_size) + { + spin_lock(&tmpfs_alloc_unit_lock); + alloc = (g_tmpfs_alloc_unit > buflen) ? g_tmpfs_alloc_unit : buflen; + spin_unlock(&tmpfs_alloc_unit_lock); + data = (char *)malloc(startpos + alloc); + if (!data) + { + ret = -ENOSPC; + goto errout_with_lock; + } + (void)memset_s(data, startpos + alloc, 0, startpos + alloc); + if (tfo->tfo_data) + { + ret = memcpy_s(data, startpos + alloc, tfo->tfo_data, tfo->tfo_size); + if (ret != EOK) + { + ret = -1; + free(data); + goto errout_with_lock; + } + free(tfo->tfo_data); + } + + tfo->tfo_data = data; + tfo->tfo_size = startpos + alloc; + } + + /* Copy data from the memory object to the user buffer */ + if (LOS_CopyToKernel(&tfo->tfo_data[startpos], nwritten, buffer, nwritten) != 0) + { + ret = -EINVAL; + goto errout_with_lock; + } + filep->f_pos += nwritten; + + /* Update the modified and access times of the node */ + + tfo->tfo_ctime = tfo->tfo_mtime = tmpfs_timestamp(); + + /* Release the lock on the file */ + + tmpfs_unlock_file(tfo); + return nwritten; + +errout_with_lock: + tmpfs_unlock_file(tfo); + return (ssize_t)ret; +} + +/**************************************************************************** + * Name: tmpfs_seek + ****************************************************************************/ + +static off_t tmpfs_seek(FAR struct file *filep, off_t offset, int whence) +{ + FAR struct tmpfs_file_s *tfo; + off_t position; + + finfo("filep: %p\n", filep); + DEBUGASSERT(filep->f_priv != NULL && filep->f_inode != NULL); + + /* Recover our private data from the struct file instance */ + + tfo = filep->f_priv; + + /* Map the offset according to the whence option */ + + switch (whence) + { + case SEEK_SET: /* The offset is set to offset bytes. */ + position = offset; + break; + + case SEEK_CUR: /* The offset is set to its current location plus + * offset bytes. */ + position = offset + filep->f_pos; + break; + + case SEEK_END: /* The offset is set to the size of the file plus + * offset bytes. */ + position = offset + tfo->tfo_size; + break; + + default: + return -EINVAL; + } + + /* Attempts to set the position beyond the end of file will + * work if the file is open for write access. + * + * REVISIT: This simple implementation has no per-open storage that + * would be needed to retain the open flags. + */ + +#if 0 + if (position > tfo->tfo_size && (tfo->tfo_oflags & O_WROK) == 0) + { + /* Otherwise, the position is limited to the file size */ + + position = tfo->tfo_size; + } +#endif + + if (position < 0) + { + return -EINVAL; + } + + /* Save the new file position */ + + filep->f_pos = position; + return position; +} + +/**************************************************************************** + * Name: tmpfs_seek64 + ****************************************************************************/ + +static loff_t tmpfs_seek64(FAR struct file *filep, loff_t offset, int whence) +{ + return (loff_t)tmpfs_seek(filep, (off_t)offset, whence); +} + +/**************************************************************************** + * Name: tmpfs_ioctl + ****************************************************************************/ + +static int tmpfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) +{ + return -EINVAL; +} + + +/**************************************************************************** + * Name: tmpfs_dup + ****************************************************************************/ + +static int tmpfs_dup(FAR const struct file *oldp, FAR struct file *newp) +{ + return -1; +} + + +/**************************************************************************** + * Name: tmpfs_opendir + ****************************************************************************/ + +static int tmpfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, + FAR struct fs_dirent_s *dir) +{ + FAR struct tmpfs_s *fs; + FAR struct tmpfs_directory_s *tdo; + int ret; + FAR struct fs_tmpfsdir_s *tmp; + + finfo("mountpt: %p relpath: %s dir: %p\n", + mountpt, relpath, dir); + DEBUGASSERT(mountpt != NULL && relpath != NULL && dir != NULL); + + /* Get the mountpoint private data from the inode structure */ + + fs = mountpt->i_private; + DEBUGASSERT(fs != NULL && fs->tfs_root.tde_object != NULL); + + tmp = (FAR struct fs_tmpfsdir_s *)malloc(sizeof(struct fs_tmpfsdir_s)); + if (!tmp) + { + return -ENOSPC; + } + + /* Get exclusive access to the file system */ + + tmpfs_lock(fs); + + /* Skip over any leading directory separators (shouldn't be any) */ + + for (; *relpath == '/'; relpath++); + + /* Find the directory object associated with this relative path. + * If successful, this action will lock both the parent directory and + * the file object, adding one to the reference count of both. + * In the event that -ENOENT, there will still be a reference and + * lock on the returned directory. + */ + + ret = tmpfs_find_directory(fs, relpath, &tdo, NULL); + if (ret >= 0) + { + tmp->tf_tdo = tdo; + tmp->tf_index = 0; + dir->u.fs_dir = (fs_dir_s)tmp; + tdo->tdo_count++; + tmpfs_unlock_directory(tdo); + } + else + { + free(tmp); + } + + /* Release the lock on the file system and return the result */ + + tmpfs_unlock(fs); + return ret; +} + +/**************************************************************************** + * Name: tmpfs_closedir + ****************************************************************************/ + +static int tmpfs_closedir(FAR struct inode *mountpt, + FAR struct fs_dirent_s *dir) +{ + FAR struct tmpfs_directory_s *tdo; + struct fs_tmpfsdir_s *tmp; + + finfo("mountpt: %p dir: %p\n", mountpt, dir); + DEBUGASSERT(mountpt != NULL && dir != NULL); + + /* Get the directory structure from the dir argument */ + + tmp = (FAR struct fs_tmpfsdir_s *)dir->u.fs_dir; + tdo = tmp->tf_tdo; + DEBUGASSERT(tdo != NULL); + + /* Decrement the reference count on the directory object */ + + tmpfs_lock_directory(tdo); + if (tdo->tdo_count == 1) + { + LOS_DL_LIST *node = tdo->tdo_entry.pstNext; + FAR struct tmpfs_dirent_s *tde; + while (node != &tdo->tdo_entry) + { + tde = (FAR struct tmpfs_dirent_s *)node; + node = node->pstNext; + if (tde->tde_inuse == false) + { + LOS_ListDelete(&tde->tde_node); + kmm_free(tde); + } + } + } + tdo->tdo_refs--; + tdo->tdo_count--; + tmpfs_unlock_directory(tdo); + + free(tmp); + + return OK; +} + +/**************************************************************************** + * Name: tmpfs_readdir + ****************************************************************************/ + +static int tmpfs_readdir(FAR struct inode *mountpt, + FAR struct fs_dirent_s *dir) +{ + FAR struct tmpfs_directory_s *tdo; + unsigned int index; + int ret; + struct fs_tmpfsdir_s *tmp; + LOS_DL_LIST *node; + FAR struct tmpfs_dirent_s *tde; + + finfo("mountpt: %p dir: %p\n", mountpt, dir); + DEBUGASSERT(mountpt != NULL && dir != NULL); + + /* Get the directory structure from the dir argument and lock it */ + + tmp = (FAR struct fs_tmpfsdir_s *)dir->u.fs_dir; + tdo = tmp->tf_tdo; + DEBUGASSERT(tdo != NULL); + + tmpfs_lock_directory(tdo); + + /* Have we reached the end of the directory? */ + + index = tmp->tf_index; + node = tdo->tdo_entry.pstNext; + while (node != &tdo->tdo_entry && index != 0) + { + node = node->pstNext; + index--; + } + + while (node != &tdo->tdo_entry) + { + tde = (FAR struct tmpfs_dirent_s *)node; + tmp->tf_index++; + if (tde->tde_inuse == true) + { + break; + } + node = node->pstNext; + } + + if (node == &tdo->tdo_entry) + { + /* We signal the end of the directory by returning the special error: + * -ENOENT + */ + + finfo("End of directory\n"); + ret = -ENOENT; + } + else + { + FAR struct tmpfs_object_s *to; + + /* Does this entry refer to a file or a directory object? */ + + to = tde->tde_object; + DEBUGASSERT(to != NULL); + + if (to->to_type == TMPFS_DIRECTORY) + { + /* A directory */ + + dir->fd_dir.d_type = DT_DIR; + } + else /* to->to_type == TMPFS_REGULAR) */ + { + /* A regular file */ + + dir->fd_dir.d_type = DT_REG; + } + + /* Copy the entry name */ + + (void)strncpy_s(dir->fd_dir.d_name, NAME_MAX + 1, tde->tde_name, NAME_MAX); + + /* Increment the index for next time */ + + dir->fd_dir.d_off = dir->fd_position; + dir->fd_dir.d_reclen = (uint16_t)sizeof(struct dirent); + + ret = OK; + } + + tmpfs_unlock_directory(tdo); + return ret; +} + +/**************************************************************************** + * Name: tmpfs_rewinddir + ****************************************************************************/ + +static int tmpfs_rewinddir(FAR struct inode *mountpt, + FAR struct fs_dirent_s *dir) +{ + struct fs_tmpfsdir_s *tmp; + fvdbg("mountpt: %p dir: %p\n", mountpt, dir); + DEBUGASSERT(mountpt != NULL && dir != NULL); + tmp = (struct fs_tmpfsdir_s *)dir->u.fs_dir; + + /* Set the readdir index to zero */ + + tmp->tf_index = 0; + return OK; +} + +/**************************************************************************** + * Name: tmpfs_bind + ****************************************************************************/ + +static int tmpfs_bind(FAR struct inode *blkdriver, FAR const void *data, + FAR void **handle, FAR const char *relpath) +{ + FAR struct tmpfs_directory_s *tdo; + FAR struct tmpfs_s *fs = &tmpfs_superblock; + + finfo("blkdriver: %p data: %p handle: %p\n", blkdriver, data, handle); + DEBUGASSERT(blkdriver == NULL && handle != NULL); + + if (fs->tfs_root.tde_object != NULL) + { + return -EPERM; + } + + /* Create a root file system. This is like a single directory entry in + * the file system structure. + */ + + tdo = tmpfs_alloc_directory(); + if (tdo == NULL) + { + return -ENOSPC; + } + + LOS_ListInit(&fs->tfs_root.tde_node); + fs->tfs_root.tde_object = (FAR struct tmpfs_object_s *)tdo; + fs->tfs_root.tde_name = NULL; + + /* Set up the backward link (to support reallocation) */ + + tdo->tdo_dirent = &fs->tfs_root; + + /* Initialize the file system state */ + + fs->tfs_exclsem.ts_holder = TMPFS_NO_HOLDER; + fs->tfs_exclsem.ts_count = 0; + sem_init(&fs->tfs_exclsem.ts_sem, 0, 1); + + /* Return the new file system handle */ + + *handle = (FAR void *)fs; + spin_lock_init(&tmpfs_alloc_unit_lock); + is_tmpfs_lock_init = true; + return OK; +} + +/**************************************************************************** + * Name: tmpfs_unbind + ****************************************************************************/ + +static int tmpfs_unbind(FAR void *handle, FAR struct inode **blkdriver) +{ + FAR struct tmpfs_s *fs = (FAR struct tmpfs_s *)handle; + FAR struct tmpfs_directory_s *tdo; + int ret = 0; + + finfo("handle: %p blkdriver: %p \n", handle, blkdriver); + DEBUGASSERT(fs != NULL && fs->tfs_root.tde_object != NULL); + + /* Lock the file system */ + + tmpfs_lock(fs); + + tdo = (FAR struct tmpfs_directory_s *)fs->tfs_root.tde_object; + + if (tdo->tdo_nentries > 0 || tdo->tdo_refs > 1) + { + ret = -EBUSY; + goto errout_with_objects; + } + + /* Now we can destroy the root file system and the file system itself. */ + + sem_destroy(&tdo->tdo_exclsem.ts_sem); + kmm_free(tdo); + + sem_destroy(&fs->tfs_exclsem.ts_sem); + fs->tfs_root.tde_object = NULL; + + tmpfs_unlock(fs); + is_tmpfs_lock_init = false; + return ret; + +errout_with_objects: + tmpfs_unlock(fs); + return ret; +} + +/**************************************************************************** + * Name: tmpfs_statfs + ****************************************************************************/ + +static int tmpfs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf) +{ + (void)memset_s(buf, sizeof(struct statfs), 0, sizeof(struct statfs)); + + buf->f_type = TMPFS_MAGIC; + + return OK; +} + +/**************************************************************************** + * Name: tmpfs_unlink + ****************************************************************************/ + +static int tmpfs_unlink(FAR struct inode *mountpt, FAR const char *relpath) +{ + FAR struct tmpfs_s *fs; + FAR struct tmpfs_directory_s *tdo; + FAR struct tmpfs_file_s *tfo = NULL; + FAR const char *name; + int ret; + + finfo("mountpt: %p relpath: %s\n", mountpt, relpath); + DEBUGASSERT(mountpt != NULL && relpath != NULL); + + if (strlen(relpath) == 0) + { + return -EISDIR; + } + + /* Get the file system structure from the inode reference. */ + + fs = mountpt->i_private; + DEBUGASSERT(fs != NULL && fs->tfs_root.tde_object != NULL); + + /* Get exclusive access to the file system */ + + tmpfs_lock(fs); + + /* Find the file object and parent directory associated with this relative + * path. If successful, tmpfs_find_file will lock both the file object + * and the parent directory and take one reference count on each. + */ + + ret = tmpfs_find_file(fs, relpath, &tfo, &tdo); + if (ret < 0) + { + goto errout_with_lock; + } + + DEBUGASSERT(tfo != NULL); + + /* Get the file name from the relative path */ + + name = strrchr(relpath, '/'); + if (name != NULL) + { + /* Skip over the file '/' character */ + + name++; + } + else + { + /* The name must lie in the root directory */ + + name = relpath; + } + + /* Remove the file from parent directory */ + + ret = tmpfs_remove_dirent(tdo, (struct tmpfs_object_s *)tfo); + if (ret < 0) + { + goto errout_with_objects; + } + + /* If the reference count is not one, then just mark the file as + * unlinked + */ + + if (tfo->tfo_refs > 1) + { + /* Make the file object as unlinked */ + + tfo->tfo_flags |= TFO_FLAG_UNLINKED; + + /* Release the reference count on the file object */ + + tfo->tfo_refs--; + tmpfs_unlock_file(tfo); + } + + /* Otherwise we can free the object now */ + + else + { + sem_destroy(&tfo->tfo_exclsem.ts_sem); + kmm_free(tfo->tfo_data); + kmm_free(tfo); + } + + /* Release the reference and lock on the parent directory */ + + tdo->tdo_refs--; + tmpfs_unlock_directory(tdo); + tmpfs_unlock(fs); + + return OK; + +errout_with_objects: + tmpfs_release_lockedfile(tfo); + + tdo->tdo_refs--; + tmpfs_unlock_directory(tdo); + +errout_with_lock: + tmpfs_unlock(fs); + return ret; +} + +/**************************************************************************** + * Name: tmpfs_mkdir + ****************************************************************************/ + +static int tmpfs_mkdir(FAR struct inode *mountpt, FAR const char *relpath, + mode_t mode) +{ + FAR struct tmpfs_s *fs; + int ret; + + finfo("mountpt: %p relpath: %s mode: %04x\n", mountpt, relpath, mode); + DEBUGASSERT(mountpt != NULL && relpath != NULL); + + if (strlen(relpath) == 0) + { + return -EEXIST; + } + + /* Get the file system structure from the inode reference. */ + + fs = mountpt->i_private; + DEBUGASSERT(fs != NULL && fs->tfs_root.tde_object != NULL); + + /* Get exclusive access to the file system */ + + tmpfs_lock(fs); + + /* Create the directory. */ + + ret = tmpfs_create_directory(fs, relpath, NULL); + tmpfs_unlock(fs); + return ret; +} + +/**************************************************************************** + * Name: tmpfs_rmdir + ****************************************************************************/ + +static int tmpfs_rmdir(FAR struct inode *mountpt, FAR const char *relpath) +{ + FAR struct tmpfs_s *fs; + FAR struct tmpfs_directory_s *parent; + FAR struct tmpfs_directory_s *tdo; + FAR const char *name; + int ret; + + finfo("mountpt: %p relpath: %s\n", mountpt, relpath); + DEBUGASSERT(mountpt != NULL && relpath != NULL); + + if (strlen(relpath) == 0) + { + return -EINVAL; + } + + /* Get the file system structure from the inode reference. */ + + fs = mountpt->i_private; + DEBUGASSERT(fs != NULL && fs->tfs_root.tde_object != NULL); + + /* Get exclusive access to the file system */ + + tmpfs_lock(fs); + + /* Find the directory object and parent directory associated with this + * relative path. If successful, tmpfs_find_file will lock both the + * directory object and the parent directory and take one reference count + * on each. + */ + + ret = tmpfs_find_directory(fs, relpath, &tdo, &parent); + if (ret < 0) + { + goto errout_with_lock; + } + + /* Is the directory empty? We cannot remove directories that still + * contain references to file system objects. No can we remove the + * directory if there are outstanding references on it (other than + * our reference). + */ + + if (tdo->tdo_nentries > 0 || tdo->tdo_refs > 1) + { + ret = -EBUSY; + goto errout_with_objects; + } + + /* Get the directory name from the relative path */ + + name = strrchr(relpath, '/'); + if (name != NULL) + { + /* Skip over the fidirectoryle '/' character */ + + name++; + } + else + { + /* The name must lie in the root directory */ + + name = relpath; + } + + /* Remove the directory from parent directory */ + + ret = tmpfs_remove_dirent(parent, (struct tmpfs_object_s *)tdo); + if (ret < 0) + { + goto errout_with_objects; + } + + /* Free the directory object */ + + sem_destroy(&tdo->tdo_exclsem.ts_sem); + kmm_free(tdo); + + /* Release the reference and lock on the parent directory */ + + parent->tdo_refs--; + tmpfs_unlock_directory(parent); + tmpfs_unlock(fs); + + return OK; + +errout_with_objects: + tdo->tdo_refs--; + tmpfs_unlock_directory(tdo); + + parent->tdo_refs--; + tmpfs_unlock_directory(parent); + +errout_with_lock: + tmpfs_unlock(fs); + return ret; +} + +/**************************************************************************** + * Name: tmpfs_rename + ****************************************************************************/ + +static int tmpfs_rename(FAR struct inode *mountpt, FAR const char *oldrelpath, + FAR const char *newrelpath) +{ + FAR struct tmpfs_directory_s *oldparent; + FAR struct tmpfs_directory_s *newparent; + FAR struct tmpfs_object_s *old_to; + FAR struct tmpfs_dirent_s *tde; + FAR struct tmpfs_directory_s *tdo; + FAR struct tmpfs_file_s *tfo; + FAR struct tmpfs_s *fs; + FAR const char *oldname; + FAR char *newname; + FAR char *copy; + int ret; + unsigned int oldrelpath_len, newrelpath_len, cmp_namelen; + + finfo("mountpt: %p oldrelpath: %s newrelpath: %s\n", + mountpt, oldrelpath, newrelpath); + + oldrelpath_len = strlen(oldrelpath); + newrelpath_len = strlen(newrelpath); + + cmp_namelen = (oldrelpath_len <= newrelpath_len) ? oldrelpath_len : newrelpath_len; + if (!cmp_namelen || ((!strncmp(oldrelpath, newrelpath, cmp_namelen)) && + (oldrelpath[cmp_namelen] == '/' || + newrelpath[cmp_namelen] == '/'))) + { + return -EPERM; + } + + /* Get the file system structure from the inode reference. */ + + fs = mountpt->i_private; + DEBUGASSERT(fs != NULL && fs->tfs_root.tde_object != NULL); + + /* Duplicate the newpath variable so that we can modify it */ + + copy = strdup(newrelpath); + if (copy == NULL) + { + return -ENOSPC; + } + + /* Get exclusive access to the file system */ + + tmpfs_lock(fs); + + /* Separate the new path into the new file name and the path to the new + * parent directory. + */ + + newname = strrchr(copy, '/'); + if (newname == NULL) + { + /* No subdirectories... use the root directory */ + + newname = copy; + newparent = (FAR struct tmpfs_directory_s *)fs->tfs_root.tde_object; + + tmpfs_lock_directory(newparent); + newparent->tdo_refs++; + } + else + { + /* Terminate the parent directory path */ + + *newname++ = '\0'; + + /* Locate the parent directory that should contain this name. + * On success, tmpfs_find_directory() will lockthe parent + * directory and increment the reference count. + */ + + ret = tmpfs_find_directory(fs, copy, &newparent, NULL); + if (ret < 0) + { + goto errout_with_lock; + } + } + + /* Find the old object at oldpath. If successful, tmpfs_find_object() + * will lock both the object and the parent directory and will increment + * the reference count on both. + */ + + ret = tmpfs_find_object(fs, oldrelpath, &old_to, &oldparent); + if (ret < 0) + { + goto errout_with_newparent; + } + + tde = tmpfs_find_dirent(newparent, newname); + if (tde != NULL) + { + FAR struct tmpfs_object_s *new_to = tde->tde_object; + + /* Cannot rename a directory to a noempty directory */ + + if (tde->tde_object->to_type == TMPFS_DIRECTORY) + { + tdo = (struct tmpfs_directory_s *)new_to; + if (tdo->tdo_nentries != 0) + { + ret = -ENOTEMPTY; + goto errout_with_oldparent; + } + } + + /* Null rename, just return */ + + if (old_to == new_to) + { + ret = ENOERR; + goto errout_with_oldparent; + } + + /* Check that we are renaming like-for-like */ + + if (old_to->to_type == TMPFS_REGULAR && new_to->to_type == TMPFS_DIRECTORY) + { + ret = -EISDIR; + goto errout_with_oldparent; + } + + if (old_to->to_type == TMPFS_DIRECTORY && new_to->to_type == TMPFS_REGULAR) + { + ret = -ENOTDIR; + goto errout_with_oldparent; + } + + /* Now delete the destination directory entry */ + + ret = tmpfs_remove_dirent(newparent, new_to); + if (ret < 0) + { + goto errout_with_oldparent; + } + + if (new_to->to_type == TMPFS_DIRECTORY) + { + (void)sem_destroy(&new_to->to_exclsem.ts_sem); + kmm_free(new_to); + } + else + { + tfo = (struct tmpfs_file_s *)new_to; + if (new_to->to_refs > 0) + { + /* Make the file object as unlinked */ + + tfo->tfo_flags |= TFO_FLAG_UNLINKED; + } + + /* Otherwise we can free the object now */ + + else + { + (void)sem_destroy(&tfo->tfo_exclsem.ts_sem); + kmm_free(tfo->tfo_data); + kmm_free(tfo); + } + } + } + + /* Get the old file name from the relative path */ + + oldname = strrchr(oldrelpath, '/'); + if (oldname != NULL) + { + /* Skip over the file '/' character */ + + oldname++; + } + else + { + /* The name must lie in the root directory */ + + oldname = oldrelpath; + } + + /* Remove the entry from the parent directory */ + + ret = tmpfs_remove_dirent(oldparent, old_to); + if (ret < 0) + { + goto errout_with_oldparent; + } + + /* Add an entry to the new parent directory. */ + + ret = tmpfs_add_dirent(&newparent, old_to, newname); + +errout_with_oldparent: + oldparent->tdo_refs--; + tmpfs_unlock_directory(oldparent); + + tmpfs_release_lockedobject(old_to); + +errout_with_newparent: + newparent->tdo_refs--; + tmpfs_unlock_directory(newparent); + +errout_with_lock: + tmpfs_unlock(fs); + kmm_free(copy); + return ret; +} + +/**************************************************************************** + * Name: tmpfs_stat_common + ****************************************************************************/ + +static void tmpfs_stat_common(FAR struct tmpfs_object_s *to, + FAR struct stat *buf) +{ + size_t objsize; + + /* Is the tmpfs object a regular file? */ + + (VOID)memset_s(buf, sizeof(struct stat), 0, sizeof(struct stat)); + + if (to->to_type == TMPFS_REGULAR) + { + FAR struct tmpfs_file_s *tfo = + (FAR struct tmpfs_file_s *)to; + + /* -rwxrwxrwx */ + + buf->st_mode = S_IRWXO | S_IRWXG | S_IRWXU | S_IFREG; + buf->st_nlink = tfo->tfo_refs - 1; + + /* Get the size of the object */ + + objsize = tfo->tfo_size; + } + else /* if (to->to_type == TMPFS_DIRECTORY) */ + { + FAR struct tmpfs_directory_s *tdo = + (FAR struct tmpfs_directory_s *)to; + + /* drwxrwxrwx */ + + buf->st_mode = S_IRWXO | S_IRWXG | S_IRWXU | S_IFDIR; + buf->st_nlink = tdo->tdo_nentries + tdo->tdo_refs; + + /* Get the size of the object */ + + objsize = sizeof(struct tmpfs_directory_s); + } + + /* Fake the rest of the information */ + + buf->st_size = objsize; + buf->st_blksize = 0; + buf->st_blocks = 0; + buf->st_atime = to->to_atime; + buf->st_mtime = to->to_mtime; + buf->st_ctime = to->to_ctime; +} + +/**************************************************************************** + * Name: tmpfs_stat + ****************************************************************************/ + +static int tmpfs_stat(FAR struct inode *mountpt, FAR const char *relpath, + FAR struct stat *buf) +{ + FAR struct tmpfs_s *fs; + FAR struct tmpfs_object_s *to; + int ret; + + finfo("mountpt=%p relpath=%s buf=%p\n", mountpt, relpath, buf); + DEBUGASSERT(mountpt != NULL && relpath != NULL && buf != NULL); + + /* Get the file system structure from the inode reference. */ + + fs = mountpt->i_private; + DEBUGASSERT(fs != NULL && fs->tfs_root.tde_object != NULL); + + /* Get exclusive access to the file system */ + + tmpfs_lock(fs); + + /* Find the tmpfs object at the relpath. If successful, + * tmpfs_find_object() will lock the object and increment the + * reference count on the object. + */ + + ret = tmpfs_find_object(fs, relpath, &to, NULL); + if (ret < 0) + { + goto errout_with_fslock; + } + + /* We found it... Return information about the file object in the stat + * buffer. + */ + + DEBUGASSERT(to != NULL); + tmpfs_stat_common(to, buf); + + /* Unlock the object and return success */ + + tmpfs_release_lockedobject(to); + ret = OK; + +errout_with_fslock: + tmpfs_unlock(fs); + return ret; +} + +FSMAP_ENTRY(ramfs_fsmap, "ramfs", tmpfs_operations, FALSE, FALSE); + +#endif + diff --git a/fs/tmpfs/fs_tmpfs.h b/fs/tmpfs/fs_tmpfs.h new file mode 100755 index 0000000..823d4f3 --- /dev/null +++ b/fs/tmpfs/fs_tmpfs.h @@ -0,0 +1,214 @@ +/**************************************************************************** + * fs/tmpfs/fs_tmpfs.h + * + * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __FS_TMPFS_FS_TMPFS_H +#define __FS_TMPFS_FS_TMPFS_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include "fs/fs.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#ifdef LOSCFG_FS_RAMFS + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Indicates that there is no holder of the re-entrant semaphore */ + +#define TMPFS_NO_HOLDER -1 + +/* Bit definitions for file object flags */ + +#define TFO_FLAG_UNLINKED (1 << 0) /* Bit 0: File is unlinked */ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* TMPFS memory object types */ + +enum tmpfs_objtype_e +{ + TMPFS_DIRECTORY = 0, /* Directory */ + TMPFS_REGULAR /* Regular file */ +}; + +/* Values returned by tmpfs_foreach() */ + +enum tmpfs_foreach_e +{ + TMPFS_CONTINUE = 0, /* Continue enumeration */ + TMPFS_HALT, /* Stop enumeration */ + TMPFS_DELETED, /* Object and directory entry deleted */ + TMPFS_UNLINKED /* Only the directory entry was deleted */ +}; + +/* Re-entrant semaphore */ + +struct tmpfs_sem_s +{ + sem_t ts_sem; /* The actual semaphore */ + pid_t ts_holder; /* Current older (-1 if not held) */ + uint16_t ts_count; /* Number of counts held */ +}; + +/* The form of one directory entry */ + +struct tmpfs_dirent_s +{ + LOS_DL_LIST tde_node; + FAR struct tmpfs_object_s *tde_object; + FAR char *tde_name; + bool tde_inuse; +}; + +/* The generic form of a TMPFS memory object */ + +struct tmpfs_object_s +{ + FAR struct tmpfs_dirent_s *to_dirent; + struct tmpfs_sem_s to_exclsem; + + uint8_t to_type; /* See enum tmpfs_objtype_e */ + uint8_t to_refs; /* Reference count */ + time_t to_ctime; /* last changed status time */ + time_t to_mtime; /* last modified time */ + time_t to_atime; /* last access time */ +}; + +/* The form of a directory memory object */ + +struct tmpfs_directory_s +{ + /* First fields must match common TMPFS object layout */ + + FAR struct tmpfs_dirent_s *tdo_dirent; + struct tmpfs_sem_s tdo_exclsem; + + uint8_t tdo_type; /* See enum tmpfs_objtype_e */ + uint8_t tdo_refs; /* Reference count */ + time_t tdo_ctime; /* last changed status time */ + time_t tdo_mtime; /* last modified time */ + time_t tdo_atime; /* last access time */ + + /* Remaining fields are unique to a directory object */ + + uint8_t tdo_count; /* Number of times the directory was opened */ + uint16_t tdo_nentries; /* Number of directory entries */ + LOS_DL_LIST tdo_entry; +}; + +#define SIZEOF_TMPFS_DIRECTORY(n) \ + (sizeof(struct tmpfs_directory_s) + ((n) - 1) * sizeof(struct tmpfs_dirent_s)) + +/* The form of a regular file memory object + * + * NOTE that in this very simplified implementation, there is no per-open + * state. The file memory object also serves as the open file object, + * saving an allocation. This has the negative side effect that no per- + * open state can be retained (such as open flags). + */ + +struct tmpfs_file_s +{ + /* First fields must match common TMPFS object layout */ + + FAR struct tmpfs_dirent_s *tfo_dirent; + struct tmpfs_sem_s tfo_exclsem; + + uint8_t tfo_type; /* See enum tmpfs_objtype_e */ + uint8_t tfo_refs; /* Reference count */ + time_t tfo_ctime; /* last changed status time */ + time_t tfo_mtime; /* last modified time */ + time_t tfo_atime; /* last access time */ + + /* Remaining fields are unique to a directory object */ + + uint8_t tfo_flags; /* See TFO_FLAG_* definitions */ + size_t tfo_size; /* Valid file size */ + char *tfo_data; /* File data pointer */ +}; + +#define SIZEOF_TMPFS_FILE(n) (sizeof(struct tmpfs_file_s) + (n) - 1) + +/* This structure represents one instance of a TMPFS file system */ + +struct tmpfs_s +{ + /* The root directory */ + + FAR struct tmpfs_dirent_s tfs_root; + struct tmpfs_sem_s tfs_exclsem; +}; + +/* This is the type used the tmpfs_statfs_callout to accumulate memory usage */ + +struct tmpfs_statfs_s +{ + size_t tsf_alloc; /* Total memory allocated */ + size_t tsf_inuse; /* Total memory in use */ + off_t tsf_files; /* Total file nodes in the file system */ + off_t tsf_ffree; /* Free directory nodes in the file system */ +}; + +/* This is the type of the for tmpfs_foreach callback */ + +typedef int (*tmpfs_foreach_t)(FAR struct tmpfs_directory_s *tdo, + unsigned int index, FAR void *arg); + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +extern void los_set_ramfs_unit(off_t size); + +#endif + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif /* __FS_TMPFS_FS_TMPFS_H */ diff --git a/fs/vfs/fs_close.c b/fs/vfs/fs_close.c new file mode 100755 index 0000000..a96b211 --- /dev/null +++ b/fs/vfs/fs_close.c @@ -0,0 +1,132 @@ +/**************************************************************************** + * fs/vfs/fs_close.c + * + * Copyright (C) 2007-2009, 2012, 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "errno.h" +#include "unistd.h" +#include "sched.h" +#include "fs/fs.h" + +#if defined(LOSCFG_NET_LWIP_SACK) +# include "net/net.h" +#endif + +#include "inode/inode.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: close + * + * Description: + * close() closes a file descriptor, so that it no longer refers to any + * file and may be reused. Any record locks (see fcntl(2)) held on the file + * it was associated with, and owned by the process, are removed (regardless + * of the file descriptor that was used to obtain the lock). + * + * If fd is the last copy of a particular file descriptor the resources + * associated with it are freed; if the descriptor was the last reference + * to a file which has been removed using unlink(2) the file is deleted. + * + * Input Parameters: + * fd file descriptor to close + * + * Returned Value: + * 0 on success; -1 on error with errno set appropriately. + * + * Assumptions: + * + ****************************************************************************/ + +int close(int fd) +{ + int err; +#if CONFIG_NFILE_DESCRIPTORS > 0 + int ret; + + /* Did we get a valid file descriptor? */ + + if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) +#endif + { + /* Close a socket descriptor */ + +#if defined(LOSCFG_NET_LWIP_SACK) + if ((unsigned int)fd < (unsigned int)(CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS)) + { + return socks_close(fd); + } + else +#endif + { + err = EBADF; + goto errout; + } + } + +#if CONFIG_NFILE_DESCRIPTORS > 0 + /* Close the driver or mountpoint. NOTES: (1) there is no + * exclusion mechanism here, the driver or mountpoint must be + * able to handle concurrent operations internally, (2) The driver + * may have been opened numerous times (for different file + * descriptors) and must also handle being closed numerous times. + * (3) for the case of the mountpoint, we depend on the close + * methods bing identical in signature and position in the operations + * vtable. + */ + + ret = files_close(fd); + if (ret < 0) + { + /* An error occurred while closing the driver */ + + err = -ret; + goto errout; + } + return OK; + +#endif + +errout: + set_errno(err); + return VFS_ERROR; +} diff --git a/fs/vfs/fs_dup.c b/fs/vfs/fs_dup.c new file mode 100755 index 0000000..b31ed25 --- /dev/null +++ b/fs/vfs/fs_dup.c @@ -0,0 +1,111 @@ +/**************************************************************************** + * fs/vfs/fs_dup.c + * + * Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "errno.h" +#include "unistd.h" +#include "sched.h" + +#include "fs/fs.h" +#include "inode/inode.h" +#include "net/net.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: dup + * + * Description: + * Clone a file or socket descriptor to an arbitray descriptor number + * + ****************************************************************************/ + +int dup(int fd) +{ + int ret = OK; + + /* Check the range of the descriptor to see if we got a file or a socket + * descriptor. + */ + +#if CONFIG_NFILE_DESCRIPTORS > 0 + if ((unsigned int)fd < CONFIG_NFILE_DESCRIPTORS) + { + /* 0,1,2 fd is not opened in system, no need to dup them, return fd directly */ + + if ((fd >= STDIN_FILENO) && (fd <= STDERR_FILENO)) + { + return fd; + } + + /* Its a valid file descriptor.. dup the file descriptor using any + * other file descriptor. fd_dupfd() sets the errno value in the + * event of any failures. + */ + + ret = fs_dupfd(fd, 3); /* 3: file start fd */ + } + else +#endif + { + /* Not a valid file descriptor. Did we get a valid socket descriptor? */ +#if defined(LOSCFG_NET_LWIP_SACK) + if ((unsigned int)fd < (unsigned int)(CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS)) + { + /* Yes.. dup the socket descriptor. The errno value is not set. */ + + set_errno(EBADF); /* When net_dupsd is still closed,errno should set */ + ret = VFS_ERROR; + + } + else +#endif + { + /* No.. then it is a bad descriptor number */ + + set_errno(EBADF); + ret = VFS_ERROR; + } + } + + return ret; +} diff --git a/fs/vfs/fs_dup2.c b/fs/vfs/fs_dup2.c new file mode 100755 index 0000000..2668186 --- /dev/null +++ b/fs/vfs/fs_dup2.c @@ -0,0 +1,104 @@ +/**************************************************************************** + * fs/vfs/fs_dup2.c + * + * Copyright (C) 2007-2009, 2011, 2013, 2017 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "errno.h" +#include "unistd.h" +#include "sched.h" + +#include "inode/inode.h" + +/* This logic in this applies only when both socket and file descriptors are + * in that case, this function descriminates which type of dup2 is being + * performed. + */ + +#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(LOSCFG_NET_LWIP_SACK) + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: dup2 + * + * Description: + * Clone a file descriptor or socket descriptor to a specific descriptor + * number + * + ****************************************************************************/ + +int dup2(int fd1, int fd2) +{ + /* Check the range of the descriptor to see if we got a file or a socket + * descriptor. + */ + + if ((unsigned int)fd1 >= CONFIG_NFILE_DESCRIPTORS) + { + /* Not a valid file descriptor. Did we get a valid socket descriptor? */ + + if ((unsigned int)fd1 < (unsigned int)(CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS)) + { + /* Yes.. dup the socket descriptor. The errno value is not set. */ + + set_errno(EBADF); /* When net_dupsd2 is still closed,errno should set */ + return VFS_ERROR; /* LWIP not support */ + } + else + { + /* No.. then it is a bad descriptor number */ + + set_errno(EBADF); + return VFS_ERROR; + } + } + else + { + /* Its a valid file descriptor.. dup the file descriptor. fd_dupfd() + * sets the errno value in the event of any failures. + */ + + return fs_dupfd2(fd1, fd2); + } +} + +#endif /* CONFIG_NFILE_DESCRIPTORS > 0 ... */ diff --git a/fs/vfs/fs_dupfd.c b/fs/vfs/fs_dupfd.c new file mode 100755 index 0000000..0aba3d6 --- /dev/null +++ b/fs/vfs/fs_dupfd.c @@ -0,0 +1,194 @@ +/**************************************************************************** + * fs/vfs/fs_dupfd.c + * + * Copyright (C) 2007-2009, 2011-2014, 2017 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "assert.h" +#include "errno.h" +#include "sched.h" + +#include "fs/fs.h" +#include "fs/file.h" + +#include "inode/inode.h" +#include "stdlib.h" +#include "string.h" +#if CONFIG_NFILE_DESCRIPTORS > 0 + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: file_dup + * + * Description: + * Equivalent to the non-standard fs_dupfd() function except that it + * accepts a struct file instance instead of a file descriptor and does + * not set the errno variable. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure. + * + ****************************************************************************/ + +int file_dup(FAR struct file *filep, int minfd) +{ + int fd2; + int ret; + int err,len; + struct file *filep2 = NULL; + char *fullpath = NULL; + const char *relpath = NULL; + struct inode_search_s desc; + + /* Verify that fd is a valid, open file descriptor */ + + if ((filep->f_inode == NULL) || (filep->f_path == NULL)) + { + set_errno(EBADF); + return VFS_ERROR; + } + + len = strlen(filep->f_path); + fullpath = (char *)zalloc(len + 1); + if (fullpath == NULL) + { + set_errno(ENOMEM); + return VFS_ERROR; + } + + /* Then allocate a new file descriptor for the inode */ + + fd2 = files_allocate(filep->f_inode, filep->f_oflags, filep->f_pos, filep->f_priv, minfd); + if (fd2 < 0) + { + inode_release(filep->f_inode); + free(fullpath); + set_errno(EMFILE); + return VFS_ERROR; + } + + ret = fs_getfilep(fd2, &filep2); + + (void)strncpy_s(fullpath, len + 1, filep->f_path, len); + SETUP_SEARCH(&desc, fullpath, false); + if (inode_find(&desc) < 0) + { + ret = -EACCES; + goto errout_with_inode; + } + relpath = desc.relpath; + filep2->f_path = fullpath; + filep2->f_relpath = relpath; + + if (filep->f_inode->u.i_mops && filep->f_inode->u.i_mops->dup) + { + ret = filep->f_inode->u.i_mops->dup(filep, filep2); + } + else + { + ret = -ENOSYS; + } + + if (ret < 0) + { + goto errout_with_inode; + } + + return fd2; + +errout_with_inode: + clear_fd(fd2); + inode_release(filep2->f_inode); + free(fullpath); + filep2->f_oflags = 0; + filep2->f_pos = 0; + filep2->f_inode = NULL; + filep2->f_priv = NULL; + filep2->f_path = NULL; + filep2->f_relpath = NULL; + filep2->f_mapping = NULL; + err = -ret; + set_errno(err); + return VFS_ERROR; +} + +/**************************************************************************** + * Name: fs_dupfd OR dup + * + * Description: + * Clone a file descriptor 'fd' to an arbitray descriptor number (any value + * greater than or equal to 'minfd'). If socket descriptors are + * implemented, then this is called by dup() for the case of file + * descriptors. If socket descriptors are not implemented, then this + * function IS dup(). + * + * Returned Value: + * fs_dupfd is sometimes an OS internal function and sometimes is a direct + * substitute for dup(). So it must return an errno value as though it + * were dup(). + * + ****************************************************************************/ + +int fs_dupfd(int fd, int minfd) +{ + FAR struct file *filep; + + /* Get the file structure corresponding to the file descriptor. */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + return VFS_ERROR; + } + + /* Let file_dup() do the real work */ + + return file_dup(filep, minfd); +} + +#endif /* CONFIG_NFILE_DESCRIPTORS > 0 */ diff --git a/fs/vfs/fs_dupfd2.c b/fs/vfs/fs_dupfd2.c new file mode 100755 index 0000000..70bf663 --- /dev/null +++ b/fs/vfs/fs_dupfd2.c @@ -0,0 +1,132 @@ +/**************************************************************************** + * fs/vfs/fs_dupfd2.c + * + * Copyright (C) 2007-2009, 2011-2014, 2017 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "errno.h" +#include "unistd.h" +#include "sched.h" + +#include "inode/inode.h" + +#if CONFIG_NFILE_DESCRIPTORS > 0 + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: fs_dupfd2 OR dup2 + * + * Description: + * Clone a file descriptor to a specific descriptor number. If socket + * descriptors are implemented, then this is called by dup2() for the + * case of file descriptors. If socket descriptors are not implemented, + * then this function IS dup2(). + * + * Returned Value: + * fs_dupfd is sometimes an OS internal function and sometimes is a direct + * substitute for dup2(). So it must return an errno value as though it + * were dup2(). + * + ****************************************************************************/ + +#if defined(LOSCFG_NET_LWIP_SACK) +int fs_dupfd2(int fd1, int fd2) +#else +int dup2(int fd1, int fd2) +#endif +{ + FAR struct file *filep1; + FAR struct file *filep2; + int ret; + + /* Get the file structures corresponding to the file descriptors. */ + + ret = fs_getfilep(fd1, &filep1); + if (ret >= 0) + { + ret = fs_getfilep(fd2, &filep2); + } + + + if (ret < 0) + { + /* The errno value has already been set */ + return VFS_ERROR; + } + + /* Verify that fd1 is a valid, open file descriptor */ + + if (filep1->f_inode == NULL) + { + set_errno(EBADF); + return VFS_ERROR; + } + + /* Handle a special case */ + + if (fd1 == fd2) + { + return fd1; + } + + /* Perform the dup2 operation */ + + if (!file_dup2(filep1, filep2)) + { + return fd2; + } + else + { + clear_fd(fd2); + return VFS_ERROR; + } +} + +#endif /* CONFIG_NFILE_DESCRIPTORS > 0 */ diff --git a/fs/vfs/fs_fcntl.c b/fs/vfs/fs_fcntl.c new file mode 100755 index 0000000..43cea0b --- /dev/null +++ b/fs/vfs/fs_fcntl.c @@ -0,0 +1,378 @@ +/**************************************************************************** + * fs/vfs/fs_fcntl.c + * + * Copyright (C) 2009, 2012-2014, 2016-2017 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "stdarg.h" +#include "fcntl.h" +#include "errno.h" +#include "assert.h" +#include "fs/fs.h" +#include "inode/inode.h" + +#if defined(LOSCFG_NET_LWIP_SACK) +#include "lwip/sockets.h" +#endif + +#define FAPPEND O_APPEND +#define FFSYNC O_SYNC +#define FNONBLOCK O_NONBLOCK +#define FNDELAY O_NDELAY +#define FFCNTL (FNONBLOCK | FNDELAY | FAPPEND | FFSYNC | FASYNC) + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: file_vfcntl + * + * Description: + * Similar to the standard vfcntl function except that is accepts a struct + * struct file instance instead of a file descriptor. + * + * Input Parameters: + * filep - Instance for struct file for the opened file. + * cmd - Indentifies the operation to be performed. + * ap - Variable argument following the command. + * + * Returned Value: + * The nature of the return value depends on the command. Non-negative + * values indicate success. Failures are reported as negated errno + * values. + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +int file_vfcntl(FAR struct file *filep, int cmd, va_list ap) +{ + int err = 0; + int ret = OK; + + /* Was this file opened ? */ + + if (!filep || !filep->f_inode) + { + err = EBADF; + goto errout; + } + + switch (cmd) + { + case F_DUPFD: + /* Return a new file descriptor which shall be the lowest numbered + * available (that is, not already open) file descriptor greater than + * or equal to the third argument, arg, taken as an integer of type + * int. The new file descriptor shall refer to the same open file + * description as the original file descriptor, and shall share any + * locks. The FD_CLOEXEC flag associated with the new file descriptor + * shall be cleared to keep the file open across calls to one of the + * exec functions. + */ + + { + /* Does not set the errno variable in the event of a failure */ + + ret = file_dup(filep, va_arg(ap, int)); + } + break; + + case F_GETFD: + /* Get the file descriptor flags defined in that are associated + * with the file descriptor fd. File descriptor flags are associated + * with a single file descriptor and do not affect other file descriptors + * that refer to the same file. + */ + + case F_SETFD: + /* Set the file descriptor flags defined in , that are associated + * with fd, to the third argument, arg, taken as type int. If the + * FD_CLOEXEC flag in the third argument is 0, the file shall remain open + * across the exec functions; otherwise, the file shall be closed upon + * successful execution of one of the exec functions. + */ + + err = ENOSYS; + break; + + case F_GETFL: + /* Get the file status flags and file access modes, defined in + * , for the file description associated with fd. The file + * access modes can be extracted from the return value using the + * mask O_ACCMODE, which is defined in . File status flags + * and file access modes are associated with the file description + * and do not affect other file descriptors that refer to the same + * file with different open file descriptions. + */ + + { + ret = filep->f_oflags; + } + break; + + case F_SETFL: + /* Set the file status flags, defined in , for the file + * description associated with fd from the corresponding bits in + * the third argument, arg, taken as type int. Bits corresponding + * to the file access mode and the file creation flags, as defined + * in , that are set in arg shall be ignored. If any bits + * in arg other than those mentioned here are changed by the + * application, the result is unspecified. + */ + + { + int oflags = va_arg(ap, int); + + oflags &= FFCNTL; + filep->f_oflags &= ~FFCNTL; + filep->f_oflags |= oflags; + } + break; + + case F_GETOWN: + /* If fd refers to a socket, get the process or process group ID + * specified to receive SIGURG signals when out-of-band data is + * available. Positive values indicate a process ID; negative + * values, other than -1, indicate a process group ID. If fd does + * not refer to a socket, the results are unspecified. + */ + + case F_SETOWN: + /* If fd refers to a socket, set the process or process group ID + * specified to receive SIGURG signals when out-of-band data is + * available, using the value of the third argument, arg, taken as + * type int. Positive values indicate a process ID; negative values, + * other than -1, indicate a process group ID. If fd does not refer + * to a socket, the results are unspecified. + */ + + err = EBADF; /* Only valid on socket descriptors */ + break; + + case F_GETLK: + /* Get the first lock which blocks the lock description pointed to + * by the third argument, arg, taken as a pointer to type struct + * flock, defined in . The information retrieved shall + * overwrite the information passed to fcntl() in the structure + * flock. If no lock is found that would prevent this lock from + * being created, then the structure shall be left unchanged except + * for the lock type which shall be set to F_UNLCK. + */ + + case F_SETLK: + /* Set or clear a file segment lock according to the lock + * description pointed to by the third argument, arg, taken as a + * pointer to type struct flock, defined in . F_SETLK can + * establish shared (or read) locks (F_RDLCK) or exclusive (or + * write) locks (F_WRLCK), as well as to remove either type of lock + * (F_UNLCK). F_RDLCK, F_WRLCK, and F_UNLCK are defined in + * . If a shared or exclusive lock cannot be set, fcntl() + * shall return immediately with a return value of -1. + */ + + case F_SETLKW: + /* This command shall be equivalent to F_SETLK except that if a + * shared or exclusive lock is blocked by other locks, the thread + * shall wait until the request can be satisfied. If a signal that + * is to be caught is received while fcntl() is waiting for a + * region, fcntl() shall be interrupted. Upon return from the signal + * handler, fcntl() shall return -1 with errno set to [EINTR], and + * the lock operation shall not be done. + */ + + err = ENOSYS; /* Not implemented */ + break; + + default: + err = EINVAL; + break; + } + +errout: + if (err != 0) + { + set_errno(err); + return VFS_ERROR; + } + + return ret; +} +#endif /* CONFIG_NFILE_DESCRIPTORS > 0 */ + +/**************************************************************************** + * Name: fcntl + * + * Description: + * fcntl() will perform the operation specified by 'cmd' on an open file. + * + * Input Parameters: + * fd - File descriptor of the open file + * cmd - Identifies the operation to be performed. Command specific + * arguments may follow. + * + * Returned Value: + * The returned value depends on the nature of the command but for all + * commands the return value of -1 (ERROR) indicates that an error has + * occurred and, in this case, the errno variable will be set + * appropriately + * + ****************************************************************************/ + +int fcntl(int fd, int cmd, ...) +{ + FAR struct file *filep; + va_list ap; + int ret; + int val = 0; + + /* Setup to access the variable argument list */ + + va_start(ap, cmd); + + /* Did we get a valid file descriptor? */ + +#if CONFIG_NFILE_DESCRIPTORS > 0 + if ((unsigned int)fd < CONFIG_NFILE_DESCRIPTORS) + { + /* Get the file structure corresponding to the file descriptor. */ + + ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + va_end(ap); + return VFS_ERROR; + } + + /* Let file_vfcntl() do the real work. The errno is not set on + * failures. + */ + + ret = file_vfcntl(filep, cmd, ap); + } + else +#endif + { + /* No... check for operations on a socket descriptor */ + +#if defined(LOSCFG_NET_LWIP_SACK) + if ((unsigned int)fd < (unsigned int)(CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS)) + { + /* Yes.. defer socket descriptor operations to net_vfcntl() */ + + val = va_arg(ap, int); + ret = lwip_fcntl(fd, cmd, val); + } + else +#endif + { + /* No.. this descriptor number is out of range */ + + (void)val; + ret = EBADF; + set_errno(ret); + va_end(ap); + return VFS_ERROR; + } + } + + va_end(ap); + return ret; +} + +int fcntl64(int fd, int cmd, ...) +{ + FAR struct file *filep = NULL; + va_list va_ap; + int reval; + int va_val = 0; + + /* Setup to access the variable argument list */ + + va_start(va_ap, cmd); + + /* Did we get a valid file descriptor? */ + +#if CONFIG_NFILE_DESCRIPTORS > 0 + if ((unsigned int)fd < CONFIG_NFILE_DESCRIPTORS) + { + /* Get the file structure corresponding to the file descriptor. */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + va_end(va_ap); + return VFS_ERROR; + } + + /* Let file_vfcntl() do the real work */ + + reval = file_vfcntl(filep, cmd, va_ap); + } + else +#endif + { + /* No... check for operations on a socket descriptor */ + +#if defined(LOSCFG_NET_LWIP_SACK) + if ((unsigned int)fd < (unsigned int)(CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS)) + { + /* Yes.. defer socket descriptor operations to net_vfcntl() */ + + va_val = va_arg(va_ap, int); + reval = lwip_fcntl(fd, cmd, va_val); + } + else +#endif + { + /* No.. this descriptor number is out of range */ + + (void)va_val; + reval = EBADF; + set_errno(reval); + va_end(va_ap); + return VFS_ERROR; + } + } + + va_end(va_ap); + return reval; +} diff --git a/fs/vfs/fs_fsync.c b/fs/vfs/fs_fsync.c new file mode 100755 index 0000000..e181d69 --- /dev/null +++ b/fs/vfs/fs_fsync.c @@ -0,0 +1,136 @@ +/**************************************************************************** + * fs/vfs/fs_fsync.c + * + * Copyright (C) 2007-2009, 2013-2014, 2016-2017 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "unistd.h" +#include "fcntl.h" +#include "errno.h" +#include "assert.h" + +#include "fs/fs.h" + + +#include "inode/inode.h" + +#ifndef CONFIG_DISABLE_MOUNTPOINT + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: file_fsync + * + * Description: + * Equivalent to the standard fsync() function except that is accepts a + * struct file instance instead of a file descriptor and it does not set + * the errno variable. + * + ****************************************************************************/ + +int file_fsync(FAR struct file *filep) +{ + struct inode *inode; + int ret; + + /* Was this file opened for write access? */ + + if ((filep->f_oflags & O_ACCMODE) == 0) + { + ret = EBADF; + goto errout; + } + + /* Is this inode a registered mountpoint? Does it support the + * sync operations may be relevant to device drivers but only + * the mountpoint operations vtable contains a sync method. + */ + + inode = filep->f_inode; + if (!inode || !INODE_IS_MOUNTPT(inode) || + !inode->u.i_mops || !inode->u.i_mops->sync) + { + ret = EINVAL; + goto errout; + } + + /* Yes, then tell the mountpoint to sync this file */ + + ret = inode->u.i_mops->sync(filep); + if (ret >= 0) + { + return OK; + } + + ret = -ret; + +errout: + set_errno(ret); + return VFS_ERROR; +} + +/**************************************************************************** + * Name: fsync + * + * Description: + * This func simply binds inode sync methods to the sync system call. + * + ****************************************************************************/ + +int fsync(int fd) +{ + FAR struct file *filep; + + /* Get the file structure corresponding to the file descriptor. */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + return VFS_ERROR; + } + + /* Perform the fsync operation */ + + return file_fsync(filep); +} + +#endif /* !CONFIG_DISABLE_MOUNTPOINT */ diff --git a/fs/vfs/fs_getfilep.c b/fs/vfs/fs_getfilep.c new file mode 100755 index 0000000..8401f03 --- /dev/null +++ b/fs/vfs/fs_getfilep.c @@ -0,0 +1,113 @@ +/**************************************************************************** + * fs/vfs/fs_getfilep.c + * + * Copyright (C) 2014, 2016-2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "sys/types.h" + +#include "errno.h" +#include "sched.h" + +#include "inode/inode.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: fs_getfilep + * + * Description: + * Given a file descriptor, return the corresponding instance of struct + * file. NOTE that this function will currently fail if it is provided + * with a socket descriptor. + * + * Input Parameters: + * fd - The file descriptor + * filep - The location to return the struct file instance + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure. + * + ****************************************************************************/ + +int fs_getfilep_normal(int fd, FAR struct file **filep) +{ + struct filelist *list; + + *filep = (struct file *)NULL; + + if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) + { + return -EBADF; + } + + /* The descriptor is in a valid range to file descriptor... Get the + * thread-specific file list. + */ + + list = sched_getfiles(); + + /* The file list can be NULL under two cases: (1) One is an obscure + * cornercase: When memory management debug output is enabled. Then + * there may be attempts to write to stdout from malloc before the group + * data has been allocated. The other other is (2) if this is a kernel + * thread. Kernel threads have no allocated file descriptors. + */ + + if (list == NULL) + { + return -EAGAIN; + } + + /* And return the file pointer from the list */ + + *filep = &list->fl_files[fd]; + return OK; +} + +int fs_getfilep(int fd, FAR struct file **filep) +{ + int ret = fs_getfilep_normal(fd, filep); + if (ret < 0) + { + set_errno(-ret); + } + return ret; +} diff --git a/fs/vfs/fs_ioctl.c b/fs/vfs/fs_ioctl.c new file mode 100755 index 0000000..a956f78 --- /dev/null +++ b/fs/vfs/fs_ioctl.c @@ -0,0 +1,177 @@ +/**************************************************************************** + * fs/vfs/fs_ioctl.c + * + * Copyright (C) 2007-2010, 2012-2014, 2016-2017 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "sched.h" +#include "assert.h" +#include "errno.h" +#include "unistd.h" +#include "console.h" + +#if defined(LOSCFG_NET_LWIP_SACK) +# include "net/net.h" +#endif + +#include "inode/inode.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: ioctl/fs_ioctl + * + * Description: + * Perform device specific operations. + * + * Input Parameters: + * fd File/socket descriptor of device + * req The ioctl command + * arg The argument of the ioctl cmd + * + * Returned Value: + * >=0 on success (positive non-zero values are cmd-specific) + * -1 on failure with errno set properly: + * + * EBADF + * 'fd' is not a valid descriptor. + * EFAULT + * 'arg' references an inaccessible memory area. + * EINVAL + * 'cmd' or 'arg' is not valid. + * ENOTTY + * 'fd' is not associated with a character special device. + * ENOTTY + * The specified request does not apply to the kind of object that the + * descriptor 'fd' references. + * + ****************************************************************************/ + +#ifdef CONFIG_LIBC_IOCTL_VARIADIC +int fs_ioctl(int fd, int req, ...) +#else +int ioctl(int fd, int req, ...) +#endif +{ + int err; + UINTPTR arg = 0; + va_list ap; +#if CONFIG_NFILE_DESCRIPTORS > 0 + FAR struct file *filep; + FAR struct inode *inode; + int ret = OK; +#endif + + va_start(ap, req); + arg = va_arg(ap, UINTPTR); + va_end(ap); +#if CONFIG_NFILE_DESCRIPTORS > 0 + + /* Did we get a valid file descriptor? */ + + if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) +#endif + { + /* Perform the socket ioctl */ + +#if defined(LOSCFG_NET_LWIP_SACK) + if ((unsigned int)fd < (unsigned int)(CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS)) + { + return socks_ioctl(fd, (long)req, (void *)arg); + } + else +#endif + { + err = EBADF; + ret = VFS_ERROR; + goto errout; + } + } + +#if CONFIG_NFILE_DESCRIPTORS > 0 + + if (fd >= STDIN_FILENO && fd <= STDERR_FILENO) /* fd : [0,2] */ + { + fd = ConsoleUpdateFd(); + if (fd < 0) + { + err = EBADF; + ret = VFS_ERROR; + goto errout; + } + } + + /* Get the file structure corresponding to the file descriptor. */ + + ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + return VFS_ERROR; + } + + /* Is a driver registered? Does it support the ioctl method? */ + + inode = filep->f_inode; + if (inode && inode->u.i_ops && inode->u.i_ops->ioctl) + { + /* Yes, then let it perform the ioctl */ + + ret = (int)inode->u.i_ops->ioctl(filep, req, arg); + if (ret < 0) + { + err = -ret; + goto errout; + } + } + else + { + err = EBADF; + ret = VFS_ERROR; + goto errout; + } + + return ret; +#endif + +errout: + set_errno(err); + return ret; +} diff --git a/fs/vfs/fs_lseek.c b/fs/vfs/fs_lseek.c new file mode 100755 index 0000000..029a247 --- /dev/null +++ b/fs/vfs/fs_lseek.c @@ -0,0 +1,194 @@ +/**************************************************************************** + * fs/vfs/fs_lseek.c + * + * Copyright (C) 2008, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "sys/types.h" +#include "unistd.h" +#include "sched.h" +#include "assert.h" +#include "errno.h" +#include "inode/inode.h" + +#if CONFIG_NFILE_DESCRIPTORS > 0 + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: file_seek + * + * Description: + * This is the internal implementation of lseek. See the comments in + * lseek() for further information. + * + * Input Parameters: + * file File structure instance + * offset Defines the offset to position to + * whence Defines how to use offset + * + * Returned Value: + * The resulting offset on success. A negated errno value is returned on + * any failure (see lseek comments). + * + ****************************************************************************/ + +off_t file_seek(FAR struct file *filep, off_t offset, int whence) +{ + FAR struct inode *inode; + int ret; + int err = OK; + + DEBUGASSERT(filep); + inode = filep->f_inode; + + if (!inode) + { + err = EBADF; + goto errout; + } + + /* Invoke the file seek method if available */ + + if (inode->u.i_ops && inode->u.i_ops->seek) + { + ret = inode->u.i_ops->seek(filep, offset, whence); + if (ret < 0) + { + err = -ret; + goto errout; + } + } + else + { + /* No... Just set the common file position value */ + + switch (whence) + { + case SEEK_CUR: + offset += (off_t)filep->f_pos; + + /* FALLTHROUGH */ + + case SEEK_SET: + if (offset >= 0) + { + filep->f_pos = (loff_t)offset; /* Might be beyond the end-of-file */ + } + else + { + err = EINVAL; + goto errout; + } + break; + + case SEEK_END: + err = ENOSYS; + goto errout; + + default: + err = EINVAL; + goto errout; + } + } + + return (off_t)filep->f_pos; + +errout: + set_errno(err); + return (off_t)VFS_ERROR; +} + +/**************************************************************************** + * Name: lseek + * + * Description: + * The lseek() function repositions the offset of the open file associated + * with the file descriptor fd to the argument 'offset' according to the + * directive 'whence' as follows: + * + * SEEK_SET + * The offset is set to offset bytes. + * SEEK_CUR + * The offset is set to its current location plus offset bytes. + * SEEK_END + * The offset is set to the size of the file plus offset bytes. + * + * The lseek() function allows the file offset to be set beyond the end of the + * file (but this does not change the size of the file). If data is later written + * at this point, subsequent reads of the data in the gap (a "hole") return null + * bytes ('\0') until data is actually written into the gap. + * + * Input Parameters: + * fd File descriptor of device + * offset Defines the offset to position to + * whence Defines how to use offset + * + * Returned Value: + * The resulting offset on success. -1 on failure withi errno set properly: + * + * EBADF fd is not an open file descriptor. + * EINVAL whence is not one of SEEK_SET, SEEK_CUR, SEEK_END; or the + * resulting file offset would be negative, or beyond the end of a + * seekable device. + * EOVERFLOW The resulting file offset cannot be represented in an off_t. + * ESPIPE fd is associated with a pipe, socket, or FIFO. + * + ****************************************************************************/ + +off_t lseek(int fd, off_t offset, int whence) +{ + FAR struct file *filep; + + /* Get the file structure corresponding to the file descriptor. */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + return (off_t)VFS_ERROR; + } + + /* Then let file_seek do the real work */ + + return file_seek(filep, offset, whence); +} + +#endif diff --git a/fs/vfs/fs_lseek64.c b/fs/vfs/fs_lseek64.c new file mode 100755 index 0000000..c168f91 --- /dev/null +++ b/fs/vfs/fs_lseek64.c @@ -0,0 +1,195 @@ +/**************************************************************************** + * fs/vfs/fs_lseek.c + * + * Copyright (C) 2008, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "sys/types.h" +#include "unistd.h" +#include "sched.h" +#include "assert.h" +#include "errno.h" +#include "inode/inode.h" + +#if CONFIG_NFILE_DESCRIPTORS > 0 + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: file_seek64 + * + * Description: + * This is the internal implementation of lseek. See the comments in + * lseek() for further information. + * + * Input Parameters: + * file File structure instance + * offset Defines the offset to position to + * whence Defines how to use offset + * + * Returned Value: + * The resulting offset on success. A negated errno value is returned on + * any failure (see lseek comments). + * + ****************************************************************************/ + +off64_t file_seek64(FAR struct file *filep, off64_t offset, int whence) +{ + FAR struct inode *inode = NULL; + off64_t ret; + int err = OK; + + DEBUGASSERT(filep); + inode = filep->f_inode; + + if (inode == NULL) + { + err = EBADF; + goto errout; + } + + /* Invoke the file seek method if available */ + + if (INODE_IS_MOUNTPT(inode) && inode->u.i_mops && inode->u.i_mops->seek64) + { + ret = inode->u.i_mops->seek64(filep, offset, whence); + if (ret < 0) + { + err = -(int)ret; + goto errout; + } + filep->f_pos = ret; + } + else + { + /* No... Just set the common file position value */ + + switch (whence) + { + case SEEK_CUR: + offset += filep->f_pos; + + /* FALLTHROUGH */ + + case SEEK_SET: + if (offset >= 0) + { + filep->f_pos = offset; /* Might be beyond the end-of-file */ + } + else + { + err = EINVAL; + goto errout; + } + break; + + case SEEK_END: + err = ENOSYS; + goto errout; + + default: + err = EINVAL; + goto errout; + } + } + + return filep->f_pos; + +errout: + set_errno(err); + return (off64_t)VFS_ERROR; +} + +/**************************************************************************** + * Name: lseek64 + * + * Description: + * The lseek64() function repositions the offset of the open file associated + * with the file descriptor fd to the argument 'offset' according to the + * directive 'whence' as follows: + * + * SEEK_SET + * The offset is set to offset bytes. + * SEEK_CUR + * The offset is set to its current location plus offset bytes. + * SEEK_END + * The offset is set to the size of the file plus offset bytes. + * + * The lseek64() function allows the file offset to be set beyond the end of the + * file (but this does not change the size of the file). If data is later written + * at this point, subsequent reads of the data in the gap (a "hole") return null + * bytes ('\0') until data is actually written into the gap. + * + * Input Parameters: + * fd File descriptor of device + * offset Defines the offset to position to + * whence Defines how to use offset + * + * Returned Value: + * The resulting offset on success. -1 on failure withi errno set properly: + * + * EBADF fd is not an open file descriptor. + * EINVAL whence is not one of SEEK_SET, SEEK_CUR, SEEK_END; or the + * resulting file offset would be negative, or beyond the end of a + * seekable device. + * EOVERFLOW The resulting file offset cannot be represented in an off_t. + * ESPIPE fd is associated with a pipe, socket, or FIFO. + * + ****************************************************************************/ + +off64_t lseek64(int fd, off64_t offset, int whence) +{ + FAR struct file *filep; + + /* Get the file structure corresponding to the file descriptor. */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + return (off64_t)VFS_ERROR; + } + + /* Then let file_seek do the real work */ + + return file_seek64(filep, offset, whence); +} + +#endif diff --git a/fs/vfs/fs_mkdir.c b/fs/vfs/fs_mkdir.c new file mode 100755 index 0000000..7435ca0 --- /dev/null +++ b/fs/vfs/fs_mkdir.c @@ -0,0 +1,277 @@ +/**************************************************************************** + * fs/vfs/fs_mkdir.c + * + * Copyright (C) 2007, 2008, 2014, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "errno.h" +#include "sys/types.h" +#include "sys/stat.h" +#include "fs/fs.h" +#include "stdlib.h" +#include "inode/inode.h" +#include "string.h" +#include "fs_other.h" +#include "capability_api.h" +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#undef FS_HAVE_WRITABLE_MOUNTPOINT +#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \ + CONFIG_NFILE_STREAMS > 0 +# define FS_HAVE_WRITABLE_MOUNTPOINT 1 +#endif + +#undef FS_HAVE_PSEUDOFS_OPERATIONS +#if !defined(CONFIG_DISABLE_PSEUDOFS_OPERATIONS) && CONFIG_NFILE_STREAMS > 0 +# define FS_HAVE_PSEUDOFS_OPERATIONS 1 +#endif + +#undef FS_HAVE_MKDIR +#if defined(FS_HAVE_WRITABLE_MOUNTPOINT) || defined(FS_HAVE_PSEUDOFS_OPERATIONS) +# define FS_HAVE_MKDIR 1 +#endif + +#ifdef FS_HAVE_MKDIR + +/**************************************************************************** + * Private Functions + ****************************************************************************/ +int do_mkdir(int dirfd, const char *pathname, mode_t mode) +{ + FAR struct inode *inode; + FAR struct inode *pathnode; + const char *relpath = NULL; + int errcode; + int ret; + char *fullpath = NULL; + char *relativepath = NULL; + struct inode_search_s desc; + uint c_uid = OsCurrUserGet()->effUserID; + uint c_gid = OsCurrUserGet()->effGid; + + mode &= ~GetUmask(); + mode &= (S_IRWXU|S_IRWXG|S_IRWXO); + + /* Get absolute path by dirfd*/ + ret = get_path_from_fd(dirfd, &relativepath); + if (ret < 0) + { + errcode = -ret; + goto errout; + } + + ret = vfs_normalize_path((const char *)relativepath, pathname, &fullpath); + if (relativepath) + { + free(relativepath); + } + + if (ret < 0) + { + errcode = -ret; + goto errout; + } + + /* Find the inode that includes this path */ + SETUP_SEARCH(&desc, fullpath, false); + ret = inode_find(&desc); + inode = desc.node; + relpath = desc.relpath; + + if ((ret >= 0) && (inode != NULL)) + { + if (!strlen(relpath)) + { + /* Find the inode that exactly match this path. */ + + errcode = EEXIST; + goto errout_with_inode; + } + + /* If the path doesn't include the existed rootfs dirs, + * then make a pseudo dir. + */ + +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS + if (((inode == g_root_inode) && !IsInRootfs(relpath)) || (!INODE_IS_MOUNTPT(g_root_inode))) + { + if (VfsPermissionCheck(desc.parent->i_uid, desc.parent->i_gid, desc.parent->i_mode, EXEC_OP | WRITE_OP)) + { + errcode = EACCES; + goto errout_with_inode; + } + /* Create a pseudo inode. */ + inode_semtake(); + + ret = inode_reserve(fullpath, &pathnode); + if (ret < 0) + { + errcode = -ret; + inode_semgive(); + goto errout_with_inode; + } + pathnode->i_mode = mode; + pathnode->i_uid = c_uid; + pathnode->i_gid = c_gid; + inode_semgive(); + } + else +#endif + + /* An inode was found that includes this path and possibly refers to a + * mountpoint. + */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT + /* Check if the inode is a valid mountpoint. */ + + if (!INODE_IS_MOUNTPT(inode) || !inode->u.i_mops) + { + /* The inode is not a mountpoint */ + + errcode = EEXIST; + goto errout_with_inode; + } + + /* Perform the mkdir operation using the relative path + * at the mountpoint. + */ + + else if (inode->u.i_mops->mkdir) + { + ret = inode->u.i_mops->mkdir(inode, relpath, mode); + if (ret < 0) + { + errcode = -ret; + goto errout_with_inode; + } + } + else + { + errcode = ENOSYS; + goto errout_with_inode; + } + + /* Release our reference on the inode */ + + inode_release(inode); +#else + /* But mountpoints are not supported in this configuration */ + + errcode = EEXIST; + goto errout_with_inode; +#endif + } + +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS + /* No inode exists that contains this path. Create a new inode in the + * pseudo-filesystem at this location. + */ + + else + { + /* Create an inode in the pseudo-filesystem at this path. + * NOTE that the new inode will be created with a reference + * count of zero. + */ + inode_semtake(); + ret = inode_reserve(fullpath, &inode); + if (ret < 0) + { + errcode = -ret; + free(fullpath); + inode_semgive(); + goto errout; + } + inode->i_mode = mode; + inode->i_uid = c_uid; + inode->i_gid = c_gid; + inode_semgive(); + } +#else + else + { + errcode = ENXIO; + free(fullpath); + goto errout; + } +#endif + + /* Directory successfully created */ + + free(fullpath); + return OK; + +errout_with_inode: + inode_release(inode); + free(fullpath); +errout: + set_errno(errcode); + return VFS_ERROR; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mkdir + * + * Description: Create a directory + * + ****************************************************************************/ + +int mkdir(const char *pathname, mode_t mode) +{ + return do_mkdir(AT_FDCWD, pathname, mode); +} + +/**************************************************************************** + * Name: mkdirat + * + * Description: Create a directory by dirfd + * + ****************************************************************************/ + +int mkdirat(int dirfd, const char *pathname, mode_t mode) +{ + return do_mkdir(dirfd, pathname, mode); +} + +#endif /* FS_HAVE_MKDIR */ diff --git a/fs/vfs/fs_open.c b/fs/vfs/fs_open.c new file mode 100755 index 0000000..a24124a --- /dev/null +++ b/fs/vfs/fs_open.c @@ -0,0 +1,362 @@ +/**************************************************************************** + * fs/vfs/fs_open.c + * + * Copyright (C) 2007-2009, 2011-2012, 2016-2018 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "errno.h" +#include "sys/types.h" +#include "fcntl.h" +#include "sched.h" +#include "assert.h" +#ifdef LOSCFG_FILE_MODE +#include "stdarg.h" +#endif +#include "stdlib.h" +#include "fs/fs.h" + +#include "inode/inode.h" +#include "driver/blockproxy.h" +#include "fs_other.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +static int oflag_convert_mode(int oflags) +{ + /* regular file operations */ + + int acc_mode = 0; + if ((oflags & O_ACCMODE) == O_RDONLY) + acc_mode |= READ_OP; + if (oflags & O_WRONLY) + acc_mode |= WRITE_OP; + if (oflags & O_RDWR) + acc_mode |= READ_OP | WRITE_OP; + + /* Opens the file, if it is existing. If not, a new file is created. */ + + if (oflags & O_CREAT) + acc_mode |= WRITE_OP; + + /* Creates a new file. If the file is existing, it is truncated and overwritten. */ + + if (oflags & O_TRUNC) + acc_mode |= WRITE_OP; + + /* Creates a new file. The function fails if the file is already existing. */ + + if (oflags & O_EXCL) + acc_mode |= WRITE_OP; + if (oflags & O_APPEND) + acc_mode |= WRITE_OP; + + /* mark for executing operation */ + + if (oflags & O_EXECVE) + acc_mode |= EXEC_OP; + return acc_mode; +} + +int get_path_from_fd(int fd, char **path) +{ + FAR struct file *file = NULL; + char *copypath = NULL; + + if (fd == AT_FDCWD) + { + return OK; + } + + int ret = fs_getfilep(fd, &file); + if (ret < 0) + { + return -ENOENT; + } + + if ((file == NULL) || (file->f_inode == NULL) || (file->f_path == NULL)) + { + return -EBADF; + } + + copypath = strdup((const char*)file->f_path); + if (copypath == NULL) + { + return VFS_ERROR; + } + + char *endptr = copypath + strlen(copypath)-1;//the ptr before '\0' + + /* strip out the file name, for example:/usr/lib/xx.so, final get /usr/lib/ */ + while (endptr > copypath) + { + if(*endptr == '/' && endptr > copypath) + { + *(endptr + 1) = '\0'; + *path = copypath; + return OK; + } + + endptr--; + } + + free(copypath); + return -ENOENT; +} + +int do_open(int dirfd, const char *path, int oflags, ...) +{ + FAR struct file *filep = NULL; + FAR struct inode *inode = NULL; + FAR const char *relpath = NULL; + char *fullpath = NULL; + char *relativepath = NULL; + struct inode_search_s desc; +#if defined(LOSCFG_FILE_MODE) || !defined(CONFIG_DISABLE_MOUNTPOINT) + mode_t mode = DEFAULT_FILE_MODE; +#endif + int ret; + int fd; + int acc_mode; +#ifdef LOSCFG_FILE_MODE + /* If the file is opened for creation, then get the mode bits */ + + if ((oflags & (O_WRONLY | O_CREAT)) != 0) + { + va_list ap; + va_start(ap, oflags); + mode = va_arg(ap, int); + va_end(ap); + mode &= ~GetUmask(); + mode &= (S_IRWXU|S_IRWXG|S_IRWXO); + } +#endif + + /* Get relative path by dirfd*/ + ret = get_path_from_fd(dirfd, &relativepath); + if (ret < 0) + { + ret = -ret; + goto errout; + } + + ret = vfs_normalize_path((const char *)relativepath, path, &fullpath); + if (relativepath) + { + free(relativepath); + } + + if (ret < 0) + { + ret = -ret; + goto errout; + } + + /* Get an inode for this file */ + SETUP_SEARCH(&desc, fullpath, false); + ret = inode_find(&desc); + if (ret < 0) + { + ret = EACCES; + free(fullpath); + goto errout; + } + inode = desc.node; + relpath = desc.relpath; + +#if !defined(CONFIG_DISABLE_MOUNTPOINT) +#ifdef LOSCFG_FS_VFS_BLOCK_DEVICE + if (INODE_IS_BLOCK(inode)) + { + fd = block_proxy(path, oflags); + if (fd < 0) + { + ret = fd; + goto errout_with_inode; + } + + inode_release(inode); + free(fullpath); + return fd; + } +#endif +#endif + + /* Verify that the inode is valid and either a "normal" character driver or a + * mountpoint. We specifically exclude block drivers and and "special" + * inodes (semaphores, message queues, shared memory). + */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT + if ((!INODE_IS_DRIVER(inode) && !INODE_IS_MOUNTPT(inode)) || !inode->u.i_ops) +#else + if (!INODE_IS_DRIVER(inode) || !inode->u.i_ops) +#endif + { + ret = ENXIO; + goto errout_with_inode; + } + + /* Associate the inode with a file structure */ + + fd = files_allocate(inode, oflags, 0, NULL, 3); /* 3: file start fd */ + if (fd < 0) + { + ret = EMFILE; + goto errout_with_inode; + } + + /* Get the file structure corresponding to the file descriptor. */ + + ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + ret = EPERM; + + /* The errno value has already been set */ + goto errout_with_fd; + } + + /* Perform the driver open operation. NOTE that the open method may be + * called many times. The driver/mountpoint logic should handled this + * because it may also be closed that many times. + */ + + ret = OK; + filep->f_path = fullpath; /* The mem will free in close(fd); */ + filep->f_relpath = relpath; + + acc_mode = oflag_convert_mode(oflags); + if (inode->u.i_ops->open) + { +#ifndef CONFIG_DISABLE_MOUNTPOINT + if (INODE_IS_MOUNTPT(inode)) + { + if (VfsPermissionCheck(inode->i_uid, inode->i_gid, inode->i_mode, EXEC_OP)) + { + ret = EACCES; + goto errout_with_fd; + } + ret = inode->u.i_mops->open(filep, relpath, oflags, mode); + } + else +#endif + { + if (VfsPermissionCheck(inode->i_uid, inode->i_gid, inode->i_mode, acc_mode)) + { + ret = EACCES; + goto errout_with_fd; + } + ret = inode->u.i_ops->open(filep); + } + } + + if (ret < 0) + { + ret = -ret; + goto errout_with_fd; + } + + /* we do not bother to handle the NULL scenario, if so, page-cache feature will not be used + * when we do the file fault */ + + add_mapping(filep, fullpath); + + return fd; + +errout_with_fd: + files_release(fd); +errout_with_inode: + inode_release(inode); + free(fullpath); +errout: + set_errno(ret); + return VFS_ERROR; +} + +/**************************************************************************** + * Name: open + * + * Description: Standard 'open' interface + * + ****************************************************************************/ + +int open(const char *path, int oflags, ...) +{ + mode_t mode = 0666; /* File read-write properties. */ +#ifdef LOSCFG_FILE_MODE + va_list ap; + va_start(ap, oflags); + mode = va_arg(ap, int); + va_end(ap); +#endif + return do_open(AT_FDCWD, path, oflags, mode); +} + +int open64 (const char *__path, int __oflag, ...) +{ + mode_t mode = 0666; /* File read-write properties. */ +#ifdef LOSCFG_FILE_MODE + va_list ap; + va_start(ap, __oflag); + mode = va_arg(ap, int); + va_end(ap); +#endif + return open (__path, ((unsigned int)__oflag) | O_LARGEFILE, mode); +} + +/**************************************************************************** + * Name: openat + * + * Description: open by dirfd + * + ****************************************************************************/ + +int openat(int dirfd, const char * path, int oflags, ...) +{ + mode_t mode = 0666; /* File read-write properties. */ +#ifdef LOSCFG_FILE_MODE + va_list ap; + va_start(ap, oflags); + mode = va_arg(ap, int); + va_end(ap); +#endif + return do_open(dirfd, path, oflags, mode); +} diff --git a/fs/vfs/fs_poll.c b/fs/vfs/fs_poll.c new file mode 100755 index 0000000..5152165 --- /dev/null +++ b/fs/vfs/fs_poll.c @@ -0,0 +1,540 @@ +/**************************************************************************** + * fs/vfs/fs_poll.c + * + * Copyright (C) 2008-2009, 2012-2019 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "los_hwi.h" +#include "vfs_config.h" +#include "stdint.h" +#include "poll.h" +#include "assert.h" +#include "errno.h" +#include "debug.h" +#include "fs/fs.h" +#include "inode/inode.h" +#include "stdlib.h" +#include "stdio.h" +#include "console.h" +#include "unistd.h" +#include "linux/wait.h" +#ifdef LOSCFG_NET_LWIP_SACK +#include "lwip/sockets.h" +#endif +#ifndef CONFIG_DISABLE_POLL + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifndef MSEC_PER_SEC +#define MSEC_PER_SEC 1000L +#endif + +#ifndef NSEC_PER_MSEC +#define NSEC_PER_MSEC 1000000L +#endif + +#define N_POLL_ITEMS 5 +#define poll_semgive(sem) sem_post(sem) + +/**************************************************************************** + * Data Structures & Macros + ****************************************************************************/ + +typedef wait_queue_head_t * poll_wait_queue; + +typedef struct tag_poll_wait_node +{ + LOS_DL_LIST queue_node; + pollevent_t key; + struct tag_poll_wait_entry *entry; + poll_wait_queue wait_queue; +} poll_wait_node; + +typedef struct tag_poll_wait_entry_table +{ + struct tag_poll_wait_entry_table *next; + UINT32 index; + poll_wait_node items[N_POLL_ITEMS]; +} poll_wait_entry_table; + +typedef struct tag_poll_wait_entry +{ + bool add_queue_flag; + sem_t sem; + UINT32 inline_index; + poll_wait_node inline_items[N_POLL_ITEMS]; + poll_wait_entry_table *table; +} poll_wait_entry; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: poll_semtake + ****************************************************************************/ + +static int poll_semtake(sem_t *sem) +{ + /* Take the semaphore (perhaps waiting) */ + + if (sem_wait(sem) < 0) + { + int err = get_errno(); + + /* The only case that an error should occur here is if the wait were + * awakened by a signal. + */ + + DEBUGASSERT(err == EINTR); + return -err; + } + + return OK; +} + +static void set_add_poll_wait_flag(poll_wait_head wait, bool add_queue_flag) +{ + wait->add_queue_flag = add_queue_flag; +} + +static int destroy_poll_wait(poll_wait_head wait) +{ + unsigned int i; + unsigned long int_save; + poll_wait_node *wait_node = NULL; + poll_wait_entry_table *curr_table = NULL; + + for (i = 0; i < wait->inline_index; ++i) + { + wait_node = &wait->inline_items[i]; + spin_lock_irqsave(&wait_node->wait_queue->lock, int_save); + LOS_ListDelete(&wait_node->queue_node); + spin_unlock_irqrestore(&wait_node->wait_queue->lock, int_save); + } + + while (wait->table) + { + curr_table = wait->table; + wait->table = curr_table->next; + + for (i = 0; i < curr_table->index; ++i) + { + wait_node = &curr_table->items[i]; + spin_lock_irqsave(&wait_node->wait_queue->lock, int_save); + LOS_ListDelete(&wait_node->queue_node); + spin_unlock_irqrestore(&wait_node->wait_queue->lock, int_save); + } + free(curr_table); + } + + if (sem_destroy(&wait->sem) < 0) + { + PRINT_ERR("[%s] sem_destroy failed\n", __FUNCTION__); + return -1; + } + + return 0; +} + +static poll_wait_node *get_poll_item(poll_wait_head wait) +{ + if (wait->inline_index < N_POLL_ITEMS) + { + return wait->inline_items + wait->inline_index++; + } + if (!wait->table || (wait->table && wait->table->index >= N_POLL_ITEMS)) + { + poll_wait_entry_table *new_entry_table = NULL; + + new_entry_table = (poll_wait_entry_table *)malloc(sizeof(poll_wait_entry_table)); + if (new_entry_table == NULL) + { + return (poll_wait_node *)NULL; + } + new_entry_table->index = 0; + + new_entry_table->next = wait->table; + wait->table = new_entry_table; + } + + return wait->table->items + wait->table->index++; +} + +static void add_pollwait_queue(poll_wait_queue queue, poll_table *p) +{ + unsigned long int_save; + poll_wait_head wait = p->wait; + poll_wait_node *new_node = get_poll_item(wait); + if (new_node != NULL) + { + new_node->entry = wait; + new_node->key = p->key; + new_node->wait_queue = queue; + spin_lock_irqsave(&queue->lock, int_save); + LOS_ListAdd(&queue->poll_queue, &new_node->queue_node); + spin_unlock_irqrestore(&queue->lock, int_save); + } +} + +static int wait_sem_time(poll_wait_head wait, const struct timespec *time_ptr) +{ + if (time_ptr != NULL) + { + return sem_timedwait(&wait->sem, time_ptr); + } + else + { + return poll_semtake(&wait->sem); + } +} + +static int file_poll(struct file *filep, poll_table *wait) +{ + struct inode *inode = NULL; + int ret = -ENOSYS; + + inode = filep->f_inode; + + if (inode != NULL && inode->u.i_ops != NULL && inode->u.i_ops->poll != NULL) + { + ret = inode->u.i_ops->poll(filep, wait); + } + + return ret; +} + +static int fdesc_poll(int fd, poll_table *wait) +{ + struct file *filep = NULL; + + if (fd <= STDERR_FILENO && fd >= STDIN_FILENO) /* fd : [0,2] */ + { + fd = ConsoleUpdateFd(); + if (fd < 0) + { + set_errno(EBADF); + return VFS_ERROR; + } + } + + /* Get the file pointer corresponding to this file descriptor */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + int errorcode = get_errno(); + return -errorcode; + } + + /* Let file_poll() do the rest */ + + return file_poll(filep, wait); +} + +static int query_fd(int fd, poll_table *wait) +{ + /* Check for a valid file descriptor */ + + if (fd >= CONFIG_NFILE_DESCRIPTORS) + { + /* Perform the socket ioctl */ + +#if defined(LOSCFG_NET_LWIP_SACK) + if (fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS)) + { + return socks_poll(fd, wait); + } + else +#endif + { + return -EBADF; + } + } + + return fdesc_poll(fd, wait); +} + +static int query_fds(struct pollfd *fds, nfds_t nfds, poll_table *wait) +{ + unsigned int i; + int ret; + int count = 0; + + if ((nfds != 0 && fds == NULL) || wait == NULL || wait->wait == NULL) + { + set_errno(EINVAL); + return -1; + } + + for (i = 0; i < nfds; ++i) + { + struct pollfd *p_fds = &fds[i]; + if (p_fds->fd < 0) + { + set_errno(EBADF); + return -1; + } + + wait->key = p_fds->events | POLLERR | POLLHUP; + + ret = query_fd(p_fds->fd, wait); + if (ret < 0) + { + set_errno(-ret); + return -1; + } + + p_fds->revents = (p_fds->events | POLLERR | POLLHUP) & (pollevent_t)ret; + if (p_fds->revents) + { + ++count; + set_add_poll_wait_flag(wait->wait, false); + } + } + + return count; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +void notify_poll_with_key(wait_queue_head_t *wait_address, pollevent_t key) +{ + unsigned long int_save; + int failed_count = 0; + poll_wait_node *curr = NULL; + + spin_lock_irqsave(&wait_address->lock, int_save); + LOS_DL_LIST_FOR_EACH_ENTRY(curr, &(wait_address->poll_queue), poll_wait_node, queue_node) + { + poll_wait_entry *curr_entry = curr->entry; + if (!key || (key & curr->key)) + { + if (poll_semgive(&curr_entry->sem) < 0) + { + failed_count++; + } + } + } + spin_unlock_irqrestore(&wait_address->lock, int_save); + + if (failed_count != 0) + { + PRINT_ERR("[%s] sem_post failed %d times\n", __FUNCTION__, failed_count); + } +} + +/* just for compatible */ + +void notify_poll(wait_queue_head_t *wait_address) +{ + notify_poll_with_key(wait_address, 0); +} + +void poll_wait(struct file *filp, wait_queue_head_t *wait_address, poll_table *p) +{ + if (!wait_address || !p || !p->wait) + { + return; + } + + if (p->wait->add_queue_flag) + { + add_pollwait_queue(wait_address, p); + } +} + +/**************************************************************************** + * Name: poll + * + * Description: + * poll() waits for one of a set of file descriptors to become ready to + * perform I/O. If none of the events requested (and no error) has + * occurred for any of the file descriptors, then poll() blocks until + * one of the events occurs. + * + * Input Parameters: + * fds - List of structures describing file descriptors to be monitored + * nfds - The number of entries in the list + * timeout - Specifies an upper limit on the time for which poll() will + * block in milliseconds. A negative value of timeout means an infinite + * timeout. + * + * Returned Value: + * On success, the number of structures that have non-zero revents fields. + * A value of 0 indicates that the call timed out and no file descriptors + * were ready. On error, -1 is returned, and errno is set appropriately: + * + * EBADF - An invalid file descriptor was given in one of the sets. + * EFAULT - The fds address is invalid + * EINTR - A signal occurred before any requested event. + * EINVAL - The nfds value exceeds a system limit. + * ENOMEM - There was no space to allocate internal data structures. + * ENOSYS - One or more of the drivers supporting the file descriptor + * does not support the poll method. + * + ****************************************************************************/ + +int poll(struct pollfd *fds, nfds_t nfds, int timeout) +{ + poll_table wait_table; + poll_wait_entry wait_entry; + size_t start_ticks = 0; + int millisecs_left; + int ret = OK; + int count = 0; + int err = 0; + int temp = 0; + + wait_table.wait = &wait_entry; + wait_table.wait->table = NULL; + wait_table.wait->inline_index = 0; + if (sem_init(&wait_table.wait->sem, 0, 0) < 0) + { + set_errno(ENOMEM); + return -1; + } + + /* set wait flag */ + + set_add_poll_wait_flag(wait_table.wait, ((timeout == 0) ? false : true)); + + count = query_fds(fds, nfds, &wait_table); + if (count > 0) + { + ret = OK; + goto out; + } + else if (count < 0) + { + goto out; + } + + /* clear wait flag if no fd got on first query */ + + set_add_poll_wait_flag(wait_table.wait, false); + + if (timeout > 0) + { + start_ticks = LOS_TickCountGet(); + } + + millisecs_left = timeout; + while (count == 0) + { + if (timeout < 0) + { + ret = wait_sem_time(wait_table.wait, (const struct timespec *)NULL); + } + else if (timeout == 0 || millisecs_left <= 0) + { + ret = OK; + goto out; + } + else if (millisecs_left > 0) + { + struct timespec wait_time; + UINT64 curr_ticks; + int millisecs_last; + + curr_ticks = LOS_TickCountGet(); + millisecs_last = (curr_ticks - start_ticks) * MSEC_PER_SEC / LOSCFG_BASE_CORE_TICK_PER_SECOND; + if (millisecs_last >= timeout) + { + ret = OK; + goto out; + } + else + { + millisecs_left = timeout - millisecs_last; + } + + wait_time.tv_sec = millisecs_left / MSEC_PER_SEC; + wait_time.tv_nsec = (millisecs_left - MSEC_PER_SEC * wait_time.tv_sec) * NSEC_PER_MSEC; + + ret = wait_sem_time(wait_table.wait, &wait_time); + if (ret < 0) + { + err = get_errno(); + + if (err == ETIMEDOUT) + { + ret = OK; + } + else + { + ret = -err; + } + } + } + + if (ret < 0) + { + goto out; + } + count = query_fds(fds, nfds, &wait_table); + if (err == ETIMEDOUT) + { + break; + } + } + +out: + temp = get_errno(); + if (destroy_poll_wait(wait_table.wait) < 0) + { + temp = get_errno(); + } + + if (temp != 0) + { + set_errno(temp); + } + if (ret < 0) + { + set_errno(-ret); + return -1; + } + + return count; +} + +#endif /* CONFIG_DISABLE_POLL */ diff --git a/fs/vfs/fs_pread.c b/fs/vfs/fs_pread.c new file mode 100755 index 0000000..eff48af --- /dev/null +++ b/fs/vfs/fs_pread.c @@ -0,0 +1,167 @@ +/**************************************************************************** + * fs/vfs/fs_pread.c + * + * Copyright (C) 2014, 2016-2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/types.h" +#include "unistd.h" +#include "errno.h" + +#include "fs/fs.h" +#include "fs/file.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: file_pread + * + * Description: + * Equivalent to the standard pread function except that is accepts a + * struct file instance instead of a file descriptor. Currently used + * only by aio_read(); + * + ****************************************************************************/ + +ssize_t file_pread(FAR struct file *filep, FAR void *buf, size_t nbytes, + off_t offset) +{ + off_t savepos; + off_t pos; + ssize_t ret; + int errcode; + + /* Perform the seek to the current position. This will not move the + * file pointer, but will return its current setting + */ + + savepos = file_seek(filep, 0, SEEK_CUR); + if (savepos == (off_t)-1) + { + /* file_seek might fail if this if the media is not seekable */ + + return VFS_ERROR; + } + + /* Then seek to the correct position in the file */ + + pos = file_seek(filep, offset, SEEK_SET); + if (pos == (off_t)-1) + { + /* This might fail is the offset is beyond the end of file */ + + return VFS_ERROR; + } + + /* Then perform the read operation */ + + ret = file_read(filep, buf, nbytes); + errcode = get_errno(); + + /* Restore the file position */ + + pos = file_seek(filep, savepos, SEEK_SET); + if (pos == (off_t)-1 && ret >= 0) + { + /* This really should not fail */ + + return VFS_ERROR; + } + + if (errcode != 0) + { + set_errno(errcode); + } + return ret; +} + +/**************************************************************************** + * Name: pread + * + * Description: + * The pread() function performs the same action as read(), except that it + * reads from a given position in the file without changing the file + * pointer. The first three arguments to pread() are the same as read() + * with the addition of a fourth argument offset for the desired position + * inside the file. An attempt to perform a pread() on a file that is + * incapable of seeking results in an error. + * + * NOTE: This function could have been wholly implemented within libc but + * it is not. Why? Because if pread were implemented in libc, it would + * require four system calls. If it is implemented within the kernel, + * only three. + * + * Input Parameters: + * file File structure instance + * buf User-provided to save the data + * nbytes The maximum size of the user-provided buffer + * offset The file offset + * + * Returned Value: + * The positive non-zero number of bytes read on success, 0 on if an + * end-of-file condition, or -1 on failure with errno set appropriately. + * See read() return values + * + ****************************************************************************/ + +ssize_t pread(int fd, FAR void *buf, size_t nbytes, off_t offset) +{ + FAR struct file *filep; + + /* Get the file structure corresponding to the file descriptor. */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + set_errno(-ret); + return (ssize_t)VFS_ERROR; + } + + if (filep->f_oflags & O_DIRECTORY) + { + set_errno(EBADF); + return (ssize_t)VFS_ERROR; + } + + /* Let file_pread do the real work */ + + return file_pread(filep, buf, nbytes, offset); +} diff --git a/fs/vfs/fs_pread64.c b/fs/vfs/fs_pread64.c new file mode 100755 index 0000000..b66b556 --- /dev/null +++ b/fs/vfs/fs_pread64.c @@ -0,0 +1,166 @@ +/**************************************************************************** + * fs/vfs/fs_pread.c + * + * Copyright (C) 2014, 2016-2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/types.h" +#include "unistd.h" +#include "errno.h" + +#include "fs/fs.h" +#include "fs/file.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: file_pread64 + * + * Description: + * Equivalent to the standard pread function except that is accepts a + * struct file instance instead of a file descriptor. Currently used + * only by aio_read(); + * + ****************************************************************************/ + +ssize_t file_pread64(FAR struct file *filep, FAR void *buf, size_t nbytes, + off64_t offset) +{ + off64_t savepos; + off64_t pos; + ssize_t ret; + int errcode; + + /* Perform the seek to the current position. This will not move the + * file pointer, but will return its current setting + */ + + savepos = file_seek64(filep, 0, SEEK_CUR); + if (savepos == (off64_t)-1) + { + /* file_seek64 might fail if this if the media is not seekable */ + + return VFS_ERROR; + } + + /* Then seek to the correct position in the file */ + + pos = file_seek64(filep, offset, SEEK_SET); + if (pos == (off64_t)-1) + { + /* This might fail is the offset is beyond the end of file */ + + return VFS_ERROR; + } + + /* Then perform the read operation */ + + ret = file_read(filep, buf, nbytes); + errcode = get_errno(); + + /* Restore the file position */ + + pos = file_seek64(filep, savepos, SEEK_SET); + if (pos == (off64_t)-1 && ret >= 0) + { + /* This really should not fail */ + + return VFS_ERROR; + } + + if (errcode != 0) + { + set_errno(errcode); + } + return ret; +} + +/**************************************************************************** + * Name: pread64 + * + * Description: + * The pread() function performs the same action as read(), except that it + * reads from a given position in the file without changing the file + * pointer. The first three arguments to pread() are the same as read() + * with the addition of a fourth argument offset for the desired position + * inside the file. An attempt to perform a pread() on a file that is + * incapable of seeking results in an error. + * + * NOTE: This function could have been wholly implemented within libc but + * it is not. Why? Because if pread were implemented in libc, it would + * require four system calls. If it is implemented within the kernel, + * only three. + * + * Input Parameters: + * file File structure instance + * buf User-provided to save the data + * nbytes The maximum size of the user-provided buffer + * offset The file offset + * + * Returned Value: + * The positive non-zero number of bytes read on success, 0 on if an + * end-of-file condition, or -1 on failure with errno set appropriately. + * See read() return values + * + ****************************************************************************/ + +ssize_t pread64(int fd, void *buf, size_t nbytes, off64_t offset) +{ + FAR struct file *filep; + + /* Get the file structure corresponding to the file descriptor. */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + return (ssize_t)VFS_ERROR; + } + + if (filep->f_oflags & O_DIRECTORY) + { + set_errno(EBADF); + return VFS_ERROR; + } + + /* Let file_pread do the real work */ + + return file_pread64(filep, buf, nbytes, offset); +} diff --git a/fs/vfs/fs_pwrite.c b/fs/vfs/fs_pwrite.c new file mode 100755 index 0000000..3bc639a --- /dev/null +++ b/fs/vfs/fs_pwrite.c @@ -0,0 +1,171 @@ +/**************************************************************************** + * fs/vfs/fs_pwrite.c + * + * Copyright (C) 2014, 2016-2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/types.h" +#include "unistd.h" +#include "errno.h" + +#include "fs/fs.h" +#include "fs/file.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: file_pwrite + * + * Description: + * Equivalent to the standard pwrite function except that is accepts a + * struct file instance instead of a file descriptor. Currently used + * only by aio_write(); + * + ****************************************************************************/ + +ssize_t file_pwrite(FAR struct file *filep, FAR const void *buf, + size_t nbytes, off_t offset) +{ + off_t savepos; + off_t pos; + ssize_t ret; + int errcode; + + /* Perform the seek to the current position. This will not move the + * file pointer, but will return its current setting + */ + + savepos = file_seek(filep, 0, SEEK_CUR); + if (savepos == (off_t)-1) + { + /* file_seek might fail if this if the media is not seekable */ + + return VFS_ERROR; + } + + /* Then seek to the correct position in the file */ + + pos = file_seek(filep, offset, SEEK_SET); + if (pos == (off_t)-1) + { + /* This might fail is the offset is beyond the end of file */ + + return VFS_ERROR; + } + + /* Then perform the write operation */ + + ret = file_write(filep, buf, nbytes); + errcode = get_errno(); + + /* Restore the file position */ + + pos = file_seek(filep, savepos, SEEK_SET); + if (pos == (off_t)-1 && ret >= 0) + { + /* This really should not fail */ + + return VFS_ERROR; + } + + if (errcode != 0) + { + set_errno(errcode); + } + return ret; +} + +/**************************************************************************** + * Name: pwrite + * + * Description: + * The pwrite() function performs the same action as write(), except that + * it writes into a given position without changing the file pointer. The + * first three arguments to pwrite() are the same as write() with the + * addition of a fourth argument offset for the desired position inside + * the file. + * + * NOTE: This function could have been wholly implemented within libc but + * it is not. Why? Because if pwrite were implemented in libc, it would + * require four system calls. If it is implemented within the kernel, + * only three. + * + * Input Parameters: + * fd file descriptor (or socket descriptor) to write to + * buf Data to write + * nbytes Length of data to write + * + * Returned Value: + * The positive non-zero number of bytes read on success, 0 on if an + * end-of-file condition, or -1 on failure with errno set appropriately. + * See write() return values + * + * Assumptions/Limitations: + * POSIX requires that opening a file with the O_APPEND flag should have no + * effect on the location at which pwrite() writes data. However, on NuttX + * like on Linux, if a file is opened with O_APPEND, pwrite() appends data + * to the end of the file, regardless of the value of offset. + * + ****************************************************************************/ + +ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset) +{ + FAR struct file *filep; + + /* Get the file structure corresponding to the file descriptor. */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + set_errno(-ret); + return (ssize_t)VFS_ERROR; + } + + if (filep->f_oflags & O_DIRECTORY) + { + set_errno(EBADF); + return (ssize_t)VFS_ERROR; + } + + /* Let file_pread do the real work */ + + return file_pwrite(filep, buf, nbytes, offset); +} diff --git a/fs/vfs/fs_pwrite64.c b/fs/vfs/fs_pwrite64.c new file mode 100755 index 0000000..358000d --- /dev/null +++ b/fs/vfs/fs_pwrite64.c @@ -0,0 +1,170 @@ +/**************************************************************************** + * fs/vfs/fs_pwrite.c + * + * Copyright (C) 2014, 2016-2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/types.h" +#include "unistd.h" +#include "errno.h" + +#include "fs/fs.h" +#include "fs/file.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: file_pwrite + * + * Description: + * Equivalent to the standard pwrite function except that is accepts a + * struct file instance instead of a file descriptor. Currently used + * only by aio_write(); + * + ****************************************************************************/ + +static ssize_t file_pwrite64(FAR struct file *filep, FAR const void *buf, + size_t nbytes, off64_t offset) +{ + off64_t savepos; + off64_t pos; + ssize_t ret; + int errcode; + + /* Perform the seek to the current position. This will not move the + * file pointer, but will return its current setting + */ + + savepos = file_seek64(filep, 0, SEEK_CUR); + if (savepos == (off64_t)-1) + { + /* file_seek64 might fail if this if the media is not seekable */ + + return VFS_ERROR; + } + + /* Then seek to the correct position in the file */ + + pos = file_seek64(filep, offset, SEEK_SET); + if (pos == (off64_t)-1) + { + /* This might fail is the offset is beyond the end of file */ + + return VFS_ERROR; + } + + /* Then perform the write operation */ + + ret = file_write(filep, buf, nbytes); + errcode = get_errno(); + + /* Restore the file position */ + + pos = file_seek64(filep, savepos, SEEK_SET); + if (pos == (off64_t)-1 && ret >= 0) + { + /* This really should not fail */ + + return VFS_ERROR; + } + + if (errcode != 0) + { + set_errno(errcode); + } + return ret; +} + +/**************************************************************************** + * Name: pwrite64 + * + * Description: + * The pwrite64() function performs the same action as write(), except that + * it writes into a given position without changing the file pointer. The + * first three arguments to pwrite() are the same as write() with the + * addition of a fourth argument offset for the desired position inside + * the file. + * + * NOTE: This function could have been wholly implemented within libc but + * it is not. Why? Because if pwrite were implemented in libc, it would + * require four system calls. If it is implemented within the kernel, + * only three. + * + * Input Parameters: + * fd file descriptor (or socket descriptor) to write to + * buf Data to write + * nbytes Length of data to write + * + * Returned Value: + * The positive non-zero number of bytes read on success, 0 on if an + * end-of-file condition, or -1 on failure with errno set appropriately. + * See write() return values + * + * Assumptions/Limitations: + * POSIX requires that opening a file with the O_APPEND flag should have no + * effect on the location at which pwrite() writes data. However, on NuttX + * like on Linux, if a file is opened with O_APPEND, pwrite() appends data + * to the end of the file, regardless of the value of offset. + * + ****************************************************************************/ + +ssize_t pwrite64(int fd, FAR const void *buf, size_t nbytes, off64_t offset) +{ + FAR struct file *filep; + + /* Get the file structure corresponding to the file descriptor. */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + return (ssize_t)VFS_ERROR; + } + + if (filep->f_oflags & O_DIRECTORY) + { + set_errno(EBADF); + return VFS_ERROR; + } + + /* Let file_pread do the real work */ + + return file_pwrite64(filep, buf, nbytes, offset); +} diff --git a/fs/vfs/fs_read.c b/fs/vfs/fs_read.c new file mode 100755 index 0000000..253ec4d --- /dev/null +++ b/fs/vfs/fs_read.c @@ -0,0 +1,234 @@ +/**************************************************************************** + * fs/vfs/fs_read.c + * + * Copyright (C) 2007-2009, 2012-2014, 2016-2017 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "sys/types.h" +#include "sys/socket.h" +#include "console.h" +#include "unistd.h" +#include "fcntl.h" +#include "sched.h" +#include "assert.h" +#include "errno.h" +#include "user_copy.h" +#include "inode/inode.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: file_read + * + * Description: + * file_read() is an interanl OS interface. It is functionally similar to + * the standard read() interface except: + * + * - It does not modify the errno variable, + * - It is not a cancellation point, + * - It does not handle socket descriptors, and + * - It accepts a file structure instance instead of file descriptor. + * + * Input Parameters: + * filep - File structure instance + * buf - User-provided to save the data + * nbytes - The maximum size of the user-provided buffer + * + * Returned Value: + * The positive non-zero number of bytes read on success, 0 on if an + * end-of-file condition, or a negated errno value on any failure. + * + ****************************************************************************/ + +ssize_t file_read(FAR struct file *filep, FAR void *buf, size_t nbytes) +{ + FAR struct inode *inode = NULL; + int ret = -EBADF; + + DEBUGASSERT(filep); + inode = filep->f_inode; + + if (buf == NULL) + { + ret = -EFAULT; + } + + /* Was this file opened for read access? */ + + else if (((unsigned int)(filep->f_oflags) & O_ACCMODE) == O_WRONLY) + { + /* No.. File is not read-able */ + + ret = -EACCES; + } + + /* Is a driver or mountpoint registered? If so, does it support the read + * method? + */ + + else if (inode && inode->u.i_ops && inode->u.i_ops->read) + { + /* Yes.. then let it perform the read. NOTE that for the case of the + * mountpoint, we depend on the read methods being identical in + * signature and position in the operations vtable. + */ + + ret = (int)inode->u.i_ops->read(filep, (char *)buf, (size_t)nbytes); + } + + /* If an error occurred, set errno and return -1 (ERROR) */ + + if (ret < 0) + { + set_errno(-ret); + return VFS_ERROR; + } + + /* Otherwise, return the number of bytes read */ + + return ret; +} + +/**************************************************************************** + * Name: read + * + * Description: + * The standard, POSIX read interface. + * + * Input Parameters: + * fd - File descriptor to read from + * buf - User-provided to save the data + * nbytes - The maximum size of the user-provided buffer + * + * Returned Value: + * The positive non-zero number of bytes read on success, 0 on if an + * end-of-file condition, or -1 on failure with errno set appropriately. + * + ****************************************************************************/ + +ssize_t read(int fd, FAR void *buf, size_t nbytes) +{ + /* Did we get a valid file descriptor? */ + +#if CONFIG_NFILE_DESCRIPTORS > 0 + FAR struct file *filep = NULL; + + if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) +#endif + { + /* No.. If networking is enabled, read() is the same as recv() with + * the flags parameter set to zero. + */ + +#if defined(LOSCFG_NET_LWIP_SACK) + FAR void *bufbak = buf; + ssize_t ret; + if (LOS_IsUserAddress((VADDR_T)(uintptr_t)buf)) + { + if (buf != NULL && nbytes > 0) + { + buf = malloc(nbytes); + if (buf == NULL) + { + set_errno(ENOMEM); + return VFS_ERROR; + } + } + } + ret = recv(fd, buf, nbytes, 0); + if (ret > 0 && buf != bufbak) + { + if (LOS_ArchCopyToUser(bufbak, buf, ret) != 0) + { + /* data lost here */ + set_errno(EFAULT); + ret = VFS_ERROR; + } + } + if (buf != bufbak) + { + free(buf); + } + return ret; +#else + /* No networking... it is a bad descriptor in any event */ + + set_errno(EBADF); + return VFS_ERROR; +#endif + } + +#if CONFIG_NFILE_DESCRIPTORS > 0 + else + { + if (fd <= STDERR_FILENO && fd >= STDIN_FILENO) /* fd : [0,2] */ + { + fd = ConsoleUpdateFd(); + if (fd < 0) + { + set_errno(EBADF); + return VFS_ERROR; + } + } + + + /* The descriptor is in a valid range to file descriptor... do the + * read. First, get the file structure. + */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + return VFS_ERROR; + } + + if (filep->f_oflags & O_DIRECTORY) + { + set_errno(EBADF); + return VFS_ERROR; + } + + /* Then let file_read do all of the work */ + + return file_read(filep, buf, nbytes); + } +#endif +} diff --git a/fs/vfs/fs_rename.c b/fs/vfs/fs_rename.c new file mode 100755 index 0000000..143324a --- /dev/null +++ b/fs/vfs/fs_rename.c @@ -0,0 +1,314 @@ +/**************************************************************************** + * fs/vfs/fs_rename.c + * + * Copyright (C) 2007-2009, 2014, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "stdio.h" +#include "errno.h" +#include "fs/fs.h" +#include "stdlib.h" +#include "inode/inode.h" +#include "fs_other.h" +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#undef FS_HAVE_WRITABLE_MOUNTPOINT +#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \ + CONFIG_NFILE_STREAMS > 0 +# define FS_HAVE_WRITABLE_MOUNTPOINT 1 +#endif + +#undef FS_HAVE_PSEUDOFS_OPERATIONS +#if !defined(CONFIG_DISABLE_PSEUDOFS_OPERATIONS) && CONFIG_NFILE_STREAMS > 0 +# define FS_HAVE_PSEUDOFS_OPERATIONS 1 +#endif + +#undef FS_HAVE_RENAME +#if defined(FS_HAVE_WRITABLE_MOUNTPOINT) || defined(FS_HAVE_PSEUDOFS_OPERATIONS) +# define FS_HAVE_RENAME 1 +#endif + +#ifdef FS_HAVE_RENAME + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int do_rename(int oldfd, FAR const char *oldpath, int newfd, FAR const char *newpath) +{ + FAR struct inode *oldinode; + FAR struct inode *newinode; + const char *oldrelpath = NULL; + char *fulloldpath = NULL; + char *fulloldpath_bak = NULL; + char *fullnewpath = NULL; + char *fullnewpath_bak = NULL; +#ifndef CONFIG_DISABLE_MOUNTPOINT + const char *newrelpath = NULL; +#endif + int errcode = ENOERR; + int ret; + struct inode_search_s old_desc, new_desc; + + /* Ignore paths that are interpreted as the root directory which has no name + * and cannot be moved + */ + + if (!oldpath || *oldpath == '\0' || + !newpath || *newpath == '\0') + { + errcode = EINVAL; + goto errout; + } + + ret = vfs_normalize_pathat(oldfd, oldpath, &fulloldpath); + if (ret < 0) + { + errcode = -ret; + goto errout; + } + fulloldpath_bak = fulloldpath; + + ret = vfs_normalize_pathat(newfd, newpath, &fullnewpath); + if (ret < 0) + { + errcode = -ret; + goto errout_with_path; + } + fullnewpath_bak = fullnewpath; + + /* Get an inode that includes the oldpath */ + SETUP_SEARCH(&old_desc, fulloldpath, false); + ret = inode_find(&old_desc); + if (ret < 0) + { + errcode = EACCES; + free(fullnewpath_bak); + goto errout_with_path; + } + oldinode = old_desc.node; + oldrelpath = old_desc.relpath; + +#ifndef CONFIG_DISABLE_MOUNTPOINT + /* Verify that the old inode is a valid mountpoint. */ + + if (INODE_IS_MOUNTPT(oldinode) && oldinode->u.i_mops) + { + /* Get an inode for the new relpath -- it should like on the same + * mountpoint + */ + SETUP_SEARCH(&new_desc, fullnewpath, false); + ret = inode_find(&new_desc); + if (ret < 0) + { + errcode = EACCES; + goto errout_with_oldinode; + } + newinode = new_desc.node; + newrelpath = new_desc.relpath; + + /* Verify that the two paths lie on the same mountpoint inode */ + + if (oldinode != newinode) + { + errcode = EXDEV; + goto errout_with_newinode; + } + + /* Perform the rename operation using the relative paths + * at the common mountpoint. + */ + + if (oldinode->u.i_mops->rename) + { + ret = oldinode->u.i_mops->rename(oldinode, oldrelpath, newrelpath); + if (ret < 0) + { + errcode = -ret; + goto errout_with_newinode; + } + } + else + { + errcode = ENOSYS; + goto errout_with_newinode; + } + + /* Successfully renamed */ + + inode_release(newinode); + } + else +#endif +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS + { + /* Create a new, empty inode at the destination location */ + if (VfsPermissionCheck(old_desc.parent->i_uid, old_desc.parent->i_gid, + old_desc.parent->i_mode, EXEC_OP | WRITE_OP)) + { + ret = EACCES; + goto errout_with_oldinode; + } + SETUP_SEARCH(&new_desc, fullnewpath, false); + ret = inode_find(&new_desc); + if (ret < 0) + { + errcode = EACCES; + goto errout_with_oldinode; + } + newinode = new_desc.node; + newrelpath = new_desc.relpath; + + if (VfsPermissionCheck(new_desc.parent->i_uid, new_desc.parent->i_gid, + new_desc.parent->i_mode, EXEC_OP | WRITE_OP)) + { + ret = EACCES; + goto errout_with_oldinode; + } + inode_semtake(); + ret = inode_reserve(fullnewpath, &newinode); + if (ret < 0) + { + /* It is an error if a node at newpath already exists in the tree + * OR if we fail to allocate memory for the new inode (and possibly + * any new intermediate path segments). + */ + + inode_semgive(); + errcode = EEXIST; + goto errout_with_oldinode; + } + + /* Copy the inode state from the old inode to the newly allocated inode */ + + newinode->i_child = oldinode->i_child; /* Link to lower level inode */ + newinode->i_flags = oldinode->i_flags; /* Flags for inode */ + newinode->u.i_ops = oldinode->u.i_ops; /* Inode operations */ +#ifdef LOSCFG_FILE_MODE + newinode->i_mode = oldinode->i_mode; /* Access mode flags */ +#endif + newinode->i_private = oldinode->i_private; /* Per inode driver private data */ + + /* We now have two copies of the inode. One with a reference count of + * zero (the new one), and one that may have multiple references + * including one by this logic (the old one) + * + * Remove the old inode. Because we hold a reference count on the + * inode, it will not be deleted now. It will be deleted when all of + * the references to to the inode have been released (perhaps when + * inode_release() is called below). inode_remove() should return + * -EBUSY to indicate that the inode was not deleted now. + */ + + ret = inode_remove(fulloldpath); + if (ret < 0 && ret != -EBUSY) + { + /* Remove the new node we just recreated */ + + (void)inode_remove(fullnewpath); + inode_semgive(); + + errcode = -ret; + goto errout_with_oldinode; + } + + /* Remove all of the children from the unlinked inode */ + + oldinode->i_child = NULL; + inode_semgive(); + } +#else + { + errcode = ENXIO; + goto errout_with_oldinode; + } +#endif + + /* rename file page cache mapping if necessary */ + + rename_mapping(fulloldpath, fullnewpath); + + /* Successfully renamed */ + + inode_release(oldinode); + free(fulloldpath_bak); + free(fullnewpath_bak); + + return OK; + +#ifndef CONFIG_DISABLE_MOUNTPOINT +errout_with_newinode: + inode_release(newinode); +#endif +errout_with_oldinode: + inode_release(oldinode); + free(fullnewpath_bak); +errout_with_path: + free(fulloldpath_bak); +errout: + set_errno(errcode); + return VFS_ERROR; +} + +/**************************************************************************** + * Name: rename + * + * Description: Rename a file managed a mountpoint + * + ****************************************************************************/ + +int rename(FAR const char *oldpath, FAR const char *newpath) +{ + return do_rename(AT_FDCWD, oldpath, AT_FDCWD, newpath); +} + +/**************************************************************************** + * Name: renameat + * + * Description: Rename a file managed a mountpoint with relatively fds. + * + ****************************************************************************/ + +int renameat(int oldfd, FAR const char *oldpath, int newdfd, FAR const char *newpath) +{ + return do_rename(oldfd, oldpath, newdfd, newpath); +} + +#endif /* FS_HAVE_RENAME */ diff --git a/fs/vfs/fs_rmdir.c b/fs/vfs/fs_rmdir.c new file mode 100755 index 0000000..00c61b5 --- /dev/null +++ b/fs/vfs/fs_rmdir.c @@ -0,0 +1,235 @@ +/**************************************************************************** + * fs/vfs/fs_rmdir.c + * + * Copyright (C) 2007-2009, 2014, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "unistd.h" +#include "errno.h" +#include "fs/fs.h" +#include "stdlib.h" +#include "inode/inode.h" +#include "sys/stat.h" +#include "string.h" +#include "fs_other.h" +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#undef FS_HAVE_WRITABLE_MOUNTPOINT +#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \ + CONFIG_NFILE_STREAMS > 0 +# define FS_HAVE_WRITABLE_MOUNTPOINT 1 +#endif + +#undef FS_HAVE_PSEUDOFS_OPERATIONS +#if !defined(CONFIG_DISABLE_PSEUDOFS_OPERATIONS) && CONFIG_NFILE_STREAMS > 0 +# define FS_HAVE_PSEUDOFS_OPERATIONS 1 +#endif + +#undef FS_HAVE_RMDIR +#if defined(FS_HAVE_WRITABLE_MOUNTPOINT) || defined(FS_HAVE_PSEUDOFS_OPERATIONS) +# define FS_HAVE_RMDIR 1 +#endif + +#ifdef FS_HAVE_RMDIR + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: do_rmdir + * + * Description: Remove a file managed a mountpoint + * + ****************************************************************************/ + +int do_rmdir(int dirfd, FAR const char *pathname) +{ + FAR struct inode *inode; + const char *relpath = NULL; + int errcode; + char *fullpath = NULL; + char *relativepath = NULL; + int ret; + struct inode_search_s desc; + + /* Get relative path by dirfd*/ + ret = get_path_from_fd(dirfd, &relativepath); + if (ret < 0) + { + errcode = ret; + goto errout; + } + + ret = vfs_normalize_path((const char *)relativepath, pathname, &fullpath); + if (relativepath) + { + free(relativepath); + } + + if (ret < 0) + { + errcode = -ret; + goto errout; + } + + /* Get an inode for this file. inode_find() automatically increments the + * reference count on the inode if one is found. + */ + SETUP_SEARCH(&desc, fullpath, false); + ret = inode_find(&desc); + if (ret < 0) + { + free(fullpath); + errcode = EACCES; + goto errout; + } + inode = desc.node; + relpath = desc.relpath; + +#ifndef CONFIG_DISABLE_MOUNTPOINT + /* Check if the inode is a valid mountpoint. */ + + if (INODE_IS_MOUNTPT(inode) && inode->u.i_mops) + { + /* Perform the rmdir operation using the relative path + * from the mountpoint. + */ + + if (inode->u.i_mops->rmdir) + { + if (!strlen(relpath)) + { + errcode = EPERM; + goto errout_with_inode; + } + + ret = inode->u.i_mops->rmdir(inode, relpath); + if (ret < 0) + { + errcode = -ret; + goto errout_with_inode; + } + } + else + { + errcode = ENOSYS; + goto errout_with_inode; + } + } + else +#endif + +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS + /* If this is a "dangling" pseudo-directory node (i.e., it has no + * operations) then rmdir should remove the node. + */ + + if (!inode->u.i_ops) + { + /* If the directory inode has children, however, then it cannot be + * removed. + */ + + if (inode->i_child) + { + errcode = ENOTEMPTY; + goto errout_with_inode; + } + + /* Remove the inode. NOTE: Because we hold a reference count on the + * inode, it will not be deleted now. But probably when inode_release() + * is called below. inode_remove should return -EBUSY to indicate that + * the inode was not deleted now. + */ + if (VfsPermissionCheck(desc.parent->i_uid, desc.parent->i_gid, desc.parent->i_mode, EXEC_OP | WRITE_OP)) + { + errcode = EACCES; + goto errout_with_inode; + } + inode_semtake(); + ret = inode_remove(fullpath); + inode_semgive(); + + if (ret < 0 && ret != -EBUSY) + { + errcode = -ret; + goto errout_with_inode; + } + } + else + { + errcode = ENOTDIR; + goto errout_with_inode; + } +#else + { + errcode = ENXIO; + goto errout_with_inode; + } +#endif + + /* Successfully removed the directory */ + + inode_release(inode); + free(fullpath); + return OK; + +errout_with_inode: + inode_release(inode); + free(fullpath); +errout: + set_errno(errcode); + return VFS_ERROR; +} + +/**************************************************************************** + * Name: rmdir + * + * Description: Remove a file managed a mountpoint + * + ****************************************************************************/ + +int rmdir(FAR const char *pathname) +{ + return do_rmdir(AT_FDCWD, pathname); +} + +#endif /* FS_HAVE_RMDIR */ diff --git a/fs/vfs/fs_select.c b/fs/vfs/fs_select.c new file mode 100755 index 0000000..9baf322 --- /dev/null +++ b/fs/vfs/fs_select.c @@ -0,0 +1,340 @@ +/**************************************************************************** + * fs/vfs/fs_select.c + * + * Copyright (C) 2008-2009, 2012-2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/select.h" + +#include "string.h" +#include "unistd.h" +#include "poll.h" +#include "assert.h" +#include "errno.h" +#include "debug.h" + +#include "stdlib.h" +#include "fs/fs.h" + +#include "los_syscall.h" + +#include "inode/inode.h" +#ifndef CONFIG_DISABLE_POLL + + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define POLL_IN_SET (POLLIN | POLLRDNORM | POLLRDBAND | POLLHUP | POLLERR) +#define POLL_OUT_SET (POLLOUT | POLLWRBAND | POLLWRNORM | POLLERR) +#define POLL_EX_SET (POLLPRI) + +/* pollfd count in stack, optimization in order to avoid small memory allocation */ + +#define POLL_STACK_CNT 5 + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ +extern unsigned int sleep(unsigned int seconds); + +/**************************************************************************** + * Name: select + * + * Description: + * select() allows a program to monitor multiple file descriptors, waiting + * until one or more of the file descriptors become "ready" for some class + * of I/O operation (e.g., input possible). A file descriptor is + * considered ready if it is possible to perform the corresponding I/O + * operation (e.g., read(2)) without blocking. + * + * NOTE: poll() is the fundamental API for performing such monitoring + * operation under NuttX. select() is provided for compatibility and + * is simply a layer of added logic on top of poll(). As such, select() + * is more wasteful of resources and poll() is the recommended API to be + * used. + * + * Input Parameters: + * nfds - the maximum fd number (+1) of any descriptor in any of the + * three sets. + * readfds - the set of descriptions to monitor for read-ready events + * writefds - the set of descriptions to monitor for write-ready events + * exceptfds - the set of descriptions to monitor for error events + * timeout - Return at this time if none of these events of interest + * occur. + * + * Returned Value: + * 0: Timer expired + * >0: The number of bits set in the three sets of descriptors + * -1: An error occurred (errno will be set appropriately) + * + ****************************************************************************/ + +int do_select(int nfds, fd_set *readfds, fd_set *writefds, + fd_set *exceptfds, struct timeval *timeout, PollFun poll) +{ + struct pollfd *pollset = NULL; + struct pollfd pfd[POLL_STACK_CNT]; + int pfd_alloc_flag = 0; + int fd; + int npfds; + int msec; + int ndx; + int ret; + + if (nfds < 0) + { + set_errno(EINVAL); + return VFS_ERROR; + } + + /* How many pollfd structures do we need to allocate? */ + + /* Initialize the descriptor list for poll() */ + + for (fd = 0, npfds = 0; fd < nfds; fd++) + { + /* Check if any monitor operation is requested on this fd */ + + if ((readfds && FD_ISSET(fd, readfds)) || + (writefds && FD_ISSET(fd, writefds)) || + (exceptfds && FD_ISSET(fd, exceptfds))) + { + /* Yes.. increment the count of pollfds structures needed */ + + npfds++; + } + } + + /* Allocate the descriptor list for poll() */ + + if (npfds != 0) + { + /* use stack variable in order to avoid small memory allocation. */ + + if (npfds <= POLL_STACK_CNT) + { + pollset = pfd; + (void)memset_s(pollset, npfds * sizeof(struct pollfd), 0, npfds * sizeof(struct pollfd)); + } + else + { + pollset = (struct pollfd *)zalloc(npfds * sizeof(struct pollfd)); + if (pollset == NULL) + { + set_errno(ENOMEM); + return VFS_ERROR; + } + pfd_alloc_flag = 1; + } + } + else + { + /* If the readfds, writefds, and exceptfds arguments are all null pointers and + * the timeout argument is not a null pointer, the select() function shall block for + * the time specified. If the readfds, writefds, and exceptfds arguments are all + * null pointers and the timeout argument is a null pointer, this is NOT permitted + * as LiteOS doesn't support Signal machanism, so select() can't come back anymore. + */ + + if (timeout != NULL) + { + /* 1000000 : Convert seconds to microseconds. */ + + if ((long long)timeout->tv_sec * 1000000 > 0xffffffff) + { + (void)sleep(timeout->tv_sec); + } + else + { + (void)usleep(timeout->tv_sec * 1000000 + timeout->tv_usec); + } + return OK; + } + else + { + set_errno(EINVAL); + return VFS_ERROR; + } + } + + /* Initialize the descriptor list for poll() */ + + for (fd = 0, ndx = 0; fd < nfds; fd++) + { + int incr = 0; + + /* The readfs set holds the set of FDs that the caller can be assured + * of reading from without blocking. Note that POLLHUP is included as + * a read-able condition. POLLHUP will be reported at the end-of-file + * or when a connection is lost. In either case, the read() can then + * be performed without blocking. + */ + + if (readfds && FD_ISSET(fd, readfds)) + { + pollset[ndx].fd = fd; + pollset[ndx].events |= (POLLIN | POLLRDNORM); + incr = 1; + } + + /* The writefds set holds the set of FDs that the caller can be assured + * of writing to without blocking. + */ + + if (writefds && FD_ISSET(fd, writefds)) + { + pollset[ndx].fd = fd; + pollset[ndx].events |= (POLLOUT | POLLWRNORM); + incr = 1; + } + + /* The exceptfds set holds the set of FDs that are watched for exceptions */ + + if (exceptfds && FD_ISSET(fd, exceptfds)) + { + pollset[ndx].fd = fd; + incr = 1; + } + + ndx += incr; + } + + DEBUGASSERT(ndx == npfds); + + /* Convert the timeout to milliseconds */ + + if (timeout) + { + /* Calculate the timeout in milliseconds */ + + msec = timeout->tv_sec * 1000 + timeout->tv_usec / 1000; + } + else + { + /* Any negative value of msec means no timeout */ + + msec = -1; + } + + /* Then let poll do all of the real work. */ + + ret = poll(pollset, npfds, msec); + + /* Now set up the return values */ + + if (readfds) + { + (void)memset_s(readfds, sizeof(fd_set), 0, sizeof(fd_set)); + } + + if (writefds) + { + (void)memset_s(writefds, sizeof(fd_set), 0, sizeof(fd_set)); + } + + if (exceptfds) + { + (void)memset_s(exceptfds, sizeof(fd_set), 0, sizeof(fd_set)); + } + + /* Convert the poll descriptor list back into selects 3 bitsets */ + + if (ret > 0) + { + ret = 0; + for (ndx = 0; ndx < npfds; ndx++) + { + /* Check for read conditions. Note that POLLHUP is included as a + * read condition. POLLHUP will be reported when no more data will + * be available (such as when a connection is lost). In either + * case, the read() can then be performed without blocking. + */ + + if (readfds) + { + if (pollset[ndx].revents & POLL_IN_SET) + { + FD_SET(pollset[ndx].fd, readfds); + ret++; + } + } + + /* Check for write conditions */ + + if (writefds) + { + if (pollset[ndx].revents & POLL_OUT_SET) + { + FD_SET(pollset[ndx].fd, writefds); + ret++; + } + } + + /* Check for exceptions */ + + if (exceptfds) + { + if (pollset[ndx].revents & POLL_EX_SET) + { + FD_SET(pollset[ndx].fd, exceptfds); + ret++; + } + } + } + } + + if (pfd_alloc_flag) + { + free(pollset); + } + return ret; +} + +int select(int nfds, fd_set *readfds, fd_set *writefds, + fd_set *exceptfds, struct timeval *timeout) +{ + return do_select(nfds, readfds, writefds, exceptfds, timeout, poll); +} + +#endif /* CONFIG_DISABLE_POLL */ diff --git a/fs/vfs/fs_sendfile.c b/fs/vfs/fs_sendfile.c new file mode 100755 index 0000000..e4fc6e7 --- /dev/null +++ b/fs/vfs/fs_sendfile.c @@ -0,0 +1,290 @@ +/**************************************************************************** + * fs/vfs/fs_sendfile.c + * + * Copyright (C) 2007, 2009, 2011, 2013, 2017-2018 Gregory Nutt. All + * rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include +#include +#include +#include +#include + +#include + +#ifndef CONFIG_LIB_SENDFILE_BUFSIZE +# define CONFIG_LIB_SENDFILE_BUFSIZE 512 +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: sendfile + * + * Description: + * sendfile() copies data between one file descriptor and another. + * Used with file descriptors it basically just wraps a sequence of + * reads() and writes() to perform a copy. + * + * If the destination descriptor is a socket, it gives a better + * performance than simple reds() and writes(). The data is read directly + * into the net buffer and the whole tcp window is filled if possible. + * + * NOTE: This interface is *not* specified in POSIX.1-2001, or other + * standards. The implementation here is very similar to the Linux + * sendfile interface. Other UNIX systems implement sendfile() with + * different semantics and prototypes. sendfile() should not be used + * in portable programs. + * + * Input Parameters: + * infd - A file (or socket) descriptor opened for reading + * outfd - A descriptor opened for writing. + * offset - If 'offset' is not NULL, then it points to a variable + * holding the file offset from which sendfile() will start + * reading data from 'infd'. When sendfile() returns, this + * variable will be set to the offset of the byte following + * the last byte that was read. If 'offset' is not NULL, + * then sendfile() does not modify the current file offset of + * 'infd'; otherwise the current file offset is adjusted to + * reflect the number of bytes read from 'infd.' + * + * If 'offset' is NULL, then data will be read from 'infd' + * starting at the current file offset, and the file offset + * will be updated by the call. + * count - The number of bytes to copy between the file descriptors. + * + * Returned Value: + * If the transfer was successful, the number of bytes written to outfd is + * returned. On error, -1 is returned, and errno is set appropriately. + * There error values are those returned by read() or write() plus: + * + * EINVAL - Bad input parameters. + * ENOMEM - Could not allocated an I/O buffer + * + ****************************************************************************/ + +ssize_t sendfile(int outfd, int infd, off_t *offset, size_t count) +{ + FAR uint8_t *iobuffer; + FAR uint8_t *wrbuffer; + off_t startpos = 0; + ssize_t nbytesread; + ssize_t nbyteswritten; + size_t ntransferred; + bool endxfr; + + /* Get the current file position. */ + + if (offset) + { + /* Use lseek to get the current file position */ + + startpos = lseek(infd, 0, SEEK_CUR); + if (startpos == (off_t)-1) + { + return VFS_ERROR; + } + + /* Use lseek again to set the new file position */ + + if (lseek(infd, *offset, SEEK_SET) == (off_t)-1) + { + return VFS_ERROR; + } + } + + /* Allocate an I/O buffer */ + + iobuffer = (FAR void *)malloc(CONFIG_LIB_SENDFILE_BUFSIZE); + if (!iobuffer) + { + set_errno(ENOMEM); + return VFS_ERROR; + } + + /* Now transfer 'count' bytes from the infd to the outfd */ + + for (ntransferred = 0, endxfr = false; ntransferred < count && !endxfr; ) + { + /* Loop until the read side of the transfer comes to some conclusion */ + + do + { + /* Read a buffer of data from the infd */ + + nbytesread = read(infd, iobuffer, CONFIG_LIB_SENDFILE_BUFSIZE); + + /* Check for end of file */ + + if (nbytesread == 0) + { + /* End of file. Break out and return current number of bytes + * transferred. + */ + + endxfr = true; + break; + } + + /* Check for a read ERROR. EINTR is a special case. This function + * should break out and return an error if EINTR is returned and + * no data has been transferred. But what should it do if some + * data has been transferred? I suppose just continue? + */ + + else if (nbytesread < 0) + { + int errcode = get_errno(); + + /* EINTR is not an error (but will still stop the copy) */ + + if (errcode != EINTR || ntransferred == 0) + { + /* Read error. Break out and return the error condition. */ + + set_errno(errcode); + ntransferred = VFS_ERROR; + endxfr = true; + break; + } + } + } + while (nbytesread < 0); + + /* Was anything read? */ + + if (!endxfr) + { + /* Yes.. Loop until the read side of the transfer comes to some + * conclusion. + */ + + wrbuffer = iobuffer; + do + { + /* Write the buffer of data to the outfd */ + + nbyteswritten = write(outfd, wrbuffer, nbytesread); + + /* Check for a complete (or parial) write. write() should not + * return zero. + */ + + if (nbyteswritten >= 0) + { + /* Advance the buffer pointer and decrement the number of bytes + * remaining in the iobuffer. Typically, nbytesread will now + * be zero. + */ + + wrbuffer += nbyteswritten; + nbytesread -= nbyteswritten; + + /* Increment the total number of bytes successfully transferred. */ + + ntransferred += nbyteswritten; + } + + /* Otherwise an error occurred */ + + else + { + int errcode = get_errno(); + + /* Check for a read ERROR. EINTR is a special case. This + * function should break out and return an error if EINTR + * is returned and no data has been transferred. But what + * should it do if some data has been transferred? I + * suppose just continue? + */ + + if (errcode != EINTR || ntransferred == 0) + { + /* Write error. Break out and return the error + * condition. + */ + + set_errno(errcode); + ntransferred = VFS_ERROR; + endxfr = true; + break; + } + } + } + while (nbytesread > 0); + } + } + + /* Release the I/O buffer */ + + free(iobuffer); + + /* Return the current file position */ + + if (offset) + { + /* Use lseek to get the current file position */ + + off_t curpos = lseek(infd, 0, SEEK_CUR); + if (curpos == (off_t)-1) + { + return VFS_ERROR; + } + + /* Return the current file position */ + + *offset = curpos; + + /* Use lseek again to restore the original file position */ + + if (lseek(infd, startpos, SEEK_SET) == (off_t)-1) + { + return VFS_ERROR; + } + } + + /* Finally return the number of bytes actually transferred (or VFS_ERROR + * if any failure occurred). + */ + + return ntransferred; +} + diff --git a/fs/vfs/fs_stat.c b/fs/vfs/fs_stat.c new file mode 100755 index 0000000..ced32a7 --- /dev/null +++ b/fs/vfs/fs_stat.c @@ -0,0 +1,270 @@ +/**************************************************************************** + * fs/vfs/fs_stat.c + * + * Copyright (C) 2007-2009, 2012, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "errno.h" +#include "sys/stat.h" +#include "string.h" +#include "stdlib.h" +#include "inode/inode.h" +#include "fs_other.h" +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: statpseudo + ****************************************************************************/ + +static inline int statpseudo(FAR struct inode *inode, FAR struct stat *buf) +{ + /* Most of the stat entries just do not apply */ + + (void)memset_s(buf, sizeof(struct stat), 0, sizeof(struct stat)); + + buf->st_mode |= inode->i_mode; + buf->st_uid = inode->i_uid; + buf->st_gid = inode->i_gid; + if (INODE_IS_SPECIAL(inode)) + { +#if defined(CONFIG_FS_NAMED_SEMAPHORES) + if (INODE_IS_NAMEDSEM(inode)) + { + buf->st_mode = S_IFSEM; + } + else +#endif +#if !defined(CONFIG_DISABLE_MQUEUE) + if (INODE_IS_MQUEUE(inode)) + { + buf->st_mode = S_IFMQ; + } + else +#endif +#if defined(CONFIG_FS_SHM) + if (INODE_IS_SHM(inode)) + { + buf->st_mode = S_IFSHM; + } + else +#endif + { + } + } + else if (inode->u.i_ops) + { + /* Determine the type of the inode */ + + if (INODE_IS_MOUNTPT(inode)) + { + buf->st_mode |= S_IFDIR; + } + else if (INODE_IS_BLOCK(inode)) + { + /* What is if also has child inodes? */ + + buf->st_mode |= S_IFBLK; + } + else /* if (INODE_IS_DRIVER(inode)) */ + { + /* What is it if it also has child inodes? */ + + buf->st_mode |= S_IFCHR; + } + } + else + { + /* If it has no operations, then it must just be a intermediate + * node in the inode tree. It is something like a directory. + * We'll say that all pseudo-directories are read-able but not + * write-able. + */ + + buf->st_mode |= S_IFDIR | inode->i_mode; + } + + return OK; +} + +/**************************************************************************** + * Name: statroot + ****************************************************************************/ + +static inline int statroot(FAR struct stat *buf) +{ + /* There is no inode associated with the fake root directory */ + + (void)memset_s(buf, sizeof(struct stat), 0, sizeof(struct stat)); + buf->st_mode = S_IFDIR | S_IROTH | S_IRGRP | S_IRUSR; + return OK; +} + +/**************************************************************************** + * Global Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: stat + * + * Returned Value: + * Zero on success; -1 on failure with errno set: + * + * EACCES Search permission is denied for one of the directories in the + * path prefix of path. + * EFAULT Bad address. + * ENOENT A component of the path path does not exist, or the path is an + * empty string. + * ENOMEM Out of memory + * ENOTDIR A component of the path is not a directory. + * + ****************************************************************************/ + +int stat(FAR const char *path, FAR struct stat *buf) +{ + FAR struct inode *inode; + const char *relpath = NULL; + int ret = OK; + char *fullpath = NULL; + struct inode_search_s desc; + + /* Sanity checks */ + + if (!path || !buf) + { + ret = EFAULT; + goto errout; + } + + if (!path[0]) + { + ret = ENOENT; + goto errout; + } + + ret = vfs_normalize_path((const char *)NULL, path, &fullpath); + if (ret < 0) + { + ret = -ret; + goto errout; + } + + /* Check for the fake root directory (which has no inode) */ + + if (strcmp(fullpath, "/") == 0) + { + free(fullpath); + return statroot(buf); + } + + /* Get an inode for this file */ + SETUP_SEARCH(&desc, fullpath, false); + ret = inode_find(&desc); + if (ret < 0) + { + ret = EACCES; + goto errout_with_path; + } + inode = desc.node; + relpath = desc.relpath; + + /* The way we handle the stat depends on the type of inode that we + * are dealing with. + */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT + if (INODE_IS_MOUNTPT(inode)) + { + /* The node is a file system mointpoint. Verify that the mountpoint + * supports the stat() method + */ + + if (inode->u.i_mops && inode->u.i_mops->stat) + { + /* Perform the stat() operation */ + + ret = inode->u.i_mops->stat(inode, relpath, buf); + } + else + { + ret = ENOSYS; + } + } + else +#endif + { + /* The node is part of the root pseudo file system */ + + if (VfsPermissionCheck(desc.parent->i_uid, desc.parent->i_gid, desc.parent->i_mode, EXEC_OP)) + { + ret = EACCES; + goto errout_with_inode; + } + ret = statpseudo(inode, buf); + } + + /* Check if the stat operation was successful */ + + if (ret < 0) + { + ret = -ret; + goto errout_with_inode; + } + + /* Successfully stat'ed the file */ + + inode_release(inode); + free(fullpath); + return OK; + + /* Failure conditions always set the errno appropriately */ + +errout_with_inode: + inode_release(inode); +errout_with_path: + free(fullpath); +errout: + set_errno(ret); + return VFS_ERROR; +} + +int isatty(int fd) +{ + return 0; +} diff --git a/fs/vfs/fs_statfs.c b/fs/vfs/fs_statfs.c new file mode 100755 index 0000000..f521af3 --- /dev/null +++ b/fs/vfs/fs_statfs.c @@ -0,0 +1,171 @@ +/**************************************************************************** + * fs/vfs/fs_statfs.c + * + * Copyright (C) 2007-2009, 2012, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/statfs.h" +#include "string.h" +#include "sched.h" + +#include "inode/inode.h" +#include "errno.h" +#include "stdlib.h" +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: statpseudo + ****************************************************************************/ + +static inline int statpseudofs(FAR struct inode *inode, FAR struct statfs *buf) +{ + (void)memset_s(buf, sizeof(struct statfs), 0, sizeof(struct statfs)); + return OK; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: statfs + * + * Returned Value: + * Zero on success; -1 on failure with errno set: + * + * EACCES Search permission is denied for one of the directories in the + * path prefix of path. + * EFAULT Bad address. + * ENOENT A component of the path path does not exist, or the path is an + * empty string. + * ENOMEM Out of memory + * ENOTDIR A component of the path is not a directory. + * ENOSYS The file system does not support this call. + * + ****************************************************************************/ + +int statfs(FAR const char *path, FAR struct statfs *buf) +{ + FAR struct inode *inode; + int ret = OK; + char *fullpath = NULL; + struct inode_search_s desc; + + /* Sanity checks */ + + if (!path || !buf) + { + ret = EFAULT; + goto errout; + } + + if (!path[0]) + { + ret = ENOENT; + goto errout; + } + + ret = vfs_normalize_path((const char *)NULL, path, &fullpath); + if (ret < 0) + { + ret = -ret; + goto errout; + } + + /* Get an inode for this file */ + SETUP_SEARCH(&desc, fullpath, false); + ret = inode_find(&desc); + if (ret < 0) + { + ret = EACCES; + free(fullpath); + goto errout; + } + inode = desc.node; + + /* The way we handle the statfs depends on the type of inode that we + * are dealing with. + */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT + if (INODE_IS_MOUNTPT(inode)) + { + /* The node is a file system mointpoint. Verify that the mountpoint + * supports the statfs() method + */ + + if (inode->u.i_mops && inode->u.i_mops->statfs) + { + /* Perform the statfs() operation */ + + ret = inode->u.i_mops->statfs(inode, buf); + } + } + else +#endif + { + /* The node is part of the root pseudo file system */ + + ret = statpseudofs(inode, buf); + } + + /* Check if the statfs operation was successful */ + + if (ret < 0) + { + ret = -ret; + goto errout_with_inode; + } + + /* Successfully statfs'ed the file */ + + inode_release(inode); + free(fullpath); + return OK; + + /* Failure conditions always set the errno appropriately */ + +errout_with_inode: + inode_release(inode); + free(fullpath); +errout: + set_errno(ret); + return VFS_ERROR; +} diff --git a/fs/vfs/fs_truncate.c b/fs/vfs/fs_truncate.c new file mode 100755 index 0000000..b43a220 --- /dev/null +++ b/fs/vfs/fs_truncate.c @@ -0,0 +1,193 @@ +/**************************************************************************** + * fs/vfs/fs_truncate.c + * + * Copyright (C) 2018 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "sys/types.h" +#include "unistd.h" +#include "fcntl.h" +#include "sched.h" +#include "assert.h" +#include "errno.h" + +#include "inode/inode.h" + +/**************************************************************************** + * Name: file_truncate + * + * Description: + * Equivalent to the standard ftruncate() function except that is accepts + * a struct file instance instead of a file descriptor and it does not set + * the errno variable. + * + ****************************************************************************/ +static int file_truncate(FAR struct file *filep, off_t length) +{ + FAR struct inode *inode = NULL; + int ret; + int err; + + /* Was this file opened for write access? */ + + if (((unsigned int)(filep->f_oflags) & O_ACCMODE) == O_RDONLY) + { + err = EACCES; + goto errout; + } + + /* Is this inode a registered mountpoint? Does it support the + * truncate operations may be relevant to device drivers but only + * the mountpoint operations vtable contains a truncate method. + */ + + inode = filep->f_inode; + if (!inode || !inode->u.i_mops || !inode->u.i_mops->truncate) + { + err = EBADF; + goto errout; + } + + /* Does the file system support the truncate method? It should if it is + * a write-able file system. + */ + + ret = inode->u.i_mops->truncate(filep, length); + if (ret < 0) + { + err = -ret; + goto errout; + } + + return ret; + +errout: + set_errno(err); + return VFS_ERROR; +} + +/**************************************************************************** + * Name: ftruncate + * + * Description: + * The ftruncate() function causes the regular file referenced by fd to + * have a size of length bytes. + * + * If the file previously was larger than length, the extra data is + * discarded. If it was previously shorter than length, it is unspecified + * whether the file is changed or its size increased. If the file is + * extended, the extended area appears as if it were zero-filled. If fd + * references a shared memory object, ftruncate() sets the size of the + * shared memory object to length. If the file is not a regular file or + * a shared memory object, the result is unspecified. + + * With ftruncate(), the file must be open for writing; for truncate(), + * the process must have write permission for the file. + * + * ftruncate() does not modify the file offset for any open file + * descriptions associated with the file. + * + * Input Parameters: + * fd - A reference to an open, regular file or shared memory object + * to be truncated. + * length - The new length of the file or shared memory object. + * + * Returned Value: + * On success, 0. + * On error, -1 is returned, and errno is set appro-priately: + * + * + ****************************************************************************/ + +int ftruncate(int fd, off_t length) +{ +#if CONFIG_NFILE_DESCRIPTORS > 0 + FAR struct file *filep = NULL; +#endif + + /* Did we get a valid file descriptor? */ + +#if CONFIG_NFILE_DESCRIPTORS > 0 + if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) +#endif + { + set_errno(EBADF); + return VFS_ERROR; + } + +#if CONFIG_NFILE_DESCRIPTORS > 0 + /* The descriptor is in the right range to be a file descriptor... write + * to the file. + */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + + return VFS_ERROR; + } + + if (filep->f_oflags & O_DIRECTORY) + { + set_errno(EBADF); + return VFS_ERROR; + } + + /* Perform the truncate operation using the file descriptor as an index */ + + return file_truncate(filep, length); +#endif +} + +int truncate(const char *path, off_t length) +{ + int fd; + int ret; + + fd = open(path, O_RDWR); + if (fd == VFS_ERROR) + { + /* The errno value has already been set */ + return VFS_ERROR; + } + + ret = ftruncate(fd, length); + close(fd); + + return ret; +} diff --git a/fs/vfs/fs_truncate64.c b/fs/vfs/fs_truncate64.c new file mode 100755 index 0000000..e1229d1 --- /dev/null +++ b/fs/vfs/fs_truncate64.c @@ -0,0 +1,193 @@ +/**************************************************************************** + * fs/vfs/fs_truncate64.c + * + * Copyright (C) 2018 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "sys/types.h" +#include "unistd.h" +#include "fcntl.h" +#include "sched.h" +#include "assert.h" +#include "errno.h" + +#include "inode/inode.h" + +/**************************************************************************** + * Name: file_truncate + * + * Description: + * Equivalent to the standard ftruncate() function except that is accepts + * a struct file instance instead of a file descriptor and it does not set + * the errno variable. + * + ****************************************************************************/ + +static int file_truncate64(FAR struct file *filep, off64_t length) +{ + FAR struct inode *inode = NULL; + int ret; + int err; + + /* Was this file opened for write access? */ + + if (((unsigned int)(filep->f_oflags) & O_ACCMODE) == O_RDONLY) + { + err = EACCES; + goto errout; + } + + /* Is this inode a registered mountpoint? Does it support the + * truncate operations may be relevant to device drivers but only + * the mountpoint operations vtable contains a truncate method. + */ + + inode = filep->f_inode; + if (!inode || !inode->u.i_mops || !inode->u.i_mops->truncate64) + { + err = EBADF; + goto errout; + } + + /* Does the file system support the truncate method? It should if it is + * a write-able file system. + */ + + ret = inode->u.i_mops->truncate64(filep, length); + if (ret < 0) + { + err = -ret; + goto errout; + } + + return ret; + +errout: + set_errno(err); + return VFS_ERROR; +} + +/**************************************************************************** + * Name: ftruncate + * + * Description: + * The ftruncate() function causes the regular file referenced by fd to + * have a size of length bytes. + * + * If the file previously was larger than length, the extra data is + * discarded. If it was previously shorter than length, it is unspecified + * whether the file is changed or its size increased. If the file is + * extended, the extended area appears as if it were zero-filled. If fd + * references a shared memory object, ftruncate() sets the size of the + * shared memory object to length. If the file is not a regular file or + * a shared memory object, the result is unspecified. + + * With ftruncate(), the file must be open for writing; for truncate(), + * the process must have write permission for the file. + * + * ftruncate() does not modify the file offset for any open file + * descriptions associated with the file. + * + * Input Parameters: + * fd - A reference to an open, regular file or shared memory object + * to be truncated. + * length - The new length of the file or shared memory object. + * + * Returned Value: + * On success, 0. + * On error, -1 is returned, and errno is set appro-priately: + * + * + ****************************************************************************/ + +int ftruncate64(int fd, off64_t length) +{ +#if CONFIG_NFILE_DESCRIPTORS > 0 + FAR struct file *filep = NULL; +#endif + + /* Did we get a valid file descriptor? */ + +#if CONFIG_NFILE_DESCRIPTORS > 0 + if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) +#endif + { + set_errno(EBADF); + return VFS_ERROR; + } + +#if CONFIG_NFILE_DESCRIPTORS > 0 + /* The descriptor is in the right range to be a file descriptor... write + * to the file. + */ + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + return VFS_ERROR; + } + + if (filep->f_oflags & O_DIRECTORY) + { + set_errno(EBADF); + return VFS_ERROR; + } + + /* Perform the truncate operation using the file descriptor as an index */ + + return file_truncate64(filep, length); +#endif +} + +int truncate64(const char *path, off64_t length) +{ + int fd; + int ret; + + fd = open(path, O_RDWR); + if (fd == VFS_ERROR) + { + /* The errno value has already been set */ + return VFS_ERROR; + } + + ret = ftruncate64(fd, length); + close(fd); + + return ret; +} diff --git a/fs/vfs/fs_unlink.c b/fs/vfs/fs_unlink.c new file mode 100755 index 0000000..98c3385 --- /dev/null +++ b/fs/vfs/fs_unlink.c @@ -0,0 +1,290 @@ +/**************************************************************************** + * fs/vfs/fs_unlink.c + * + * Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "unistd.h" +#include "errno.h" +#include "fs/fs.h" +#include "fcntl.h" + +#include "inode/inode.h" +#include "stdlib.h" +#include "fs_other.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#undef FS_HAVE_WRITABLE_MOUNTPOINT +#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_WRITABLE) && \ + CONFIG_NFILE_STREAMS > 0 +# define FS_HAVE_WRITABLE_MOUNTPOINT 1 +#endif + +#undef FS_HAVE_PSEUDOFS_OPERATIONS +#if !defined(CONFIG_DISABLE_PSEUDOFS_OPERATIONS) && CONFIG_NFILE_STREAMS > 0 +# define FS_HAVE_PSEUDOFS_OPERATIONS 1 +#endif + +#undef FS_HAVE_UNLINK +#if defined(FS_HAVE_WRITABLE_MOUNTPOINT) || defined(FS_HAVE_PSEUDOFS_OPERATIONS) +# define FS_HAVE_UNLINK 1 +#endif + +#ifdef FS_HAVE_UNLINK + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: do_unlink + * + * Description: Remove a file managed a mountpoint + * + ****************************************************************************/ + +int do_unlink(int dirfd, FAR const char *pathname) +{ + FAR struct inode *inode; + const char *relpath = NULL; + int errcode; + int ret; + char *fullpath = NULL; + char *relativepath = NULL; + struct inode_search_s desc; + + /* Get relative path by dirfd*/ + ret = get_path_from_fd(dirfd, &relativepath); + if (ret < 0) + { + errcode = ret; + goto errout; + } + + errcode = vfs_normalize_path((const char *)relativepath, pathname, &fullpath); + if (relativepath) + { + free(relativepath); + } + + if (errcode < 0) + { + errcode = -errcode; + goto errout; + } + + /* Get an inode for this file */ + SETUP_SEARCH(&desc, fullpath, false); + ret = inode_find(&desc); + if (ret < 0) + { + errcode = EACCES; + free(fullpath); + goto errout; + } + inode = desc.node; + relpath = desc.relpath; + +#ifndef CONFIG_DISABLE_MOUNTPOINT + /* Check if the inode is a valid mountpoint. */ + + if (INODE_IS_MOUNTPT(inode) && inode->u.i_mops) + { + /* Perform the unlink operation using the relative path at the + * mountpoint. + */ + + if (inode->u.i_mops->unlink) + { + ret = inode->u.i_mops->unlink(inode, relpath); + if (ret < 0) + { + errcode = -ret; + goto errout_with_inode; + } + } + else + { + errcode = ENOSYS; + goto errout_with_inode; + } + } + else +#endif + +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS + /* If this is a "dangling" pseudo-file node (i.e., it has no operations) + * or a soft link, then rm should remove the node. + */ + + if (!INODE_IS_SPECIAL(inode) && inode->u.i_ops) + { + /* If this is a pseudo-file node (i.e., it has no operations) + * then rmdir should remove the node. + */ + + inode_semtake(); + if (VfsPermissionCheck(desc.parent->i_uid, desc.parent->i_gid, desc.parent->i_mode, EXEC_OP | WRITE_OP)) + { + errcode = EACCES; + goto errout_with_inode; + } + + /* Refuse to unlink the inode if it has children. I.e., if it is + * functioning as a directory and the directory is not empty. + */ + + if (inode->i_child != NULL) + { + errcode = ENOTEMPTY; + inode_semgive(); + goto errout_with_inode; + } + + /* Notify the driver that it has been unlinked. If there are no + * open references to the driver instance, then the driver should + * release all resources because it is no longer accessible. + */ + + if (INODE_IS_DRIVER(inode) && inode->u.i_ops->unlink) + { + /* Notify the character driver that it has been unlinked */ + + ret = inode->u.i_ops->unlink(inode); + if (ret < 0) + { + errcode = -ret; + inode_semgive(); + goto errout_with_inode; + } + } +#ifndef CONFIG_DISABLE_MOUNTPOINT + else if (INODE_IS_BLOCK(inode) && inode->u.i_bops->unlink) + { + /* Notify the block driver that it has been unlinked */ + + ret = inode->u.i_bops->unlink(inode); + if (ret < 0) + { + errcode = -ret; + inode_semgive(); + goto errout_with_inode; + } + } +#endif + else + { + inode_semgive(); + errcode = EACCES; + goto errout_with_inode; + } + + inode_semgive(); + } + else if (!INODE_IS_SPECIAL(inode) && (inode->u.i_ops == NULL)) + { + /* It is a "dangling" pseudo-file node with no operations */ + + errcode = EISDIR; + goto errout_with_inode; + } + else +#endif + { + errcode = ENXIO; + goto errout_with_inode; + } + + /* Thie file is being deleted, page-caches of the file will no longer be used, + * so drop all the page-caches for the file at this moment, and then remove mapping + * between the file and pagecache. + */ + + (void)remove_mapping(fullpath, NULL); + + /* Successfully unlinked */ + + inode_release(inode); + free(fullpath); + return OK; + +errout_with_inode: + inode_release(inode); + free(fullpath); + +errout: + set_errno(errcode); + return VFS_ERROR; +} + +/**************************************************************************** + * Name: unlink + * + * Description: Remove a file managed a mountpoint + * + ****************************************************************************/ + +int unlink(FAR const char *pathname) +{ + return do_unlink(AT_FDCWD, pathname); +} + +/**************************************************************************** + * Name: unlinkat + * + * Description: Remove a file managed a mountpoint by dirfd + * + ****************************************************************************/ +extern int do_rmdir(int dirfd, FAR const char *pathname); + +int unlinkat(int dirfd, FAR const char *pathname, int flag) +{ + /* Now flag only support 0 && AT_REMOVEDIR */ + if ((flag & ~AT_REMOVEDIR) != 0) + return VFS_ERROR; + + if (flag & AT_REMOVEDIR) + return do_rmdir(dirfd, pathname); + + return do_unlink(dirfd, pathname); +} + +#endif /* FS_HAVE_UNLINK */ diff --git a/fs/vfs/fs_write.c b/fs/vfs/fs_write.c new file mode 100755 index 0000000..529f0c6 --- /dev/null +++ b/fs/vfs/fs_write.c @@ -0,0 +1,263 @@ +/**************************************************************************** + * fs/vfs/fs_write.c + * + * Copyright (C) 2007-2009, 2012-2014, 2016-2017 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "sys/types.h" +#include "unistd.h" +#include "fcntl.h" +#include "sched.h" +#include "assert.h" +#include "errno.h" +#include "sys/socket.h" +#include "console.h" +#include "user_copy.h" +#include "inode/inode.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: file_write + * + * Description: + * Equivalent to the standard write() function except that is accepts a + * struct file instance instead of a file descriptor. It is functionally + * equivalent to write() except that in addition to the differences in + * input paramters: + * + * - It does not modify the errno variable, + * - It is not a cancellation point, and + * - It does not handle socket descriptors. + * + * Input Parameters: + * filep - Instance of struct file to use with the write + * buf - Data to write + * nbytes - Length of data to write + * + * Returned Value: + * On success, the number of bytes written are returned (zero indicates + * nothing was written). On any failure, a negated errno value is returned + * (see comments withwrite() for a description of the appropriate errno + * values). + * + ****************************************************************************/ + +ssize_t file_write(FAR struct file *filep, FAR const void *buf, size_t nbytes) +{ + FAR struct inode *inode; + int ret; + int err; + + if (buf == NULL) + { + err = EFAULT; + goto errout; + } + + /* Was this file opened for write access? */ + + if ((((unsigned int)(filep->f_oflags)) & O_ACCMODE) == O_RDONLY) + { + err = EACCES; + goto errout; + } + + /* Is a driver registered? Does it support the write method? */ + + inode = filep->f_inode; + if (!inode || !inode->u.i_ops || !inode->u.i_ops->write) + { + err = EBADF; + goto errout; + } + + /* Yes, then let the driver perform the write */ + + ret = inode->u.i_ops->write(filep, (const char *)buf, nbytes); + if (ret < 0) + { + err = -ret; + goto errout; + } + + return ret; + +errout: + set_errno(err); + return VFS_ERROR; +} + +/**************************************************************************** + * Name: write + * + * Description: + * write() writes up to nytes bytes to the file referenced by the file + * descriptor fd from the buffer starting at buf. + * + * Input Parameters: + * fd - file descriptor (or socket descriptor) to write to + * buf - Data to write + * nbytes - Length of data to write + * + * Returned Value: + * On success, the number of bytes written are returned (zero indicates + * nothing was written). On error, -1 is returned, and errno is set appro- + * priately: + * + * EAGAIN + * Non-blocking I/O has been selected using O_NONBLOCK and the write + * would block. + * EBADF + * fd is not a valid file descriptor or is not open for writing. + * EFAULT + * buf is outside your accessible address space. + * EFBIG + * An attempt was made to write a file that exceeds the implementation + * defined maximum file size or the process' file size limit, or + * to write at a position past the maximum allowed offset. + * EINTR + * The call was interrupted by a signal before any data was written. + * EINVAL + * fd is attached to an object which is unsuitable for writing; or + * the file was opened with the O_DIRECT flag, and either the address + * specified in buf, the value specified in count, or the current + * file offset is not suitably aligned. + * EIO + * A low-level I/O error occurred while modifying the inode. + * ENOSPC + * The device containing the file referred to by fd has no room for + * the data. + * EPIPE + * fd is connected to a pipe or socket whose reading end is closed. + * When this happens the writing process will also receive a SIGPIPE + * signal. (Thus, the write return value is seen only if the program + * catches, blocks or ignores this signal.) + * + ****************************************************************************/ + +ssize_t write(int fd, FAR const void *buf, size_t nbytes) +{ +#if CONFIG_NFILE_DESCRIPTORS > 0 + FAR struct file *filep; +#endif + + /* Did we get a valid file descriptor? */ + +#if CONFIG_NFILE_DESCRIPTORS > 0 + if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) +#endif + { + /* Write to a socket descriptor is equivalent to send with flags == 0 */ + +#if defined(LOSCFG_NET_LWIP_SACK) + FAR const void *bufbak = buf; + ssize_t ret; + if (LOS_IsUserAddress((VADDR_T)(uintptr_t)buf)) + { + if (buf != NULL && nbytes > 0) + { + buf = malloc(nbytes); + if (buf == NULL) + { + set_errno(ENOMEM); + return VFS_ERROR; + } + if (LOS_ArchCopyFromUser((void*)buf, bufbak, nbytes) != 0) + { + free((void*)buf); + set_errno(EFAULT); + return VFS_ERROR; + } + } + } + ret = send(fd, buf, nbytes, 0); + if (buf != bufbak) + { + free((void*)buf); + } + return ret; +#else + set_errno(EBADF); + return VFS_ERROR; +#endif + } + +#if CONFIG_NFILE_DESCRIPTORS > 0 + /* The descriptor is in the right range to be a file descriptor... write + * to the file. + */ + + if (fd <= STDERR_FILENO && fd >= STDIN_FILENO) /* fd : [0,2] */ + { + fd = ConsoleUpdateFd(); + if (fd < 0) + { + set_errno(EBADF); + return VFS_ERROR; + } + } + + int ret = fs_getfilep(fd, &filep); + if (ret < 0) + { + /* The errno value has already been set */ + return VFS_ERROR; + } + + if (filep->f_oflags & O_DIRECTORY) + { + set_errno(EBADF); + return VFS_ERROR; + } + + if (filep->f_oflags & O_APPEND) + { + if (file_seek64(filep, 0, SEEK_END) == -1) + { + return VFS_ERROR; + } + } + + /* Perform the write operation using the file descriptor as an index */ + + return file_write(filep, buf, nbytes); +#endif +} diff --git a/include/debug.h b/include/debug.h new file mode 100755 index 0000000..69397e5 --- /dev/null +++ b/include/debug.h @@ -0,0 +1,179 @@ +/**************************************************************************** + * include/debug.h + * + * Copyright (C) 2007-2011, 2014, 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __INCLUDE_DEBUG_H +#define __INCLUDE_DEBUG_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "compiler.h" +#include "syslog.h" + + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Debug macros to runtime filter the debug messages sent to the console. In + * general, there are four forms of the debug macros: + * + * [a-z]dbg() -- Outputs messages to the console similar to printf() except + * that the output is not buffered. The first character indicates the + * system system (e.g., n=network, f=filesystm, etc.). If the first + * character is missing (i.e., dbg()), then it is common. The common + * dbg() macro is enabled by CONFIG_DEBUG. Subsystem debug requires an + * additional configuration setting to enable it (e.g., CONFIG_DEBUG_NET + * for the network, CONFIG_DEBUG_FS for the file system, etc). + * + * In general, error messages and output of importance use [a-z]dbg(). + * [a-z]dbg() is implementation dependent but usually uses file descriptors. + * (that is a problem only because the interrupt task may have re- + * directed stdout). Therefore [a-z]dbg() should not be used in interrupt + * handlers. + * + * [a-z]vdbg() -- Identical to [a-z]dbg() except that it also requires that + * CONFIG_DEBUG_VERBOSE be defined. This is intended for general debug + * output that you would normally want to suppress. + * + * [a-z]lldbg() -- Identical to [a-z]dbg() except this is uses special + * interfaces provided by architecture-specific logic to talk directly + * to the underlying console hardware. If the architecture provides such + * logic, it should define CONFIG_ARCH_LOWPUTC. + * + * [a-z]lldbg() should not be used in normal code because the implementation + * probably disables interrupts and does things that are not consistent with + * good real-time performance. However, [a-z]lldbg() is particularly useful + * in low-level code where it is inappropriate to use file descriptors. For + * example, only [a-z]lldbg() should be used in interrupt handlers. + * + * [a-z]llvdbg() -- Identical to [a-z]lldbg() except that it also requires that + * CONFIG_DEBUG_VERBOSE be defined. This is intended for general debug + * output that you would normally want to suppress. + */ + +#ifdef CONFIG_HAVE_FUNCTIONNAME +# define EXTRA_FMT "%s: " +# define EXTRA_ARG ,__FUNCTION__ +#else +# define EXTRA_FMT +# define EXTRA_ARG +#endif + +/* Debug macros will differ depending upon if the toolchain supports + * macros with a variable number of arguments or not. + */ + +#ifdef CONFIG_CPP_HAVE_VARARGS + +/* C-99 style variadic macros are supported */ + +/* The actual logger function may be overridden in arch/debug.h if needed. + * (Currently only if the pre-processor supports variadic macros) + */ + +#ifdef CONFIG_DEBUG +# define dbg(format, ...) \ + syslog(LOG_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) + +# ifdef CONFIG_ARCH_LOWPUTC +# define lldbg(format, ...) \ + lowsyslog(LOG_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) +# else +# define lldbg(x...) +# endif + +# ifdef CONFIG_DEBUG_VERBOSE +# define vdbg(format, ...) \ + syslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) + +# ifdef CONFIG_ARCH_LOWPUTC +# define llvdbg(format, ...) \ + lowsyslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__) +# else +# define llvdbg(x...) +# endif + +# else +# define vdbg(x...) +# define llvdbg(x...) +# endif + +#else /* CONFIG_DEBUG */ + +# define dbg(x...) +# define lldbg(x...) +# define vdbg(x...) +# define llvdbg(x...) + +#endif /* CONFIG_DEBUG */ + +/* Subsystem specific debug */ + +#ifdef CONFIG_DEBUG_FS +# define fdbg(format, ...) dbg(format, ##__VA_ARGS__) +# define flldbg(format, ...) lldbg(format, ##__VA_ARGS__) +# define fvdbg(format, ...) vdbg(format, ##__VA_ARGS__) +# define fllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__) +# define finfo(format, ...) vdbg(format, ##__VA_ARGS__) +# define ferr(format, ...) dbg(format, ##__VA_ARGS__) +# define fwarn(format, ...) dbg(format, ##__VA_ARGS__) +#else +# define fdbg(x...) +# define flldbg(x...) +# define fvdbg(x...) +# define fllvdbg(x...) +# define finfo(x...) +# define ferr(x...) +# define fwarn(x...) +#endif + +#endif /* CONFIG_CPP_HAVE_VARARGS */ + + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ +#endif /* __INCLUDE_DEBUG_H */ diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h new file mode 100755 index 0000000..6bf9007 --- /dev/null +++ b/include/nuttx/compiler.h @@ -0,0 +1,696 @@ +/**************************************************************************** + * include/nuttx/compiler.h + * + * Copyright (C) 2007-2009, 2012-2013, 2015-2017 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __INCLUDE_NUTTX_COMPILER_H +#define __INCLUDE_NUTTX_COMPILER_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* GCC-specific definitions *************************************************/ + +#ifdef __GNUC__ + +/* Pre-processor */ + +# define CONFIG_CPP_HAVE_VARARGS 1 /* Supports variable argument macros */ +# define CONFIG_CPP_HAVE_WARNING 1 /* Supports #warning */ + +/* Intriniscs. GCC supports __func__ but provides __FUNCTION__ for backward + * compatibility with older versions of GCC. + */ + +# define CONFIG_HAVE_FUNCTIONNAME 1 /* Has __FUNCTION__ */ +# define CONFIG_HAVE_FILENAME 1 /* Has __FILE__ */ + +/* Indicate that a local variable is not used */ + +# define UNUSED(a) ((void)(a)) + +/* Built-in functions */ + +/* GCC 4.x have __builtin_ctz(|l|ll) and __builtin_clz(|l|ll). These count + * trailing/leading zeros of input number and typically will generate few + * fast bit-counting instructions. Inputting zero to these functions is + * undefined and needs to be taken care of by the caller. */ + +#if __GNUC__ >= 4 +# define CONFIG_HAVE_BUILTIN_CTZ 1 +# define CONFIG_HAVE_BUILTIN_CLZ 1 +#endif + +/* C++ support */ + +#if defined(__cplusplus) && __cplusplus >= 201402L +# define CONFIG_HAVE_CXX14 1 +#else +# undef CONFIG_HAVE_CXX14 +#endif + +/* Attributes + * + * GCC supports weak symbols which can be used to reduce code size because + * unnecessary "weak" functions can be excluded from the link. + */ + +# if !defined(__CYGWIN__) && !defined(CONFIG_ARCH_GNU_NO_WEAKFUNCTIONS) +# define CONFIG_HAVE_WEAKFUNCTIONS 1 +# ifndef weak_alias +# define weak_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))); +# endif +# define weak_function __attribute__ ((weak)) +# define weak_const_function __attribute__ ((weak, __const__)) +# else +# undef CONFIG_HAVE_WEAKFUNCTIONS +# define weak_alias(name, aliasname) +# define weak_function +# define weak_const_function +# endif + +/* The noreturn attribute informs GCC that the function will not return. + * C11 adds _Noreturn keyword (see stdnoreturn.h) + */ + +# define noreturn_function __attribute__ ((noreturn)) + +/* The farcall_function attribute informs GCC that is should use long calls + * (even though -mlong-calls does not appear in the compilation options) + */ + +# define farcall_function __attribute__ ((long_call)) + +/* Data alignment */ + +# define aligned_data(n) __attribute__ ((aligned(n))) + +/* The packed attribute informs GCC that the structure elements are packed, + * ignoring other alignment rules. + */ + +# define begin_packed_struct +# define end_packed_struct __attribute__ ((packed)) + +/* GCC does not support the reentrant attribute */ + +# define reentrant_function + +/* The naked attribute informs GCC that the programmer will take care of + * the function prolog and epilog. + */ + +# define naked_function __attribute__ ((naked,no_instrument_function)) + +/* The inline_function attribute informs GCC that the function should always + * be inlined, regardless of the level of optimization. The noinline_function + * indicates that the function should never be inlined. + */ + +# define inline_function __attribute__ ((always_inline,no_instrument_function)) +# define noinline_function __attribute__ ((noinline)) + +/* GCC does not use storage classes to qualify addressing */ + +# define FAR +# define NEAR +# define DSEG +# define CODE + +/* Handle cases where sizeof(int) is 16-bits, sizeof(long) is 32-bits, and + * pointers are 16-bits. + */ + +#if defined(__m32c__) +/* No I-space access qualifiers */ + +# define IOBJ +# define IPTR + +/* Select the small, 16-bit addressing model */ + +# define CONFIG_SMALL_MEMORY 1 + +/* Long and int are not the same size */ + +# define CONFIG_LONG_IS_NOT_INT 1 + +/* Pointers and int are the same size */ + +# undef CONFIG_PTR_IS_NOT_INT + +#elif defined(__AVR__) +# if defined(CONFIG_AVR_HAS_MEMX_PTR) + /* I-space access qualifiers needed by Harvard architecture */ + +# define IOBJ __flash +# define IPTR __memx + +# else +/* No I-space access qualifiers */ + +# define IOBJ +# define IPTR +# endif + +/* Select the small, 16-bit addressing model (for D-Space) */ + +# define CONFIG_SMALL_MEMORY 1 + +/* Long and int are not the same size */ + +# define CONFIG_LONG_IS_NOT_INT 1 + +/* Pointers and int are the same size */ + +# undef CONFIG_PTR_IS_NOT_INT + +/* Uses a 32-bit FAR pointer only from accessing data outside of the 16-bit + * data space. + */ + +# define CONFIG_HAVE_FARPOINTER 1 + +#elif defined(__mc68hc1x__) + +/* No I-space access qualifiers */ + +# define IOBJ +# define IPTR + +/* Select the small, 16-bit addressing model */ + +# define CONFIG_SMALL_MEMORY 1 + +/* Normally, mc68hc1x code is compiled with the -mshort option + * which results in a 16-bit integer. If -mnoshort is defined + * then an integer is 32-bits. GCC will defined __INT__ accordingly: + */ + +# if __INT__ == 16 +/* int is 16-bits, long is 32-bits */ + +# define CONFIG_LONG_IS_NOT_INT 1 + +/* Pointers and int are the same size (16-bits) */ + +# undef CONFIG_PTR_IS_NOT_INT +# else +/* int and long are both 32-bits */ + +# undef CONFIG_LONG_IS_NOT_INT + +/* Pointers and int are NOT the same size */ + +# define CONFIG_PTR_IS_NOT_INT 1 +# endif + +#else + +/* No I-space access qualifiers */ + +# define IOBJ +# define IPTR + +/* Select the large, 32-bit addressing model */ + +# undef CONFIG_SMALL_MEMORY + +/* Long and int are (probably) the same size (32-bits) */ + +# undef CONFIG_LONG_IS_NOT_INT + +/* Pointers and int are the same size (32-bits) */ + +# undef CONFIG_PTR_IS_NOT_INT +#endif + +/* GCC supports inlined functions for C++ and for C version C99 and above */ + +# if defined(__cplusplus) || !defined(__STDC_VERSION__) || __STDC_VERSION__ >= 199901L +# define CONFIG_HAVE_INLINE 1 +# else +# undef CONFIG_HAVE_INLINE +# define inline +# endif + +/* ISO C11 supports anonymous (unnamed) structures and unions, added in + * GCC 4.6 (but might be suppressed with -std= option). ISO C++11 also + * adds un-named unions, but NOT unnamed structures (although compilers + * may support them). + * + * CAREFUL: This can cause issues for shared data structures shared between + * C and C++ if the two versions do not support the same features. Structures + * and unions can lose binary compatibility! + * + * NOTE: The NuttX coding standard forbids the use of unnamed structures and + * unions within the OS. + */ + +# undef CONFIG_HAVE_ANONYMOUS_STRUCT +# undef CONFIG_HAVE_ANONYMOUS_UNION + +# if (defined(__cplusplus) && __cplusplus >= 201103L) || \ + (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +# define CONFIG_HAVE_ANONYMOUS_STRUCT 1 +# define CONFIG_HAVE_ANONYMOUS_UNION 1 +# endif + +/* GCC supports both types double and long long */ + +# ifndef __clang__ +# define CONFIG_HAVE_LONG_LONG 1 +# endif +# define CONFIG_HAVE_FLOAT 1 +# define CONFIG_HAVE_DOUBLE 1 +# define CONFIG_HAVE_LONG_DOUBLE 1 + +/* Structures and unions can be assigned and passed as values */ + +# define CONFIG_CAN_PASS_STRUCTS 1 + +/* Indicate that a local variable is not used */ + +# define UNUSED(a) ((void)(a)) + +/* SDCC-specific definitions ************************************************/ + +#elif defined(SDCC) || defined(__SDCC) + +/* No I-space access qualifiers */ + +# define IOBJ +# define IPTR + +/* Pre-processor */ + +# define CONFIG_CPP_HAVE_VARARGS 1 /* Supports variable argument macros */ +# define CONFIG_CPP_HAVE_WARNING 1 /* Supports #warning */ + +/* Intriniscs */ + +# define CONFIG_HAVE_FUNCTIONNAME 1 /* Has __FUNCTION__ */ +# define CONFIG_HAVE_FILENAME 1 /* Has __FILE__ */ +# define __FUNCTION__ __func__ /* SDCC supports on __func__ */ + +/* Pragmas + * + * Disable warnings for unused function arguments */ + +# pragma disable_warning 85 + +/* C++ support */ + +# undef CONFIG_HAVE_CXX14 + +/* Attributes + * + * SDCC does not support weak symbols */ + +# undef CONFIG_HAVE_WEAKFUNCTIONS +# ifndef weak_alias +# define weak_alias(name, aliasname) +# endif +# define weak_function +# define weak_const_function +# define restrict /* REVISIT */ + +/* SDCC does not support the noreturn or packed attributes */ +/* Current SDCC supports noreturn via C11 _Noreturn keyword (see + * stdnoreturn.h). + */ + +# define noreturn_function +# define aligned_data(n) +# define begin_packed_struct +# define end_packed_struct + +/* REVISIT: */ + +# define farcall_function + +/* SDCC does support "naked" functions */ + +# define naked_function __naked + +/* SDCC does not support forced inlining. */ + +# define inline_function +# define noinline_function + +/* The reentrant attribute informs SDCC that the function + * must be reentrant. In this case, SDCC will store input + * arguments on the stack to support reentrancy. + * + * SDCC functions are always reentrant (except for the mcs51, + * ds390, hc08 and s08 backends) + */ + +# define reentrant_function __reentrant + +/* ISO C11 supports anonymous (unnamed) structures and unions. Does SDCC? */ + +# undef CONFIG_HAVE_ANONYMOUS_STRUCT +# undef CONFIG_HAVE_ANONYMOUS_UNION + +/* Indicate that a local variable is not used */ + +# define UNUSED(a) ((void)(a)) + +/* It is assumed that the system is build using the small + * data model with storage defaulting to internal RAM. + * The NEAR storage class can also be used to address data + * in internal RAM; FAR can be used to address data in + * external RAM. + */ + +#if defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_gbz80) +# define FAR +# define NEAR +# define CODE +# define DSEG +#else +# define FAR __xdata +# define NEAR __data +# define CODE __code +# if defined(SDCC_MODEL_SMALL) +# define DSEG __data +# else +# define DSEG __xdata +# endif +#endif + +/* Select small, 16-bit address model */ + +# define CONFIG_SMALL_MEMORY 1 + +/* Long and int are not the same size */ + +# define CONFIG_LONG_IS_NOT_INT 1 + +/* The generic pointer and int are not the same size (for some SDCC + * architectures). REVISIT: SDCC now has more backends where pointers are + * the same size as int than just z80 and z180. + */ + +#if !defined(__z80) && !defined(__gbz80) +# define CONFIG_PTR_IS_NOT_INT 1 +#endif + +/* New versions of SDCC supports inline function */ + +# define CONFIG_HAVE_INLINE 1 + +/* SDCC does types long long and float, but not types double and long + * double. + */ + +# define CONFIG_HAVE_LONG_LONG 1 +# define CONFIG_HAVE_FLOAT 1 +# undef CONFIG_HAVE_DOUBLE +# undef CONFIG_HAVE_LONG_DOUBLE + +/* Structures and unions cannot be passed as values or used + * in assignments. + */ + +# undef CONFIG_CAN_PASS_STRUCTS + +/* Indicate that a local variable is not used */ + +# define UNUSED(a) ((void)(a)) + +/* Zilog-specific definitions ***********************************************/ + +#elif defined(__ZILOG__) + +/* At present, only the following Zilog compilers are recognized */ + +# if !defined(__ZNEO__) && !defined(__EZ8__) && !defined(__EZ80__) +# warning "Unrecognized Zilog compiler" +# endif + +/* Pre-processor */ + +# undef CONFIG_CPP_HAVE_VARARGS /* No variable argument macros */ +# undef CONFIG_CPP_HAVE_WARNING /* Does not support #warning */ + +/* Intrinsics */ + +# define CONFIG_HAVE_FUNCTIONNAME 1 /* Has __FUNCTION__ */ +# define CONFIG_HAVE_FILENAME 1 /* Has __FILE__ */ + +/* No I-space access qualifiers */ + +# define IOBJ +# define IPTR + +/* C++ support */ + +# undef CONFIG_HAVE_CXX14 + +/* Attributes + * + * The Zilog compiler does not support weak symbols + */ + +# undef CONFIG_HAVE_WEAKFUNCTIONS +# ifndef weak_alias +# define weak_alias(name, aliasname) +# endif +# define weak_function +# define weak_const_function +# define restrict + +/* The Zilog compiler does not support the noreturn, packed, naked + * attributes. + */ + +# define noreturn_function +# define aligned_data(n) +# define begin_packed_struct +# define end_packed_struct +# define naked_function +# define inline_function +# define noinline_function + +/* REVISIT: */ + +# define farcall_function + +/* The Zilog compiler does not support the reentrant attribute */ + +# define reentrant_function + +/* Addressing. + * + * Z16F ZNEO: Far is 24-bits; near is 16-bits of address. + * The supported model is (1) all code on ROM, and (2) all data + * and stacks in external (far) RAM. + * Z8Encore!: Far is 16-bits; near is 8-bits of address. + * The supported model is (1) all code on ROM, and (2) all data + * and stacks in internal (far) RAM. + * Z8Acclaim: In Z80 mode, all pointers are 16-bits. In ADL mode, all pointers + * are 24 bits. + */ + +# if defined(__ZNEO__) +# define FAR _Far +# define NEAR _Near +# define DSEG _Far +# define CODE _Erom +# undef CONFIG_SMALL_MEMORY /* Select the large, 32-bit addressing model */ +# undef CONFIG_LONG_IS_NOT_INT /* Long and int are the same size */ +# undef CONFIG_PTR_IS_NOT_INT /* FAR pointers and int are the same size */ +# elif defined(__EZ8__) +# define FAR far +# define NEAR near +# define DSEG far +# define CODE rom +# define CONFIG_SMALL_MEMORY 1 /* Select small, 16-bit address model */ +# define CONFIG_LONG_IS_NOT_INT 1 /* Long and int are not the same size */ +# undef CONFIG_PTR_IS_NOT_INT /* FAR pointers and int are the same size */ +# elif defined(__EZ80__) +# define FAR +# define NEAR +# define DSEG +# define CODE +# undef CONFIG_SMALL_MEMORY /* Select the large, 32-bit addressing model */ +# define CONFIG_LONG_IS_NOT_INT 1 /* Long and int are not the same size */ +# ifdef CONFIG_EZ80_Z80MODE +# define CONFIG_PTR_IS_NOT_INT 1 /* Pointers and int are not the same size */ +# else +# undef CONFIG_PTR_IS_NOT_INT /* Pointers and int are the same size */ +# endif +# endif + +/* The Zilog compiler does not support inline functions */ + +# undef CONFIG_HAVE_INLINE +# define inline + +/* ISO C11 supports anonymous (unnamed) structures and unions. Zilog does + * not support C11 + */ + +# undef CONFIG_HAVE_ANONYMOUS_STRUCT +# undef CONFIG_HAVE_ANONYMOUS_UNION + +/* Older Zilog compilers support both types double and long long, but the size + * is 32-bits (same as long and single precision) so it is safer to say that + * they are not supported. Later versions are more ANSII compliant and + * simply do not support long long or double. + */ + +# undef CONFIG_HAVE_LONG_LONG +# define CONFIG_HAVE_FLOAT 1 +# undef CONFIG_HAVE_DOUBLE +# undef CONFIG_HAVE_LONG_DOUBLE + +/* Structures and unions can be assigned and passed as values */ + +# define CONFIG_CAN_PASS_STRUCTS 1 + +/* Indicate that a local variable is not used */ + +# define UNUSED(a) ((void)(a)) + +/* ICCARM-specific definitions ***********************************************/ + +#elif defined(__ICCARM__) + +# define CONFIG_CPP_HAVE_VARARGS 1 /* Supports variable argument macros */ +# define CONFIG_HAVE_FILENAME 1 /* Has __FILE__ */ +# define CONFIG_HAVE_FLOAT 1 + +/* Indicate that a local variable is not used */ + +# define UNUSED(a) ((void)(a)) + +# ifndef weak_alias +# define weak_alias(name, aliasname) +# endif +# define weak_function __weak +# define weak_const_function +# define noreturn_function +# define farcall_function +# define aligned_data(n) +# define begin_packed_struct __packed +# define end_packed_struct +# define reentrant_function +# define naked_function +# define inline_function +# define noinline_function + +# define FAR +# define NEAR +# define DSEG +# define CODE +# define IOBJ +# define IPTR + +# define __asm__ asm +# define __volatile__ volatile + +/* For operatots __sfb() and __sfe() */ + +# pragma section = ".bss" +# pragma section = ".data" +# pragma section = ".data_init" +# pragma section = ".text" + +/* C++ support */ + +# undef CONFIG_HAVE_CXX14 + +/* ISO C11 supports anonymous (unnamed) structures and unions. Does ICCARM? */ + +# undef CONFIG_HAVE_ANONYMOUS_STRUCT +# undef CONFIG_HAVE_ANONYMOUS_UNION + +/* Unknown compiler *********************************************************/ + +#else + +# undef CONFIG_CPP_HAVE_VARARGS +# undef CONFIG_CPP_HAVE_WARNING +# undef CONFIG_HAVE_FUNCTIONNAME +# undef CONFIG_HAVE_FILENAME +# undef CONFIG_HAVE_WEAKFUNCTIONS +# undef CONFIG_HAVE_CXX14 +# ifndef weak_alias +# define weak_alias(name, aliasname) +# endif +# define weak_function +# define weak_const_function +# define restrict +# define noreturn_function +# define farcall_function +# define aligned_data(n) +# define begin_packed_struct +# define end_packed_struct +# define reentrant_function +# define naked_function +# define inline_function +# define noinline_function + +# define FAR +# define NEAR +# define DSEG +# define CODE + +# undef CONFIG_SMALL_MEMORY +# undef CONFIG_LONG_IS_NOT_INT +# undef CONFIG_PTR_IS_NOT_INT +# undef CONFIG_HAVE_INLINE +# define inline +# undef CONFIG_HAVE_LONG_LONG +# define CONFIG_HAVE_FLOAT 1 +# undef CONFIG_HAVE_DOUBLE +# undef CONFIG_HAVE_LONG_DOUBLE +# undef CONFIG_CAN_PASS_STRUCTS +# undef CONFIG_HAVE_ANONYMOUS_STRUCT +# undef CONFIG_HAVE_ANONYMOUS_UNION + +# define UNUSED(a) ((void)(a)) + +#endif + +#endif /* __INCLUDE_NUTTX_COMPILER_H */ diff --git a/include/nuttx/fs/automount.h b/include/nuttx/fs/automount.h new file mode 100755 index 0000000..29d31e2 --- /dev/null +++ b/include/nuttx/fs/automount.h @@ -0,0 +1,200 @@ +/**************************************************************************** + * include/nuttx/audio/automount.h + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __INCLUDE_NUTTX_AUDIO_AUTOMOUNT_H +#define __INCLUDE_NUTTX_AUDIO_AUTOMOUNT_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "stdint.h" + + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************ + * Automounter configuration + * CONFIG_FS_AUTOMOUNTER - Enables automount support + * + * Prequisites: + * CONFIG_SCHED_WORKQUEUE - Work queue support is required + * And others that would only matter if you are working in a very minimal + * configuration. + */ + +/* Helper macros ************************************************************/ + +#define AUTOMOUNT_ATTACH(s,isr,arg) ((s)->attach(s,isr,arg)) +#define AUTOMOUNT_DETACH(s) ((s)->attach(s,NULL,NULL)) +#define AUTOMOUNT_ENABLE(s) ((s)->enable(s,true)) +#define AUTOMOUNT_DISABLE(s) ((s)->enable(s,false)) +#define AUTOMOUNT_INSERTED(s) ((s)->inserted(s)) + +/**************************************************************************** + * Public Types + ****************************************************************************/ +/* This is the type of the automount media change handler. The lower level + * code will intercept the interrupt and provide the upper level with the + * private data that was provided when the interrupt was attached and will + * also provide an indication if the media was inserted or removed. + */ + +struct automount_lower_s; /* Forward reference. Defined below */ + +typedef CODE int + (*automount_handler_t)(FAR const struct automount_lower_s *lower, + FAR void *arg, bool inserted); + +/* A reference to a structure of this type must be passed to the FS + * automounter. This structure provides information about the volume to be + * mounted and provides board-specific hooks. + * + * Memory for this structure is provided by the caller. It is not copied + * by the automounter and is presumed to persist while the automounter + * is active. + */ + +struct automount_lower_s +{ + /* Volume characterization */ + + FAR const char *fstype; /* Type of file system */ + FAR const char *blockdev; /* Path to the block device */ + FAR const char *mountpoint; /* Location to mount the volume */ + + /* Debounce delay in system clock ticks. Automount operation will not + * be performed until the insertion/removal state has been unchanges + * for this duration. + */ + + uint32_t ddelay; + + /* Unmount delay time in system clock ticks. If a volume has open + * references at the time that the media is removed, then we will be + * unable to unmount it. In that case, hopefully, the clients of the + * mount will eventually fail with file access errors and eventually close + * their references. So, at some time later, it should be possible to + * unmount the volume. This delay specifies the time between umount + * retries. + */ + + uint32_t udelay; + + /* Interrupt related operations all hidden behind callbacks to isolate the + * automounter from differences in interrupt handling by varying boards + * and MCUs. Board interrupts should be configured both insertion and + * removal of the media can be detected. + * + * attach - Attach or detach the media change interrupt handler to the + * board level interrupt + * enable - Enable or disable the media change interrupt + */ + + CODE int (*attach)(FAR const struct automount_lower_s *lower, + automount_handler_t isr, FAR void *arg); + CODE void (*enable)(FAR const struct automount_lower_s *lower, + bool enable); + CODE bool (*inserted)(FAR const struct automount_lower_s *lower); +}; + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: automount_initialize + * + * Description: + * Configure the automounter. + * + * Input Parameters: + * lower - Persistent board configuration data + * + * Returned Value: + * A void* handle. The only use for this handle is with automount_uninitialize(). + * NULL is returned on any failure. + * + ****************************************************************************/ + +FAR void *automount_initialize(FAR const struct automount_lower_s *lower); + +/**************************************************************************** + * Name: automount_uninitialize + * + * Description: + * Stop the automounter and free resources that it used. NOTE that the + * mount is left in its last state mounted/unmounted state. + * + * Input Parameters: + * handle - The value previously returned by automount_initialize(); + * + * Returned Value: + * None + * + ****************************************************************************/ + +void automount_uninitialize(FAR void *handle); + +#undef EXTERN +#ifdef __cplusplus +} +#endif +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif /* __INCLUDE_NUTTX_AUDIO_AUTOMOUNT_H */ diff --git a/include/nuttx/fs/dirent_fs.h b/include/nuttx/fs/dirent_fs.h new file mode 100755 index 0000000..101f753 --- /dev/null +++ b/include/nuttx/fs/dirent_fs.h @@ -0,0 +1,331 @@ +/**************************************************************************** + * include/nuttx/fs/dirent_fs.h + * + * Copyright (C) 2007, 2009, 2011-2013, 2015, 2018 Gregory Nutt. All + * rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __INCLUDE_NUTTX_FS_DIRENT_FS_H +#define __INCLUDE_NUTTX_FS_DIRENT_FS_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "sys/types.h" +#include "stdint.h" +#include "dirent.h" + +#include "fs/fs.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#define kmm_malloc(s) malloc(s) +#define kmm_free(mem) free(mem) +#define kmm_zalloc(s) zalloc(s) + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifdef CONFIG_NFS +# define DIRENT_NFS_MAXHANDLE 64 /* Maximum length of an NFSv3 file handle */ +# define DIRENT_NFS_VERFLEN 8 /* Length of the copy verifier */ +#endif + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* The internal representation of type DIR is just a container for an inode + * reference, a position, a dirent structure, and file-system-specific + * information. + * + * For the root pseudo-file system, we need retain only the 'next' inode + * need for the next readdir() operation. We hold a reference on this + * inode so we know that it will persist until closedir is called. + */ + +struct fs_pseudodir_s +{ + struct inode *fd_next; /* The inode for the next call to readdir() */ +}; + +typedef void *fs_dir_s; + +#define DIRENT_MAGIC 0x11CBA828 /* Magic number to express the status of a dirent */ + +#ifdef CONFIG_FS_FAT +/* For fat, we need to return the start cluster, current cluster, current + * sector and current directory index. + */ + +struct fs_fatdir_s +{ + off_t fd_startcluster; /* Start cluster number of the directory */ + off_t fd_currcluster; /* Current cluster number being read */ + off_t fd_currsector; /* Current sector being read */ + unsigned int fd_index; /* Current index of the directory entry to read */ +}; +#endif /* CONFIG_FS_FAT */ + +#ifdef CONFIG_FS_ROMFS +/* For ROMFS, we need to return the offset to the current and start positions + * of the directory entry being read + */ + +struct fs_romfsdir_s +{ + off_t fr_firstoffset; /* Offset to the first entry in the directory */ + off_t fr_curroffset; /* Current offset into the directory contents */ +}; +#endif /* CONFIG_FS_ROMFS */ + +#ifdef CONFIG_FS_CROMFS +/* For CROMFS, we need to return the next compressed node to be examined. */ + +struct fs_cromfsdir_s +{ + uint32_t cr_firstoffset; /* Offset to the first entry in the directory */ + uint32_t cr_curroffset; /* Current offset into the directory contents */ +}; +#endif /* CONFIG_FS_CROMFS */ +/* For TMPFS, we need the directory object and an index into the directory + * entries. + */ + +struct tmpfs_directory_s; /* Forward reference */ +struct fs_tmpfsdir_s +{ + FAR struct tmpfs_directory_s *tf_tdo; /* Directory being enumerated */ + unsigned int tf_index; /* Directory index */ +}; + +#ifdef CONFIG_FS_BINFS +/* The apps/ pseudo bin/ directory. The state value is simply an index */ + +struct fs_binfsdir_s +{ + unsigned int fb_index; /* Index to the next named entry point */ +}; +#endif + +#ifdef CONFIG_FS_NXFFS +/* NXFFS is the tiny NuttX wear-leveling FLASH file system. The state value is + * the offset in FLASH memory to the next inode entry. + */ + +struct fs_nxffsdir_s +{ + off_t nx_offset; /* Offset to the next inode */ +}; +#endif + +#ifdef CONFIG_NFS +/* The NFS client file system */ + +struct nfsdir_s +{ + uint8_t nfs_fhsize; /* Length of the file handle */ + uint8_t nfs_fhandle[DIRENT_NFS_MAXHANDLE]; /* File handle (max size allocated) */ + uint8_t nfs_verifier[DIRENT_NFS_VERFLEN]; /* Cookie verifier */ + uint32_t nfs_cookie[2]; /* Cookie */ +}; +#endif + +#ifdef CONFIG_FS_SMARTFS +/* SMARTFS is the Sector Mapped Allocation for Really Tiny FLASH filesystem. + * it is designed to use small sectors on small serial FLASH devices, using + * minimal RAM footprint. + */ + +struct fs_smartfsdir_s +{ + uint16_t fs_firstsector; /* First sector of directory list */ + uint16_t fs_currsector; /* Current sector of directory list */ + uint16_t fs_curroffset; /* Current offset within current sector */ +}; +#endif + +#ifdef CONFIG_FS_SPIFFS +/* SPIFFS is an SPI-oriented FLASH file system originally by Peter Andersson */ + +struct fs_spiffsdir_s +{ + int16_t block; /* Current block */ + int entry; /* Current entry */ +}; +#endif + +#ifdef CONFIG_FS_UNIONFS +/* The Union File System can be used to merge to different mountpoints so + * that they appear as a single merged directory. + */ + +struct fs_dirent_s; /* Forward reference */ +struct fs_unionfsdir_s +{ + uint8_t fu_ndx; /* Index of file system being enumerated */ + bool fu_eod; /* True: At end of directory */ + bool fu_prefix[2]; /* True: Fake directory in prefix */ + FAR char *fu_relpath; /* Path being enumerated */ + FAR struct fs_dirent_s *fu_lower[2]; /* dirent struct used by contained file system */ +}; +#endif + +#ifdef CONFIG_FS_USERFS +/* The UserFS uses an opaque representation since the actual userspace representation + * of the directory state structure is unknowable. + */ + +struct fs_userfsdir_s +{ + FAR void *fs_dir; /* Opaque pointer to UserFS DIR */ +}; +#endif + +#ifdef CONFIG_FS_HOSTFS +/* HOSTFS provides mapping to directories on the host machine in the + * sim environment. + */ + +struct fs_hostfsdir_s +{ + FAR void *fs_dir; /* Opaque pointer to host DIR */ +}; +#endif + +struct fs_dirent_s +{ + /* This is the node that was opened by opendir. The type of the inode + * determines the way that the readdir() operations are performed. For the + * pseudo root pseudo-file system, it is also used to support rewind. + * + * We hold a reference on this inode so we know that it will persist until + * closedir() is called (although inodes linked to this inode may change). + */ + + struct inode *fd_root; + + /* At present, only mountpoints require special handling flags */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT + unsigned int fd_flags; +#endif + + /* This keeps track of the current directory position for telldir */ + + off_t fd_position; + + /* Retained control information depends on the type of file system that + * provides is provides the mountpoint. Ideally this information should + * be hidden behind an opaque, file-system-dependent void *, but we put + * the private definitions in line here for now to reduce allocations. + */ + + struct + { + /* Private data used by the built-in pseudo-file system */ + + struct fs_pseudodir_s pseudo; + + /* Private data used by other file systems */ + fs_dir_s fs_dir; +#ifdef CONFIG_FS_FAT + struct fs_fatdir_s fat; +#endif +#ifdef CONFIG_FS_ROMFS + struct fs_romfsdir_s romfs; +#endif +#ifdef CONFIG_FS_CROMFS + struct fs_cromfsdir_s cromfs; +#endif +#ifdef CONFIG_FS_TMPFS + struct fs_tmpfsdir_s tmpfs; +#endif +#ifdef CONFIG_FS_BINFS + struct fs_binfsdir_s binfs; +#endif +#ifdef CONFIG_FS_PROCFS + FAR void *procfs; +#endif +#ifdef CONFIG_FS_NXFFS + struct fs_nxffsdir_s nxffs; +#endif +#ifdef CONFIG_NFS + struct nfsdir_s nfs; +#endif +#ifdef CONFIG_FS_SMARTFS + struct fs_smartfsdir_s smartfs; +#endif +#ifdef CONFIG_FS_SPIFFS + struct fs_spiffsdir_s spiffs; +#endif +#ifdef CONFIG_FS_LITTLEFS + FAR void *littlefs; +#endif +#ifdef CONFIG_FS_UNIONFS + struct fs_unionfsdir_s unionfs; +#endif +#ifdef CONFIG_FS_USERFS + struct fs_userfsdir_s userfs; +#endif +#ifdef CONFIG_FS_HOSTFS + struct fs_hostfsdir_s hostfs; +#endif + } u; + + /* In any event, this the actual struct dirent that is returned by readdir */ + + struct dirent fd_dir; /* Populated when readdir is called */ + int fd_status; /* Express the dirent is been opened or no */ +}; + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ +#endif /* __INCLUDE_NUTTX_FS_DIRENT_FS_H */ diff --git a/include/nuttx/fs/file.h b/include/nuttx/fs/file.h new file mode 100755 index 0000000..952f140 --- /dev/null +++ b/include/nuttx/fs/file.h @@ -0,0 +1,179 @@ +/**************************************************************************** + * include/fs/file.h + * + * Copyright (C) 2007-2009, 2011-2013, 2015-2018 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __INCLUDE_FS_FILE_H +#define __INCLUDE_FS_FILE_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "compiler.h" + +#include "sys/types.h" +#include "stdarg.h" +#include "stdint.h" +#include "fs/fs.h" + +#include "semaphore.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +/**************************************************************************** + * Global Function Prototypes + ****************************************************************************/ + +/* Callback used by foreach_mountpoints to traverse all mountpoints in the + * pseudo-file system. + */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT +struct statfs; /* Forward reference */ +typedef int (*foreach_mountpoint_t)(FAR const char *mountpoint, + FAR struct statfs *statbuf, + FAR void *arg); +#endif + +struct filelist *sched_getfiles(void); + +/* fs/fs_sendfile.c *************************************************/ +/**************************************************************************** + * Name: sendfile + * + * Description: + * Copy data between one file descriptor and another. + * + ****************************************************************************/ +ssize_t sendfile(int outfd, int infd, off_t *offset, size_t count); + +/** + * @ingroup fs + * @brief get the path by a given file fd. + * + * @par Description: + * The function is used for getting the path by a given file fd. + * + * @attention + *
        + *
      • Only support file fd, not any dir fd.
      • + *
      + * + * @param fd [IN] Type #int file fd. + * @param path [IN] Type #char ** address of the location to return the path reference. + * + * @retval #0 get path success + * @retval #~0 get path failed + * + * @par Dependency: + *
      • fs.h: the header file that contains the API declaration.
      + * @see + * + * @since 2020-1-8 + */ + +extern int get_path_from_fd(int fd, char **path); + +/**************************************************************************** + * Name: foreach_mountpoint + * + * Description: + * Visit each mountpoint in the pseudo-file system. The traversal is + * terminated when the callback 'handler' returns a non-zero value, or when + * all of the mountpoints have been visited. + * + * This is just a front end "filter" to foreach_inode() that forwards only + * mountpoint inodes. It is intended to support the mount() command to + * when the mount command is used to enumerate mounts. + * + * NOTE 1: Use with caution... The pseudo-file system is locked throughout + * the traversal. + * NOTE 2: The search algorithm is recursive and could, in principle, use + * an indeterminant amount of stack space. This will not usually be a + * real work issue. + * + * Input Parameters: + * handler - Operation function when find a mount point. + * arg - Private data. + * + ****************************************************************************/ + +#ifndef CONFIG_DISABLE_MOUNTPOINT +int foreach_mountpoint(foreach_mountpoint_t handler, FAR void *arg); +#endif + +/**************************************************************************** + * Name: find_blockdriver + * + * Description: + * Return the inode of the block driver specified by 'pathname' + * + * Input Parameters: + * pathname - The full path to the block driver to be located + * mountflags - If MS_RDONLY is not set, then driver must support write + * operations (see include/sys/mount.h) + * ppinode - Address of the location to return the inode reference + * + * Returned Value: + * Returns zero on success or a negated errno on failure: + * + * EINVAL - Pathname or pinode is NULL. + * ENOENT - No block driver of this name is registered + * ENOTBLK - The inode associated with the pathname is not a block driver + * EACCESS - The MS_RDONLY option was not set but this driver does not + * support write access + * + * Attention: + * The parameter pathname is a full path, which begin with '/'. + * The parameter ppinode must point a valid memory, which size must be enough for storing struct inode. + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +int find_blockdriver(FAR const char *pathname, int mountflags, + FAR struct inode **ppinode); +#endif + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ +#endif /* __INCLUDE_FS_FILE_H */ diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h new file mode 100755 index 0000000..210e8b3 --- /dev/null +++ b/include/nuttx/fs/fs.h @@ -0,0 +1,1058 @@ +/**************************************************************************** + * include/fs/fs.h + * + * Copyright (C) 2007-2009, 2011-2013, 2015-2018 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __INCLUDE_FS_FS_H +#define __INCLUDE_FS_FS_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#include "menuconfig.h" +#include "compiler.h" + +#include "poll.h" +#include "sys/types.h" +#include "sys/stat.h" +#include "fcntl.h" + +#include "stdarg.h" +#include "stdint.h" + +#include "sys/vfs.h" +#include "los_vm_map.h" +#include "los_atomic.h" +#include "semaphore.h" +#include "los_spinlock.h" + +#ifndef CONFIG_DISABLE_MQUEUE +#include "mqueue.h" +#endif + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +/* POSIX-like OS return values: */ + +#ifndef VFS_ERROR +#define VFS_ERROR -1 +#endif + +#undef OK +#define OK 0 + +#define MS_RDONLY 1 +#define MS_NOSYNC 2 +#define PROCFS_MOUNT_POINT "/proc" +#define PROCFS_MOUNT_POINT_SIZE (sizeof(PROCFS_MOUNT_POINT) - 1) + +#define RAMFS_MOUNT_POINT "/ramfs" +#define RAMFS_MOUNT_POINT_SIZE (sizeof(RAMFS_MOUNT_POINT) - 1) + +#define DEFAULT_DIR_MODE 0777 +#define DEFAULT_FILE_MODE 0666 +#define USER_MODE_SHIFT 6 +#define GROUP_MODE_SHIFT 3 +#define DEFAULT_MOUNT_DIR_MODE 0755 +/* Format options (3rd argument of format) */ +#define FMT_FAT 0x01 +#define FMT_FAT32 0x02 +#define FMT_ANY 0x07 +#define FMT_ERASE 0x08 + +/* system time flag for FAT */ +#define FAT_SYSTEM_TIME_ENABLE 0x01 +#define FAT_SYSTEM_TIME_DISABLE 0x00 + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Stream flags for the fs_flags field of in struct file_struct */ + +#define __FS_FLAG_EOF (1 << 0) /* EOF detected by a read operation */ +#define __FS_FLAG_ERROR (1 << 1) /* Error detected by any operation */ +#define __FS_FLAG_LBF (1 << 2) /* Line buffered */ +#define __FS_FLAG_UBF (1 << 3) /* Buffer allocated by caller of setvbuf */ + +#define FALLOC_FL_KEEP_SIZE 1 /* extend size */ + +/* The struct file_operations open(0) normally returns zero on success and + * a negated errno value on failure. There is one case, however, where + * the open method will redirect to another driver and return a file + * descriptor instead. + * + * This case is when SUSv1 pseudo-terminals are used (CONFIG_PSEUDOTERM_SUSV1=y). + * In this case, the output is encoded and decoded using these macros in + * order to support (a) returning file descriptor 0 (which really should + * not happen), and (b) avoiding confusion if some other open method returns + * a positive, non-zero value which is not a file descriptor. + * + * OPEN_ISFD(r) tests if the return value from the open method is + * really a file descriptor. + * OPEN_SETFD(f) is used by an implementation of the open() method + * in order to encode a file descriptor in the return value. + * OPEN_GETFD(r) is use by the upper level open() logic to decode + * the file descriptor encoded in the return value. + * + * REVISIT: This only works for file descriptors in the in range 0-255. + */ + +#define OPEN_MAGIC 0x4200 +#define OPEN_MASK 0x00ff +#define OPEN_MAXFD 0x00ff + +#define OPEN_ISFD(r) (((r) & ~OPEN_MASK) == OPEN_MAGIC) +#define OPEN_SETFD(f) ((f) | OPEN_MAGIC) +#define OPEN_GETFD(r) ((r) & OPEN_MASK) + +/**************************************************************************** + * Public Type Definitions + ****************************************************************************/ + +#define AT_REMOVEDIR 0x200 + +/* Attribute flags. */ +#define CHG_MODE 1 +#define CHG_UID 2 +#define CHG_GID 4 +#define CHG_SIZE 8 +#define CHG_ATIME 16 +#define CHG_MTIME 32 +#define CHG_CTIME 64 + +struct IATTR { + /* This structure is used for record inode attr. */ + unsigned int attr_chg_valid; + unsigned int attr_chg_flags; + unsigned attr_chg_mode; + unsigned attr_chg_uid; + unsigned attr_chg_gid; + unsigned attr_chg_size; + unsigned attr_chg_atime; + unsigned attr_chg_mtime; + unsigned attr_chg_ctime; +}; + +/* Forward references */ + +struct file; +struct inode; +struct stat; +struct statfs; +struct pollfd; +struct fs_dirent_s; + +/* This structure is provided by devices when they are registered with the + * system. It is used to call back to perform device specific operations. + */ + +struct file_operations_vfs +{ + /* The device driver open method differs from the mountpoint open method */ + + int (*open)(FAR struct file *filep); + + /* The following methods must be identical in signature and position because + * the struct file_operations and struct mountp_operations are treated like + * unions. + */ + + int (*close)(FAR struct file *filep); + ssize_t (*read)(FAR struct file *filep, FAR char *buffer, size_t buflen); + ssize_t (*write)(FAR struct file *filep, FAR const char *buffer, size_t buflen); + off_t (*seek)(FAR struct file *filep, off_t offset, int whence); + int (*ioctl)(FAR struct file *filep, int cmd, unsigned long arg); + int (*mmap)(FAR struct file* filep, struct VmMapRegion *region); + /* The two structures need not be common after this point */ + +#ifndef CONFIG_DISABLE_POLL + int (*poll)(FAR struct file *filep, poll_table *fds); +#endif + int (*unlink)(FAR struct inode *inode); +}; + +/* This structure provides information about the state of a block driver */ + +#ifndef CONFIG_DISABLE_MOUNTPOINT +struct geometry +{ + bool geo_available; /* true: The device is available */ + bool geo_mediachanged; /* true: The media has changed since last query */ + bool geo_writeenabled; /* true: It is okay to write to this device */ + unsigned long long geo_nsectors; /* Number of sectors on the device */ + size_t geo_sectorsize; /* Size of one sector */ +}; + +/* This structure is provided by block devices when they register with the + * system. It is used by file systems to perform filesystem transfers. It + * differs from the normal driver vtable in several ways -- most notably in + * that it deals in struct inode vs. struct filep. + */ + +struct inode; +struct block_operations +{ + int (*open)(FAR struct inode *inode); + int (*close)(FAR struct inode *inode); + ssize_t (*read)(FAR struct inode *inode, FAR unsigned char *buffer, + unsigned long long start_sector, unsigned int nsectors); + ssize_t (*write)(FAR struct inode *inode, FAR const unsigned char *buffer, + unsigned long long start_sector, unsigned int nsectors); + int (*geometry)(FAR struct inode *inode, FAR struct geometry *geometry); + int (*ioctl)(FAR struct inode *inode, int cmd, unsigned long arg); + int (*unlink)(FAR struct inode *inode); +}; + +/* This structure is provided by a filesystem to describe a mount point. + * Note that this structure differs from file_operations ONLY in the form of + * the open method. Once the file is opened, it can be accessed either as a + * struct file_operations or struct mountpt_operations + */ + +/* file mapped in VMM pages */ +struct page_mapping { + LOS_DL_LIST page_list; /* all pages */ + SPIN_LOCK_S list_lock; /* lock protecting it */ + LosMux mux_lock; /* mutex lock */ + unsigned long nrpages; /* number of total pages */ + unsigned long flags; + Atomic ref; /* reference counting */ + struct file *host; /* owner of this mapping */ +}; + +/* map: full_path(owner) <-> mapping */ +struct file_map { + LOS_DL_LIST head; + LosMux lock; /* lock to protect this mapping */ + struct page_mapping mapping; + char *owner; /* owner: full path of file */ +}; + + +struct mountpt_operations +{ + /* The mountpoint open method differs from the driver open method + * because it receives (1) the inode that contains the mountpoint + * private data, (2) the relative path into the mountpoint, and (3) + * information to manage privileges. + */ + + int (*open)(FAR struct file *filep, FAR const char *relpath, + int oflags, mode_t mode); + + /* The following methods must be identical in signature and position + * because the struct file_operations and struct mountpt_operations are + * treated like unions. + */ + + int (*close)(FAR struct file *filep); + ssize_t (*read)(FAR struct file *filep, FAR char *buffer, size_t buflen); + ssize_t (*write)(FAR struct file *filep, FAR const char *buffer, + size_t buflen); + off_t (*seek)(FAR struct file *filep, off_t offset, int whence); + int (*ioctl)(FAR struct file *filep, int cmd, unsigned long arg); + int (*mmap)(FAR struct file* filep, LosVmMapRegion *region); + /* The two structures need not be common after this point. The following + * are extended methods needed to deal with the unique needs of mounted + * file systems. + * + * Additional open-file-specific mountpoint operations: + */ + + int (*sync)(FAR struct file *filep); + int (*dup)(FAR const struct file *oldp, FAR struct file *newp); + int (*fstat)(FAR const struct file *filep, FAR struct stat *buf); + int (*truncate)(FAR struct file *filep, off_t length); + + /* Directory operations */ + + int (*opendir)(FAR struct inode *mountpt, FAR const char *relpath, + FAR struct fs_dirent_s *dir); + int (*closedir)(FAR struct inode *mountpt, + FAR struct fs_dirent_s *dir); + int (*readdir)(FAR struct inode *mountpt, + FAR struct fs_dirent_s *dir); + int (*rewinddir)(FAR struct inode *mountpt, + FAR struct fs_dirent_s *dir); + + /* General volume-related mountpoint operations: */ + + int (*bind)(FAR struct inode *blkdriver, FAR const void *data, + FAR void **handle, FAR const char *realpath); + int (*unbind)(FAR void *handle, FAR struct inode **blkdriver); + int (*statfs)(FAR struct inode *mountpt, FAR struct statfs *buf); + int (*virstatfs)(struct inode *mountpt, const char* relpath, struct statfs *buf); + + /* Operations on paths */ + + int (*unlink)(FAR struct inode *mountpt, FAR const char *relpath); + int (*mkdir)(FAR struct inode *mountpt, FAR const char *relpath, + mode_t mode); + int (*rmdir)(FAR struct inode *mountpt, FAR const char *relpath); + int (*rename)(FAR struct inode *mountpt, FAR const char *oldrelpath, + FAR const char *newrelpath); + int (*stat)(FAR struct inode *mountpt, FAR const char *relpath, + FAR struct stat *buf); + int (*utime)(FAR struct inode *mountpt, FAR const char *relpath, + FAR const struct tm *times); + int (*chattr)(FAR struct inode *mountpt, FAR const char *relpath, + struct IATTR *attr); + loff_t (*seek64)(FAR struct file *filep, loff_t offset, int whence); + int (*getlabel)(FAR void *handle, FAR char* label); + int (*fallocate)(FAR struct file *filep, int mode, off_t offset, off_t len); + int (*fallocate64)(FAR struct file *filep, int mode, off64_t offset, off64_t len); + int (*truncate64)(FAR struct file *filep, off64_t length); + int (*fscheck)(FAR struct inode *mountpt, FAR const char *relpath, + FAR struct fs_dirent_s *dir); + int (*map_pages)(LosVmMapRegion *region, LosVmPgFault *pgFault); + ssize_t (*readpage)(struct file *filep, char *buffer, size_t buflen); + ssize_t (*writepage)(struct file *filep, const char *buffer, size_t buflen); + /* NOTE: More operations will be needed here to support: disk usage + * stats file stat(), file attributes, file truncation, etc. + */ +}; +#endif /* CONFIG_DISABLE_MOUNTPOINT */ + +#ifdef LOSCFG_FS_FAT_VIRTUAL_PARTITION +#define _MAX_ENTRYLENGTH 16 /* MAX virtual partition name length */ +#define _MAX_VIRVOLUMES 5 /* MAX virtual partition number */ +typedef struct virtual_partition_info +{ + char *devpartpath; /* need set virtual partition, e.g. /dev/mmcblk0p0 */ + int virpartnum; /* virtual partition numbers, MAX number is 5 */ + double virpartpercent[_MAX_VIRVOLUMES]; /* every virtual partition percent,e.g 0.6,0.3,0.1 */ + char virpartname[_MAX_VIRVOLUMES][_MAX_ENTRYLENGTH + 1]; /* every virtual partition name, MAX length is 16 */ +} virpartinfo; +#endif + +struct fsmap_t +{ + const char *fs_filesystemtype; + const struct mountpt_operations *fs_mops; + const BOOL is_mtd_support; + const BOOL is_bdfs; +}; + +#define FSMAP_ENTRY(_l, _name, _mop, _is_mtd_support, _is_bdfs) \ +struct fsmap_t _l LOS_HAL_TABLE_ENTRY(fsmap) = \ +{ \ + _name, \ + &_mop, \ + _is_mtd_support, \ + _is_bdfs \ +} + +/* Named OS resources are also maintained by the VFS. This includes: + * + * - Named semaphores: sem_open(), sem_close(), and sem_unlink() + * - POSIX Message Queues: mq_open() and mq_close() + * - Shared memory: shm_open() and shm_unlink(); + * + * These are a special case in that they do not follow quite the same + * pattern as the other file system types in that they have operations. + */ + +/* These are the various kinds of operations that can be associated with + * an inode. + */ + +union inode_ops_u +{ + FAR const struct file_operations_vfs *i_ops; /* Driver operations for inode */ +#ifndef CONFIG_DISABLE_MOUNTPOINT + FAR const struct block_operations *i_bops; /* Block driver operations */ + FAR const struct mountpt_operations *i_mops; /* Operations on a mountpoint */ +#endif +#ifdef CONFIG_FS_NAMED_SEMAPHORES + FAR struct nsem_inode_s *i_nsem; /* Named semaphore */ +#endif +#ifndef CONFIG_DISABLE_MQUEUE + FAR struct mqueue_inode_s *i_mqueue; /* POSIX message queue */ +#endif +}; + +/* This structure represents one inode in the NuttX pseudo-file system */ + +typedef enum mount_status +{ + STAT_UNMOUNTED = 0, + STAT_MOUNTED, +} MOUNT_STATE; + +struct inode +{ + FAR struct inode *i_peer; /* Link to same level inode */ + FAR struct inode *i_child; /* Link to lower level inode */ + int16_t i_crefs; /* References to inode */ + uint16_t i_flags; /* Flags for inode */ + unsigned long mountflags; /* Flags for mount */ + union inode_ops_u u; /* Inode operations */ +#ifdef LOSCFG_FILE_MODE + unsigned int i_uid; + unsigned int i_gid; + mode_t i_mode; /* Access mode flags */ +#endif + FAR void *i_private; /* Per inode driver private data */ + MOUNT_STATE e_status; + char i_name[1]; /* Name of inode (variable) */ +}; + +#define FSNODE_SIZE(n) (sizeof(struct inode) + (n)) + +/* This is the underlying representation of an open file. A file + * descriptor is an index into an array of such types. The type associates + * the file descriptor to the file state and to a set of inode operations. + */ + +struct file +{ + unsigned int f_magicnum; /* file magic number */ + int f_oflags; /* Open mode flags */ + FAR struct inode *f_inode; /* Driver interface */ + loff_t f_pos; /* File position */ + unsigned long f_refcount; /* reference count */ + char *f_path; /* File fullpath */ + void *f_priv; /* Per file driver private data */ + const char *f_relpath; /* realpath */ + struct page_mapping *f_mapping; /* mapping file to memory */ + void *f_dir; /* DIR struct for iterate the directory if open a directory */ +}; + +/* This defines a list of files indexed by the file descriptor */ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +struct filelist +{ + sem_t fl_sem; /* Manage access to the file list */ + struct file fl_files[CONFIG_NFILE_DESCRIPTORS]; +}; + +extern struct filelist tg_filelist; +#endif + +/* The following structure defines the list of files used for standard C I/O. + * Note that NuttX can support the standard C APIs with or without buffering + * + * When buffering is used, the following describes the usage of the I/O buffer. + * The buffer can be used for reading or writing -- but not both at the same time. + * An fflush is implied between each change in direction of access. + * + * The field fs_bufread determines whether the buffer is being used for reading or + * for writing as follows: + * + * BUFFER + * +----------------------+ <- fs_bufstart Points to the beginning of the buffer. + * | WR: Buffered data | WR: Start of buffered write data. + * | RD: Already read | RD: Start of already read data. + * +----------------------+ + * | WR: Available buffer | <- fs_bufpos Points to next byte: + * | RD: Read-ahead data | WR: End+1 of buffered write data. + * | | RD: Points to next char to return + * +----------------------+ + * | WR: Available | <- fs_bufread Top+1 of buffered read data + * | RD: Available | WR: bufstart buffer used for writing. + * | | RD: Pointer to last buffered read char+1 + * +----------------------+ + * <- fs_bufend Points to the end of the buffer+1 + */ + +#if CONFIG_NFILE_STREAMS > 0 +struct file_struct +{ + int fs_fd; /* File descriptor associated with stream */ +#if CONFIG_STDIO_BUFFER_SIZE > 0 + sem_t fs_sem; /* For thread safety */ + pid_t fs_holder; /* Holder of sem */ + int fs_counts; /* Number of times sem is held */ + FAR unsigned char *fs_bufstart; /* Pointer to start of buffer */ + FAR unsigned char *fs_bufend; /* Pointer to 1 past end of buffer */ + FAR unsigned char *fs_bufpos; /* Current position in buffer */ + FAR unsigned char *fs_bufread; /* Pointer to 1 past last buffered read char. */ +#endif + uint16_t fs_oflags; /* Open mode flags */ + uint8_t fs_flags; /* Stream flags */ +#if CONFIG_NUNGET_CHARS > 0 + uint8_t fs_nungotten; /* The number of characters buffered for ungetc */ + unsigned char fs_ungotten[CONFIG_NUNGET_CHARS]; +#endif +}; + +struct streamlist +{ + sem_t sl_sem; /* For thread safety */ + struct file_struct sl_streams[CONFIG_NFILE_STREAMS]; +}; + +extern struct streamlist tg_streamlist; +#endif /* CONFIG_NFILE_STREAMS */ + +/**************************************************************************** + * Name: fs_initialize + * + * Description: + * This is called from the OS initialization logic to configure the file + * system. + * + ****************************************************************************/ + +void fs_initialize(void); + +/**************************************************************************** + * Name: register_driver + * + * Description: + * Register a character driver inode the pseudo file system. + * + * Input Parameters: + * path - The path to the inode to create + * fops - The file operations structure + * mode - Access privileges (not used) + * priv - Private, user data that will be associated with the inode. + * + * Returned Value: + * Zero on success (with the inode point in 'inode'); A negated errno + * value is returned on a failure (all error values returned by + * inode_reserve): + * + * EINVAL - 'path' is invalid for this operation + * EEXIST - An inode already exists at 'path' + * ENOMEM - Failed to allocate in-memory resources for the operation + * + * Attention: + * This function should be called after los_vfs_init has been called. + * The parameter path must point a valid string, which end with the terminating null byte. + * The total length of parameter path must less than the value defined by PATH_MAX. + * The prefix of the parameter path must be /dev/. + * The fops must pointed the right functions, otherwise the system will crash when the device is being operated. + * + ****************************************************************************/ + +int register_driver(FAR const char *path, + FAR const struct file_operations_vfs *fops, mode_t mode, + FAR void *priv); + +/**************************************************************************** + * Name: register_blockdriver + * + * Description: + * Register a block driver inode the pseudo file system. + * + * Attention: + * This function should be called after los_vfs_init has been called. + * The parameter path must point a valid string, which end with the terminating null byte. + * The length of parameter path must be less than the value defined by PATH_MAX. + * The prefix of the parameter path must be '/dev/'. + * The bops must pointed the right functions, otherwise the system will crash when the device is being operated. + * + * Input Parameters: + * path - The path to the inode to create + * bops - The block driver operations structure + * mode - Access privileges (not used) + * priv - Private, user data that will be associated with the inode. + * + * Returned Value: + * Zero on success (with the inode point in 'inode'); A negated errno + * value is returned on a failure (all error values returned by + * inode_reserve): + * + * EINVAL - 'path' is invalid for this operation + * EEXIST - An inode already exists at 'path' + * ENOMEM - Failed to allocate in-memory resources for the operation + * + ****************************************************************************/ + +#ifndef CONFIG_DISABLE_MOUNTPOINT +int register_blockdriver(FAR const char *path, + FAR const struct block_operations *bops, + mode_t mode, FAR void *priv); +#endif + +/**************************************************************************** + * Name: unregister_driver + * + * Description: + * Remove the character driver inode at 'path' from the pseudo-file system + * + * Returned Value: + * Zero on success (with the inode point in 'inode'); A negated errno + * value is returned on a failure (all error values returned by + * inode_reserve): + * + * EBUSY - Resource is busy ,not permit for this operation. + * ENOENT - 'path' is invalid for this operation. + * + * Attention: + * This function should be called after register_blockdriver has been called. + * The parameter path must point a valid string, which end with the terminating null byte. + * The total length of parameter path must less than the value defined by PATH_MAX. + * The block device node referred by parameter path must be really exist. + ****************************************************************************/ + +int unregister_driver(FAR const char *path); + +/**************************************************************************** + * Name: unregister_blockdriver + * + * Description: + * Remove the block driver inode at 'path' from the pseudo-file system + * + * Input Parameters: + * path - The path that the inode to be destroyed. + * + * Returned Value: + * Zero on success (with the inode point in 'inode'); A negated errno + * value is returned on a failure (all error values returned by + * inode_reserve): + * + * EBUSY - Resource is busy ,not permit for this operation. + * ENOENT - 'path' is invalid for this operation. + * + * Attention: + * This function should be called after register_blockdriver has been called. + * The parameter path must point a valid string, which end with the terminating null byte. + * The total length of parameter path must less than the value defined by PATH_MAX. + * The block device node referred by parameter path must be really exist. + * + ****************************************************************************/ + +int unregister_blockdriver(FAR const char *path); + +/**************************************************************************** + * Name: files_initlist + * + * Description: + * Initializes the list of files for a new task + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +void files_initlist(FAR struct filelist *list); +#endif + +/**************************************************************************** + * Name: files_releaselist + * + * Description: + * Release a reference to the file list + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +void files_releaselist(FAR struct filelist *list); +#endif + +/**************************************************************************** + * Name: file_dup2 + * + * Description: + * Assign an inode to a specific files structure. This is the heart of + * dup2. + * + * Equivalent to the non-standard fs_dupfd2() function except that it + * accepts struct file instances instead of file descriptors and it does + * not set the errno variable. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is return on + * any failure. + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +int file_dup2(FAR struct file *filep1, FAR struct file *filep2); +#endif + +/**************************************************************************** + * Name: fs_dupfd OR dup + * + * Description: + * Clone a file descriptor 'fd' to an arbitrary descriptor number (any value + * greater than or equal to 'minfd'). If socket descriptors are + * implemented, then this is called by dup() for the case of file + * descriptors. If socket descriptors are not implemented, then this + * function IS dup(). + * + * This alternative naming is used when dup could operate on both file and + * socket descriptors to avoid drawing unused socket support into the link. + * + * Returned Value: + * fs_dupfd is sometimes an OS internal function and sometimes is a direct + * substitute for dup(). So it must return an errno value as though it + * were dup(). + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +int fs_dupfd(int fd, int minfd); +#endif + +/**************************************************************************** + * Name: file_dup + * + * Description: + * Equivalent to the non-standard fs_dupfd() function except that it + * accepts a struct file instance instead of a file descriptor and does + * not set the errno variable. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure. + * + ****************************************************************************/ + +int file_dup(FAR struct file *filep, int minfd); + +/**************************************************************************** + * Name: fs_dupfd2 OR dup2 + * + * Description: + * Clone a file descriptor to a specific descriptor number. If socket + * descriptors are implemented, then this is called by dup2() for the + * case of file descriptors. If socket descriptors are not implemented, + * then this function IS dup2(). + * + * This alternative naming is used when dup2 could operate on both file and + * socket descriptors to avoid drawing unused socket support into the link. + * + * Returned Value: + * fs_dupfd2 is sometimes an OS internal function and sometimes is a direct + * substitute for dup2(). So it must return an errno value as though it + * were dup2(). + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +int fs_dupfd2(int fd1, int fd2); +#endif + + +/**************************************************************************** + * Name: open_blockdriver + * + * Description: + * Return the inode of the block driver specified by 'pathname' + * + * Input Parameters: + * pathname - the full path to the block driver to be opened + * mountflags - if MS_RDONLY is not set, then driver must support write + * operations (see include/sys/mount.h) + * ppinode - address of the location to return the inode reference + * + * Returned Value: + * Returns zero on success or a negated errno on failure: + * + * EINVAL - pathname or pinode is NULL + * ENOENT - No block driver of this name is registered + * ENOTBLK - The inode associated with the pathname is not a block driver + * EACCESS - The MS_RDONLY option was not set but this driver does not + * support write access + * + * Aattention: + * The parameter path must point a valid string, which end with the terminating null byte. + * The total length of parameter path must less than the value defined by PATH_MAX. + * The parameter ppinode must point a valid memory, which size must be enough for storing struct inode. + + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +int open_blockdriver(FAR const char *pathname, int mountflags, + FAR struct inode **ppinode); +#endif + +/**************************************************************************** + * Name: close_blockdriver + * + * Description: + * Call the close method and release the inode + * + * Input Parameters: + * inode - reference to the inode of a block driver opened by open_blockdriver + * + * Returned Value: + * Returns zero on success or a negated errno on failure: + * + * EINVAL - inode is NULL + * ENOTBLK - The inode is not a block driver + * + * Attention: + * This function should be called after open_blockdriver has been called. + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +int close_blockdriver(FAR struct inode *inode); +#endif + +/**************************************************************************** + * Name: fs_ioctl + * + * Description: + * Perform device specific operations. + * + * Input Parameters: + * fd File/socket descriptor of device + * req The ioctl command + * arg The argument of the ioctl cmd + * + * Returned Value: + * >=0 on success (positive non-zero values are cmd-specific) + * -1 on failure with errno set properly: + * + * EBADF + * 'fd' is not a valid descriptor. + * EFAULT + * 'arg' references an inaccessible memory area. + * EINVAL + * 'cmd' or 'arg' is not valid. + * ENOTTY + * 'fd' is not associated with a character special device. + * ENOTTY + * The specified request does not apply to the kind of object that the + * descriptor 'fd' references. + * + ****************************************************************************/ + +#ifdef CONFIG_LIBC_IOCTL_VARIADIC +int fs_ioctl(int fd, int req, unsigned long arg); +#endif + +/**************************************************************************** + * Name: fs_fdopen + * + * Description: + * This function does the core operations for fopen and fdopen. It is + * used by the OS to clone stdin, stdout, stderr + * + ****************************************************************************/ + +#if CONFIG_NFILE_STREAMS > 0 +struct tcb_s; /* Forward reference */ +FAR struct file_struct *fs_fdopen(int fd, int oflags); +#endif + +/**************************************************************************** + * Name: lib_flushall + * + * Description: + * Called either (1) by the OS when a task exits, or (2) from fflush() + * when a NULL stream argument is provided. + * + ****************************************************************************/ + +#if CONFIG_NFILE_STREAMS > 0 +int lib_flushall(FAR struct streamlist *list); +#endif + +/**************************************************************************** + * Name: lib_sendfile + * + * Description: + * Transfer a file + * + ****************************************************************************/ + +#ifdef CONFIG_NET_SENDFILE +ssize_t lib_sendfile(int outfd, int infd, off_t *offset, size_t count); +#endif + +/**************************************************************************** + * Name: fs_getfilep + * + * Description: + * Given a file descriptor, return the corresponding instance of struct + * file. NOTE that this function will currently fail if it is provided + * with a socket descriptor. + * + * Input Parameters: + * fd - The file descriptor + * filep - The location to return the struct file instance + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure. + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +int fs_getfilep(int fd, FAR struct file **filep); +#endif + +/**************************************************************************** + * Name: file_read + * + * Description: + * file_read() is an internal OS interface. It is functionally similar to + * the standard read() interface except: + * + * - It does not modify the errno variable, + * - It is not a cancellation point, + * - It does not handle socket descriptors, and + * - It accepts a file structure instance instead of file descriptor. + * + * Input Parameters: + * filep - File structure instance + * buf - User-provided to save the data + * nbytes - The maximum size of the user-provided buffer + * + * Returned Value: + * The positive non-zero number of bytes read on success, 0 on if an + * end-of-file condition, or a negated errno value on any failure. + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +ssize_t file_read(FAR struct file *filep, FAR void *buf, size_t nbytes); +#endif + +/**************************************************************************** + * Name: file_write + * + * Description: + * Equivalent to the standard write() function except that is accepts a + * struct file instance instead of a file descriptor. Currently used + * only by aio_write(); + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +ssize_t file_write(FAR struct file *filep, FAR const void *buf, size_t nbytes); +#endif + +/**************************************************************************** + * Name: file_pread + * + * Description: + * Equivalent to the standard pread function except that is accepts a + * struct file instance instead of a file descriptor. Currently used + * only by aio_read(); + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +ssize_t file_pread(FAR struct file *filep, FAR void *buf, size_t nbytes, + off_t offset); +#endif + +/**************************************************************************** + * Name: file_pwrite + * + * Description: + * Equivalent to the standard pwrite function except that is accepts a + * struct file instance instead of a file descriptor. Currently used + * only by aio_write(); + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +ssize_t file_pwrite(FAR struct file *filep, FAR const void *buf, + size_t nbytes, off_t offset); +#endif + +/**************************************************************************** + * Name: file_seek + * + * Description: + * Equivalent to the standard lseek() function except that is accepts a + * struct file instance instead of a file descriptor. Currently used + * only by net_sendfile() + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +off_t file_seek(FAR struct file *filep, off_t offset, int whence); +#endif + +/**************************************************************************** + * Name: file_fsync + * + * Description: + * Equivalent to the standard fsync() function except that is accepts a + * struct file instance instead of a file descriptor and it does not set + * the errno variable. + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +int file_fsync(FAR struct file *filep); +#endif + +/**************************************************************************** + * Name: file_vfcntl + * + * Description: + * Similar to the standard vfcntl function except that is accepts a struct + * struct file instance instead of a file descriptor. + * + * Input Parameters: + * filep - Instance for struct file for the opened file. + * cmd - Indentifies the operation to be performed. + * ap - Variable argument following the command. + * + * Returned Value: + * The nature of the return value depends on the command. Non-negative + * values indicate success. Failures are reported as negated errno + * values. + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +int file_vfcntl(FAR struct file *filep, int cmd, va_list ap); +#endif + +/**************************************************************************** + * Name: file_seek64 + * + * Description: + * Equivalent to the standard lseek64() function except that is accepts a + * struct file instance instead of a file descriptor. Currently used + * only by net_sendfile() + * + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +off64_t file_seek64(FAR struct file *filep, off64_t offset, int whence); +#endif + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ +#endif /* __INCLUDE_FS_FS_H */ diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h new file mode 100755 index 0000000..0154500 --- /dev/null +++ b/include/nuttx/net/net.h @@ -0,0 +1,1504 @@ +/**************************************************************************** + * include/nuttx/net/net.h + * + * Copyright (C) 2007, 2009-2014, 2016-2018 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __INCLUDE_NUTTX_NET_NET_H +#define __INCLUDE_NUTTX_NET_NET_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" +#ifdef LOSCFG_NET_LWIP_SACK + +#include +#include + +#include +#include +#include "lwip/sockets.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Most internal network OS interfaces are not available in the user space in + * PROTECTED and KERNEL builds. In that context, the corresponding + * application network interfaces must be used. The differences between the + * two sets of interfaces are: The internal OS interfaces (1) do not cause + * cancellation points and (2) they do not modify the errno variable. + * + * This is only important when compiling libraries (libc or libnx) that are + * used both by the OS (libkc.a and libknx.a) or by the applications + * (libuc.a and libunx.a). The that case, the correct interface must be + * used for the build context. + * + * REVISIT: In the flat build, the same functions must be used both by + * the OS and by applications. We have to use the normal user functions + * in this case or we will fail to set the errno or fail to create the + * cancellation point. + * + * The interfaces accept(), read(), recv(), recvfrom(), write(), send(), + * sendto() are all cancellation points. + * + * REVISIT: These cancellation points are an issue and may cause + * violations: It use of these internally will cause the calling function + * to become a cancellation points! + */ + +#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) +# define _NX_SEND(s,b,l,f) nx_send(s,b,l,f) +# define _NX_RECV(s,b,l,f) nx_recv(s,b,l,f) +# define _NX_RECVFROM(s,b,l,f,a,n) nx_recvfrom(s,b,l,f,a,n) +# define _NX_GETERRNO(r) (-(r)) +# define _NX_GETERRVAL(r) (r) +#else +# define _NX_SEND(s,b,l,f) send(s,b,l,f) +# define _NX_RECV(s,b,l,f) recv(s,b,l,f) +# define _NX_RECVFROM(s,b,l,f,a,n) recvfrom(s,b,l,f,a,n) +# define _NX_GETERRNO(r) errno +# define _NX_GETERRVAL(r) (-errno) +#endif + +/* Socket descriptors are the index into the TCB sockets list, offset by the + * following amount. This offset is used to distinguish file descriptors from + * socket descriptors + */ + +#define __SOCKFD_OFFSET CONFIG_NFILE_DESCRIPTORS + +/* Capabilities of a socket */ + +#define SOCKCAP_NONBLOCKING (1 << 0) /* Bit 0: Socket supports non-blocking + * operation. */ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* Link layer type. This type is used with netdev_register in order to + * identify the type of the network driver. + */ + +enum net_lltype_e +{ + NET_LL_ETHERNET = 0, /* Ethernet */ + NET_LL_SLIP, /* Serial Line Internet Protocol (SLIP) */ + NET_LL_PPP /* Point-to-Point Protocol (PPP) */ +}; + +/* This defines a bitmap big enough for one bit for each socket option */ + +typedef uint16_t sockopt_t; + +/* This defines the storage size of a timeout value. This effects only + * range of supported timeout values. With an LSB in seciseconds, the + * 16-bit maximum of 65535 corresponds to 1 hr 49 min 13.5 sec at decisecond + * resolution. + */ + +typedef uint16_t socktimeo_t; + +/* This type defines the type of the socket capabilities set */ + +typedef uint8_t sockcaps_t; + +/* This callbacks are socket operations that may be performed on a socket of + * a given address family. + */ + +struct file; /* Forward reference */ +struct socket; /* Forward reference */ +struct pollfd; /* Forward reference */ + +struct sock_intf_s +{ + CODE int (*si_setup)(FAR struct socket *psock, int protocol); + CODE sockcaps_t (*si_sockcaps)(FAR struct socket *psock); + CODE void (*si_addref)(FAR struct socket *psock); + CODE int (*si_bind)(FAR struct socket *psock, + FAR const struct sockaddr *addr, socklen_t addrlen); + CODE int (*si_getsockname)(FAR struct socket *psock, + FAR struct sockaddr *addr, FAR socklen_t *addrlen); + CODE int (*si_getpeername)(FAR struct socket *psock, + FAR struct sockaddr *addr, FAR socklen_t *addrlen); + CODE int (*si_listen)(FAR struct socket *psock, int backlog); + CODE int (*si_connect)(FAR struct socket *psock, + FAR const struct sockaddr *addr, socklen_t addrlen); + CODE int (*si_accept)(FAR struct socket *psock, + FAR struct sockaddr *addr, FAR socklen_t *addrlen, + FAR struct socket *newsock); + CODE int (*si_poll)(FAR struct socket *psock, + FAR struct pollfd *fds, bool setup); + CODE ssize_t (*si_send)(FAR struct socket *psock, FAR const void *buf, + size_t len, int flags); + CODE ssize_t (*si_sendto)(FAR struct socket *psock, FAR const void *buf, + size_t len, int flags, FAR const struct sockaddr *to, + socklen_t tolen); +#ifdef CONFIG_NET_SENDFILE + CODE ssize_t (*si_sendfile)(FAR struct socket *psock, + FAR struct file *infile, FAR off_t *offset, + size_t count); +#endif + CODE ssize_t (*si_recvfrom)(FAR struct socket *psock, FAR void *buf, + size_t len, int flags, FAR struct sockaddr *from, + FAR socklen_t *fromlen); + CODE int (*si_close)(FAR struct socket *psock); +#ifdef CONFIG_NET_USRSOCK + CODE int (*si_ioctl)(FAR struct socket *psock, int cmd, + FAR void *arg, size_t arglen); +#endif +}; + +/* Each socket refers to a connection structure of type FAR void *. Each + * socket type will have a different connection structure type bound to its + * sockets. The fields at the the beginning of each connection type must + * begin the same content prologue as struct socket_conn_s and must be cast + * compatible with struct socket_conn_s. Connection-specific content may + * then follow the common prologue fields. + */ + +struct devif_callback_s; /* Forward reference */ + +/* This is the internal representation of a socket reference by a file + * descriptor. + */ + +struct devif_callback_s; /* Forward reference */ + +struct socket +{ + int16_t s_crefs; /* Reference count on the socket */ + uint8_t s_domain; /* IP domain: PF_INET, PF_INET6, or PF_PACKET */ + uint8_t s_type; /* Protocol type: Only SOCK_STREAM or + * SOCK_DGRAM */ + uint8_t s_flags; /* See _SF_* definitions */ + + /* Socket options */ + +#ifdef CONFIG_NET_SOCKOPTS + sockopt_t s_options; /* Selected socket options */ + socktimeo_t s_rcvtimeo; /* Receive timeout value (in deciseconds) */ + socktimeo_t s_sndtimeo; /* Send timeout value (in deciseconds) */ +#ifdef CONFIG_NET_SOLINGER + socktimeo_t s_linger; /* Linger timeout value (in deciseconds) */ +#endif +#endif + + void *s_conn; /* Connection inherits from struct socket_conn_s */ + + /* Socket interface */ + + FAR const struct sock_intf_s *s_sockif; + +#if defined(CONFIG_NET_TCP_WRITE_BUFFERS) || \ + defined(CONFIG_NET_UDP_WRITE_BUFFERS) + /* Callback instance for TCP send() or UDP sendto() */ + + struct devif_callback_s *s_sndcb; +#endif +}; + +/* Callback from netdev_foreach() */ + +struct net_driver_s; /* Forward reference. Defined in net/netdev.h */ +typedef int (*netdev_callback_t)(struct net_driver_s *dev, void *arg); + +#ifdef CONFIG_NET_NOINTS + +/* Semaphore based locking for non-interrupt based logic. + * + * net_lock_t -- Not used. Only for compatibility + */ + +typedef uint8_t net_lock_t; /* Not really used */ + +#else + +/* Enable/disable locking for interrupt based logic: + * + * net_lock_t -- The processor specific representation of interrupt state. + */ + +# define net_lock_t irqstate_t +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: net_initialize + * + * Description: + * This is called from the OS initialization logic at power-up reset in + * order to configure networking data structures. This is called prior + * to platform-specific driver initialization so that the networking + * subsystem is prepared to deal with network driver initialization + * actions. + * + * Actions performed in this initialization phase assume that base OS + * facilities such as semaphores are available but this logic cannot + * depend upon OS resources such as interrupts or timers which are not + * yet available. + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +void net_initialize(void); + +/**************************************************************************** + * Critical section management. + * + * Re-entrant mutex based locking of the network is supported: + * + * net_lock() - Locks the network via a re-entrant mutex. + * net_unlock() - Unlocks the network. + * net_lockedwait() - Like pthread_cond_wait() except releases the + * network momentarily to wait on another semaphore. + * net_ioballoc() - Like iob_alloc() except releases the network + * momentarily to wait for an IOB to become + * available. + * + ****************************************************************************/ + +/**************************************************************************** + * Name: net_lock + * + * Description: + * Take the network lock + * + * Input Parameters: + * None + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * failured (probably -ECANCELED). + * + ****************************************************************************/ + +int net_lock(void); + +/**************************************************************************** + * Name: net_unlock + * + * Description: + * Release the network lock. + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +void net_unlock(void); + +/**************************************************************************** + * Name: net_timedwait + * + * Description: + * Atomically wait for sem (or a timeout( while temporarily releasing + * the lock on the network. + * + * Caution should be utilized. Because the network lock is relinquished + * during the wait, there could changes in the network state that occur + * before the lock is recovered. Your design should account for this + * possibility. + * + * Input Parameters: + * sem - A reference to the semaphore to be taken. + * abstime - The absolute time to wait until a timeout is declared. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure. + * + ****************************************************************************/ + +struct timespec; +int net_timedwait(sem_t *sem, FAR const struct timespec *abstime); + +/**************************************************************************** + * Name: net_lockedwait + * + * Description: + * Atomically wait for sem while temporarily releasing the network lock. + * + * Caution should be utilized. Because the network lock is relinquished + * during the wait, there could changes in the network state that occur + * before the lock is recovered. Your design should account for this + * possibility. + * + * Input Parameters: + * sem - A reference to the semaphore to be taken. + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure. + * + ****************************************************************************/ + +int net_lockedwait(sem_t *sem); + +/**************************************************************************** + * Name: net_ioballoc + * + * Description: + * Allocate an IOB. If no IOBs are available, then atomically wait for + * for the IOB while temporarily releasing the lock on the network. + * + * Caution should be utilized. Because the network lock is relinquished + * during the wait, there could changes in the network state that occur + * before the lock is recovered. Your design should account for this + * possibility. + * + * Input Parameters: + * throttled - An indication of the IOB allocation is "throttled" + * + * Returned Value: + * A pointer to the newly allocated IOB is returned on success. NULL is + * returned on any allocation failure. + * + ****************************************************************************/ + +#ifdef CONFIG_MM_IOB +FAR struct iob_s *net_ioballoc(bool throttled, enum iob_user_e consumerid); +#endif + +/**************************************************************************** + * Name: net_setipid + * + * Description: + * This function may be used at boot time to set the initial ip_id. + * + * Assumptions: + * + ****************************************************************************/ + +void net_setipid(uint16_t id); + +/**************************************************************************** + * Name: net_checksd + * + * Description: + * Check if the socket descriptor is valid for the provided TCB and if it + * supports the requested access. This trivial operation is part of the + * fdopen() operation when the fdopen() is performed on a socket descriptor. + * It simply performs some sanity checking before permitting the socket + * descriptor to be wrapped as a C FILE stream. + * + ****************************************************************************/ + +int net_checksd(int fd, int oflags); + + + + +/**************************************************************************** + * Name: sockfd_socket + * + * Description: + * Given a socket descriptor, return the underlying socket structure. + * + * Input Parameters: + * sockfd - The socket descriptor index o use. + * + * Returned Value: + * On success, a reference to the socket structure associated with the + * the socket descriptor is returned. NULL is returned on any failure. + * + ****************************************************************************/ + +struct socket *sockfd_socket(int sockfd); + +/**************************************************************************** + * Name: psock_socket + * + * Description: + * socket() creates an endpoint for communication and returns a socket + * structure. + * + * Input Parameters: + * domain (see sys/socket.h) + * type (see sys/socket.h) + * protocol (see sys/socket.h) + * psock A pointer to a user allocated socket structure to be + * initialized. + * + * Returned Value: + * Returns zero (OK) on success. On failure, it returns a negated errno + * value to indicate the nature of the error: + * + * EACCES + * Permission to create a socket of the specified type and/or protocol + * is denied. + * EAFNOSUPPORT + * The implementation does not support the specified address family. + * EINVAL + * Unknown protocol, or protocol family not available. + * EMFILE + * Process file table overflow. + * ENFILE + * The system limit on the total number of open files has been reached. + * ENOBUFS or ENOMEM + * Insufficient memory is available. The socket cannot be created until + * sufficient resources are freed. + * EPROTONOSUPPORT + * The protocol type or the specified protocol is not supported within + * this domain. + * + * Assumptions: + * + ****************************************************************************/ + +int psock_socket(int domain, int type, int protocol, + struct socket *psock); + +/**************************************************************************** + * Name: net_close + * + * Description: + * Performs the close operation on socket descriptors + * + * Input Parameters: + * sockfd Socket descriptor of socket + * + * Returned Value: + * Returns zero (OK) on success. On failure, it returns a negated errno + * value to indicate the nature of the error. + * + * Assumptions: + * + ****************************************************************************/ + +int net_close(int sockfd); + +/**************************************************************************** + * Name: psock_close + * + * Description: + * Performs the close operation on a socket instance + * + * Input Parameters: + * psock Socket instance + * + * Returned Value: + * Returns zero (OK) on success. On failure, it returns a negated errno + * value to indicate the nature of the error. + * + ****************************************************************************/ + +int psock_close(struct socket *psock); + +/**************************************************************************** + * Name: psock_bind + * + * Description: + * bind() gives the socket 'psock' the local address 'addr'. 'addr' is + * 'addrlen' bytes long. Traditionally, this is called "assigning a name to + * a socket." When a socket is created with socket, it exists in a name + * space (address family) but has no name assigned. + * + * Input Parameters: + * psock Socket structure of the socket to bind + * addr Socket local address + * addrlen Length of 'addr' + * + * Returned Value: + * Returns zero (OK) on success. On failure, it returns a negated errno + * value to indicate the nature of the error. + * + * EACCES + * The address is protected, and the user is not the superuser. + * EADDRINUSE + * The given address is already in use. + * EINVAL + * The socket is already bound to an address. + * ENOTSOCK + * psock is a descriptor for a file, not a socket. + * + * Assumptions: + * + ****************************************************************************/ + +struct sockaddr; /* Forward reference. See nuttx/include/sys/socket.h */ +int psock_bind(struct socket *psock, const struct sockaddr *addr, + socklen_t addrlen); + +/**************************************************************************** + * Name: psock_listen + * + * Description: + * To accept connections, a socket is first created with psock_socket(), a + * willingness to accept incoming connections and a queue limit for + * incoming connections are specified with psock_listen(), and then the + * connections are accepted with psock_accept(). The psock_listen() call + * applies only to sockets of type SOCK_STREAM or SOCK_SEQPACKET. + * + * Input Parameters: + * psock Reference to an internal, boound socket structure. + * backlog The maximum length the queue of pending connections may grow. + * If a connection request arrives with the queue full, the client + * may receive an error with an indication of ECONNREFUSED or, + * if the underlying protocol supports retransmission, the request + * may be ignored so that retries succeed. + * + * Returned Value: + * Returns zero (OK) on success. On failure, it returns a negated errno + * value to indicate the nature of the error. + * + * EADDRINUSE + * Another socket is already listening on the same port. + * EOPNOTSUPP + * The socket is not of a type that supports the listen operation. + * + ****************************************************************************/ + +int psock_listen(FAR struct socket *psock, int backlog); + +/**************************************************************************** + * Name: psock_accept + * + * Description: + * The psock_accept function is used with connection-based socket types + * (SOCK_STREAM, SOCK_SEQPACKET and SOCK_RDM). It extracts the first + * connection request on the queue of pending connections, creates a new + * connected socket with mostly the same properties as 'sockfd', and + * allocates a new socket descriptor for the socket, which is returned. The + * newly created socket is no longer in the listening state. The original + * socket 'sockfd' is unaffected by this call. Per file descriptor flags + * are not inherited across an psock_accept. + * + * The 'sockfd' argument is a socket descriptor that has been created with + * socket(), bound to a local address with bind(), and is listening for + * connections after a call to listen(). + * + * On return, the 'addr' structure is filled in with the address of the + * connecting entity. The 'addrlen' argument initially contains the size + * of the structure pointed to by 'addr'; on return it will contain the + * actual length of the address returned. + * + * If no pending connections are present on the queue, and the socket is + * not marked as non-blocking, psock_accept blocks the caller until a + * connection is present. If the socket is marked non-blocking and no + * pending connections are present on the queue, psock_accept returns + * EAGAIN. + * + * Input Parameters: + * psock Reference to the listening socket structure + * addr Receives the address of the connecting client + * addrlen Input: allocated size of 'addr', Return: returned size of 'addr' + * newsock Location to return the accepted socket information. + * + * Returned Value: + * Returns zero (OK) on success. On failure, it returns a negated errno + * value to indicate the nature of the error. + * + * EAGAIN or EWOULDBLOCK + * The socket is marked non-blocking and no connections are present to + * be accepted. + * EOPNOTSUPP + * The referenced socket is not of type SOCK_STREAM. + * EINTR + * The system call was interrupted by a signal that was caught before + * a valid connection arrived. + * ECONNABORTED + * A connection has been aborted. + * EINVAL + * Socket is not listening for connections. + * EMFILE + * The per-process limit of open file descriptors has been reached. + * ENFILE + * The system maximum for file descriptors has been reached. + * EFAULT + * The addr parameter is not in a writable part of the user address + * space. + * ENOBUFS or ENOMEM + * Not enough free memory. + * EPROTO + * Protocol error. + * EPERM + * Firewall rules forbid connection. + * + ****************************************************************************/ + +int psock_accept(FAR struct socket *psock, FAR struct sockaddr *addr, + FAR socklen_t *addrlen, FAR struct socket *newsock); + +/**************************************************************************** + * Name: psock_connect + * + * Description: + * connect() connects the socket referred to by the structure 'psock' + * to the address specified by 'addr'. The addrlen argument specifies + * the size of 'addr'. The format of the address in 'addr' is + * determined by the address space of the socket 'psock'. + * + * If the socket 'psock' is of type SOCK_DGRAM then 'addr' is the address + * to which datagrams are sent by default, and the only address from which + * datagrams are received. If the socket is of type SOCK_STREAM or + * SOCK_SEQPACKET, this call attempts to make a connection to the socket + * that is bound to the address specified by 'addr'. + * + * Generally, connection-based protocol sockets may successfully connect() + * only once; connectionless protocol sockets may use connect() multiple + * times to change their association. Connectionless sockets may dissolve + * the association by connecting to an address with the sa_family member of + * sockaddr set to AF_UNSPEC. + * + * Input Parameters: + * psock Pointer to a socket structure initialized by psock_socket() + * addr Server address (form depends on type of socket) + * addrlen Length of actual 'addr' + * + * Returned Value: + * Returns zero (OK) on success. On failure, it returns a negated errno + * value to indicate the nature of the error. + * + * EACCES, EPERM + * The user tried to connect to a broadcast address without having the + * socket broadcast flag enabled or the connection request failed + * because of a local firewall rule. + * EADDRINUSE + * Local address is already in use. + * EAFNOSUPPORT + * The passed address didn't have the correct address family in its + * sa_family field. + * EAGAIN + * No more free local ports or insufficient entries in the routing + * cache. + * EALREADY + * The socket is non-blocking and a previous connection attempt has + * not yet been completed. + * EBADF + * The file descriptor is not a valid index in the descriptor table. + * ECONNREFUSED + * No one listening on the remote address. + * EFAULT + * The socket structure address is outside the user's address space. + * EINPROGRESS + * The socket is non-blocking and the connection cannot be completed + * immediately. + * EINTR + * The system call was interrupted by a signal that was caught. + * EISCONN + * The socket is already connected. + * ENETUNREACH + * Network is unreachable. + * ENOTSOCK + * The file descriptor is not associated with a socket. + * ETIMEDOUT + * Timeout while attempting connection. The server may be too busy + * to accept new connections. + * + * Assumptions: + * + ****************************************************************************/ + +int psock_connect(struct socket *psock, const struct sockaddr *addr, + socklen_t addrlen); + +/**************************************************************************** + * Name: psock_send + * + * Description: + * The psock_send() call may be used only when the socket is in a + * connected state (so that the intended recipient is known). This is an + * internal OS interface. It is functionally equivalent to send() except + * that: + * + * - It is not a cancellation point, + * - It does not modify the errno variable, and + * - I accepts the internal socket structure as an input rather than an + * task-specific socket descriptor. + * + * See comments with send() for more a more complete description of the + * functionality. + * + * Input Parameters: + * psock - An instance of the internal socket structure. + * buf - Data to send + * len - Length of data to send + * flags - Send flags + * + * Returned Value: + * On success, returns the number of characters sent. On any failure, a + * negated errno value is returned (See comments with send() for a list + * of the appropriate errno value). + * + ****************************************************************************/ + +ssize_t psock_send(FAR struct socket *psock, const void *buf, size_t len, + int flags); + +/**************************************************************************** + * Name: nx_send + * + * Description: + * The nx_send() call may be used only when the socket is in a + * connected state (so that the intended recipient is known). This is an + * internal OS interface. It is functionally equivalent to send() except + * that: + * + * - It is not a cancellation point, and + * - It does not modify the errno variable. + * + * See comments with send() for more a more complete description of the + * functionality. + * + * Input Parameters: + * sockfd - Socket descriptor of the socket + * buf - Data to send + * len - Length of data to send + * flags - Send flags + * + * Returned Value: + * On success, returns the number of characters sent. On any failure, a + * negated errno value is returned (See comments with send() for a list + * of the appropriate errno value). + * + ****************************************************************************/ + +ssize_t nx_send(int sockfd, FAR const void *buf, size_t len, int flags); + +/**************************************************************************** + * Name: psock_sendto + * + * Description: + * If sendto() is used on a connection-mode (SOCK_STREAM, SOCK_SEQPACKET) + * socket, the parameters to and 'tolen' are ignored (and the error EISCONN + * may be returned when they are not NULL and 0), and the error ENOTCONN is + * returned when the socket was not actually connected. + * + * Input Parameters: + * psock A pointer to a NuttX-specific, internal socket structure + * buf Data to send + * len Length of data to send + * flags Send flags + * to Address of recipient + * tolen The length of the address structure + * + * Returned Value: + * On success, returns the number of characters sent. On any failure, a + * negated errno value is returned. One of: + * + * EAGAIN or EWOULDBLOCK + * The socket is marked non-blocking and the requested operation + * would block. + * EBADF + * An invalid descriptor was specified. + * ECONNRESET + * Connection reset by peer. + * EDESTADDRREQ + * The socket is not connection-mode, and no peer address is set. + * EFAULT + * An invalid user space address was specified for a parameter. + * EINTR + * A signal occurred before any data was transmitted. + * EINVAL + * Invalid argument passed. + * EISCONN + * The connection-mode socket was connected already but a recipient + * was specified. (Now either this error is returned, or the recipient + * specification is ignored.) + * EMSGSIZE + * The socket type requires that message be sent atomically, and the + * size of the message to be sent made this impossible. + * ENOBUFS + * The output queue for a network interface was full. This generally + * indicates that the interface has stopped sending, but may be + * caused by transient congestion. + * ENOMEM + * No memory available. + * ENOTCONN + * The socket is not connected, and no target has been given. + * ENOTSOCK + * The argument s is not a socket. + * EOPNOTSUPP + * Some bit in the flags argument is inappropriate for the socket + * type. + * EPIPE + * The local end has been shut down on a connection oriented socket. + * In this case the process will also receive a SIGPIPE unless + * MSG_NOSIGNAL is set. + * + ****************************************************************************/ + +ssize_t psock_sendto(struct socket *psock, const void *buf, + size_t len, int flags, const struct sockaddr *to, + socklen_t tolen); + +/**************************************************************************** + * Name: psock_recvfrom + * + * Description: + * psock_recvfrom() receives messages from a socket, and may be used to + * receive data on a socket whether or not it is connection-oriented. + * This is an internal OS interface. It is functionally equivalent to + * recvfrom() except that: + * + * - It is not a cancellation point, + * - It does not modify the errno variable, and + * - I accepts the internal socket structure as an input rather than an + * task-specific socket descriptor. + * + * Input Parameters: + * psock - A pointer to a NuttX-specific, internal socket structure + * buf - Buffer to receive data + * len - Length of buffer + * flags - Receive flags + * from - Address of source (may be NULL) + * fromlen - The length of the address structure + * + * Returned Value: + * On success, returns the number of characters sent. If no data is + * available to be received and the peer has performed an orderly shutdown, + * recv() will return 0. Otherwise, on any failure, a negated errno value + * is returned (see comments with send() for a list of appropriate errno + * values). + * + ****************************************************************************/ + +ssize_t psock_recvfrom(struct socket *psock, void *buf, size_t len, + int flags, struct sockaddr *from, + socklen_t *fromlen); + +/* recv using the underlying socket structure */ + +#define psock_recv(psock,buf,len,flags) \ + psock_recvfrom(psock,buf,len,flags,NULL,0) + +/**************************************************************************** + * Name: nx_recvfrom + * + * Description: + * nx_recvfrom() receives messages from a socket, and may be used to + * receive data on a socket whether or not it is connection-oriented. + * This is an internal OS interface. It is functionally equivalent to + * recvfrom() except that: + * + * - It is not a cancellation point, and + * - It does not modify the errno variable. + * + * Input Parameters: + * sockfd - Socket descriptor of socket + * buf - Buffer to receive data + * len - Length of buffer + * flags - Receive flags + * from - Address of source (may be NULL) + * fromlen - The length of the address structure + * + * Returned Value: + * On success, returns the number of characters sent. If no data is + * available to be received and the peer has performed an orderly shutdown, + * recv() will return 0. Otherwise, on any failure, a negated errno value + * is returned (see comments with send() for a list of appropriate errno + * values). + * + ****************************************************************************/ + +ssize_t nx_recvfrom(int sockfd, FAR void *buf, size_t len, int flags, + FAR struct sockaddr *from, FAR socklen_t *fromlen); + +/* Internal version os recv */ + +#define nx_recv(psock,buf,len,flags) nx_recvfrom(psock,buf,len,flags,NULL,0) + +/**************************************************************************** + * Name: psock_getsockopt + * + * Description: + * getsockopt() retrieve thse value for the option specified by the + * 'option' argument for the socket specified by the 'psock' argument. If + * the size of the option value is greater than 'value_len', the value + * stored in the object pointed to by the 'value' argument will be silently + * truncated. Otherwise, the length pointed to by the 'value_len' argument + * will be modified to indicate the actual length of the'value'. + * + * The 'level' argument specifies the protocol level of the option. To + * retrieve options at the socket level, specify the level argument as + * SOL_SOCKET. + * + * See a complete list of values for the 'option' argument. + * + * Input Parameters: + * psock Socket structure of the socket to query + * level Protocol level to set the option + * option identifies the option to get + * value Points to the argument value + * value_len The length of the argument value + * + * Returned Value: + * Returns zero (OK) on success. On failure, it returns a negated errno + * value to indicate the nature of the error: + * + * EINVAL + * The specified option is invalid at the specified socket 'level' or the + * socket has been shutdown. + * ENOPROTOOPT + * The 'option' is not supported by the protocol. + * ENOTSOCK + * The 'psock' argument does not refer to a socket. + * ENOBUFS + * Insufficient resources are available in the system to complete the + * call. + * + ****************************************************************************/ + +int psock_getsockopt(struct socket *psock, int level, int option, + void *value, socklen_t *value_len); + +/**************************************************************************** + * Name: psock_setsockopt + * + * Description: + * psock_setsockopt() sets the option specified by the 'option' argument, + * at the protocol level specified by the 'level' argument, to the value + * pointed to by the 'value' argument for the socket on the 'psock' + * argument. + * + * The 'level' argument specifies the protocol level of the option. To set + * options at the socket level, specify the level argument as SOL_SOCKET. + * + * See a complete list of values for the 'option' argument. + * + * Input Parameters: + * psock Socket structure of socket to operate on + * level Protocol level to set the option + * option identifies the option to set + * value Points to the argument value + * value_len The length of the argument value + * + * Returned Value: + * Returns zero (OK) on success. On failure, it returns a negated errno + * value to indicate the nature of the error: + * + * EDOM + * The send and receive timeout values are too big to fit into the + * timeout fields in the socket structure. + * EINVAL + * The specified option is invalid at the specified socket 'level' or the + * socket has been shut down. + * EISCONN + * The socket is already connected, and a specified option cannot be set + * while the socket is connected. + * ENOPROTOOPT + * The 'option' is not supported by the protocol. + * ENOTSOCK + * The 'sockfd' argument does not refer to a socket. + * ENOMEM + * There was insufficient memory available for the operation to complete. + * ENOBUFS + * Insufficient resources are available in the system to complete the + * call. + * + * Assumptions: + * + ****************************************************************************/ + +int psock_setsockopt(struct socket *psock, int level, int option, + const void *value, socklen_t value_len); + +/**************************************************************************** + * Name: psock_getsockname + * + * Description: + * The psock_getsockname() function retrieves the locally-bound name of the + * the specified socket, stores this address in the sockaddr structure + * pointed to by the 'addr' argument, and stores the length of this + * address in the object pointed to by the 'addrlen' argument. + * + * If the actual length of the address is greater than the length of the + * supplied sockaddr structure, the stored address will be truncated. + * + * If the socket has not been bound to a local name, the value stored in + * the object pointed to by address is unspecified. + * + * Parameters: + * psock Socket structure of socket to operate on + * addr sockaddr structure to receive data [out] + * addrlen Length of sockaddr structure [in/out] + * + * Returned Value: + * On success, 0 is returned, the 'addr' argument points to the address + * of the socket, and the 'addrlen' argument points to the length of the + * address. Otherwise, -1 is returned and errno is set to indicate the + * error. Possible errno values that may be returned include: + * + * EBADF - The socket argument is not a valid file descriptor. + * ENOTSOCK - The socket argument does not refer to a socket. + * EOPNOTSUPP - The operation is not supported for this socket's protocol. + * ENOTCONN - The socket is not connected or otherwise has not had the + * peer pre-specified. + * EINVAL - The socket has been shut down. + * ENOBUFS - Insufficient resources were available in the system to + * complete the function. + * + ****************************************************************************/ + +int psock_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, + FAR socklen_t *addrlen); + +/**************************************************************************** + * Name: psock_getpeername + * + * Description: + * The psock_getpeername() function retrieves the remote-connected name of + * the specified socket, stores this address in the sockaddr structure + * pointed to by the 'addr' argument, and stores the length of this address + * in the object pointed to by the 'addrlen' argument. + * + * If the actual length of the address is greater than the length of the + * supplied sockaddr structure, the stored address will be truncated. + * + * If the socket has not been bound to a local name, the value stored in + * the object pointed to by address is unspecified. + * + * Parameters: + * psock Socket structure of socket to operate on + * addr sockaddr structure to receive data [out] + * addrlen Length of sockaddr structure [in/out] + * + * Returned Value: + * On success, 0 is returned, the 'addr' argument points to the address + * of the socket, and the 'addrlen' argument points to the length of the + * address. Otherwise, -1 is returned and errno is set to indicate the + * error. Possible errno values that may be returned include: + * + * EBADF - The socket argument is not a valid file descriptor. + * ENOTSOCK - The socket argument does not refer to a socket. + * EOPNOTSUPP - The operation is not supported for this socket's protocol. + * ENOTCONN - The socket is not connected or otherwise has not had the + * peer pre-specified. + * EINVAL - The socket has been shut down. + * ENOBUFS - Insufficient resources were available in the system to + * complete the function. + * + ****************************************************************************/ + +int psock_getpeername(FAR struct socket *psock, FAR struct sockaddr *addr, + FAR socklen_t *addrlen); + +/**************************************************************************** + * Name: psock_ioctl + * + * Description: + * Perform network device specific operations. + * + * Input Parameters: + * psock A pointer to a NuttX-specific, internal socket structure + * cmd The ioctl command + * arg The argument of the ioctl cmd + * + * Returned Value: + * A non-negative value is returned on success; a negated errno value is + * returned on any failure to indicate the nature of the failure: + * + * EBADF + * 'psock' is not a valid, connected socket structure. + * EFAULT + * 'arg' references an inaccessible memory area. + * ENOTTY + * 'cmd' not valid. + * EINVAL + * 'arg' is not valid. + * ENOTTY + * 'sockfd' is not associated with a network device. + * ENOTTY + * The specified request does not apply to the kind of object that the + * descriptor 'sockfd' references. + * + ****************************************************************************/ + +int psock_ioctl(FAR struct socket *psock, int cmd, unsigned long arg); + +/**************************************************************************** + * Name: netdev_ioctl + * + * Description: + * Perform network device specific operations. + * + * Input Parameters: + * sockfd Socket descriptor of device + * cmd The ioctl command + * arg The argument of the ioctl cmd + * + * Returned Value: + * A non-negative value is returned on success; a negated errno value is + * returned on any failure to indicate the nature of the failure: + * + * EBADF + * 'sockfd' is not a valid socket descriptor. + * EFAULT + * 'arg' references an inaccessible memory area. + * ENOTTY + * 'cmd' not valid. + * EINVAL + * 'arg' is not valid. + * ENOTTY + * 'sockfd' is not associated with a network device. + * ENOTTY + * The specified request does not apply to the kind of object that the + * descriptor 'sockfd' references. + * + ****************************************************************************/ + +int netdev_ioctl(int sockfd, int cmd, unsigned long arg); + +/**************************************************************************** + * Name: psock_poll + * + * Description: + * The standard poll() operation redirects operations on socket descriptors + * to this function. + * + * Input Parameters: + * psock - An instance of the internal socket structure. + * fds - The structure describing the events to be monitored, OR NULL if + * this is a request to stop monitoring events. + * setup - true: Setup up the poll; false: Teardown the poll + * + * Returned Value: + * 0: Success; Negated errno on failure + * + ****************************************************************************/ + +struct pollfd; /* Forward reference -- see poll.h */ + +int psock_poll(struct socket *psock, struct pollfd *fds, bool setup); + +/**************************************************************************** + * Name: net_poll + * + * Description: + * The standard poll() operation redirects operations on socket descriptors + * to this function. + * + * Input Parameters: + * fd - The socket descriptor of interest + * fds - The structure describing the events to be monitored, OR NULL if + * this is a request to stop monitoring events. + * setup - true: Setup up the poll; false: Teardown the poll + * + * Returned Value: + * 0: Success; Negated errno on failure + * + ****************************************************************************/ + +struct pollfd; /* Forward reference -- see poll.h */ + +int net_poll(int sockfd, struct pollfd *fds, bool setup); + +/**************************************************************************** + * Name: psock_dupsd + * + * Description: + * Clone a socket descriptor to an arbitray descriptor number. If file + * descriptors are implemented, then this is called by dup() for the case + * of socket file descriptors. If file descriptors are not implemented, + * then this function IS dup(). + * + * Returned Value: + * On success, returns the number of characters sent. On any error, + * a negated errno value is returned:. + * + ****************************************************************************/ + +int psock_dupsd(FAR struct socket *psock, int minsd); + +/**************************************************************************** + * Name: net_dupsd + * + * Description: + * Clone a socket descriptor to an arbitray descriptor number. If file + * descriptors are implemented, then this is called by dup() for the case + * of socket file descriptors. If file descriptors are not implemented, + * then this function IS dup(). + * + * Returned Value: + * On success, returns the number of characters sent. On any error, + * a negated errno value is returned:. + * + ****************************************************************************/ + +int net_dupsd(int sockfd, int minsd); + +/**************************************************************************** + * Name: net_dupsd2 + * + * Description: + * Clone a socket descriptor to an arbitray descriptor number. If file + * descriptors are implemented, then this is called by dup2() for the case + * of socket file descriptors. If file descriptors are not implemented, + * then this function IS dup2(). + * + * Returned Value: + * On success, returns the number of characters sent. On any error, + * a negated errno value is returned:. + * + ****************************************************************************/ + +int net_dupsd2(int sockfd1, int sockfd2); + +/**************************************************************************** + * Name: net_fstat + * + * Description: + * Performs fstat operations on socket + * + * Input Parameters: + * sockfd - Socket descriptor of the socket to operate on + * bug - Caller-provided location in which to return the fstat data + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure to indicate the nature of the failure. + * + ****************************************************************************/ + +struct stat; /* Forward reference. See sys/stat.h */ + +int net_fstat(int sockfd, FAR struct stat *buf); + +/**************************************************************************** + * Name: net_clone + * + * Description: + * Performs the low level, common portion of net_dupsd() and net_dupsd2() + * + ****************************************************************************/ + +int net_clone(struct socket *psock1, struct socket *psock2); + +/**************************************************************************** + * Name: net_sendfile + * + * Description: + * The send() call may be used only when the socket is in a connected state + * (so that the intended recipient is known). The only difference between + * send() and write() is the presence of flags. With zero flags parameter, + * send() is equivalent to write(). Also, send(sockfd,buf,len,flags) is + * equivalent to sendto(sockfd,buf,len,flags,NULL,0). + * + * Input Parameters: + * psock An instance of the internal socket structure. + * buf Data to send + * len Length of data to send + * flags Send flags + * + * Returned Value: + * On success, returns the number of characters sent. On error, + * -1 is returned, and errno is set appropriately: + * + * EAGAIN or EWOULDBLOCK + * The socket is marked non-blocking and the requested operation + * would block. + * EBADF + * An invalid descriptor was specified. + * ECONNRESET + * Connection reset by peer. + * EDESTADDRREQ + * The socket is not connection-mode, and no peer address is set. + * EFAULT + * An invalid user space address was specified for a parameter. + * EINTR + * A signal occurred before any data was transmitted. + * EINVAL + * Invalid argument passed. + * EISCONN + * The connection-mode socket was connected already but a recipient + * was specified. (Now either this error is returned, or the recipient + * specification is ignored.) + * EMSGSIZE + * The socket type requires that message be sent atomically, and the + * size of the message to be sent made this impossible. + * ENOBUFS + * The output queue for a network interface was full. This generally + * indicates that the interface has stopped sending, but may be + * caused by transient congestion. + * ENOMEM + * No memory available. + * ENOTCONN + * The socket is not connected, and no target has been given. + * ENOTSOCK + * The argument s is not a socket. + * EOPNOTSUPP + * Some bit in the flags argument is inappropriate for the socket + * type. + * EPIPE + * The local end has been shut down on a connection oriented socket. + * In this case the process will also receive a SIGPIPE unless + * MSG_NOSIGNAL is set. + * + ****************************************************************************/ + +#ifdef CONFIG_NET_SENDFILE +struct file; +ssize_t net_sendfile(int outfd, struct file *infile, off_t *offset, + size_t count); +#endif + +/**************************************************************************** + * Name: psock_vfcntl + * + * Description: + * Performs fcntl operations on socket + * + * Input Parameters: + * psock - An instance of the internal socket structure. + * cmd - The fcntl command. + * ap - Command-specific arguments + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure to indicate the nature of the failure. + * + ****************************************************************************/ + +int psock_vfcntl(FAR struct socket *psock, int cmd, va_list ap); + +/**************************************************************************** + * Name: psock_fcntl + * + * Description: + * Similar to the standard fcntl function except that is accepts a struct + * struct socket instance instead of a file descriptor. + * + * Input Parameters: + * psock - An instance of the internal socket structure. + * cmd - Identifies the operation to be performed. Command specific + * arguments may follow. + * + * Returned Value: + * The nature of the return value depends on the command. Non-negative + * values indicate success. Failures are reported as negated errno + * values. + * + ****************************************************************************/ + +int psock_fcntl(FAR struct socket *psock, int cmd, ...); + +/**************************************************************************** + * Name: net_vfcntl + * + * Description: + * Performs fcntl operations on socket + * + * Input Parameters: + * sockfd - Socket descriptor of the socket to operate on + * cmd - The fcntl command. + * ap - Command-specific arguments + * + * Returned Value: + * Zero (OK) is returned on success; a negated errno value is returned on + * any failure to indicate the nature of the failure. + * + ****************************************************************************/ + +int net_vfcntl(int sockfd, int cmd, va_list ap); + +/**************************************************************************** + * Name: netdev_register + * + * Description: + * Register a network device driver and assign a name to it so that it can + * be found in subsequent network ioctl operations on the device. + * + * A custom, device-specific interface name format string may be selected + * by putting that format string into the device structure's d_ifname[] + * array before calling netdev_register(). Otherwise, the d_ifname[] must + * be zeroed on entry. + * + * Input Parameters: + * dev - The device driver structure to be registered. + * lltype - Link level protocol used by the driver (Ethernet, SLIP, TUN, ... + * + * Returned Value: + * 0:Success; negated errno on failure + * + * Assumptions: + * Called during system initialization from normal user mode + * + ****************************************************************************/ + +int netdev_register(struct net_driver_s *dev, enum net_lltype_e lltype); + +/**************************************************************************** + * Name: netdev_unregister + * + * Description: + * Unregister a network device driver. + * + * Input Parameters: + * dev - The device driver structure to un-register + * + * Returned Value: + * 0:Success; negated errno on failure + * + * Assumptions: + * Currently only called for USB networking devices when the device is + * physically removed from the slot + * + ****************************************************************************/ + +int netdev_unregister(struct net_driver_s *dev); + + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif /* CONFIG_NET */ +#endif /* __INCLUDE_NET_NET_H */ diff --git a/include/nuttx/scsi.h b/include/nuttx/scsi.h new file mode 100755 index 0000000..60dae96 --- /dev/null +++ b/include/nuttx/scsi.h @@ -0,0 +1,1051 @@ +/**************************************************************************** + * include/nuttx/scsi.h + * + * Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * References: + * "SCSI Primary Commands - 3 (SPC-3)," American National Standard + * for Information Technology, May 4, 2005 + * + * "SCSI Primary Commands - 4 (SPC-4)," American National Standard + * for Information Technology, July 19, 2008 + * + * "SCSI Block Commands -2 (SBC-2)," American National Standard + * for Information Technology, November 13, 2004 + * + * "SCSI Multimedia Commands - 3 (MMC-3)," American National Standard + * for Information Technology, November 12, 2001 + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __INCLUDE_NUTTX_SCSI_H +#define __INCLUDE_NUTTX_SCSI_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* SCSI commands ************************************************************/ + +#define SCSI_CMD_TESTUNITREADY 0x00 +#define SCSI_CMD_REZEROUNIT 0x01 +#define SCSI_CMD_REQUESTSENSE 0x03 +#define SCSI_CMD_FORMAT_UNIT 0x04 +#define SCSI_CMD_REASSIGNBLOCKS 0x07 +#define SCSI_CMD_READ6 0x08 +#define SCSI_CMD_WRITE6 0x0a +#define SCSI_CMD_SEEK6 0x0b +#define SCSI_CMD_SPACE6 0x11 +#define SCSI_CMD_INQUIRY 0x12 +#define SCSI_CMD_MODESELECT6 0x15 +#define SCSI_CMD_RESERVE6 0x16 +#define SCSI_CMD_RELEASE6 0x17 +#define SCSI_CMD_COPY 0x18 +#define SCSI_CMD_MODESENSE6 0x1a +#define SCSI_CMD_STARTSTOPUNIT 0x1b +#define SCSI_CMD_RECEIVEDIAGNOSTICRESULTS 0x1c +#define SCSI_CMD_SENDDIAGNOSTIC 0x1d +#define SCSI_CMD_PREVENTMEDIAREMOVAL 0x1e +#define SCSI_CMD_READFORMATCAPACITIES 0x23 +#define SCSI_CMD_READCAPACITY10 0x25 +#define SCSI_CMD_READ10 0x28 +#define SCSI_CMD_WRITE10 0x2a +#define SCSI_CMD_READ16 0x88 +#define SCSI_CMD_WRITE16 0x8a +#define SCSI_CMD_SEEK10 0x2b +#define SCSI_CMD_WRITEANDVERIFY 0x2e +#define SCSI_CMD_VERIFY10 0x2f +#define SCSI_CMD_SEARCHDATAHIGH 0x30 +#define SCSI_CMD_SEARCHDATAEQUAL 0x31 +#define SCSI_CMD_SEARCHDATALOW 0x32 +#define SCSI_CMD_SETLIMITS10 0x33 +#define SCSI_CMD_PREFETCH10 0x34 +#define SCSI_CMD_SYNCHCACHE10 0x35 +#define SCSI_CMD_LOCKCACHE 0x36 +#define SCSI_CMD_READDEFECTDATA10 0x37 +#define SCSI_CMD_COMPARE 0x39 +#define SCSI_CMD_COPYANDVERIFY 0x3a +#define SCSI_CMD_WRITEBUFFER 0x3b +#define SCSI_CMD_READBUFFER 0x3c +#define SCSI_CMD_READLONG10 0x3e +#define SCSI_CMD_WRITELONG10 0x3f +#define SCSI_CMD_CHANGEDEFINITION 0x40 +#define SCSI_CMD_WRITESAME10 0x41 +#define SCSI_CMD_LOGSELECT 0x4c +#define SCSI_CMD_LOGSENSE 0x4d +#define SCSI_CMD_XDWRITE10 0x50 +#define SCSI_CMD_XPWRITE10 0x51 +#define SCSI_CMD_XDREAD10 0x52 +#define SCSI_CMD_MODESELECT10 0x55 +#define SCSI_CMD_RESERVE10 0x56 +#define SCSI_CMD_RELEASE10 0x57 +#define SCSI_CMD_MODESENSE10 0x5a +#define SCSI_CMD_PERSISTENTRESERVEIN 0x5e +#define SCSI_CMD_PERSISTENTRESERVEOUT 0x5f +#define SCSI_CMD_32 0x7f +#define SCSI_CMD_XDWRITEEXTENDED 0x80 +#define SCSI_CMD_REBUILD 0x82 +#define SCSI_CMD_REGENERATE 0x82 +#define SCSI_CMD_EXTENDEDCOPY 0x83 +#define SCSI_CMD_COPYRESULTS 0x84 +#define SCSI_CMD_ACCESSCONTROLIN 0x86 +#define SCSI_CMD_ACCESSCONTROLOUT 0x87 +#define SCSI_CMD_READ16 0x88 +#define SCSI_CMD_WRITE16 0x8a +#define SCSI_CMD_READATTRIBUTE 0x8c +#define SCSI_CMD_WRITEATTRIBUTE 0x8d +#define SCSI_CMD_WRITEANDVERIFY16 0x8e +#define SCSI_CMD_PREFETCH16 0x90 +#define SCSI_CMD_SYNCHCACHE16 0x91 +#define SCSI_CMD_LOCKUNLOCKACACHE 0x92 +#define SCSI_CMD_WRITESAME16 0x93 +#define SCSI_CMD_READCAPACITY16 0x9e +#define SCSI_CMD_READLONG16 0x9e +#define SCSI_CMD_WRITELONG106 0x9f +#define SCSI_CMD_REPORTLUNS 0xa0 +#define SCSI_CMD_MAINTENANCEIN 0xa3 +#define SCSI_CMD_MAINTENANCEOUT 0xa4 +#define SCSI_CMD_MOVEMEDIUM 0xa5 +#define SCSI_CMD_MOVEMEDIUMATTACHED 0xa7 +#define SCSI_CMD_READ12 0xa8 +#define SCSI_CMD_WRITE12 0xaa +#define SCSI_CMD_READMEDIASERIALNUMBER 0xab +#define SCSI_CMD_WRITEANDVERIFY12 0xae +#define SCSI_CMD_VERIFY12 0xaf +#define SCSI_CMD_SETLIMITS12 0xb3 +#define SCSI_CMD_READELEMENTSTATUS 0xb4 +#define SCSI_CMD_READDEFECTDATA12 0xb7 +#define SCSI_CMD_REDUNDANCYGROUPIN 0xba +#define SCSI_CMD_REDUNDANCYGROUPOUT 0xbb +#define SCSI_CMD_SPAREIN 0xbc +#define SCSI_CMD_SPAREOUT 0xbd +#define SCSI_CMD_VOLUMESETIN 0xbe +#define SCSI_CMD_VOLUMESETOUT 0xbf + +/* Common SCSI KCQ values (sense Key/additional sense Code/ASC Qualifier) *** + * + * 0xnn0386 Write Fault Data Corruption + * 0xnn0500 Illegal request + * 0xnn0600 Unit attention + * 0xnn0700 Data protect + * 0xnn0800 LUN communication failure + * 0xnn0801 LUN communication timeout + * 0xnn0802 LUN communication parity error + * 0xnn0803 LUN communication CRC error + * 0xnn0900 vendor specific sense key + * 0xnn0901 servo fault + * 0xnn0904 head select fault + * 0xnn0a00 error log overflow + * 0xnn0b00 aborted command + * 0xnn0c00 write error + * 0xnn0c02 write error - auto-realloc failed + * 0xnn0e00 data miscompare + * 0xnn1200 address mark not founf for ID field + * 0xnn1400 logical block not found + * 0xnn1500 random positioning error + * 0xnn1501 mechanical positioning error + * 0xnn1502 positioning error detected by read of medium + * 0xnn2700 write protected + * 0xnn2900 POR or bus reset occurred + * 0xnn3101 format failed + * 0xnn3191 format corrupted + * 0xnn3201 defect list update error + * 0xnn3202 no spares available + * 0xnn3501 unspecified enclosure services failure + * 0xnn3700 parameter rounded + * 0xnn3d00 invalid bits in identify message + * 0xnn3e00 LUN not self-configured yet + * 0xnn4001 DRAM parity error + * 0xnn4002 DRAM parity error + * 0xnn4200 power-on or self-test failure + * 0xnn4c00 LUN failed self-configuration + * 0xnn5c00 RPL status change + * 0xnn5c01 spindles synchronized + * 0xnn5c02 spindles not synchronized + * 0xnn6500 voltage fault + * 0xnn8000 general firmware error + */ + +/* No sense KCQ values */ + +#define SCSI_KCQ_NOSENSE 0x000000 /* No error */ +#define SCSI_KCQ_PFATHRESHOLDREACHED 0x005c00 /* No sense - PFA threshold reached */ + +/* Soft error KCQ values */ + +#define SCSI_KCQSE_RWENOINDEX 0x010100 /* Recovered Write error - no index */ +#define SCSI_KCQSE_RECOVEREDNOSEEKCOMPLETION 0x010200 /* Recovered no seek completion */ +#define SCSI_KCQSE_RWEWRITEFAULT 0x010300 /* Recovered Write error - write fault */ +#define SCSI_KCQSE_TRACKFOLLOWINGERROR 0x010900 /* Track following error */ +#define SCSI_KCQSE_TEMPERATUREWARNING 0x010b01 /* Temperature warning */ +#define SCSI_KCQSE_RWEWARREALLOCATED 0x010c01 /* Recovered Write error with auto-realloc - reallocated */ +#define SCSI_KCQSE_RWERECOMMENDREASSIGN 0x010c03 /* Recovered Write error - recommend reassign */ +#define SCSI_KCQSE_RDWOEUSINGPREVLBI 0x011201 /* Recovered data without ECC using prev logical block ID */ +#define SCSI_KCQSE_RDWEUSINGPREVLBI 0x011202 /* Recovered data with ECC using prev logical block ID */ +#define SCSI_KCQSE_RECOVEREDRECORDNOTFOUND 0x011401 /* Recovered Record Not Found */ +#define SCSI_KCQSE_RWEDSME 0x011600 /* Recovered Write error - Data Sync Mark Error */ +#define SCSI_KCQSE_RWEDSEDATAREWRITTEN 0x011601 /* Recovered Write error - Data Sync Error - data rewritten */ +#define SCSI_KCQSE_RWEDSERECOMMENDREWRITE 0x011602 /* Recovered Write error - Data Sync Error - recommend rewrite */ +#define SCSI_KCQSE_RWEDSEDATAAUTOREALLOCATED 0x011603 /* Recovered Write error - Data Sync Error - data auto-reallocated */ +#define SCSI_KCQSE_RWEDSERECOMMENDREASSIGNMENT 0x011604 /* Recovered Write error - Data Sync Error - recommend reassignment */ +#define SCSI_KCQSE_RDWNECORRECTIONAPPLIED 0x011700 /* Recovered data with no error correction applied */ +#define SCSI_KCQSE_RREWITHRETRIES 0x011701 /* Recovered Read error - with retries */ +#define SCSI_KCQSE_RDUSINGPOSITIVEOFFSET 0x011702 /* Recovered data using positive offset */ +#define SCSI_KCQSE_RDUSINGNEGATIVEOFFSET 0x011703 /* Recovered data using negative offset */ +#define SCSI_KCQSE_RDUSINGPREVIOUSLBI 0x011705 /* Recovered data using previous logical block ID */ +#define SCSI_KCQSE_RREWOEAUTOREALLOCATED 0x011706 /* Recovered Read error - without ECC, auto reallocated */ +#define SCSI_KCQSE_RREWOERECOMMENDREASSIGN 0x011707 /* Recovered Read error - without ECC, recommend reassign */ +#define SCSI_KCQSE_RREWOERECOMMENDREWRITE 0x011708 /* Recovered Read error - without ECC, recommend rewrite */ +#define SCSI_KCQSE_RREWOEDATAREWRITTEN 0x011709 /* Recovered Read error - without ECC, data rewritten */ +#define SCSI_KCQSE_RREWE 0x011800 /* Recovered Read error - with ECC */ +#define SCSI_KCQSE_RDWEANDRETRIES 0x011801 /* Recovered data with ECC and retries */ +#define SCSI_KCQSE_RREWEAUTOREALLOCATED 0x011802 /* Recovered Read error - with ECC, auto reallocated */ +#define SCSI_KCQSE_RREWERECOMMENDREASSIGN 0x011805 /* Recovered Read error - with ECC, recommend reassign */ +#define SCSI_KCQSE_RDUSINGECCANDOFFSETS 0x011806 /* Recovered data using ECC and offsets */ +#define SCSI_KCQSE_RREWEDATAREWRITTEN 0x011807 /* Recovered Read error - with ECC, data rewritten */ +#define SCSI_KCQSE_DLNOTFOUND 0x011c00 /* Defect List not found */ +#define SCSI_KCQSE_PRIMARYDLNOTFOUND 0x011c01 /* Primary defect list not found */ +#define SCSI_KCQSE_GROWNDLNOTFOUND 0x011c02 /* Grown defect list not found */ +#define SCSI_KCQSE_PARTIALDLTRANSFERRED 0x011f00 /* Partial defect list transferred */ +#define SCSI_KCQSE_INTERNALTARGETFAILURE 0x014400 /* Internal target failure */ +#define SCSI_KCQSE_PFATHRESHOLDREACHED 0x015d00 /* PFA threshold reached */ +#define SCSI_KCQSE_PFATESTWARNING 0x015dff /* PFA test warning */ +#define SCSI_KCQSE_INTERNALLOGICFAILURE 0x018100 /* Internal logic failure */ + +/* Not Ready / Diagnostic Failure KCQ values */ + +#define SCSI_KCQNR_CAUSENOTREPORTABLE 0x020400 /* Not Ready - Cause not reportable. */ +#define SCSI_KCQNR_BECOMINGREADY 0x020401 /* Not Ready - becoming ready */ +#define SCSI_KCQNR_NEEDINITIALIZECOMMAND 0x020402 /* Not Ready - need initialize command (start unit) */ +#define SCSI_KCQNR_MANUALINTERVENTIONREQUIRED 0x020403 /* Not Ready - manual intervention required */ +#define SCSI_KCQNR_FORMATINPROGRESS 0x020404 /* Not Ready - format in progress */ +#define SCSI_KCQNR_SELFTESTINPROGRESS 0x020409 /* Not Ready - self-test in progress */ +#define SCSI_KCQNR_MEDIUMFORMATCORRUPTED 0x023100 /* Not Ready - medium format corrupted */ +#define SCSI_KCQNR_FORMATCOMMANDFAILED 0x023101 /* Not Ready - format command failed */ +#define SCSI_KCQNR_ESUNAVAILABLE 0x023502 /* Not Ready - enclosure services unavailable */ +#define SCSI_KCQNR_MEDIANOTPRESENT 0x023a00 /* Not Ready - media not present */ +#define SCSI_KCQDF_BRINGUPFAILORDEGRADEDMODE 0x024080 /* Diagnostic Failure - bring-up fail or degraded mode */ +#define SCSI_KCQDF_HARDDISKCONTROLLER 0x024081 /* Diagnostic Failure - Hard Disk Controller */ +#define SCSI_KCQDF_RAMMICROCODENOTLOADED 0x024085 /* Diagnostic Failure - RAM microcode not loaded */ +#define SCSI_KCQDF_RROCALIBRATION 0x024090 /* Diagnostic Failure - RRO Calibration */ +#define SCSI_KCQDF_CHANNELCALIBRATION 0x024091 /* Diagnostic Failure - Channel Calibration */ +#define SCSI_KCQDF_HEADLOAD 0x024092 /* Diagnostic Failure - Head Load */ +#define SCSI_KCQDF_WRITEAE 0x024093 /* Diagnostic Failure - Write AE */ +#define SCSI_KCQDF_12VOVERCURRENT 0x024094 /* Diagnostic Failure - 12V over current */ +#define SCSI_KCQDF_OTHERSPINDLEFAILURE 0x024095 /* Diagnostic Failure - Other spindle failure */ +#define SCSI_KCQDF_SELFRESET 0x0240b0 /* Diagnostic Failure - self-reset */ +#define SCSI_KCQDF_CONFIGNOTLOADED 0x024c00 /* Diagnostic Failure - config not loaded */ + +/* Medium error KCQ values */ + +#define SCSI_KCQME_WRITEFAULT 0x030300 /* Medium Error - write fault */ +#define SCSI_KCQME_WRITEFAULTAUTOREALLOCFAILED 0x030c02 /* Medium Error - write error - auto-realloc failed */ +#define SCSI_KCQME_WRITERTLIMITEXCEEDED 0x030cbb /* Medium Error - write recovery time limit exceeded */ +#define SCSI_KCQME_IDCRCERROR 0x031000 /* Medium Error - ID CRC error */ +#define SCSI_KCQME_UNRRE1 0x031100 /* Medium Error - unrecovered read error */ +#define SCSI_KCQME_READRETRIESEXHAUSTED 0x031101 /* Medium Error - read retries exhausted */ +#define SCSI_KCQME_ERRORTOOLONGTOCORRECT 0x031102 /* Medium Error - error too long to correct */ +#define SCSI_KCQME_UREAUTOREALLOCFAILED 0x031104 /* Medium Error - unrecovered read error - auto re-alloc failed */ +#define SCSI_KCQME_URERECOMMENDREASSIGN 0x03110b /* Medium Error - unrecovered read error - recommend reassign */ +#define SCSI_KCQME_READRTLIMITEXCEEDED 0x0311ff /* Medium Error - read recovery time limit exceeded */ +#define SCSI_KCQME_RECORDNOTFOUND 0x031401 /* Medium Error - record not found */ +#define SCSI_KCQME_DSME 0x031600 /* Medium Error - Data Sync Mark error */ +#define SCSI_KCQME_DSERECOMMENDREASSIGN 0x031604 /* Medium Error - Data Sync Error - recommend reassign */ +#define SCSI_KCQME_DLE 0x031900 /* Medium Error - defect list error */ +#define SCSI_KCQME_DLNOTAVAILABLE 0x031901 /* Medium Error - defect list not available */ +#define SCSI_KCQME_DLEINPRIMARYLIST 0x031902 /* Medium Error - defect list error in primary list */ +#define SCSI_KCQME_DLEINGROWNLIST 0x031903 /* Medium Error - defect list error in grown list */ +#define SCSI_KCQME_FEWERTHAN50PCTDLCOPIES 0x03190e /* Medium Error - fewer than 50% defect list copies */ +#define SCSI_KCQME_MEDIUMFORMATCORRUPTED 0x033100 /* Medium Error - medium format corrupted */ +#define SCSI_KCQME_FORMATCOMMANDFAILED 0x033101 /* Medium Error - format command failed */ +#define SCSI_KCQME_DATAAUTOREALLOCATED 0x038000 /* Medium Error - data auto-reallocated */ + +/* Hardware Error KCQ values */ + +#define SCSI_KCQHE_NOINDEXORSECTOR 0x040100 /* Hardware Error - no index or sector */ +#define SCSI_KCQHE_NOSEEKCOMPLETE 0x040200 /* Hardware Error - no seek complete */ +#define SCSI_KCQHE_WRITEFAULT 0x040300 /* Hardware Error - write fault */ +#define SCSI_KCQHE_COMMUNICATIONFAILURE 0x040800 /* Hardware Error - communication failure */ +#define SCSI_KCQHE_TRACKFOLLOWINGERROR 0x040900 /* Hardware Error - track following error */ +#define SCSI_KCQHE_UREINRESERVEDAREA 0x041100 /* Hardware Error - unrecovered read error in reserved area */ +#define SCSI_KCQHE_DSMEINRESERVEDAREA 0x041600 /* Hardware Error - Data Sync Mark error in reserved area */ +#define SCSI_KCQHE_DLE 0x041900 /* Hardware Error - defect list error */ +#define SCSI_KCQHE_DLEINPRIMARYLIST 0x041902 /* Hardware Error - defect list error in Primary List */ +#define SCSI_KCQHE_DLEINGROWNLIST 0x041903 /* Hardware Error - defect list error in Grown List */ +#define SCSI_KCQHE_REASSIGNFAILED 0x043100 /* Hardware Error - reassign failed */ +#define SCSI_KCQHE_NODEFECTSPAREAVAILABLE 0x043200 /* Hardware Error - no defect spare available */ +#define SCSI_KCQHE_UNSUPPORTEDENCLOSUREFUNCTION 0x043501 /* Hardware Error - unsupported enclosure function */ +#define SCSI_KCQHE_ESUNAVAILABLE 0x043502 /* Hardware Error - enclosure services unavailable */ +#define SCSI_KCQHE_ESTRANSFERFAILURE 0x043503 /* Hardware Error - enclosure services transfer failure */ +#define SCSI_KCQHE_ESREFUSED 0x043504 /* Hardware Error - enclosure services refused */ +#define SCSI_KCQHE_SELFTESTFAILED 0x043e03 /* Hardware Error - self-test failed */ +#define SCSI_KCQHE_UNABLETOUPDATESELFTEST 0x043e04 /* Hardware Error - unable to update self-test */ +#define SCSI_KCQHE_DMDIAGNOSTICFAIL 0x044080 /* Hardware Error - Degrade Mode. Diagnostic Fail */ +#define SCSI_KCQHE_DMHWERROR 0x044081 /* Hardware Error - Degrade Mode. H/W Error */ +#define SCSI_KCQHE_DMRAMMICROCODENOTLOADED 0x044085 /* Hardware Error - Degrade Mode. RAM microcode not loaded */ +#define SCSI_KCQHE_SEEKTESTFAILURE 0x044090 /* Hardware Error - seek test failure */ +#define SCSI_KCQHE_READWRITETESTFAILURE 0x0440a0 /* Hardware Error - read/write test failure */ +#define SCSI_KCQHE_DEVICESELFRESET 0x0440b0 /* Hardware Error - device self-reset */ +#define SCSI_KCQHE_COMPONENTMISMATCH 0x0440d0 /* Hardware Error - component mismatch */ +#define SCSI_KCQHE_INTERNALTARGETFAILURE 0x044400 /* Hardware Error - internal target failure */ +#define SCSI_KCQHE_INTERNALLOGICERROR 0x048100 /* Hardware Error - internal logic error */ +#define SCSI_KCQHE_COMMANDTIMEOUT 0x048200 /* Hardware Error - command timeout */ + +/* Illegal Request KCQ values */ + +#define SCSI_KCQIR_PARMLISTLENGTHERROR 0x051a00 /* Illegal Request - parm list length error */ +#define SCSI_KCQIR_INVALIDCOMMAND 0x052000 /* Illegal Request - invalid/unsupported command code */ +#define SCSI_KCQIR_LBAOUTOFRANGE 0x052100 /* Illegal Request - LBA out of range */ +#define SCSI_KCQIR_INVALIDFIELDINCBA 0x052400 /* Illegal Request - invalid field in CDB (Command Descriptor Block) */ +#define SCSI_KCQIR_INVALIDLUN 0x052500 /* Illegal Request - invalid LUN */ +#define SCSI_KCQIR_INVALIDFIELDSINPARMLIST 0x052600 /* Illegal Request - invalid fields in parm list */ +#define SCSI_KCQIR_PARAMETERNOTSUPPORTED 0x052601 /* Illegal Request - parameter not supported */ +#define SCSI_KCQIR_INVALIDPARMVALUE 0x052602 /* Illegal Request - invalid parm value */ +#define SCSI_KCQIR_IFPTHRESHOLDPARAMETER 0x052603 /* Illegal Request - invalid field parameter - threshold parameter */ +#define SCSI_KCQIR_INVALIDRELEASEOFPR 0x052604 /* Illegal Request - invalid release of persistent reservation */ +#define SCSI_KCQIR_IFPTMSFIRMWARETAG 0x052697 /* Illegal Request - invalid field parameter - TMS firmware tag */ +#define SCSI_KCQIR_IFPCHECKSUM 0x052698 /* Illegal Request - invalid field parameter - check sum */ +#define SCSI_KCQIR_IFPFIRMWARETAG 0x052699 /* Illegal Request - invalid field parameter - firmware tag */ +#define SCSI_KCQIR_COMMANDSEQUENCEERROR 0x052c00 /* Illegal Request - command sequence error */ +#define SCSI_KCQIR_UNSUPPORTEDENCLOSUREFUNCTION 0x053501 /* Illegal Request - unsupported enclosure function */ +#define SCSI_KCQIR_SAVINGPARMSNOTSUPPORTED 0x053900 /* Illegal Request - Saving parameters not supported */ +#define SCSI_KCQIR_INVALIDMESSAGE 0x054900 /* Illegal Request - invalid message */ +#define SCSI_KCQIR_MEDIALOADOREJECTFAILED 0x055300 /* Illegal Request - media load or eject failed */ +#define SCSI_KCQIR_UNLOADTAPEFAILURE 0x055301 /* Illegal Request - unload tape failure */ +#define SCSI_KCQIR_MEDIUMREMOVALPREVENTED 0x055302 /* Illegal Request - medium removal prevented */ +#define SCSI_KCQIR_SYSTEMRESOURCEFAILURE 0x055500 /* Illegal Request - system resource failure */ +#define SCSI_KCQIR_SYSTEMBUFFERFULL 0x055501 /* Illegal Request - system buffer full */ +#define SCSI_KCQIR_INSUFFICIENTRR 0x055504 /* Illegal Request - Insufficient Registration Resources */ + +/* Unit Attention KCQ values */ + +#define SCSI_KCQUA_NOTREADYTOTRANSITION 0x062800 /* Unit Attention - not-ready to ready transition (format complete) */ +#define SCSI_KCQUA_DEVICERESETOCCURRED 0x062900 /* Unit Attention - POR or device reset occurred */ +#define SCSI_KCQUA_POROCCURRED 0x062901 /* Unit Attention - POR occurred */ +#define SCSI_KCQUA_SCSIBUSRESETOCCURRED 0x062902 /* Unit Attention - SCSI bus reset occurred */ +#define SCSI_KCQUA_TARGETRESETOCCURRED 0x062903 /* Unit Attention - TARGET RESET occurred */ +#define SCSI_KCQUA_SELFINITIATEDRESETOCCURRED 0x062904 /* Unit Attention - self-initiated-reset occurred */ +#define SCSI_KCQUA_TRANSCEIVERMODECHANGETOSE 0x062905 /* Unit Attention - transceiver mode change to SE */ +#define SCSI_KCQUA_TRANSCEIVERMODECHANGETOLVD 0x062906 /* Unit Attention - transceiver mode change to LVD */ +#define SCSI_KCQUA_PARAMETERSCHANGED 0x062a00 /* Unit Attention - parameters changed */ +#define SCSI_KCQUA_MODEPARAMETERSCHANGED 0x062a01 /* Unit Attention - mode parameters changed */ +#define SCSI_KCQUA_LOGSELECTPARMSCHANGED 0x062a02 /* Unit Attention - log select parms changed */ +#define SCSI_KCQUA_RESERVATIONSPREEMPTED 0x062a03 /* Unit Attention - Reservations pre-empted */ +#define SCSI_KCQUA_RESERVATIONSRELEASED 0x062a04 /* Unit Attention - Reservations released */ +#define SCSI_KCQUA_REGISTRATIONSPREEMPTED 0x062a05 /* Unit Attention - Registrations pre-empted */ +#define SCSI_KCQUA_COMMANDSCLEARED 0x062f00 /* Unit Attention - commands cleared by another initiator */ +#define SCSI_KCQUA_OPERATINGCONDITIONSCHANGED 0x063f00 /* Unit Attention - target operating conditions have changed */ +#define SCSI_KCQUA_MICROCODECHANGED 0x063f01 /* Unit Attention - microcode changed */ +#define SCSI_KCQUA_CHANGEDOPERATINGDEFINITION 0x063f02 /* Unit Attention - changed operating definition */ +#define SCSI_KCQUA_INQUIRYPARAMETERSCHANGED 0x063f03 /* Unit Attention - inquiry parameters changed */ +#define SCSI_KCQUA_DEVICEIDENTIFIERCHANGED 0x063f05 /* Unit Attention - device identifier changed */ +#define SCSI_KCQUA_INVALIDAPMPARAMETERS 0x063f90 /* Unit Attention - invalid APM parameters */ +#define SCSI_KCQUA_WORLDWIDENAMEMISMATCH 0x063f91 /* Unit Attention - world-wide name mismatch */ +#define SCSI_KCQUA_PFATHRESHOLDREACHED 0x065d00 /* Unit Attention - PFA threshold reached */ +#define SCSI_KCQUA_PFATHRESHOLDEXCEEDED 0x065dff /* Unit Attention - PFA threshold exceeded */ + +/* Write Protect KCQ values */ + +#define SCSI_KCQWP_COMMANDNOTALLOWED 0x072700 /* Write Protect - command not allowed */ + +/* Aborted Command KCQ values */ + +#define SCSI_KCQAC_NOADDITIONALSENSECODE 0x0b0000 /* Aborted Command - no additional sense code */ +#define SCSI_KCQAC_SYNCDATATRANSFERERROR 0x0b1b00 /* Aborted Command - sync data transfer error (extra ACK) */ +#define SCSI_KCQAC_UNSUPPORTEDLUN 0x0b2500 /* Aborted Command - unsupported LUN */ +#define SCSI_KCQAC_ECHOBUFFEROVERWRITTEN 0x0b3f0f /* Aborted Command - echo buffer overwritten */ +#define SCSI_KCQAC_MESSAGEREJECTERROR 0x0b4300 /* Aborted Command - message reject error */ +#define SCSI_KCQAC_INTERNALTARGETFAILURE 0x0b4400 /* Aborted Command - internal target failure */ +#define SCSI_KCQAC_SELECTIONFAILURE 0x0b4500 /* Aborted Command - Selection/Reselection failure */ +#define SCSI_KCQAC_SCSIPARITYERROR 0x0b4700 /* Aborted Command - SCSI parity error */ +#define SCSI_KCQAC_INITIATORDETECTEDERRORECEIVED 0x0b4800 /* Aborted Command - initiator-detected error message received */ +#define SCSI_KCQAC_ILLEGALMESSAGE 0x0b4900 /* Aborted Command - inappropriate/illegal message */ +#define SCSI_KCQAC_DATAPHASEERROR 0x0b4b00 /* Aborted Command - data phase error */ +#define SCSI_KCQAC_OVERLAPPEDCOMMANDSATTEMPTED 0x0b4e00 /* Aborted Command - overlapped commands attempted */ +#define SCSI_KCQAC_LOOPINITIALIZATION 0x0b4f00 /* Aborted Command - due to loop initialization */ + +/* Other KCQ values: */ + +#define SCSO_KCQOTHER_MISCOMPARE 0x0e1d00 /* Miscompare - during verify byte check operation */ + +/* SSCSI Status Codes *******************************************************/ + +#define SCSI_STATUS_OK 0x00 /* OK */ +#define SCSI_STATUS_CHECKCONDITION 0x02 /* Check condition */ +#define SCSI_STATUS_CONDITIONMET 0x04 /* Condition met */ +#define SCSI_STATUS_BUSY 0x08 /* Busy */ +#define SCSI_STATUS_INTERMEDIATE 0x10 /* Intermediate */ +#define SCSI_STATUS_DATAOVERUNDERRUN 0x12 /* Data Under/Over Run? */ +#define SCSI_STATUS_INTERMEDIATECONDITIONMET 0x14 /* Intermediate - Condition met */ +#define SCSI_STATUS_RESERVATIONCONFLICT 0x18 /* Reservation conflict */ +#define SCSI_STATUS_COMMANDTERMINATED 0x22 /* Command terminated */ +#define SCSI_STATUS_QUEUEFULL 0x28 /* Queue (task set) full */ +#define SCSI_STATUS_ACAACTIVE 0x30 /* ACA active */ +#define SCSI_STATUS_TASKABORTED 0x40 /* Task aborted */ + +/* Definitions for selected SCSI commands ***********************************/ + +/* Inquiry */ + +#define SCSICMD_INQUIRYFLAGS_EVPD 0x01 /* Bit 0: EVPD */ + /* Bits 5-7: Peripheral Qualifier */ +#define SCSIRESP_INQUIRYPQ_CONNECTED 0x00 /* 000: Device is connected */ +#define SCSIRESP_INQUIRYPQ_NOTCONNECTED 0x20 /* 001: Device is NOT connected */ +#define SCSIRESP_INQUIRYPQ_NOTCAPABLE 0x60 /* 011: LUN not supported */ + /* Bits 0-4: Peripheral Device */ +#define SCSIRESP_INQUIRYPD_DIRECTACCESS 0x00 /* Direct-access block device */ +#define SCSIRESP_INQUIRYPD_SEQUENTIALACCESS 0x01 /* Sequential-access block device */ +#define SCSIRESP_INQUIRYPD_PRINTER 0x02 /* Printer device */ +#define SCSIRESP_INQUIRYPD_PROCESSOR 0x03 /* Processor device */ +#define SCSIRESP_INQUIRYPD_WRONCE 0x04 /* Write once device */ +#define SCSIRESP_INQUIRYPD_CDDVD 0x05 /* CD/DVD device */ +#define SCSIRESP_INQUIRYPD_SCANNER 0x06 /* Scanner device (obsolete) */ +#define SCSIRESP_INQUIRYPD_OPTICAL 0x07 /* Optical memory device */ +#define SCSIRESP_INQUIRYPD_MEDIUMCHANGER 0x08 /* Medium changer device (Jukebox) */ +#define SCSIRESP_INQUIRYPD_COMMUNICATIONS 0x09 /* Communications device (obsolete) */ +#define SCSIRESP_INQUIRYPD_STORAGEARRAY 0x0c /* Storage array controller device */ +#define SCSIRESP_INQUIRYPD_ENCLOSURESERVICES 0x0d /* Enclosure services device */ +#define SCSIRESP_INQUIRYPD_RBC 0x0e /* Simplified direct-access device */ +#define SCSIRESP_INQUIRYPD_OCRW 0x0f /* Optical reader/writer device */ +#define SCSIRESP_INQUIRYPD_BCC 0x10 /* Bridge controller commands */ +#define SCSIRESP_INQUIRYPD_OSD 0x11 /* Object-based storage device */ +#define SCSIRESP_INQUIRYPD_ADC 0x12 /* Automation/drive interface */ +#define SCSIRESP_INQUIRYPD_WKLU 0x1e /* Well-known logical unit */ +#define SCSIRESP_INQUIRYPD_UNKNOWN 0x1f /* Direct-access block device */ + +#define SCSIRESP_INQUIRYFLAGS1_RMB 0x80 /* Bit 7: RMB */ +#define SCSIRESP_INQUIRYFLAGS2_NORMACA 0x20 /* Bit 5: NormACA */ +#define SCSIRESP_INQUIRYFLAGS2_HISUP 0x10 /* Bit 4: HiSup */ +#define SCSIRESP_INQUIRYFLAGS2_FMTMASK 0x0f /* Bits 0-3: Response data format */ + +#define SCSIRESP_INQUIRYFLAGS3_SCCS 0x80 /* Bit 8: SCCS */ +#define SCSIRESP_INQUIRYFLAGS3_ACC 0x40 /* Bit 7: ACC */ +#define SCSIRESP_INQUIRYFLAGS3_TPGSMASK 0x30 /* Bits 4-5: TPGS */ +#define SCSIRESP_INQUIRYFLAGS3_3PC 0x08 /* Bit 3: 3PC */ +#define SCSIRESP_INQUIRYFLAGS3_PROTECT 0x01 /* Bit 0: Protect */ + +#define SCSIRESP_INQUIRYFLAGS4_BQUE 0x80 /* Bit 7: BQue */ +#define SCSIRESP_INQUIRYFLAGS4_ENCSERV 0x40 /* Bit 6: EncServ */ +#define SCSIRESP_INQUIRYFLAGS4_VS 0x20 /* Bit 5: VS */ +#define SCSIRESP_INQUIRYFLAGS4_MULTIP 0x10 /* Bit 4: MultIP */ +#define SCSIRESP_INQUIRYFLAGS4_MCHNGR 0x08 /* Bit 3: MChngr */ +#define SCSIRESP_INQUIRYFLAGS4_ADDR16 0x01 /* Bit 0: Addr16 */ + +#define SCSIRESP_INQUIRYFLAGS5_WBUS16 0x20 /* Bit 5: WBus16 */ +#define SCSIRESP_INQUIRYFLAGS5_SYNC 0x10 /* Bit 4: SYNC */ +#define SCSIRESP_INQUIRYFLAGS5_LINKED 0x08 /* Bit 3: LINKED */ +#define SCSIRESP_INQUIRYFLAGS5_CMDQUEUE 0x02 /* Bit 1: CmdQue */ +#define SCSIRESP_INQUIRYFLAGS5_VS 0x01 /* Bit 0: VS */ + +#define SCSIRESP_INQUIRYFLAGS6_CLOCKINGMASK 0xc0 /* Bits 2-3: Clocking */ +#define SCSIRESP_INQUIRYFLAGS6_QAS 0x02 /* Bit 1: QAS */ +#define SCSIRESP_INQUIRYFLAGS6_IUS 0x01 /* Bit 0: IUS */ + +/* Sense data */ +/* Sense data response codes */ + +#define SCSIRESP_SENSEDATA_CURRENTFIXED 0x70 /* Byte 1 is always the response code */ +#define SCSIRESP_SENSEDATA_DEFERREDFIXED 0x71 +#define SCSIRESP_SENSEDATA_CURRENTDESC 0x72 +#define SCSIRESP_SENSEDATA_DEFERREDDESC 0x73 + +#define SCSIRESP_SENSEDATA_RESPVALID 0x80 + +/* Fixed sense data flags */ + +#define SCSIRESP_SENSEDATA_FILEMARK 0x80 /* Bit 7: FileMark */ +#define SCSIRESP_SENSEDATA_EOM 0x40 /* Bit 6: EOM */ +#define SCSIRESP_SENSEDATA_ILI 0x20 /* Bit 5: ILI */ +#define SCSIRESP_SENSEDATA_SENSEKEYMASK 0x0f /* Bits 0-3: Sense key */ +#define SCSIRESP_SENSEDATA_NOSENSE 0x00 /* Nothing to be reported */ +#define SCSIRESP_SENSEDATA_RECOVEREDERROR 0x01 /* Successful after recovery action */ +#define SCSIRESP_SENSEDATA_NOTREADY 0x02 /* Logical unit is not accessible */ +#define SCSIRESP_SENSEDATA_MEDIUMERROR 0x03 /* Error posssibly caused by flaw in medium */ +#define SCSIRESP_SENSEDATA_HARDWAREERROR 0x04 /* Non-recoverable hardware error */ +#define SCSIRESP_SENSEDATA_ILLEGALREQUEST 0x05 /* Error in recived request */ +#define SCSIRESP_SENSEDATA_UNITATTENTION 0x06 /* Unit attention condition */ +#define SCSIRESP_SENSEDATA_DATAPROTECT 0x07 /* Action failed, medium protected */ +#define SCSIRESP_SENSEDATA_BLANKCHECK 0x08 /* Encountered blank media */ +#define SCSIRESP_SENSEDATA_VENDORSPECIFIC 0x09 /* Vendor specific condition */ +#define SCSIRESP_SENSEDATA_ABORTEDCOMMAND 0x0b /* Command was aborted */ + +#define SCSIRESP_SENSEDATA_KEYVALID 0x80 /* Sense-specific data valid */ + +/* Mode Select 6 */ + +#define SCSICMD_MODESELECT6_PF 0x10 /* Bit 4: PF */ +#define SCSICMD_MODESELECT6_SP 0x01 /* Bit 0: SP */ + +/* Mode Sense 6 */ + +#define SCSICMD_MODESENSE6_DBD 0x08 /* Bit 3: PF */ + +#define SCSICMD_MODESENSE_PCMASK 0xc0 /* Bits 6-7: Page control (PC) */ +#define SCSICMD_MODESENSE_PCCURRENT 0x00 /* Current values */ +#define SCSICMD_MODESENSE_PCCHANGEABLE 0x40 /* Changeable values */ +#define SCSICMD_MODESENSE_PCDEFAULT 0x80 /* Default values */ +#define SCSICMD_MODESENSE_PCSAVED 0xc0 /* Saved values */ +#define SCSICMD_MODESENSE_PGCODEMASK 0x3f /* Bits 0-5: Page code */ + +#define SCSICMD_MODESENSE6_PCDEFAULT 0x80 /* Default values */ + /* Direct-access device page codes */ +#define SCSIRESP_MODESENSE_PGCCODE_VENDOR 0x00 /* Vendor-specific */ +#define SCSIRESP_MODESENSE_PGCCODE_RWERROR 0x01 /* Read/Write error recovery mode page */ +#define SCSIRESP_MODESENSE_PGCCODE_RECONNECT 0x02 /* Disconnect-reconnect mode page */ +#define SCSIRESP_MODESENSE_PGCCODE_FORMATDEV 0x03 /* Format device mode page (obsolete) */ +#define SCSIRESP_MODESENSE_PGCCODE_RIGID 0x04 /* Rigid disk geometry mode page (obsolete) */ +#define SCSIRESP_MODESENSE_PGCCODE_FLEXIBLE 0x05 /* Flexible disk geometry mode page (obsolete) */ +#define SCSIRESP_MODESENSE_PGCCODE_VERIFY 0x07 /* Verify error recovery mode page */ +#define SCSIRESP_MODESENSE_PGCCODE_CACHING 0x08 /* Caching mode page */ +#define SCSIRESP_MODESENSE_PGCCODE_CONTROL 0x0a /* Control mode page (0x0a/0x00) */ +#define SCSIRESP_MODESENSE_PGCCODE_CONTROLEXT 0x0a /* Control extension mode page (0x0a/0x01) */ +#define SCSIRESP_MODESENSE_PGCCODE_MEDIUMTYPES 0x0b /* Medum types supported mode page (obsolete) */ +#define SCSIRESP_MODESENSE_PGCCODE_NP 0x0c /* Notch and partition mode page (obsolete) */ +#define SCSIRESP_MODESENSE_PGCCODE_XOR 0x10 /* XOR control mode page */ +#define SCSIRESP_MODESENSE_PGCCODE_ES 0x14 /* Enclosure services mode page */ +#define SCSIRESP_MODESENSE_PGCCODE_PSLUN 0x18 /* Protocol-specific LUN mode page */ +#define SCSIRESP_MODESENSE_PGCCODE_PSPORT 0x19 /* Protocol-specific port mode page */ +#define SCSIRESP_MODESENSE_PGCCODE_POWER 0x1a /* Power condition mode page */ +#define SCSIRESP_MODESENSE_PGCCODE_IE 0x1c /* Informational exceptions control mode page (0x1c/0x00) */ +#define SCSIRESP_MODESENSE_PGCCODE_BC 0x1c /* Background control mode page (0x1c/0x01) */ +#define SCSIRESP_MODESENSE_PGCCODE_RETURNALL 0x3f /* Return all mode pages */ + /* Direct-access caching mode page */ +#define SCSIRESP_CACHINGMODEPG_PS 0x80 /* Byte 0, Bit 7: PS */ +#define SCSIRESP_CACHINGMODEPG_SPF 0x60 /* Byte 0, Bit 6: SPF */ +#define SCSIRESP_CACHINGMODEPG_IC 0x80 /* Byte 2, Bit 7: IC */ +#define SCSIRESP_CACHINGMODEPG_ABPF 0x40 /* Byte 2, Bit 6: ABPF */ +#define SCSIRESP_CACHINGMODEPG_CAP 0x20 /* Byte 2, Bit 5: CAP */ +#define SCSIRESP_CACHINGMODEPG_DISC 0x10 /* Byte 2, Bit 4: DISC */ +#define SCSIRESP_CACHINGMODEPG_SIZE 0x08 /* Byte 2, Bit 3: SIZE */ +#define SCSIRESP_CACHINGMODEPG_WCE 0x04 /* Byte 2, Bit 2: Write cache enable (WCE) */ +#define SCSIRESP_CACHINGMODEPG_MF 0x02 /* Byte 2, Bit 1: MF */ +#define SCSIRESP_CACHINGMODEPG_RCD 0x01 /* Byte 2, Bit 0: Read cache disable (RCD) */ + +#define SCSIRESP_MODEPARMHDR_DAPARM_WP 0x80 /* Bit 7: WP (Direct-access block devices only) */ +#define SCSIRESP_MODEPARMHDR_DAPARM_DBPFUA 0x10 /* Bit 4: DBOFUA (Direct-access block devices only) */ + +#define SCSIRESP_PAGEFMT_PS 0x80 /* Bit 7: PS */ +#define SCSIRESP_PAGEFMT_SPF 0x40 /* Bit 6: SPF */ +#define SCSIRESP_PAGEFMT_PGCODEMASK 0x3f /* Bits 0-5: Page code */ + +/* Prevent / Allow Medium Removal */ + +#define SCSICMD_PREVENTMEDIUMREMOVAL_TRANSPORT 0x01 /* Removal prohibited from data transport */ +#define SCSICMD_PREVENTMEDIUMREMOVAL_MCHANGER 0x02 /* Removal prohibited from medium changer */ + +/* Read format capacities */ + +#define SCIRESP_RDFMTCAPACITIES_UNFORMATED 0x01 /* Unformatted media */ +#define SCIRESP_RDFMTCAPACITIES_FORMATED 0x02 /* Formatted media */ +#define SCIRESP_RDFMTCAPACITIES_NOMEDIA 0x03 /* No media */ + +/* Read 6 */ + +#define SCSICMD_READ6_MSLBAMASK 0x1f + +/* Write 6 */ + +#define SCSICMD_WRITE6_MSLBAMASK 0x1f + +/* Mode Select 10 */ + +#define SCSICMD_MODESELECT10_PF 0x10 /* Bit 4: PF */ +#define SCSICMD_MODESELECT10_SP 0x01 /* Bit 0: SP */ + +/* Mode Sense 10 */ + +#define SCSICMD_MODESENSE10_LLBAA 0x10 /* Bit 4: LLBAA */ +#define SCSICMD_MODESENSE10_DBD 0x08 /* Bit 3: PF */ + +/* Read 10 */ + +#define SCSICMD_READ10FLAGS_RDPROTECTMASK 0xe0 +#define SCSICMD_READ10FLAGS_DPO 0x10 /* Disable Page Out */ +#define SCSICMD_READ10FLAGS_FUA 0x08 +#define SCSICMD_READ10FLAGS_FUANV 0x02 + +/* Write 10 */ + +#define SCSICMD_WRITE10FLAGS_WRPROTECTMASK 0xe0 +#define SCSICMD_WRITE10FLAGS_DPO 0x10 /* Disable Page Out */ +#define SCSICMD_WRITE10FLAGS_FUA 0x08 +#define SCSICMD_WRITE10FLAGS_FUANV 0x02 + +/* Verify 10 */ + +#define SCSICMD_VERIFY10_VRPROTECTMASK 0xe0 /* Byte 1: Bits 5-7: VRPROTECT */ +#define SCSICMD_VERIFY10_DPO 0x10 /* Byte 1: Bit 4: Disable Page Out (DPO) */ +#define SCSICMD_VERIFY10_BYTCHK 0x02 /* Byte 1: Bit 2: BytChk */ + +/* Read 12 */ + +#define SCSICMD_READ12FLAGS_RDPROTECTMASK 0xe0 +#define SCSICMD_READ12FLAGS_DPO 0x10 /* Disable Page Out */ +#define SCSICMD_READ12FLAGS_FUA 0x08 +#define SCSICMD_READ12FLAGS_FUANV 0x02 + +/* Write 12 */ + +#define SCSICMD_WRITE12FLAGS_WRPROTECTMASK 0xe0 +#define SCSICMD_WRITE12FLAGS_DPO 0x10 /* Disable Page Out */ +#define SCSICMD_WRITE12FLAGS_FUA 0x08 +#define SCSICMD_WRITE12FLAGS_FUANV 0x02 + +/* Verify 12 */ + +#define SCSICMD_VERIFY12_VRPROTECTMASK 0xe0 /* Byte 1: Bits 5-7: VRPROTECT */ +#define SCSICMD_VERIFY12_DPO 0x10 /* Byte 1: Bit 4: Disable Page Out (DPO) */ +#define SCSICMD_VERIFY12_BYTCHK 0x02 /* Byte 1: Bit 2: BytChk */ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* Format structures for selected SCSI primary commands */ + +#define SCSICMD_TESTUNITREADY_SIZEOF 6 + +struct scsicmd_requestsense_s +{ + uint8_t opcode; /* 0: 0x03 */ + uint8_t flags; /* 1: See SCSICMD_REQUESTSENSE_FLAGS_* */ + uint8_t reserved[2]; /* 2-3: Reserved */ + uint8_t alloclen; /* 4: Allocation length */ + uint8_t control; /* 5: Control */ +}; +#define SCSICMD_REQUESTSENSE_SIZEOF 6 +#define SCSICMD_REQUESTSENSE_MSSIZEOF 12 /* MS-Windows REQUEST SENSE with cbw->cdblen == 12 */ + +struct scsiresp_fixedsensedata_s +{ + uint8_t code; /* 0: Response code See SCSIRESP_SENSEDATA_*FIXED defns */ + uint8_t obsolete; /* 1: */ + uint8_t flags; /* 2: See SCSIRESP_SENSEDATA_* definitions */ + uint8_t info[4]; /* 3-6: Information */ + uint8_t len; /* 7: Additional length */ + uint8_t cmdinfo[4]; /* 8-11: Command-specific information */ + uint8_t code2; /* 12: Additional sense code */ + uint8_t qual2; /* 13: Additional sense code qualifier */ + uint8_t fru; /* 14: Field replacement unit code */ + uint8_t key[3]; /* 15-17: Sense key specific */ + /* 18-: Additional bytes may follow */ +}; +#define SCSIRESP_FIXEDSENSEDATA_SIZEOF 18 /* Minimum size */ + +struct scscicmd_inquiry_s +{ + uint8_t opcode; /* 0: 0x12 */ + uint8_t flags; /* 1: See SCSICMD_INQUIRY_FLAGS_* */ + uint8_t pagecode; /* 2: Page code */ + uint8_t alloclen[2]; /* 3-4: Allocation length */ + uint8_t control; /* 5: Control */ +}; +#define SCSICMD_INQUIRY_SIZEOF 6 + +#define SCSI_GET_INQUIRY_PDT(pdt) ((pdt) & 0x1f) /* get the Peripheral Device Type */ +#define SCSI_GET_INQUIRY_RMB(rmb) ((rmb) >> 7) /* get Removable Medium Bit */ +#define SCSI_MEDIUM_NOT_REMOVABLE (0) /* Not Removable */ +#define SCSI_MEDIUM_CAN_REMOVABLE (1) /* Can Removable */ + +struct scsiresp_inquiry_s +{ + /* Mandatory */ + + uint8_t qualtype; /* 0: Bits 5-7: Peripheral qualifier; Bits 0-4: Peripheral device type */ + uint8_t flags1; /* 1: See SCSIRESP_INQUIRY_FLAGS1_* */ + uint8_t version; /* 2: Version */ + uint8_t flags2; /* 3: See SCSIRESP_INQUIRY_FLAGS2_* */ + uint8_t len; /* 4: Additional length */ + uint8_t flags3; /* 5: See SCSIRESP_INQUIRY_FLAGS3_* */ + uint8_t flags4; /* 6: See SCSIRESP_INQUIRY_FLAGS4_* */ + uint8_t flags5; /* 7: See SCSIRESP_INQUIRY_FLAGS5_* */ + uint8_t vendorid[8]; /* 8-15: T10 Vendor Identification */ + uint8_t productid[16]; /* 16-31: Product Identification */ + uint8_t revision[4]; /* 32-35: Product Revision Level */ + + /* Optional */ + + uint8_t vendor[20]; /* 36-55: Vendor specific */ + uint8_t flags6; /* 56: See SCSIRESP_INQUIRY_FLAGS6_* */ + uint8_t reserved1; /* 57: Reserved */ + uint8_t version1[2]; /* 58-59: Version Descriptor 1 */ + uint8_t version2[2]; /* 60-61: Version Descriptor 2 */ + uint8_t version3[2]; /* 62-63: Version Descriptor 3 */ + uint8_t version4[2]; /* 64-65: Version Descriptor 4 */ + uint8_t version5[2]; /* 66-67: Version Descriptor 5 */ + uint8_t version6[2]; /* 68-69: Version Descriptor 6 */ + uint8_t version7[2]; /* 70-71: Version Descriptor 7 */ + uint8_t version8[2]; /* 72-73: Version Descriptor 8 */ + uint8_t reserved2[22]; /* 74-95: Reserved */ + /* 96-: Vendor-specific parameters may follow */ +}; +#define SCSIRESP_INQUIRY_SIZEOF 36 /* Minimum size */ + +struct scsicmd_modeselect6_s +{ + uint8_t opcode; /* 0x15 */ + uint8_t flags; /* 1: See SCSICMD_MODESELECT6_FLAGS_* */ + uint8_t reserved[2]; /* 2-3: Reserved */ + uint8_t plen; /* 4: Parameter list length */ + uint8_t control; /* 5: Control */ +}; +#define SCSICMD_MODESELECT6_SIZEOF 6 + +struct scsicmd_modesense6_s +{ + uint8_t opcode; /* 0x1a */ + uint8_t flags; /* 1: See SCSICMD_MODESENSE6_FLAGS_* */ + uint8_t pcpgcode; /* 2: Bits 6-7: PC, bits 0-5: page code */ + uint8_t subpgcode; /* 3: subpage code */ + uint8_t alloclen; /* 4: Allocation length */ + uint8_t control; /* 5: Control */ +}; +#define SCSICMD_MODESENSE6_SIZEOF 6 + +struct scsiresp_modeparameterhdr6_s +{ + uint8_t mdlen; /* 0: Mode data length */ + uint8_t type; /* 1: Medium type */ + uint8_t param; /* 2: Device-specific parameter */ + uint8_t bdlen; /* 3: Block descriptor length */ +}; +#define SCSIRESP_MODEPARAMETERHDR6_SIZEOF 4 + +struct scsiresp_blockdesc_s +{ + uint8_t density; /* 0: density code */ + uint8_t nblocks[3]; /* 1-3: Number of blocks */ + uint8_t reserved; /* 4: reserved */ + uint8_t blklen[3]; /* 5-7: Block len */ +}; +#define SCSIRESP_BLOCKDESC_SIZEOF 8 + +struct scsiresp_pageformat_s +{ + uint8_t pgcode; /* 0: See SCSIRESP_PAGEFMT_* definitions */ + uint8_t pglen; /* 1: Page length (n-1) */ + uint8_t parms[1]; /* 2-n: Mode parameters */ +}; + +struct scsiresp_subpageformat_s +{ + uint8_t pgcode; /* 0: See SCSIRESP_PAGEFMT_* definitions */ + uint8_t subpgcode; /* 1: sub-page code */ + uint8_t pglen[2]; /* 2-3: Page length (n-3) */ + uint8_t parms[1]; /* 4-n: Mode parameters */ +}; + +struct scsiresp_cachingmodepage_s +{ + uint8_t pgcode; /* 0: Bit 7: PS; Bit 6: SPF, Bits 0-5: page code == 8 */ + uint8_t len; /* 1: Page length (18) */ + uint8_t flags1; /* 2: See SCSIRESP_CACHINGMODEPG_* definitions */ + uint8_t priority; /* 3: Bits 4-7: Demand read retention priority; Bits 0-3: Write retention priority */ + uint8_t dpflen[2]; /* 4-5: Disable prefetch transfer length */ + uint8_t minpf[2]; /* 6-7: Minimum pre-fetch */ + uint8_t maxpf[2]; /* 8-9: Maximum pre-fetch */ + uint8_t maxpfc[2]; /* 10-11: Maximum pref-fetch ceiling */ + uint8_t flags2; /* 12: See SCSIRESP_CACHINGMODEPG_* definitions */ + uint8_t nsegments; /* 13: Number of cache segments */ + uint8_t segsize[2]; /* 14-15: Cache segment size */ + uint8_t reserved; /* 16: Reserved */ + uint8_t obsolete[3]; /* 17-19: Obsolete */ +}; + +/* Format structures for selected SCSI block commands */ + +struct scsicmd_read6_s +{ + uint8_t opcode; /* 0: 0x08 */ + uint8_t mslba; /* 1: Bits 5-7: reserved; Bits 0-6: MS Logical Block Address (LBA) */ + uint8_t lslba[2]; /* 2-3: LS Logical Block Address (LBA) */ + uint8_t xfrlen; /* 4: Transfer length (in contiguous logical blocks)*/ + uint8_t control; /* 5: Control */ +}; +#define SCSICMD_READ6_SIZEOF 6 + +struct scsicmd_write6_s +{ + uint8_t opcode; /* 0: 0x0a */ + uint8_t mslba; /* 1: Bits 5-7: reserved; Bits 0-6: MS Logical Block Address (LBA) */ + uint8_t lslba[2]; /* 2-3: LS Logical Block Address (LBA) */ + uint8_t xfrlen; /* 4: Transfer length (in contiguous logical blocks) */ + uint8_t control; /* 5: Control */ +}; +#define SCSICMD_WRITE6_SIZEOF 6 + +struct scsicmd_startstopunit_s +{ + uint8_t opcode; /* 0: 0x1b */ + uint8_t immed; /* 1: Bits 2-7: Reserved, Bit 0: Immed */ + uint8_t reserved; /* 2: reserved */ + uint8_t pcm; /* 3: Bits 4-7: Reserved, Bits 0-3: Power condition modifier */ + uint8_t pc; /* 4: Bits 4-7: Power condition, Bit 2: NO_FLUSH, Bit 1: LOEJ, Bit 0: START */ + uint8_t control; /* 5: Control */ +}; +#define SCSICMD_STARTSTOPUNIT_SIZEOF 6 + +struct scsicmd_preventmediumremoval_s +{ + uint8_t opcode; /* 0: 0x1e */ + uint8_t reserved[3]; /* 1-3: Reserved */ + uint8_t prevent; /* 4: Bits 2-7: Reserved, Bits 0:1: prevent */ + uint8_t control; /* 5: Control */ +}; +#define SCSICMD_PREVENTMEDIUMREMOVAL_SIZEOF 6 + +struct scsicmd_readformatcapcacities_s +{ + uint8_t opcode; /* 0: 0x23 */ + uint8_t reserved[6]; /* 1-6: Reserved */ + uint8_t alloclen[2]; /* 7-8: Allocation length */ + uint8_t control; /* 9: Control */ +}; +#define SCSICMD_READFORMATCAPACITIES_SIZEOF 10 + +struct scsiresp_readformatcapacities_s +{ + /* Current capacity header */ + + uint8_t reserved[3]; /* 0-2: Reserved */ + uint8_t listlen; /* 3: Capacity list length */ + + /* Current/Maximum Capacity Descriptor (actually a separate structure) */ + + uint8_t nblocks[4]; /* 4-7: Number of blocks */ + uint8_t type; /* 8: Bits 2-7: Reserved, Bits 0-1: Descriptor type */ + uint8_t blocklen[3]; /* 9-11: Block length */ +}; +#define SCSIRESP_READFORMATCAPACITIES_SIZEOF 12 +#define SCSIRESP_CURRCAPACITYDESC_SIZEOF 8 + +struct scsiresp_formattedcapacitydesc_s +{ + uint8_t nblocks[4]; /* 0-3: Number of blocks */ + uint8_t type; /* 4: Bits 2-7: Type, bits 0-1, reserved */ + uint8_t param[3]; /* 5-7: Type dependent parameter */ +}; +#define SCSIRESP_FORMATTEDCAPACITYDESC_SIZEOF 8 + +struct scsicmd_readcapacity10_s +{ + uint8_t opcode; /* 0: 0x25 */ + uint8_t reserved1; /* 1: Bits 1-7: Reserved, Bit 0: Obsolete */ + uint8_t lba[4]; /* 2-5: Logical block address (LBA) */ + uint8_t reserved2[2]; /* 6-7: Reserved */ + uint8_t pmi; /* 8: Bits 1-7 Reserved; Bit 0: PMI */ + uint8_t control; /* 9: Control */ +}; +#define SCSICMD_READCAPACITY10_SIZEOF 10 + +struct scsiresp_readcapacity10_s +{ + uint8_t lba[4]; /* 0-3: Returned logical block address (LBA) */ + uint8_t blklen[4]; /* 4-7: Logical block length (in bytes) */ +}; +#define SCSIRESP_READCAPACITY10_SIZEOF 8 + +struct scsicmd_readcapacity16_s +{ + uint8_t opcode; /* 0: 0x9E */ + uint8_t reserved1; /* 1: Bits 0-4: Service Action, Bit 5-7: Reserved */ + uint8_t lba[8]; /* 2-9: Logical block address (LBA) */ + uint8_t blklen[4]; /* 10-13: Allocation Length */ + uint8_t pmi; /* 14: Bits 1-7 Reserved; Bit 0: PMI */ + uint8_t control; /* 15: Control */ +}; +#define SCSICMD_READCAPACITY16_SIZEOF 16 + +struct scsiresp_readcapacity16_s +{ + uint8_t lba[8]; /* 0-7: Returned logical block address (LBA) */ + uint8_t blklen[4]; /* 8-11: Logical block length (in bytes) */ + uint8_t prot; /* 12: Bits 0: PROT_EN, Bits 1-3: P_TYPE, Bits 4-7: Reserved*/ + uint8_t reserved[19]; /* 13-31: Reserved */ +}; +#define SCSIRESP_READCAPACITY16_SIZEOF 32 + +struct scsicmd_read16_s +{ + uint8_t opcode; /* 0: 0x88 */ + uint8_t flags; /* 1: See SCSICMD_READ16 FLAGS* */ + uint8_t lba[8]; /* 2-9: Logical Block Address (LBA) */ + uint8_t xfrlen[4]; /* 10-13: Transfer length (in contiguous logical blocks) */ + uint8_t groupno; /* 14: Bits 7: Restricted for MMC-4; Bits 5-6: reserved; Bits 0-4: group number */ + uint8_t control; /* 15: Control */ +}; +#define SCSICMD_READ16_SIZEOF 16 + +struct scsicmd_write16_s +{ + uint8_t opcode; /* 0: 0x8a */ + uint8_t flags; /* 1: See SCSICMD_WRITE10FLAGS_* */ + uint8_t lba[8]; /* 2-9: Logical Block Address (LBA) */ + uint8_t xfrlen[4]; /* 10-13: Transfer length (in contiguous logical blocks) */ + uint8_t groupno; /* 14: Bits 7: RESTRICTED FOR MMC-4; Bits 5-6: reserved; Bits 0-4: group number */ + uint8_t control; /* 9: Control */ +}; +#define SCSICMD_WRITE16_SIZEOF 16 + +struct scsicmd_read10_s +{ + uint8_t opcode; /* 0: 0x28 */ + uint8_t flags; /* 1: See SCSICMD_READ10FLAGS_* */ + uint8_t lba[4]; /* 2-5: Logical Block Address (LBA) */ + uint8_t groupno; /* 6: Bits 5-7: reserved; Bits 0-6: group number */ + uint8_t xfrlen[2]; /* 7-8: Transfer length (in contiguous logical blocks) */ + uint8_t control; /* 9: Control */ +}; +#define SCSICMD_READ10_SIZEOF 10 + +struct scsicmd_write10_s +{ + uint8_t opcode; /* 0: 0x2a */ + uint8_t flags; /* 1: See SCSICMD_WRITE10FLAGS_* */ + uint8_t lba[4]; /* 2-5: Logical Block Address (LBA) */ + uint8_t groupno; /* 6: Bits 5-7: reserved; Bits 0-6: group number */ + uint8_t xfrlen[2]; /* 7-8: Transfer length (in contiguous logical blocks) */ + uint8_t control; /* 9: Control */ +}; +#define SCSICMD_WRITE10_SIZEOF 10 + +struct scsicmd_verify10_s +{ + uint8_t opcode; /* 0: 0x2f */ + uint8_t flags; /* 1: See SCSICMD_VERIFY10_* definitions */ + uint8_t lba[4]; /* 2-5: Logical block address (LBA) */ + uint8_t groupno; /* 6: Bit 7: restricted; Bits 5-6: Reserved, Bits 0-4: Group number */ + uint8_t len[2]; /* 7-8: Verification length (in blocks) */ + uint8_t control; /* 9: Control */ +}; +#define SCSICMD_VERIFY10_SIZEOF 10 + +struct scsicmd_synchronizecache10_s +{ + uint8_t opcode; /* 0: 0x35 */ + uint8_t flags; /* 1: See SCSICMD_SYNCHRONIZECACHE10_* definitions */ + uint8_t lba[4]; /* 2-5: Logical block address (LBA) */ + uint8_t groupno; /* 6: Bit 7: restricted; Bits 5-6: Reserved, Bits 0-4: Group number */ + uint8_t len[2]; /* 7-8: Number of logical blocks */ + uint8_t control; /* 9: Control */ +}; +#define SCSICMD_SYNCHRONIZECACHE10_SIZEOF 10 + +struct scsicmd_modeselect10_s +{ + uint8_t opcode; /* 0: 0x55 */ + uint8_t flags; /* 1: See SCSICMD_MODESELECT10_FLAGS_* */ + uint8_t reserved[5]; /* 2-6: Reserved */ + uint8_t parmlen[2]; /* 7-8: Parameter list length */ + uint8_t control; /* 9: Control */ +}; +#define SCSICMD_MODESELECT10_SIZEOF 10 + +struct scsiresp_modeparameterhdr10_s +{ + uint8_t mdlen[2]; /* 0-1: Mode data length */ + uint8_t type; /* 2: Medium type */ + uint8_t param; /* 3: Device-specific parameter */ + uint8_t reserved[2]; /* 4-5: reserved */ + uint8_t bdlen[2]; /* 6-7: Block descriptor length */ +}; +#define SCSIRESP_MODEPARAMETERHDR10_SIZEOF 8 + +struct scsicmd_modesense10_s +{ + uint8_t opcode; /* O: 0x5a */ + uint8_t flags; /* 1: See SCSICMD_MODESENSE10_FLAGS_* */ + uint8_t pcpgcode; /* 2: Bits 6-7: PC, bits 0-5: page code */ + uint8_t subpgcode; /* 3: subpage code */ + uint8_t reserved[3]; /* 4-6: reserved */ + uint8_t alloclen[2]; /* 7-8: Allocation length */ + uint8_t control; /* 9: Control */ +}; +#define SCSICMD_MODESENSE10_SIZEOF 10 + +struct scsicmd_read12_s +{ + uint8_t opcode; /* 0: 0xa8 */ + uint8_t flags; /* 1: See SCSICMD_READ12FLAGS_* */ + uint8_t lba[4]; /* 2-5: Logical Block Address (LBA) */ + uint8_t xfrlen[4]; /* 6-9: Transfer length (in contiguous logical blocks) */ + uint8_t groupno; /* 10: Bit 7: restricted; Bits 5-6: reserved; Bits 0-6: group number */ + uint8_t control; /* 11: Control */ +}; +#define SCSICMD_READ12_SIZEOF 12 + +struct scsicmd_write12_s +{ + uint8_t opcode; /* 0: 0xaa */ + uint8_t flags; /* 1: See SCSICMD_WRITE12FLAGS_* */ + uint8_t lba[4]; /* 2-5: Logical Block Address (LBA) */ + uint8_t xfrlen[4]; /* 6-9: Transfer length (in contiguous logical blocks) */ + uint8_t groupno; /* 10: Bit 7: restricted; Bits 5-6: reserved; Bits 0-6: group number */ + uint8_t control; /* 11: Control */ +}; +#define SCSICMD_WRITE12_SIZEOF 12 + +struct scsicmd_verify12_s +{ + uint8_t opcode; /* 0: 0xaf */ + uint8_t flags; /* 1: See SCSICMD_VERIFY12_* definitions */ + uint8_t lba[4]; /* 2-5: Logical block address (LBA) */ + uint8_t len[4]; /* 6-9: Verification length */ + uint8_t groupno; /* 10: Bit 7: restricted; Bits 5-6: Reserved, Bits 0-4: Group number */ + uint8_t control; /* 11: Control */ +}; +#define SCSICMD_VERIFY12_SIZEOF 12 + +#define SCSICMD_TESTUNITREADY8_SIZEOF 6 + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __INCLUDE_NUTTX_SCSI_H */ \ No newline at end of file diff --git a/include/nuttx/usb/storage.h b/include/nuttx/usb/storage.h new file mode 100755 index 0000000..90ba1db --- /dev/null +++ b/include/nuttx/usb/storage.h @@ -0,0 +1,132 @@ +/************************************************************************************ + * include/nuttx/usb/storage.h + * + * Copyright (C) 2008-2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * References: + * "Universal Serial Bus Mass Storage Class, Specification Overview," + * Revision 1.2, USB Implementer's Forum, June 23, 2003. + * + * "Universal Serial Bus Mass Storage Class, Bulk-Only Transport," + * Revision 1.0, USB Implementer's Forum, September 31, 1999. + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ************************************************************************************/ + +#ifndef __INCLUDE_NUTTX_USB_STORAGE_H +#define __INCLUDE_NUTTX_USB_STORAGE_H + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +/************************************************************************************ + * Pre-processor Definitions + ************************************************************************************/ + +/* Mass storage requests */ + +#define USBMSC_TYPE_SETUPIN (USB_DIR_IN|UT_CLASS|UT_INTERFACE) +#define USBMSC_TYPE_SETUPOUT (USB_DIR_OUT|UT_CLASS|UT_INTERFACE) + +#define USBMSC_REQ_MSRESET (0xff) /* Reset mass storage device and interface */ +#define USBMSC_REQ_GETMAXLUN (0xfe) /* Return number LUNs supported */ + +/* Mass storage subclass codes */ + +#define USBMSC_SUBCLASS_RBC (0x01) /* Reduced block commands (e.g., flash devices) */ +#define USBMSC_SUBCLASS_SFF1 (0x02) /* SFF-8020i/MMC-2 (ATAPI) (e.g., C/DVD) */ +#define USBMSC_SUBCLASS_QIC (0x03) /* QIC-157 (e.g., tape device) */ +#define USBMSC_SUBCLASS_UFI (0x04) /* e.g. floppy device */ +#define USBMSC_SUBCLASS_SFF2 (0x05) /* SFF-8070i (e.g. floppy disk) */ +#define USBMSC_SUBCLASS_SCSI (0x06) /* SCSI transparent */ + +#define UMASS_ATTACH_PRENAME "/dev/sd" +#define MASS_NAME 10 +#define MAX_DEVICE 5 + +/* Mass storage transport protocols */ + +#define USBMSC_PROTO_CBI0 (0x00) /* CBI transport with command completion interrupt */ +#define USBMSC_PROTO_CBI1 (0x01) /* CBI transport without command completion interrupt */ +#define USBMSC_PROTO_BULKONLY (0x50) /* Bulk only transport */ + +/* Common Block Wrapper (CBW) */ + +#define USBMSC_CBW_SIZEOF (31) +#define USBMSC_CBW_SIGNATURE (0x43425355) /* Little endian USBC */ +#define USBMSC_CBWFLAG_IN (0x80) /* Bit 7=1: Direction = IN */ + +#define USBMSC_MAXCDBLEN (16) /* Max length of SCSI Command Data Block */ + +/* Command Status Wrapper (CSW) */ + +#define USBMSC_CSW_SIZEOF (13) +#define USBMSC_CSW_SIGNATURE (0x53425355) /* Little endian 'USBS' */ +#define USBMSC_CSWSTATUS_PASS (0) +#define USBMSC_CSWSTATUS_FAIL (1) +#define USBMSC_CSWSTATUS_PHASEERROR (2) + +/************************************************************************************ + * Public Types + ************************************************************************************/ + +/* Command Block Wrapper (CBW) */ + +struct usbmsc_cbw_s +{ + uint8_t signature[4]; /* 'USBC' = 0x43425355 */ + uint8_t tag[4]; /* Depends on command id */ + uint8_t datlen[4]; /* Number of bytes that host expects to transfer */ + uint8_t flags; /* Bit 7: Direction=IN (other obsolete or reserved) */ + uint8_t lun; /* LUN (normally 0) */ + uint8_t cdblen; /* len of cdb[] */ + uint8_t cdb[USBMSC_MAXCDBLEN]; /* Command Data Block */ +}; + +/* Command Status Wrapper (CSW) */ + +struct usbmsc_csw_s +{ + uint8_t signature[4]; /* 'USBS' = 0x53425355 */ + uint8_t tag[4]; /* Same tag as original command */ + uint8_t residue[4]; /* Amount not transferred */ + uint8_t status; /* Status of transfer */ +}; + +/************************************************************************************ + * Public Data + ************************************************************************************/ + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +#endif /* __INCLUDE_NUTTX_USB_STORAGE_H */ \ No newline at end of file diff --git a/include/nuttx/video/fb.h b/include/nuttx/video/fb.h new file mode 100755 index 0000000..1c8a06a --- /dev/null +++ b/include/nuttx/video/fb.h @@ -0,0 +1,709 @@ +/**************************************************************************** + * include/nuttx/video/fb.h + * + * Copyright (C) 2008-2011, 2013, 2016-2018 Gregory Nutt. All rights + * reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __INCLUDE_NUTTX_VIDEO_FB_H +#define __INCLUDE_NUTTX_VIDEO_FB_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "los_config.h" +#include "compiler.h" +#include "los_vm_map.h" + +#define CONFIG_FB_CMAP +#define CONFIG_FB_OVERLAY_BLIT +#define CONFIG_FB_OVERLAY +#define CONFIG_FB_TRANSPARENCY + + +/**************************************************************************** + * Pre-processor definitions + ****************************************************************************/ + +/* Color format definitions. The pretty much define the color pixel processing + * organization of the video controller. + */ + +/* Monochrome Formats *******************************************************/ + +#define FB_FMT_Y1 0 /* BPP=1, monochrome */ +#define FB_FMT_Y2 1 /* BPP=2, 2-bit uncompressed greyscale */ +#define FB_FMT_Y4 2 /* BPP=4, 4-bit uncompressed greyscale */ +#define FB_FMT_Y8 3 /* BPP=8, 8-bit uncompressed greyscale */ +#define FB_FMT_Y16 4 /* BPP=16, 16-bit uncompressed greyscale */ +#define FB_FMT_GREY FB_FMT_Y8 /* BPP=8 */ +#define FB_FMT_Y800 FB_FMT_Y8 /* BPP=8 */ + +#define FB_ISMONO(f) ((f) >= FB_FMT_Y4) && (f) <= FB_FMT_Y16) + +/* RGB video formats ********************************************************/ + +/* Standard RGB */ + +#define FB_FMT_RGB1 FB_FMT_Y1 /* BPP=1 */ +#define FB_FMT_RGB4 5 /* BPP=4 */ +#define FB_FMT_RGB8 6 /* BPP=8 RGB palette index */ +#define FB_FMT_RGB8_222 7 /* BPP=8 R=2, G=2, B=2 */ +#define FB_FMT_RGB8_332 8 /* BPP=8 R=3, G=3, B=2 */ +#define FB_FMT_RGB12_444 9 /* BPP=12 R=4, G=4, B=4 */ +#define FB_FMT_RGB16_555 10 /* BPP=16 R=5, G=5, B=5 (1 unused bit) */ +#define FB_FMT_RGB16_565 11 /* BPP=16 R=6, G=6, B=5 */ +#define FB_FMT_RGB24 12 /* BPP=24 */ +#define FB_FMT_RGB32 13 /* BPP=32 */ + +/* Run length encoded RGB */ + +#define FB_FMT_RGBRLE4 14 /* BPP=4 */ +#define FB_FMT_RGBRLE8 15 /* BPP=8 */ + +/* Raw RGB */ + +#define FB_FMT_RGBRAW 16 /* BPP=? */ + +/* Raw RGB with arbitrary sample packing within a pixel. Packing and precision + * of R, G and B components is determined by bit masks for each. + */ + +#define FB_FMT_RGBBTFLD16 17 /* BPP=16 */ +#define FB_FMT_RGBBTFLD24 18 /* BPP=24 */ +#define FB_FMT_RGBBTFLD32 19 /* BPP=32 */ +#define FB_FMT_RGBA16 20 /* BPP=16 Raw RGB with alpha */ +#define FB_FMT_RGBA32 21 /* BPP=32 Raw RGB with alpha */ + +/* Raw RGB with a transparency field. Layout is as for standard RGB at 16 and + * 32 bits per pixel but the msb in each pixel indicates whether the pixel is + * transparent or not. + */ + +#define FB_FMT_RGBT16 22 /* BPP=16 */ +#define FB_FMT_RGBT32 23 /* BPP=32 */ + +#define FB_ISRGB(f) ((f) >= FB_FMT_RGB1) && (f) <= FB_FMT_RGBT32) + +/* Packed YUV Formats *******************************************************/ + +#define FB_FMT_AYUV 24 /* BPP=32 Combined YUV and alpha */ +#define FB_FMT_CLJR 25 /* BPP=8 4 pixels packed into a uint32_t. + * YUV 4:1:1 with l< 8 bits + * per YUV sample */ +#define FB_FMT_CYUV 26 /* BPP=16 UYVY except that height is + * reversed */ +#define FB_FMT_IRAW 27 /* BPP=? Intel uncompressed YUV */ +#define FB_FMT_IUYV 28 /* BPP=16 Interlaced UYVY (line order + * 0,2,4,.., 1,3,5...) */ +#define FB_FMT_IY41 29 /* BPP=12 Interlaced Y41P (line order + * 0,2,4,.., 1,3,5...) */ +#define FB_FMT_IYU2 30 /* BPP=24 */ +#define FB_FMT_HDYC 31 /* BPP=16 UYVY except uses the BT709 + * color space */ +#define FB_FMT_UYVP 32 /* BPP=24? YCbCr 4:2:2, 10-bits per + * component in U0Y0V0Y1 order */ +#define FB_FMT_UYVY 33 /* BPP=16 YUV 4:2:2 */ +#define FB_FMT_UYNV FB_FMT_UYVY /* BPP=16 */ +#define FB_FMT_Y422 FB_FMT_UYVY /* BPP=16 */ +#define FB_FMT_V210 34 /* BPP=32 10-bit 4:2:2 YCrCb */ +#define FB_FMT_V422 35 /* BPP=16 Upside down version of UYVY */ +#define FB_FMT_V655 36 /* BPP=16? 16-bit YUV 4:2:2 */ +#define FB_FMT_VYUY 37 /* BPP=? ATI Packed YUV Data */ +#define FB_FMT_YUYV 38 /* BPP=16 YUV 4:2:2 */ +#define FB_FMT_YUY2 FB_FMT_YUYV /* BPP=16 YUV 4:2:2 */ +#define FB_FMT_YUNV FB_FMT_YUYV /* BPP=16 YUV 4:2:2 */ +#define FB_FMT_YVYU 39 /* BPP=16 YUV 4:2:2 */ +#define FB_FMT_Y41P 40 /* BPP=12 YUV 4:1:1 */ +#define FB_FMT_Y411 41 /* BPP=12 YUV 4:1:1 */ +#define FB_FMT_Y211 42 /* BPP=8 */ +#define FB_FMT_Y41T 43 /* BPP=12 Y41P LSB for transparency */ +#define FB_FMT_Y42T 44 /* BPP=16 UYVY LSB for transparency */ +#define FB_FMT_YUVP 45 /* BPP=24? YCbCr 4:2:2 Y0U0Y1V0 order */ + +#define FB_ISYUVPACKED(f) ((f) >= FB_FMT_AYUV) && (f) <= FB_FMT_YUVP) + +/* Packed Planar YUV Formats ************************************************/ + +#define FB_FMT_YVU9 46 /* BPP=9 8-bit Y followed by 8-bit + * 4x4 VU */ +#define FB_FMT_YUV9 47 /* BPP=9? */ +#define FB_FMT_IF09 48 /* BPP=9.5 YVU9 + 4x4 plane of delta + * relative to tframe. */ +#define FB_FMT_YV16 49 /* BPP=16 8-bit Y followed by 8-bit + * 2x1 VU */ +#define FB_FMT_YV12 50 /* BPP=12 8-bit Y followed by 8-bit + * 2x2 VU */ +#define FB_FMT_I420 51 /* BPP=12 8-bit Y followed by 8-bit + * 2x2 UV */ +#define FB_FMT_IYUV FB_FMT_I420 /* BPP=12 */ +#define FB_FMT_NV12 52 /* BPP=12 8-bit Y followed by an + * interleaved 2x2 UV */ +#define FB_FMT_NV21 53 /* BPP=12 NV12 with UV reversed */ +#define FB_FMT_IMC1 54 /* BPP=12 YV12 except UV planes same + * stride as Y */ +#define FB_FMT_IMC2 55 /* BPP=12 IMC1 except UV lines + * interleaved at half stride + * boundaries */ +#define FB_FMT_IMC3 56 /* BPP=12 As IMC1 except that UV + * swapped */ +#define FB_FMT_IMC4 57 /* BPP=12 As IMC2 except that UV + * swapped */ +#define FB_FMT_CLPL 58 /* BPP=12 YV12 but including a level + * of indirection. */ +#define FB_FMT_Y41B 59 /* BPP=12? 4:1:1 planar. */ +#define FB_FMT_Y42B 60 /* BPP=16? YUV 4:2:2 planar. */ +#define FB_FMT_CXY1 61 /* BPP=12 */ +#define FB_FMT_CXY2 62 /* BPP=16 */ + +#define FB_ISYUVPLANAR(f) (((f) >= FB_FMT_AYUV) && (f) <= FB_FMT_YUVP) +#define FB_ISYUV(f) (FB_ISYUVPACKED(f) || FB_ISYUVPLANAR(f)) + +/* Hardware cursor control **************************************************/ + +#ifdef CONFIG_FB_HWCURSOR +# define FB_CUR_ENABLE 0x01 /* Enable the cursor */ +# define FB_CUR_SETIMAGE 0x02 /* Set the cursor image */ +# define FB_CUR_SETPOSITION 0x04 /* Set the position of the cursor */ +# define FB_CUR_SETSIZE 0x08 /* Set the size of the cursor */ +# define FB_CUR_XOR 0x10 /* Use XOR vs COPY ROP on image */ +#endif + +/* Hardware overlay acceleration *******************************************/ + +#ifdef CONFIG_FB_OVERLAY +# define FB_ACCL_TRANSP 0x01 /* Hardware tranparency support */ +# define FB_ACCL_CHROMA 0x02 /* Hardware chromakey support */ +# define FB_ACCL_COLOR 0x04 /* Hardware color support */ +# define FB_ACCL_AREA 0x08 /* Hardware support area selection */ + +#ifdef CONFIG_FB_OVERLAY_BLIT +# define FB_ACCL_BLIT 0x10 /* Hardware blit support */ +# define FB_ACCL_BLEND 0x20 /* Hardware blend support */ +#endif + +/* Overlay transparency mode ************************************************/ + +# define FB_CONST_ALPHA 0x00 /* Transparency by alpha value */ +# define FB_PIXEL_ALPHA 0x01 /* Transparency by pixel alpha value */ + +#endif /* CONFIG_FB_OVERLAY */ + +/* FB character driver IOCTL commands ***************************************/ +#define _FBIOCBASE (0x2800) /* Frame buffer character driver ioctl commands */ +#define _IOC_X(type,nr) ((type)|(nr)) +#define _FBIOC(nr) _IOC_X(_FBIOCBASE,nr) + +/* ioctls */ + +#define FBIOGET_VIDEOINFO _FBIOC(0x0001) /* Get color plane info */ + /* Argument: writable struct + * fb_videoinfo_s */ +#define FBIOGET_PLANEINFO _FBIOC(0x0002) /* Get video plane info */ + /* Argument: writable struct + * fb_planeinfo_s */ + +#ifdef CONFIG_FB_CMAP +# define FBIOGET_CMAP _FBIOC(0x0003) /* Get RGB color mapping */ + /* Argument: writable struct + * fb_cmap_s */ +# define FBIOPUT_CMAP _FBIOC(0x0004) /* Put RGB color mapping */ + /* Argument: read-only struct + * fb_cmap_s */ +#endif + +#ifdef CONFIG_FB_HWCURSOR +# define FBIOGET_CURSOR _FBIOC(0x0005) /* Get cursor attributes */ + /* Argument: writable struct + * fb_cursorattrib_s */ +# define FBIOPUT_CURSOR _FBIOC(0x0006) /* Set cursor attributes */ + /* Argument: read-only struct + * fb_setcursor_s */ +#endif + +#ifdef CONFIG_LCD_UPDATE +# define FBIO_UPDATE _FBIOC(0x0007) /* Update a rectangular region in + * the framebuffer + * Argument: read-only struct + * nxgl_rect_s */ +#endif + +#ifdef CONFIG_FB_SYNC +# define FBIO_WAITFORVSYNC _FBIOC(0x0008) /* Wait for vertical sync */ +#endif + +#ifdef CONFIG_FB_OVERLAY +# define FBIOGET_OVERLAYINFO _FBIOC(0x0009) /* Get video overlay info */ + /* Argument: writable struct + * fb_overlayinfo_s */ +# define FBIO_SELECT_OVERLAY _FBIOC(0x000a) /* Select overlay */ + /* Argument: read-only + * unsigned long */ +# define FBIOSET_TRANSP _FBIOC(0x000b) /* Set opacity or transparency + * Argument: read-only struct + * fb_overlayinfo_s */ +# define FBIOSET_CHROMAKEY _FBIOC(0x000c) /* Set chroma key + * Argument: read-only struct + * fb_overlayinfo_s */ +# define FBIOSET_COLOR _FBIOC(0x000d) /* Set color + * Argument: read-only struct + * fb_overlayinfo_s */ +# define FBIOSET_BLANK _FBIOC(0x000e) /* Blank or unblank + * Argument: read-only struct + * fb_overlayinfo_s */ +# define FBIOSET_AREA _FBIOC(0x000f) /* Set active overlay area + * Argument: read-only struct + * fb_overlayinfo_s */ +#ifdef CONFIG_FB_OVERLAY_BLIT +# define FBIOSET_BLIT _FBIOC(0x0010) /* Blit area between overlays + * Argument: read-only struct + * fb_overlayblit_s */ +# define FBIOSET_BLEND _FBIOC(0x0011) /* Blend area between overlays + * Argument: read-only struct + * fb_overlayblend_s */ +#endif +#endif /* CONFIG_FB_OVERLAY */ + +#define FIOC_MMAP _FBIOC(0x0012) + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* If any dimension of the display exceeds 65,536 pixels, then the following + * type will need to change: + */ + +typedef uint16_t fb_coord_t; + +/* This structure describes the overall video controller */ + +struct fb_videoinfo_s +{ + uint8_t fmt; /* see FB_FMT_* */ + fb_coord_t xres; /* Horizontal resolution in pixel columns */ + fb_coord_t yres; /* Vertical resolution in pixel rows */ + uint8_t nplanes; /* Number of color planes supported */ +#ifdef CONFIG_FB_OVERLAY + uint8_t noverlays; /* Number of overlays supported */ +#endif +}; + +/* This structure describes one color plane. Some YUV formats may support + * up to 4 planes + */ + +struct fb_planeinfo_s +{ + FAR void *fbmem; /* Start of frame buffer memory */ + size_t fblen; /* Length of frame buffer memory in bytes */ + fb_coord_t stride; /* Length of a line in bytes */ + uint8_t display; /* Display number */ + uint8_t bpp; /* Bits per pixel */ +}; + +#ifdef CONFIG_FB_OVERLAY +/* This structure describes the transparency. */ + +struct fb_transp_s +{ + uint8_t transp; /* Transparency */ + uint8_t transp_mode; /* Transparency mode */ +}; + +/* This structure describes an area. */ + +struct fb_area_s +{ + fb_coord_t x; /* x-offset of the area */ + fb_coord_t y; /* y-offset of the area */ + fb_coord_t w; /* Width of the area */ + fb_coord_t h; /* Height of the area */ +}; + +/* This structure describes one overlay. */ + +struct fb_overlayinfo_s +{ + FAR void *fbmem; /* Start of frame buffer virtual memory */ + FAR void *memphys; /* Start of frame buffer physical memory */ + size_t fblen; /* Length of frame buffer memory in bytes */ + fb_coord_t stride; /* Length of a line in bytes */ + uint8_t overlay; /* Overlay number */ + uint8_t bpp; /* Bits per pixel */ + uint8_t blank; /* Blank or unblank */ + uint32_t chromakey; /* Chroma key argb8888 formatted */ + uint32_t color; /* Color argb8888 formatted */ + struct fb_transp_s transp; /* Transparency */ + struct fb_area_s sarea; /* Selected area within the overlay */ + uint32_t accl; /* Supported hardware acceleration */ +}; + +#ifdef CONFIG_FB_OVERLAY_BLIT +/* This structure describes an overlay area within a whole overlay */ + +struct fb_overlayarea_s +{ + uint8_t overlay; /* Number overlay */ + struct fb_area_s area; /* Overlay area */ +}; + +/* This structure describes blit operation */ + +struct fb_overlayblit_s +{ + struct fb_overlayarea_s dest; /* The destination overlay area */ + struct fb_overlayarea_s src; /* The source overlay area */ +}; + +/* This structure describes blend operation */ + +struct fb_overlayblend_s +{ + struct fb_overlayarea_s dest; /* The destination overlay area */ + struct fb_overlayarea_s foreground; /* The foreground overlay area */ + struct fb_overlayarea_s background; /* The background overlay area */ +}; +#endif +#endif /* CONFIG_FB_OVERLAY */ + +/* On video controllers that support mapping of a pixel palette value + * to an RGB encoding, the following structure may be used to define + * that mapping. + */ + +#ifdef CONFIG_FB_CMAP +struct fb_cmap_s +{ + uint16_t first; /* Offset offset first color entry in tables */ + uint16_t len; /* Number of color entries in tables */ + + /* Tables of color component. Any may be NULL if not used */ + + uint8_t *red; /* Table of 8-bit red values */ + uint8_t *green; /* Table of 8-bit green values */ + uint8_t *blue; /* Table of 8-bit blue values */ +#ifdef CONFIG_FB_TRANSPARENCY + uint8_t *transp; /* Table of 8-bit transparency */ +#endif +}; +#endif + +#ifdef CONFIG_FB_HWCURSOR +#ifdef CONFIG_FB_HWCURSORIMAGE +/* If the video controller hardware supports a hardware cursor and + * that hardware cursor supports user-provided images, then the + * following structure may be used to provide the cursor image + */ + +struct fb_cursorimage_s +{ + fb_coord_t width; /* Width of the cursor image in pixels */ + fb_coord_t height /* Height of the cursor image in pixels */ + const uint8_t *image; /* Pointer to image data */ +}; +#endif + +/* The following structure defines the cursor position/size */ + +struct fb_cursorpos_s +{ + fb_coord_t x; /* X position in pixels */ + fb_coord_t y; /* Y position in rows */ +}; + +/* If the hardware supports setting the cursor size, then this structure + * is used to provide the size. + */ + +#ifdef CONFIG_FB_HWCURSORSIZE +struct fb_cursorsize_s +{ + fb_coord_t h; /* Height in rows */ + fb_coord_t w; /* Width in pixels */ +}; +#endif + +/* The following is used to get the cursor attributes */ + +struct fb_cursorattrib_s +{ +#ifdef CONFIG_FB_HWCURSORIMAGE + uint8_t fmt; /* Video format of cursor */ +#endif + struct fb_cursorpos_s pos; /* Current cursor position */ +#ifdef CONFIG_FB_HWCURSORSIZE + struct fb_cursorsize_s mxsize; /* Maximum cursor size */ + struct fb_cursorsize_s size; /* Current size */ +#endif +}; + +struct fb_setcursor_s +{ + uint8_t flags; /* See FB_CUR_* definitions */ + struct fb_cursorpos_s pos; /* Cursor position */ +#ifdef CONFIG_FB_HWCURSORSIZE + struct fb_cursorsize_s size; /* Cursor size */ +#endif +#ifdef CONFIG_FB_HWCURSORIMAGE + struct fb_cursorimage_s img; /* Cursor image */ +#endif +}; +#endif + +/* The framebuffer "object" is accessed through within the OS via + * the following vtable: + */ + +struct fb_vtable_s +{ + /* Get information about the video controller configuration and the + * configuration of each color plane. + */ + + int (*getvideoinfo)(FAR struct fb_vtable_s *vtable, + FAR struct fb_videoinfo_s *vinfo); + int (*getplaneinfo)(FAR struct fb_vtable_s *vtable, int planeno, + FAR struct fb_planeinfo_s *pinfo); + +#ifdef CONFIG_FB_CMAP + /* The following are provided only if the video hardware supports RGB + * color mapping + */ + + int (*getcmap)(FAR struct fb_vtable_s *vtable, + FAR struct fb_cmap_s *cmap); + int (*putcmap)(FAR struct fb_vtable_s *vtable, + FAR const struct fb_cmap_s *cmap); +#endif + +#ifdef CONFIG_FB_HWCURSOR + /* The following are provided only if the video hardware supports a + * hardware cursor. + */ + + int (*getcursor)(FAR struct fb_vtable_s *vtable, + FAR struct fb_cursorattrib_s *attrib); + int (*setcursor)(FAR struct fb_vtable_s *vtable, + FAR struct fb_setcursor_s *settings); +#endif + +#ifdef CONFIG_FB_SYNC + /* The following are provided only if the video hardware signals + * vertical snyc. + */ + + int (*waitforvsync)(FAR struct fb_vtable_s *vtable); +#endif + +#ifdef CONFIG_FB_OVERLAY + /* Get information about the video controller configuration and the + * configuration of each overlay. + */ + + int (*getoverlayinfo)(FAR struct fb_vtable_s *vtable, int overlayno, + FAR struct fb_overlayinfo_s *oinfo); + + /* The following are provided only if the video hardware supports + * transparency + */ + + int (*settransp)(FAR struct fb_vtable_s *vtable, + FAR const struct fb_overlayinfo_s *oinfo); + + /* The following are provided only if the video hardware supports + * chromakey + */ + + int (*setchromakey)(FAR struct fb_vtable_s *vtable, + FAR const struct fb_overlayinfo_s *oinfo); + + /* The following are provided only if the video hardware supports + * filling the overlay with a color. + */ + + int (*setcolor)(FAR struct fb_vtable_s *vtable, + FAR const struct fb_overlayinfo_s *oinfo); + + /* The following allows to switch the overlay on or off */ + + int (*setblank)(FAR struct fb_vtable_s *vtable, + FAR const struct fb_overlayinfo_s *oinfo); + + /* The following allows to set the active area for subsequently overlay + * operations. + */ + + int (*setarea)(FAR struct fb_vtable_s *vtable, + FAR const struct fb_overlayinfo_s *oinfo); + +# ifdef CONFIG_FB_OVERLAY_BLIT + /* The following are provided only if the video hardware supports + * blit operation between overlays. + */ + + int (*blit)(FAR struct fb_vtable_s *vtable, + FAR const struct fb_overlayblit_s *blit); + + /* The following are provided only if the video hardware supports + * blend operation between overlays. + */ + + int (*blend)(FAR struct fb_vtable_s *vtable, + FAR const struct fb_overlayblend_s *blend); +# endif +#endif + int (*fb_open)(struct fb_vtable_s *vtable); + int (*fb_release)(struct fb_vtable_s *vtable); +#ifdef CONFIG_FB_OVERLAY + int (*fb_pan_display)(struct fb_vtable_s *vtable, struct fb_overlayinfo_s *oinfo); +#endif + int (*fb_ioctl)(struct fb_vtable_s *vtable, int cmd, unsigned long arg); + int (*fb_check_var)(struct fb_vtable_s *vtable, unsigned long arg); + int (*fb_set_par)(struct fb_vtable_s *vtable); + ssize_t (*fb_mmap)(FAR struct fb_vtable_s *vtable, FAR LosVmMapRegion *region); +}; + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * If an architecture supports a framebuffer, then it must provide the + * following APIs to access the framebuffer. + ****************************************************************************/ + +/**************************************************************************** + * Name: up_fbinitialize + * + * Description: + * Initialize the framebuffer video hardware associated with the display. + * + * There are multiple logic paths that may call up_fbinitialize() so any + * implementation of up_fbinitialize() should be tolerant of being called + * multiple times. + * + * Input Parameters: + * display - In the case of hardware with multiple displays, this + * specifies the display. Normally this is zero. + * + * Returned Value: + * Zero is returned on success; a negated errno value is returned on any + * failure. + * + ****************************************************************************/ + +int up_fbinitialize(int display); + +/**************************************************************************** + * Name: up_fbgetvplane + * + * Description: + * Return a a reference to the framebuffer object for the specified video + * plane of the specified plane. Many OSDs support multiple planes of video. + * + * Input Parameters: + * display - In the case of hardware with multiple displays, this + * specifies the display. Normally this is zero. + * vplane - Identifies the plane being queried. + * + * Returned Value: + * A non-NULL pointer to the frame buffer access structure is returned on + * success; NULL is returned on any failure. + * + ****************************************************************************/ + +FAR struct fb_vtable_s *up_fbgetvplane(int display, int vplane); + +/**************************************************************************** + * Name: up_fbuninitialize + * + * Description: + * Uninitialize the framebuffer support for the specified display. + * + * Input Parameters: + * display - In the case of hardware with multiple displays, this + * specifies the display. Normally this is zero. + * + * Returned Value: + * None + * + ****************************************************************************/ + +void up_fbuninitialize(int display); + +/**************************************************************************** + * Name: fb_register + * + * Description: + * Register the framebuffer character device at /dev/fbN where N is the + * display number if the devices supports only a single plane. If the + * hardware supports multiple color planes, then the device will be + * registered at /dev/fbN.M where N is the again display number but M + * is the display plane. + * + * Input Parameters: + * display - The display number for the case of boards supporting multiple + * displays or for hardware that supports multiple + * layers (each layer is consider a display). Typically zero. + * plane - Identifies the color plane on hardware that supports separate + * framebuffer "planes" for each color component. + * + * Returned Value: + * Zero (OK) is returned success; a negated errno value is returned on any + * failure. + * + ****************************************************************************/ + +int fb_register(int display, int plane); + +int fb_unregister(int display); + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __INCLUDE_NUTTX_VIDEO_FB_H */ diff --git a/include/syslog.h b/include/syslog.h new file mode 100755 index 0000000..7289804 --- /dev/null +++ b/include/syslog.h @@ -0,0 +1,301 @@ +/**************************************************************************** + * include/syslog.h + * + * Copyright (C) 2013-2014, 2018 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "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 + * COPYRIGHT OWNER OR CONTRIBUTORS 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. + * + ****************************************************************************/ + +#ifndef __INCLUDE_SYSLOG_H +#define __INCLUDE_SYSLOG_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "vfs_config.h" + +#include "stdint.h" +#include "stdarg.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* __cplusplus */ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* The option argument to openlog() is an OR of any of these: + * + * LOG_CONS - Write directly to system console if there is an error + * while sending to system logger. + * LOG_NDELAY - Open the connection immediately (normally, the connection + * is opened when the first message is logged). + * LOG_NOWAIT - Don't wait for child processes that may have been created + * while logging the message. + * LOG_ODELAY - The converse of LOG_NDELAY; opening of the connection is + * delayed until syslog() is called. (This is the default, + * and need not be specified.) + * LOG_PERROR - (Not in POSIX.1-2001 or POSIX.1-2008.) Print to stderr + * as well (Linux). + * LOG_PID - Include PID with each message. + */ + +/* Note: openlog() is not currently supported */ + +/* The facility argument is used to specify what type of program is logging + * the message. This lets the configuration file specify that messages from + * different facilities will be handled differently. + * + * LOG_AUTH - Security/authorization messages + * LOG_AUTHPRIV - Security/authorization messages (private) + * LOG_CRON - Clock daemon (cron and at) + * LOG_DAEMON - System daemons without separate facility value + * LOG_FTP - Ftp daemon + * LOG_KERN - Lernel messages (these can't be generated from user + * processes) + * LOG_LOCAL0 through LOG_LOCAL7 - Reserved for local use + * LOG_LPR - Line printer subsystem + * LOG_MAIL - Mail subsystem + * LOG_NEWS - USENET news subsystem + * LOG_SYSLOG - Messages generated internally by syslogd(8) + * LOG_USER - Generic user-level messages (default) + * LOG_UUCP - UUCP subsystem + */ + +#define LOG_AUTH 0 +#define LOG_AUTHPRIV 0 +#define LOG_CRON 0 +#define LOG_DAEMON 0 +#define LOG_FTP 0 +#define LOG_KERN 0 +#define LOG_LOCAL0 0 +#define LOG_LOCAL1 0 +#define LOG_LOCAL2 0 +#define LOG_LOCAL3 0 +#define LOG_LOCAL4 0 +#define LOG_LOCAL5 0 +#define LOG_LOCAL6 0 +#define LOG_LOCAL7 0 +#define LOG_LPR 0 +#define LOG_MAIL 0 +#define LOG_NEWS 0 +#define LOG_SYSLOG 0 +#define LOG_USER 0 +#define LOG_UUCP 0 + +/* This determines the importance of the message. The levels are, in order + * of decreasing importance: + */ + +#define LOG_EMERG 0 /* System is unusable */ +#define LOG_ALERT 1 /* Action must be taken immediately */ +#define LOG_CRIT 2 /* Critical conditions */ +#define LOG_ERR 3 /* Error conditions */ +#define LOG_WARNING 4 /* Warning conditions */ +#define LOG_NOTICE 5 /* Normal, but significant, condition */ +#define LOG_INFO 6 /* Informational message */ +#define LOG_DEBUG 7 /* Debug-level message */ + +/* Used with setlogmask() */ + +#define LOG_MASK(p) (1 << (p)) +#define LOG_UPTO(p) ((1 << (p)) - 1) +#define LOG_ALL 0xff + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#if defined(CONFIG_SYSLOG_CHAR) && !defined(CONFIG_SYSLOG_DEVPATH) +# define CONFIG_SYSLOG_DEVPATH "/dev/ttyS1" +#endif + +/**************************************************************************** + * Name: openlog + * + * Description: + * The openlog() function sets process attributes that affect subsequent + * calls to syslog(). The ident argument is a string that is prepended to + * every message. The logopt argument indicates logging options. Values + * for logopt are constructed by a bitwise-inclusive OR of zero or more of + * the following: + * + * LOG_PID - Log the process ID with each message. This is useful for + * identifying specific processes. + * + * LOG_CONS - Write messages to the system console if they cannot be + * sent to the logging facility. The syslog() function ensures that + * the process does not acquire the console as a controlling terminal + * in the process of writing the message. + * + * LOG_NDELAY - Open the connection to the logging facility immediately. + * Normally the open is delayed until the first message is logged. + * This is useful for programs that need to manage the order in which + * file descriptors are allocated. + * + * LOG_ODELAY - Delay open until syslog() is called. + * + * LOG_NOWAIT - Do not wait for child processes that may have been + * created during the course of logging the message. This option + * should be used by processes that enable notification of child + * termination using SIGCHLD, since syslog() may otherwise block + * waiting for a child whose exit status has already been collected. + * + * The facility argument encodes a default facility to be assigned to all + * messages that do not have an explicit facility already encoded. The + * initial default facility is LOG_USER. + * + * It is not necessary to call openlog() prior to calling syslog(). + * + ****************************************************************************/ + +#if 0 /* Not supported */ +void openlog(FAR const char *ident, int option, int facility); +#endif + +/**************************************************************************** + * Name: closelog + * + * Description: + * The openlog() and syslog() functions may allocate a file descriptor. + * The closelog() function will close any open file descriptors allocated + * by previous calls to openlog() or syslog(). + * + ****************************************************************************/ + +#if 0 /* Not supported */ +void closelog(void); +#endif + +/**************************************************************************** + * Name: syslog and vsyslog + * + * 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. + * + ****************************************************************************/ + +int syslog(int priority, const char *format, ...); +int vsyslog(int priority, const char *src, va_list ap); + +/**************************************************************************** + * Name: lowsyslog and lowvsyslog + * + * 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. + * + * This is a non-standard, low-level system logging interface. The + * difference between syslog() and lowsyslog() is that the syslog() + * interface writes to the syslog device (usually fd=1, stdout) whereas + * lowsyslog() uses a lower level interface that works even from interrupt + * handlers. + * + * If the platform cannot support lowsyslog, then we will substitute the + * standard syslogging functions. These will, however, probably cause + * problems if called from interrupt handlers, depending upon the nature of + * the underlying syslog device. + * + * The function lowvsyslog() performs the same task as lowsyslog() with + * the difference that it takes a set of arguments which have been + * obtained using the stdarg variable argument list macros. + * + ****************************************************************************/ + +#ifdef CONFIG_ARCH_LOWPUTC + +int lowsyslog(int priority, FAR const char *format, ...); +int lowvsyslog(int priority, FAR const char *format, va_list ap); + +#else + +# ifdef CONFIG_CPP_HAVE_VARARGS +# define lowsyslog(p,f,...) syslog(p,f,##__VA_ARGS__) +# else +# define lowsyslog (void) +# endif +# define lowvsyslog(p,f,a) vsyslog(p,f,a) + +#endif + +/**************************************************************************** + * Name: setlogmask + * + * Description: + * The setlogmask() function sets the logmask and returns the previous + * mask. If the mask argument is 0, 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: + * + * Flat Build: There is one, global SYSLOG mask that controls all output. + * Protected Build: There are two SYSLOG masks. One within the kernel + * that controls only kernel output. And one in user-space that controls + * only user SYSLOG output. + * Kernel Build: The kernel build is compliant with the POSIX requirement: + * There will be one mask for for each user process, controlling the + * SYSLOG output only form that process. There will be a separate mask + * accessable only in the kernel code to control kernel SYSLOG output. + * + ****************************************************************************/ + +int setlogmask(int mask); + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __INCLUDE_SYSLOG_H */