From 168976579a7a81d31112283b23ff9fe7b7d25166 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 26 May 2013 16:44:53 -0600 Subject: 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. --- nuttx/ChangeLog | 7 + nuttx/arch/mips/src/pic32mx/Kconfig | 2 +- nuttx/configs/pcblogic-pic32mx/README.txt | 6 +- nuttx/configs/sure-pic32mx/Kconfig | 33 + nuttx/configs/sure-pic32mx/README.txt | 263 +++-- nuttx/configs/sure-pic32mx/nsh/Make.defs | 6 +- nuttx/configs/sure-pic32mx/nsh/appconfig | 77 -- nuttx/configs/sure-pic32mx/nsh/defconfig | 1023 ++++++++++++-------- nuttx/configs/sure-pic32mx/nsh/ld.script | 317 ------ nuttx/configs/sure-pic32mx/ostest/Make.defs | 6 +- nuttx/configs/sure-pic32mx/ostest/appconfig | 39 - nuttx/configs/sure-pic32mx/ostest/defconfig | 895 ++++++++++------- nuttx/configs/sure-pic32mx/ostest/ld.script | 317 ------ nuttx/configs/sure-pic32mx/scripts/ld.script | 317 ++++++ nuttx/configs/sure-pic32mx/src/Makefile | 38 +- nuttx/configs/sure-pic32mx/src/pic32mx_autoleds.c | 217 +++++ nuttx/configs/sure-pic32mx/src/pic32mx_boot.c | 101 ++ nuttx/configs/sure-pic32mx/src/pic32mx_buttons.c | 223 +++++ nuttx/configs/sure-pic32mx/src/pic32mx_lcd1602.c | 961 ++++++++++++++++++ nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c | 372 +++++++ nuttx/configs/sure-pic32mx/src/pic32mx_spi.c | 271 ++++++ nuttx/configs/sure-pic32mx/src/pic32mx_usbdev.c | 174 ++++ nuttx/configs/sure-pic32mx/src/pic32mx_usbterm.c | 107 +++ nuttx/configs/sure-pic32mx/src/sure-internal.h | 122 --- nuttx/configs/sure-pic32mx/src/sure-pic32mx.h | 122 +++ nuttx/configs/sure-pic32mx/src/up_boot.c | 102 -- nuttx/configs/sure-pic32mx/src/up_buttons.c | 223 ----- nuttx/configs/sure-pic32mx/src/up_leds.c | 218 ----- nuttx/configs/sure-pic32mx/src/up_nsh.c | 360 ------- nuttx/configs/sure-pic32mx/src/up_spi.c | 272 ------ nuttx/configs/sure-pic32mx/src/up_usbdev.c | 175 ---- nuttx/configs/sure-pic32mx/src/up_usbterm.c | 108 --- nuttx/configs/sure-pic32mx/usbnsh/Make.defs | 6 +- nuttx/configs/sure-pic32mx/usbnsh/appconfig | 47 - nuttx/configs/sure-pic32mx/usbnsh/defconfig | 1070 +++++++++++++-------- nuttx/configs/sure-pic32mx/usbnsh/ld.script | 317 ------ 36 files changed, 4963 insertions(+), 3951 deletions(-) delete mode 100644 nuttx/configs/sure-pic32mx/nsh/appconfig delete mode 100644 nuttx/configs/sure-pic32mx/nsh/ld.script delete mode 100644 nuttx/configs/sure-pic32mx/ostest/appconfig delete mode 100644 nuttx/configs/sure-pic32mx/ostest/ld.script create mode 100644 nuttx/configs/sure-pic32mx/scripts/ld.script create mode 100644 nuttx/configs/sure-pic32mx/src/pic32mx_autoleds.c create mode 100644 nuttx/configs/sure-pic32mx/src/pic32mx_boot.c create mode 100644 nuttx/configs/sure-pic32mx/src/pic32mx_buttons.c create mode 100644 nuttx/configs/sure-pic32mx/src/pic32mx_lcd1602.c create mode 100644 nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c create mode 100644 nuttx/configs/sure-pic32mx/src/pic32mx_spi.c create mode 100644 nuttx/configs/sure-pic32mx/src/pic32mx_usbdev.c create mode 100644 nuttx/configs/sure-pic32mx/src/pic32mx_usbterm.c delete mode 100644 nuttx/configs/sure-pic32mx/src/sure-internal.h create mode 100644 nuttx/configs/sure-pic32mx/src/sure-pic32mx.h delete mode 100644 nuttx/configs/sure-pic32mx/src/up_boot.c delete mode 100644 nuttx/configs/sure-pic32mx/src/up_buttons.c delete mode 100644 nuttx/configs/sure-pic32mx/src/up_leds.c delete mode 100644 nuttx/configs/sure-pic32mx/src/up_nsh.c delete mode 100644 nuttx/configs/sure-pic32mx/src/up_spi.c delete mode 100644 nuttx/configs/sure-pic32mx/src/up_usbdev.c delete mode 100644 nuttx/configs/sure-pic32mx/src/up_usbterm.c delete mode 100644 nuttx/configs/sure-pic32mx/usbnsh/appconfig delete mode 100644 nuttx/configs/sure-pic32mx/usbnsh/ld.script diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index e02fa4f14..a630f65a4 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -4805,3 +4805,10 @@ 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). + diff --git a/nuttx/arch/mips/src/pic32mx/Kconfig b/nuttx/arch/mips/src/pic32mx/Kconfig index bc22080eb..82a901809 100644 --- a/nuttx/arch/mips/src/pic32mx/Kconfig +++ b/nuttx/arch/mips/src/pic32mx/Kconfig @@ -499,7 +499,7 @@ config PIC32MX_UART1 config PIC32MX_UART2 bool "UART2" default n - select ARCH_HAVE_UART1 + select ARCH_HAVE_UART2 config PIC32MX_UART3 bool "UART3" diff --git a/nuttx/configs/pcblogic-pic32mx/README.txt b/nuttx/configs/pcblogic-pic32mx/README.txt index baa0763ee..847f355fd 100644 --- a/nuttx/configs/pcblogic-pic32mx/README.txt +++ b/nuttx/configs/pcblogic-pic32mx/README.txt @@ -599,8 +599,7 @@ Configuration sub-directories 2. By default, this configuration uses an older Microchip C32 toolchain for Windows (the newer ones seem to be incompatible) and builds under - Cygwin (or probably MSYS). That - can easily be reconfigured, of course. + Cygwin (or probably MSYS). That can easily be reconfigured, of course. Build Setup: CONFIG_HOST_WINDOWS=y : Builds under Windows @@ -634,8 +633,7 @@ Configuration sub-directories 3. By default, this configuration uses an older Microchip C32 toolchain for Windows (the newer ones seem to be incompatible) and builds under - Cygwin (or probably MSYS). That - can easily be reconfigured, of course. + Cygwin (or probably MSYS). That can easily be reconfigured, of course. Build Setup: CONFIG_HOST_WINDOWS=y : Builds under Windows diff --git a/nuttx/configs/sure-pic32mx/Kconfig b/nuttx/configs/sure-pic32mx/Kconfig index 03753893d..ef56fa29c 100644 --- a/nuttx/configs/sure-pic32mx/Kconfig +++ b/nuttx/configs/sure-pic32mx/Kconfig @@ -4,4 +4,37 @@ # if ARCH_BOARD_SUREPIC32MX + +choice + prompt "Select Sure PIC32MX Board" + default ARCH_DBDP11215 + +config ARCH_DBDP11215 + bool "DB_DP11215 PIC32 Storage Demo Board" + ---help--- + DB_DP11215 PIC32 Storage Demo Board + + - PIC32MX44F512H + - SD card slot + - RS-2323 Interface + - USB (MINI-B) + - 2x16 LCD display + - Three tactile switches + - Four user LEDs + +config ARCH_DBDP11212 + bool "DB-DP11212 PIC32 General Purpose Demo Board" + ---help--- + DB-DP11212 PIC32 General Purpose Demo Board + + - PIC32MX44F512H + - LM75A temperature sensor and temperature resistor (NTC-SMD thermistor) + - SPI FLASH: AT25DF041A + - USB (MINI-B) + - 2x16 LCD display + - 4 digit, 8 segment LED display + - Three tactile switches + - Four user LEDs + +endchoice endif diff --git a/nuttx/configs/sure-pic32mx/README.txt b/nuttx/configs/sure-pic32mx/README.txt index a3721e2de..36abc7997 100644 --- a/nuttx/configs/sure-pic32mx/README.txt +++ b/nuttx/configs/sure-pic32mx/README.txt @@ -36,6 +36,7 @@ Contents PIC32MX440F512H Pin Out Toolchains Loading NuttX with PICkit2 + LCD1602 PIC32MX Configuration Options Configurations @@ -391,6 +392,37 @@ Loading NuttX with PICkit2 # to the top-level build directory. It is the only # required input to mkpichex. +LCD1602 +======= + + The on-board LCD is a 2x16 segment LCD and appears to be compatible with + the LCD1602 and is like an LCD1602 LCD here. + + LCD pin mapping (see configs/pcblogic-pic32mx/README.txt) + + --------------------- ---------- ---------------------------------- + PIC32 Sure JP1 Sure Signal Description + PIN SIGNAL NAME PIN NAME(s) + --------------------- ---------- ---------------------------------- + 34 Vbus 1. +5V +5V VBUS device mode + To GND via capacitor + 2. GND GND + 49 RD1 3. Vo Transistor circuit driven by PWM2 + 44 PMA0/AN15/RB15 4. RS PMA0, Selects registers + 53 PMRD/RD5 5. RW PMRD/PMWR, Selects read or write + 45 PMPCS1/RD11 6. E Starts data read/write + 60 PMD0/RE0 7. DB0 PMD0 + 61 PMD1/RE1 8. DB1 PMD1 + 62 PMD2/RE2 9. DB2 PMD2 + 63 PMD3/RE3 10. DB3 PMD3 + 64 PMD4/RE4 11. DB4 PMD4 + 1 PMD5/RE5 12. DB5 PMD5 + 2 PMD6/RE6 13. DB6 PMD6 + 3 PMD7/RE7 14. DB7 PMD7 + 15. A +5V_DUSB + 46 INT0/RD0 16. K Transistor circuit driven by PWM1 + --------------------- ---------- ---------------------------------- + PIC32MX Configuration Options ============================= @@ -596,14 +628,28 @@ PIC32MX Configuration Options Configurations ============== -Each PIC32MX configuration is maintained in a sub-directory and can be -selected as follow: + Each PIC32MX configuration is maintained in a sub-directory and can be + selected as follow: cd tools ./configure.sh sure-pic32mx/ cd - . ./setenv.sh + Where is one of the following sub-directories. + + NOTE: These configurations use the mconf-based configuration tool. To + change any of these configurations using that tool, you should: + + a. Build and install the kconfig-mconf tool. See nuttx/README.txt + and misc/tools/ + + b. Execute 'make menuconfig' in nuttx/ in order to start the + reconfiguration process. + +Configuration sub-directories +----------------------------- + Where is one of the following: ostest: @@ -613,6 +659,20 @@ Where is one of the following: This configuration directory, performs a simple OS test using apps/examples/ostest. + Notes. + ----- + 1. By default, this configuration uses an older Microchip C32 toolchain + for Windows (the newer ones seem to be incompatible) and builds under + Cygwin (or probably MSYS). That + can easily be reconfigured, of course. + + Build Setup: + CONFIG_HOST_WINDOWS=y : Builds under Windows + CONFIG_WINDOWS_CYGWIN=y : Using Cygwin + + System Type: + CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW_LITE=y : Older C32 toolchain + nsh: ==== Description. @@ -620,54 +680,122 @@ Where is one of the following: Configures the NuttShell (nsh) located at apps/examples/nsh. The Configuration enables only the serial NSH interface. - USB Configuations. - ----------------- - Several USB device configurations can be enabled and included - as NSH built-in built in functions. All require the following - basic setup in your .config to enable USB device support: + Notes. + ----- + 1. By default, this configuration uses an older Microchip C32 toolchain + for Windows (the newer ones seem to be incompatible) and builds under + Cygwin (or probably MSYS). That can easily be reconfigured, of course. + + Build Setup: + CONFIG_HOST_WINDOWS=y : Builds under Windows + CONFIG_WINDOWS_CYGWIN=y : Using Cygwin + + System Type: + CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW_LITE=y : Older C32 toolchain + + 2. USB Configuations. + + Several USB device configurations can be enabled and included + as NSH built-in built in functions. All require the following + basic setup in your .config to enable USB device support: - CONFIG_USBDEV=y : Enable basic USB device support - CONFIG_PIC32MX_USBDEV=y : Enable PIC32 USB device support + Drivers: + CONFIG_USBDEV=y : Enable basic USB device support - examples/usbterm - This option can be enabled by uncommenting - the following line in the appconfig file: + System Type -> PIC32MX Peripheral Support: + CONFIG_PIC32MX_USBDEV=y : Enable PIC32 USB device support - CONFIGURED_APPS += examples/usbterm + examples/usbterm - This option can be enabled by uncommenting + the following line in the appconfig file: - And by enabling one of the USB serial devices: + Application Configuration->Examples: + CONFIG_EXAMPLES_USBTERM=y : Selects /apps/examples/usbterm - CONFIG_PL2303=y : Enable the Prolifics PL2303 emulation - CONFIG_CDCACM=y : or the CDC/ACM serial driver (not both) + And by enabling one of the USB serial devices: - examples/cdcacm - The examples/cdcacm program can be included as an - function by uncommenting the following line in the appconfig file: + Drivers->USB Device Driver Support + CONFIG_PL2303=y : Enable the Prolifics PL2303 emulation + CONFIG_CDCACM=y : or the CDC/ACM serial driver (not both) + + examples/cdcacm - The examples/cdcacm program can be included as an + function by uncommenting the following line in the appconfig file: - CONFIGURED_APPS += examples/cdcacm + Application Configuration->Examples: + CONFIG_EXAMPLES_CDCACM=y : Select apps/examples/cdcacm + + and defining the following in your .config file: + + Drivers->USB Device Driver Support + CONFIG_CDCACM=y : Enable the CDCACM device + + examples/usbstorage - There are some hooks in the appconfig file + to enable the USB mass storage class (MSC)device. However, this device + cannot work until support for the SD card is also incorporated. + + Drivers->USB Device Driver Support + CONFIG_USBMSC=y : Enables the USB MSC class + + Application Configuration->Examples: + CONFIG_EXAMPLES_USBSTORAGE=y : Enhables apps/examples/usbstorage - and defining the following in your .config file: + 3. SD Card Support. - CONFIG_CDCACM=y : Enable the CDCACM device + Support for the on-board, SPI-based SD card is available but is + not yet functional (at least at the time of this writing). SD + card support can be enabled for testing by simply enabling SPI2 + support in the configuration file: - examples/usbstorage - There are some hooks in the appconfig file - to enable the USB mass storage device. However, this device cannot - work until support for the SD card is also incorporated. + System Type -> PIC32MX Peripheral Support: + CONFIG_PIC32MX_SPI2=y : Enable SPI2 - SD Card Support. - ---------------- - Support for the on-board, SPI-based SD card is available but is - not yet functional (at least at the time of this writing). SD - card support can be enabled for testing by simply enabling SPI2 - support in the configuration file: + Drivers: + CONFIG_MMCSD=y : MMC/SD support + CONFIG_MMCSD_SPI=y : SPI-based MMC/SD support - -CONFIG_PIC32MX_SPI2=n - +CONFIG_PIC32MX_SPI2=y + File Systems: + CONFIG_FS_FAT=y : FAT file system + : Other FAT options Debug output for testing the SD card can be enabled using: - -CONFIG_DEBUG_FS=n - -CONFIG_DEBUG_SPI=n - +CONFIG_DEBUG_FS=y - +CONFIG_DEBUG_SPI=y + Build Setup: + CONFIG_DEBUG=y : Enable debug features + CONFIG_DEBUG_VERBOSE=y : Enable verbose debug output + CONFIG_DEBUG_FS=y : Enable file system debug + CONFIG_DEBUG_SPI=y : Enable SPI debug + + 4. To enable LCD1602 support: + + Device Drivers: + CONFIG_LCD=y : Enable LCD menus + CONFIG_LCD_LCD1602=y : Select LCD1602 + + Library Routines: + CONFIG_LIB_SLCDCODEC=y : Enable the SLCD CODEC + + System Type -> PIC32MX Peripheral Support: + CONFIG_PIC32MX_PMP=y : Enable PMP support + + To enable apps/examples/slcd to test the LCD: + + Application Configuration: + CONFIG_NSH_ARCHINIT=y : Needed to initialize the SLCD + CONFIG_EXAMPLES_SLCD=y : Enable apps/examples/slcd use /dev/lcd1602 + CONFIG_EXAMPLES_SLCD_DEVNAME="/dev/lcd1602" + + To enable LCD debug output: + + Build Setup: + CONFIG_DEBUG=y : Enable debug features + CONFIG_DEBUG_VERBOSE=y : Enable LCD debug + + NOTES: + a. I do not have the LCD1602 working. I may just be getting lost in the + tangle of wires or perhaps there is something fundamentally wrong with + the code. + b. At this point in time, testing of the SLCD is very limited because + there is not much in apps/examples/slcd. Basically driver with a working + test setup and ready to be tested and debugged. usbnsh: ======= @@ -681,29 +809,42 @@ Where is one of the following: "DB_DP11215 PIC32 Storage Demo Board" and has only be testing on that board. - Comparison to nsh - ----------------- - Below summarizes the key configuration differences between the 'nsh' - and the 'upnsh' configurations: - - CONFIG_USBDEV=y : NuttX USB device support is enabled - CONFIG_PIC32MX_USBDEV=y : The PIC32MX USB device driver is built - CONFIG_UART1_SERIAL_CONSOLE=n : There is no serial console - CONFIG_UART2_SERIAL_CONSOLE=n : - CONFIG_CDCACM=y : The CDC/ACM serial device class is enabled - CONFIG_CDCACM_CONSOLE=y : The CDC/ACM serial device is the console - - Using the Prolifics PL2303 Emulation - ------------------------------------ - You could also use the non-standard PL2303 serial device instead of - the standard CDC/ACM serial device by changing: - - CONFIG_CDCACM=y : Disable the CDC/ACM serial device class - CONFIG_CDCACM_CONSOLE=y : The CDC/ACM serial device is NOT the console - CONFIG_PL2303=y : The Prolifics PL2303 emulation is enabled - CONFIG_PL2303_CONSOLE=y : The PL2303 serial device is the console - - Why would you want to use a non-standard USB serial driver? You might - to use the PL2303 driver with a Windows host because it should - automatically install the PL2303 driver (you might have to go through - some effort to get Windows to recognize the CDC/ACM device). + Notes. + ----- + 1. By default, this configuration uses an older Microchip C32 toolchain + for Windows (the newer ones seem to be incompatible) and builds under + Cygwin (or probably MSYS). That can easily be reconfigured, of course. + + Build Setup: + CONFIG_HOST_WINDOWS=y : Builds under Windows + CONFIG_WINDOWS_CYGWIN=y : Using Cygwin + + System Type: + CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW_LITE=y : Older C32 toolchain + + 2. Comparison to nsh + + Below summarizes the key configuration differences between the 'nsh' + and the 'upnsh' configurations: + + CONFIG_USBDEV=y : NuttX USB device support is enabled + CONFIG_PIC32MX_USBDEV=y : The PIC32MX USB device driver is built + CONFIG_UART1_SERIAL_CONSOLE=n : There is no serial console + CONFIG_UART2_SERIAL_CONSOLE=n : + CONFIG_CDCACM=y : The CDC/ACM serial device class is enabled + CONFIG_CDCACM_CONSOLE=y : The CDC/ACM serial device is the console + + Using the Prolifics PL2303 Emulation + + You could also use the non-standard PL2303 serial device instead of + the standard CDC/ACM serial device by changing: + + CONFIG_CDCACM=n : Disable the CDC/ACM serial device class + CONFIG_CDCACM_CONSOLE=n : The CDC/ACM serial device is NOT the console + CONFIG_PL2303=y : The Prolifics PL2303 emulation is enabled + CONFIG_PL2303_CONSOLE=y : The PL2303 serial device is the console + + Why would you want to use a non-standard USB serial driver? You might + to use the PL2303 driver with a Windows host because it should + automatically install the PL2303 driver (you might have to go through + some effort to get Windows to recognize the CDC/ACM device). diff --git a/nuttx/configs/sure-pic32mx/nsh/Make.defs b/nuttx/configs/sure-pic32mx/nsh/Make.defs index c15ab4f81..3803fdd4d 100644 --- a/nuttx/configs/sure-pic32mx/nsh/Make.defs +++ b/nuttx/configs/sure-pic32mx/nsh/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/sure-pic32mx/nsh/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -44,13 +44,13 @@ ifeq ($(WINTOOL),y) MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" - ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script}" + ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}" else # Linux/Cygwin-native toolchain MKDEP = $(TOPDIR)/tools/mkdeps.sh ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script endif CC = $(CROSSDEV)gcc diff --git a/nuttx/configs/sure-pic32mx/nsh/appconfig b/nuttx/configs/sure-pic32mx/nsh/appconfig deleted file mode 100644 index 2263c5a3e..000000000 --- a/nuttx/configs/sure-pic32mx/nsh/appconfig +++ /dev/null @@ -1,77 +0,0 @@ -############################################################################ -# configs/sure-pic32mx/nsh/appconfig -# -# Copyright (C) 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. -# -############################################################################ - -############################################################################ -# Path to example in apps/examples containing the user_start entry point -############################################################################ - -CONFIGURED_APPS += examples/nsh - -############################################################################ -# The NSH application library -############################################################################ - -CONFIGURED_APPS += system/readline -CONFIGURED_APPS += nshlib - -############################################################################ -# USB device configurations -############################################################################ - -ifeq ($(CONFIG_PIC32MX_USBDEV),y) - -# USB Mass Storage Class device configurations - -ifeq ($(CONFIG_USBMSC),y) -# Uncomment to enable the examples/usbstorage built-in -# CONFIGURED_APPS += examples/usbstorage -endif - -# USB CDC/ACM serial device configurations - -ifeq ($(CONFIG_CDCACM),y) -# Uncomment to enable the examples/cdcacm built-in -# CONFIGURED_APPS += examples/cdcacm -# Uncomment the following to enable the examples/usbterm built-in -# CONFIGURED_APPS += examples/usbterm -endif - -# Prolifics PL2303 emulation configurations - -ifeq ($(CONFIG_PL2303),y) -# Uncomment the following to enable the examples/usbterm built-in -# CONFIGURED_APPS += examples/usbterm -endif -endif diff --git a/nuttx/configs/sure-pic32mx/nsh/defconfig b/nuttx/configs/sure-pic32mx/nsh/defconfig index c552dec22..8167b8212 100644 --- a/nuttx/configs/sure-pic32mx/nsh/defconfig +++ b/nuttx/configs/sure-pic32mx/nsh/defconfig @@ -1,530 +1,733 @@ -############################################################################ -# configs/sure-pic32mx/nsh/defconfig -# -# Copyright (C) 2011 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. -# -############################################################################ -# -# Architecture Selection # -CONFIG_ARCH="mips" -CONFIG_ARCH_MIPS=y -CONFIG_ARCH_MIPS32=y -CONFIG_ARCH_CHIP="pic32mx" -CONFIG_ARCH_CHIP_PIC32MX440F512H=y -CONFIG_ARCH_BOARD="sure-pic32mx" -CONFIG_ARCH_BOARD_SUREPIC32MX=y -CONFIG_ARCH_DBDP11215=y -CONFIG_ARCH_DBDP11212=n -CONFIG_BOARD_LOOPSPERMSEC=4275 -CONFIG_DRAM_SIZE=32768 -CONFIG_DRAM_START=0xa0000000 -CONFIG_ARCH_NOINTC=n -CONFIG_ARCH_VECNOTIRQ=y -CONFIG_ARCH_IRQPRIO=y -CONFIG_ARCH_INTERRUPTSTACK=0 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARCH_BOOTLOADER=n -CONFIG_ARCH_LEDS=y -CONFIG_ARCH_BUTTONS=n -CONFIG_ARCH_CALIBRATION=n -CONFIG_ARCH_DMA=n +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +# CONFIG_WINDOWS_NATIVE is not set +CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set # -# Enable support for RAM-based functions -# (If selected, then modifications are needed in ld.script as well) +# Binary Output Formats # -CONFIG_ARCH_RAMFUNCS=n +# CONFIG_RRLOAD_BINARY is not set +CONFIG_INTELHEX_BINARY=y +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set # -# Identify toolchain and linker options +# Customize Header Files # -CONFIG_PIC32MX_MICROCHIPW=n -CONFIG_PIC32MX_MICROCHIPL=n -CONFIG_PIC32MX_MICROCHIPW_LITE=y -CONFIG_PIC32MX_MICROCHIPL_LITE=n +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set # -# Individual subsystems can be enabled: +# Debug Options # +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_SYMBOLS is not set -CONFIG_PIC32MX_WDT=n -CONFIG_PIC32MX_RTCC=n -CONFIG_PIC32MX_TIMER1=n -CONFIG_PIC32MX_TIMER2=n -CONFIG_PIC32MX_TIMER3=n -CONFIG_PIC32MX_TIMER4=n -CONFIG_PIC32MX_TIMER5=n -CONFIG_PIC32MX_IC1=n -CONFIG_PIC32MX_IC2=n -CONFIG_PIC32MX_IC3=n -CONFIG_PIC32MX_IC4=n -CONFIG_PIC32MX_IC5=n -CONFIG_PIC32MX_OC1=n -CONFIG_PIC32MX_OC2=n -CONFIG_PIC32MX_OC3=n -CONFIG_PIC32MX_OC4=n -CONFIG_PIC32MX_OC5=n -CONFIG_PIC32MX_I2C1=n -CONFIG_PIC32MX_I2C2=n -CONFIG_PIC32MX_SPI2=n -CONFIG_PIC32MX_UART1=n +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +CONFIG_ARCH_MIPS=y +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set +# CONFIG_ARCH_Z80 is not set +CONFIG_ARCH="mips" +CONFIG_ARCH_FAMILY="mips32" +CONFIG_ARCH_CHIP="pic32mx" +# CONFIG_SERIAL_TERMIOS is not set +CONFIG_ARCH_CHIP_PIC32MX=y +CONFIG_ARCH_MIPS32=y + +# +# MIPS32 Configuration Options +# +# CONFIG_MIPS32_TOOLCHAIN_GNU_ELF is not set +# CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW is not set +CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW_LITE=y +# CONFIG_MIPS32_TOOLCHAIN_PINGUINOW is not set +# CONFIG_MIPS32_FRAMEPOINTER is not set + +# +# PIC32MX Configuration Options +# +# CONFIG_ARCH_CHIP_PIC32MX110F016B is not set +# CONFIG_ARCH_CHIP_PIC32MX110F016C is not set +# CONFIG_ARCH_CHIP_PIC32MX110F016D is not set +# CONFIG_ARCH_CHIP_PIC32MX120F032B is not set +# CONFIG_ARCH_CHIP_PIC32MX120F032C is not set +# CONFIG_ARCH_CHIP_PIC32MX120F032D is not set +# CONFIG_ARCH_CHIP_PIC32MX130F064B is not set +# CONFIG_ARCH_CHIP_PIC32MX130F064C is not set +# CONFIG_ARCH_CHIP_PIC32MX130F064D is not set +# CONFIG_ARCH_CHIP_PIC32MX150F128B is not set +# CONFIG_ARCH_CHIP_PIC32MX150F128C is not set +# CONFIG_ARCH_CHIP_PIC32MX150F128D is not set +# CONFIG_ARCH_CHIP_PIC32MX210F016B is not set +# CONFIG_ARCH_CHIP_PIC32MX210F016C is not set +# CONFIG_ARCH_CHIP_PIC32MX210F016D is not set +# CONFIG_ARCH_CHIP_PIC32MX220F032B is not set +# CONFIG_ARCH_CHIP_PIC32MX220F032C is not set +# CONFIG_ARCH_CHIP_PIC32MX220F032D is not set +# CONFIG_ARCH_CHIP_PIC32MX230F064B is not set +# CONFIG_ARCH_CHIP_PIC32MX230F064C is not set +# CONFIG_ARCH_CHIP_PIC32MX230F064D is not set +# CONFIG_ARCH_CHIP_PIC32MX250F128B is not set +# CONFIG_ARCH_CHIP_PIC32MX250F128C is not set +# CONFIG_ARCH_CHIP_PIC32MX250F128D is not set +# CONFIG_ARCH_CHIP_PIC32MX320F032H is not set +# CONFIG_ARCH_CHIP_PIC32MX320F064H is not set +# CONFIG_ARCH_CHIP_PIC32MX320F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX320F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX340F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX340F256H is not set +# CONFIG_ARCH_CHIP_PIC32MX340F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX340F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX360F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX360F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX420F032H is not set +# CONFIG_ARCH_CHIP_PIC32MX440F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX440F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX440F256H is not set +CONFIG_ARCH_CHIP_PIC32MX440F512H=y +# CONFIG_ARCH_CHIP_PIC32MX460F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX460F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX534F064H is not set +# CONFIG_ARCH_CHIP_PIC32MX534F064L is not set +# CONFIG_ARCH_CHIP_PIC32MX564F064H is not set +# CONFIG_ARCH_CHIP_PIC32MX564F064L is not set +# CONFIG_ARCH_CHIP_PIC32MX564F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX564F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX575F256H is not set +# CONFIG_ARCH_CHIP_PIC32MX575F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX575F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX575F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX664F064H is not set +# CONFIG_ARCH_CHIP_PIC32MX664F064L is not set +# CONFIG_ARCH_CHIP_PIC32MX664F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX664F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX675F256H is not set +# CONFIG_ARCH_CHIP_PIC32MX675F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX675F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX675F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX695F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX695F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX764F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX764F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX775F256H is not set +# CONFIG_ARCH_CHIP_PIC32MX775F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX775F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX775F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX795F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX795F512L is not set +CONFIG_ARCH_CHIP_PIC32MX4=y +# CONFIG_PIC32MX_MVEC is not set +CONFIG_PIC32MX_T1=y + +# +# PIC32MX Peripheral Support +# +# CONFIG_PIC32MX_WDT is not set +# CONFIG_PIC32MX_T2 is not set +# CONFIG_PIC32MX_T3 is not set +# CONFIG_PIC32MX_T4 is not set +# CONFIG_PIC32MX_T5 is not set +# CONFIG_PIC32MX_IC1 is not set +# CONFIG_PIC32MX_IC2 is not set +# CONFIG_PIC32MX_IC3 is not set +# CONFIG_PIC32MX_IC4 is not set +# CONFIG_PIC32MX_IC5 is not set +# CONFIG_PIC32MX_OC1 is not set +# CONFIG_PIC32MX_OC2 is not set +# CONFIG_PIC32MX_OC3 is not set +# CONFIG_PIC32MX_OC4 is not set +# CONFIG_PIC32MX_OC5 is not set +# CONFIG_PIC32MX_I2C1 is not set +# CONFIG_PIC32MX_I2C2 is not set +# CONFIG_PIC32MX_I2C3 is not set +# CONFIG_PIC32MX_I2C4 is not set +# CONFIG_PIC32MX_I2C5 is not set +# CONFIG_PIC32MX_SPI1 is not set +# CONFIG_PIC32MX_SPI2 is not set +# CONFIG_PIC32MX_SPI3 is not set +# CONFIG_PIC32MX_SPI4 is not set +# CONFIG_PIC32MX_UART1 is not set CONFIG_PIC32MX_UART2=y -CONFIG_PIC32MX_PMP=n -CONFIG_PIC32MX_ADC=n -CONFIG_PIC32MX_CVR=n -CONFIG_PIC32MX_CM1=n -CONFIG_PIC32MX_CM2=n -CONFIG_PIC32MX_DDP=n -CONFIG_PIC32MX_FLASH=n -CONFIG_PIC32MX_BMX=n -CONFIG_PIC32MX_DMA=n -CONFIG_PIC32MX_CHE=n -CONFIG_PIC32MX_USBDEV=n -CONFIG_PIC32MX_USBHOST=n - -# -# PIC32MX Configuration Settings +# CONFIG_PIC32MX_UART3 is not set +# CONFIG_PIC32MX_UART4 is not set +# CONFIG_PIC32MX_UART5 is not set +# CONFIG_PIC32MX_UART6 is not set +# CONFIG_PIC32MX_ADC is not set +# CONFIG_PIC32MX_PMP is not set +# CONFIG_PIC32MX_CM1 is not set +# CONFIG_PIC32MX_CM2 is not set +# CONFIG_PIC32MX_CM3 is not set +# CONFIG_PIC32MX_RTCC is not set +# CONFIG_PIC32MX_DMA is not set +# CONFIG_PIC32MX_FLASH is not set +# CONFIG_PIC32MX_USBDEV is not set +# CONFIG_PIC32MX_USBHOST is not set +# CONFIG_PIC32MX_CAN1 is not set +# CONFIG_PIC32MX_CAN2 is not set +# CONFIG_PIC32MX_ETHERNET is not set +# CONFIG_PIC32MX_CTMU is not set + +# +# PIC32MX Peripheral Interrupt Priorities +# +CONFIG_PIC32MX_CTPRIO=16 +CONFIG_PIC32MX_CS0PRIO=16 +CONFIG_PIC32MX_CS1PRIO=16 +CONFIG_PIC32MX_INT0PRIO=16 +CONFIG_PIC32MX_INT1PRIO=16 +CONFIG_PIC32MX_INT2PRIO=16 +CONFIG_PIC32MX_INT3PRIO=16 +CONFIG_PIC32MX_INT4PRIO=16 +CONFIG_PIC32MX_T1PRIO=16 +CONFIG_PIC32MX_UART2PRIO=16 + +# +# Device Configuration 0 (DEVCFG0) # CONFIG_PIC32MX_DEBUGGER=2 CONFIG_PIC32MX_ICESEL=1 +CONFIG_PIC32MX_PROGFLASHWP=0xff +CONFIG_PIC32MX_BOOTFLASHWP=1 +CONFIG_PIC32MX_CODEWP=1 # -# PIC32MX specific serial device driver settings +# Device Configuration 3 (DEVCFG3) # -CONFIG_UART1_SERIAL_CONSOLE=n -CONFIG_UART2_SERIAL_CONSOLE=y - -CONFIG_UART1_TXBUFSIZE=256 -CONFIG_UART2_TXBUFSIZE=256 +CONFIG_PIC32MX_USBIDO=0 +CONFIG_PIC32MX_VBUSIO=0 +# CONFIG_PIC32MX_WDENABLE is not set +CONFIG_PIC32MX_FETHIO=1 +CONFIG_PIC32MX_FMIIEN=1 -CONFIG_UART1_RXBUFSIZE=256 -CONFIG_UART2_RXBUFSIZE=256 - -CONFIG_UART1_BAUD=115200 -CONFIG_UART2_BAUD=115200 +# +# External Memory Configuration +# -CONFIG_UART1_BITS=8 -CONFIG_UART2_BITS=8 +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +CONFIG_ARCH_VECNOTIRQ=y +# CONFIG_ARCH_DMA is not set +CONFIG_ARCH_IRQPRIO=y +# CONFIG_CUSTOM_STACK is not set +# CONFIG_ADDRENV is not set +CONFIG_ARCH_HAVE_VFORK=y +CONFIG_ARCH_STACKDUMP=y +# CONFIG_ENDIAN_BIG is not set +CONFIG_ARCH_HAVE_RAMFUNCS=y +# CONFIG_ARCH_RAMFUNCS is not set +# CONFIG_ARCH_HAVE_RAMVECTORS is not set -CONFIG_UART1_PARITY=0 -CONFIG_UART2_PARITY=0 +# +# Board Settings +# +CONFIG_BOARD_LOOPSPERMSEC=4275 +# CONFIG_ARCH_CALIBRATION is not set +CONFIG_DRAM_START=0xa0000000 +CONFIG_DRAM_SIZE=32768 +CONFIG_ARCH_HAVE_INTERRUPTSTACK=y +CONFIG_ARCH_INTERRUPTSTACK=0 -CONFIG_UART1_2STOP=0 -CONFIG_UART2_2STOP=0 +# +# Boot options +# +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set # -# PIC32MX-specific USB device setup +# Board Selection # -CONFIG_PIC32MX_USBDEV_REGDEBUG=n -CONFIG_PIC32MX_USBDEV_BDTDEBUG=n - +CONFIG_ARCH_BOARD_SUREPIC32MX=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="sure-pic32mx" + # -# General build options +# Common Board Options # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=y -CONFIG_MOTOROLA_SREC=n -CONFIG_RAW_BINARY=n +CONFIG_ARCH_HAVE_LEDS=y +CONFIG_ARCH_LEDS=y +CONFIG_ARCH_HAVE_BUTTONS=y +# CONFIG_ARCH_BUTTONS is not set +CONFIG_ARCH_HAVE_IRQBUTTONS=y +CONFIG_NSH_MMCSDMINOR=0 # -# General OS setup +# Board-Specific Options # -CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_ARCH_DBDP11215=y +# CONFIG_ARCH_DBDP11212 is not set -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_DEBUG_SCHED=n -CONFIG_DEBUG_USB=n -CONFIG_DEBUG_FS=n -CONFIG_DEBUG_SPI=n -CONFIG_SPI_REGDEBUG=n - -CONFIG_HAVE_CXX=n -CONFIG_HAVE_CXXINITIALIZE=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y +# +# RTOS Features +# +# CONFIG_BOARD_INITIALIZE is not set +CONFIG_MSEC_PER_TICK=10 CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n +# CONFIG_SCHED_INSTRUMENTATION is not set CONFIG_TASK_NAME_SIZE=0 +# CONFIG_SCHED_HAVE_PARENT is not set +# CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2011 CONFIG_START_MONTH=12 CONFIG_START_DAY=22 -CONFIG_GREGORIAN_TIME=n -CONFIG_JULIAN_TIME=n CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set CONFIG_SDCLONE_DISABLE=y -CONFIG_SCHED_WORKQUEUE=n -CONFIG_SCHED_WORKPRIORITY=192 -CONFIG_SCHED_WORKPERIOD=50000 -CONFIG_SCHED_WORKSTACKSIZE=1024 -CONFIG_SIG_SIGWORK=17 CONFIG_SCHED_WAITPID=y -CONFIG_SCHED_ATEXIT=n +# CONFIG_SCHED_STARTHOOK is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_DISABLE_OS_API=y +# CONFIG_DISABLE_CLOCK is not set +# CONFIG_DISABLE_POSIX_TIMERS is not set +# CONFIG_DISABLE_PTHREAD is not set +# CONFIG_DISABLE_SIGNALS is not set +# CONFIG_DISABLE_MQUEUE is not set +# CONFIG_DISABLE_ENVIRON is not set # -# Settings for nxflat +# Signal Numbers # -CONFIG_NXFLAT=n -CONFIG_NXFLAT_DUMPBUFFER=n -CONFIG_SYMTAB_ORDEREDBYNAME=y +CONFIG_SIG_SIGUSR1=1 +CONFIG_SIG_SIGUSR2=2 +CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGCONDTIMEDOUT=16 # -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. +# Sizes of configurable things (0 disables) # -# There are certain dependency relationships in these -# features. +CONFIG_MAX_TASKS=16 +CONFIG_MAX_TASK_ARGS=4 +CONFIG_NPTHREAD_KEYS=4 +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=8 +CONFIG_NAME_MAX=32 +CONFIG_PREALLOC_MQ_MSGS=4 +CONFIG_MQ_MAXMSGSIZE=32 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=4 +CONFIG_PREALLOC_TIMERS=4 + # -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. +# Stack and heap information +# +CONFIG_IDLETHREAD_STACKSIZE=2048 +CONFIG_USERMAIN_STACKSIZE=2048 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=2048 + +# +# Device Drivers # -CONFIG_DISABLE_CLOCK=n -CONFIG_DISABLE_POSIX_TIMERS=n -CONFIG_DISABLE_PTHREAD=n -CONFIG_DISABLE_SIGNALS=n -CONFIG_DISABLE_MQUEUE=n -CONFIG_DISABLE_MOUNTPOINT=n -CONFIG_DISABLE_ENVIRON=n CONFIG_DISABLE_POLL=y +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_AUDIO_DEVICES is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +CONFIG_SERIAL=y +# CONFIG_DEV_LOWCONSOLE is not set +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART2=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +CONFIG_UART2_SERIAL_CONSOLE=y +# CONFIG_NO_SERIAL_CONSOLE is not set # -# Misc libc settings +# UART2 Configuration # -CONFIG_NOPRINTF_FIELDWIDTH=n +CONFIG_UART2_RXBUFSIZE=256 +CONFIG_UART2_TXBUFSIZE=256 +CONFIG_UART2_BAUD=115200 +CONFIG_UART2_BITS=8 +CONFIG_UART2_PARITY=0 +CONFIG_UART2_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set # -# Allow for architecture optimized implementations +# System Logging Device Options # -# The architecture can provide optimized versions of the -# following to improve system performance + +# +# System Logging # -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n +# CONFIG_RAMLOG is not set # -# Sizes of configurable things (0 disables) +# Networking Support # -CONFIG_MAX_TASKS=16 -CONFIG_MAX_TASK_ARGS=4 -CONFIG_NPTHREAD_KEYS=4 -CONFIG_NFILE_DESCRIPTORS=8 -CONFIG_NFILE_STREAMS=8 -CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=64 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=2 -CONFIG_PREALLOC_MQ_MSGS=4 -CONFIG_MQ_MAXMSGSIZE=32 -CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=4 -CONFIG_PREALLOC_TIMERS=4 +# CONFIG_NET is not set # -# Filesystem configuration +# File Systems # -CONFIG_FS_FAT=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_MAXFNAME=32 -CONFIG_FS_NXFFS=n -CONFIG_FS_ROMFS=n # -# Maintain legacy build behavior (revisit) +# File system configuration # +# CONFIG_DISABLE_MOUNTPOINT is not set +# CONFIG_FS_RAMMAP is not set +# CONFIG_FS_FAT is not set +# CONFIG_FS_NXFFS is not set +# CONFIG_FS_ROMFS is not set +# CONFIG_FS_SMARTFS is not set +# CONFIG_FS_BINFS is not set -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MTD=y +# +# System Logging +# +# CONFIG_SYSLOG_ENABLE is not set +# CONFIG_SYSLOG is not set # -# SPI-based MMC/SD driver +# Graphics Support # -CONFIG_MMCSD_NSLOTS=1 -CONFIG_MMCSD_READONLY=n -CONFIG_MMCSD_SPICLOCK=12500000 +# CONFIG_NX is not set # -# Block driver buffering +# Memory Management # -CONFIG_FS_READAHEAD=n -CONFIG_FS_WRITEBUFFER=n +# CONFIG_MM_MULTIHEAP is not set +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +# CONFIG_GRAN is not set # -# SDIO-based MMC/SD driver +# Audio Support # -CONFIG_SDIO_DMA=n -CONFIG_MMCSD_MMCSUPPORT=n -CONFIG_MMCSD_HAVECARDDETECT=n +# CONFIG_AUDIO is not set # -# TCP/IP and UDP support via uIP +# Binary Formats # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_BINFMT_EXEPATH is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +CONFIG_BUILTIN=y +# CONFIG_PIC is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set # -# UIP Network Utilities +# Library Routines # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 # -# USB Device Configuration +# Standard C Library Options # -CONFIG_USBDEV=n -CONFIG_USBDEV_ISOCHRONOUS=n -CONFIG_USBDEV_DUALSPEED=n -CONFIG_USBDEV_SELFPOWERED=y -CONFIG_USBDEV_REMOTEWAKEUP=n -CONFIG_USBDEV_MAXPOWER=100 -CONFIG_USBDEV_TRACE=n -CONFIG_USBDEV_TRACE_NRECORDS=128 +CONFIG_STDIO_BUFFER_SIZE=64 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=2 +CONFIG_LIB_HOMEDIR="/" +# CONFIG_LIBM is not set +# CONFIG_NOPRINTF_FIELDWIDTH is not set +# CONFIG_LIBC_FLOATINGPOINT is not set +CONFIG_LIB_RAND_ORDER=1 +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_EXECFUNCS is not set +CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 +CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set # -# USB Serial Device Configuration +# Non-standard Library Support # -CONFIG_PL2303=n -CONFIG_PL2303_EPINTIN=1 -CONFIG_PL2303_EPBULKOUT=2 -CONFIG_PL2303_EPBULKIN=5 -CONFIG_PL2303_NWRREQS=4 -CONFIG_PL2303_NRDREQS=4 -CONFIG_PL2303_VENDORID=0x067b -CONFIG_PL2303_PRODUCTID=0x2303 -CONFIG_PL2303_VENDORSTR="Nuttx" -CONFIG_PL2303_PRODUCTSTR="USBdev Serial" -CONFIG_PL2303_RXBUFSIZE=512 -CONFIG_PL2303_TXBUFSIZE=512 +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_LIB_KBDCODEC is not set +# CONFIG_LIB_SLCDCODEC is not set # -# USB serial device class driver (Standard CDC ACM class) +# Basic CXX Support # -CONFIG_CDCACM=n -CONFIG_CDCACM_CONSOLE=n -#CONFIG_CDCACM_EP0MAXPACKET -#CONFIG_CDCACM_EPINTIN -#CONFIG_CDCACM_EPINTIN_FSSIZE -#CONFIG_CDCACM_EPINTIN_HSSIZE -#CONFIG_CDCACM_EPBULKOUT -#CONFIG_CDCACM_EPBULKOUT_FSSIZE -#CONFIG_CDCACM_EPBULKOUT_HSSIZE -#CONFIG_CDCACM_EPBULKIN -#CONFIG_CDCACM_EPBULKIN_FSSIZE -#CONFIG_CDCACM_EPBULKIN_HSSIZE -#CONFIG_CDCACM_NWRREQS -#CONFIG_CDCACM_NRDREQS -#CONFIG_CDCACM_VENDORID -#CONFIG_CDCACM_VENDORSTR -#CONFIG_CDCACM_PRODUCTID -#CONFIG_CDCACM_PRODUCTSTR -#CONFIG_CDCACM_RXBUFSIZE -#CONFIG_CDCACM_TXBUFSIZE +# CONFIG_C99_BOOL8 is not set +# CONFIG_HAVE_CXX is not set # -# USB Storage Device Configuration +# Application Configuration # -CONFIG_USBMSC=n -CONFIG_USBMSC_EP0MAXPACKET=64 -CONFIG_USBMSC_EPBULKOUT=1 -CONFIG_USBMSC_EPBULKIN=2 -CONFIG_USBMSC_NRDREQS=8 -CONFIG_USBMSC_NWRREQS=2 -CONFIG_USBMSC_BULKINREQLEN=256 -CONFIG_USBMSC_BULKOUTREQLEN=64 -CONFIG_USBMSC_VENDORID=0x584e -CONFIG_USBMSC_VENDORSTR="NuttX" -CONFIG_USBMSC_PRODUCTID=0x5342 -CONFIG_USBMSC_PRODUCTSTR="USBdev Storage" -CONFIG_USBMSC_VERSIONNO=0x0399 -CONFIG_USBMSC_REMOVABLE=y - -# -# Settings for examples/uip -# -CONFIG_EXAMPLES_UIP_IPADDR=0x0a000002 -CONFIG_EXAMPLES_UIP_DRIPADDR=0x0a000001 -CONFIG_EXAMPLES_UIP_NETMASK=0xffffff00 -CONFIG_EXAMPLES_UIP_DHCPC=n - -# -# Settings for examples/nettest -# -CONFIG_EXAMPLES_NETTEST_SERVER=n -CONFIG_EXAMPLES_NETTEST_PERFORMANCE=n -CONFIG_EXAMPLES_NETTEST_NOMAC=y -CONFIG_EXAMPLES_NETTEST_IPADDR=0x0a000002 -CONFIG_EXAMPLES_NETTEST_DRIPADDR=0x0a000001 -CONFIG_EXAMPLES_NETTEST_NETMASK=0xffffff00 -CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001 # -# Settings for examples/ostest +# Built-In Applications # -CONFIG_EXAMPLES_OSTEST_LOOPS=1 -CONFIG_EXAMPLES_OSTEST_STACKSIZE=2048 -CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3 - +CONFIG_BUILTIN_PROXY_STACKSIZE=1024 + # -# Settings for apps/nshlib +# Examples # -CONFIG_BUILTIN=y +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_MOUNT is not set +CONFIG_EXAMPLES_NSH=y +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POSIXSPAWN is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_SLCD is not set +# CONFIG_EXAMPLES_SMART_TEST is not set +# CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_TCPECHO is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set + +# +# Graphics Support +# +# CONFIG_TIFF is not set + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# FreeModBus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +CONFIG_NSH_LIBRARY=y CONFIG_NSH_BUILTIN_APPS=y + +# +# Disable Individual commands +# +# CONFIG_NSH_DISABLE_CAT is not set +# CONFIG_NSH_DISABLE_CD is not set +# CONFIG_NSH_DISABLE_CP is not set +# CONFIG_NSH_DISABLE_DD is not set +# CONFIG_NSH_DISABLE_ECHO is not set +# CONFIG_NSH_DISABLE_EXEC is not set +# CONFIG_NSH_DISABLE_EXIT is not set +# CONFIG_NSH_DISABLE_FREE is not set +# CONFIG_NSH_DISABLE_GET is not set +# CONFIG_NSH_DISABLE_HELP is not set +# CONFIG_NSH_DISABLE_HEXDUMP is not set +# CONFIG_NSH_DISABLE_IFCONFIG is not set +# CONFIG_NSH_DISABLE_KILL is not set +# CONFIG_NSH_DISABLE_LOSETUP is not set +# CONFIG_NSH_DISABLE_LS is not set +# CONFIG_NSH_DISABLE_MB is not set +# CONFIG_NSH_DISABLE_MKDIR is not set +# CONFIG_NSH_DISABLE_MKFATFS is not set +# CONFIG_NSH_DISABLE_MKFIFO is not set +# CONFIG_NSH_DISABLE_MKRD is not set +# CONFIG_NSH_DISABLE_MH is not set +# CONFIG_NSH_DISABLE_MOUNT is not set +# CONFIG_NSH_DISABLE_MW is not set +# CONFIG_NSH_DISABLE_NSFMOUNT is not set +# CONFIG_NSH_DISABLE_PS is not set +# CONFIG_NSH_DISABLE_PING is not set +# CONFIG_NSH_DISABLE_PUT is not set +# CONFIG_NSH_DISABLE_PWD is not set +# CONFIG_NSH_DISABLE_RM is not set +# CONFIG_NSH_DISABLE_RMDIR is not set +# CONFIG_NSH_DISABLE_SET is not set +# CONFIG_NSH_DISABLE_SH is not set +# CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TEST is not set +# CONFIG_NSH_DISABLE_UMOUNT is not set +# CONFIG_NSH_DISABLE_UNSET is not set +# CONFIG_NSH_DISABLE_USLEEP is not set +# CONFIG_NSH_DISABLE_WGET is not set +# CONFIG_NSH_DISABLE_XD is not set + +# +# Configure Command Options +# +# CONFIG_NSH_CMDOPT_DF_H is not set +CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_STRERROR=n CONFIG_NSH_LINELEN=64 CONFIG_NSH_NESTDEPTH=3 -CONFIG_NSH_DISABLESCRIPT=n -CONFIG_NSH_DISABLEBG=n -CONFIG_NSH_ROMFSETC=n +# CONFIG_NSH_DISABLESCRIPT is not set +# CONFIG_NSH_DISABLEBG is not set CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n + +# +# USB Trace Support +# +# CONFIG_NSH_CONDEV is not set CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 -CONFIG_NSH_ROMFSMOUNTPT="/etc" -CONFIG_NSH_INITSCRIPT="init.d/rcS" -CONFIG_NSH_ROMFSDEVNO=0 -CONFIG_NSH_ROMFSSECTSIZE=64 -CONFIG_NSH_FATDEVNO=1 -CONFIG_NSH_FATSECTSIZE=512 -CONFIG_NSH_FATNSECTORS=1024 -CONFIG_NSH_FATMOUNTPT="/tmp" - -# -# Architecture-specific NSH options -# -CONFIG_NSH_MMCSDSPIPORTNO=2 -CONFIG_NSH_MMCSDSLOTNO=0 -CONFIG_NSH_MMCSDMINOR=0 # -# Settings for examples/usbserial +# NxWidgets/NxWM # -CONFIG_EXAMPLES_USBSERIAL_INONLY=n -CONFIG_EXAMPLES_USBSERIAL_OUTONLY=n -CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL=n -CONFIG_EXAMPLES_USBSERIAL_ONLYBIG=n -CONFIG_EXAMPLES_USBSERIAL_TRACEINIT=n -CONFIG_EXAMPLES_USBSERIAL_TRACECLASS=n -CONFIG_EXAMPLES_USBSERIAL_TRACETRANSFERS=n -CONFIG_EXAMPLES_USBSERIAL_TRACECONTROLLER=n -CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=n +# +# System NSH Add-Ons +# # -# Settings for examples/usbstorage +# Custom Free Memory Command # -CONFIG_EXAMPLES_USBMSC_NLUNS=1 -CONFIG_EXAMPLES_USBMSC_DEVMINOR1=0 -CONFIG_EXAMPLES_USBMSC_DEVPATH1="/dev/mmcsd0" -CONFIG_EXAMPLES_USBMSC_TRACEINIT=n -CONFIG_EXAMPLES_USBMSC_TRACECLASS=n -CONFIG_EXAMPLES_USBMSC_TRACETRANSFERS=n -CONFIG_EXAMPLES_USBMSC_TRACECONTROLLER=n -CONFIG_EXAMPLES_USBMSC_TRACEINTERRUPTS=n +# CONFIG_SYSTEM_FREE is not set # -# Settings for examples/usbterm +# I2C tool # -CONFIG_EXAMPLES_USBTERM_BUILTIN=y -CONFIG_EXAMPLES_USBTERM_DEVINIT=y -#CONFIG_EXAMPLES_USBTERM_BUFLEN -CONFIG_EXAMPLES_USBTERM_TRACEINIT=n -CONFIG_EXAMPLES_USBTERM_TRACECLASS=n -CONFIG_EXAMPLES_USBTERM_TRACETRANSFERS=n -CONFIG_EXAMPLES_USBTERM_TRACECONTROLLER=n -CONFIG_EXAMPLES_USBTERM_TRACEINTERRUPTS=n # -# Settings for examples/cdcacm +# FLASH Program Installation # -# Configuration prequisites: +# CONFIG_SYSTEM_INSTALL is not set + +# +# FLASH Erase-all Command # -CONFIG_EXAMPLES_CDCACM_DEVMINOR=0 -CONFIG_EXAMPLES_CDCACM_TRACEINIT=n -CONFIG_EXAMPLES_CDCACM_TRACECLASS=n -CONFIG_EXAMPLES_CDCACM_TRACETRANSFERS=n -CONFIG_EXAMPLES_CDCACM_TRACECONTROLLER=n -CONFIG_EXAMPLES_CDCACM_TRACEINTERRUPTS=n # -# Stack and heap information +# readline() +# +CONFIG_SYSTEM_READLINE=y +CONFIG_READLINE_ECHO=y + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set + +# +# USB Monitor # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=2048 -CONFIG_USERMAIN_STACKSIZE=2048 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=2048 diff --git a/nuttx/configs/sure-pic32mx/nsh/ld.script b/nuttx/configs/sure-pic32mx/nsh/ld.script deleted file mode 100644 index 0975477cc..000000000 --- a/nuttx/configs/sure-pic32mx/nsh/ld.script +++ /dev/null @@ -1,317 +0,0 @@ -/**************************************************************************** - * configs/sure-pic32mx/nsh/ld.script - * - * Copyright (C) 2011 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. - * - ****************************************************************************/ -/* Memory Regions ***********************************************************/ - -MEMORY -{ - /* The PIC32MX440F512H has 512Kb of program FLASH at physical address - * 0x1d000000 but is always accessed at KSEG0 address 0x9d00:0000 - */ - - kseg0_progmem (rx) : ORIGIN = 0x9d000000, LENGTH = 512K - - /* The PIC32MX440F512H has 12Kb of boot FLASH at physical address - * 0x1fc00000. The initial reset vector is in KSEG1, but all other - * accesses are in KSEG0. - * - * REGION PHYSICAL KSEG SIZE - * DESCRIPTION START ADDR (BYTES) - * ------------- ---------- ------ ---------------------- - * Exceptions:* - * Reset 0x1fc00000 KSEG1 512 512 - * TLB Refill 0x1fc00200 KSEG1 256 768 - * Cache Error 0x1fc00300 KSEG1 128 896 - * Others 0x1fc00380 KSEG1 128 1024 (1Kb) - * Interrupt 0x1fc00400 KSEG1 128 1152 - * JTAG 0x1fc00480 KSEG1 16 1168 - * Exceptions 0x1fc00490 KSEG0 8192-1168 8192 (4Kb) - * Debug code 0x1fc02000 KSEG1 4096-16 12272 - * DEVCFG3-0 0x1fc02ff0 KSEG1 16 12288 (12Kb) - * - * Exceptions assume: - * - * STATUS: BEV=0/1 and EXL=0 - * CAUSE: IV=1 - * JTAG: ProbEn=0 - * And multi-vector support disabled - */ - - kseg1_reset (rx) : ORIGIN = 0xbfc00000, LENGTH = 384 - kseg1_genexcpt (rx) : ORIGIN = 0xbfc00180, LENGTH = 128 - kseg1_ebexcpt (rx) : ORIGIN = 0xbfc00200, LENGTH = 128 - kseg1_bevexcpt (rx) : ORIGIN = 0xbfc00380, LENGTH = 128 - kseg1_intexcpt (rx) : ORIGIN = 0xbfc00400, LENGTH = 128 - kseg1_dbgexcpt (rx) : ORIGIN = 0xbfc00480, LENGTH = 16 - kseg0_bootmem (rx) : ORIGIN = 0x9fc00490, LENGTH = 8192-1168 - kseg1_dbgcode (rx) : ORIGIN = 0xbfc02000, LENGTH = 4096-16 - kseg1_devcfg (r) : ORIGIN = 0xbfc02ff0, LENGTH = 16 - - /* The PIC32MX440F512H has 32Kb of data memory at physical address - * 0x00000000. Since the PIC32MX has no data cache, this memory is - * always accessed through KSEG1. - * - * When used with MPLAB, we need to set aside 512 bytes of memory - * for use by MPLAB. - */ - - kseg1_datamem (w!x) : ORIGIN = 0xa0000200, LENGTH = 32K - 512 -} - -OUTPUT_FORMAT("elf32-tradlittlemips") -OUTPUT_ARCH(pic32mx) -ENTRY(__start) - -SECTIONS -{ - /* Boot FLASH sections */ - - .reset : - { - KEEP (*(.reset)) - } > kseg1_reset - - /* Exception handlers. The following is assumed: - * - * STATUS: BEV=1 and EXL=0 - * CAUSE: IV=1 - * JTAG: ProbEn=0 - * And multi-vector support disabled - * - * In that configuration, the vector locations become: - * - * Reset, Soft Reset bfc0:0000 - * TLB Refill bfc0:0200 - * Cache Error bfc0:0300 - * All others bfc0:0380 - * Interrupt bfc0:0400 - * EJTAG Debug bfc0:0480 - */ - - /* KSEG1 exception handler "trampolines" */ - - .gen_excpt : - { - KEEP (*(.gen_excpt)) - } > kseg1_genexcpt - - .ebase_excpt : - { - KEEP (*(.ebase_excpt)) - } > kseg1_ebexcpt - - .bev_excpt : - { - KEEP (*(.bev_excpt)) - } > kseg1_bevexcpt - - .int_excpt : - { - KEEP (*(.int_excpt)) - } > kseg1_intexcpt - - .dbg_excpt = ORIGIN(kseg1_dbgexcpt); - - .start : - { - /* KSEG0 Reset startup logic */ - - *(.start) - - /* KSEG0 exception handlers */ - - *(.nmi_handler) - *(.bev_handler) - *(.int_handler) - } > kseg0_bootmem - - .dbg_code = ORIGIN(kseg1_dbgcode); - - .devcfg : - { - KEEP (*(.devcfg)) - } > kseg1_devcfg - - /* Program FLASH sections */ - - .text : - { - _stext = ABSOLUTE(.); - *(.text .text.*) - *(.stub) - KEEP (*(.text.*personality*)) - *(.gnu.linkonce.t.*) - *(.gnu.warning) - *(.mips16.fn.*) - *(.mips16.call.*) - - /* Read-only data is included in the text section */ - - *(.rodata .rodata.*) - *(.rodata1) - *(.gnu.linkonce.r.*) - - /* Small initialized constant global and static data */ - - *(.sdata2 .sdata2.*) - *(.gnu.linkonce.s2.*) - - /* Uninitialized constant global and static data */ - - *(.sbss2 .sbss2.*) - *(.gnu.linkonce.sb2.*) - _etext = ABSOLUTE(.); - } > kseg0_progmem - - /* Initialization data begins here in progmem */ - - _data_loaddr = LOADADDR(.data); - - .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } - - /* RAM functions are positioned at the beginning of RAM so that - * they can be guaranteed to satisfy the 2Kb alignment requirement. - */ - -/* This causes failures if there are no RAM functions - .ramfunc ALIGN(2K) : - { - _sramfunc = ABSOLUTE(.); - *(.ramfunc .ramfunc.*) - _eramfunc = ABSOLUTE(.); - } > kseg1_datamem AT > kseg0_progmem - - _ramfunc_loadaddr = LOADADDR(.ramfunc); - _ramfunc_sizeof = SIZEOF(.ramfunc); - _bmxdkpba_address = _sramfunc - ORIGIN(kseg1_datamem) ; - _bmxdudba_address = LENGTH(kseg1_datamem) ; - _bmxdupba_address = LENGTH(kseg1_datamem) ; -*/ - - .data : - { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - KEEP (*(.gnu.linkonce.d.*personality*)) - *(.data1) - } > kseg1_datamem AT > kseg0_progmem - - .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } - _gp = ALIGN(16) + 0x7FF0 ; - - .got : - { - *(.got.plt) *(.got) - } > kseg1_datamem AT > kseg0_progmem - - .sdata : - { - *(.sdata .sdata.* .gnu.linkonce.s.*) - } > kseg1_datamem AT > kseg0_progmem - - .lit8 : - { - *(.lit8) - } > kseg1_datamem AT > kseg0_progmem - - .lit4 : - { - *(.lit4) - _edata = ABSOLUTE(.); - } >kseg1_datamem AT>kseg0_progmem - - .sbss : - { - _sbss = ABSOLUTE(.); - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.scommon) - } >kseg1_datamem - - .bss : - { - *(.dynbss) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - _ebss = ABSOLUTE(.); - } > kseg1_datamem - - /* Stabs debugging sections */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - - /* DWARF debug sections */ - /* DWARF 1 */ - - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - - /* GNU DWARF 1 extensions */ - - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - - /* DWARF 1.1 and DWARF 2 */ - - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - - /* DWARF 2 */ - - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - - /* SGI/MIPS DWARF 2 extensions */ - - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /DISCARD/ : { *(.note.GNU-stack) } -} diff --git a/nuttx/configs/sure-pic32mx/ostest/Make.defs b/nuttx/configs/sure-pic32mx/ostest/Make.defs index b2bb45150..09c66dde6 100644 --- a/nuttx/configs/sure-pic32mx/ostest/Make.defs +++ b/nuttx/configs/sure-pic32mx/ostest/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/sure-pic32mx/ostest/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2011,2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -44,13 +44,13 @@ ifeq ($(WINTOOL),y) MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" - ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script}" + ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}" else # Linux/Cygwin-native toolchain MKDEP = $(TOPDIR)/tools/mkdeps.sh ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script endif CC = $(CROSSDEV)gcc diff --git a/nuttx/configs/sure-pic32mx/ostest/appconfig b/nuttx/configs/sure-pic32mx/ostest/appconfig deleted file mode 100644 index 3b96b3d6d..000000000 --- a/nuttx/configs/sure-pic32mx/ostest/appconfig +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################ -# configs/sure-pic32mx/ostest/appconfig -# -# Copyright (C) 2011 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. -# -############################################################################ - -# Path to example in apps/examples containing the user_start entry point - -CONFIGURED_APPS += examples/ostest - diff --git a/nuttx/configs/sure-pic32mx/ostest/defconfig b/nuttx/configs/sure-pic32mx/ostest/defconfig index 86c4bbdd9..836f5bb0a 100644 --- a/nuttx/configs/sure-pic32mx/ostest/defconfig +++ b/nuttx/configs/sure-pic32mx/ostest/defconfig @@ -1,239 +1,336 @@ -############################################################################ -# configs/sure-pic32mx/ostest/defconfig -# -# Copyright (C) 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. -# -############################################################################ -# -# Architecture Selection # -CONFIG_ARCH="mips" -CONFIG_ARCH_MIPS=y -CONFIG_ARCH_MIPS32=y -CONFIG_ARCH_CHIP="pic32mx" -CONFIG_ARCH_CHIP_PIC32MX440F512H=y -CONFIG_ARCH_BOARD="sure-pic32mx" -CONFIG_ARCH_BOARD_SUREPIC32MX=y -CONFIG_ARCH_DBDP11215=y -CONFIG_ARCH_DBDP11212=n -CONFIG_BOARD_LOOPSPERMSEC=4275 -CONFIG_DRAM_SIZE=32768 -CONFIG_DRAM_START=0xa0000000 -CONFIG_ARCH_NOINTC=n -CONFIG_ARCH_VECNOTIRQ=y -CONFIG_ARCH_IRQPRIO=y -CONFIG_ARCH_INTERRUPTSTACK=0 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARCH_BOOTLOADER=n -CONFIG_ARCH_LEDS=y -CONFIG_ARCH_BUTTONS=n -CONFIG_ARCH_CALIBRATION=n -CONFIG_ARCH_DMA=n +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +# CONFIG_WINDOWS_NATIVE is not set +CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set # -# Enable support for RAM-based functions -# (If selected, then modifications are needed in ld.script as well) +# Binary Output Formats # -CONFIG_ARCH_RAMFUNCS=n +# CONFIG_RRLOAD_BINARY is not set +CONFIG_INTELHEX_BINARY=y +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set # -# Identify toolchain and linker options +# Customize Header Files # -CONFIG_PIC32MX_MICROCHIPW=n -CONFIG_PIC32MX_MICROCHIPL=n -CONFIG_PIC32MX_MICROCHIPW_LITE=y -CONFIG_PIC32MX_MICROCHIPL_LITE=n +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set # -# Individual subsystems can be enabled: +# Debug Options # +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_SYMBOLS is not set -CONFIG_PIC32MX_WDT=n -CONFIG_PIC32MX_RTCC=n -CONFIG_PIC32MX_TIMER1=n -CONFIG_PIC32MX_TIMER2=n -CONFIG_PIC32MX_TIMER3=n -CONFIG_PIC32MX_TIMER4=n -CONFIG_PIC32MX_TIMER5=n -CONFIG_PIC32MX_IC1=n -CONFIG_PIC32MX_IC2=n -CONFIG_PIC32MX_IC3=n -CONFIG_PIC32MX_IC4=n -CONFIG_PIC32MX_IC5=n -CONFIG_PIC32MX_OC1=n -CONFIG_PIC32MX_OC2=n -CONFIG_PIC32MX_OC3=n -CONFIG_PIC32MX_OC4=n -CONFIG_PIC32MX_OC5=n -CONFIG_PIC32MX_I2C1=n -CONFIG_PIC32MX_I2C2=n -CONFIG_PIC32MX_SPI2=n -CONFIG_PIC32MX_UART1=n +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +CONFIG_ARCH_MIPS=y +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set +# CONFIG_ARCH_Z80 is not set +CONFIG_ARCH="mips" +CONFIG_ARCH_FAMILY="mips32" +CONFIG_ARCH_CHIP="pic32mx" +# CONFIG_SERIAL_TERMIOS is not set +CONFIG_ARCH_CHIP_PIC32MX=y +CONFIG_ARCH_MIPS32=y + +# +# MIPS32 Configuration Options +# +# CONFIG_MIPS32_TOOLCHAIN_GNU_ELF is not set +# CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW is not set +CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW_LITE=y +# CONFIG_MIPS32_TOOLCHAIN_PINGUINOW is not set +# CONFIG_MIPS32_FRAMEPOINTER is not set + +# +# PIC32MX Configuration Options +# +# CONFIG_ARCH_CHIP_PIC32MX110F016B is not set +# CONFIG_ARCH_CHIP_PIC32MX110F016C is not set +# CONFIG_ARCH_CHIP_PIC32MX110F016D is not set +# CONFIG_ARCH_CHIP_PIC32MX120F032B is not set +# CONFIG_ARCH_CHIP_PIC32MX120F032C is not set +# CONFIG_ARCH_CHIP_PIC32MX120F032D is not set +# CONFIG_ARCH_CHIP_PIC32MX130F064B is not set +# CONFIG_ARCH_CHIP_PIC32MX130F064C is not set +# CONFIG_ARCH_CHIP_PIC32MX130F064D is not set +# CONFIG_ARCH_CHIP_PIC32MX150F128B is not set +# CONFIG_ARCH_CHIP_PIC32MX150F128C is not set +# CONFIG_ARCH_CHIP_PIC32MX150F128D is not set +# CONFIG_ARCH_CHIP_PIC32MX210F016B is not set +# CONFIG_ARCH_CHIP_PIC32MX210F016C is not set +# CONFIG_ARCH_CHIP_PIC32MX210F016D is not set +# CONFIG_ARCH_CHIP_PIC32MX220F032B is not set +# CONFIG_ARCH_CHIP_PIC32MX220F032C is not set +# CONFIG_ARCH_CHIP_PIC32MX220F032D is not set +# CONFIG_ARCH_CHIP_PIC32MX230F064B is not set +# CONFIG_ARCH_CHIP_PIC32MX230F064C is not set +# CONFIG_ARCH_CHIP_PIC32MX230F064D is not set +# CONFIG_ARCH_CHIP_PIC32MX250F128B is not set +# CONFIG_ARCH_CHIP_PIC32MX250F128C is not set +# CONFIG_ARCH_CHIP_PIC32MX250F128D is not set +# CONFIG_ARCH_CHIP_PIC32MX320F032H is not set +# CONFIG_ARCH_CHIP_PIC32MX320F064H is not set +# CONFIG_ARCH_CHIP_PIC32MX320F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX320F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX340F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX340F256H is not set +# CONFIG_ARCH_CHIP_PIC32MX340F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX340F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX360F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX360F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX420F032H is not set +# CONFIG_ARCH_CHIP_PIC32MX440F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX440F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX440F256H is not set +CONFIG_ARCH_CHIP_PIC32MX440F512H=y +# CONFIG_ARCH_CHIP_PIC32MX460F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX460F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX534F064H is not set +# CONFIG_ARCH_CHIP_PIC32MX534F064L is not set +# CONFIG_ARCH_CHIP_PIC32MX564F064H is not set +# CONFIG_ARCH_CHIP_PIC32MX564F064L is not set +# CONFIG_ARCH_CHIP_PIC32MX564F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX564F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX575F256H is not set +# CONFIG_ARCH_CHIP_PIC32MX575F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX575F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX575F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX664F064H is not set +# CONFIG_ARCH_CHIP_PIC32MX664F064L is not set +# CONFIG_ARCH_CHIP_PIC32MX664F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX664F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX675F256H is not set +# CONFIG_ARCH_CHIP_PIC32MX675F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX675F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX675F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX695F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX695F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX764F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX764F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX775F256H is not set +# CONFIG_ARCH_CHIP_PIC32MX775F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX775F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX775F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX795F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX795F512L is not set +CONFIG_ARCH_CHIP_PIC32MX4=y +# CONFIG_PIC32MX_MVEC is not set +CONFIG_PIC32MX_T1=y + +# +# PIC32MX Peripheral Support +# +# CONFIG_PIC32MX_WDT is not set +# CONFIG_PIC32MX_T2 is not set +# CONFIG_PIC32MX_T3 is not set +# CONFIG_PIC32MX_T4 is not set +# CONFIG_PIC32MX_T5 is not set +# CONFIG_PIC32MX_IC1 is not set +# CONFIG_PIC32MX_IC2 is not set +# CONFIG_PIC32MX_IC3 is not set +# CONFIG_PIC32MX_IC4 is not set +# CONFIG_PIC32MX_IC5 is not set +# CONFIG_PIC32MX_OC1 is not set +# CONFIG_PIC32MX_OC2 is not set +# CONFIG_PIC32MX_OC3 is not set +# CONFIG_PIC32MX_OC4 is not set +# CONFIG_PIC32MX_OC5 is not set +# CONFIG_PIC32MX_I2C1 is not set +# CONFIG_PIC32MX_I2C2 is not set +# CONFIG_PIC32MX_I2C3 is not set +# CONFIG_PIC32MX_I2C4 is not set +# CONFIG_PIC32MX_I2C5 is not set +# CONFIG_PIC32MX_SPI1 is not set +# CONFIG_PIC32MX_SPI2 is not set +# CONFIG_PIC32MX_SPI3 is not set +# CONFIG_PIC32MX_SPI4 is not set +# CONFIG_PIC32MX_UART1 is not set CONFIG_PIC32MX_UART2=y -CONFIG_PIC32MX_PMP=n -CONFIG_PIC32MX_ADC=n -CONFIG_PIC32MX_CVR=n -CONFIG_PIC32MX_CM1=n -CONFIG_PIC32MX_CM2=n -CONFIG_PIC32MX_DDP=n -CONFIG_PIC32MX_FLASH=n -CONFIG_PIC32MX_BMX=n -CONFIG_PIC32MX_DMA=n -CONFIG_PIC32MX_CHE=n -CONFIG_PIC32MX_USBDEV=n -CONFIG_PIC32MX_USBHOST=n - -# -# PIC32MX Configuration Settings +# CONFIG_PIC32MX_UART3 is not set +# CONFIG_PIC32MX_UART4 is not set +# CONFIG_PIC32MX_UART5 is not set +# CONFIG_PIC32MX_UART6 is not set +# CONFIG_PIC32MX_ADC is not set +# CONFIG_PIC32MX_PMP is not set +# CONFIG_PIC32MX_CM1 is not set +# CONFIG_PIC32MX_CM2 is not set +# CONFIG_PIC32MX_CM3 is not set +# CONFIG_PIC32MX_RTCC is not set +# CONFIG_PIC32MX_DMA is not set +# CONFIG_PIC32MX_FLASH is not set +# CONFIG_PIC32MX_USBDEV is not set +# CONFIG_PIC32MX_USBHOST is not set +# CONFIG_PIC32MX_CAN1 is not set +# CONFIG_PIC32MX_CAN2 is not set +# CONFIG_PIC32MX_ETHERNET is not set +# CONFIG_PIC32MX_CTMU is not set + +# +# PIC32MX Peripheral Interrupt Priorities +# +CONFIG_PIC32MX_CTPRIO=16 +CONFIG_PIC32MX_CS0PRIO=16 +CONFIG_PIC32MX_CS1PRIO=16 +CONFIG_PIC32MX_INT0PRIO=16 +CONFIG_PIC32MX_INT1PRIO=16 +CONFIG_PIC32MX_INT2PRIO=16 +CONFIG_PIC32MX_INT3PRIO=16 +CONFIG_PIC32MX_INT4PRIO=16 +CONFIG_PIC32MX_T1PRIO=16 +CONFIG_PIC32MX_UART2PRIO=16 + +# +# Device Configuration 0 (DEVCFG0) # CONFIG_PIC32MX_DEBUGGER=2 CONFIG_PIC32MX_ICESEL=1 +CONFIG_PIC32MX_PROGFLASHWP=0xff +CONFIG_PIC32MX_BOOTFLASHWP=1 +CONFIG_PIC32MX_CODEWP=1 # -# PIC32MX specific serial device driver settings +# Device Configuration 3 (DEVCFG3) # -CONFIG_UART1_SERIAL_CONSOLE=n -CONFIG_UART2_SERIAL_CONSOLE=y +CONFIG_PIC32MX_USBIDO=0 +CONFIG_PIC32MX_VBUSIO=0 +# CONFIG_PIC32MX_WDENABLE is not set +CONFIG_PIC32MX_FETHIO=1 +CONFIG_PIC32MX_FMIIEN=1 -CONFIG_UART1_TXBUFSIZE=256 -CONFIG_UART2_TXBUFSIZE=256 +# +# External Memory Configuration +# -CONFIG_UART1_RXBUFSIZE=256 -CONFIG_UART2_RXBUFSIZE=256 +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +CONFIG_ARCH_VECNOTIRQ=y +# CONFIG_ARCH_DMA is not set +CONFIG_ARCH_IRQPRIO=y +# CONFIG_CUSTOM_STACK is not set +# CONFIG_ADDRENV is not set +CONFIG_ARCH_HAVE_VFORK=y +CONFIG_ARCH_STACKDUMP=y +# CONFIG_ENDIAN_BIG is not set +CONFIG_ARCH_HAVE_RAMFUNCS=y +# CONFIG_ARCH_RAMFUNCS is not set +# CONFIG_ARCH_HAVE_RAMVECTORS is not set -CONFIG_UART1_BAUD=115200 -CONFIG_UART2_BAUD=115200 +# +# Board Settings +# +CONFIG_BOARD_LOOPSPERMSEC=4275 +# CONFIG_ARCH_CALIBRATION is not set +CONFIG_DRAM_START=0xa0000000 +CONFIG_DRAM_SIZE=32768 +CONFIG_ARCH_HAVE_INTERRUPTSTACK=y +CONFIG_ARCH_INTERRUPTSTACK=0 -CONFIG_UART1_BITS=8 -CONFIG_UART2_BITS=8 +# +# Boot options +# +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set -CONFIG_UART1_PARITY=0 -CONFIG_UART2_PARITY=0 +# +# Board Selection +# +CONFIG_ARCH_BOARD_SUREPIC32MX=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="sure-pic32mx" -CONFIG_UART1_2STOP=0 -CONFIG_UART2_2STOP=0 +# +# Common Board Options +# +CONFIG_ARCH_HAVE_LEDS=y +CONFIG_ARCH_LEDS=y +CONFIG_ARCH_HAVE_BUTTONS=y +# CONFIG_ARCH_BUTTONS is not set +CONFIG_ARCH_HAVE_IRQBUTTONS=y # -# General build options +# Board-Specific Options # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=y -CONFIG_MOTOROLA_SREC=n -CONFIG_RAW_BINARY=n +CONFIG_ARCH_DBDP11215=y +# CONFIG_ARCH_DBDP11212 is not set # -# General OS setup +# RTOS Features # -CONFIG_USER_ENTRYPOINT="ostest_main" -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_DEBUG_SCHED=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y +# CONFIG_BOARD_INITIALIZE is not set +CONFIG_MSEC_PER_TICK=10 CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n +# CONFIG_SCHED_INSTRUMENTATION is not set CONFIG_TASK_NAME_SIZE=0 +# CONFIG_SCHED_HAVE_PARENT is not set +# CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2011 CONFIG_START_MONTH=4 CONFIG_START_DAY=8 -CONFIG_GREGORIAN_TIME=n -CONFIG_JULIAN_TIME=n CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=y -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set CONFIG_SDCLONE_DISABLE=y -CONFIG_SCHED_WORKQUEUE=n -CONFIG_SCHED_WORKPRIORITY=192 -CONFIG_SCHED_WORKPERIOD=50000 -CONFIG_SCHED_WORKSTACKSIZE=1024 -CONFIG_SIG_SIGWORK=17 - -# -# Settings for nxflat -# -CONFIG_NXFLAT=n -CONFIG_NXFLAT_DUMPBUFFER=n -CONFIG_SYMTAB_ORDEREDBYNAME=y - -# -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. -# -# There are certain dependency relationships in these -# features. -# -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. -# -CONFIG_DISABLE_CLOCK=n -CONFIG_DISABLE_POSIX_TIMERS=n -CONFIG_DISABLE_PTHREAD=n -CONFIG_DISABLE_SIGNALS=n -CONFIG_DISABLE_MQUEUE=n -CONFIG_DISABLE_MOUNTPOINT=y +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_STARTHOOK is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="ostest_main" +CONFIG_DISABLE_OS_API=y +# CONFIG_DISABLE_CLOCK is not set +# CONFIG_DISABLE_POSIX_TIMERS is not set +# CONFIG_DISABLE_PTHREAD is not set +# CONFIG_DISABLE_SIGNALS is not set +# CONFIG_DISABLE_MQUEUE is not set CONFIG_DISABLE_ENVIRON=y -CONFIG_DISABLE_POLL=y # -# Misc libc settings +# Signal Numbers # -CONFIG_NOPRINTF_FIELDWIDTH=n - -# -# Allow for architecture optimized implementations -# -# The architecture can provide optimized versions of the -# following to improve system performance -# -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n +CONFIG_SIG_SIGUSR1=1 +CONFIG_SIG_SIGUSR2=2 +CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGCONDTIMEDOUT=16 # # Sizes of configurable things (0 disables) @@ -244,8 +341,6 @@ CONFIG_NPTHREAD_KEYS=4 CONFIG_NFILE_DESCRIPTORS=8 CONFIG_NFILE_STREAMS=8 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=64 -CONFIG_NUNGET_CHARS=2 CONFIG_PREALLOC_MQ_MSGS=4 CONFIG_MQ_MAXMSGSIZE=32 CONFIG_MAX_WDOGPARMS=2 @@ -253,207 +348,319 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=4 # -# Filesystem configuration +# Stack and heap information +# +CONFIG_IDLETHREAD_STACKSIZE=2048 +CONFIG_USERMAIN_STACKSIZE=2048 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=2048 + +# +# Device Drivers +# +CONFIG_DISABLE_POLL=y +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_AUDIO_DEVICES is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +CONFIG_SERIAL=y +CONFIG_DEV_LOWCONSOLE=y +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART2=y +CONFIG_MCU_SERIAL=y +CONFIG_UART2_SERIAL_CONSOLE=y +# CONFIG_NO_SERIAL_CONSOLE is not set + +# +# UART2 Configuration +# +CONFIG_UART2_RXBUFSIZE=256 +CONFIG_UART2_TXBUFSIZE=256 +CONFIG_UART2_BAUD=115200 +CONFIG_UART2_BITS=8 +CONFIG_UART2_PARITY=0 +CONFIG_UART2_2STOP=0 +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options # -CONFIG_FS_FAT=n -CONFIG_FS_ROMFS=n # -# Maintain legacy build behavior (revisit) +# System Logging # +# CONFIG_RAMLOG is not set -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MTD=y +# +# Networking Support +# +# CONFIG_NET is not set # -# SPI-based MMC/SD driver +# File Systems # -CONFIG_MMCSD_NSLOTS=1 -CONFIG_MMCSD_READONLY=n -CONFIG_MMCSD_SPICLOCK=12500000 # -# Block driver buffering +# File system configuration # -CONFIG_FS_READAHEAD=n -CONFIG_FS_WRITEBUFFER=n +CONFIG_DISABLE_MOUNTPOINT=y +# CONFIG_FS_RAMMAP is not set # -# SDIO-based MMC/SD driver +# System Logging # -CONFIG_SDIO_DMA=n -CONFIG_MMCSD_MMCSUPPORT=n -CONFIG_MMCSD_HAVECARDDETECT=n +# CONFIG_SYSLOG_ENABLE is not set +# CONFIG_SYSLOG is not set # -# TCP/IP and UDP support via uIP +# Graphics Support # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n +# CONFIG_NX is not set # -# UIP Network Utilities +# Memory Management # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 +# CONFIG_MM_MULTIHEAP is not set +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +# CONFIG_GRAN is not set # -# USB Device Configuration +# Audio Support # -CONFIG_USBDEV=n -CONFIG_USBDEV_ISOCHRONOUS=n -CONFIG_USBDEV_DUALSPEED=n -CONFIG_USBDEV_SELFPOWERED=y -CONFIG_USBDEV_REMOTEWAKEUP=n -CONFIG_USBDEV_MAXPOWER=100 -CONFIG_USBDEV_TRACE=n -CONFIG_USBDEV_TRACE_NRECORDS=128 +# CONFIG_AUDIO is not set # -# USB Serial Device Configuration +# Binary Formats # -CONFIG_PL2303=n -CONFIG_PL2303_EPINTIN=1 -CONFIG_PL2303_EPBULKOUT=2 -CONFIG_PL2303_EPBULKIN=5 -CONFIG_PL2303_NWRREQS=4 -CONFIG_PL2303_NRDREQS=4 -CONFIG_PL2303_VENDORID=0x067b -CONFIG_PL2303_PRODUCTID=0x2303 -CONFIG_PL2303_VENDORSTR="Nuttx" -CONFIG_PL2303_PRODUCTSTR="USBdev Serial" -CONFIG_PL2303_RXBUFSIZE=512 -CONFIG_PL2303_TXBUFSIZE=512 +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_BUILTIN is not set +# CONFIG_PIC is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set # -# USB Storage Device Configuration +# Library Routines # -CONFIG_USBMSC=n -CONFIG_USBMSC_EP0MAXPACKET=64 -CONFIG_USBMSC_EPBULKOUT=1 -CONFIG_USBMSC_EPBULKIN=2 -CONFIG_USBMSC_NRDREQS=8 -CONFIG_USBMSC_NWRREQS=2 -CONFIG_USBMSC_BULKINREQLEN=256 -CONFIG_USBMSC_BULKOUTREQLEN=64 -CONFIG_USBMSC_VENDORID=0x584e -CONFIG_USBMSC_VENDORSTR="NuttX" -CONFIG_USBMSC_PRODUCTID=0x5342 -CONFIG_USBMSC_PRODUCTSTR="USBdev Storage" -CONFIG_USBMSC_VERSIONNO=0x0399 -CONFIG_USBMSC_REMOVABLE=y # -# Settings for examples/uip +# Standard C Library Options # -CONFIG_EXAMPLES_UIP_IPADDR=0x0a000002 -CONFIG_EXAMPLES_UIP_DRIPADDR=0x0a000001 -CONFIG_EXAMPLES_UIP_NETMASK=0xffffff00 -CONFIG_EXAMPLES_UIP_DHCPC=n +CONFIG_STDIO_BUFFER_SIZE=64 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=2 +# CONFIG_LIBM is not set +# CONFIG_NOPRINTF_FIELDWIDTH is not set +# CONFIG_LIBC_FLOATINGPOINT is not set +CONFIG_LIB_RAND_ORDER=1 +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_EXECFUNCS is not set +CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 +CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set # -# Settings for examples/nettest +# Non-standard Library Support # -CONFIG_EXAMPLES_NETTEST_SERVER=n -CONFIG_EXAMPLES_NETTEST_PERFORMANCE=n -CONFIG_EXAMPLES_NETTEST_NOMAC=y -CONFIG_EXAMPLES_NETTEST_IPADDR=0x0a000002 -CONFIG_EXAMPLES_NETTEST_DRIPADDR=0x0a000001 -CONFIG_EXAMPLES_NETTEST_NETMASK=0xffffff00 -CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001 +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_LIB_KBDCODEC is not set +# CONFIG_LIB_SLCDCODEC is not set # -# Settings for examples/ostest +# Basic CXX Support # +# CONFIG_C99_BOOL8 is not set +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Built-In Applications +# + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +CONFIG_EXAMPLES_OSTEST=y +# CONFIG_EXAMPLES_OSTEST_BUILTIN is not set CONFIG_EXAMPLES_OSTEST_LOOPS=1 CONFIG_EXAMPLES_OSTEST_STACKSIZE=2048 CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3 +CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000 +CONFIG_EXAMPLES_OSTEST_RR_RUNS=10 +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_POSIXSPAWN is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_SLCD is not set +# CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_TCPECHO is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set # -# Settings for apps/nshlib +# Graphics Support # -CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_STRERROR=n -CONFIG_NSH_LINELEN=64 -CONFIG_NSH_NESTDEPTH=3 -CONFIG_NSH_DISABLESCRIPT=n -CONFIG_NSH_DISABLEBG=n -CONFIG_NSH_ROMFSETC=n -CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 -CONFIG_NSH_ROMFSMOUNTPT="/etc" -CONFIG_NSH_INITSCRIPT="init.d/rcS" -CONFIG_NSH_ROMFSDEVNO=0 -CONFIG_NSH_ROMFSSECTSIZE=64 -CONFIG_NSH_FATDEVNO=1 -CONFIG_NSH_FATSECTSIZE=512 -CONFIG_NSH_FATNSECTORS=1024 -CONFIG_NSH_FATMOUNTPT="/tmp" +# CONFIG_TIFF is not set # -# Architecture-specific NSH options +# Interpreters # -CONFIG_NSH_MMCSDSPIPORTNO=2 -CONFIG_NSH_MMCSDSLOTNO=0 -CONFIG_NSH_MMCSDMINOR=0 +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set # -# Settings for examples/usbserial +# Network Utilities # -CONFIG_EXAMPLES_USBSERIAL_INONLY=n -CONFIG_EXAMPLES_USBSERIAL_OUTONLY=n -CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL=n -CONFIG_EXAMPLES_USBSERIAL_ONLYBIG=n -CONFIG_EXAMPLES_USBSERIAL_TRACEINIT=n -CONFIG_EXAMPLES_USBSERIAL_TRACECLASS=n -CONFIG_EXAMPLES_USBSERIAL_TRACETRANSFERS=n -CONFIG_EXAMPLES_USBSERIAL_TRACECONTROLLER=n -CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=n +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set # -# Settings for examples/usbstorage +# FreeModBus # -CONFIG_EXAMPLES_USBMSC_NLUNS=1 -CONFIG_EXAMPLES_USBMSC_DEVMINOR1=0 -CONFIG_EXAMPLES_USBMSC_DEVPATH1="/dev/mmcsd0" -CONFIG_EXAMPLES_USBMSC_TRACEINIT=n -CONFIG_EXAMPLES_USBMSC_TRACECLASS=n -CONFIG_EXAMPLES_USBMSC_TRACETRANSFERS=n -CONFIG_EXAMPLES_USBMSC_TRACECONTROLLER=n -CONFIG_EXAMPLES_USBMSC_TRACEINTERRUPTS=n +# CONFIG_MODBUS is not set # -# Stack and heap information +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM +# + +# +# System NSH Add-Ons +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# FLASH Erase-all Command +# + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set + +# +# USB Monitor # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=2048 -CONFIG_USERMAIN_STACKSIZE=2048 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=2048 diff --git a/nuttx/configs/sure-pic32mx/ostest/ld.script b/nuttx/configs/sure-pic32mx/ostest/ld.script deleted file mode 100644 index 01d97ad55..000000000 --- a/nuttx/configs/sure-pic32mx/ostest/ld.script +++ /dev/null @@ -1,317 +0,0 @@ -/**************************************************************************** - * configs/sure-pic32mx/ostest/ld.script - * - * Copyright (C) 2011 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. - * - ****************************************************************************/ -/* Memory Regions ***********************************************************/ - -MEMORY -{ - /* The PIC32MX440F512H has 512Kb of program FLASH at physical address - * 0x1d000000 but is always accessed at KSEG0 address 0x9d00:0000 - */ - - kseg0_progmem (rx) : ORIGIN = 0x9d000000, LENGTH = 512K - - /* The PIC32MX440F512H has 12Kb of boot FLASH at physical address - * 0x1fc00000. The initial reset vector is in KSEG1, but all other - * accesses are in KSEG0. - * - * REGION PHYSICAL KSEG SIZE - * DESCRIPTION START ADDR (BYTES) - * ------------- ---------- ------ ---------------------- - * Exceptions:* - * Reset 0x1fc00000 KSEG1 512 512 - * TLB Refill 0x1fc00200 KSEG1 256 768 - * Cache Error 0x1fc00300 KSEG1 128 896 - * Others 0x1fc00380 KSEG1 128 1024 (1Kb) - * Interrupt 0x1fc00400 KSEG1 128 1152 - * JTAG 0x1fc00480 KSEG1 16 1168 - * Exceptions 0x1fc00490 KSEG0 8192-1168 8192 (4Kb) - * Debug code 0x1fc02000 KSEG1 4096-16 12272 - * DEVCFG3-0 0x1fc02ff0 KSEG1 16 12288 (12Kb) - * - * Exceptions assume: - * - * STATUS: BEV=0/1 and EXL=0 - * CAUSE: IV=1 - * JTAG: ProbEn=0 - * And multi-vector support disabled - */ - - kseg1_reset (rx) : ORIGIN = 0xbfc00000, LENGTH = 384 - kseg1_genexcpt (rx) : ORIGIN = 0xbfc00180, LENGTH = 128 - kseg1_ebexcpt (rx) : ORIGIN = 0xbfc00200, LENGTH = 128 - kseg1_bevexcpt (rx) : ORIGIN = 0xbfc00380, LENGTH = 128 - kseg1_intexcpt (rx) : ORIGIN = 0xbfc00400, LENGTH = 128 - kseg1_dbgexcpt (rx) : ORIGIN = 0xbfc00480, LENGTH = 16 - kseg0_bootmem (rx) : ORIGIN = 0x9fc00490, LENGTH = 8192-1168 - kseg1_dbgcode (rx) : ORIGIN = 0xbfc02000, LENGTH = 4096-16 - kseg1_devcfg (r) : ORIGIN = 0xbfc02ff0, LENGTH = 16 - - /* The PIC32MX440F512H has 32Kb of data memory at physical address - * 0x00000000. Since the PIC32MX has no data cache, this memory is - * always accessed through KSEG1. - * - * When used with MPLAB, we need to set aside 512 bytes of memory - * for use by MPLAB. - */ - - kseg1_datamem (w!x) : ORIGIN = 0xa0000200, LENGTH = 32K - 512 -} - -OUTPUT_FORMAT("elf32-tradlittlemips") -OUTPUT_ARCH(pic32mx) -ENTRY(__start) - -SECTIONS -{ - /* Boot FLASH sections */ - - .reset : - { - KEEP (*(.reset)) - } > kseg1_reset - - /* Exception handlers. The following is assumed: - * - * STATUS: BEV=1 and EXL=0 - * CAUSE: IV=1 - * JTAG: ProbEn=0 - * And multi-vector support disabled - * - * In that configuration, the vector locations become: - * - * Reset, Soft Reset bfc0:0000 - * TLB Refill bfc0:0200 - * Cache Error bfc0:0300 - * All others bfc0:0380 - * Interrupt bfc0:0400 - * EJTAG Debug bfc0:0480 - */ - - /* KSEG1 exception handler "trampolines" */ - - .gen_excpt : - { - KEEP (*(.gen_excpt)) - } > kseg1_genexcpt - - .ebase_excpt : - { - KEEP (*(.ebase_excpt)) - } > kseg1_ebexcpt - - .bev_excpt : - { - KEEP (*(.bev_excpt)) - } > kseg1_bevexcpt - - .int_excpt : - { - KEEP (*(.int_excpt)) - } > kseg1_intexcpt - - .dbg_excpt = ORIGIN(kseg1_dbgexcpt); - - .start : - { - /* KSEG0 Reset startup logic */ - - *(.start) - - /* KSEG0 exception handlers */ - - *(.nmi_handler) - *(.bev_handler) - *(.int_handler) - } > kseg0_bootmem - - .dbg_code = ORIGIN(kseg1_dbgcode); - - .devcfg : - { - KEEP (*(.devcfg)) - } > kseg1_devcfg - - /* Program FLASH sections */ - - .text : - { - _stext = ABSOLUTE(.); - *(.text .text.*) - *(.stub) - KEEP (*(.text.*personality*)) - *(.gnu.linkonce.t.*) - *(.gnu.warning) - *(.mips16.fn.*) - *(.mips16.call.*) - - /* Read-only data is included in the text section */ - - *(.rodata .rodata.*) - *(.rodata1) - *(.gnu.linkonce.r.*) - - /* Small initialized constant global and static data */ - - *(.sdata2 .sdata2.*) - *(.gnu.linkonce.s2.*) - - /* Uninitialized constant global and static data */ - - *(.sbss2 .sbss2.*) - *(.gnu.linkonce.sb2.*) - _etext = ABSOLUTE(.); - } > kseg0_progmem - - /* Initialization data begins here in progmem */ - - _data_loaddr = LOADADDR(.data); - - .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } - - /* RAM functions are positioned at the beginning of RAM so that - * they can be guaranteed to satisfy the 2Kb alignment requirement. - */ - -/* This causes failures if there are no RAM functions - .ramfunc ALIGN(2K) : - { - _sramfunc = ABSOLUTE(.); - *(.ramfunc .ramfunc.*) - _eramfunc = ABSOLUTE(.); - } > kseg1_datamem AT > kseg0_progmem - - _ramfunc_loadaddr = LOADADDR(.ramfunc); - _ramfunc_sizeof = SIZEOF(.ramfunc); - _bmxdkpba_address = _sramfunc - ORIGIN(kseg1_datamem) ; - _bmxdudba_address = LENGTH(kseg1_datamem) ; - _bmxdupba_address = LENGTH(kseg1_datamem) ; -*/ - - .data : - { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - KEEP (*(.gnu.linkonce.d.*personality*)) - *(.data1) - } > kseg1_datamem AT > kseg0_progmem - - .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } - _gp = ALIGN(16) + 0x7FF0 ; - - .got : - { - *(.got.plt) *(.got) - } > kseg1_datamem AT > kseg0_progmem - - .sdata : - { - *(.sdata .sdata.* .gnu.linkonce.s.*) - } > kseg1_datamem AT > kseg0_progmem - - .lit8 : - { - *(.lit8) - } > kseg1_datamem AT > kseg0_progmem - - .lit4 : - { - *(.lit4) - _edata = ABSOLUTE(.); - } >kseg1_datamem AT>kseg0_progmem - - .sbss : - { - _sbss = ABSOLUTE(.); - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.scommon) - } >kseg1_datamem - - .bss : - { - *(.dynbss) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - _ebss = ABSOLUTE(.); - } > kseg1_datamem - - /* Stabs debugging sections */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - - /* DWARF debug sections */ - /* DWARF 1 */ - - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - - /* GNU DWARF 1 extensions */ - - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - - /* DWARF 1.1 and DWARF 2 */ - - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - - /* DWARF 2 */ - - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - - /* SGI/MIPS DWARF 2 extensions */ - - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /DISCARD/ : { *(.note.GNU-stack) } -} diff --git a/nuttx/configs/sure-pic32mx/scripts/ld.script b/nuttx/configs/sure-pic32mx/scripts/ld.script new file mode 100644 index 000000000..0975477cc --- /dev/null +++ b/nuttx/configs/sure-pic32mx/scripts/ld.script @@ -0,0 +1,317 @@ +/**************************************************************************** + * configs/sure-pic32mx/nsh/ld.script + * + * Copyright (C) 2011 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. + * + ****************************************************************************/ +/* Memory Regions ***********************************************************/ + +MEMORY +{ + /* The PIC32MX440F512H has 512Kb of program FLASH at physical address + * 0x1d000000 but is always accessed at KSEG0 address 0x9d00:0000 + */ + + kseg0_progmem (rx) : ORIGIN = 0x9d000000, LENGTH = 512K + + /* The PIC32MX440F512H has 12Kb of boot FLASH at physical address + * 0x1fc00000. The initial reset vector is in KSEG1, but all other + * accesses are in KSEG0. + * + * REGION PHYSICAL KSEG SIZE + * DESCRIPTION START ADDR (BYTES) + * ------------- ---------- ------ ---------------------- + * Exceptions:* + * Reset 0x1fc00000 KSEG1 512 512 + * TLB Refill 0x1fc00200 KSEG1 256 768 + * Cache Error 0x1fc00300 KSEG1 128 896 + * Others 0x1fc00380 KSEG1 128 1024 (1Kb) + * Interrupt 0x1fc00400 KSEG1 128 1152 + * JTAG 0x1fc00480 KSEG1 16 1168 + * Exceptions 0x1fc00490 KSEG0 8192-1168 8192 (4Kb) + * Debug code 0x1fc02000 KSEG1 4096-16 12272 + * DEVCFG3-0 0x1fc02ff0 KSEG1 16 12288 (12Kb) + * + * Exceptions assume: + * + * STATUS: BEV=0/1 and EXL=0 + * CAUSE: IV=1 + * JTAG: ProbEn=0 + * And multi-vector support disabled + */ + + kseg1_reset (rx) : ORIGIN = 0xbfc00000, LENGTH = 384 + kseg1_genexcpt (rx) : ORIGIN = 0xbfc00180, LENGTH = 128 + kseg1_ebexcpt (rx) : ORIGIN = 0xbfc00200, LENGTH = 128 + kseg1_bevexcpt (rx) : ORIGIN = 0xbfc00380, LENGTH = 128 + kseg1_intexcpt (rx) : ORIGIN = 0xbfc00400, LENGTH = 128 + kseg1_dbgexcpt (rx) : ORIGIN = 0xbfc00480, LENGTH = 16 + kseg0_bootmem (rx) : ORIGIN = 0x9fc00490, LENGTH = 8192-1168 + kseg1_dbgcode (rx) : ORIGIN = 0xbfc02000, LENGTH = 4096-16 + kseg1_devcfg (r) : ORIGIN = 0xbfc02ff0, LENGTH = 16 + + /* The PIC32MX440F512H has 32Kb of data memory at physical address + * 0x00000000. Since the PIC32MX has no data cache, this memory is + * always accessed through KSEG1. + * + * When used with MPLAB, we need to set aside 512 bytes of memory + * for use by MPLAB. + */ + + kseg1_datamem (w!x) : ORIGIN = 0xa0000200, LENGTH = 32K - 512 +} + +OUTPUT_FORMAT("elf32-tradlittlemips") +OUTPUT_ARCH(pic32mx) +ENTRY(__start) + +SECTIONS +{ + /* Boot FLASH sections */ + + .reset : + { + KEEP (*(.reset)) + } > kseg1_reset + + /* Exception handlers. The following is assumed: + * + * STATUS: BEV=1 and EXL=0 + * CAUSE: IV=1 + * JTAG: ProbEn=0 + * And multi-vector support disabled + * + * In that configuration, the vector locations become: + * + * Reset, Soft Reset bfc0:0000 + * TLB Refill bfc0:0200 + * Cache Error bfc0:0300 + * All others bfc0:0380 + * Interrupt bfc0:0400 + * EJTAG Debug bfc0:0480 + */ + + /* KSEG1 exception handler "trampolines" */ + + .gen_excpt : + { + KEEP (*(.gen_excpt)) + } > kseg1_genexcpt + + .ebase_excpt : + { + KEEP (*(.ebase_excpt)) + } > kseg1_ebexcpt + + .bev_excpt : + { + KEEP (*(.bev_excpt)) + } > kseg1_bevexcpt + + .int_excpt : + { + KEEP (*(.int_excpt)) + } > kseg1_intexcpt + + .dbg_excpt = ORIGIN(kseg1_dbgexcpt); + + .start : + { + /* KSEG0 Reset startup logic */ + + *(.start) + + /* KSEG0 exception handlers */ + + *(.nmi_handler) + *(.bev_handler) + *(.int_handler) + } > kseg0_bootmem + + .dbg_code = ORIGIN(kseg1_dbgcode); + + .devcfg : + { + KEEP (*(.devcfg)) + } > kseg1_devcfg + + /* Program FLASH sections */ + + .text : + { + _stext = ABSOLUTE(.); + *(.text .text.*) + *(.stub) + KEEP (*(.text.*personality*)) + *(.gnu.linkonce.t.*) + *(.gnu.warning) + *(.mips16.fn.*) + *(.mips16.call.*) + + /* Read-only data is included in the text section */ + + *(.rodata .rodata.*) + *(.rodata1) + *(.gnu.linkonce.r.*) + + /* Small initialized constant global and static data */ + + *(.sdata2 .sdata2.*) + *(.gnu.linkonce.s2.*) + + /* Uninitialized constant global and static data */ + + *(.sbss2 .sbss2.*) + *(.gnu.linkonce.sb2.*) + _etext = ABSOLUTE(.); + } > kseg0_progmem + + /* Initialization data begins here in progmem */ + + _data_loaddr = LOADADDR(.data); + + .eh_frame_hdr : { *(.eh_frame_hdr) } + .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } + + /* RAM functions are positioned at the beginning of RAM so that + * they can be guaranteed to satisfy the 2Kb alignment requirement. + */ + +/* This causes failures if there are no RAM functions + .ramfunc ALIGN(2K) : + { + _sramfunc = ABSOLUTE(.); + *(.ramfunc .ramfunc.*) + _eramfunc = ABSOLUTE(.); + } > kseg1_datamem AT > kseg0_progmem + + _ramfunc_loadaddr = LOADADDR(.ramfunc); + _ramfunc_sizeof = SIZEOF(.ramfunc); + _bmxdkpba_address = _sramfunc - ORIGIN(kseg1_datamem) ; + _bmxdudba_address = LENGTH(kseg1_datamem) ; + _bmxdupba_address = LENGTH(kseg1_datamem) ; +*/ + + .data : + { + _sdata = ABSOLUTE(.); + *(.data .data.*) + *(.gnu.linkonce.d.*) + KEEP (*(.gnu.linkonce.d.*personality*)) + *(.data1) + } > kseg1_datamem AT > kseg0_progmem + + .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } + _gp = ALIGN(16) + 0x7FF0 ; + + .got : + { + *(.got.plt) *(.got) + } > kseg1_datamem AT > kseg0_progmem + + .sdata : + { + *(.sdata .sdata.* .gnu.linkonce.s.*) + } > kseg1_datamem AT > kseg0_progmem + + .lit8 : + { + *(.lit8) + } > kseg1_datamem AT > kseg0_progmem + + .lit4 : + { + *(.lit4) + _edata = ABSOLUTE(.); + } >kseg1_datamem AT>kseg0_progmem + + .sbss : + { + _sbss = ABSOLUTE(.); + *(.dynsbss) + *(.sbss .sbss.* .gnu.linkonce.sb.*) + *(.scommon) + } >kseg1_datamem + + .bss : + { + *(.dynbss) + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + _ebss = ABSOLUTE(.); + } > kseg1_datamem + + /* Stabs debugging sections */ + + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + + /* DWARF debug sections */ + /* DWARF 1 */ + + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + + /* GNU DWARF 1 extensions */ + + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + + /* DWARF 1.1 and DWARF 2 */ + + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + + /* DWARF 2 */ + + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + + /* SGI/MIPS DWARF 2 extensions */ + + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + + /DISCARD/ : { *(.note.GNU-stack) } +} diff --git a/nuttx/configs/sure-pic32mx/src/Makefile b/nuttx/configs/sure-pic32mx/src/Makefile index 57a74ce35..a0cd0fdbe 100644 --- a/nuttx/configs/sure-pic32mx/src/Makefile +++ b/nuttx/configs/sure-pic32mx/src/Makefile @@ -1,7 +1,7 @@ ############################################################################ # configs/sure-pic32mx/src/Makefile # -# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -35,48 +35,52 @@ -include $(TOPDIR)/Make.defs -CFLAGS += -I$(TOPDIR)/sched +CFLAGS += -I$(TOPDIR)/sched -ASRCS = -CSRCS = up_boot.c up_spi.c +ASRCS = +CSRCS = pic32mx_boot.c pic32mx_spi.c # Only the DB_DP11215 PIC32 Storage Demo Board board has user controllable # LEDs ifeq ($(CONFIG_ARCH_DBDP11215),y) ifeq ($(CONFIG_ARCH_LEDS),y) -CSRCS += up_leds.c +CSRCS += pic32mx_autoleds.c endif endif ifeq ($(CONFIG_ARCH_BUTTONS),y) -CSRCS += up_buttons.c +CSRCS += pic32mx_buttons.c endif ifeq ($(CONFIG_PIC32MX_USBDEV),y) -CSRCS += up_usbdev.c +CSRCS += pic32mx_usbdev.c ifeq ($(CONFIG_EXAMPLES_USBTERM_DEVINIT),y) -CSRCS += up_usbterm.c +CSRCS += pic32mx_usbterm.c endif endif +ifeq ($(CONFIG_LCD_LCD1602),y) +CSRCS += pic32mx_lcd1602.c +endif + ifeq ($(CONFIG_NSH_ARCHINIT),y) -CSRCS += up_nsh.c +CSRCS += pic32mx_nsh.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src ifeq ($(WINTOOL),y) - CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \ - -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \ - -I "${shell cygpath -w $(ARCH_SRCDIR)/mips32}" + CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \ + -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \ + -I "${shell cygpath -w $(ARCH_SRCDIR)/mips32}" else - CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/mips32 + CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/mips32 endif all: libboard$(LIBEXT) diff --git a/nuttx/configs/sure-pic32mx/src/pic32mx_autoleds.c b/nuttx/configs/sure-pic32mx/src/pic32mx_autoleds.c new file mode 100644 index 000000000..61ddfe71a --- /dev/null +++ b/nuttx/configs/sure-pic32mx/src/pic32mx_autoleds.c @@ -0,0 +1,217 @@ +/**************************************************************************** + * configs/sure-pic32mx/src/pic32mx_leds.c + * + * Copyright (C) 2011, 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 + +#include +#include +#include + +#include + +#include "chip.h" +#include "up_arch.h" +#include "up_internal.h" + +#include "pic32mx-internal.h" +#include "pic32mx-ioport.h" +#include "sure-pic32mx.h" + +#ifdef CONFIG_ARCH_LEDS + +/**************************************************************************** + * Definitions + ****************************************************************************/ +/* LED Configuration ********************************************************/ +/* The Sure PIC32MX board has five LEDs. One (D4, lablel "Power") is not + * controllable by software. Four are controllable by software: + * + * D7 "USB" Yellow RD7 Low illuminates + * D8 "SD" Yellow RD6 Low illuminates + * D9 "Flash" Yellow RF0 Low illuminates + * D10 "Error" Red RF1 Low illuminates + * + * ON OFF + * USB SD FLASH ERROR USB SD FLASH ERROR + * LED_STARTED 0 OFF OFF OFF OFF --- --- --- --- + * LED_HEAPALLOCATE 1 ON OFF N/C N/C --- --- --- --- + * LED_IRQSENABLED 2 OFF ON N/C N/C --- --- --- --- + * LED_STACKCREATED 3 ON ON N/C N/C --- --- --- --- + * LED_INIRQ 4 N/C N/C ON N/C N/C N/C OFF N/C + * LED_SIGNAL 4 N/C N/C ON N/C N/C N/C OFF N/C + * LED_ASSERTION 4 N/C N/C ON N/C N/C N/C OFF N/C + * LED_PANIC 5 N/C N/C N/C ON N/C N/C N/C OFF + */ + +#define GPIO_USB_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTD|GPIO_PIN7) +#define GPIO_SD_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTD|GPIO_PIN6) +#define GPIO_FLASH_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTF|GPIO_PIN0) +#define GPIO_ERROR_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTF|GPIO_PIN1) + +/* LED Management Definitions ***********************************************/ + +#define LED_OFF 0 +#define LED_ON 1 +#define LED_NC 2 + +/* Debug ********************************************************************/ + +#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_LEDS) +# define leddbg lldbg +# ifdef CONFIG_DEBUG_VERBOSE +# define ledvdbg lldbg +# else +# define ledvdbg(x...) +# endif +#else +# undef CONFIG_DEBUG_LEDS +# undef CONFIG_DEBUG_VERBOSE +# define leddbg(x...) +# define ledvdbg(x...) +#endif + +/**************************************************************************** + * Private types + ****************************************************************************/ + +struct led_setting_s +{ + uint8_t usb : 2; + uint8_t sd : 2; + uint8_t flash : 2; + uint8_t error : 2; +}; + + /**************************************************************************** + * Private Data + ****************************************************************************/ + +static const struct led_setting_s g_ledonvalues[LED_NVALUES] = +{ + {LED_OFF, LED_OFF, LED_OFF, LED_OFF}, + {LED_ON, LED_OFF, LED_NC, LED_NC}, + {LED_OFF, LED_ON, LED_NC, LED_NC}, + {LED_ON, LED_ON, LED_NC, LED_NC}, + {LED_NC, LED_NC, LED_ON, LED_NC}, + {LED_NC, LED_NC, LED_NC, LED_ON}, +}; + +static const struct led_setting_s g_ledoffvalues[LED_NVALUES] = +{ + {LED_NC, LED_NC, LED_NC, LED_NC}, + {LED_NC, LED_NC, LED_NC, LED_NC}, + {LED_NC, LED_NC, LED_NC, LED_NC}, + {LED_NC, LED_NC, LED_NC, LED_NC}, + {LED_NC, LED_NC, LED_OFF, LED_NC}, + {LED_NC, LED_NC, LED_NC, LED_OFF} +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_setleds + ****************************************************************************/ + +void up_setleds(FAR const struct led_setting_s *setting) +{ + if (setting->usb != LED_NC) + { + pic32mx_gpiowrite(GPIO_USB_LED, setting->usb != LED_ON); + } + + if (setting->sd != LED_NC) + { + pic32mx_gpiowrite(GPIO_SD_LED, setting->sd != LED_ON); + } + + if (setting->flash != LED_NC) + { + pic32mx_gpiowrite(GPIO_FLASH_LED, setting->flash != LED_ON); + } + + if (setting->error != LED_NC) + { + pic32mx_gpiowrite(GPIO_ERROR_LED, setting->error != LED_ON); + } +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: pic32mx_ledinit + ****************************************************************************/ + +void pic32mx_ledinit(void) +{ + /* Configure output pins */ + + pic32mx_configgpio(GPIO_USB_LED); + pic32mx_configgpio(GPIO_SD_LED); + pic32mx_configgpio(GPIO_FLASH_LED); + pic32mx_configgpio(GPIO_ERROR_LED); +} + +/**************************************************************************** + * Name: up_ledon + ****************************************************************************/ + +void up_ledon(int led) +{ + if (led < LED_NVALUES) + { + up_setleds(&g_ledonvalues[led]); + } +} + +/**************************************************************************** + * Name: up_ledoff + ****************************************************************************/ + +void up_ledoff(int led) +{ + if (led < LED_NVALUES) + { + up_setleds(&g_ledoffvalues[led]); + } +} +#endif /* CONFIG_ARCH_LEDS */ diff --git a/nuttx/configs/sure-pic32mx/src/pic32mx_boot.c b/nuttx/configs/sure-pic32mx/src/pic32mx_boot.c new file mode 100644 index 000000000..2748c1e96 --- /dev/null +++ b/nuttx/configs/sure-pic32mx/src/pic32mx_boot.c @@ -0,0 +1,101 @@ +/************************************************************************************ + * configs/sure-pic32mx/src/pic32mx_boot.c + * + * Copyright (C) 2011, 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 + +#include + +#include + +#include "up_arch.h" +#include "up_internal.h" + +#include "pic32mx-internal.h" +#include "sure-pic32mx.h" + +/************************************************************************************ + * Definitions + ************************************************************************************/ + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: pic32mx_boardinitialize + * + * Description: + * All PIC32MX architectures must provide the following entry point. This entry + * point is called early in the intitialization -- after all memory has been + * configured and mapped but before any devices have been initialized. + * + ************************************************************************************/ + +void pic32mx_boardinitialize(void) +{ + /* Configure SPI chip selects if 1) at least one SPI is enabled, and 2) the weak + * function pic32mx_spiinitialize() has been brought into the link. + */ + +#if defined(CONFIG_PIC32MX_SPI2) + if (pic32mx_spiinitialize) + { + pic32mx_spiinitialize(); + } +#endif + + /* Configure the mini-B PHY on the Sure PIC32MX board for the USB device */ + +#if defined(CONFIG_PIC32MX_USBDEV) + if (pic32mx_usbdevinitialize) + { + pic32mx_usbdevinitialize(); + } +#endif + + /* Configure on-board LEDs if LED support has been selected. */ + +#ifdef CONFIG_ARCH_LEDS + pic32mx_ledinit(); +#endif +} diff --git a/nuttx/configs/sure-pic32mx/src/pic32mx_buttons.c b/nuttx/configs/sure-pic32mx/src/pic32mx_buttons.c new file mode 100644 index 000000000..ce9acd875 --- /dev/null +++ b/nuttx/configs/sure-pic32mx/src/pic32mx_buttons.c @@ -0,0 +1,223 @@ +/**************************************************************************** + * configs/sure-pic32mx/src/pic32mx_buttons.c + * + * Copyright (C) 2011, 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 + +#include +#include +#include + +#include + +#include "chip.h" +#include "up_arch.h" + +#include "pic32mx-internal.h" +#include "pic32mx-ioport.h" +#include "pic32mx-adc.h" +#include "sure-pic32mx.h" + +#ifdef CONFIG_ARCH_BUTTONS + +/**************************************************************************** + * Definitions + ****************************************************************************/ +/* The Sure DB_DP11215 PIC32 Storage Demo Board has three buttons. + * + * SW1 (SW_UP, left arrow) RB3 Pulled high, Grounded/low when depressed + * SW2 (SW_DOWN, down/right arrow) RB2 Pulled high, Grounded/low when depressed + * SW3 (SW_OK, right arrow) RB4 Pulled high, Grounded/low when depressed + * + * The Sure DB-DP11212 PIC32 General Purpose Demo Board also has three buttons, + * but these are connected differently: + * + * SW2-1 RF0 Pulled high, Grounded/low when depressed + * SW3-1 RF1 Pulled high, Grounded/low when depressed + * SW5-1 RD6 Pulled high, Grounded/low when depressed + * + * Internal pull-ups are not required since the LEDs are pull-up externally. + * Change notification interrupts are not *automatically* enabled. Change + * notification will be enabled when pic32mx_gpioattach() is called. + */ + +#ifdef CONFIG_ARCH_DBDP11215 +# define GPIO_SW1 (GPIO_INPUT|GPIO_INT|GPIO_PORTB|GPIO_PIN3) +# define GPIO_SW2 (GPIO_INPUT|GPIO_INT|GPIO_PORTB|GPIO_PIN2) +# define GPIO_SW3 (GPIO_INPUT|GPIO_INT|GPIO_PORTB|GPIO_PIN4) +#else /* CONFIG_ARCH_DBDP11212 */ +# define GPIO_SW1 (GPIO_INPUT|GPIO_INT|GPIO_PORTF|GPIO_PIN0) +# define GPIO_SW2 (GPIO_INPUT|GPIO_INT|GPIO_PORTF|GPIO_PIN1) +# define GPIO_SW3 (GPIO_INPUT|GPIO_INT|GPIO_PORTD|GPIO_PIN6) +#endif + +/* Change notification numbers: + * RB3 -> CN5 + * RB2 -> CN2 + * RB4 -> CN6 + */ + +#define CN_SW1 5 +#define CN_SW2 2 +#define CN_SW3 6 + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* Pin configuration for each button */ + +static const uint16_t g_buttonset[NUM_BUTTONS] = +{ + GPIO_SW1 GPIO_SW2, GPIO_SW3 +} + +/* Change notification number for each button */ + +#ifdef CONFIG_ARCH_IRQBUTTONS +static const uint8_t g_buttoncn[NUM_BUTTONS] = +{ + CN_SW1, CN_SW2, CN_SW3 +} +#endif + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_buttoninit + * + * Description: + * up_buttoninit() must be called to initialize button resources. After + * that, up_buttons() may be called to collect the current state of all + * buttons or up_irqbutton() may be called to register button interrupt + * handlers. + * + ****************************************************************************/ + +void up_buttoninit(void) +{ + int i; + + /* Configure input pins */ + + for (i = 0; i < NUM_BUTTONS; i++) + { + pic32mx_configgpio(g_buttonset[i]); + } + + /* Change AN2/AN3/AN4 to digital */ + + putreg32(0xffff, PIC32MX_ADC_CFG); +} + +/**************************************************************************** + * Name: up_buttons + ****************************************************************************/ + +uint8_t up_buttons(void) +{ + uint8_t ret = 0; + int id; + + /* Configure input pins */ + + for (id = 0; id < NUM_BUTTONS; id++) + { + if (pic32mx_gpioread(g_buttonset[id])) + { + ret |= (1 << id); + } + } + + return ret; +} + +/************************************************************************************ + * Button support. + * + * Description: + * up_buttoninit() must be called to initialize button resources. After + * that, up_buttons() may be called to collect the current state of all + * buttons or up_irqbutton() may be called to register button interrupt + * handlers. + * + * After up_buttoninit() has been called, up_buttons() may be called to + * collect the state of all buttons. up_buttons() returns an 8-bit bit set + * with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT + * definitions in board.h for the meaning of each bit. + * + * up_irqbutton() may be called to register an interrupt handler that will + * be called when a button is depressed or released. The ID value is a + * button enumeration value that uniquely identifies a button resource. See the + * BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration + * value. The previous interrupt handler address is returned (so that it may + * restored, if so desired). + * + * Interrupts are automatically enabled when the button handler is attached and + * automatically disabled when the button handler is detached. + * + * When an interrupt occurs, it is due to a change on the GPIO input pin + * associated with the button. In that case, all attached change + * notification handlers will be called. Each handler must maintain state + * and determine if the unlying GPIO button input value changed. + * + ************************************************************************************/ + +#ifdef CONFIG_ARCH_IRQBUTTONS +xcpt_t up_irqbutton(int id, xcpt_t irqhandler) +{ + xcpt_t oldhandler = NULL; + + if (id < NUM_BUTTONS) + { + oldhandler = pic32mx_gpioattach(g_buttonset[id], g_buttoncn[id], irqhandler); + if (irqbuttron) + { + pic32mx_gpioirqenable(g_buttoncn[id]); + } + } + return oldhandler; +} +#endif +#endif /* CONFIG_ARCH_BUTTONS */ diff --git a/nuttx/configs/sure-pic32mx/src/pic32mx_lcd1602.c b/nuttx/configs/sure-pic32mx/src/pic32mx_lcd1602.c new file mode 100644 index 000000000..1c51bb7af --- /dev/null +++ b/nuttx/configs/sure-pic32mx/src/pic32mx_lcd1602.c @@ -0,0 +1,961 @@ +/**************************************************************************** + * configs/sure-pic32mx/src/pic32mx_lcd1602.c + * + * This logic supports the connection of an LCD1602 LCD to the PCB Logic + * PIC32MX board. The LCD1602 is based on the Hitachi HD44780U LCD + * controller + * + * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Authors: 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. + * + ****************************************************************************/ + + /* LCD pin mapping (see configs/pcblogic-pic32mx/README.txt) + * + * --------------------- ---------- ---------------------------------- + * PIC32 Sure JP1 Sure Signal Description + * PIN SIGNAL NAME PIN NAME(s) + * --------------------- ---------- ---------------------------------- + * 34 Vbus 1. +5V +5V VBUS device mode + * To GND via capacitor + * 2. GND GND + * 49 RD1 3. Vo Transistor circuit driven by PWM2 + * 44 PMA0/AN15/RB15 4. RS PMA0, Selects registers + * 53 PMRD/RD5 5. RW PMRD/PMWR, Selects read or write + * 45 PMPCS1/RD11 6. E Starts data read/write + * 60 PMD0/RE0 7. DB0 PMD0 + * 61 PMD1/RE1 8. DB1 PMD1 + * 62 PMD2/RE2 9. DB2 PMD2 + * 63 PMD3/RE3 10. DB3 PMD3 + * 64 PMD4/RE4 11. DB4 PMD4 + * 1 PMD5/RE5 12. DB5 PMD5 + * 2 PMD6/RE6 13. DB6 PMD6 + * 3 PMD7/RE7 14. DB7 PMD7 + * 15. A +5V_DUSB + * 46 INT0/RD0 16. K Transistor circuit driven by PWM1 + * --------------------- ---------- ---------------------------------- + */ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "up_arch.h" +#include "pic32mx-pmp.h" +#include "pic32mx-int.h" +#include "pic32mx-internal.h" +#include "sure-pic32mx.h" + +#ifdef CONFIG_LCD_LCD1602 + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ + +#ifndef CONFIG_PIC32MX_PMP +# error "CONFIG_PIC32MX_PMP is required to use the LCD" +#endif + +/* Define CONFIG_DEBUG_LCD to enable detailed LCD debug output. Verbose debug must + * also be enabled. + */ + +#ifndef CONFIG_DEBUG +# undef CONFIG_DEBUG_VERBOSE +# undef CONFIG_DEBUG_GRAPHICS +# undef CONFIG_DEBUG_LCD +#endif + +#ifndef CONFIG_DEBUG_VERBOSE +# undef CONFIG_DEBUG_LCD +#endif + +/* The ever-present MIN/MAX macros ******************************************/ + +#ifndef MIN +# define MIN(a,b) (a < b ? a : b) +#endif + +#ifndef MAX +# define MAX(a,b) (a > b ? a : b) +#endif + +/* Pin configuration ********************************************************/ +/* RB15, RS -- High values selects data */ + +#define GPIO_LCD_RS (GPIO_OUTPUT|GPIO_VALUE_ZERO|GPIO_PORTB|GPIO_PIN15) + +/* LCD **********************************************************************/ + +#define LCD_NROWS 2 +#define LCD_NCOLUMNS 16 +#define LCD_NCHARS (LCD_NROWS * LCD_NCOLUMNS) + +/* Debug ********************************************************************/ + +#ifdef CONFIG_DEBUG_LCD +# define lcddbg dbg +# define lcdvdbg vdbg +#else +# define lcddbg(x...) +# define lcdvdbg(x...) +#endif + +/**************************************************************************** + * Private Type Definition + ****************************************************************************/ + +/* SLCD incoming stream structure */ + +struct lcd_instream_s +{ + struct lib_instream_s stream; + FAR const char *buffer; + ssize_t nbytes; +}; + +/* Global LCD state */ + +struct lcd1602_2 +{ + bool initialized; /* True: Completed initialization sequence */ + uint8_t currow; /* Current row */ + uint8_t curcol; /* Current column */ +}; + +/**************************************************************************** + * Private Function Protototypes + ****************************************************************************/ +/* Debug */ + + #if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_VERBOSE) +static void lcd_dumpstate(FAR const char *msg); +static void lcd_dumpstream(FAR const char *msg, + FAR const struct lcd_instream_s *stream); +#else +# define lcd_dumpstate(msg) +# define lcd_dumpstream(msg, stream) +#endif + +/* Internal functions */ + +static int lcd_getstream(FAR struct lib_instream_s *instream); +static void lcd_wrcommand(uint8_t cmd); +static void lcd_wrdata(uint8_t data); +static uint8_t lcd_rddata(void); +static uint8_t lcd_readch(uint8_t row, uint8_t column); +static void lcd_writech(uint8_t ch, uint8_t row, uint8_t column); +static void lcd_appendch(uint8_t ch); +static void lcd_action(enum slcdcode_e code, uint8_t count); + +/* Character driver operations */ + +static ssize_t lcd_read(FAR struct file *, FAR char *, size_t); +static ssize_t lcd_write(FAR struct file *, FAR const char *, size_t); +static int lcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg); +#ifndef CONFIG_DISABLE_POLL +static int lcd_poll(FAR struct file *filp, FAR struct pollfd *fds, bool setup); +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* Character driver operations */ + +static const struct file_operations g_lcdops = +{ + 0, /* open */ + 0, /* close */ + lcd_read, /* read */ + lcd_write, /* write */ + 0, /* seek */ + lcd_ioctl /* ioctl */ +#ifndef CONFIG_DISABLE_POLL + , lcd_poll /* poll */ +#endif +}; + +/* This is the driver state structure */ + +static struct lcd1602_2 g_lcd1602; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: lcd_dumpstate + ****************************************************************************/ + +#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_VERBOSE) +static void lcd_dumpstate(FAR const char *msg) +{ + uint8_t buffer[LCD_NCOLUMNS]; + uint8_t ch; + int row; + int column; + + lcdvdbg("%s:\n", msg); + lcdvdbg(" currow: %d curcol: %d\n", + g_lcd1602.currow, g_lcd1602.curcol); + + for (row = 0, column = 0; row < LCD_NROWS; ) + { + ch = lcd_readch(row, column); + buffer[column] = isprint(ch) ? ch : '.'; + if (++column >= LCD_NCOLUMNS) + { + lcdvdbg(" [%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c]\n", + buffer[0], buffer[1], buffer[2], buffer[3], + buffer[4], buffer[5], buffer[6], buffer[7], + buffer[8], buffer[9], buffer[10], buffer[11], + buffer[12], buffer[13], buffer[14], buffer[15]); + + column = 0; + row++; + } + } +} +#endif + +/**************************************************************************** + * Name: lcd_dumpstate + ****************************************************************************/ + +#if defined(CONFIG_DEBUG_LCD) && defined(CONFIG_DEBUG_VERBOSE) +static void lcd_dumpstream(FAR const char *msg, + FAR const struct lcd_instream_s *stream) +{ + lcdvdbg("%s:\n", msg); + lcdvdbg(" nget: %d nbytes: %d\n", + stream->stream.nget, stream->nbytes); + lib_dumpbuffer("STREAM", stream->buffer, stream->nbytes); +} +#endif + +/**************************************************************************** + * Name: lcd_getstream + * + * Description: + * Get one character from the keyboard. + * + ****************************************************************************/ + +static int lcd_getstream(FAR struct lib_instream_s *instream) +{ + FAR struct lcd_instream_s *lcdstream = (FAR struct lcd_instream_s *)instream; + + DEBUGASSERT(lcdstream && lcdstream->buffer); + if (lcdstream->nbytes > 0) + { + lcdstream->nbytes--; + lcdstream->stream.nget++; + return (int)*lcdstream->buffer++; + } + + return EOF; +} + +/**************************************************************************** + * Name: lcd_wrcommand + * + * Description: + * Configure to write an LCD command + * + ****************************************************************************/ + +static void lcd_wrcommand(uint8_t cmd) +{ + /* Address bit A0 is RS. Set the address latch to A0=0 */ + + putreg32(1, PIC32MX_PMP_ADDRCLR); + + /* And write the command to the data out register */ + + putreg32((uint32_t)cmd, PIC32MX_PMP_DOUT); +} + +/**************************************************************************** + * Name: lcd_wrdata + * + * Description: + * Configure to read or write LCD data + * + ****************************************************************************/ + +static void lcd_wrdata(uint8_t data) +{ + /* Address bit A0 is RS. Set the address latch to A0=1 */ + + putreg32(1, PIC32MX_PMP_ADDRSET); + + /* And write the data to the data out register */ + + putreg32((uint32_t)data, PIC32MX_PMP_DOUT); +} + +/**************************************************************************** + * Name: lcd_rddata + * + * Description: + * Configure to read or write LCD data + * + ****************************************************************************/ + +static uint8_t lcd_rddata(void) +{ + /* Address bit A0 is RS. Set the address latch to A0=1 */ + + putreg32(1, PIC32MX_PMP_ADDRSET); + + /* And read the data to the data in register */ + + return (uint8_t)getreg32(PIC32MX_PMP_DIN); +} + +/**************************************************************************** + * Name: lcd_readch + ****************************************************************************/ + +static uint8_t lcd_readch(uint8_t row, uint8_t column) +{ + uint8_t addr; + + /* Set the cursor position. Internally, the HD44780U supports a display + * size of up to 2x40 addressed as follows: + * + * Column 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ... 39 + * Row 0 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ... 27 + * Ro1 1 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f ... 67 + */ + + addr = column; + if (row > 0) + { + addr |= HD4478OU_DDRAM_ROW1; + } + + lcd_wrcommand(HD4478OU_DDRAM_AD(addr)); + + /* And write the character here */ + + return lcd_rddata(); +} + +/**************************************************************************** + * Name: lcd_writech + ****************************************************************************/ + +static void lcd_writech(uint8_t ch, uint8_t row, uint8_t column) +{ + uint8_t addr; + + /* Set the cursor position. Internally, the HD44780U supports a display + * size of up to 2x40 addressed as follows: + * + * Column 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ... 39 + * Row 0 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ... 27 + * Ro1 1 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f ... 67 + */ + + addr = column; + if (row > 0) + { + addr |= HD4478OU_DDRAM_ROW1; + } + + lcd_wrcommand(HD4478OU_DDRAM_AD(addr)); + + /* And write the character here */ + + lcd_wrdata(ch); +} + +/**************************************************************************** + * Name: lcd_appendch + ****************************************************************************/ + +static void lcd_appendch(uint8_t ch) +{ + if (g_lcd1602.curcol < LCD_NCOLUMNS) + { + lcd_writech(ch, g_lcd1602.currow, g_lcd1602.curcol); + g_lcd1602.curcol++; + } +} + +/**************************************************************************** + * Name: lcd_action + ****************************************************************************/ + +static void lcd_action(enum slcdcode_e code, uint8_t count) +{ + lcdvdbg("Action: %d count: %d\n", code, count); + lcd_dumpstate("BEFORE ACTION"); + + switch (code) + { + /* Erasure */ + + case SLCDCODE_BACKDEL: /* Backspace (backward delete) N characters */ + { + int tmp; + + /* If we are at the home position or if the count is zero, then ignore the action */ + + if (g_lcd1602.curcol < 1 || count < 1) + { + break; + } + + /* Otherwise, BACKDEL is like moving the cursor back N characters then doing a + * forward deletion. Decrement the cursor position and fall through. + */ + + tmp = (int)g_lcd1602.curcol - count; + if (tmp < 0) + { + tmp = 0; + count = g_lcd1602.curcol; + } + + /* Save the updated cursor positions */ + + g_lcd1602.curcol = tmp; + } + + case SLCDCODE_FWDDEL: /* DELete (forward delete) N characters moving text */ + if (count > 0) + { + int nchars; + int nmove; + int i; + + /* How many characters are to the right of the cursor position + * (including the one at the cursor position)? Then get the + * number of characters to move. + */ + + nchars = LCD_NCOLUMNS - g_lcd1602.curcol; + nmove = MIN(nchars, count) - 1; + + /* Move all characters after the current cursor position left by 'nmove' characters */ + + for (i = g_lcd1602.curcol + nmove; i < LCD_NCOLUMNS - 1; i++) + { + uint8_t ch = lcd_readch(g_lcd1602.currow, i); + lcd_writech(ch, g_lcd1602.currow, i - nmove); + } + + /* Erase the last 'nmove' characters on the display */ + + for (i = LCD_NCOLUMNS - nmove; i < LCD_NCOLUMNS; i++) + { + lcd_writech(' ', i, 0); + } + } + break; + + case SLCDCODE_ERASE: /* Erase N characters from the cursor position */ + if (count > 0) + { + int last; + int i; + + /* Get the last position to clear and make sure that the last + * position is on the SLCD. + */ + + last = g_lcd1602.curcol + count - 1; + if (last >= LCD_NCOLUMNS) + { + last = LCD_NCOLUMNS - 1; + } + + /* Erase N characters after the current cursor position left by one */ + + for (i = g_lcd1602.curcol; i < last; i++) + { + lcd_writech(' ', g_lcd1602.currow, i); + } + } + break; + + case SLCDCODE_CLEAR: /* Home the cursor and erase the entire display */ + { + /* Clear the display */ + + lcd_wrcommand(HD4478OU_CLEAR); + + /* And home the cursor */ + + g_lcd1602.currow = 0; + g_lcd1602.curcol = 0; + } + break; + + case SLCDCODE_ERASEEOL: /* Erase from the cursor position to the end of line */ + { + int i; + + /* Erase characters after the current cursor position to the end of the line */ + + for (i = g_lcd1602.curcol; i < LCD_NCOLUMNS; i++) + { + lcd_writech(' ', g_lcd1602.currow, i); + } + } + break; + + /* Cursor movement */ + + case SLCDCODE_HOME: /* Cursor home */ + { + g_lcd1602.currow = 0; + g_lcd1602.curcol = 0; + } + break; + + case SLCDCODE_END: /* Cursor end */ + { + g_lcd1602.curcol = LCD_NCOLUMNS - 1; + } + break; + + case SLCDCODE_LEFT: /* Cursor left by N characters */ + { + int tmp = (int)g_lcd1602.curcol - count; + + /* Don't permit movement past the beginning of the SLCD */ + + if (tmp < 0) + { + tmp = 0; + } + + /* Save the new cursor position */ + + g_lcd1602.curcol = (uint8_t)tmp; + } + break; + + case SLCDCODE_RIGHT: /* Cursor right by N characters */ + { + int tmp = (int)g_lcd1602.curcol + count; + + /* Don't permit movement past the end of the SLCD */ + + if (tmp >= LCD_NCOLUMNS) + { + tmp = LCD_NCOLUMNS - 1; + } + + /* Save the new cursor position */ + + g_lcd1602.curcol = (uint8_t)tmp; + } + break; + + case SLCDCODE_UP: /* Cursor up by N lines */ + { + int tmp = (int)g_lcd1602.currow - count; + + /* Don't permit movement past the top of the SLCD */ + + if (tmp < 0) + { + tmp = 0; + } + + /* Save the new cursor position */ + + g_lcd1602.currow = (uint8_t)tmp; + } + break; + + case SLCDCODE_DOWN: /* Cursor down by N lines */ + { + int tmp = (int)g_lcd1602.currow + count; + + /* Don't permit movement past the bottom of the SLCD */ + + if (tmp >= LCD_NROWS) + { + tmp = LCD_NROWS - 1; + } + + /* Save the new cursor position */ + + g_lcd1602.currow = (uint8_t)tmp; + } + break; + + case SLCDCODE_PAGEUP: /* Cursor up by N pages */ + case SLCDCODE_PAGEDOWN: /* Cursor down by N pages */ + break; /* Not supportable on this SLCD */ + + /* Blinking */ + + case SLCDCODE_BLINKSTART: /* Start blinking with current cursor position */ + case SLCDCODE_BLINKEND: /* End blinking after the current cursor position */ + case SLCDCODE_BLINKOFF: /* Turn blinking off */ + break; /* Not implemented */ + + /* These are actually unreportable errors */ + + default: + case SLCDCODE_NORMAL: /* Not a special keycode */ + break; + } + + lcd_dumpstate("AFTER ACTION"); +} + +/**************************************************************************** + * Name: lcd_read + ****************************************************************************/ + +static ssize_t lcd_read(FAR struct file *filp, FAR char *buffer, size_t len) +{ + uint8_t row; + uint8_t column; + int nread; + + /* Try to read the entire display. Notice that the seek offset + * (filp->f_pos) is ignored. It probably should be taken into account + * and also updated after each read and write. + */ + + row = 0; + column = 0; + + for (nread = 0; nread < len; nread++) + { + *buffer++ = lcd_readch(row, column); + if (++column >= LCD_NCOLUMNS) + { + column = 0; + if (++row >= LCD_NROWS) + { + break; + } + } + } + + return nread; +} + +/**************************************************************************** + * Name: lcd_write + ****************************************************************************/ + +static ssize_t lcd_write(FAR struct file *filp, FAR const char *buffer, + size_t len) +{ + struct lcd_instream_s instream; + struct slcdstate_s state; + enum slcdret_e result; + uint8_t ch; + uint8_t count; + + /* Initialize the stream for use with the SLCD CODEC */ + + instream.stream.get = lcd_getstream; + instream.stream.nget = 0; + instream.buffer = buffer; + instream.nbytes = len; + + lcd_dumpstream("BEFORE WRITE", &instream); + + /* Now decode and process every byte in the input buffer */ + + memset(&state, 0, sizeof(struct slcdstate_s)); + while ((result = slcd_decode(&instream.stream, &state, &ch, &count)) != SLCDRET_EOF) + { + lcdvdbg("slcd_decode returned result=%d char=%d count=%d\n", + result, ch, count); + + if (result == SLCDRET_CHAR) /* A normal character was returned */ + { + /* Check for ASCII control characters */ + + if (ch < ASCII_SPACE) + { + /* All are ignored except for backspace and carriage return */ + + if (ch == ASCII_BS) + { + /* Perform the backward deletion */ + + lcd_action(SLCDCODE_BACKDEL, 1); + } + else if (ch == ASCII_CR) + { + /* Perform the carriage return */ + + g_lcd1602.curcol = 0; + lcd_action(SLCDCODE_DOWN, 1); + } + } + + /* Handle ASCII_DEL */ + + else if (ch == ASCII_DEL) + { + /* Perform the forward deletion */ + + lcd_action(SLCDCODE_FWDDEL, 1); + } + + /* The rest of the 7-bit ASCII characters are fair game */ + + else if (ch < 128) + { + /* Write the character if it valid */ + + lcd_appendch(ch); + } + } + else /* (result == SLCDRET_SPEC) */ /* A special SLCD action was returned */ + { + /* Then Perform the action */ + + lcd_action((enum slcdcode_e)ch, count); + } + } + + /* Assume that the entire input buffer was processed */ + + lcd_dumpstream("AFTER WRITE", &instream); + return (ssize_t)len; +} + +/**************************************************************************** + * Name: lcd_ioctl + ****************************************************************************/ + +static int lcd_ioctl(FAR struct file *filp, int cmd, unsigned long arg) +{ + switch (cmd) + { + + /* SLCDIOC_GEOMETRY: Get the SLCD geometry (rows x characters) + * + * argument: Pointer to struct slcd_geometry_s in which values will be + * returned + */ + + case SLCDIOC_GEOMETRY: + { + FAR struct slcd_geometry_s *geo = (FAR struct slcd_geometry_s *)((uintptr_t)arg); + + lcdvdbg("SLCDIOC_GEOMETRY: nrows=%d ncolumns=%d\n", LCD_NROWS, LCD_NCOLUMNS); + + if (!geo) + { + return -EINVAL; + } + + geo->nrows = LCD_NROWS; + geo->ncolumns = LCD_NCOLUMNS; + geo->nbars = 0; + } + break; + + /* SLCDIOC_CURPOS: Get the SLCD cursor positioni (rows x characters) + * + * argument: Pointer to struct slcd_curpos_s in which values will be + * returned + */ + + + case SLCDIOC_CURPOS: + { + FAR struct slcd_curpos_s *curpos = (FAR struct slcd_curpos_s *)((uintptr_t)arg); + + lcdvdbg("SLCDIOC_CURPOS: row=%d column=%d\n", g_lcd1602.currow, g_lcd1602.curcol); + + if (!curpos) + { + return -EINVAL; + } + + curpos->row = g_lcd1602.currow; + curpos->column = g_lcd1602.curcol; + } + break; + + case SLCDIOC_SETBAR: /* SLCDIOC_SETBAR: Set bars on a bar display */ + case SLCDIOC_GETCONTRAST: /* SLCDIOC_GETCONTRAST: Get the current contrast setting */ + case SLCDIOC_MAXCONTRAST: /* SLCDIOC_MAXCONTRAST: Get the maximum contrast setting */ + case SLCDIOC_SETCONTRAST: /* SLCDIOC_SETCONTRAST: Set the contrast to a new value */ + default: + return -ENOTTY; + } + + return OK; +} + +/**************************************************************************** + * Name: lcd_poll + ****************************************************************************/ + +#ifndef CONFIG_DISABLE_POLL +static int lcd_poll(FAR struct file *filp, FAR struct pollfd *fds, + bool setup) +{ + if (setup) + { + /* Data is always avaialble to be read */ + + fds->revents |= (fds->events & (POLLIN|POLLOUT)); + if (fds->revents != 0) + { + sem_post(fds->sem); + } + } + return OK; +} +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_lcd1602_initialize + * + * Description: + * Initialize the LCD1602 hardware and register the character driver as + * /dev/lcd1602. Prototype is in include/nuttx/lcd/hd4478ou.h. + * + ****************************************************************************/ + +int up_lcd1602_initialize(void) +{ + uint32_t regval; + int ret = OK; + + /* Only initialize the driver once. */ + + if (!g_lcd1602.initialized) + { + lcdvdbg("Initializing\n"); + + /* PMP Master mode configuration */ + /* Make sure that interrupts are disabled */ + + putreg32(INT_PMP, PIC32MX_INT_IEC1CLR); + + /* Stop and reset the PMP module and clear the mode and control registers. */ + + putreg32(0, PIC32MX_PMP_MODE); + putreg32(0, PIC32MX_PMP_AEN); + putreg32(0, PIC32MX_PMP_CON); + putreg32(0, PIC32MX_PMP_ADDR); + + /* Set LCD timing values, PMP master mode 3, 8-bit mode, no address + * increment, and no interrupts. + */ + + regval = (PMP_MODE_WAITE_RD(0) | PMP_MODE_WAITM(3) | PMP_MODE_WAITB_1TPB | + PMP_MODE_MODE_MODE1 | PMP_MODE_MODE8 | PMP_MODE_INCM_NONE | + PMP_MODE_IRQM_NONE); + putreg32(regval, PIC32MX_PMP_MODE); + + /* Enable the PMP for reading and writing + * PMRD/PMWR is active high (1=RD; 0=WR) + * PMENB is active high. + * No chip selects + * Address latch is active high + * Enable PMRD/PMWR, PMENB, and the PMP. + */ + + + regval = (PMP_CON_RDSP | PMP_CON_WRSP | PMP_CON_ALP | + PMP_CON_CSF_ADDR1415 | PMP_CON_PTRDEN | PMP_CON_PTWREN | + PMP_CON_ADRMUX_NONE | PMP_CON_ON); + putreg32(regval, PIC32MX_PMP_CON); + + /* Configure and enable the LCD */ + /* Wait > 15 milliseconds afer Vdd > 4.5V */ + + up_mdelay(100); + + /* Select the 8-bit interface. BF cannot be checked before this command. + * This needs to be done a few times with some magic delays. + */ + + lcd_wrcommand(HD4478OU_FUNC | HD4478OU_FUNC_DL8D | HD4478OU_FUNC_N1); + up_mdelay(50); + lcd_wrcommand(HD4478OU_FUNC | HD4478OU_FUNC_DL8D | HD4478OU_FUNC_N1); + up_udelay(50); + lcd_wrcommand(HD4478OU_FUNC | HD4478OU_FUNC_DL8D | HD4478OU_FUNC_N1); + lcd_wrcommand(HD4478OU_FUNC | HD4478OU_FUNC_DL8D | HD4478OU_FUNC_N1); + + /* Configure the display */ + + lcd_wrcommand(HD4478OU_DISPLAY); /* Display, cursor, and blink off */ + lcd_wrcommand(HD4478OU_CLEAR); /* Clear the display */ + lcd_wrcommand(HD4478OU_INPUT | HD4478OU_INPUT_INCR); /* Increment mode */ + lcd_wrcommand(HD4478OU_DISPLAY | HD4478OU_DISPLAY_ON); /* Display on, cursor and blink off */ + lcd_wrcommand(HD4478OU_DDRAM_AD(0)); /* Select DDRAM RAM AD=0 */ + + /* Register the LCD device driver */ + + ret = register_driver("/dev/lcd1602", &g_lcdops, 0644, &g_lcd1602); + g_lcd1602.initialized = true; + } + + return ret; +} + +#endif /* CONFIG_LCD_LCD1602 */ diff --git a/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c b/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c new file mode 100644 index 000000000..9aef56313 --- /dev/null +++ b/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c @@ -0,0 +1,372 @@ +/**************************************************************************** + * config/sure-pic32mx/src/pic32mx_nsh.c + * + * Copyright (C) 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 + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "pic32mx-internal.h" +#include "sure-pic32mx.h" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/* Configuration ************************************************************/ + +/* PORT and SLOT number probably depend on the board configuration */ + +#define NSH_HAVEMMCSD 1 +#define NSH_HAVEUSBHOST 1 + +/* Can't support MMC/SD if SPI2 is not enabled */ + +#ifndef CONFIG_PIC32MX_SPI2 +# undef NSH_HAVEMMCSD +#endif + +/* Can't support MMC/SD features if mountpoints are disabled */ + +#if defined(CONFIG_DISABLE_MOUNTPOINT) +# undef NSH_HAVEMMCSD +#endif + +/* MMC/SD configuration */ + +#ifdef NSH_HAVEMMCSD +# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 2 +# warning "The Sure PIC32MX MMC/SD is on SPI2" +# undef CONFIG_NSH_MMCSDSPIPORTNO +# define CONFIG_NSH_MMCSDSPIPORTNO 2 +# endif +# if !defined(CONFIG_NSH_MMCSDSLOTNO) || CONFIG_NSH_MMCSDSLOTNO != 0 +# error "The Sure PIC32MX MMC/SD has only one slot (0)" +# warning CONFIG_NSH_MMCSDSLOTNO +# define CONFIG_NSH_MMCSDSLOTNO 0 +# endif +# ifndef CONFIG_NSH_MMCSDMINOR +# define CONFIG_NSH_MMCSDMINOR 0 +# endif +#endif + +/* USB Host */ + +#ifdef CONFIG_USBHOST +# ifndef CONFIG_PIC32MX_USBHOST +# warning "CONFIG_PIC32MX_USBHOST is not selected" +# undef CONFIG_USBHOST +# endif +#endif + +#ifdef CONFIG_PIC32MX_USBHOST +# ifndef CONFIG_USBHOST +# warning "CONFIG_USBHOST is not selected" +# undef CONFIG_PIC32MX_USBHOST +# endif +#endif + +#if !defined(CONFIG_USBHOST) || !defined(CONFIG_PIC32MX_USBHOST) +# undef NSH_HAVEUSBHOST +#endif + +#ifdef NSH_HAVEUSBHOST +# ifndef CONFIG_USBHOST_DEFPRIO +# define CONFIG_USBHOST_DEFPRIO 50 +# endif +# ifndef CONFIG_USBHOST_STACKSIZE +# define CONFIG_USBHOST_STACKSIZE 1024 +# endif +#endif + +/* Debug ********************************************************************/ + +#ifdef CONFIG_CPP_HAVE_VARARGS +# ifdef CONFIG_DEBUG +# define message(...) lowsyslog(__VA_ARGS__) +# else +# define message(...) printf(__VA_ARGS__) +# endif +#else +# ifdef CONFIG_DEBUG +# define message lowsyslog +# else +# define message printf +# endif +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +#ifdef NSH_HAVEUSBHOST +static struct usbhost_driver_s *g_drvr; +#endif + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: nsh_waiter + * + * Description: + * Wait for USB devices to be connected. + * + ****************************************************************************/ + +#ifdef NSH_HAVEUSBHOST +static int nsh_waiter(int argc, char *argv[]) +{ + bool connected = false; + int ret; + + message("nsh_waiter: Running\n"); + for (;;) + { + /* Wait for the device to change state */ + + ret = DRVR_WAIT(g_drvr, connected); + DEBUGASSERT(ret == OK); + + connected = !connected; + message("nsh_waiter: %s\n", connected ? "connected" : "disconnected"); + + /* Did we just become connected? */ + + if (connected) + { + /* Yes.. enumerate the newly connected device */ + + (void)DRVR_ENUMERATE(g_drvr); + } + } + + /* Keep the compiler from complaining */ + + return 0; +} +#endif + +/**************************************************************************** + * Name: nsh_sdinitialize + * + * Description: + * Initialize SPI-based microSD. + * + ****************************************************************************/ + +#ifdef NSH_HAVEMMCSD +static int nsh_sdinitialize(void) +{ + FAR struct spi_dev_s *spi; + int ret; + + /* Get the SPI port */ + + spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO); + if (!spi) + { + message("nsh_archinitialize: Failed to initialize SPI port %d\n", + CONFIG_NSH_MMCSDSPIPORTNO); + ret = -ENODEV; + goto errout; + } + + message("Successfully initialized SPI port %d\n", + CONFIG_NSH_MMCSDSPIPORTNO); + + /* The SPI should be in 8-bit (default) and mode2: CKP=1, CKE=0. + * The MMC/SD driver will control the SPI frequency. WARNING: + * this is not the right way to do this... this should be done + * the MMC/SD driver: Other device on SPI1 may need other mode + * settings. + */ + + SPI_SETMODE(spi, SPIDEV_MODE2); + + /* Bind the SPI port to the slot */ + + ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, + CONFIG_NSH_MMCSDSLOTNO, spi); + if (ret < 0) + { + message("nsh_sdinitialize: " + "Failed to bind SPI port %d to MMC/SD slot %d: %d\n", + CONFIG_NSH_MMCSDSPIPORTNO, + CONFIG_NSH_MMCSDSLOTNO, ret); + goto errout; + } + + message("Successfuly bound SPI port %d to MMC/SD slot %d\n", + CONFIG_NSH_MMCSDSPIPORTNO, + CONFIG_NSH_MMCSDSLOTNO); + return OK; + +errout: + return ret; +} +#else +# define nsh_sdinitialize() (OK) +#endif + +/**************************************************************************** + * Name: nsh_usbhostinitialize + * + * Description: + * Initialize USB Host + * + ****************************************************************************/ + +#ifdef NSH_HAVEUSBHOST +static int nsh_usbhostinitialize(void) +{ + int pid; + int ret; + + /* First, register all of the class drivers needed to support the drivers + * that we care about: + */ + + message("nsh_usbhostinitialize: Register class drivers\n"); + ret = usbhost_storageinit(); + if (ret != OK) + { + message("nsh_usbhostinitialize: Failed to register the mass storage class\n"); + } + + /* Then get an instance of the USB host interface */ + + message("nsh_usbhostinitialize: Initialize USB host\n"); + g_drvr = usbhost_initialize(0); + if (g_drvr) + { + /* Start a thread to handle device connection. */ + + message("nsh_usbhostinitialize: Start nsh_waiter\n"); + +#ifndef CONFIG_CUSTOM_STACK + pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO, + CONFIG_USBHOST_STACKSIZE, + (main_t)nsh_waiter, (FAR char * const *)NULL); +#else + pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO, + (main_t)nsh_waiter, (FAR char * const *)NULL); +#endif + return pid < 0 ? -ENOEXEC : OK; + } + return -ENODEV; +} +#else +# define nsh_usbhostinitialize() (OK) +#endif + +/**************************************************************************** + * Name: nsh_usbdevinitialize + * + * Description: + * Initialize SPI-based microSD. + * + ****************************************************************************/ + +#ifdef CONFIG_USBDEV +static int nsh_usbdevinitialize(void) +{ + /* The Sure board has no way to know when the USB is connected. So we + * will fake it and tell the USB driver that the USB is connected now. + */ + + pic32mx_usbattach(); + return OK; +} +#else +# define nsh_usbdevinitialize() (OK) +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: nsh_archinitialize + * + * Description: + * Perform architecture specific initialization + * + ****************************************************************************/ + +int nsh_archinitialize(void) +{ + int ret; + + /* Initialize the LCD1602 and register the device as /dev/lcd1602 */ + +#ifdef CONFIG_LCD_LCD1602 + ret = up_lcd1602_initialize(); + if (ret == OK) +#endif + { + /* Initialize SPI-based microSD */ + + ret = nsh_sdinitialize(); + } + + if (ret == OK) + { + /* Initialize USB host */ + + ret = nsh_usbhostinitialize(); + } + + if (ret == OK) + { + /* Initialize USB device */ + + ret = nsh_usbdevinitialize(); + } + + return ret; +} diff --git a/nuttx/configs/sure-pic32mx/src/pic32mx_spi.c b/nuttx/configs/sure-pic32mx/src/pic32mx_spi.c new file mode 100644 index 000000000..95c3440a4 --- /dev/null +++ b/nuttx/configs/sure-pic32mx/src/pic32mx_spi.c @@ -0,0 +1,271 @@ +/************************************************************************************ + * configs/sure-pic32mx/src/pic32mx_spi.c + * + * Copyright (C) 2011-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 + +#include +#include +#include + +#include +#include + +#include "up_arch.h" +#include "chip.h" +#include "pic32mx-internal.h" +#include "sure-pic32mx.h" + +#if defined(CONFIG_PIC32MX_SPI2) + +/************************************************************************************ + * Definitions + ************************************************************************************/ + +#ifdef CONFIG_ARCH_DBDP11215 + +/* The Sure DB_DP11215 PIC32 Storage Demo Board has an SD slot connected on SPI2: + * + * SCK2/PMA5/CN8/RG6 SCK SD connector SCK, FLASH (U1) SCK* + * SDI2/PMA4/CN9/RG7 SDI SD connector DO, FLASH (U1) SO* + * SDO2/PMA3/CN10/RG8 SDO SD connector DI, FLASH (U1) SI* + * + * Chip Select. Pulled up on-board + * TDO/AN11/PMA12/RB11 SD_CS SD connector CS + * + * Status inputs. All pulled up on-board + * + * TCK/AN12/PMA11/RB12 SD_CD SD connector CD + * TDI/AN13/PMA10/RB13 SD_WD SD connector WD + */ + +# define PIC32_HAVE_SD 1 + +# define GPIO_SD_CS (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTB|GPIO_PIN11) +# define GPIO_SD_CD (GPIO_INPUT|GPIO_INT|GPIO_PORTB|GPIO_PIN12) +# define GPIO_SD_WD (GPIO_INPUT|GPIO_PORTB|GPIO_PIN13) + +/* The Sure DB_DP11215 PIC32 Storage Demo Board has pads an SOIC (Flash or + * EEPROM) connected on SPI2, however, U4 is not populated on my board. + * + * + * TMS/AN10/CVREFOUT/PMA13/RB10 UTIL_WP FLASH (U1) WP + * SS2/PMA2/CN11/RG9 UTIL_CS FLASH (U1) CS + */ + +# undef PIC32_HAVE_SOIC + +# define GPIO_SOIC_WP (GPIO_INPUT|GPIO_PORTB|GPIO_PIN10) +# define GPIO_SOIC_CS (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTG|GPIO_PIN0) + +/* Change notification numbers -- Not available for SD_CD. */ + +#endif + +#ifdef CONFIG_ARCH_DBDP11212 + +/* The Sure DB-DP11212 PIC32 General Purpose Demo Board does not have an + * SD slot. + */ + +# undef PIC32_HAVE_SD + + /* The Sure DB-DP11212 PIC32 General Purpose Demo Board has an SOIC (Flash or + * EEPROM) connected on SPI2: + * + * + * TMS/AN10/PMA13/RB10 UTIL_WP FLASH (U4) WP + * TDO/AN11/PMA12/RB11 UTIL_CS FLASH (U4) CS + */ + +# define PIC32_HAVE_SOIC 1 + +# define GPIO_SOIC_WP (GPIO_INPUT|GPIO_PORTB|GPIO_PIN10) +# define GPIO_SOIC_CS (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTB|GPIO_PIN11) +#endif + +/* The following enable debug output from this file. + * + * CONFIG_DEBUG_SPI && CONFIG_DEBUG - Define to enable basic SPI debug + * CONFIG_DEBUG_VERBOSE - Define to enable verbose SPI debug + */ + +#ifndef CONFIG_DEBUG +# undef CONFIG_DEBUG_SPI +# undef CONFIG_DEBUG_VERBOSE +#endif + +#ifdef CONFIG_DEBUG_SPI +# define spidbg lldbg +# ifdef CONFIG_DEBUG_VERBOSE +# define spivdbg lldbg +# else +# define spivdbg(x...) +# endif +#else +# define spidbg(x...) +# define spivdbg(x...) +#endif + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: pic32mx_spiinitialize + * + * Description: + * Called to configure SPI chip select GPIO pins for the Sure PIC32MX board. + * + ************************************************************************************/ + +void weak_function pic32mx_spiinitialize(void) +{ + /* Configure the SPI2 chip select (CS) GPIO output, and the card detect (CD) and + * write protect (WP) inputs. + */ + +#ifdef PIC32_HAVE_SD + pic32mx_configgpio(GPIO_SD_CS); + pic32mx_configgpio(GPIO_SD_CD); + pic32mx_configgpio(GPIO_SD_WD); +#endif + +#ifdef PIC32_HAVE_SOIC + pic32mx_configgpio(GPIO_SOIC_WP); + pic32mx_configgpio(GPIO_SOIC_CS); +#endif +} + +/************************************************************************************ + * Name: pic32mx_spi2select and pic32mx_spi2status + * + * Description: + * The external functions, pic32mx_spi2select and pic32mx_spi2status + * must be provided by board-specific logic. They are implementations of the select + * and status methods of the SPI interface defined by struct spi_ops_s (see + * include/nuttx/spi.h). All other methods (including up_spiinitialize()) + * are provided by common PIC32MX logic. To use this common SPI logic on your + * board: + * + * 1. Provide logic in pic32mx_boardinitialize() to configure SPI/SPI chip select + * pins. + * 2. Provide pic32mx_spi2select() and pic32mx_spi2status() functions + * in your board-specific logic. These functions will perform chip selection + * and status operations using GPIOs in the way your board is configured. + * 3. Add a calls to up_spiinitialize() in your low level application + * initialization logic + * 4. The handle returned by up_spiinitialize() may then be used to bind the + * SPI driver to higher level logic (e.g., calling + * mmcsd_spislotinitialize(), for example, will bind the SPI driver to + * the SPI MMC/SD driver). + * + ************************************************************************************/ + +#ifdef CONFIG_PIC32MX_SPI2 +void pic32mx_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) +{ + spivdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + + /* The SD card chip select is pulled high and active low */ + +#ifdef PIC32_HAVE_SD + if (devid == SPIDEV_MMCSD) + { + pic32mx_gpiowrite(GPIO_SD_CS, !selected); + } +#endif + +#ifdef PIC32_HAVE_SOIC + if (devid == SPIDEV_FLASH) + { + pic32mx_gpiowrite(GPIO_SOIC_CS, !selected); + } +#endif +} + +uint8_t pic32mx_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) +{ + uint8_t ret = 0; + + /* Card detect is pull up on-board. If a low value is sensed then the + * card must be present. + */ + +#ifdef PIC32_HAVE_SD + if (devid == SPIDEV_MMCSD) + { + if (!pic32mx_gpioread(GPIO_SD_CD)) + { + ret = SPI_STATUS_PRESENT; + + /* It seems that a high value indicates the the card is write + * protected. + */ + + if (pic32mx_gpioread(GPIO_SD_WD)) + { + ret |= SPI_STATUS_WRPROTECTED; + } + } + } +#endif + +#ifdef PIC32_HAVE_SOIC + if (devid == SPIDEV_FLASH) + { + ret = SPI_STATUS_PRESENT; + + /* Write protect is indicated with a low value. */ + + if (pic32mx_gpioread(GPIO_SOIC_WP)) + { + ret |= SPI_STATUS_WRPROTECTED; + } + } +#endif + + spivdbg("Returning %d\n", ret); + return ret; +} +#endif +#endif /* CONFIG_PIC32MX_SPI2 */ diff --git a/nuttx/configs/sure-pic32mx/src/pic32mx_usbdev.c b/nuttx/configs/sure-pic32mx/src/pic32mx_usbdev.c new file mode 100644 index 000000000..d8230d427 --- /dev/null +++ b/nuttx/configs/sure-pic32mx/src/pic32mx_usbdev.c @@ -0,0 +1,174 @@ +/************************************************************************************ + * configs/sure-pic32mx/src/pic32mx_usbdev.c + * + * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * References: + * - Sample code and schematics provided with the Sure Electronics PIC32 board. + * + * 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 "pic32mx-internal.h" +#include "sure-pic32mx.h" + +#if defined(CONFIG_PIC32MX_USBDEV) + +/************************************************************************************ + * Definitions + ************************************************************************************/ +/* The Sure DB_DP11215 PIC32 Storage Demo Board has a CP2102 PHY that is shared + * between the USB and the UART-to-USB logic. That PHY must be programmed during + * boot up for USB functionality (since the UART-to-USB is not populated). + * + * PIN NAME SIGNAL NOTES + * ---- ------------------------------- -------------- ------------------------------ + * 11 AN5/C1IN+/Vbuson/CN7/RB5 Vbuson/AN5/RB5 To USB VBUS circuitry + * 43 U1CTS/SDA1/IC2/INT2/RD9 USB_OPTEN USB PHY + * 44 SCL1/IC3/PMCS2/PMA15/INT3/RD10 USB_OPT USB PHY + */ + +#ifdef CONFIG_ARCH_DBDP11215 +# define GPIO_USB_VBUSON (GPIO_INPUT|GPIO_PORTB|GPIO_PIN5) +# define GPIO_USB_OPTEN (GPIO_OUTPUT|GPIO_VALUE_ZERO|GPIO_PORTD|GPIO_PIN9) +# define GPIO_USB_OPT (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTD|GPIO_PIN10) +#endif + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: pic32mx_usbdevinitialize + * + * Description: + * Called to configure the mini-B PHY on the Sure PIC32MX board for the USB device + * + ************************************************************************************/ + +void weak_function pic32mx_usbdevinitialize(void) +{ + /* Connect the PHY to the USB mini-B port. Order and timing matter! */ + +#ifdef CONFIG_ARCH_DBDP11215 + pic32mx_configgpio(GPIO_USB_OPTEN); + pic32mx_configgpio(GPIO_USB_OPT); +#endif + + /* Notes from the Sure Electronics sample code: + * + * "The USB specifications require that USB peripheral devices must never source + * current onto the Vbus pin. Additionally, USB peripherals should not source + * current on D+ or D- when the host/hub is not actively powering the Vbus line. + * When designing a self powered (as opposed to bus powered) USB peripheral + * device, the firmware should make sure not to turn on the USB module and D+ + * or D- pull up resistor unless Vbus is actively powered. Therefore, the + * firmware needs some means to detect when Vbus is being powered by the host. + * A 5V tolerant I/O pin can be connected to Vbus (through a resistor), and + * can be used to detect when Vbus is high (host actively powering), or low + * (host is shut down or otherwise not supplying power). The USB firmware + * can then periodically poll this I/O pin to know when it is okay to turn on + * the USB module/D+/D- pull up resistor. When designing a purely bus powered + * peripheral device, it is not possible to source current on D+ or D- when the + * host is not actively providing power on Vbus. Therefore, implementing this + * bus sense feature is optional. ..." + */ + +#ifdef CONFIG_USBHOST + // pic32mx_configgpio(GPIO_USB_VBUSON); +#endif + + /* "If the host PC sends a GetStatus (device) request, the firmware must respond + * and let the host know if the USB peripheral device is currently bus powered + * or self powered. See chapter 9 in the official USB specifications for details + * regarding this request. If the peripheral device is capable of being both + * self and bus powered, it should not return a hard coded value for this request. + * Instead, firmware should check if it is currently self or bus powered, and + * respond accordingly. If the hardware has been configured like demonstrated + * on the PICDEM FS USB Demo Board, an I/O pin can be polled to determine the + * currently selected power source. ..." + */ + +#ifdef CONFIG_USB_PWRSENSE + // pic32mx_configgpio(GPIO_USB_PWRSENSE); +#endif +} + +/************************************************************************************ + * Name: pic32mx_usbpullup + * + * Description: + * If USB is supported and the board supports a pullup via GPIO (for USB + * software connect and disconnect), then the board software must provide + * stm32_pullup. See include/nuttx/usb/usbdev.h for additional description + * of this method. Alternatively, if no pull-up GPIO the following EXTERN + * can be redefined to be NULL. + * + ************************************************************************************/ + +int pic32mx_usbpullup(FAR struct usbdev_s *dev, bool enable) +{ + /* The Sure PIC32MX does not have a USB pull-up */ + + return OK; +} + +/************************************************************************************ + * Name: pic32mx_usbsuspend + * + * Description: + * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver + * is used. This function is called whenever the USB enters or leaves + * suspend mode. This is an opportunity for the board logic to shutdown + * clocks, power, etc. while the USB is suspended. + * + ************************************************************************************/ + +void pic32mx_usbsuspend(FAR struct usbdev_s *dev, bool resume) +{ + /* Do nothing */ +} + +#endif /* CONFIG_PIC32MX_USBDEV */ diff --git a/nuttx/configs/sure-pic32mx/src/pic32mx_usbterm.c b/nuttx/configs/sure-pic32mx/src/pic32mx_usbterm.c new file mode 100644 index 000000000..6905951b8 --- /dev/null +++ b/nuttx/configs/sure-pic32mx/src/pic32mx_usbterm.c @@ -0,0 +1,107 @@ +/************************************************************************************ + * configs/sure-pic32mx/src/pic32mx_usbterm.c + * + * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * References: + * - Sample code and schematics provided with the Sure Electronics PIC32 board. + * + * 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 "pic32mx-internal.h" +#include "sure-pic32mx.h" + +#if defined(CONFIG_PIC32MX_USBDEV) && defined(CONFIG_EXAMPLES_USBTERM_DEVINIT) + +/************************************************************************************ + * Definitions + ************************************************************************************/ + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/**************************************************************************** + * Name: + * + * Description: + * If CONFIG_EXAMPLES_USBTERM_DEVINIT is defined, then the example will + * call this user provided function as part of its initialization. + * + ****************************************************************************/ + +int usbterm_devinit(void) +{ + /* The Sure board has no way to know when the USB is connected. So we + * will fake it and tell the USB driver that the USB is connected now. + * + * If examples/usbterm is built as an NSH built-in application, then + * pic32mx_usbattach() will be called in nsh_archinitialize(). + */ + +#ifndef CONFIG_EXAMPLES_USBTERM_BUILTIN + pic32mx_usbattach(); +#endif + return OK; +} + +/**************************************************************************** + * Name: + * + * Description: + * If CONFIG_EXAMPLES_USBTERM_DEVINIT is defined, then the example will + * call this user provided function as part of its termination sequence. + * + ****************************************************************************/ + +void usbterm_devuninit(void) +{ + /* Tell the USB driver that the USB is no longer connected */ + + pic32mx_usbdetach(); +} + +#endif /* CONFIG_PIC32MX_USBDEV && CONFIG_EXAMPLES_USBTERM_DEVINIT */ diff --git a/nuttx/configs/sure-pic32mx/src/sure-internal.h b/nuttx/configs/sure-pic32mx/src/sure-internal.h deleted file mode 100644 index 34e881f41..000000000 --- a/nuttx/configs/sure-pic32mx/src/sure-internal.h +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** - * configs/sure-pic32mx/src/sure-internal.h - * - * Copyright (C) 2011 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 __CONFIGS_SURE_PIC32MX_SRC_SURE_INTERNAL_H -#define __CONFIGS_SURE_PIC32MX_SRC_SURE_INTERNAL_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ -/* Configuration ************************************************************/ - -/* The Sure PIC32MX board has five LEDs. One (D4, lablel "Power") is not - * controllable by software. Four are controllable by software: - * - * D7 "USB" Yellow RD7 Low illuminates - * D8 "SD" Yellow RD6 Low illuminates - * D9 "Flash" Yellow RF0 Low illuminates - * D10 "Error" Red RF1 Low illuminates - */ - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -#ifndef __ASSEMBLY__ - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern -#endif - -/************************************************************************************ - * Name: pic32mx_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the Sure PIC32MX Logic board. - * - ************************************************************************************/ - -#if defined(CONFIG_PIC32MX_SPI2) -EXTERN void weak_function pic32mx_spiinitialize(void); -#endif - -/************************************************************************************ - * Name: pic32mx_usbdevinitialize - * - * Description: - * Called to configure the mini-B PHY on the Sure PIC32MX board for the USB device - * - ************************************************************************************/ - -#if defined(CONFIG_PIC32MX_USBDEV) -EXTERN void weak_function pic32mx_usbdevinitialize(void); -#endif - -/************************************************************************************ - * Name: pic32mx_ledinit - * - * Description: - * Configure on-board LEDs if LED support has been selected. - * - ************************************************************************************/ - -#ifdef CONFIG_ARCH_LEDS -EXTERN void pic32mx_ledinit(void); -#endif - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* __ASSEMBLY__ */ -#endif /* __CONFIGS_SURE_PIC32MX_SRC_SURE_INTERNAL_H */ diff --git a/nuttx/configs/sure-pic32mx/src/sure-pic32mx.h b/nuttx/configs/sure-pic32mx/src/sure-pic32mx.h new file mode 100644 index 000000000..1d2be66eb --- /dev/null +++ b/nuttx/configs/sure-pic32mx/src/sure-pic32mx.h @@ -0,0 +1,122 @@ +/**************************************************************************** + * configs/sure-pic32mx/src/sure-pic32mx.h + * + * Copyright (C) 2011, 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. + * + ****************************************************************************/ + +#ifndef __CONFIGS_SURE_PIC32MX_SRC_SURE_PIC32MXL_H +#define __CONFIGS_SURE_PIC32MX_SRC_SURE_PIC32MXL_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ + +/* The Sure PIC32MX board has five LEDs. One (D4, lablel "Power") is not + * controllable by software. Four are controllable by software: + * + * D7 "USB" Yellow RD7 Low illuminates + * D8 "SD" Yellow RD6 Low illuminates + * D9 "Flash" Yellow RF0 Low illuminates + * D10 "Error" Red RF1 Low illuminates + */ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +/**************************************************************************** + * Inline Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +/************************************************************************************ + * Name: pic32mx_spiinitialize + * + * Description: + * Called to configure SPI chip select GPIO pins for the Sure PIC32MX Logic board. + * + ************************************************************************************/ + +#if defined(CONFIG_PIC32MX_SPI2) +void weak_function pic32mx_spiinitialize(void); +#endif + +/************************************************************************************ + * Name: pic32mx_usbdevinitialize + * + * Description: + * Called to configure the mini-B PHY on the Sure PIC32MX board for the USB device + * + ************************************************************************************/ + +#if defined(CONFIG_PIC32MX_USBDEV) +void weak_function pic32mx_usbdevinitialize(void); +#endif + +/************************************************************************************ + * Name: pic32mx_ledinit + * + * Description: + * Configure on-board LEDs if LED support has been selected. + * + ************************************************************************************/ + +#ifdef CONFIG_ARCH_LEDS +void pic32mx_ledinit(void); +#endif + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __CONFIGS_SURE_PIC32MX_SRC_SURE_PIC32MXL_H */ diff --git a/nuttx/configs/sure-pic32mx/src/up_boot.c b/nuttx/configs/sure-pic32mx/src/up_boot.c deleted file mode 100644 index 2982cdbf4..000000000 --- a/nuttx/configs/sure-pic32mx/src/up_boot.c +++ /dev/null @@ -1,102 +0,0 @@ -/************************************************************************************ - * configs/sure-pic32mx/src/up_boot.c - * arch/mips/src/board/up_boot.c - * - * Copyright (C) 2011 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 "up_arch.h" -#include "up_internal.h" - -#include "pic32mx-internal.h" -#include "sure-internal.h" - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: pic32mx_boardinitialize - * - * Description: - * All PIC32MX architectures must provide the following entry point. This entry - * point is called early in the intitialization -- after all memory has been - * configured and mapped but before any devices have been initialized. - * - ************************************************************************************/ - -void pic32mx_boardinitialize(void) -{ - /* Configure SPI chip selects if 1) at least one SPI is enabled, and 2) the weak - * function pic32mx_spiinitialize() has been brought into the link. - */ - -#if defined(CONFIG_PIC32MX_SPI2) - if (pic32mx_spiinitialize) - { - pic32mx_spiinitialize(); - } -#endif - - /* Configure the mini-B PHY on the Sure PIC32MX board for the USB device */ - -#if defined(CONFIG_PIC32MX_USBDEV) - if (pic32mx_usbdevinitialize) - { - pic32mx_usbdevinitialize(); - } -#endif - - /* Configure on-board LEDs if LED support has been selected. */ - -#ifdef CONFIG_ARCH_LEDS - pic32mx_ledinit(); -#endif -} diff --git a/nuttx/configs/sure-pic32mx/src/up_buttons.c b/nuttx/configs/sure-pic32mx/src/up_buttons.c deleted file mode 100644 index 80fb35fdb..000000000 --- a/nuttx/configs/sure-pic32mx/src/up_buttons.c +++ /dev/null @@ -1,223 +0,0 @@ -/**************************************************************************** - * configs/sure-pic32mx/src/up_buttons.c - * - * Copyright (C) 2011 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 "chip.h" -#include "up_arch.h" - -#include "pic32mx-internal.h" -#include "pic32mx-ioport.h" -#include "pic32mx-adc.h" -#include "sure-internal.h" - -#ifdef CONFIG_ARCH_BUTTONS - -/**************************************************************************** - * Definitions - ****************************************************************************/ -/* The Sure DB_DP11215 PIC32 Storage Demo Board has three buttons. - * - * SW1 (SW_UP, left arrow) RB3 Pulled high, Grounded/low when depressed - * SW2 (SW_DOWN, down/right arrow) RB2 Pulled high, Grounded/low when depressed - * SW3 (SW_OK, right arrow) RB4 Pulled high, Grounded/low when depressed - * - * The Sure DB-DP11212 PIC32 General Purpose Demo Board also has three buttons, - * but these are connected differently: - * - * SW2-1 RF0 Pulled high, Grounded/low when depressed - * SW3-1 RF1 Pulled high, Grounded/low when depressed - * SW5-1 RD6 Pulled high, Grounded/low when depressed - * - * Internal pull-ups are not required since the LEDs are pull-up externally. - * Change notification interrupts are not *automatically* enabled. Change - * notification will be enabled when pic32mx_gpioattach() is called. - */ - -#ifdef CONFIG_ARCH_DBDP11215 -# define GPIO_SW1 (GPIO_INPUT|GPIO_INT|GPIO_PORTB|GPIO_PIN3) -# define GPIO_SW2 (GPIO_INPUT|GPIO_INT|GPIO_PORTB|GPIO_PIN2) -# define GPIO_SW3 (GPIO_INPUT|GPIO_INT|GPIO_PORTB|GPIO_PIN4) -#else /* CONFIG_ARCH_DBDP11212 */ -# define GPIO_SW1 (GPIO_INPUT|GPIO_INT|GPIO_PORTF|GPIO_PIN0) -# define GPIO_SW2 (GPIO_INPUT|GPIO_INT|GPIO_PORTF|GPIO_PIN1) -# define GPIO_SW3 (GPIO_INPUT|GPIO_INT|GPIO_PORTD|GPIO_PIN6) -#endif - -/* Change notification numbers: - * RB3 -> CN5 - * RB2 -> CN2 - * RB4 -> CN6 - */ - -#define CN_SW1 5 -#define CN_SW2 2 -#define CN_SW3 6 - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/* Pin configuration for each button */ - -static const uint16_t g_buttonset[NUM_BUTTONS] = -{ - GPIO_SW1 GPIO_SW2, GPIO_SW3 -} - -/* Change notification number for each button */ - -#ifdef CONFIG_ARCH_IRQBUTTONS -static const uint8_t g_buttoncn[NUM_BUTTONS] = -{ - CN_SW1, CN_SW2, CN_SW3 -} -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_buttoninit - * - * Description: - * up_buttoninit() must be called to initialize button resources. After - * that, up_buttons() may be called to collect the current state of all - * buttons or up_irqbutton() may be called to register button interrupt - * handlers. - * - ****************************************************************************/ - -void up_buttoninit(void) -{ - int i; - - /* Configure input pins */ - - for (i = 0; i < NUM_BUTTONS; i++) - { - pic32mx_configgpio(g_buttonset[i]); - } - - /* Change AN2/AN3/AN4 to digital */ - - putreg32(0xffff, PIC32MX_ADC_CFG); -} - -/**************************************************************************** - * Name: up_buttons - ****************************************************************************/ - -uint8_t up_buttons(void) -{ - uint8_t ret = 0; - int id; - - /* Configure input pins */ - - for (id = 0; id < NUM_BUTTONS; id++) - { - if (pic32mx_gpioread(g_buttonset[id])) - { - ret |= (1 << id); - } - } - - return ret; -} - -/************************************************************************************ - * Button support. - * - * Description: - * up_buttoninit() must be called to initialize button resources. After - * that, up_buttons() may be called to collect the current state of all - * buttons or up_irqbutton() may be called to register button interrupt - * handlers. - * - * After up_buttoninit() has been called, up_buttons() may be called to - * collect the state of all buttons. up_buttons() returns an 8-bit bit set - * with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT - * definitions in board.h for the meaning of each bit. - * - * up_irqbutton() may be called to register an interrupt handler that will - * be called when a button is depressed or released. The ID value is a - * button enumeration value that uniquely identifies a button resource. See the - * BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration - * value. The previous interrupt handler address is returned (so that it may - * restored, if so desired). - * - * Interrupts are automatically enabled when the button handler is attached and - * automatically disabled when the button handler is detached. - * - * When an interrupt occurs, it is due to a change on the GPIO input pin - * associated with the button. In that case, all attached change - * notification handlers will be called. Each handler must maintain state - * and determine if the unlying GPIO button input value changed. - * - ************************************************************************************/ - -#ifdef CONFIG_ARCH_IRQBUTTONS -xcpt_t up_irqbutton(int id, xcpt_t irqhandler) -{ - xcpt_t oldhandler = NULL; - - if (id < NUM_BUTTONS) - { - oldhandler = pic32mx_gpioattach(g_buttonset[id], g_buttoncn[id], irqhandler); - if (irqbuttron) - { - pic32mx_gpioirqenable(g_buttoncn[id]); - } - } - return oldhandler; -} -#endif -#endif /* CONFIG_ARCH_BUTTONS */ diff --git a/nuttx/configs/sure-pic32mx/src/up_leds.c b/nuttx/configs/sure-pic32mx/src/up_leds.c deleted file mode 100644 index 49905bb4a..000000000 --- a/nuttx/configs/sure-pic32mx/src/up_leds.c +++ /dev/null @@ -1,218 +0,0 @@ -/**************************************************************************** - * configs/sure-pic32mx/src/up_leds.c - * arch/arm/src/board/up_leds.c - * - * Copyright (C) 2011 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 "chip.h" -#include "up_arch.h" -#include "up_internal.h" - -#include "pic32mx-internal.h" -#include "pic32mx-ioport.h" -#include "sure-internal.h" - -#ifdef CONFIG_ARCH_LEDS - -/**************************************************************************** - * Definitions - ****************************************************************************/ -/* LED Configuration ********************************************************/ -/* The Sure PIC32MX board has five LEDs. One (D4, lablel "Power") is not - * controllable by software. Four are controllable by software: - * - * D7 "USB" Yellow RD7 Low illuminates - * D8 "SD" Yellow RD6 Low illuminates - * D9 "Flash" Yellow RF0 Low illuminates - * D10 "Error" Red RF1 Low illuminates - * - * ON OFF - * USB SD FLASH ERROR USB SD FLASH ERROR - * LED_STARTED 0 OFF OFF OFF OFF --- --- --- --- - * LED_HEAPALLOCATE 1 ON OFF N/C N/C --- --- --- --- - * LED_IRQSENABLED 2 OFF ON N/C N/C --- --- --- --- - * LED_STACKCREATED 3 ON ON N/C N/C --- --- --- --- - * LED_INIRQ 4 N/C N/C ON N/C N/C N/C OFF N/C - * LED_SIGNAL 4 N/C N/C ON N/C N/C N/C OFF N/C - * LED_ASSERTION 4 N/C N/C ON N/C N/C N/C OFF N/C - * LED_PANIC 5 N/C N/C N/C ON N/C N/C N/C OFF - */ - -#define GPIO_USB_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTD|GPIO_PIN7) -#define GPIO_SD_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTD|GPIO_PIN6) -#define GPIO_FLASH_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTF|GPIO_PIN0) -#define GPIO_ERROR_LED (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTF|GPIO_PIN1) - -/* LED Management Definitions ***********************************************/ - -#define LED_OFF 0 -#define LED_ON 1 -#define LED_NC 2 - -/* Debug ********************************************************************/ - -#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_LEDS) -# define leddbg lldbg -# ifdef CONFIG_DEBUG_VERBOSE -# define ledvdbg lldbg -# else -# define ledvdbg(x...) -# endif -#else -# undef CONFIG_DEBUG_LEDS -# undef CONFIG_DEBUG_VERBOSE -# define leddbg(x...) -# define ledvdbg(x...) -#endif - -/**************************************************************************** - * Private types - ****************************************************************************/ - -struct led_setting_s -{ - uint8_t usb : 2; - uint8_t sd : 2; - uint8_t flash : 2; - uint8_t error : 2; -}; - - /**************************************************************************** - * Private Data - ****************************************************************************/ - -static const struct led_setting_s g_ledonvalues[LED_NVALUES] = -{ - {LED_OFF, LED_OFF, LED_OFF, LED_OFF}, - {LED_ON, LED_OFF, LED_NC, LED_NC}, - {LED_OFF, LED_ON, LED_NC, LED_NC}, - {LED_ON, LED_ON, LED_NC, LED_NC}, - {LED_NC, LED_NC, LED_ON, LED_NC}, - {LED_NC, LED_NC, LED_NC, LED_ON}, -}; - -static const struct led_setting_s g_ledoffvalues[LED_NVALUES] = -{ - {LED_NC, LED_NC, LED_NC, LED_NC}, - {LED_NC, LED_NC, LED_NC, LED_NC}, - {LED_NC, LED_NC, LED_NC, LED_NC}, - {LED_NC, LED_NC, LED_NC, LED_NC}, - {LED_NC, LED_NC, LED_OFF, LED_NC}, - {LED_NC, LED_NC, LED_NC, LED_OFF} -}; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_setleds - ****************************************************************************/ - -void up_setleds(FAR const struct led_setting_s *setting) -{ - if (setting->usb != LED_NC) - { - pic32mx_gpiowrite(GPIO_USB_LED, setting->usb != LED_ON); - } - - if (setting->sd != LED_NC) - { - pic32mx_gpiowrite(GPIO_SD_LED, setting->sd != LED_ON); - } - - if (setting->flash != LED_NC) - { - pic32mx_gpiowrite(GPIO_FLASH_LED, setting->flash != LED_ON); - } - - if (setting->error != LED_NC) - { - pic32mx_gpiowrite(GPIO_ERROR_LED, setting->error != LED_ON); - } -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: pic32mx_ledinit - ****************************************************************************/ - -void pic32mx_ledinit(void) -{ - /* Configure output pins */ - - pic32mx_configgpio(GPIO_USB_LED); - pic32mx_configgpio(GPIO_SD_LED); - pic32mx_configgpio(GPIO_FLASH_LED); - pic32mx_configgpio(GPIO_ERROR_LED); -} - -/**************************************************************************** - * Name: up_ledon - ****************************************************************************/ - -void up_ledon(int led) -{ - if (led < LED_NVALUES) - { - up_setleds(&g_ledonvalues[led]); - } -} - -/**************************************************************************** - * Name: up_ledoff - ****************************************************************************/ - -void up_ledoff(int led) -{ - if (led < LED_NVALUES) - { - up_setleds(&g_ledoffvalues[led]); - } -} -#endif /* CONFIG_ARCH_LEDS */ diff --git a/nuttx/configs/sure-pic32mx/src/up_nsh.c b/nuttx/configs/sure-pic32mx/src/up_nsh.c deleted file mode 100644 index 548ade02b..000000000 --- a/nuttx/configs/sure-pic32mx/src/up_nsh.c +++ /dev/null @@ -1,360 +0,0 @@ -/**************************************************************************** - * config/sure-pic32mx/src/up_nsh.c - * arch/arm/src/board/up_nsh.c - * - * Copyright (C) 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 - -#include -#include -#include -#include - -#include -#include -#include - -#include "pic32mx-internal.h" -#include "sure-internal.h" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -/* PORT and SLOT number probably depend on the board configuration */ - -#ifdef CONFIG_ARCH_BOARD_SUREPIC32MX -# define NSH_HAVEMMCSD 1 -# define NSH_HAVEUSBHOST 1 -# if !defined(CONFIG_NSH_MMCSDSPIPORTNO) || CONFIG_NSH_MMCSDSPIPORTNO != 2 -# error "The Sure PIC32MX MMC/SD is on SPI2" -# undef CONFIG_NSH_MMCSDSPIPORTNO -# define CONFIG_NSH_MMCSDSPIPORTNO 2 -# endif -# if !defined(CONFIG_NSH_MMCSDSLOTNO) || CONFIG_NSH_MMCSDSLOTNO != 0 -# error "The Sure PIC32MX MMC/SD has only one slot (0)" -# undef CONFIG_NSH_MMCSDSLOTNO -# define CONFIG_NSH_MMCSDSLOTNO 0 -# endif -# ifndef CONFIG_PIC32MX_SPI2 -# warning "CONFIG_PIC32MX_SPI2 is not enabled" -# undef NSH_HAVEMMCSD -# endif -#else -# error "Unrecognized board" -# undef NSH_HAVEMMCSD -# undef NSH_HAVEUSBHOST -#endif - -/* Can't support MMC/SD features if mountpoints are disabled */ - -#if defined(CONFIG_DISABLE_MOUNTPOINT) -# undef NSH_HAVEMMCSD -#endif - -#ifndef CONFIG_NSH_MMCSDMINOR -# define CONFIG_NSH_MMCSDMINOR 0 -#endif - -/* USB Host */ - -#ifdef CONFIG_USBHOST -# ifndef CONFIG_PIC32MX_USBHOST -# error "CONFIG_PIC32MX_USBHOST is not selected" -# endif -#endif - -#ifdef CONFIG_PIC32MX_USBHOST -# ifndef CONFIG_USBHOST -# warning "CONFIG_USBHOST is not selected" -# endif -#endif - -#if !defined(CONFIG_USBHOST) || !defined(CONFIG_PIC32MX_USBHOST) -# undef NSH_HAVEUSBHOST -#endif - -#ifdef NSH_HAVEUSBHOST -# ifndef CONFIG_USBHOST_DEFPRIO -# define CONFIG_USBHOST_DEFPRIO 50 -# endif -# ifndef CONFIG_USBHOST_STACKSIZE -# define CONFIG_USBHOST_STACKSIZE 1024 -# endif -#endif - -/* Debug ********************************************************************/ - -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG -# define message(...) lowsyslog(__VA_ARGS__) -# else -# define message(...) printf(__VA_ARGS__) -# endif -#else -# ifdef CONFIG_DEBUG -# define message lowsyslog -# else -# define message printf -# endif -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -#ifdef NSH_HAVEUSBHOST -static struct usbhost_driver_s *g_drvr; -#endif - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: nsh_waiter - * - * Description: - * Wait for USB devices to be connected. - * - ****************************************************************************/ - -#ifdef NSH_HAVEUSBHOST -static int nsh_waiter(int argc, char *argv[]) -{ - bool connected = false; - int ret; - - message("nsh_waiter: Running\n"); - for (;;) - { - /* Wait for the device to change state */ - - ret = DRVR_WAIT(g_drvr, connected); - DEBUGASSERT(ret == OK); - - connected = !connected; - message("nsh_waiter: %s\n", connected ? "connected" : "disconnected"); - - /* Did we just become connected? */ - - if (connected) - { - /* Yes.. enumerate the newly connected device */ - - (void)DRVR_ENUMERATE(g_drvr); - } - } - - /* Keep the compiler from complaining */ - - return 0; -} -#endif - -/**************************************************************************** - * Name: nsh_sdinitialize - * - * Description: - * Initialize SPI-based microSD. - * - ****************************************************************************/ - -#ifdef NSH_HAVEMMCSD -static int nsh_sdinitialize(void) -{ - FAR struct spi_dev_s *spi; - int ret; - - /* Get the SPI port */ - - spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO); - if (!spi) - { - message("nsh_archinitialize: Failed to initialize SPI port %d\n", - CONFIG_NSH_MMCSDSPIPORTNO); - ret = -ENODEV; - goto errout; - } - - message("Successfully initialized SPI port %d\n", - CONFIG_NSH_MMCSDSPIPORTNO); - - /* The SPI should be in 8-bit (default) and mode2: CKP=1, CKE=0. - * The MMC/SD driver will control the SPI frequency. WARNING: - * this is not the right way to do this... this should be done - * the MMC/SD driver: Other device on SPI1 may need other mode - * settings. - */ - - SPI_SETMODE(spi, SPIDEV_MODE2); - - /* Bind the SPI port to the slot */ - - ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, - CONFIG_NSH_MMCSDSLOTNO, spi); - if (ret < 0) - { - message("nsh_sdinitialize: " - "Failed to bind SPI port %d to MMC/SD slot %d: %d\n", - CONFIG_NSH_MMCSDSPIPORTNO, - CONFIG_NSH_MMCSDSLOTNO, ret); - goto errout; - } - - message("Successfuly bound SPI port %d to MMC/SD slot %d\n", - CONFIG_NSH_MMCSDSPIPORTNO, - CONFIG_NSH_MMCSDSLOTNO); - return OK; - -errout: - return ret; -} -#else -# define nsh_sdinitialize() (OK) -#endif - -/**************************************************************************** - * Name: nsh_usbhostinitialize - * - * Description: - * Initialize USB Host - * - ****************************************************************************/ - -#ifdef NSH_HAVEUSBHOST -static int nsh_usbhostinitialize(void) -{ - int pid; - int ret; - - /* First, register all of the class drivers needed to support the drivers - * that we care about: - */ - - message("nsh_usbhostinitialize: Register class drivers\n"); - ret = usbhost_storageinit(); - if (ret != OK) - { - message("nsh_usbhostinitialize: Failed to register the mass storage class\n"); - } - - /* Then get an instance of the USB host interface */ - - message("nsh_usbhostinitialize: Initialize USB host\n"); - g_drvr = usbhost_initialize(0); - if (g_drvr) - { - /* Start a thread to handle device connection. */ - - message("nsh_usbhostinitialize: Start nsh_waiter\n"); - -#ifndef CONFIG_CUSTOM_STACK - pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO, - CONFIG_USBHOST_STACKSIZE, - (main_t)nsh_waiter, (FAR char * const *)NULL); -#else - pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO, - (main_t)nsh_waiter, (FAR char * const *)NULL); -#endif - return pid < 0 ? -ENOEXEC : OK; - } - return -ENODEV; -} -#else -# define nsh_usbhostinitialize() (OK) -#endif - -/**************************************************************************** - * Name: nsh_usbdevinitialize - * - * Description: - * Initialize SPI-based microSD. - * - ****************************************************************************/ - -#ifdef CONFIG_USBDEV -static int nsh_usbdevinitialize(void) -{ - /* The Sure board has no way to know when the USB is connected. So we - * will fake it and tell the USB driver that the USB is connected now. - */ - - pic32mx_usbattach(); - return OK; -} -#else -# define nsh_usbdevinitialize() (OK) -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: nsh_archinitialize - * - * Description: - * Perform architecture specific initialization - * - ****************************************************************************/ - -int nsh_archinitialize(void) -{ - int ret; - - /* Initialize SPI-based microSD */ - - ret = nsh_sdinitialize(); - if (ret == OK) - { - /* Initialize USB host */ - - ret = nsh_usbhostinitialize(); - } - - if (ret == OK) - { - /* Initialize USB device */ - - ret = nsh_usbdevinitialize(); - } - return ret; -} diff --git a/nuttx/configs/sure-pic32mx/src/up_spi.c b/nuttx/configs/sure-pic32mx/src/up_spi.c deleted file mode 100644 index 02ffa4f48..000000000 --- a/nuttx/configs/sure-pic32mx/src/up_spi.c +++ /dev/null @@ -1,272 +0,0 @@ -/************************************************************************************ - * configs/sure-pic32mx/src/up_spi.c - * arch/arm/src/board/up_spi.c - * - * Copyright (C) 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 - -#include -#include -#include - -#include -#include - -#include "up_arch.h" -#include "chip.h" -#include "pic32mx-internal.h" -#include "sure-internal.h" - -#if defined(CONFIG_PIC32MX_SPI2) - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -#ifdef CONFIG_ARCH_DBDP11215 - -/* The Sure DB_DP11215 PIC32 Storage Demo Board has an SD slot connected on SPI2: - * - * SCK2/PMA5/CN8/RG6 SCK SD connector SCK, FLASH (U1) SCK* - * SDI2/PMA4/CN9/RG7 SDI SD connector DO, FLASH (U1) SO* - * SDO2/PMA3/CN10/RG8 SDO SD connector DI, FLASH (U1) SI* - * - * Chip Select. Pulled up on-board - * TDO/AN11/PMA12/RB11 SD_CS SD connector CS - * - * Status inputs. All pulled up on-board - * - * TCK/AN12/PMA11/RB12 SD_CD SD connector CD - * TDI/AN13/PMA10/RB13 SD_WD SD connector WD - */ - -# define PIC32_HAVE_SD 1 - -# define GPIO_SD_CS (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTB|GPIO_PIN11) -# define GPIO_SD_CD (GPIO_INPUT|GPIO_INT|GPIO_PORTB|GPIO_PIN12) -# define GPIO_SD_WD (GPIO_INPUT|GPIO_PORTB|GPIO_PIN13) - -/* The Sure DB_DP11215 PIC32 Storage Demo Board has pads an SOIC (Flash or - * EEPROM) connected on SPI2, however, U4 is not populated on my board. - * - * - * TMS/AN10/CVREFOUT/PMA13/RB10 UTIL_WP FLASH (U1) WP - * SS2/PMA2/CN11/RG9 UTIL_CS FLASH (U1) CS - */ - -# undef PIC32_HAVE_SOIC - -# define GPIO_SOIC_WP (GPIO_INPUT|GPIO_PORTB|GPIO_PIN10) -# define GPIO_SOIC_CS (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTG|GPIO_PIN0) - -/* Change notification numbers -- Not available for SD_CD. */ - -#endif - -#ifdef CONFIG_ARCH_DBDP11212 - -/* The Sure DB-DP11212 PIC32 General Purpose Demo Board does not have an - * SD slot. - */ - -# undef PIC32_HAVE_SD - - /* The Sure DB-DP11212 PIC32 General Purpose Demo Board has an SOIC (Flash or - * EEPROM) connected on SPI2: - * - * - * TMS/AN10/PMA13/RB10 UTIL_WP FLASH (U4) WP - * TDO/AN11/PMA12/RB11 UTIL_CS FLASH (U4) CS - */ - -# define PIC32_HAVE_SOIC 1 - -# define GPIO_SOIC_WP (GPIO_INPUT|GPIO_PORTB|GPIO_PIN10) -# define GPIO_SOIC_CS (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTB|GPIO_PIN11) -#endif - -/* The following enable debug output from this file. - * - * CONFIG_DEBUG_SPI && CONFIG_DEBUG - Define to enable basic SPI debug - * CONFIG_DEBUG_VERBOSE - Define to enable verbose SPI debug - */ - -#ifndef CONFIG_DEBUG -# undef CONFIG_DEBUG_SPI -# undef CONFIG_DEBUG_VERBOSE -#endif - -#ifdef CONFIG_DEBUG_SPI -# define spidbg lldbg -# ifdef CONFIG_DEBUG_VERBOSE -# define spivdbg lldbg -# else -# define spivdbg(x...) -# endif -#else -# define spidbg(x...) -# define spivdbg(x...) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: pic32mx_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the Sure PIC32MX board. - * - ************************************************************************************/ - -void weak_function pic32mx_spiinitialize(void) -{ - /* Configure the SPI2 chip select (CS) GPIO output, and the card detect (CD) and - * write protect (WP) inputs. - */ - -#ifdef PIC32_HAVE_SD - pic32mx_configgpio(GPIO_SD_CS); - pic32mx_configgpio(GPIO_SD_CD); - pic32mx_configgpio(GPIO_SD_WD); -#endif - -#ifdef PIC32_HAVE_SOIC - pic32mx_configgpio(GPIO_SOIC_WP); - pic32mx_configgpio(GPIO_SOIC_CS); -#endif -} - -/************************************************************************************ - * Name: pic32mx_spi2select and pic32mx_spi2status - * - * Description: - * The external functions, pic32mx_spi2select and pic32mx_spi2status - * must be provided by board-specific logic. They are implementations of the select - * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi.h). All other methods (including up_spiinitialize()) - * are provided by common PIC32MX logic. To use this common SPI logic on your - * board: - * - * 1. Provide logic in pic32mx_boardinitialize() to configure SPI/SPI chip select - * pins. - * 2. Provide pic32mx_spi2select() and pic32mx_spi2status() functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. - * 3. Add a calls to up_spiinitialize() in your low level application - * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling - * mmcsd_spislotinitialize(), for example, will bind the SPI driver to - * the SPI MMC/SD driver). - * - ************************************************************************************/ - -#ifdef CONFIG_PIC32MX_SPI2 -void pic32mx_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) -{ - spivdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); - - /* The SD card chip select is pulled high and active low */ - -#ifdef PIC32_HAVE_SD - if (devid == SPIDEV_MMCSD) - { - pic32mx_gpiowrite(GPIO_SD_CS, !selected); - } -#endif - -#ifdef PIC32_HAVE_SOIC - if (devid == SPIDEV_FLASH) - { - pic32mx_gpiowrite(GPIO_SOIC_CS, !selected); - } -#endif -} - -uint8_t pic32mx_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) -{ - uint8_t ret = 0; - - /* Card detect is pull up on-board. If a low value is sensed then the - * card must be present. - */ - -#ifdef PIC32_HAVE_SD - if (devid == SPIDEV_MMCSD) - { - if (!pic32mx_gpioread(GPIO_SD_CD)) - { - ret = SPI_STATUS_PRESENT; - - /* It seems that a high value indicates the the card is write - * protected. - */ - - if (pic32mx_gpioread(GPIO_SD_WD)) - { - ret |= SPI_STATUS_WRPROTECTED; - } - } - } -#endif - -#ifdef PIC32_HAVE_SOIC - if (devid == SPIDEV_FLASH) - { - ret = SPI_STATUS_PRESENT; - - /* Write protect is indicated with a low value. */ - - if (pic32mx_gpioread(GPIO_SOIC_WP)) - { - ret |= SPI_STATUS_WRPROTECTED; - } - } -#endif - - spivdbg("Returning %d\n", ret); - return ret; -} -#endif -#endif /* CONFIG_PIC32MX_SPI2 */ diff --git a/nuttx/configs/sure-pic32mx/src/up_usbdev.c b/nuttx/configs/sure-pic32mx/src/up_usbdev.c deleted file mode 100644 index bb175f664..000000000 --- a/nuttx/configs/sure-pic32mx/src/up_usbdev.c +++ /dev/null @@ -1,175 +0,0 @@ -/************************************************************************************ - * configs/sure-pic32mx/src/up_usbdev.c - * arch/arm/src/board/up_usbdev.c - * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * References: - * - Sample code and schematics provided with the Sure Electronics PIC32 board. - * - * 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 "pic32mx-internal.h" -#include "sure-internal.h" - -#if defined(CONFIG_PIC32MX_USBDEV) - -/************************************************************************************ - * Definitions - ************************************************************************************/ -/* The Sure DB_DP11215 PIC32 Storage Demo Board has a CP2102 PHY that is shared - * between the USB and the UART-to-USB logic. That PHY must be programmed during - * boot up for USB functionality (since the UART-to-USB is not populated). - * - * PIN NAME SIGNAL NOTES - * ---- ------------------------------- -------------- ------------------------------ - * 11 AN5/C1IN+/Vbuson/CN7/RB5 Vbuson/AN5/RB5 To USB VBUS circuitry - * 43 U1CTS/SDA1/IC2/INT2/RD9 USB_OPTEN USB PHY - * 44 SCL1/IC3/PMCS2/PMA15/INT3/RD10 USB_OPT USB PHY - */ - -#ifdef CONFIG_ARCH_DBDP11215 -# define GPIO_USB_VBUSON (GPIO_INPUT|GPIO_PORTB|GPIO_PIN5) -# define GPIO_USB_OPTEN (GPIO_OUTPUT|GPIO_VALUE_ZERO|GPIO_PORTD|GPIO_PIN9) -# define GPIO_USB_OPT (GPIO_OUTPUT|GPIO_VALUE_ONE|GPIO_PORTD|GPIO_PIN10) -#endif - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/************************************************************************************ - * Name: pic32mx_usbdevinitialize - * - * Description: - * Called to configure the mini-B PHY on the Sure PIC32MX board for the USB device - * - ************************************************************************************/ - -void weak_function pic32mx_usbdevinitialize(void) -{ - /* Connect the PHY to the USB mini-B port. Order and timing matter! */ - -#ifdef CONFIG_ARCH_DBDP11215 - pic32mx_configgpio(GPIO_USB_OPTEN); - pic32mx_configgpio(GPIO_USB_OPT); -#endif - - /* Notes from the Sure Electronics sample code: - * - * "The USB specifications require that USB peripheral devices must never source - * current onto the Vbus pin. Additionally, USB peripherals should not source - * current on D+ or D- when the host/hub is not actively powering the Vbus line. - * When designing a self powered (as opposed to bus powered) USB peripheral - * device, the firmware should make sure not to turn on the USB module and D+ - * or D- pull up resistor unless Vbus is actively powered. Therefore, the - * firmware needs some means to detect when Vbus is being powered by the host. - * A 5V tolerant I/O pin can be connected to Vbus (through a resistor), and - * can be used to detect when Vbus is high (host actively powering), or low - * (host is shut down or otherwise not supplying power). The USB firmware - * can then periodically poll this I/O pin to know when it is okay to turn on - * the USB module/D+/D- pull up resistor. When designing a purely bus powered - * peripheral device, it is not possible to source current on D+ or D- when the - * host is not actively providing power on Vbus. Therefore, implementing this - * bus sense feature is optional. ..." - */ - -#ifdef CONFIG_USBHOST - // pic32mx_configgpio(GPIO_USB_VBUSON); -#endif - - /* "If the host PC sends a GetStatus (device) request, the firmware must respond - * and let the host know if the USB peripheral device is currently bus powered - * or self powered. See chapter 9 in the official USB specifications for details - * regarding this request. If the peripheral device is capable of being both - * self and bus powered, it should not return a hard coded value for this request. - * Instead, firmware should check if it is currently self or bus powered, and - * respond accordingly. If the hardware has been configured like demonstrated - * on the PICDEM FS USB Demo Board, an I/O pin can be polled to determine the - * currently selected power source. ..." - */ - -#ifdef CONFIG_USB_PWRSENSE - // pic32mx_configgpio(GPIO_USB_PWRSENSE); -#endif -} - -/************************************************************************************ - * Name: pic32mx_usbpullup - * - * Description: - * If USB is supported and the board supports a pullup via GPIO (for USB - * software connect and disconnect), then the board software must provide - * stm32_pullup. See include/nuttx/usb/usbdev.h for additional description - * of this method. Alternatively, if no pull-up GPIO the following EXTERN - * can be redefined to be NULL. - * - ************************************************************************************/ - -int pic32mx_usbpullup(FAR struct usbdev_s *dev, bool enable) -{ - /* The Sure PIC32MX does not have a USB pull-up */ - - return OK; -} - -/************************************************************************************ - * Name: pic32mx_usbsuspend - * - * Description: - * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver - * is used. This function is called whenever the USB enters or leaves - * suspend mode. This is an opportunity for the board logic to shutdown - * clocks, power, etc. while the USB is suspended. - * - ************************************************************************************/ - -void pic32mx_usbsuspend(FAR struct usbdev_s *dev, bool resume) -{ - /* Do nothing */ -} - -#endif /* CONFIG_PIC32MX_USBDEV */ diff --git a/nuttx/configs/sure-pic32mx/src/up_usbterm.c b/nuttx/configs/sure-pic32mx/src/up_usbterm.c deleted file mode 100644 index 9ff333ce2..000000000 --- a/nuttx/configs/sure-pic32mx/src/up_usbterm.c +++ /dev/null @@ -1,108 +0,0 @@ -/************************************************************************************ - * configs/sure-pic32mx/src/up_usbterm.c - * arch/arm/src/board/up_usbterm.c - * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * References: - * - Sample code and schematics provided with the Sure Electronics PIC32 board. - * - * 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 "pic32mx-internal.h" -#include "sure-internal.h" - -#if defined(CONFIG_PIC32MX_USBDEV) && defined(CONFIG_EXAMPLES_USBTERM_DEVINIT) - -/************************************************************************************ - * Definitions - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ - -/**************************************************************************** - * Name: - * - * Description: - * If CONFIG_EXAMPLES_USBTERM_DEVINIT is defined, then the example will - * call this user provided function as part of its initialization. - * - ****************************************************************************/ - -int usbterm_devinit(void) -{ - /* The Sure board has no way to know when the USB is connected. So we - * will fake it and tell the USB driver that the USB is connected now. - * - * If examples/usbterm is built as an NSH built-in application, then - * pic32mx_usbattach() will be called in nsh_archinitialize(). - */ - -#ifndef CONFIG_EXAMPLES_USBTERM_BUILTIN - pic32mx_usbattach(); -#endif - return OK; -} - -/**************************************************************************** - * Name: - * - * Description: - * If CONFIG_EXAMPLES_USBTERM_DEVINIT is defined, then the example will - * call this user provided function as part of its termination sequence. - * - ****************************************************************************/ - -void usbterm_devuninit(void) -{ - /* Tell the USB driver that the USB is no longer connected */ - - pic32mx_usbdetach(); -} - -#endif /* CONFIG_PIC32MX_USBDEV && CONFIG_EXAMPLES_USBTERM_DEVINIT */ diff --git a/nuttx/configs/sure-pic32mx/usbnsh/Make.defs b/nuttx/configs/sure-pic32mx/usbnsh/Make.defs index 6a2ea6ef7..79c47842e 100644 --- a/nuttx/configs/sure-pic32mx/usbnsh/Make.defs +++ b/nuttx/configs/sure-pic32mx/usbnsh/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/sure-pic32mx/usbnsh/Make.defs # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012, 2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -44,13 +44,13 @@ ifeq ($(WINTOOL),y) MKDEP = $(TOPDIR)/tools/mknulldeps.sh ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" - ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbnsh/ld.script}" + ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}" else # Linux/Cygwin-native toolchain MKDEP = $(TOPDIR)/tools/mkdeps.sh ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx - ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbnsh/ld.script + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script endif CC = $(CROSSDEV)gcc diff --git a/nuttx/configs/sure-pic32mx/usbnsh/appconfig b/nuttx/configs/sure-pic32mx/usbnsh/appconfig deleted file mode 100644 index 1b76789b6..000000000 --- a/nuttx/configs/sure-pic32mx/usbnsh/appconfig +++ /dev/null @@ -1,47 +0,0 @@ -############################################################################ -# configs/sure-pic32mx/usbnsh/appconfig -# -# 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. -# -############################################################################ - -############################################################################ -# Path to example in apps/examples containing the user_start entry point -############################################################################ - -CONFIGURED_APPS += examples/nsh - -############################################################################ -# The NSH application library -############################################################################ - -CONFIGURED_APPS += system/readline -CONFIGURED_APPS += nshlib diff --git a/nuttx/configs/sure-pic32mx/usbnsh/defconfig b/nuttx/configs/sure-pic32mx/usbnsh/defconfig index 404decf12..8e947e9db 100644 --- a/nuttx/configs/sure-pic32mx/usbnsh/defconfig +++ b/nuttx/configs/sure-pic32mx/usbnsh/defconfig @@ -1,252 +1,338 @@ -############################################################################ -# configs/sure-pic32mx/usbnsh/defconfig -# -# 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. -# -############################################################################ -# -# Architecture Selection # -CONFIG_ARCH="mips" -CONFIG_ARCH_MIPS=y -CONFIG_ARCH_MIPS32=y -CONFIG_ARCH_CHIP="pic32mx" -CONFIG_ARCH_CHIP_PIC32MX440F512H=y -CONFIG_ARCH_BOARD="sure-pic32mx" -CONFIG_ARCH_BOARD_SUREPIC32MX=y -CONFIG_ARCH_DBDP11215=y -CONFIG_ARCH_DBDP11212=n -CONFIG_BOARD_LOOPSPERMSEC=4275 -CONFIG_DRAM_SIZE=32768 -CONFIG_DRAM_START=0xa0000000 -CONFIG_ARCH_NOINTC=n -CONFIG_ARCH_VECNOTIRQ=y -CONFIG_ARCH_IRQPRIO=y -CONFIG_ARCH_INTERRUPTSTACK=0 -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARCH_BOOTLOADER=n -CONFIG_ARCH_LEDS=y -CONFIG_ARCH_BUTTONS=n -CONFIG_ARCH_CALIBRATION=n -CONFIG_ARCH_DMA=n +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_LINUX is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +# CONFIG_WINDOWS_NATIVE is not set +CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set # -# Enable support for RAM-based functions -# (If selected, then modifications are needed in ld.script as well) +# Binary Output Formats # -CONFIG_ARCH_RAMFUNCS=n +# CONFIG_RRLOAD_BINARY is not set +CONFIG_INTELHEX_BINARY=y +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set # -# Identify toolchain and linker options +# Customize Header Files # -CONFIG_PIC32MX_MICROCHIPW=n -CONFIG_PIC32MX_MICROCHIPL=n -CONFIG_PIC32MX_MICROCHIPW_LITE=y -CONFIG_PIC32MX_MICROCHIPL_LITE=n +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set # -# Individual subsystems can be enabled: +# Debug Options # +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_SYMBOLS is not set -CONFIG_PIC32MX_WDT=n -CONFIG_PIC32MX_RTCC=n -CONFIG_PIC32MX_TIMER1=n -CONFIG_PIC32MX_TIMER2=n -CONFIG_PIC32MX_TIMER3=n -CONFIG_PIC32MX_TIMER4=n -CONFIG_PIC32MX_TIMER5=n -CONFIG_PIC32MX_IC1=n -CONFIG_PIC32MX_IC2=n -CONFIG_PIC32MX_IC3=n -CONFIG_PIC32MX_IC4=n -CONFIG_PIC32MX_IC5=n -CONFIG_PIC32MX_OC1=n -CONFIG_PIC32MX_OC2=n -CONFIG_PIC32MX_OC3=n -CONFIG_PIC32MX_OC4=n -CONFIG_PIC32MX_OC5=n -CONFIG_PIC32MX_I2C1=n -CONFIG_PIC32MX_I2C2=n -CONFIG_PIC32MX_SPI2=n -CONFIG_PIC32MX_UART1=n +# +# System Type +# +# CONFIG_ARCH_8051 is not set +# CONFIG_ARCH_ARM is not set +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +CONFIG_ARCH_MIPS=y +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set +# CONFIG_ARCH_Z80 is not set +CONFIG_ARCH="mips" +CONFIG_ARCH_FAMILY="mips32" +CONFIG_ARCH_CHIP="pic32mx" +# CONFIG_SERIAL_TERMIOS is not set +CONFIG_ARCH_CHIP_PIC32MX=y +CONFIG_ARCH_MIPS32=y + +# +# MIPS32 Configuration Options +# +# CONFIG_MIPS32_TOOLCHAIN_GNU_ELF is not set +# CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW is not set +CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW_LITE=y +# CONFIG_MIPS32_TOOLCHAIN_PINGUINOW is not set +# CONFIG_MIPS32_FRAMEPOINTER is not set + +# +# PIC32MX Configuration Options +# +# CONFIG_ARCH_CHIP_PIC32MX110F016B is not set +# CONFIG_ARCH_CHIP_PIC32MX110F016C is not set +# CONFIG_ARCH_CHIP_PIC32MX110F016D is not set +# CONFIG_ARCH_CHIP_PIC32MX120F032B is not set +# CONFIG_ARCH_CHIP_PIC32MX120F032C is not set +# CONFIG_ARCH_CHIP_PIC32MX120F032D is not set +# CONFIG_ARCH_CHIP_PIC32MX130F064B is not set +# CONFIG_ARCH_CHIP_PIC32MX130F064C is not set +# CONFIG_ARCH_CHIP_PIC32MX130F064D is not set +# CONFIG_ARCH_CHIP_PIC32MX150F128B is not set +# CONFIG_ARCH_CHIP_PIC32MX150F128C is not set +# CONFIG_ARCH_CHIP_PIC32MX150F128D is not set +# CONFIG_ARCH_CHIP_PIC32MX210F016B is not set +# CONFIG_ARCH_CHIP_PIC32MX210F016C is not set +# CONFIG_ARCH_CHIP_PIC32MX210F016D is not set +# CONFIG_ARCH_CHIP_PIC32MX220F032B is not set +# CONFIG_ARCH_CHIP_PIC32MX220F032C is not set +# CONFIG_ARCH_CHIP_PIC32MX220F032D is not set +# CONFIG_ARCH_CHIP_PIC32MX230F064B is not set +# CONFIG_ARCH_CHIP_PIC32MX230F064C is not set +# CONFIG_ARCH_CHIP_PIC32MX230F064D is not set +# CONFIG_ARCH_CHIP_PIC32MX250F128B is not set +# CONFIG_ARCH_CHIP_PIC32MX250F128C is not set +# CONFIG_ARCH_CHIP_PIC32MX250F128D is not set +# CONFIG_ARCH_CHIP_PIC32MX320F032H is not set +# CONFIG_ARCH_CHIP_PIC32MX320F064H is not set +# CONFIG_ARCH_CHIP_PIC32MX320F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX320F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX340F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX340F256H is not set +# CONFIG_ARCH_CHIP_PIC32MX340F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX340F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX360F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX360F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX420F032H is not set +# CONFIG_ARCH_CHIP_PIC32MX440F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX440F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX440F256H is not set +CONFIG_ARCH_CHIP_PIC32MX440F512H=y +# CONFIG_ARCH_CHIP_PIC32MX460F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX460F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX534F064H is not set +# CONFIG_ARCH_CHIP_PIC32MX534F064L is not set +# CONFIG_ARCH_CHIP_PIC32MX564F064H is not set +# CONFIG_ARCH_CHIP_PIC32MX564F064L is not set +# CONFIG_ARCH_CHIP_PIC32MX564F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX564F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX575F256H is not set +# CONFIG_ARCH_CHIP_PIC32MX575F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX575F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX575F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX664F064H is not set +# CONFIG_ARCH_CHIP_PIC32MX664F064L is not set +# CONFIG_ARCH_CHIP_PIC32MX664F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX664F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX675F256H is not set +# CONFIG_ARCH_CHIP_PIC32MX675F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX675F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX675F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX695F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX695F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX764F128H is not set +# CONFIG_ARCH_CHIP_PIC32MX764F128L is not set +# CONFIG_ARCH_CHIP_PIC32MX775F256H is not set +# CONFIG_ARCH_CHIP_PIC32MX775F256L is not set +# CONFIG_ARCH_CHIP_PIC32MX775F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX775F512L is not set +# CONFIG_ARCH_CHIP_PIC32MX795F512H is not set +# CONFIG_ARCH_CHIP_PIC32MX795F512L is not set +CONFIG_ARCH_CHIP_PIC32MX4=y +# CONFIG_PIC32MX_MVEC is not set +CONFIG_PIC32MX_T1=y + +# +# PIC32MX Peripheral Support +# +# CONFIG_PIC32MX_WDT is not set +# CONFIG_PIC32MX_T2 is not set +# CONFIG_PIC32MX_T3 is not set +# CONFIG_PIC32MX_T4 is not set +# CONFIG_PIC32MX_T5 is not set +# CONFIG_PIC32MX_IC1 is not set +# CONFIG_PIC32MX_IC2 is not set +# CONFIG_PIC32MX_IC3 is not set +# CONFIG_PIC32MX_IC4 is not set +# CONFIG_PIC32MX_IC5 is not set +# CONFIG_PIC32MX_OC1 is not set +# CONFIG_PIC32MX_OC2 is not set +# CONFIG_PIC32MX_OC3 is not set +# CONFIG_PIC32MX_OC4 is not set +# CONFIG_PIC32MX_OC5 is not set +# CONFIG_PIC32MX_I2C1 is not set +# CONFIG_PIC32MX_I2C2 is not set +# CONFIG_PIC32MX_I2C3 is not set +# CONFIG_PIC32MX_I2C4 is not set +# CONFIG_PIC32MX_I2C5 is not set +# CONFIG_PIC32MX_SPI1 is not set +# CONFIG_PIC32MX_SPI2 is not set +# CONFIG_PIC32MX_SPI3 is not set +# CONFIG_PIC32MX_SPI4 is not set +# CONFIG_PIC32MX_UART1 is not set CONFIG_PIC32MX_UART2=y -CONFIG_PIC32MX_PMP=n -CONFIG_PIC32MX_ADC=n -CONFIG_PIC32MX_CVR=n -CONFIG_PIC32MX_CM1=n -CONFIG_PIC32MX_CM2=n -CONFIG_PIC32MX_DDP=n -CONFIG_PIC32MX_FLASH=n -CONFIG_PIC32MX_BMX=n -CONFIG_PIC32MX_DMA=n -CONFIG_PIC32MX_CHE=n +# CONFIG_PIC32MX_UART3 is not set +# CONFIG_PIC32MX_UART4 is not set +# CONFIG_PIC32MX_UART5 is not set +# CONFIG_PIC32MX_UART6 is not set +# CONFIG_PIC32MX_ADC is not set +# CONFIG_PIC32MX_PMP is not set +# CONFIG_PIC32MX_CM1 is not set +# CONFIG_PIC32MX_CM2 is not set +# CONFIG_PIC32MX_CM3 is not set +# CONFIG_PIC32MX_RTCC is not set +# CONFIG_PIC32MX_DMA is not set +# CONFIG_PIC32MX_FLASH is not set CONFIG_PIC32MX_USBDEV=y -CONFIG_PIC32MX_USBHOST=n +# CONFIG_PIC32MX_USBHOST is not set +# CONFIG_PIC32MX_CAN1 is not set +# CONFIG_PIC32MX_CAN2 is not set +# CONFIG_PIC32MX_ETHERNET is not set +# CONFIG_PIC32MX_CTMU is not set + +# +# PIC32MX Peripheral Interrupt Priorities +# +CONFIG_PIC32MX_CTPRIO=16 +CONFIG_PIC32MX_CS0PRIO=16 +CONFIG_PIC32MX_CS1PRIO=16 +CONFIG_PIC32MX_INT0PRIO=16 +CONFIG_PIC32MX_INT1PRIO=16 +CONFIG_PIC32MX_INT2PRIO=16 +CONFIG_PIC32MX_INT3PRIO=16 +CONFIG_PIC32MX_INT4PRIO=16 +CONFIG_PIC32MX_T1PRIO=16 +CONFIG_PIC32MX_UART2PRIO=16 +CONFIG_PIC32MX_USBPRIO=16 # -# PIC32MX Configuration Settings +# Device Configuration 0 (DEVCFG0) # CONFIG_PIC32MX_DEBUGGER=2 CONFIG_PIC32MX_ICESEL=1 +CONFIG_PIC32MX_PROGFLASHWP=0xff +CONFIG_PIC32MX_BOOTFLASHWP=1 +CONFIG_PIC32MX_CODEWP=1 # -# PIC32MX specific serial device driver settings +# Device Configuration 3 (DEVCFG3) # -CONFIG_UART1_SERIAL_CONSOLE=n -CONFIG_UART2_SERIAL_CONSOLE=n - -CONFIG_UART1_TXBUFSIZE=256 -CONFIG_UART2_TXBUFSIZE=256 - -CONFIG_UART1_RXBUFSIZE=256 -CONFIG_UART2_RXBUFSIZE=256 +CONFIG_PIC32MX_USBIDO=0 +CONFIG_PIC32MX_VBUSIO=0 +# CONFIG_PIC32MX_WDENABLE is not set +CONFIG_PIC32MX_FETHIO=1 +CONFIG_PIC32MX_FMIIEN=1 -CONFIG_UART1_BAUD=115200 -CONFIG_UART2_BAUD=115200 - -CONFIG_UART1_BITS=8 -CONFIG_UART2_BITS=8 +# +# External Memory Configuration +# -CONFIG_UART1_PARITY=0 -CONFIG_UART2_PARITY=0 +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +CONFIG_ARCH_VECNOTIRQ=y +# CONFIG_ARCH_DMA is not set +CONFIG_ARCH_IRQPRIO=y +# CONFIG_CUSTOM_STACK is not set +# CONFIG_ADDRENV is not set +CONFIG_ARCH_HAVE_VFORK=y +CONFIG_ARCH_STACKDUMP=y +# CONFIG_ENDIAN_BIG is not set +CONFIG_ARCH_HAVE_RAMFUNCS=y +# CONFIG_ARCH_RAMFUNCS is not set +# CONFIG_ARCH_HAVE_RAMVECTORS is not set -CONFIG_UART1_2STOP=0 -CONFIG_UART2_2STOP=0 +# +# Board Settings +# +CONFIG_BOARD_LOOPSPERMSEC=4275 +# CONFIG_ARCH_CALIBRATION is not set +CONFIG_DRAM_START=0xa0000000 +CONFIG_DRAM_SIZE=32768 +CONFIG_ARCH_HAVE_INTERRUPTSTACK=y +CONFIG_ARCH_INTERRUPTSTACK=0 # -# PIC32MX-specific USB device setup +# Boot options # -CONFIG_PIC32MX_USBDEV_REGDEBUG=n -CONFIG_PIC32MX_USBDEV_BDTDEBUG=n - +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set + # -# General build options +# Board Selection # -CONFIG_RRLOAD_BINARY=n -CONFIG_INTELHEX_BINARY=y -CONFIG_MOTOROLA_SREC=n -CONFIG_RAW_BINARY=n +CONFIG_ARCH_BOARD_SUREPIC32MX=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="sure-pic32mx" # -# General OS setup +# Common Board Options # -CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_ARCH_HAVE_LEDS=y +CONFIG_ARCH_LEDS=y +CONFIG_ARCH_HAVE_BUTTONS=y +# CONFIG_ARCH_BUTTONS is not set +CONFIG_ARCH_HAVE_IRQBUTTONS=y +CONFIG_NSH_MMCSDMINOR=0 -CONFIG_DEBUG=n -CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n -CONFIG_DEBUG_SCHED=n -CONFIG_DEBUG_USB=n +# +# Board-Specific Options +# +CONFIG_ARCH_DBDP11215=y +# CONFIG_ARCH_DBDP11212 is not set -CONFIG_HAVE_CXX=n -CONFIG_HAVE_CXXINITIALIZE=n -CONFIG_MM_REGIONS=1 -CONFIG_ARCH_LOWPUTC=y +# +# RTOS Features +# +# CONFIG_BOARD_INITIALIZE is not set +CONFIG_MSEC_PER_TICK=10 CONFIG_RR_INTERVAL=0 -CONFIG_SCHED_INSTRUMENTATION=n +# CONFIG_SCHED_INSTRUMENTATION is not set CONFIG_TASK_NAME_SIZE=0 +# CONFIG_SCHED_HAVE_PARENT is not set +# CONFIG_JULIAN_TIME is not set CONFIG_START_YEAR=2012 CONFIG_START_MONTH=3 CONFIG_START_DAY=6 -CONFIG_GREGORIAN_TIME=n -CONFIG_JULIAN_TIME=n CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=n -CONFIG_MUTEX_TYPES=n -CONFIG_PRIORITY_INHERITANCE=n -CONFIG_SEM_PREALLOCHOLDERS=0 -CONFIG_SEM_NNESTPRIO=0 -CONFIG_FDCLONE_DISABLE=n -CONFIG_FDCLONE_STDIO=n +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set CONFIG_SDCLONE_DISABLE=y -CONFIG_SCHED_WORKQUEUE=n -CONFIG_SCHED_WORKPRIORITY=192 -CONFIG_SCHED_WORKPERIOD=50000 -CONFIG_SCHED_WORKSTACKSIZE=1024 -CONFIG_SIG_SIGWORK=17 CONFIG_SCHED_WAITPID=y -CONFIG_SCHED_ATEXIT=n - -# -# Settings for nxflat -# -CONFIG_NXFLAT=n -CONFIG_NXFLAT_DUMPBUFFER=n -CONFIG_SYMTAB_ORDEREDBYNAME=y - -# -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. -# -# There are certain dependency relationships in these -# features. -# -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. -# -CONFIG_DISABLE_CLOCK=n -CONFIG_DISABLE_POSIX_TIMERS=n -CONFIG_DISABLE_PTHREAD=n -CONFIG_DISABLE_SIGNALS=n -CONFIG_DISABLE_MQUEUE=n -CONFIG_DISABLE_MOUNTPOINT=n -CONFIG_DISABLE_ENVIRON=n -CONFIG_DISABLE_POLL=y - -# -# Misc libc settings -# -CONFIG_NOPRINTF_FIELDWIDTH=n +# CONFIG_SCHED_STARTHOOK is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_DISABLE_OS_API=y +# CONFIG_DISABLE_CLOCK is not set +# CONFIG_DISABLE_POSIX_TIMERS is not set +# CONFIG_DISABLE_PTHREAD is not set +# CONFIG_DISABLE_SIGNALS is not set +# CONFIG_DISABLE_MQUEUE is not set +# CONFIG_DISABLE_ENVIRON is not set # -# Allow for architecture optimized implementations +# Signal Numbers # -# The architecture can provide optimized versions of the -# following to improve system performance -# -CONFIG_ARCH_MEMCPY=n -CONFIG_ARCH_MEMCMP=n -CONFIG_ARCH_MEMMOVE=n -CONFIG_ARCH_MEMSET=n -CONFIG_ARCH_STRCMP=n -CONFIG_ARCH_STRCPY=n -CONFIG_ARCH_STRNCPY=n -CONFIG_ARCH_STRLEN=n -CONFIG_ARCH_STRNLEN=n -CONFIG_ARCH_BZERO=n +CONFIG_SIG_SIGUSR1=1 +CONFIG_SIG_SIGUSR2=2 +CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGCONDTIMEDOUT=16 # # Sizes of configurable things (0 disables) @@ -257,9 +343,6 @@ CONFIG_NPTHREAD_KEYS=4 CONFIG_NFILE_DESCRIPTORS=8 CONFIG_NFILE_STREAMS=8 CONFIG_NAME_MAX=32 -CONFIG_STDIO_BUFFER_SIZE=64 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=2 CONFIG_PREALLOC_MQ_MSGS=4 CONFIG_MQ_MAXMSGSIZE=32 CONFIG_MAX_WDOGPARMS=2 @@ -267,261 +350,426 @@ CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=4 # -# Filesystem configuration +# Stack and heap information # -CONFIG_FS_FAT=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_MAXFNAME=32 -CONFIG_FS_NXFFS=n -CONFIG_FS_ROMFS=n +CONFIG_IDLETHREAD_STACKSIZE=2048 +CONFIG_USERMAIN_STACKSIZE=2048 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=2048 # -# Maintain legacy build behavior (revisit) +# Device Drivers # +CONFIG_DISABLE_POLL=y +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_PWM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_AUDIO_DEVICES is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +CONFIG_SERIAL=y +# CONFIG_DEV_LOWCONSOLE is not set +CONFIG_SERIAL_REMOVABLE=y +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_UART2=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +# CONFIG_UART2_SERIAL_CONSOLE is not set +CONFIG_NO_SERIAL_CONSOLE=y + +# +# UART2 Configuration +# +CONFIG_UART2_RXBUFSIZE=256 +CONFIG_UART2_TXBUFSIZE=256 +CONFIG_UART2_BAUD=115200 +CONFIG_UART2_BITS=8 +CONFIG_UART2_PARITY=0 +CONFIG_UART2_2STOP=0 +CONFIG_USBDEV=y + +# +# USB Device Controller Driver Options +# +# CONFIG_USBDEV_ISOCHRONOUS is not set +# CONFIG_USBDEV_DUALSPEED is not set +CONFIG_USBDEV_SELFPOWERED=y +# CONFIG_USBDEV_BUSPOWERED is not set +CONFIG_USBDEV_MAXPOWER=100 +# CONFIG_USBDEV_DMA is not set +# CONFIG_USBDEV_TRACE is not set + +# +# USB Device Class Driver Options +# +# CONFIG_USBDEV_COMPOSITE is not set +# CONFIG_PL2303 is not set +CONFIG_CDCACM=y +CONFIG_CDCACM_CONSOLE=y +CONFIG_CDCACM_EP0MAXPACKET=64 +CONFIG_CDCACM_EPINTIN=1 +CONFIG_CDCACM_EPINTIN_FSSIZE=64 +CONFIG_CDCACM_EPINTIN_HSSIZE=64 +CONFIG_CDCACM_EPBULKOUT=3 +CONFIG_CDCACM_EPBULKOUT_FSSIZE=64 +CONFIG_CDCACM_EPBULKOUT_HSSIZE=512 +CONFIG_CDCACM_EPBULKIN=2 +CONFIG_CDCACM_EPBULKIN_FSSIZE=64 +CONFIG_CDCACM_EPBULKIN_HSSIZE=512 +CONFIG_CDCACM_NWRREQS=4 +CONFIG_CDCACM_NRDREQS=4 +CONFIG_CDCACM_RXBUFSIZE=256 +CONFIG_CDCACM_TXBUFSIZE=256 +CONFIG_CDCACM_VENDORID=0x0525 +CONFIG_CDCACM_PRODUCTID=0xa4a7 +CONFIG_CDCACM_VENDORSTR="NuttX" +CONFIG_CDCACM_PRODUCTSTR="CDC/ACM Serial" +# CONFIG_USBMSC is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set -CONFIG_MMCSD=y -CONFIG_MMCSD_SPI=y -CONFIG_MTD=y +# +# System Logging Device Options +# # -# SPI-based MMC/SD driver +# System Logging # -CONFIG_MMCSD_NSLOTS=1 -CONFIG_MMCSD_READONLY=n -CONFIG_MMCSD_SPICLOCK=12500000 +# CONFIG_RAMLOG is not set # -# Block driver buffering +# Networking Support # -CONFIG_FS_READAHEAD=n -CONFIG_FS_WRITEBUFFER=n +# CONFIG_NET is not set # -# SDIO-based MMC/SD driver +# File Systems # -CONFIG_SDIO_DMA=n -CONFIG_MMCSD_MMCSUPPORT=n -CONFIG_MMCSD_HAVECARDDETECT=n # -# TCP/IP and UDP support via uIP +# File system configuration # -CONFIG_NET=n -CONFIG_NET_IPv6=n -CONFIG_NSOCKET_DESCRIPTORS=0 -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=420 -CONFIG_NET_TCP=n -CONFIG_NET_TCP_CONNS=40 -CONFIG_NET_MAX_LISTENPORTS=40 -CONFIG_NET_UDP=n -CONFIG_NET_UDP_CHECKSUMS=y -#CONFIG_NET_UDP_CONNS=10 -CONFIG_NET_ICMP=n -CONFIG_NET_ICMP_PING=n -#CONFIG_NET_PINGADDRCONF=0 -CONFIG_NET_STATISTICS=y -#CONFIG_NET_RECEIVE_WINDOW= -#CONFIG_NET_ARPTAB_SIZE=8 -CONFIG_NET_BROADCAST=n +# CONFIG_DISABLE_MOUNTPOINT is not set +# CONFIG_FS_RAMMAP is not set +# CONFIG_FS_FAT is not set +# CONFIG_FS_NXFFS is not set +# CONFIG_FS_ROMFS is not set +# CONFIG_FS_SMARTFS is not set +# CONFIG_FS_BINFS is not set # -# UIP Network Utilities +# System Logging # -CONFIG_NET_DHCP_LIGHT=n -CONFIG_NET_RESOLV_ENTRIES=4 +# CONFIG_SYSLOG_ENABLE is not set +# CONFIG_SYSLOG is not set # -# USB Device Configuration +# Graphics Support # -CONFIG_USBDEV=y -CONFIG_USBDEV_ISOCHRONOUS=n -CONFIG_USBDEV_DUALSPEED=n -CONFIG_USBDEV_SELFPOWERED=y -CONFIG_USBDEV_REMOTEWAKEUP=n -CONFIG_USBDEV_MAXPOWER=100 -CONFIG_USBDEV_TRACE=n -CONFIG_USBDEV_TRACE_NRECORDS=128 +# CONFIG_NX is not set # -# USB Serial Device Configuration +# Memory Management # -CONFIG_PL2303=n -CONFIG_PL2303_EPINTIN=1 -CONFIG_PL2303_EPBULKOUT=2 -CONFIG_PL2303_EPBULKIN=5 -CONFIG_PL2303_NWRREQS=4 -CONFIG_PL2303_NRDREQS=4 -CONFIG_PL2303_VENDORID=0x067b -CONFIG_PL2303_PRODUCTID=0x2303 -CONFIG_PL2303_VENDORSTR="Nuttx" -CONFIG_PL2303_PRODUCTSTR="USBdev Serial" -CONFIG_PL2303_RXBUFSIZE=512 -CONFIG_PL2303_TXBUFSIZE=512 +# CONFIG_MM_MULTIHEAP is not set +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +# CONFIG_GRAN is not set # -# USB serial device class driver (Standard CDC ACM class) +# Audio Support # -CONFIG_CDCACM=y -CONFIG_CDCACM_CONSOLE=y -#CONFIG_CDCACM_EP0MAXPACKET -#CONFIG_CDCACM_EPINTIN -#CONFIG_CDCACM_EPINTIN_FSSIZE -#CONFIG_CDCACM_EPINTIN_HSSIZE -#CONFIG_CDCACM_EPBULKOUT -#CONFIG_CDCACM_EPBULKOUT_FSSIZE -#CONFIG_CDCACM_EPBULKOUT_HSSIZE -#CONFIG_CDCACM_EPBULKIN -#CONFIG_CDCACM_EPBULKIN_FSSIZE -#CONFIG_CDCACM_EPBULKIN_HSSIZE -#CONFIG_CDCACM_NWRREQS -#CONFIG_CDCACM_NRDREQS -#CONFIG_CDCACM_VENDORID -#CONFIG_CDCACM_VENDORSTR -#CONFIG_CDCACM_PRODUCTID -#CONFIG_CDCACM_PRODUCTSTR -#CONFIG_CDCACM_RXBUFSIZE -#CONFIG_CDCACM_TXBUFSIZE - -# -# USB Storage Device Configuration -# -CONFIG_USBMSC=n -CONFIG_USBMSC_EP0MAXPACKET=64 -CONFIG_USBMSC_EPBULKOUT=1 -CONFIG_USBMSC_EPBULKIN=2 -CONFIG_USBMSC_NRDREQS=8 -CONFIG_USBMSC_NWRREQS=2 -CONFIG_USBMSC_BULKINREQLEN=256 -CONFIG_USBMSC_BULKOUTREQLEN=64 -CONFIG_USBMSC_VENDORID=0x584e -CONFIG_USBMSC_VENDORSTR="NuttX" -CONFIG_USBMSC_PRODUCTID=0x5342 -CONFIG_USBMSC_PRODUCTSTR="USBdev Storage" -CONFIG_USBMSC_VERSIONNO=0x0399 -CONFIG_USBMSC_REMOVABLE=y - -# -# Settings for examples/uip -# -CONFIG_EXAMPLES_UIP_IPADDR=0x0a000002 -CONFIG_EXAMPLES_UIP_DRIPADDR=0x0a000001 -CONFIG_EXAMPLES_UIP_NETMASK=0xffffff00 -CONFIG_EXAMPLES_UIP_DHCPC=n - -# -# Settings for examples/nettest -# -CONFIG_EXAMPLES_NETTEST_SERVER=n -CONFIG_EXAMPLES_NETTEST_PERFORMANCE=n -CONFIG_EXAMPLES_NETTEST_NOMAC=y -CONFIG_EXAMPLES_NETTEST_IPADDR=0x0a000002 -CONFIG_EXAMPLES_NETTEST_DRIPADDR=0x0a000001 -CONFIG_EXAMPLES_NETTEST_NETMASK=0xffffff00 -CONFIG_EXAMPLES_NETTEST_CLIENTIP=0x0a000001 - -# -# Settings for examples/ostest -# -CONFIG_EXAMPLES_OSTEST_LOOPS=1 -CONFIG_EXAMPLES_OSTEST_STACKSIZE=2048 -CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3 - -# -# Settings for apps/nshlib +# CONFIG_AUDIO is not set + +# +# Binary Formats # +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_BINFMT_EXEPATH is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set CONFIG_BUILTIN=y +# CONFIG_PIC is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# + +# +# Standard C Library Options +# +CONFIG_STDIO_BUFFER_SIZE=64 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=2 +CONFIG_LIB_HOMEDIR="/" +# CONFIG_LIBM is not set +# CONFIG_NOPRINTF_FIELDWIDTH is not set +# CONFIG_LIBC_FLOATINGPOINT is not set +CONFIG_LIB_RAND_ORDER=1 +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_EXECFUNCS is not set +CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 +CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Non-standard Library Support +# +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_LIB_KBDCODEC is not set +# CONFIG_LIB_SLCDCODEC is not set + +# +# Basic CXX Support +# +# CONFIG_C99_BOOL8 is not set +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Built-In Applications +# +CONFIG_BUILTIN_PROXY_STACKSIZE=1024 + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CDCACM is not set +# CONFIG_EXAMPLES_COMPOSITE is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_MOUNT is not set +CONFIG_EXAMPLES_NSH=y +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POSIXSPAWN is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_SLCD is not set +# CONFIG_EXAMPLES_SMART_TEST is not set +# CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_TCPECHO is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBMSC is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set + +# +# Graphics Support +# +# CONFIG_TIFF is not set + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPC is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_RESOLV is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TELNETD is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# FreeModBus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +CONFIG_NSH_LIBRARY=y CONFIG_NSH_BUILTIN_APPS=y + +# +# Disable Individual commands +# +# CONFIG_NSH_DISABLE_CAT is not set +# CONFIG_NSH_DISABLE_CD is not set +# CONFIG_NSH_DISABLE_CP is not set +# CONFIG_NSH_DISABLE_DD is not set +# CONFIG_NSH_DISABLE_ECHO is not set +# CONFIG_NSH_DISABLE_EXEC is not set +# CONFIG_NSH_DISABLE_EXIT is not set +# CONFIG_NSH_DISABLE_FREE is not set +# CONFIG_NSH_DISABLE_GET is not set +# CONFIG_NSH_DISABLE_HELP is not set +# CONFIG_NSH_DISABLE_HEXDUMP is not set +# CONFIG_NSH_DISABLE_IFCONFIG is not set +# CONFIG_NSH_DISABLE_KILL is not set +# CONFIG_NSH_DISABLE_LOSETUP is not set +# CONFIG_NSH_DISABLE_LS is not set +# CONFIG_NSH_DISABLE_MB is not set +# CONFIG_NSH_DISABLE_MKDIR is not set +# CONFIG_NSH_DISABLE_MKFATFS is not set +# CONFIG_NSH_DISABLE_MKFIFO is not set +# CONFIG_NSH_DISABLE_MKRD is not set +# CONFIG_NSH_DISABLE_MH is not set +# CONFIG_NSH_DISABLE_MOUNT is not set +# CONFIG_NSH_DISABLE_MW is not set +# CONFIG_NSH_DISABLE_NSFMOUNT is not set +# CONFIG_NSH_DISABLE_PS is not set +# CONFIG_NSH_DISABLE_PING is not set +# CONFIG_NSH_DISABLE_PUT is not set +# CONFIG_NSH_DISABLE_PWD is not set +# CONFIG_NSH_DISABLE_RM is not set +# CONFIG_NSH_DISABLE_RMDIR is not set +# CONFIG_NSH_DISABLE_SET is not set +# CONFIG_NSH_DISABLE_SH is not set +# CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TEST is not set +# CONFIG_NSH_DISABLE_UMOUNT is not set +# CONFIG_NSH_DISABLE_UNSET is not set +# CONFIG_NSH_DISABLE_USLEEP is not set +# CONFIG_NSH_DISABLE_WGET is not set +# CONFIG_NSH_DISABLE_XD is not set + +# +# Configure Command Options +# +# CONFIG_NSH_CMDOPT_DF_H is not set +CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_STRERROR=n CONFIG_NSH_LINELEN=64 CONFIG_NSH_NESTDEPTH=3 -CONFIG_NSH_DISABLESCRIPT=n -CONFIG_NSH_DISABLEBG=n -CONFIG_NSH_ROMFSETC=n +# CONFIG_NSH_DISABLESCRIPT is not set +# CONFIG_NSH_DISABLEBG is not set CONFIG_NSH_CONSOLE=y -CONFIG_NSH_TELNET=n +# CONFIG_NSH_USBCONSOLE is not set + +# +# USB Trace Support +# +# CONFIG_NSH_CONDEV is not set CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_IOBUFFER_SIZE=512 -CONFIG_NSH_DHCPC=n -CONFIG_NSH_NOMAC=n -CONFIG_NSH_IPADDR=0x0a000002 -CONFIG_NSH_DRIPADDR=0x0a000001 -CONFIG_NSH_NETMASK=0xffffff00 -CONFIG_NSH_ROMFSMOUNTPT="/etc" -CONFIG_NSH_INITSCRIPT="init.d/rcS" -CONFIG_NSH_ROMFSDEVNO=0 -CONFIG_NSH_ROMFSSECTSIZE=64 -CONFIG_NSH_FATDEVNO=1 -CONFIG_NSH_FATSECTSIZE=512 -CONFIG_NSH_FATNSECTORS=1024 -CONFIG_NSH_FATMOUNTPT="/tmp" - -# -# Architecture-specific NSH options -# -CONFIG_NSH_MMCSDSPIPORTNO=2 -CONFIG_NSH_MMCSDSLOTNO=0 -CONFIG_NSH_MMCSDMINOR=0 # -# Settings for examples/usbserial +# NxWidgets/NxWM # -CONFIG_EXAMPLES_USBSERIAL_INONLY=n -CONFIG_EXAMPLES_USBSERIAL_OUTONLY=n -CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL=n -CONFIG_EXAMPLES_USBSERIAL_ONLYBIG=n -CONFIG_EXAMPLES_USBSERIAL_TRACEINIT=n -CONFIG_EXAMPLES_USBSERIAL_TRACECLASS=n -CONFIG_EXAMPLES_USBSERIAL_TRACETRANSFERS=n -CONFIG_EXAMPLES_USBSERIAL_TRACECONTROLLER=n -CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=n +# +# System NSH Add-Ons +# # -# Settings for examples/usbstorage +# Custom Free Memory Command # -CONFIG_EXAMPLES_USBMSC_NLUNS=1 -CONFIG_EXAMPLES_USBMSC_DEVMINOR1=0 -CONFIG_EXAMPLES_USBMSC_DEVPATH1="/dev/mmcsd0" -CONFIG_EXAMPLES_USBMSC_TRACEINIT=n -CONFIG_EXAMPLES_USBMSC_TRACECLASS=n -CONFIG_EXAMPLES_USBMSC_TRACETRANSFERS=n -CONFIG_EXAMPLES_USBMSC_TRACECONTROLLER=n -CONFIG_EXAMPLES_USBMSC_TRACEINTERRUPTS=n +# CONFIG_SYSTEM_FREE is not set # -# Settings for examples/usbterm +# I2C tool # -CONFIG_EXAMPLES_USBTERM_BUILTIN=y -CONFIG_EXAMPLES_USBTERM_DEVINIT=y -#CONFIG_EXAMPLES_USBTERM_BUFLEN -CONFIG_EXAMPLES_USBTERM_TRACEINIT=n -CONFIG_EXAMPLES_USBTERM_TRACECLASS=n -CONFIG_EXAMPLES_USBTERM_TRACETRANSFERS=n -CONFIG_EXAMPLES_USBTERM_TRACECONTROLLER=n -CONFIG_EXAMPLES_USBTERM_TRACEINTERRUPTS=n # -# Settings for examples/cdcacm +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + # -# Configuration prequisites: +# FLASH Erase-all Command # -CONFIG_EXAMPLES_CDCACM_DEVMINOR=0 -CONFIG_EXAMPLES_CDCACM_TRACEINIT=n -CONFIG_EXAMPLES_CDCACM_TRACECLASS=n -CONFIG_EXAMPLES_CDCACM_TRACETRANSFERS=n -CONFIG_EXAMPLES_CDCACM_TRACECONTROLLER=n -CONFIG_EXAMPLES_CDCACM_TRACEINTERRUPTS=n # -# Stack and heap information +# readline() +# +CONFIG_SYSTEM_READLINE=y +CONFIG_READLINE_ECHO=y + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set + +# +# USB Monitor # -CONFIG_BOOT_RUNFROMFLASH=n -CONFIG_BOOT_COPYTORAM=n -CONFIG_CUSTOM_STACK=n -CONFIG_IDLETHREAD_STACKSIZE=2048 -CONFIG_USERMAIN_STACKSIZE=2048 -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=2048 diff --git a/nuttx/configs/sure-pic32mx/usbnsh/ld.script b/nuttx/configs/sure-pic32mx/usbnsh/ld.script deleted file mode 100644 index 088f812d8..000000000 --- a/nuttx/configs/sure-pic32mx/usbnsh/ld.script +++ /dev/null @@ -1,317 +0,0 @@ -/**************************************************************************** - * configs/sure-pic32mx/usbnsh/ld.script - * - * 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. - * - ****************************************************************************/ -/* Memory Regions ***********************************************************/ - -MEMORY -{ - /* The PIC32MX440F512H has 512Kb of program FLASH at physical address - * 0x1d000000 but is always accessed at KSEG0 address 0x9d00:0000 - */ - - kseg0_progmem (rx) : ORIGIN = 0x9d000000, LENGTH = 512K - - /* The PIC32MX440F512H has 12Kb of boot FLASH at physical address - * 0x1fc00000. The initial reset vector is in KSEG1, but all other - * accesses are in KSEG0. - * - * REGION PHYSICAL KSEG SIZE - * DESCRIPTION START ADDR (BYTES) - * ------------- ---------- ------ ---------------------- - * Exceptions:* - * Reset 0x1fc00000 KSEG1 512 512 - * TLB Refill 0x1fc00200 KSEG1 256 768 - * Cache Error 0x1fc00300 KSEG1 128 896 - * Others 0x1fc00380 KSEG1 128 1024 (1Kb) - * Interrupt 0x1fc00400 KSEG1 128 1152 - * JTAG 0x1fc00480 KSEG1 16 1168 - * Exceptions 0x1fc00490 KSEG0 8192-1168 8192 (4Kb) - * Debug code 0x1fc02000 KSEG1 4096-16 12272 - * DEVCFG3-0 0x1fc02ff0 KSEG1 16 12288 (12Kb) - * - * Exceptions assume: - * - * STATUS: BEV=0/1 and EXL=0 - * CAUSE: IV=1 - * JTAG: ProbEn=0 - * And multi-vector support disabled - */ - - kseg1_reset (rx) : ORIGIN = 0xbfc00000, LENGTH = 384 - kseg1_genexcpt (rx) : ORIGIN = 0xbfc00180, LENGTH = 128 - kseg1_ebexcpt (rx) : ORIGIN = 0xbfc00200, LENGTH = 128 - kseg1_bevexcpt (rx) : ORIGIN = 0xbfc00380, LENGTH = 128 - kseg1_intexcpt (rx) : ORIGIN = 0xbfc00400, LENGTH = 128 - kseg1_dbgexcpt (rx) : ORIGIN = 0xbfc00480, LENGTH = 16 - kseg0_bootmem (rx) : ORIGIN = 0x9fc00490, LENGTH = 8192-1168 - kseg1_dbgcode (rx) : ORIGIN = 0xbfc02000, LENGTH = 4096-16 - kseg1_devcfg (r) : ORIGIN = 0xbfc02ff0, LENGTH = 16 - - /* The PIC32MX440F512H has 32Kb of data memory at physical address - * 0x00000000. Since the PIC32MX has no data cache, this memory is - * always accessed through KSEG1. - * - * When used with MPLAB, we need to set aside 512 bytes of memory - * for use by MPLAB. - */ - - kseg1_datamem (w!x) : ORIGIN = 0xa0000200, LENGTH = 32K - 512 -} - -OUTPUT_FORMAT("elf32-tradlittlemips") -OUTPUT_ARCH(pic32mx) -ENTRY(__start) - -SECTIONS -{ - /* Boot FLASH sections */ - - .reset : - { - KEEP (*(.reset)) - } > kseg1_reset - - /* Exception handlers. The following is assumed: - * - * STATUS: BEV=1 and EXL=0 - * CAUSE: IV=1 - * JTAG: ProbEn=0 - * And multi-vector support disabled - * - * In that configuration, the vector locations become: - * - * Reset, Soft Reset bfc0:0000 - * TLB Refill bfc0:0200 - * Cache Error bfc0:0300 - * All others bfc0:0380 - * Interrupt bfc0:0400 - * EJTAG Debug bfc0:0480 - */ - - /* KSEG1 exception handler "trampolines" */ - - .gen_excpt : - { - KEEP (*(.gen_excpt)) - } > kseg1_genexcpt - - .ebase_excpt : - { - KEEP (*(.ebase_excpt)) - } > kseg1_ebexcpt - - .bev_excpt : - { - KEEP (*(.bev_excpt)) - } > kseg1_bevexcpt - - .int_excpt : - { - KEEP (*(.int_excpt)) - } > kseg1_intexcpt - - .dbg_excpt = ORIGIN(kseg1_dbgexcpt); - - .start : - { - /* KSEG0 Reset startup logic */ - - *(.start) - - /* KSEG0 exception handlers */ - - *(.nmi_handler) - *(.bev_handler) - *(.int_handler) - } > kseg0_bootmem - - .dbg_code = ORIGIN(kseg1_dbgcode); - - .devcfg : - { - KEEP (*(.devcfg)) - } > kseg1_devcfg - - /* Program FLASH sections */ - - .text : - { - _stext = ABSOLUTE(.); - *(.text .text.*) - *(.stub) - KEEP (*(.text.*personality*)) - *(.gnu.linkonce.t.*) - *(.gnu.warning) - *(.mips16.fn.*) - *(.mips16.call.*) - - /* Read-only data is included in the text section */ - - *(.rodata .rodata.*) - *(.rodata1) - *(.gnu.linkonce.r.*) - - /* Small initialized constant global and static data */ - - *(.sdata2 .sdata2.*) - *(.gnu.linkonce.s2.*) - - /* Uninitialized constant global and static data */ - - *(.sbss2 .sbss2.*) - *(.gnu.linkonce.sb2.*) - _etext = ABSOLUTE(.); - } > kseg0_progmem - - /* Initialization data begins here in progmem */ - - _data_loaddr = LOADADDR(.data); - - .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } - - /* RAM functions are positioned at the beginning of RAM so that - * they can be guaranteed to satisfy the 2Kb alignment requirement. - */ - -/* This causes failures if there are no RAM functions - .ramfunc ALIGN(2K) : - { - _sramfunc = ABSOLUTE(.); - *(.ramfunc .ramfunc.*) - _eramfunc = ABSOLUTE(.); - } > kseg1_datamem AT > kseg0_progmem - - _ramfunc_loadaddr = LOADADDR(.ramfunc); - _ramfunc_sizeof = SIZEOF(.ramfunc); - _bmxdkpba_address = _sramfunc - ORIGIN(kseg1_datamem) ; - _bmxdudba_address = LENGTH(kseg1_datamem) ; - _bmxdupba_address = LENGTH(kseg1_datamem) ; -*/ - - .data : - { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - KEEP (*(.gnu.linkonce.d.*personality*)) - *(.data1) - } > kseg1_datamem AT > kseg0_progmem - - .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } - _gp = ALIGN(16) + 0x7FF0 ; - - .got : - { - *(.got.plt) *(.got) - } > kseg1_datamem AT > kseg0_progmem - - .sdata : - { - *(.sdata .sdata.* .gnu.linkonce.s.*) - } > kseg1_datamem AT > kseg0_progmem - - .lit8 : - { - *(.lit8) - } > kseg1_datamem AT > kseg0_progmem - - .lit4 : - { - *(.lit4) - _edata = ABSOLUTE(.); - } >kseg1_datamem AT>kseg0_progmem - - .sbss : - { - _sbss = ABSOLUTE(.); - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.scommon) - } >kseg1_datamem - - .bss : - { - *(.dynbss) - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - _ebss = ABSOLUTE(.); - } > kseg1_datamem - - /* Stabs debugging sections */ - - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - - /* DWARF debug sections */ - /* DWARF 1 */ - - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - - /* GNU DWARF 1 extensions */ - - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - - /* DWARF 1.1 and DWARF 2 */ - - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - - /* DWARF 2 */ - - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - - /* SGI/MIPS DWARF 2 extensions */ - - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - - /DISCARD/ : { *(.note.GNU-stack) } -} -- cgit v1.2.3