From 2103ca967a41f169dd5c1935ebee2c5f154eb9b8 Mon Sep 17 00:00:00 2001 From: jeditekunum Date: Sat, 24 Jan 2015 14:31:35 -0600 Subject: [PATCH 1/4] First step at porting to MoteinoMEGA. LED shows assert failure at boot. Appears to be short double blink, short off (~1sec), followed by 250ms toggle cycles. Most of it derived from amber board. --- configs/Kconfig | 13 + configs/moteino-mega/Kconfig | 4 + configs/moteino-mega/README.txt | 491 +++++++++++++ configs/moteino-mega/hello/Make.defs | 98 +++ configs/moteino-mega/hello/defconfig | 580 ++++++++++++++++ configs/moteino-mega/hello/ld.script | 211 ++++++ configs/moteino-mega/hello/setenv.sh | 63 ++ configs/moteino-mega/include/board.h | 97 +++ configs/moteino-mega/nsh/Make.defs | 98 +++ configs/moteino-mega/nsh/defconfig | 651 ++++++++++++++++++ configs/moteino-mega/nsh/ld.script | 211 ++++++ configs/moteino-mega/nsh/setenv.sh | 63 ++ configs/moteino-mega/src/.gitignore | 2 + configs/moteino-mega/src/Makefile | 96 +++ .../moteino-mega/src/moteino_mega_internal.h | 101 +++ configs/moteino-mega/src/up_boot.c | 92 +++ configs/moteino-mega/src/up_leds.c | 189 +++++ 17 files changed, 3060 insertions(+) create mode 100644 configs/moteino-mega/Kconfig create mode 100644 configs/moteino-mega/README.txt create mode 100644 configs/moteino-mega/hello/Make.defs create mode 100644 configs/moteino-mega/hello/defconfig create mode 100644 configs/moteino-mega/hello/ld.script create mode 100755 configs/moteino-mega/hello/setenv.sh create mode 100644 configs/moteino-mega/include/board.h create mode 100644 configs/moteino-mega/nsh/Make.defs create mode 100644 configs/moteino-mega/nsh/defconfig create mode 100644 configs/moteino-mega/nsh/ld.script create mode 100755 configs/moteino-mega/nsh/setenv.sh create mode 100644 configs/moteino-mega/src/.gitignore create mode 100644 configs/moteino-mega/src/Makefile create mode 100644 configs/moteino-mega/src/moteino_mega_internal.h create mode 100644 configs/moteino-mega/src/up_boot.c create mode 100644 configs/moteino-mega/src/up_leds.c diff --git a/configs/Kconfig b/configs/Kconfig index de745686d6..dddbabfec2 100644 --- a/configs/Kconfig +++ b/configs/Kconfig @@ -318,6 +318,15 @@ config ARCH_BOARD_MICROPENDOUS3 be populated with either an AVR AT90USB646, 647, 1286, or 1287 MCU. Support is configured for the AT90USB647. +config ARCH_BOARD_MOTEINO_MEGA + bool "LowPowerLab MoteinoMEGA" + depends on ARCH_CHIP_ATMEGA1284P + select ARCH_HAVE_LEDS + ---help--- + This is placeholder for the LowPowerLab MoteinoMEGA that is based + on the Atmel AVR ATMega1284P MCU. There is not much there yet and what is + there is untested due to tool-related issues. + config ARCH_BOARD_MX1ADS bool "Motorola MX1ADS development board" depends on ARCH_CHIP_IMX1 @@ -1065,6 +1074,7 @@ config ARCH_BOARD default "mcu123-lpc214x" if ARCH_BOARD_MCU123_LPC214X default "micropendous3" if ARCH_BOARD_MICROPENDOUS3 default "mirtoo" if ARCH_BOARD_MIRTOO + default "moteino-mega" if ARCH_BOARD_MOTEINO_MEGA default "mx1ads" if ARCH_BOARD_MX1ADS default "ne64badge" if ARCH_BOARD_NE64BADGE default "ntosd-dm320" if ARCH_BOARD_NTOSD_DM320 @@ -1288,6 +1298,9 @@ endif if ARCH_BOARD_MIRTOO source "configs/mirtoo/Kconfig" endif +if ARCH_BOARD_MOTEINO_MEGA +source "configs/moteino-mega/Kconfig" +endif if ARCH_BOARD_MX1ADS source "configs/mx1ads/Kconfig" endif diff --git a/configs/moteino-mega/Kconfig b/configs/moteino-mega/Kconfig new file mode 100644 index 0000000000..ae2bf31307 --- /dev/null +++ b/configs/moteino-mega/Kconfig @@ -0,0 +1,4 @@ +# +# For a description of the syntax of this configuration file, +# see misc/tools/kconfig-language.txt. +# diff --git a/configs/moteino-mega/README.txt b/configs/moteino-mega/README.txt new file mode 100644 index 0000000000..97b1e08dcb --- /dev/null +++ b/configs/moteino-mega/README.txt @@ -0,0 +1,491 @@ +README +^^^^^^ + +********************************************************************** +**** PRELIMINARY - Port in progress **** +********************************************************************** + +This is the README file for the port of NuttX to the MoteinoMEGA from +LowPowerLab (http://www.lowpowerlab.com). The MoteinoMEGA is based +on an Atmel ATMega1284P. As of this writing, documentation for the +MoteinoMEGA board is available here: + +https://lowpowerlab.com/shop/index.php?_route_=Moteino/moteinomega + +Contents +^^^^^^^^ + + o MoteinoMEGA Features + o Pin Connections + o DualOptiboot Bootloader + o Toolchains + o Windows Native Toolchains + o NuttX buildroot Toolchain + o avr-libc + o MoteinoMEGA Configuration Options + o Configurations + +MoteinoMEGA Features +^^^^^^^^^^^^^^^^^^^^ + + o 16MHz ATmega1284P Atmel 8bit AVR RISC Processor + o 128Kbyte Flash + o 16Kbyte RAM + o 4Kbyte EEPROM + o 2 High Speed Serial Ports + o 8Ch 10bit Analog Input port + +Pin Connections (PCB Rev ?) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + -------------------- ----------------------------- + ATMega1284P Pinout MoteinoMEGA board connection + -------------------- ----------------------------- +********************************************************************** +**** INVALID - Port in progress **** +********************************************************************** + (left) + 1 PEN Pulled-up + 2 PE0 (RXD0/PDI) MAX202ECWED T1IN or J7-1, ISP-PDI (via 74HC5053), J5-26 + 3 PE1 (TXD0/PDO) MAX202ECWED A1OUT or J7-9, ISP-PDO (via 74HC5053), J5-25 + 4 PE2 (XCK0/AIN0) MAX202ECWED T2IN, J5-24 + 5 PE3 (OC3A/AIN1) MAX202ECWED A2OUT, J5-23 + 6 PE4 (OC3B/INT4) J5-22 + 7 PE5 (OC3C/INT5) J5-21, RTL8019AS INT 0, TP5 PE5 + 8 PE6 (T3/INT6) J5-20 + 9 PE7 (ICP3/INT7) J5-19 + 10 PB0 (SS) Pull up of SS SPI master + 11 PB1 (SCK) J7-7, ISP_SCK (via 74HC4053) and AT45D011 SCK, J5-17 + 12 PB2 (MOSI) AT45D011 SI. J5-16 + 13 PB3 (MISO) AT45D011 SO, J5-15 + 14 PB4 (OC0) AT45D011 CS\, J5-14 + 15 PB5 (OC1A) J5-13 + 16 PB6 (OC1B) J5-12 + (bottom) + 17 PB7 (OC2/OC1C) J5-11 + 18 PG3/TOSC2 32.768KHz XTAL + 19 PG4/TOSC1 32.768KHz XTAL + 20 RESET RESET + 21 VCC + 22 GND GND + 23 XTAL2 14.7456MHz XTAL + 24 XTAL1 14.7456MHz XTAL + 25 PD0 (SCL/INT0) J5-10 + 26 PD1 (SDA/INT1) J5-9 + 27 PD2 (RXD1/INT2) J5-8, MAX488CSA RO (RS-485) + 28 PD3 (TXD1/INT3) J5-7, MAX488CSA DI (RS-485) + 29 PD4 (ICP1) J5-6 + 30 PD5 (XCK1) J5-5 + 31 PD6 (T1) J5-4 + 32 PD7 (T2) J5-3 + (left) + 48 PA3 (AD3) J5-?, 74HC5730, 62246DLP-7, RTL8019AS + 47 PA4 (AD4) J5-?, 74HC5730, 62246DLP-7, RTL8019AS + 46 PA5 (AD5) J5-?, 74HC5730, 62246DLP-7, RTL8019AS + 45 PA6 (AD6) J5-?, 74HC5730, 62246DLP-7, RTL8019AS + 44 PA7 (AD7) J5-?, 74HC5730, 62246DLP-7, RTL8019AS + 43 PG2 (ALE) J5-1, 74HC5730, 62246DLP-7, RTL8019AS + 42 PC7 (A15) TP4 A15, J5-27, 74HC5730 + 41 PC6 (A14) J5-28, 74HC5730, 62246DLP-7, RTL8019AS + 40 PC5 (A13) J5-29, 74HC5730, 62246DLP-7, RTL8019AS + 39 PC4 (A12) J5-30, 74HC5730, 62246DLP-7, RTL8019AS + 38 PC3 (A11) J5-31, 74HC5730, 62246DLP-7, RTL8019AS + 37 PC2 (A10) J5-32, 74HC5730, 62246DLP-7, RTL8019AS + 36 PC1 (A9) J5-33, 74HC5730, 62246DLP-7, RTL8019AS + 35 PC0 (A8) J5-34, 74HC5730, 62246DLP-7, RTL8019AS + 34 PG1 (RD) TP2 RD\, J5-52, 62246DLP-7, RTL8019AS + 33 PG0 (WR) TP3 WR\, J5-51, 62246DLP-7, RTL8019AS + (top) + 64 AVCC + 63 GND GND + 62 AREF (analog supply) + 61 PF0 (ADC0) J6-5, PDV-P9 Light Sensor + 60 PF1 (ADC1) J6-7, Thermister + 59 PF2 (ADC2) J6-9, MXA2500GL Dual Axis Accesserometer, AOUTX + 58 PF3 (ADC3) J6-11, MXA2500GL Dual Axis Accesserometer, AOUTY + 57 PF4 (ADC4/TCK) J6-13, MXA2500GL Dual Axis Accesserometer, TOUT + 56 PF5 (ADC5/TMS) J6-15 + 55 PF6 (ADC6/TDO) J6-17 + 54 PF7 (ADC7/TDI) J6-19 + 53 GND GND + 52 VCC + 51 PA0 (AD0) J5-?, 74HC5730, 62246DLP-7, RTL8019AS + 50 PA1 (AD1) J5-?, 74HC5730, 62246DLP-7, RTL8019AS + 49 PA2 (AD2) J5-?, 74HC5730, 62246DLP-7, RTL8019AS + +DualOptiboot Bootloader +^^^^^^^^^^^^^^^^^^^^^^^ + +o FTDI (or similar) USB-To-Serial converter with compatible connector + configured for DTR (AdaFruit, SparkFun, etc) +o Obtain ard-reset-arduino Python script + (one source: https://github.com/mikaelpatel/Cosa/blob/master/build/Arduino-Makefile/bin/ard-reset-arduino) + This script triggers the DTR pin to enter bootloader mode. +o Obtain avrdude for your platform. + +Bootloader operates at 115200 baud. It would be useful to create a short script +that invokes ard-reset-arduino and then avrdude to load program. This script +could then also, optionally, invoke miniterm.py or some other serial interface +program for console. + +Example: + +APP=nuttx +CPU=atmega1284p +BAUD=115200 +PORT=/dev/tty.usbserial-A703X8PQ +avr-size --mcu=$CPU -C --format=avr $APP +ard-reset-arduino --verbose $PORT +avrdude -q -V -p $CPU -C {location-of-avrdude.conf} -D -c arduino -b $BAUD \ + -P $PORT -U flash:w:${APP}.hex:i +miniterm.py --port=$PORT --baud=$BAUD -q --lf + +Toolchains +^^^^^^^^^^ + +The toolchain may be selected using the kconfig-mconf tool (via 'make menuconfig'), +by editing the existing configuration file (defconfig), or by overriding +the toolchain on the make commandline with CONFIG_AVR_TOOLCHAIN=. + +The valid values for are BUILDROOT, CROSSPACK, LINUXGCC and WINAVR. + +Buildroot: + + There is a DIY buildroot version for the AVR boards here: + http://sourceforge.net/projects/nuttx/files/buildroot/. See the + following section for details on building this toolchain. + + It is assumed in some places that buildroot toolchain is available + at ../misc/buildroot/build_avr. Edit the setenv.sh file if + this is not the case. + + After configuring NuttX, make sure that CONFIG_AVR_BUILDROOT=y is set in your + .config file. + +WinAVR: + + For Cygwin development environment on Windows machines, you can use + WinAVR: http://sourceforge.net/projects/winavr/files/ + + It is assumed in some places that WinAVR is installed at C:/WinAVR. Edit the + setenv.sh file if this is not the case. + + After configuring NuttX, make sure that CONFIG_AVR_WINAVR=y is set in your + .config file. + + WARNING: There is an incompatible version of cygwin.dll in the WinAVR/bin + directory! Make sure that the path to the correct cygwin.dll file precedes + the path to the WinAVR binaries! + +Linux: + + For Linux, there are widely available avr-gcc packages. On Ubuntu, use: + sudo apt-get install gcc-avr gdb-avr avr-libc + + After configuring NuttX, make sure that CONFIG_AVR_LINUXGCC=y is set in your + .config file. + +Mac OS X: + + For Mac OS X, the CrossPack for AVR toolchain is available from: + + http://www.obdev.at/products/crosspack/index.html + + This toolchain is functionally equivalent to the Linux GCC toolchain. + +Windows Native Toolchains +^^^^^^^^^^^^^^^^^^^^^^^^^ + + The WinAVR toolchain is a Windows native toolchain. There are several + limitations to using a Windows native toolchain in a Cygwin environment. + The three biggest are: + + 1. The Windows toolchain cannot follow Cygwin paths. Path conversions are + performed automatically in the Cygwin makefiles using the 'cygpath' + utility but you might easily find some new path problems. If so, check + out 'cygpath -w' + + 2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic + links are used in Nuttx (e.g., include/arch). The make system works + around these problems for the Windows tools by copying directories + instead of linking them. But this can also cause some confusion for + you: For example, you may edit a file in a "linked" directory and find + that your changes had no effect. That is because you are building the + copy of the file in the "fake" symbolic directory. If you use a + Windows toolchain, you should get in the habit of making like this: + + make clean_context all + + An alias in your .bashrc file might make that less painful. + + 3. Dependencies are not made when using Windows versions of the GCC. This + is because the dependencies are generated using Windows pathes which do + not work with the Cygwin make. + + MKDEP = $(TOPDIR)/tools/mknulldeps.sh + + An additional issue with the WinAVR toolchain, in particular, is that it + contains an incompatible version of the Cygwin DLL in its bin/ directory. + You must take care that the correct Cygwin DLL is used. + +NuttX buildroot Toolchain +^^^^^^^^^^^^^^^^^^^^^^^^^ + + If NuttX buildroot toolchain source tarball cne can be downloaded from the + NuttX SourceForge download site (https://sourceforge.net/projects/nuttx/files/). + This GNU toolchain builds and executes in the Linux or Cygwin environment. + + 1. You must have already configured Nuttx in /nuttx. + + cd tools + ./configure.sh amber/ + + NOTE: you also must copy avr-libc header files into the NuttX include + directory with command perhaps like: + + cp -a /cygdrive/c/WinAVR/include/avr include/. + + 2. Download the latest buildroot package into + + 3. unpack the buildroot tarball. The resulting directory may + have versioning information on it like buildroot-x.y.z. If so, + rename /buildroot-x.y.z to /buildroot. + + 4. cd /buildroot + + 5. cp configs/avr-defconfig-4.5.2 .config + + 6. make oldconfig + + 7. make + + 8. Edit setenv.h, if necessary, so that the PATH variable includes + the path to the newly built binaries. + + See the file configs/README.txt in the buildroot source tree. That has more + detailed PLUS some special instructions that you will need to follow if you + are building a toolchain for Cygwin under Windows. + +avr-libc +^^^^^^^^ + +Header Files + + In any case, header files from avr-libc are required: http://www.nongnu.org/avr-libc/. + A snapshot of avr-lib is included in the WinAVR installation. For Linux + development platforms, avr-libc package is readily available (and would + be installed in the apt-get command shown above). But if you are using + the NuttX buildroot configuration on Cygwin, then you will have to build + get avr-libc from binaries. + +Header File Installation + + The NuttX build will required that the AVR header files be available via + the NuttX include directory. This can be accomplished by either copying + the avr-libc header files into the NuttX include directory: + + cp -a /include/avr /include/. + + Or simply using a symbolic link: + + ln -s /include/avr /include/. + +Build Notes: + + It may not necessary to have a built version of avr-lib; only header files + are required. Bu if you choose to use the optimized libraru functions of + the flowing point library, then you may have to build avr-lib from sources. + Below are instructions for building avr-lib from fresh sources: + + 1. Download the avr-libc package from: + + http://savannah.nongnu.org/projects/avr-libc/ + + I am using avr-lib-1.7.1.tar.bz2 + + 2. Upack the tarball and cd into the + + tar jxf avr-lib-1.7.1.tar.bz2 + cd avr-lib-1.7.1 + + 3. Configure avr-lib. Assuming that WinAVR is installed at the following + loction: + + export PATH=/cygdrive/c/WinAVR/bin:$PATH + ./configure --build=`./config.guess` --host=avr + + This takes a *long* time. + + 4. Make avr-lib. + + make + + This also takes a long time because it generates variants for nearly + all AVR chips. + + 5. Install avr-lib. + + make install + +MoteinoMEGA Configuration Options +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + CONFIG_ARCH - Identifies the arch/ subdirectory. This should + be set to: + + CONFIG_ARCH=avr + + CONFIG_ARCH_FAMILY - For use in C code: + + CONFIG_ARCH_FAMILY=avr + + CONFIG_ARCH_FAMILY_family - For use in C code: + + CONFIG_ARCH_FAMILY_AVR=y + + CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory + + CONFIG_ARCH_CHIP=atmega + + CONFIG_ARCH_CHIP_name - For use in C code to identify the exact + chip: + + CONFIG_ARCH_CHIP_ATMEGA1284P=y + + CONFIG_ARCH_BOARD - Identifies the configs subdirectory and + hence, the board that supports the particular chip or SoC. + + CONFIG_ARCH_BOARD=moteino-mega + + CONFIG_ARCH_BOARD_name - For use in C code + + CONFIG_ARCH_BOARD_MOTEINO_MEGA=y + + CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation + of delay loops + + CONFIG_ENDIAN_BIG - define if big endian (default is little + endian) + + CONFIG_RAM_SIZE - Describes the installed DRAM. One of: + + CONFIG_RAM_SIZE=(16*1024) - (16Kb) + + CONFIG_RAM_START - The start address of installed SRAM + + CONFIG_RAM_START=0x800100 + + CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to boards that + have LEDs + + CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt + stack. If defined, this symbol is the size of the interrupt + stack in bytes. If not defined, the user task stacks will be + used during interrupt handling. + + CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions + + CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture. + + CONFIG_ARCH_CALIBRATION - Enables some build in instrumentation that + cause a 100 second delay during boot-up. This 100 second delay + serves no purpose other than it allows you to calibratre + CONFIG_ARCH_LOOPSPERMSEC. You simply use a stop watch to measure + the 100 second delay then adjust CONFIG_ARCH_LOOPSPERMSEC until + the delay actually is 100 seconds. + + Individual subsystems can be enabled: + + CONFIG_AVR_INT0=n + CONFIG_AVR_INT1=n + CONFIG_AVR_INT2=n + CONFIG_AVR_INT3=n + CONFIG_AVR_INT4=n + CONFIG_AVR_INT5=n + CONFIG_AVR_INT6=n + CONFIG_AVR_INT7=n + CONFIG_AVR_WDT=n + CONFIG_AVR_TIMER0=n + CONFIG_AVR_TIMER1=n + CONFIG_AVR_TIMER2=n + CONFIG_AVR_TIMER3=n + CONFIG_AVR_SPI=n + CONFIG_AVR_USART0=y + CONFIG_AVR_USART1=n + CONFIG_AVR_ADC=n + CONFIG_AVR_ANACOMP=n + CONFIG_AVR_TWI=n + + If the watchdog is enabled, this specifies the initial timeout. Default + is maximum supported value. + + CONFIG_WDTO_15MS + CONFIG_WDTO_30MS + CONFIG_WDTO_60MS + CONFIG_WDTO_120MS + CONFIG_WDTO_1250MS + CONFIG_WDTO_500MS + CONFIG_WDTO_1S + CONFIG_WDTO_2S + CONFIG_WDTO_4S + CONFIG_WDTO_8S + + ATMEGA specific device driver settings + + CONFIG_USARTn_SERIAL_CONSOLE - selects the USARTn for the + console and ttys0 (default is the USART0). + CONFIG_USARTn_RXBUFSIZE - Characters are buffered as received. + This specific the size of the receive buffer + CONFIG_USARTn_TXBUFSIZE - Characters are buffered before + being sent. This specific the size of the transmit buffer + CONFIG_USARTn_BAUD - The configure BAUD of the USART. Must be + CONFIG_USARTn_BITS - The number of bits. Must be either 7 or 8. + CONFIG_USARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity + CONFIG_USARTn_2STOP - Two stop bits + +Configurations +^^^^^^^^^^^^^^ + +Common Configuration Notes +-------------------------- + + 1. Each MoteinoMEGA configuration is maintained in a sub-directory and + can be selected as follow: + + cd tools + ./configure.sh moteino-mega/ + cd - + . ./setenv.sh + + Where is one of the configuration sub-directories described in + the following paragraph. + + NOTE: You must also copy avr-libc header files, perhaps like: + + cp -a /cygdrive/c/WinAVR/include/avr include/. + + 2. These configurations use the mconf-based configuration tool. To + change a 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. + + 3. By default, all configurations assume the NuttX Buildroot toolchain + under Cygwin with Windows. This is easily reconfigured: + + CONFIG_HOST_WINDOWS=y + CONFIG_WINDOWS_CYGWIN=y + CONFIG_AVR_BUILDROOT=y + +Configuration Sub-Directories +----------------------------- + + hello: + The simple apps/examples/hello "Hello, World!" example. + + nsh: + Configures the NuttShell (nsh) located at examples/nsh. The + Configuration enables only the serial NSH interfaces. diff --git a/configs/moteino-mega/hello/Make.defs b/configs/moteino-mega/hello/Make.defs new file mode 100644 index 0000000000..bc2cbaaf48 --- /dev/null +++ b/configs/moteino-mega/hello/Make.defs @@ -0,0 +1,98 @@ +############################################################################ +# configs/moteino-mega/hello/Make.defs +# +# Copyright (C) 2015 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +include ${TOPDIR}/.config +include ${TOPDIR}/tools/Config.mk +include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs + +ifeq ($(WINTOOL),y) + # Windows-native toolchains + DIRLINK = $(TOPDIR)/tools/copydir.sh + DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)/tools/mknulldeps.sh + ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" + ARCHXXINCLUDES = $(ARCHINCLUDES) "${shell cygpath -w $(TOPDIR)/include/cxx}" + ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/hello/ld.script}" +else + # Linux/Cygwin-native toolchain + MKDEP = $(TOPDIR)/tools/mkdeps.sh + ARCHINCLUDES = -I. -isystem "$(TOPDIR)/include" + ARCHXXINCLUDES = $(ARCHINCLUDES) -isystem "$(TOPDIR)/include/cxx" + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/hello/ld.script +endif + +CC = $(CROSSDEV)gcc +CXX = $(CROSSDEV)g++ +CPP = $(CROSSDEV)gcc -E +LD = $(CROSSDEV)ld +AR = $(CROSSDEV)ar rcs +NM = $(CROSSDEV)nm +OBJCOPY = $(CROSSDEV)objcopy +OBJDUMP = $(CROSSDEV)objdump + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + ARCHOPTIMIZATION = -g +endif + +ifneq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer +endif + +ARCHCFLAGS = -fno-builtin +ARCHCXXFLAGS = -fno-builtin -fno-exceptions +ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow +ARCHWARNINGSXX = -Wall -Wshadow +ARCHDEFINES = + +CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ + +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + +OBJEXT = .o +LIBEXT = .a +EXEEXT = + + +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = + diff --git a/configs/moteino-mega/hello/defconfig b/configs/moteino-mega/hello/defconfig new file mode 100644 index 0000000000..ce5e990bf4 --- /dev/null +++ b/configs/moteino-mega/hello/defconfig @@ -0,0 +1,580 @@ +# +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +CONFIG_DEFAULT_SMALL=y +# CONFIG_HOST_LINUX is not set +CONFIG_HOST_OSX=y +# CONFIG_HOST_WINDOWS is not set +# CONFIG_HOST_OTHER is not set +# CONFIG_WINDOWS_NATIVE is not set +# CONFIG_WINDOWS_CYGWIN is not set +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +CONFIG_INTELHEX_BINARY=y +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# 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 + +# +# Debug Options +# +# CONFIG_DEBUG is not set +CONFIG_ARCH_HAVE_STACKCHECK=y +# CONFIG_ARCH_HAVE_HEAPCHECK is not set +# CONFIG_DEBUG_SYMBOLS is not set +CONFIG_ARCH_HAVE_CUSTOMOPT=y +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y + +# +# System Type +# +# CONFIG_ARCH_ARM is not set +CONFIG_ARCH_AVR=y +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# 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="avr" +CONFIG_ARCH_FAMILY="avr" +CONFIG_ARCH_CHIP="atmega" +# CONFIG_ARCH_CHIP_ATMEGA128 is not set +CONFIG_ARCH_CHIP_ATMEGA1284P=y +# CONFIG_ARCH_CHIP_AT90USB646 is not set +# CONFIG_ARCH_CHIP_AT90USB647 is not set +# CONFIG_ARCH_CHIP_AT90USB1286 is not set +# CONFIG_ARCH_CHIP_AT90USB1287 is not set +# CONFIG_ARCH_CHIP_AT32UC3B0256 is not set +CONFIG_ARCH_FAMILY_AVR=y +CONFIG_ARCH_CHIP_ATMEGA=y + +# +# AVR Configuration Options +# +# CONFIG_AVR_WINAVR is not set +CONFIG_AVR_BUILDROOT=y +# CONFIG_AVR_USART1 is not set + +# +# ATMega Configuration Options +# +CONFIG_AVR_USART0=y + +# +# Architecture Options +# +CONFIG_ARCH_NOINTC=y +# CONFIG_ARCH_VECNOTIRQ is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_HAVE_IRQPRIO is not set +# CONFIG_ARCH_ADDRENV is not set +# CONFIG_ARCH_HAVE_VFORK is not set +# CONFIG_ARCH_HAVE_MMU is not set +# CONFIG_ARCH_NAND_HWECC is not set +CONFIG_ARCH_STACKDUMP=y +# CONFIG_ENDIAN_BIG is not set +# CONFIG_ARCH_IDLE_CUSTOM is not set +# CONFIG_ARCH_HAVE_RAMFUNCS is not set +# CONFIG_ARCH_HAVE_RAMVECTORS is not set + +# +# Board Settings +# +CONFIG_BOARD_LOOPSPERMSEC=864 +# CONFIG_ARCH_CALIBRATION is not set + +# +# Interrupt options +# +CONFIG_ARCH_HAVE_INTERRUPTSTACK=y +CONFIG_ARCH_INTERRUPTSTACK=0 +# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set + +# +# 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 + +# +# Boot Memory Configuration +# +CONFIG_RAM_START=0x800100 +CONFIG_RAM_SIZE=16384 +# CONFIG_ARCH_HAVE_SDRAM is not set + +# +# Board Selection +# +CONFIG_ARCH_BOARD_MOTEINO_MEGA=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="moteino-mega" + +# +# Common Board Options +# +CONFIG_ARCH_HAVE_LEDS=y +CONFIG_ARCH_LEDS=y + +# +# Board-Specific Options +# + +# +# RTOS Features +# +# CONFIG_BOARD_INITIALIZE is not set +CONFIG_USEC_PER_TICK=10000 +# CONFIG_SYSTEM_TIME64 is not set +CONFIG_RR_INTERVAL=0 +# CONFIG_SCHED_CPULOAD is not set +# 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=2015 +CONFIG_START_MONTH=1 +CONFIG_START_DAY=21 +CONFIG_DEV_CONSOLE=y +# 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_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="hello_main" +CONFIG_DISABLE_OS_API=y +CONFIG_DISABLE_POSIX_TIMERS=y +CONFIG_DISABLE_PTHREAD=y +CONFIG_DISABLE_SIGNALS=y +CONFIG_DISABLE_MQUEUE=y +CONFIG_DISABLE_ENVIRON=y + +# +# Sizes of configurable things (0 disables) +# +CONFIG_MAX_TASKS=4 +CONFIG_NPTHREAD_KEYS=0 +CONFIG_NFILE_DESCRIPTORS=4 +CONFIG_NFILE_STREAMS=4 +CONFIG_NAME_MAX=32 +CONFIG_PREALLOC_MQ_MSGS=0 +CONFIG_MQ_MAXMSGSIZE=0 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=4 +CONFIG_WDOG_INTRESERVE=0 +CONFIG_PREALLOC_TIMERS=0 + +# +# Stack and heap information +# +CONFIG_IDLETHREAD_STACKSIZE=512 +CONFIG_USERMAIN_STACKSIZE=512 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=1024 + +# +# 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_ARCH_HAVE_PWM_PULSECOUNT is not set +# CONFIG_PWM is not set +# CONFIG_ARCH_HAVE_I2CRESET is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_I2S 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_VIDEO_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_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +CONFIG_DEV_LOWCONSOLE=y +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_USART0=y + +# +# USART Configuration +# +CONFIG_USART0_ISUART=y +CONFIG_MCU_SERIAL=y +CONFIG_USART0_SERIAL_CONSOLE=y +# CONFIG_NO_SERIAL_CONSOLE is not set + +# +# USART0 Configuration +# +CONFIG_USART0_RXBUFSIZE=256 +CONFIG_USART0_TXBUFSIZE=256 +CONFIG_USART0_BAUD=115200 +CONFIG_USART0_BITS=8 +CONFIG_USART0_PARITY=0 +CONFIG_USART0_2STOP=0 +# CONFIG_USART0_IFLOWCONTROL is not set +# CONFIG_USART0_OFLOWCONTROL is not set +# CONFIG_SERIAL_IFLOWCONTROL is not set +# CONFIG_SERIAL_OFLOWCONTROL is not set +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options +# + +# +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_ARCH_HAVE_NET is not set +# CONFIG_ARCH_HAVE_PHY is not set +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +CONFIG_DISABLE_MOUNTPOINT=y +CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y +# CONFIG_FS_READABLE is not set +# CONFIG_FS_WRITABLE is not set +# CONFIG_FS_RAMMAP is not set +# CONFIG_FS_PROCFS is not set + +# +# System Logging +# + +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +# CONFIG_ARCH_HAVE_HEAP2 is not set +# CONFIG_GRAN is not set + +# +# Audio Support +# +# CONFIG_AUDIO is not set + +# +# Binary Formats +# +# 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 + +# +# Library Routines +# + +# +# Standard C Library Options +# +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +# 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_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 +# + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CONFIGDATA 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=y +# 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_NRF24L01TERM is not set +# CONFIG_EXAMPLES_NSH is not set +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXTERM 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_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_WEBSERVER is not set +# CONFIG_EXAMPLES_USBSERIAL 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_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_NETLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# FreeModBus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM +# + +# +# Platform-specific Support +# +# CONFIG_PLATFORM_CONFIGDATA is not set + +# +# System Libraries and NSH Add-Ons +# + +# +# USB CDC/ACM Device Commands +# + +# +# USB Composite Device Commands +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# INI File Parser +# +# CONFIG_SYSTEM_INIFILE is not set + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# FLASH Erase-all Command +# + +# +# NxPlayer media player library / command Line +# +# CONFIG_SYSTEM_NXPLAYER is not set + +# +# RAM test +# +# CONFIG_SYSTEM_RAMTEST is not set + +# +# 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 +# + +# +# EMACS-like Command Line Editor +# +# CONFIG_SYSTEM_CLE is not set + +# +# VI Work-Alike Editor +# +# CONFIG_SYSTEM_VI is not set + +# +# Stack Monitor +# + +# +# USB Mass Storage Device Commands +# + +# +# Zmodem Commands +# +# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/moteino-mega/hello/ld.script b/configs/moteino-mega/hello/ld.script new file mode 100644 index 0000000000..3ea9da807d --- /dev/null +++ b/configs/moteino-mega/hello/ld.script @@ -0,0 +1,211 @@ +/************************************************************************************** + * configs/moteino-mega/hello/ld.script + * + * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + **************************************************************************************/ + +/* Memory Regions *********************************************************************/ +/* -------------- ------ ------+------- -- ------ -- ------ --- ------ ----+------- --- + * FLASH | REGISTERS I/O EXT I/O ISRAM | EEPROM + * | REGISTERS REGISTERS | + * -------------- ------ ------+------- -- ------ -- ------ --- ------ ----+------- --- + * ATMEGA1284P 0x0000 128Kb | 0x0000 32 0x0020 64 0x0060 160 0x0100 16Kb| 0x0000 4Kb + * -------------- ------ ------+------- -- ------ -- ------ --- ------ ----+------- --- + * *Memory configuration A + */ + +MEMORY +{ + flash (rx) : ORIGIN = 0, LENGTH = 128K + sram (rw!x) : ORIGIN = 0x800100, LENGTH = 16K + eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 4K +} + +OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr") +OUTPUT_ARCH(avr:5) +ENTRY(__start) + +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + } + + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + } + + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + } + + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + } + + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + } + + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + } + + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + + .text : + { + _stext = . ; + *(.vectors) + *(.init) + *(.handlers) + *(.text) + *(.text.*) + _etext = . ; + } > flash + + _eronly = ABSOLUTE(.); + + .data : + { + _sdata = ABSOLUTE(.); + *(.data .data.*) + *(.gnu.linkonce.d.*) + CONSTRUCTORS + _edata = ABSOLUTE(.); + } > sram AT > flash + + .bss : + { + _sbss = ABSOLUTE(.); + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + _ebss = ABSOLUTE(.); + } > sram + + /* Global data not cleared after reset. */ + + .noinit : + { + _snoinit = ABSOLUTE(.); + *(.noinit*) + _enoinit = ABSOLUTE(.); + } > sram + + .eeprom : + { + _seeprom = ABSOLUTE(.); + *(.eeprom*) + _eeeprom = ABSOLUTE(.); + } > eeprom + + /* 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. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + + /* 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) } +} diff --git a/configs/moteino-mega/hello/setenv.sh b/configs/moteino-mega/hello/setenv.sh new file mode 100755 index 0000000000..42f7ca44b2 --- /dev/null +++ b/configs/moteino-mega/hello/setenv.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# configs/moteino-mega/hello/setenv.sh +# +# Copyright (C) 2015 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +if [ "$_" = "$0" ] ; then + echo "You must source this script, not run it!" 1>&2 + exit 1 +fi + +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the WinAVR +# toolchain under windows. This is *not* the default install +# location so you will probably have to edit this. You will also have +# to edit this if you install the Linux AVR toolchain as well +#export TOOLCHAIN_BIN="/cygdrive/c/WinAVR/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_avr/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" + +echo "PATH : ${PATH}" diff --git a/configs/moteino-mega/include/board.h b/configs/moteino-mega/include/board.h new file mode 100644 index 0000000000..2d73363b55 --- /dev/null +++ b/configs/moteino-mega/include/board.h @@ -0,0 +1,97 @@ +/**************************************************************************** + * configs/moteino-mega/include/board.h + * include/arch/board/board.h + * + * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __CONFIGS_MOTEINO_MEGA_INCLUDE_BOARD_H +#define __CONFIGS_MOTEINO_MEGA_INCLUDE_BOARD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ + +/* Clocking *****************************************************************/ +/* Assume default CLKDIV8 fuse setting is overridden to CLKDIV1 */ + +#define BOARD_XTAL_FREQ 16000000 /* 16MHz crystal */ +#define BOARD_CPU_CLOCK BOARD_XTAL_FREQ /* F_CPU = 16MHz */ + +/* LED definitions **********************************************************/ + +/* The MoteinoMEGA has a single on-board LED connected to PortD, Pin 7 */ + +#define LED_STARTED 0 /* OFF ON (never happens) */ +#define LED_HEAPALLOCATE 0 /* OFF ON (never happens) */ +#define LED_IRQSENABLED 0 /* OFF ON (never happens) */ +#define LED_STACKCREATED 1 /* ON ON (never happens) */ +#define LED_INIRQ 2 /* OFF NC (momentary) */ +#define LED_SIGNAL 2 /* OFF NC (momentary) */ +#define LED_ASSERTION 2 /* OFF NC (momentary) */ +#define LED_PANIC 0 /* OFF ON (1Hz flashing) */ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +/**************************************************************************** + * Inline Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __CONFIGS_MOTEINO_MEGA_INCLUDE_BOARD_H */ diff --git a/configs/moteino-mega/nsh/Make.defs b/configs/moteino-mega/nsh/Make.defs new file mode 100644 index 0000000000..5556b1b128 --- /dev/null +++ b/configs/moteino-mega/nsh/Make.defs @@ -0,0 +1,98 @@ +############################################################################ +# configs/moteino-mega/nsh/Make.defs +# +# Copyright (C) 2015 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +include ${TOPDIR}/.config +include ${TOPDIR}/tools/Config.mk +include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs + +ifeq ($(WINTOOL),y) + # Windows-native toolchains + DIRLINK = $(TOPDIR)/tools/copydir.sh + DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)/tools/mknulldeps.sh + ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" + ARCHXXINCLUDES = $(ARCHINCLUDES) "${shell cygpath -w $(TOPDIR)/include/cxx}" + ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script}" +else + # Linux/Cygwin-native toolchain + MKDEP = $(TOPDIR)/tools/mkdeps.sh + ARCHINCLUDES = -I. -isystem "$(TOPDIR)/include" + ARCHXXINCLUDES = $(ARCHINCLUDES) -isystem "$(TOPDIR)/include/cxx" + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script +endif + +CC = $(CROSSDEV)gcc +CXX = $(CROSSDEV)g++ +CPP = $(CROSSDEV)gcc -E +LD = $(CROSSDEV)ld +AR = $(CROSSDEV)ar rcs +NM = $(CROSSDEV)nm +OBJCOPY = $(CROSSDEV)objcopy +OBJDUMP = $(CROSSDEV)objdump + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + ARCHOPTIMIZATION = -g +endif + +ifneq ($(CONFIG_DEBUG_NOOPT),y) + ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer +endif + +ARCHCFLAGS = -fno-builtin +ARCHCXXFLAGS = -fno-builtin -fno-exceptions +ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow +ARCHWARNINGSXX = -Wall -Wshadow +ARCHDEFINES = + +CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ + +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + +OBJEXT = .o +LIBEXT = .a +EXEEXT = + + +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = + diff --git a/configs/moteino-mega/nsh/defconfig b/configs/moteino-mega/nsh/defconfig new file mode 100644 index 0000000000..c2e3526258 --- /dev/null +++ b/configs/moteino-mega/nsh/defconfig @@ -0,0 +1,651 @@ +# +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +CONFIG_DEFAULT_SMALL=y +# CONFIG_HOST_LINUX is not set +CONFIG_HOST_OSX=y +# CONFIG_HOST_WINDOWS is not set +# CONFIG_HOST_OTHER is not set +# CONFIG_WINDOWS_NATIVE is not set +# CONFIG_WINDOWS_CYGWIN is not set +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set + +# +# Build Configuration +# +# CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +CONFIG_INTELHEX_BINARY=y +# CONFIG_MOTOROLA_SREC is not set +# CONFIG_RAW_BINARY is not set + +# +# Customize Header Files +# +# 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 + +# +# Debug Options +# +# CONFIG_DEBUG is not set +CONFIG_ARCH_HAVE_STACKCHECK=y +# CONFIG_ARCH_HAVE_HEAPCHECK is not set +# CONFIG_DEBUG_SYMBOLS is not set +CONFIG_ARCH_HAVE_CUSTOMOPT=y +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y + +# +# System Type +# +# CONFIG_ARCH_ARM is not set +CONFIG_ARCH_AVR=y +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# 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="avr" +CONFIG_ARCH_FAMILY="avr" +CONFIG_ARCH_CHIP="atmega" +# CONFIG_ARCH_CHIP_ATMEGA128 is not set +CONFIG_ARCH_CHIP_ATMEGA1284P=y +# CONFIG_ARCH_CHIP_AT90USB646 is not set +# CONFIG_ARCH_CHIP_AT90USB647 is not set +# CONFIG_ARCH_CHIP_AT90USB1286 is not set +# CONFIG_ARCH_CHIP_AT90USB1287 is not set +# CONFIG_ARCH_CHIP_AT32UC3B0256 is not set +CONFIG_ARCH_FAMILY_AVR=y +CONFIG_ARCH_CHIP_ATMEGA=y + +# +# AVR Configuration Options +# +# CONFIG_AVR_WINAVR is not set +CONFIG_AVR_BUILDROOT=y +# CONFIG_AVR_USART1 is not set + +# +# ATMega Configuration Options +# +CONFIG_AVR_USART0=y + +# +# Architecture Options +# +CONFIG_ARCH_NOINTC=y +# CONFIG_ARCH_VECNOTIRQ is not set +# CONFIG_ARCH_DMA is not set +# CONFIG_ARCH_HAVE_IRQPRIO is not set +# CONFIG_ARCH_ADDRENV is not set +# CONFIG_ARCH_HAVE_VFORK is not set +# CONFIG_ARCH_HAVE_MMU is not set +# CONFIG_ARCH_NAND_HWECC is not set +CONFIG_ARCH_STACKDUMP=y +# CONFIG_ENDIAN_BIG is not set +# CONFIG_ARCH_IDLE_CUSTOM is not set +# CONFIG_ARCH_HAVE_RAMFUNCS is not set +# CONFIG_ARCH_HAVE_RAMVECTORS is not set + +# +# Board Settings +# +CONFIG_BOARD_LOOPSPERMSEC=864 +# CONFIG_ARCH_CALIBRATION is not set + +# +# Interrupt options +# +CONFIG_ARCH_HAVE_INTERRUPTSTACK=y +CONFIG_ARCH_INTERRUPTSTACK=0 +# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set + +# +# 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 + +# +# Boot Memory Configuration +# +CONFIG_RAM_START=0x800100 +CONFIG_RAM_SIZE=16384 +# CONFIG_ARCH_HAVE_SDRAM is not set + +# +# Board Selection +# +CONFIG_ARCH_BOARD_MOTEINO_MEGA=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="moteino-mega" + +# +# Common Board Options +# +CONFIG_ARCH_HAVE_LEDS=y +CONFIG_ARCH_LEDS=y +CONFIG_NSH_MMCSDMINOR=0 + +# +# Board-Specific Options +# + +# +# RTOS Features +# +# CONFIG_BOARD_INITIALIZE is not set +CONFIG_USEC_PER_TICK=10000 +# CONFIG_SYSTEM_TIME64 is not set +CONFIG_RR_INTERVAL=200 +# CONFIG_SCHED_CPULOAD is not set +# 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=2015 +CONFIG_START_MONTH=1 +CONFIG_START_DAY=21 +CONFIG_DEV_CONSOLE=y +# 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_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="nsh_main" +CONFIG_DISABLE_OS_API=y +CONFIG_DISABLE_POSIX_TIMERS=y +CONFIG_DISABLE_PTHREAD=y +# CONFIG_DISABLE_SIGNALS is not set +CONFIG_DISABLE_MQUEUE=y +# CONFIG_DISABLE_ENVIRON is not set + +# +# Signal Numbers +# +CONFIG_SIG_SIGUSR1=1 +CONFIG_SIG_SIGUSR2=2 +CONFIG_SIG_SIGALARM=3 + +# +# Sizes of configurable things (0 disables) +# +CONFIG_MAX_TASKS=8 +CONFIG_NPTHREAD_KEYS=0 +CONFIG_NFILE_DESCRIPTORS=6 +CONFIG_NFILE_STREAMS=6 +CONFIG_NAME_MAX=32 +CONFIG_PREALLOC_MQ_MSGS=0 +CONFIG_MQ_MAXMSGSIZE=0 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=4 +CONFIG_WDOG_INTRESERVE=0 +CONFIG_PREALLOC_TIMERS=0 + +# +# Stack and heap information +# +CONFIG_IDLETHREAD_STACKSIZE=512 +CONFIG_USERMAIN_STACKSIZE=512 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=512 + +# +# 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_ARCH_HAVE_PWM_PULSECOUNT is not set +# CONFIG_PWM is not set +# CONFIG_ARCH_HAVE_I2CRESET is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_I2S 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_VIDEO_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_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +CONFIG_DEV_LOWCONSOLE=y +# CONFIG_16550_UART is not set +CONFIG_ARCH_HAVE_USART0=y + +# +# USART Configuration +# +CONFIG_USART0_ISUART=y +CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y +CONFIG_USART0_SERIAL_CONSOLE=y +# CONFIG_NO_SERIAL_CONSOLE is not set + +# +# USART0 Configuration +# +CONFIG_USART0_RXBUFSIZE=256 +CONFIG_USART0_TXBUFSIZE=256 +CONFIG_USART0_BAUD=115200 +CONFIG_USART0_BITS=8 +CONFIG_USART0_PARITY=0 +CONFIG_USART0_2STOP=0 +# CONFIG_USART0_IFLOWCONTROL is not set +# CONFIG_USART0_OFLOWCONTROL is not set +# CONFIG_SERIAL_IFLOWCONTROL is not set +# CONFIG_SERIAL_OFLOWCONTROL is not set +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options +# + +# +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_ARCH_HAVE_NET is not set +# CONFIG_ARCH_HAVE_PHY is not set +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +CONFIG_DISABLE_MOUNTPOINT=y +CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y +# CONFIG_FS_READABLE is not set +# CONFIG_FS_WRITABLE is not set +# CONFIG_FS_RAMMAP is not set +# CONFIG_FS_PROCFS is not set + +# +# System Logging +# + +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +# CONFIG_ARCH_HAVE_HEAP2 is not set +# CONFIG_GRAN is not set + +# +# Audio Support +# +# CONFIG_AUDIO is not set + +# +# Binary Formats +# +# 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 + +# +# Library Routines +# + +# +# Standard C Library Options +# +CONFIG_STDIO_BUFFER_SIZE=0 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=0 +CONFIG_LIB_HOMEDIR="/" +# CONFIG_LIBM is not set +CONFIG_NOPRINTF_FIELDWIDTH=y +# 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_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 +# + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CONFIGDATA 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_NRF24L01TERM is not set +CONFIG_EXAMPLES_NSH=y +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXTERM 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_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_WEBSERVER is not set +# CONFIG_EXAMPLES_USBSERIAL 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_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_NETLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# FreeModBus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +CONFIG_NSH_LIBRARY=y +CONFIG_NSH_READLINE=y +# CONFIG_NSH_CLE is not set + +# +# Disable Individual commands +# +CONFIG_NSH_DISABLE_ADDROUTE=y +# CONFIG_NSH_DISABLE_CAT is not set +# CONFIG_NSH_DISABLE_CD is not set +# CONFIG_NSH_DISABLE_CP is not set +CONFIG_NSH_DISABLE_CMP=y +CONFIG_NSH_DISABLE_DD=y +CONFIG_NSH_DISABLE_DF=y +CONFIG_NSH_DISABLE_DELROUTE=y +# CONFIG_NSH_DISABLE_ECHO is not set +CONFIG_NSH_DISABLE_EXEC=y +CONFIG_NSH_DISABLE_EXIT=y +# CONFIG_NSH_DISABLE_FREE is not set +CONFIG_NSH_DISABLE_GET=y +# CONFIG_NSH_DISABLE_HELP is not set +CONFIG_NSH_DISABLE_HEXDUMP=y +# CONFIG_NSH_DISABLE_IFCONFIG is not set +# CONFIG_NSH_DISABLE_KILL is not set +CONFIG_NSH_DISABLE_LOSETUP=y +# CONFIG_NSH_DISABLE_LS is not set +# CONFIG_NSH_DISABLE_MB is not set +# CONFIG_NSH_DISABLE_MKDIR is not set +CONFIG_NSH_DISABLE_MKFIFO=y +CONFIG_NSH_DISABLE_MKRD=y +# CONFIG_NSH_DISABLE_MH is not set +# CONFIG_NSH_DISABLE_MOUNT is not set +# CONFIG_NSH_DISABLE_MW is not set +# CONFIG_NSH_DISABLE_PS is not set +CONFIG_NSH_DISABLE_PUT=y +# 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=y +CONFIG_NSH_DISABLE_XD=y + +# +# Configure Command Options +# +CONFIG_NSH_CODECS_BUFSIZE=128 +CONFIG_NSH_FILEIOSIZE=512 +CONFIG_NSH_LINELEN=64 +CONFIG_NSH_DISABLE_SEMICOLON=y +CONFIG_NSH_MAXARGUMENTS=6 +# CONFIG_NSH_ARGCAT is not set +CONFIG_NSH_NESTDEPTH=3 +CONFIG_NSH_DISABLESCRIPT=y +# CONFIG_NSH_DISABLEBG is not set +CONFIG_NSH_CONSOLE=y + +# +# NxWidgets/NxWM +# + +# +# Platform-specific Support +# +# CONFIG_PLATFORM_CONFIGDATA is not set + +# +# System Libraries and NSH Add-Ons +# + +# +# USB CDC/ACM Device Commands +# + +# +# USB Composite Device Commands +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# INI File Parser +# +# CONFIG_SYSTEM_INIFILE is not set + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# FLASH Erase-all Command +# + +# +# NxPlayer media player library / command Line +# +# CONFIG_SYSTEM_NXPLAYER is not set + +# +# RAM test +# +# CONFIG_SYSTEM_RAMTEST is not set + +# +# 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 +# + +# +# EMACS-like Command Line Editor +# +# CONFIG_SYSTEM_CLE is not set + +# +# VI Work-Alike Editor +# +# CONFIG_SYSTEM_VI is not set + +# +# Stack Monitor +# + +# +# USB Mass Storage Device Commands +# + +# +# Zmodem Commands +# +# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/moteino-mega/nsh/ld.script b/configs/moteino-mega/nsh/ld.script new file mode 100644 index 0000000000..d613030d3b --- /dev/null +++ b/configs/moteino-mega/nsh/ld.script @@ -0,0 +1,211 @@ +/************************************************************************************** + * configs/moteino-mega/nsh/ld.script + * + * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + **************************************************************************************/ + +/* Memory Regions *********************************************************************/ +/* -------------- ------ ------+------- -- ------ -- ------ --- ------ ----+------- --- + * FLASH | REGISTERS I/O EXT I/O ISRAM | EEPROM + * | REGISTERS REGISTERS | + * -------------- ------ ------+------- -- ------ -- ------ --- ------ ----+------- --- + * ATMEGA1284P 0x0000 128Kb | 0x0000 32 0x0020 64 0x0060 160 0x0100 16Kb| 0x0000 4Kb + * -------------- ------ ------+------- -- ------ -- ------ --- ------ ----+------- --- + * *Memory configuration A + */ + +MEMORY +{ + flash (rx) : ORIGIN = 0, LENGTH = 128K + sram (rw!x) : ORIGIN = 0x800100, LENGTH = 16K + eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 4K +} + +OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr") +OUTPUT_ARCH(avr:5) +ENTRY(__start) + +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + } + + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + } + + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + } + + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + } + + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + } + + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + } + + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + + .text : + { + _stext = . ; + *(.vectors) + *(.init) + *(.handlers) + *(.text) + *(.text.*) + _etext = . ; + } > flash + + _eronly = ABSOLUTE(.); + + .data : + { + _sdata = ABSOLUTE(.); + *(.data .data.*) + *(.gnu.linkonce.d.*) + CONSTRUCTORS + _edata = ABSOLUTE(.); + } > sram AT > flash + + .bss : + { + _sbss = ABSOLUTE(.); + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + _ebss = ABSOLUTE(.); + } > sram + + /* Global data not cleared after reset. */ + + .noinit : + { + _snoinit = ABSOLUTE(.); + *(.noinit*) + _enoinit = ABSOLUTE(.); + } > sram + + .eeprom : + { + _seeprom = ABSOLUTE(.); + *(.eeprom*) + _eeeprom = ABSOLUTE(.); + } > eeprom + + /* 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. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + + /* 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) } +} diff --git a/configs/moteino-mega/nsh/setenv.sh b/configs/moteino-mega/nsh/setenv.sh new file mode 100755 index 0000000000..ee47389b9d --- /dev/null +++ b/configs/moteino-mega/nsh/setenv.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# configs/moteino-mega/nsh/setenv.sh +# +# Copyright (C) 2015 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +if [ "$_" = "$0" ] ; then + echo "You must source this script, not run it!" 1>&2 + exit 1 +fi + +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the WinAVR +# toolchain under windows. This is *not* the default install +# location so you will probably have to edit this. You will also have +# to edit this if you install the Linux AVR toolchain as well +#export TOOLCHAIN_BIN="/cygdrive/c/WinAVR/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_avr/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" + +echo "PATH : ${PATH}" diff --git a/configs/moteino-mega/src/.gitignore b/configs/moteino-mega/src/.gitignore new file mode 100644 index 0000000000..726d936e1e --- /dev/null +++ b/configs/moteino-mega/src/.gitignore @@ -0,0 +1,2 @@ +/.depend +/Make.dep diff --git a/configs/moteino-mega/src/Makefile b/configs/moteino-mega/src/Makefile new file mode 100644 index 0000000000..b9b8dae971 --- /dev/null +++ b/configs/moteino-mega/src/Makefile @@ -0,0 +1,96 @@ +############################################################################ +# configs/moteino-mega/src/Makefile +# +# Copyright (C) 2015 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +-include $(TOPDIR)/Make.defs + +ASRCS = +CSRCS = up_boot.c + +ifeq ($(CONFIG_ARCH_LEDS),y) +CSRCS += up_leds.c +endif + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src +ifeq ($(CONFIG_ARCH_FAMILY_AVR32),y) +ARCH_SUBDIR = avr32 +endif +ifeq ($(CONFIG_ARCH_FAMILY_AVR),y) +ARCH_SUBDIR = avr +endif + +ifeq ($(WINTOOL),y) + CFLAGS += -I "${shell cygpath -w $(TOPDIR)/sched}" + CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" + CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" + CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/$(ARCH_SUBDIR)}" +else + CFLAGS += -I "$(TOPDIR)/sched" + CFLAGS += -I "$(ARCH_SRCDIR)/chip" + CFLAGS += -I "$(ARCH_SRCDIR)/common" + CFLAGS += -I "$(ARCH_SRCDIR)/$(ARCH_SUBDIR)" +endif + +all: libboard$(LIBEXT) + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +libboard$(LIBEXT): $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) + +.depend: Makefile $(SRCS) + $(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ + +depend: .depend + +clean: + $(call DELFILE, libboard$(LIBEXT)) + $(call CLEAN) + +distclean: clean + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/configs/moteino-mega/src/moteino_mega_internal.h b/configs/moteino-mega/src/moteino_mega_internal.h new file mode 100644 index 0000000000..078242e33b --- /dev/null +++ b/configs/moteino-mega/src/moteino_mega_internal.h @@ -0,0 +1,101 @@ +/**************************************************************************** + * configs/moteino-mega/src/moteino-mega-internal.h + * + * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __CONFIGS_MOTEINO_MEGA_SRC_MOTEINO_MEGA_INTERNAL_H +#define __CONFIGS_MOTEINO_MEGA_SRC_MOTEINO_MEGA_INTERNAL_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ +/* Configuration ************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +#ifndef __ASSEMBLY__ + +/**************************************************************************** + * Inline Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +/************************************************************************************ + * Name: atmega_spiinitialize + * + * Description: + * Called to configure SPI chip select GPIO pins for the Amber Web Server. + * + ************************************************************************************/ + +#if defined(CONFIG_AVR_SPI1) || defined(CONFIG_AVR_SPI2) +EXTERN void weak_function atmega_spiinitialize(void); +#endif + +/************************************************************************************ + * Name: atmega_ledinit + * + * Description: + * Configure on-board LEDs if LED support has been selected. + * + ************************************************************************************/ + +#ifdef CONFIG_ARCH_LEDS +EXTERN void atmega_ledinit(void); +#endif + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __CONFIGS_MOTEINO_MEGA_SRC_MOTEINO_MEGA_INTERNAL_H */ diff --git a/configs/moteino-mega/src/up_boot.c b/configs/moteino-mega/src/up_boot.c new file mode 100644 index 0000000000..80233bb897 --- /dev/null +++ b/configs/moteino-mega/src/up_boot.c @@ -0,0 +1,92 @@ +/************************************************************************************ + * configs/moteino-mega/src/up_boot.c + * + * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ************************************************************************************/ + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include + +#include + +#include + +#include "up_arch.h" +#include "up_internal.h" + +#include "atmega_internal.h" +#include "moteino_mega_internal.h" + +/************************************************************************************ + * Definitions + ************************************************************************************/ + +/************************************************************************************ + * Private Functions + ************************************************************************************/ + +/************************************************************************************ + * Public Functions + ************************************************************************************/ + +/************************************************************************************ + * Name: up_boardinitialize + * + * Description: + * All ATMega 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 up_boardinitialize(void) +{ + /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the weak + * function atmega_spiinitialize() has been brought into the link. + */ + +#if defined(CONFIG_AVR_SPI1) || defined(CONFIG_AVR_SPI2) + if (atmega_spiinitialize) + { + atmega_spiinitialize(); + } +#endif + + /* Configure on-board LEDs if LED support has been selected. */ + +#ifdef CONFIG_ARCH_LEDS + atmega_ledinit(); +#endif +} diff --git a/configs/moteino-mega/src/up_leds.c b/configs/moteino-mega/src/up_leds.c new file mode 100644 index 0000000000..bc436aa5b4 --- /dev/null +++ b/configs/moteino-mega/src/up_leds.c @@ -0,0 +1,189 @@ +/**************************************************************************** + * configs/moteino-mega/src/up_leds.c + * + * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include "up_arch.h" +#include "up_internal.h" + +#include "atmega_internal.h" +#include "moteino_mega_internal.h" + +#ifdef CONFIG_ARCH_LEDS + +/**************************************************************************** + * Definitions + ****************************************************************************/ + +/* CONFIG_DEBUG_LEDS enables debug output from this file (needs CONFIG_DEBUG + * with CONFIG_DEBUG_VERBOSE too) + */ + +#ifdef CONFIG_DEBUG_LEDS +# define leddbg lldbg +# ifdef CONFIG_DEBUG_VERBOSE +# define ledvdbg lldbg +# else +# define ledvdbg(x...) +# endif +#else +# define leddbg(x...) +# define ledvdbg(x...) +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static bool g_ncoff; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: atmega_ledinit + ****************************************************************************/ + +void atmega_ledinit(void) +{ + /* The MoteinoMEGA's single LED is on Port D, Pin 7. Configure this pin as an + * output and turn it OFF. The "other" side of the LED is onnected to + * ground through a resistor. Therefore, a logic value of 0 should turn + * the LED off. + */ + + DDRD |= (1 << 7); + PORTD &= ~(1 << 7); + g_ncoff = true; +} + +/**************************************************************************** + * Name: board_led_on + ****************************************************************************/ + +void board_led_on(int led) +{ + /* ON OFF + * LED_STARTED 0 OFF ON (never happens) + * LED_HEAPALLOCATE 0 OFF ON (never happens) + * LED_IRQSENABLED 0 OFF ON (never happens) + * LED_STACKCREATED 1 ON ON (never happens) + * LED_INIRQ 2 OFF NC (momentary) + * LED_SIGNAL 2 OFF NC (momentary) + * LED_ASSERTION 2 OFF NC (momentary) + * LED_PANIC 0 OFF ON (1Hz flashing) + */ + + switch (led) + { + case 0: + /* The steady state is OFF */ + + g_ncoff = true; + + case 2: + /* Turn the LED off */ + + PORTD &= ~(1 << 7); + break; + + case 1: + /* The steady state is ON */ + + PORTD |= (1 << 7); + g_ncoff = false; + break; + + default: + return; + } +} + +/**************************************************************************** + * Name: board_led_off + ****************************************************************************/ + +void board_led_off(int led) +{ + /* ON OFF + * LED_STARTED 0 OFF ON (never happens) + * LED_HEAPALLOCATE 0 OFF ON (never happens) + * LED_IRQSENABLED 0 OFF ON (never happens) + * LED_STACKCREATED 1 ON ON (never happens) + * LED_INIRQ 2 OFF NC (momentary) + * LED_SIGNAL 2 OFF NC (momentary) + * LED_ASSERTION 2 OFF NC (momentary) + * LED_PANIC 0 OFF ON (1Hz flashing) + */ + + switch (led) + { + case 2: + /* If the "no-change" state is OFF, then turn the LED off */ + + if (g_ncoff) + { + PORTD &= ~(1 << 7); + break; + } + + /* Otherwise, fall through to turn the LED ON */ + + case 0: + case 1: + /* Turn the LED on */ + + PORTD |= (1 << 7); + break; + + default: + return; + } +} + +#endif /* CONFIG_ARCH_LEDS */ From df36a6243c723e002f38b3dfeb68215ae84c2eec Mon Sep 17 00:00:00 2001 From: jeditekunum Date: Mon, 26 Jan 2015 14:33:25 -0600 Subject: [PATCH 2/4] Try console on serial 1. --- configs/moteino-mega/nsh/defconfig | 39 +++++++++++++++++++----------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/configs/moteino-mega/nsh/defconfig b/configs/moteino-mega/nsh/defconfig index c2e3526258..e27b3fce11 100644 --- a/configs/moteino-mega/nsh/defconfig +++ b/configs/moteino-mega/nsh/defconfig @@ -82,12 +82,14 @@ CONFIG_ARCH_CHIP_ATMEGA=y # # CONFIG_AVR_WINAVR is not set CONFIG_AVR_BUILDROOT=y -# CONFIG_AVR_USART1 is not set # # ATMega Configuration Options # -CONFIG_AVR_USART0=y + +# +# ATMega Peripheral Selections +CONFIG_AVR_USART1=y # # Architecture Options @@ -147,7 +149,6 @@ CONFIG_ARCH_BOARD="moteino-mega" # CONFIG_ARCH_HAVE_LEDS=y CONFIG_ARCH_LEDS=y -CONFIG_NSH_MMCSDMINOR=0 # # Board-Specific Options @@ -247,30 +248,38 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -CONFIG_DEV_LOWCONSOLE=y +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set -CONFIG_ARCH_HAVE_USART0=y +CONFIG_ARCH_HAVE_USART1=y # # USART Configuration # -CONFIG_USART0_ISUART=y +CONFIG_USART1_ISUART=y CONFIG_MCU_SERIAL=y CONFIG_STANDARD_SERIAL=y -CONFIG_USART0_SERIAL_CONSOLE=y +CONFIG_USART1_SERIAL_CONSOLE=y # CONFIG_NO_SERIAL_CONSOLE is not set # -# USART0 Configuration +# USART Configuration # -CONFIG_USART0_RXBUFSIZE=256 -CONFIG_USART0_TXBUFSIZE=256 -CONFIG_USART0_BAUD=115200 -CONFIG_USART0_BITS=8 -CONFIG_USART0_PARITY=0 -CONFIG_USART0_2STOP=0 +#CONFIG_USART0_RXBUFSIZE=256 +#CONFIG_USART0_TXBUFSIZE=256 +#CONFIG_USART0_BAUD=115200 +#CONFIG_USART0_BITS=8 +#CONFIG_USART0_PARITY=0 +#CONFIG_USART0_2STOP=0 # CONFIG_USART0_IFLOWCONTROL is not set # CONFIG_USART0_OFLOWCONTROL is not set +CONFIG_USART1_RXBUFSIZE=256 +CONFIG_USART1_TXBUFSIZE=256 +CONFIG_USART1_BAUD=38400 +CONFIG_USART1_BITS=8 +CONFIG_USART1_PARITY=0 +CONFIG_USART1_2STOP=0 +# CONFIG_USART1_IFLOWCONTROL is not set +# CONFIG_USART1_OFLOWCONTROL is not set # CONFIG_SERIAL_IFLOWCONTROL is not set # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_USBDEV is not set @@ -335,6 +344,7 @@ CONFIG_MM_REGIONS=1 # 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 is not set @@ -373,6 +383,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # # Non-standard Library Support # +# CONFIG_SCHED_WORKQUEUE is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set From cd2be452eee4af3de73d7980cf6cbd7634c7851e Mon Sep 17 00:00:00 2001 From: jeditekunum Date: Sat, 31 Jan 2015 11:59:39 -0600 Subject: [PATCH 3/4] Complete initial port. --- configs/moteino-mega/hello/defconfig | 236 ++++++++++++++------- configs/moteino-mega/hello/ld.script | 6 +- configs/moteino-mega/nsh/defconfig | 304 ++++++++++++++++++--------- configs/moteino-mega/nsh/ld.script | 4 + 4 files changed, 373 insertions(+), 177 deletions(-) diff --git a/configs/moteino-mega/hello/defconfig b/configs/moteino-mega/hello/defconfig index ce5e990bf4..68c0e5befc 100644 --- a/configs/moteino-mega/hello/defconfig +++ b/configs/moteino-mega/hello/defconfig @@ -12,10 +12,6 @@ CONFIG_DEFAULT_SMALL=y CONFIG_HOST_OSX=y # CONFIG_HOST_WINDOWS is not set # CONFIG_HOST_OTHER is not set -# CONFIG_WINDOWS_NATIVE is not set -# CONFIG_WINDOWS_CYGWIN is not set -# CONFIG_WINDOWS_MSYS is not set -# CONFIG_WINDOWS_OTHER is not set # # Build Configuration @@ -30,10 +26,12 @@ CONFIG_HOST_OSX=y CONFIG_INTELHEX_BINARY=y # CONFIG_MOTOROLA_SREC is not set # CONFIG_RAW_BINARY is not set +# CONFIG_UBOOT_UIMAGE is not set # # Customize Header Files # +# CONFIG_ARCH_STDINT_H is not set # CONFIG_ARCH_STDBOOL_H is not set # CONFIG_ARCH_MATH_H is not set # CONFIG_ARCH_FLOAT_H is not set @@ -67,26 +65,27 @@ CONFIG_ARCH_AVR=y CONFIG_ARCH="avr" CONFIG_ARCH_FAMILY="avr" CONFIG_ARCH_CHIP="atmega" -# CONFIG_ARCH_CHIP_ATMEGA128 is not set -CONFIG_ARCH_CHIP_ATMEGA1284P=y -# CONFIG_ARCH_CHIP_AT90USB646 is not set -# CONFIG_ARCH_CHIP_AT90USB647 is not set -# CONFIG_ARCH_CHIP_AT90USB1286 is not set -# CONFIG_ARCH_CHIP_AT90USB1287 is not set -# CONFIG_ARCH_CHIP_AT32UC3B0256 is not set -CONFIG_ARCH_FAMILY_AVR=y CONFIG_ARCH_CHIP_ATMEGA=y +# CONFIG_ARCH_CHIP_AT90USB is not set +# CONFIG_ARCH_CHIP_AT32UC3 is not set +CONFIG_ARCH_FAMILY_AVR=y +# CONFIG_ARCH_FAMILY_AVR32 is not set # # AVR Configuration Options # -# CONFIG_AVR_WINAVR is not set -CONFIG_AVR_BUILDROOT=y +CONFIG_AVR_CROSSPACK=y # CONFIG_AVR_USART1 is not set # # ATMega Configuration Options # +# CONFIG_ARCH_CHIP_ATMEGA128 is not set +CONFIG_ARCH_CHIP_ATMEGA1284P=y + +# +# ATMega Peripheral Selections +# CONFIG_AVR_USART0=y # @@ -96,10 +95,15 @@ CONFIG_ARCH_NOINTC=y # CONFIG_ARCH_VECNOTIRQ is not set # CONFIG_ARCH_DMA is not set # CONFIG_ARCH_HAVE_IRQPRIO is not set -# CONFIG_ARCH_ADDRENV is not set +# CONFIG_ARCH_L2CACHE is not set +# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set +# CONFIG_ARCH_HAVE_ADDRENV is not set +# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set # CONFIG_ARCH_HAVE_VFORK is not set # CONFIG_ARCH_HAVE_MMU is not set +# CONFIG_ARCH_HAVE_MPU is not set # CONFIG_ARCH_NAND_HWECC is not set +# CONFIG_ARCH_HAVE_EXTCLK is not set CONFIG_ARCH_STACKDUMP=y # CONFIG_ENDIAN_BIG is not set # CONFIG_ARCH_IDLE_CUSTOM is not set @@ -109,7 +113,7 @@ CONFIG_ARCH_STACKDUMP=y # # Board Settings # -CONFIG_BOARD_LOOPSPERMSEC=864 +CONFIG_BOARD_LOOPSPERMSEC=888 # CONFIG_ARCH_CALIBRATION is not set # @@ -155,29 +159,6 @@ CONFIG_ARCH_LEDS=y # # RTOS Features # -# CONFIG_BOARD_INITIALIZE is not set -CONFIG_USEC_PER_TICK=10000 -# CONFIG_SYSTEM_TIME64 is not set -CONFIG_RR_INTERVAL=0 -# CONFIG_SCHED_CPULOAD is not set -# 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=2015 -CONFIG_START_MONTH=1 -CONFIG_START_DAY=21 -CONFIG_DEV_CONSOLE=y -# 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_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="hello_main" CONFIG_DISABLE_OS_API=y CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_DISABLE_PTHREAD=y @@ -186,27 +167,71 @@ CONFIG_DISABLE_MQUEUE=y CONFIG_DISABLE_ENVIRON=y # -# Sizes of configurable things (0 disables) +# Clocks and Timers # -CONFIG_MAX_TASKS=4 -CONFIG_NPTHREAD_KEYS=0 -CONFIG_NFILE_DESCRIPTORS=4 -CONFIG_NFILE_STREAMS=4 -CONFIG_NAME_MAX=32 -CONFIG_PREALLOC_MQ_MSGS=0 -CONFIG_MQ_MAXMSGSIZE=0 +CONFIG_USEC_PER_TICK=10000 +# CONFIG_SYSTEM_TIME64 is not set +# CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2015 +CONFIG_START_MONTH=1 +CONFIG_START_DAY=31 CONFIG_MAX_WDOGPARMS=2 CONFIG_PREALLOC_WDOGS=4 CONFIG_WDOG_INTRESERVE=0 CONFIG_PREALLOC_TIMERS=0 +# +# Tasks and Scheduling +# +# CONFIG_INIT_NONE is not set +CONFIG_INIT_ENTRYPOINT=y +# CONFIG_INIT_FILEPATH is not set +CONFIG_USER_ENTRYPOINT="hello_main" +CONFIG_RR_INTERVAL=0 +CONFIG_TASK_NAME_SIZE=0 +CONFIG_MAX_TASKS=4 +# CONFIG_SCHED_HAVE_PARENT is not set +# CONFIG_SCHED_WAITPID is not set + +# +# Performance Monitoring +# +# CONFIG_SCHED_CPULOAD is not set +# CONFIG_SCHED_INSTRUMENTATION is not set + +# +# Files and I/O +# +CONFIG_DEV_CONSOLE=y +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +CONFIG_NFILE_DESCRIPTORS=4 +CONFIG_NFILE_STREAMS=4 +CONFIG_NAME_MAX=32 +# CONFIG_PRIORITY_INHERITANCE is not set + +# +# RTOS hooks +# +# CONFIG_BOARD_INITIALIZE is not set +# CONFIG_SCHED_STARTHOOK is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set + +# +# Work Queue Support +# + # # Stack and heap information # CONFIG_IDLETHREAD_STACKSIZE=512 CONFIG_USERMAIN_STACKSIZE=512 CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=1024 +CONFIG_PTHREAD_STACK_DEFAULT=512 +# CONFIG_LIB_SYSCALL is not set # # Device Drivers @@ -215,6 +240,12 @@ CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set # CONFIG_LOOP is not set + +# +# Buffering +# +# CONFIG_DRVR_WRITEBUFFER is not set +# CONFIG_DRVR_READAHEAD is not set # CONFIG_RAMDISK is not set # CONFIG_CAN is not set # CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set @@ -225,6 +256,7 @@ CONFIG_DEV_NULL=y # CONFIG_I2S is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set +# CONFIG_TIMER is not set # CONFIG_ANALOG is not set # CONFIG_AUDIO_DEVICES is not set # CONFIG_VIDEO_DEVICES is not set @@ -233,6 +265,7 @@ CONFIG_DEV_NULL=y # CONFIG_LCD is not set # CONFIG_MMCSD is not set # CONFIG_MTD is not set +# CONFIG_EEPROM is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set @@ -241,14 +274,39 @@ CONFIG_DEV_NULL=y CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set +# CONFIG_ARCH_HAVE_UART is not set +# CONFIG_ARCH_HAVE_UART0 is not set +# CONFIG_ARCH_HAVE_UART1 is not set +# CONFIG_ARCH_HAVE_UART2 is not set +# CONFIG_ARCH_HAVE_UART3 is not set +# CONFIG_ARCH_HAVE_UART4 is not set +# CONFIG_ARCH_HAVE_UART5 is not set +# CONFIG_ARCH_HAVE_UART6 is not set +# CONFIG_ARCH_HAVE_UART7 is not set +# CONFIG_ARCH_HAVE_UART8 is not set +# CONFIG_ARCH_HAVE_SCI0 is not set +# CONFIG_ARCH_HAVE_SCI1 is not set CONFIG_ARCH_HAVE_USART0=y +# CONFIG_ARCH_HAVE_USART1 is not set +# CONFIG_ARCH_HAVE_USART2 is not set +# CONFIG_ARCH_HAVE_USART3 is not set +# CONFIG_ARCH_HAVE_USART4 is not set +# CONFIG_ARCH_HAVE_USART5 is not set +# CONFIG_ARCH_HAVE_USART6 is not set +# CONFIG_ARCH_HAVE_USART7 is not set +# CONFIG_ARCH_HAVE_USART8 is not set +# CONFIG_ARCH_HAVE_OTHER_UART is not set # # USART Configuration # CONFIG_USART0_ISUART=y CONFIG_MCU_SERIAL=y +# CONFIG_SERIAL_IFLOWCONTROL is not set +# CONFIG_SERIAL_OFLOWCONTROL is not set +# CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set CONFIG_USART0_SERIAL_CONSOLE=y +# CONFIG_OTHER_SERIAL_CONSOLE is not set # CONFIG_NO_SERIAL_CONSOLE is not set # @@ -262,8 +320,6 @@ CONFIG_USART0_PARITY=0 CONFIG_USART0_2STOP=0 # CONFIG_USART0_IFLOWCONTROL is not set # CONFIG_USART0_OFLOWCONTROL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set # CONFIG_WIRELESS is not set @@ -284,6 +340,11 @@ CONFIG_USART0_2STOP=0 # CONFIG_ARCH_HAVE_PHY is not set # CONFIG_NET is not set +# +# Crypto API +# +# CONFIG_CRYPTO is not set + # # File Systems # @@ -295,14 +356,15 @@ CONFIG_DISABLE_MOUNTPOINT=y CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y # CONFIG_FS_READABLE is not set # CONFIG_FS_WRITABLE is not set +# CONFIG_FS_NAMED_SEMAPHORES is not set # CONFIG_FS_RAMMAP is not set # CONFIG_FS_PROCFS is not set # # System Logging # - # CONFIG_SYSLOG is not set +# CONFIG_SYSLOG_TIMESTAMP is not set # # Graphics Support @@ -323,7 +385,7 @@ CONFIG_MM_REGIONS=1 # CONFIG_AUDIO is not set # -# Binary Formats +# Binary Loader # # CONFIG_BINFMT_DISABLE is not set # CONFIG_NXFLAT is not set @@ -345,6 +407,7 @@ CONFIG_NUNGET_CHARS=0 # CONFIG_LIBM is not set # CONFIG_NOPRINTF_FIELDWIDTH is not set # CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_LIBC_IOCTL_VARIADIC is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -386,6 +449,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CAN is not set # CONFIG_EXAMPLES_CONFIGDATA is not set +# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set @@ -396,7 +460,6 @@ CONFIG_EXAMPLES_HELLO=y # 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 @@ -412,7 +475,6 @@ CONFIG_EXAMPLES_HELLO=y # 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_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set @@ -420,6 +482,8 @@ CONFIG_EXAMPLES_HELLO=y # CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERIALBLASTER is not set +# CONFIG_EXAMPLES_SERIALRX is not set # CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART is not set @@ -438,12 +502,14 @@ CONFIG_EXAMPLES_HELLO=y # Graphics Support # # CONFIG_TIFF is not set +# CONFIG_GRAPHICS_TRAVELER is not set # # Interpreters # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_PCODE is not set +# CONFIG_INTERPRETERS_MICROPYTHON is not set # # Network Utilities @@ -486,27 +552,20 @@ CONFIG_EXAMPLES_HELLO=y # System Libraries and NSH Add-Ons # -# -# USB CDC/ACM Device Commands -# - -# -# USB Composite Device Commands -# - # # Custom Free Memory Command # # CONFIG_SYSTEM_FREE is not set # -# I2C tool +# EMACS-like Command Line Editor # +# CONFIG_SYSTEM_CLE is not set # -# INI File Parser +# CU Minimal Terminal # -# CONFIG_SYSTEM_INIFILE is not set +# CONFIG_SYSTEM_CUTERM is not set # # FLASH Program Installation @@ -517,10 +576,23 @@ CONFIG_EXAMPLES_HELLO=y # FLASH Erase-all Command # +# +# Intel HEX to binary conversion +# +# CONFIG_SYSTEM_HEX2BIN is not set + +# +# I2C tool +# + +# +# INI File Parser +# +# CONFIG_SYSTEM_INIFILE is not set + # # NxPlayer media player library / command Line # -# CONFIG_SYSTEM_NXPLAYER is not set # # RAM test @@ -532,6 +604,14 @@ CONFIG_EXAMPLES_HELLO=y # # CONFIG_SYSTEM_READLINE is not set +# +# P-Code Support +# + +# +# PHY Tool +# + # # Power Off # @@ -547,20 +627,20 @@ CONFIG_EXAMPLES_HELLO=y # # CONFIG_SYSTEM_SDCARD is not set +# +# Sudoku +# +# CONFIG_SYSTEM_SUDOKU is not set + # # Sysinfo # # CONFIG_SYSTEM_SYSINFO is not set # -# USB Monitor +# Temperature # -# -# EMACS-like Command Line Editor -# -# CONFIG_SYSTEM_CLE is not set - # # VI Work-Alike Editor # @@ -570,10 +650,22 @@ CONFIG_EXAMPLES_HELLO=y # Stack Monitor # +# +# USB CDC/ACM Device Commands +# + +# +# USB Composite Device Commands +# + # # USB Mass Storage Device Commands # +# +# USB Monitor +# + # # Zmodem Commands # diff --git a/configs/moteino-mega/hello/ld.script b/configs/moteino-mega/hello/ld.script index 3ea9da807d..ea4fb0b8ee 100644 --- a/configs/moteino-mega/hello/ld.script +++ b/configs/moteino-mega/hello/ld.script @@ -1,5 +1,5 @@ /************************************************************************************** - * configs/moteino-mega/hello/ld.script + * configs/moteino-mega/nsh/ld.script * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -127,6 +127,8 @@ SECTIONS { _stext = . ; *(.vectors) + *(.progmem.gcc*) + *(.progmem*) *(.init) *(.handlers) *(.text) @@ -140,6 +142,8 @@ SECTIONS { _sdata = ABSOLUTE(.); *(.data .data.*) + *(.rodata) + *(.rodata*) *(.gnu.linkonce.d.*) CONSTRUCTORS _edata = ABSOLUTE(.); diff --git a/configs/moteino-mega/nsh/defconfig b/configs/moteino-mega/nsh/defconfig index e27b3fce11..34aa6de21b 100644 --- a/configs/moteino-mega/nsh/defconfig +++ b/configs/moteino-mega/nsh/defconfig @@ -12,10 +12,6 @@ CONFIG_DEFAULT_SMALL=y CONFIG_HOST_OSX=y # CONFIG_HOST_WINDOWS is not set # CONFIG_HOST_OTHER is not set -# CONFIG_WINDOWS_NATIVE is not set -# CONFIG_WINDOWS_CYGWIN is not set -# CONFIG_WINDOWS_MSYS is not set -# CONFIG_WINDOWS_OTHER is not set # # Build Configuration @@ -30,10 +26,12 @@ CONFIG_HOST_OSX=y CONFIG_INTELHEX_BINARY=y # CONFIG_MOTOROLA_SREC is not set # CONFIG_RAW_BINARY is not set +# CONFIG_UBOOT_UIMAGE is not set # # Customize Header Files # +# CONFIG_ARCH_STDINT_H is not set # CONFIG_ARCH_STDBOOL_H is not set # CONFIG_ARCH_MATH_H is not set # CONFIG_ARCH_FLOAT_H is not set @@ -67,29 +65,28 @@ CONFIG_ARCH_AVR=y CONFIG_ARCH="avr" CONFIG_ARCH_FAMILY="avr" CONFIG_ARCH_CHIP="atmega" -# CONFIG_ARCH_CHIP_ATMEGA128 is not set -CONFIG_ARCH_CHIP_ATMEGA1284P=y -# CONFIG_ARCH_CHIP_AT90USB646 is not set -# CONFIG_ARCH_CHIP_AT90USB647 is not set -# CONFIG_ARCH_CHIP_AT90USB1286 is not set -# CONFIG_ARCH_CHIP_AT90USB1287 is not set -# CONFIG_ARCH_CHIP_AT32UC3B0256 is not set -CONFIG_ARCH_FAMILY_AVR=y CONFIG_ARCH_CHIP_ATMEGA=y +# CONFIG_ARCH_CHIP_AT90USB is not set +# CONFIG_ARCH_CHIP_AT32UC3 is not set +CONFIG_ARCH_FAMILY_AVR=y +# CONFIG_ARCH_FAMILY_AVR32 is not set # # AVR Configuration Options # -# CONFIG_AVR_WINAVR is not set -CONFIG_AVR_BUILDROOT=y +CONFIG_AVR_CROSSPACK=y +# CONFIG_AVR_USART1 is not set # # ATMega Configuration Options # +# CONFIG_ARCH_CHIP_ATMEGA128 is not set +CONFIG_ARCH_CHIP_ATMEGA1284P=y # # ATMega Peripheral Selections -CONFIG_AVR_USART1=y +# +CONFIG_AVR_USART0=y # # Architecture Options @@ -98,10 +95,15 @@ CONFIG_ARCH_NOINTC=y # CONFIG_ARCH_VECNOTIRQ is not set # CONFIG_ARCH_DMA is not set # CONFIG_ARCH_HAVE_IRQPRIO is not set -# CONFIG_ARCH_ADDRENV is not set +# CONFIG_ARCH_L2CACHE is not set +# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set +# CONFIG_ARCH_HAVE_ADDRENV is not set +# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set # CONFIG_ARCH_HAVE_VFORK is not set # CONFIG_ARCH_HAVE_MMU is not set +# CONFIG_ARCH_HAVE_MPU is not set # CONFIG_ARCH_NAND_HWECC is not set +# CONFIG_ARCH_HAVE_EXTCLK is not set CONFIG_ARCH_STACKDUMP=y # CONFIG_ENDIAN_BIG is not set # CONFIG_ARCH_IDLE_CUSTOM is not set @@ -111,7 +113,7 @@ CONFIG_ARCH_STACKDUMP=y # # Board Settings # -CONFIG_BOARD_LOOPSPERMSEC=864 +CONFIG_BOARD_LOOPSPERMSEC=888 # CONFIG_ARCH_CALIBRATION is not set # @@ -149,6 +151,7 @@ CONFIG_ARCH_BOARD="moteino-mega" # CONFIG_ARCH_HAVE_LEDS=y CONFIG_ARCH_LEDS=y +CONFIG_NSH_MMCSDMINOR=0 # # Board-Specific Options @@ -157,29 +160,6 @@ CONFIG_ARCH_LEDS=y # # RTOS Features # -# CONFIG_BOARD_INITIALIZE is not set -CONFIG_USEC_PER_TICK=10000 -# CONFIG_SYSTEM_TIME64 is not set -CONFIG_RR_INTERVAL=200 -# CONFIG_SCHED_CPULOAD is not set -# 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=2015 -CONFIG_START_MONTH=1 -CONFIG_START_DAY=21 -CONFIG_DEV_CONSOLE=y -# 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_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="nsh_main" CONFIG_DISABLE_OS_API=y CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_DISABLE_PTHREAD=y @@ -187,6 +167,60 @@ CONFIG_DISABLE_PTHREAD=y CONFIG_DISABLE_MQUEUE=y # CONFIG_DISABLE_ENVIRON is not set +# +# Clocks and Timers +# +CONFIG_USEC_PER_TICK=10000 +# CONFIG_SYSTEM_TIME64 is not set +# CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2015 +CONFIG_START_MONTH=1 +CONFIG_START_DAY=31 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=4 +CONFIG_WDOG_INTRESERVE=0 +CONFIG_PREALLOC_TIMERS=0 + +# +# Tasks and Scheduling +# +# CONFIG_INIT_NONE is not set +CONFIG_INIT_ENTRYPOINT=y +# CONFIG_INIT_FILEPATH is not set +CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_RR_INTERVAL=200 +CONFIG_TASK_NAME_SIZE=0 +CONFIG_MAX_TASKS=8 +# CONFIG_SCHED_HAVE_PARENT is not set +# CONFIG_SCHED_WAITPID is not set + +# +# Performance Monitoring +# +# CONFIG_SCHED_CPULOAD is not set +# CONFIG_SCHED_INSTRUMENTATION is not set + +# +# Files and I/O +# +CONFIG_DEV_CONSOLE=y +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +CONFIG_NFILE_DESCRIPTORS=6 +CONFIG_NFILE_STREAMS=6 +CONFIG_NAME_MAX=32 +# CONFIG_PRIORITY_INHERITANCE is not set + +# +# RTOS hooks +# +# CONFIG_BOARD_INITIALIZE is not set +# CONFIG_SCHED_STARTHOOK is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set + # # Signal Numbers # @@ -195,19 +229,8 @@ CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 # -# Sizes of configurable things (0 disables) +# Work Queue Support # -CONFIG_MAX_TASKS=8 -CONFIG_NPTHREAD_KEYS=0 -CONFIG_NFILE_DESCRIPTORS=6 -CONFIG_NFILE_STREAMS=6 -CONFIG_NAME_MAX=32 -CONFIG_PREALLOC_MQ_MSGS=0 -CONFIG_MQ_MAXMSGSIZE=0 -CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=4 -CONFIG_WDOG_INTRESERVE=0 -CONFIG_PREALLOC_TIMERS=0 # # Stack and heap information @@ -216,6 +239,7 @@ CONFIG_IDLETHREAD_STACKSIZE=512 CONFIG_USERMAIN_STACKSIZE=512 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=512 +# CONFIG_LIB_SYSCALL is not set # # Device Drivers @@ -224,6 +248,12 @@ CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set # CONFIG_LOOP is not set + +# +# Buffering +# +# CONFIG_DRVR_WRITEBUFFER is not set +# CONFIG_DRVR_READAHEAD is not set # CONFIG_RAMDISK is not set # CONFIG_CAN is not set # CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set @@ -234,6 +264,7 @@ CONFIG_DEV_NULL=y # CONFIG_I2S is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set +# CONFIG_TIMER is not set # CONFIG_ANALOG is not set # CONFIG_AUDIO_DEVICES is not set # CONFIG_VIDEO_DEVICES is not set @@ -242,46 +273,62 @@ CONFIG_DEV_NULL=y # CONFIG_LCD is not set # CONFIG_MMCSD is not set # CONFIG_MTD is not set +# CONFIG_EEPROM is not set # CONFIG_PIPES is not set # CONFIG_PM is not set # CONFIG_POWER is not set # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -# CONFIG_DEV_LOWCONSOLE is not set +CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set -CONFIG_ARCH_HAVE_USART1=y +# CONFIG_ARCH_HAVE_UART is not set +# CONFIG_ARCH_HAVE_UART0 is not set +# CONFIG_ARCH_HAVE_UART1 is not set +# CONFIG_ARCH_HAVE_UART2 is not set +# CONFIG_ARCH_HAVE_UART3 is not set +# CONFIG_ARCH_HAVE_UART4 is not set +# CONFIG_ARCH_HAVE_UART5 is not set +# CONFIG_ARCH_HAVE_UART6 is not set +# CONFIG_ARCH_HAVE_UART7 is not set +# CONFIG_ARCH_HAVE_UART8 is not set +# CONFIG_ARCH_HAVE_SCI0 is not set +# CONFIG_ARCH_HAVE_SCI1 is not set +CONFIG_ARCH_HAVE_USART0=y +# CONFIG_ARCH_HAVE_USART1 is not set +# CONFIG_ARCH_HAVE_USART2 is not set +# CONFIG_ARCH_HAVE_USART3 is not set +# CONFIG_ARCH_HAVE_USART4 is not set +# CONFIG_ARCH_HAVE_USART5 is not set +# CONFIG_ARCH_HAVE_USART6 is not set +# CONFIG_ARCH_HAVE_USART7 is not set +# CONFIG_ARCH_HAVE_USART8 is not set +# CONFIG_ARCH_HAVE_OTHER_UART is not set # # USART Configuration # -CONFIG_USART1_ISUART=y +CONFIG_USART0_ISUART=y CONFIG_MCU_SERIAL=y CONFIG_STANDARD_SERIAL=y -CONFIG_USART1_SERIAL_CONSOLE=y +# CONFIG_SERIAL_IFLOWCONTROL is not set +# CONFIG_SERIAL_OFLOWCONTROL is not set +# CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set +CONFIG_USART0_SERIAL_CONSOLE=y +# CONFIG_OTHER_SERIAL_CONSOLE is not set # CONFIG_NO_SERIAL_CONSOLE is not set # -# USART Configuration +# USART0 Configuration # -#CONFIG_USART0_RXBUFSIZE=256 -#CONFIG_USART0_TXBUFSIZE=256 -#CONFIG_USART0_BAUD=115200 -#CONFIG_USART0_BITS=8 -#CONFIG_USART0_PARITY=0 -#CONFIG_USART0_2STOP=0 +CONFIG_USART0_RXBUFSIZE=256 +CONFIG_USART0_TXBUFSIZE=256 +CONFIG_USART0_BAUD=115200 +CONFIG_USART0_BITS=8 +CONFIG_USART0_PARITY=0 +CONFIG_USART0_2STOP=0 # CONFIG_USART0_IFLOWCONTROL is not set # CONFIG_USART0_OFLOWCONTROL is not set -CONFIG_USART1_RXBUFSIZE=256 -CONFIG_USART1_TXBUFSIZE=256 -CONFIG_USART1_BAUD=38400 -CONFIG_USART1_BITS=8 -CONFIG_USART1_PARITY=0 -CONFIG_USART1_2STOP=0 -# CONFIG_USART1_IFLOWCONTROL is not set -# CONFIG_USART1_OFLOWCONTROL is not set -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_USBDEV is not set # CONFIG_USBHOST is not set # CONFIG_WIRELESS is not set @@ -302,6 +349,11 @@ CONFIG_USART1_2STOP=0 # CONFIG_ARCH_HAVE_PHY is not set # CONFIG_NET is not set +# +# Crypto API +# +# CONFIG_CRYPTO is not set + # # File Systems # @@ -313,14 +365,15 @@ CONFIG_DISABLE_MOUNTPOINT=y CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y # CONFIG_FS_READABLE is not set # CONFIG_FS_WRITABLE is not set +# CONFIG_FS_NAMED_SEMAPHORES is not set # CONFIG_FS_RAMMAP is not set # CONFIG_FS_PROCFS is not set # # System Logging # - # CONFIG_SYSLOG is not set +# CONFIG_SYSLOG_TIMESTAMP is not set # # Graphics Support @@ -341,10 +394,9 @@ CONFIG_MM_REGIONS=1 # CONFIG_AUDIO is not set # -# Binary Formats +# Binary Loader # # CONFIG_BINFMT_DISABLE is not set -# CONFIG_BINFMT_EXEPATH is not set # CONFIG_NXFLAT is not set # CONFIG_ELF is not set # CONFIG_BUILTIN is not set @@ -363,8 +415,9 @@ CONFIG_STDIO_LINEBUFFER=y CONFIG_NUNGET_CHARS=0 CONFIG_LIB_HOMEDIR="/" # CONFIG_LIBM is not set -CONFIG_NOPRINTF_FIELDWIDTH=y +# CONFIG_NOPRINTF_FIELDWIDTH is not set # CONFIG_LIBC_FLOATINGPOINT is not set +# CONFIG_LIBC_IOCTL_VARIADIC is not set CONFIG_LIB_RAND_ORDER=1 # CONFIG_EOL_IS_CR is not set # CONFIG_EOL_IS_LF is not set @@ -376,6 +429,7 @@ CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 # CONFIG_LIBC_STRERROR is not set # CONFIG_LIBC_PERROR_STDOUT is not set CONFIG_ARCH_LOWPUTC=y +# CONFIG_LIBC_LOCALTIME is not set CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set @@ -383,7 +437,6 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # # Non-standard Library Support # -# CONFIG_SCHED_WORKQUEUE is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set @@ -407,6 +460,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CAN is not set # CONFIG_EXAMPLES_CONFIGDATA is not set +# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set @@ -417,7 +471,6 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # 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 @@ -433,7 +486,6 @@ CONFIG_EXAMPLES_NSH=y # 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_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set @@ -441,6 +493,8 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERIALBLASTER is not set +# CONFIG_EXAMPLES_SERIALRX is not set # CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART is not set @@ -459,12 +513,14 @@ CONFIG_EXAMPLES_NSH=y # Graphics Support # # CONFIG_TIFF is not set +# CONFIG_GRAPHICS_TRAVELER is not set # # Interpreters # # CONFIG_INTERPRETERS_FICL is not set # CONFIG_INTERPRETERS_PCODE is not set +# CONFIG_INTERPRETERS_MICROPYTHON is not set # # Network Utilities @@ -493,8 +549,18 @@ CONFIG_EXAMPLES_NSH=y # NSH Library # CONFIG_NSH_LIBRARY=y + +# +# Command Line Configuration +# CONFIG_NSH_READLINE=y # CONFIG_NSH_CLE is not set +CONFIG_NSH_LINELEN=64 +CONFIG_NSH_DISABLE_SEMICOLON=y +CONFIG_NSH_MAXARGUMENTS=6 +# CONFIG_NSH_ARGCAT is not set +CONFIG_NSH_NESTDEPTH=3 +# CONFIG_NSH_DISABLEBG is not set # # Disable Individual commands @@ -545,14 +611,18 @@ CONFIG_NSH_DISABLE_XD=y # CONFIG_NSH_CODECS_BUFSIZE=128 CONFIG_NSH_FILEIOSIZE=512 -CONFIG_NSH_LINELEN=64 -CONFIG_NSH_DISABLE_SEMICOLON=y -CONFIG_NSH_MAXARGUMENTS=6 -# CONFIG_NSH_ARGCAT is not set -CONFIG_NSH_NESTDEPTH=3 + +# +# Scripting Support +# CONFIG_NSH_DISABLESCRIPT=y -# CONFIG_NSH_DISABLEBG is not set + +# +# Console Configuration +# CONFIG_NSH_CONSOLE=y +# CONFIG_NSH_ALTCONDEV is not set +# CONFIG_NSH_ARCHINIT is not set # # NxWidgets/NxWM @@ -567,27 +637,20 @@ CONFIG_NSH_CONSOLE=y # System Libraries and NSH Add-Ons # -# -# USB CDC/ACM Device Commands -# - -# -# USB Composite Device Commands -# - # # Custom Free Memory Command # # CONFIG_SYSTEM_FREE is not set # -# I2C tool +# EMACS-like Command Line Editor # +# CONFIG_SYSTEM_CLE is not set # -# INI File Parser +# CU Minimal Terminal # -# CONFIG_SYSTEM_INIFILE is not set +# CONFIG_SYSTEM_CUTERM is not set # # FLASH Program Installation @@ -598,10 +661,23 @@ CONFIG_NSH_CONSOLE=y # FLASH Erase-all Command # +# +# Intel HEX to binary conversion +# +# CONFIG_SYSTEM_HEX2BIN is not set + +# +# I2C tool +# + +# +# INI File Parser +# +# CONFIG_SYSTEM_INIFILE is not set + # # NxPlayer media player library / command Line # -# CONFIG_SYSTEM_NXPLAYER is not set # # RAM test @@ -614,6 +690,14 @@ CONFIG_NSH_CONSOLE=y CONFIG_SYSTEM_READLINE=y CONFIG_READLINE_ECHO=y +# +# P-Code Support +# + +# +# PHY Tool +# + # # Power Off # @@ -629,20 +713,20 @@ CONFIG_READLINE_ECHO=y # # CONFIG_SYSTEM_SDCARD is not set +# +# Sudoku +# +# CONFIG_SYSTEM_SUDOKU is not set + # # Sysinfo # # CONFIG_SYSTEM_SYSINFO is not set # -# USB Monitor +# Temperature # -# -# EMACS-like Command Line Editor -# -# CONFIG_SYSTEM_CLE is not set - # # VI Work-Alike Editor # @@ -652,10 +736,22 @@ CONFIG_READLINE_ECHO=y # Stack Monitor # +# +# USB CDC/ACM Device Commands +# + +# +# USB Composite Device Commands +# + # # USB Mass Storage Device Commands # +# +# USB Monitor +# + # # Zmodem Commands # diff --git a/configs/moteino-mega/nsh/ld.script b/configs/moteino-mega/nsh/ld.script index d613030d3b..ea4fb0b8ee 100644 --- a/configs/moteino-mega/nsh/ld.script +++ b/configs/moteino-mega/nsh/ld.script @@ -127,6 +127,8 @@ SECTIONS { _stext = . ; *(.vectors) + *(.progmem.gcc*) + *(.progmem*) *(.init) *(.handlers) *(.text) @@ -140,6 +142,8 @@ SECTIONS { _sdata = ABSOLUTE(.); *(.data .data.*) + *(.rodata) + *(.rodata*) *(.gnu.linkonce.d.*) CONSTRUCTORS _edata = ABSOLUTE(.); From ca7ecf658f0085ad72732e27a9110b7060d91188 Mon Sep 17 00:00:00 2001 From: jeditekunum Date: Sat, 31 Jan 2015 13:32:31 -0600 Subject: [PATCH 4/4] Update README for MoteinoMEGA (ATMEGA1284P) port. --- configs/moteino-mega/README.txt | 321 ++++++-------------------------- 1 file changed, 53 insertions(+), 268 deletions(-) diff --git a/configs/moteino-mega/README.txt b/configs/moteino-mega/README.txt index 97b1e08dcb..6cf9330db6 100644 --- a/configs/moteino-mega/README.txt +++ b/configs/moteino-mega/README.txt @@ -1,9 +1,7 @@ README ^^^^^^ -********************************************************************** -**** PRELIMINARY - Port in progress **** -********************************************************************** +This port conributed by jeditekunum. This is the README file for the port of NuttX to the MoteinoMEGA from LowPowerLab (http://www.lowpowerlab.com). The MoteinoMEGA is based @@ -19,9 +17,6 @@ Contents o Pin Connections o DualOptiboot Bootloader o Toolchains - o Windows Native Toolchains - o NuttX buildroot Toolchain - o avr-libc o MoteinoMEGA Configuration Options o Configurations @@ -35,83 +30,62 @@ MoteinoMEGA Features o 2 High Speed Serial Ports o 8Ch 10bit Analog Input port -Pin Connections (PCB Rev ?) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Pin Connections +^^^^^^^^^^^^^^^ -------------------- ----------------------------- ATMega1284P Pinout MoteinoMEGA board connection -------------------- ----------------------------- -********************************************************************** -**** INVALID - Port in progress **** -********************************************************************** (left) - 1 PEN Pulled-up - 2 PE0 (RXD0/PDI) MAX202ECWED T1IN or J7-1, ISP-PDI (via 74HC5053), J5-26 - 3 PE1 (TXD0/PDO) MAX202ECWED A1OUT or J7-9, ISP-PDO (via 74HC5053), J5-25 - 4 PE2 (XCK0/AIN0) MAX202ECWED T2IN, J5-24 - 5 PE3 (OC3A/AIN1) MAX202ECWED A2OUT, J5-23 - 6 PE4 (OC3B/INT4) J5-22 - 7 PE5 (OC3C/INT5) J5-21, RTL8019AS INT 0, TP5 PE5 - 8 PE6 (T3/INT6) J5-20 - 9 PE7 (ICP3/INT7) J5-19 - 10 PB0 (SS) Pull up of SS SPI master - 11 PB1 (SCK) J7-7, ISP_SCK (via 74HC4053) and AT45D011 SCK, J5-17 - 12 PB2 (MOSI) AT45D011 SI. J5-16 - 13 PB3 (MISO) AT45D011 SO, J5-15 - 14 PB4 (OC0) AT45D011 CS\, J5-14 - 15 PB5 (OC1A) J5-13 - 16 PB6 (OC1B) J5-12 + 1 AREF AR + 2 PA7 A7 + 3 PA6 A6 + 4 PA5 A5 + 5 PA4 A4 + 6 PA3 A3 + 7 PA2 A2 + 8 PA1 A1 + 9 PA0 A0 + 10 PB0 0 + 11 PB1 1 + 12 PB2 (INT2) 2/i2 (used by optional radio) + 13 PB3 (PWM0) 3 + 14 PB4 (PWM1/SS) 4/SS (used by optional radio) + 15 PB5 (MOSI) 5/MO (used by optional radio/flash) + 16 PB6 (MISO/PWM2) 6/MI (used by optional radio/flash) + 17 PB7 (SCK/PWM3) 7/SCK (used by optional radio/flash) + 18 VOUT 3v3 + 19 VIN VIN + 20 GND GND (bottom) - 17 PB7 (OC2/OC1C) J5-11 - 18 PG3/TOSC2 32.768KHz XTAL - 19 PG4/TOSC1 32.768KHz XTAL - 20 RESET RESET - 21 VCC - 22 GND GND - 23 XTAL2 14.7456MHz XTAL - 24 XTAL1 14.7456MHz XTAL - 25 PD0 (SCL/INT0) J5-10 - 26 PD1 (SDA/INT1) J5-9 - 27 PD2 (RXD1/INT2) J5-8, MAX488CSA RO (RS-485) - 28 PD3 (TXD1/INT3) J5-7, MAX488CSA DI (RS-485) - 29 PD4 (ICP1) J5-6 - 30 PD5 (XCK1) J5-5 - 31 PD6 (T1) J5-4 - 32 PD7 (T2) J5-3 - (left) - 48 PA3 (AD3) J5-?, 74HC5730, 62246DLP-7, RTL8019AS - 47 PA4 (AD4) J5-?, 74HC5730, 62246DLP-7, RTL8019AS - 46 PA5 (AD5) J5-?, 74HC5730, 62246DLP-7, RTL8019AS - 45 PA6 (AD6) J5-?, 74HC5730, 62246DLP-7, RTL8019AS - 44 PA7 (AD7) J5-?, 74HC5730, 62246DLP-7, RTL8019AS - 43 PG2 (ALE) J5-1, 74HC5730, 62246DLP-7, RTL8019AS - 42 PC7 (A15) TP4 A15, J5-27, 74HC5730 - 41 PC6 (A14) J5-28, 74HC5730, 62246DLP-7, RTL8019AS - 40 PC5 (A13) J5-29, 74HC5730, 62246DLP-7, RTL8019AS - 39 PC4 (A12) J5-30, 74HC5730, 62246DLP-7, RTL8019AS - 38 PC3 (A11) J5-31, 74HC5730, 62246DLP-7, RTL8019AS - 37 PC2 (A10) J5-32, 74HC5730, 62246DLP-7, RTL8019AS - 36 PC1 (A9) J5-33, 74HC5730, 62246DLP-7, RTL8019AS - 35 PC0 (A8) J5-34, 74HC5730, 62246DLP-7, RTL8019AS - 34 PG1 (RD) TP2 RD\, J5-52, 62246DLP-7, RTL8019AS - 33 PG0 (WR) TP3 WR\, J5-51, 62246DLP-7, RTL8019AS - (top) - 64 AVCC - 63 GND GND - 62 AREF (analog supply) - 61 PF0 (ADC0) J6-5, PDV-P9 Light Sensor - 60 PF1 (ADC1) J6-7, Thermister - 59 PF2 (ADC2) J6-9, MXA2500GL Dual Axis Accesserometer, AOUTX - 58 PF3 (ADC3) J6-11, MXA2500GL Dual Axis Accesserometer, AOUTY - 57 PF4 (ADC4/TCK) J6-13, MXA2500GL Dual Axis Accesserometer, TOUT - 56 PF5 (ADC5/TMS) J6-15 - 55 PF6 (ADC6/TDO) J6-17 - 54 PF7 (ADC7/TDI) J6-19 - 53 GND GND - 52 VCC - 51 PA0 (AD0) J5-?, 74HC5730, 62246DLP-7, RTL8019AS - 50 PA1 (AD1) J5-?, 74HC5730, 62246DLP-7, RTL8019AS - 49 PA2 (AD2) J5-?, 74HC5730, 62246DLP-7, RTL8019AS + 21 DTR/RTS DTR + 22 TX0 v + 23 RX0 ^ + 24 VIN + 25 + 26 GND GND + (right) + 27 GND GND + 28 VIN VIN + 29 VOUT 3v3 + 30 RESET RST + 31 PD0 (RX0) 8/Serial 0 ^ + 32 PD1 (TX0) 9/Serial 0 v + 33 PD2 (RX1/INT0) 10/Serial 0 ^/i0 + 34 PD3 (TX1/INT1) 11/Serial 1 v/i1 + 35 PD4 (PWM4) 12 + 36 PD5 (PWM5) 13 + 37 PD6 (PWM6) 14 + 38 PD7 (PWM7) 15/LED + 39 PC0 (SCL) 16/SCL + 40 PC1 (SDA) 17/SDA + 41 PC2 (TCK) 18 + 42 PC3 (TMS) 19 + 43 PC4 (TDO) 20 + 44 PC5 (TDI) 21 + 45 PC6 22 + 46 PC7 23 (used by optional flash) + DualOptiboot Bootloader ^^^^^^^^^^^^^^^^^^^^^^^ @@ -149,183 +123,8 @@ the toolchain on the make commandline with CONFIG_AVR_TOOLCHAIN=. The valid values for are BUILDROOT, CROSSPACK, LINUXGCC and WINAVR. -Buildroot: - - There is a DIY buildroot version for the AVR boards here: - http://sourceforge.net/projects/nuttx/files/buildroot/. See the - following section for details on building this toolchain. - - It is assumed in some places that buildroot toolchain is available - at ../misc/buildroot/build_avr. Edit the setenv.sh file if - this is not the case. - - After configuring NuttX, make sure that CONFIG_AVR_BUILDROOT=y is set in your - .config file. - -WinAVR: - - For Cygwin development environment on Windows machines, you can use - WinAVR: http://sourceforge.net/projects/winavr/files/ - - It is assumed in some places that WinAVR is installed at C:/WinAVR. Edit the - setenv.sh file if this is not the case. - - After configuring NuttX, make sure that CONFIG_AVR_WINAVR=y is set in your - .config file. - - WARNING: There is an incompatible version of cygwin.dll in the WinAVR/bin - directory! Make sure that the path to the correct cygwin.dll file precedes - the path to the WinAVR binaries! - -Linux: - - For Linux, there are widely available avr-gcc packages. On Ubuntu, use: - sudo apt-get install gcc-avr gdb-avr avr-libc - - After configuring NuttX, make sure that CONFIG_AVR_LINUXGCC=y is set in your - .config file. - -Mac OS X: - - For Mac OS X, the CrossPack for AVR toolchain is available from: - - http://www.obdev.at/products/crosspack/index.html - - This toolchain is functionally equivalent to the Linux GCC toolchain. - -Windows Native Toolchains -^^^^^^^^^^^^^^^^^^^^^^^^^ - - The WinAVR toolchain is a Windows native toolchain. There are several - limitations to using a Windows native toolchain in a Cygwin environment. - The three biggest are: - - 1. The Windows toolchain cannot follow Cygwin paths. Path conversions are - performed automatically in the Cygwin makefiles using the 'cygpath' - utility but you might easily find some new path problems. If so, check - out 'cygpath -w' - - 2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic - links are used in Nuttx (e.g., include/arch). The make system works - around these problems for the Windows tools by copying directories - instead of linking them. But this can also cause some confusion for - you: For example, you may edit a file in a "linked" directory and find - that your changes had no effect. That is because you are building the - copy of the file in the "fake" symbolic directory. If you use a - Windows toolchain, you should get in the habit of making like this: - - make clean_context all - - An alias in your .bashrc file might make that less painful. - - 3. Dependencies are not made when using Windows versions of the GCC. This - is because the dependencies are generated using Windows pathes which do - not work with the Cygwin make. - - MKDEP = $(TOPDIR)/tools/mknulldeps.sh - - An additional issue with the WinAVR toolchain, in particular, is that it - contains an incompatible version of the Cygwin DLL in its bin/ directory. - You must take care that the correct Cygwin DLL is used. - -NuttX buildroot Toolchain -^^^^^^^^^^^^^^^^^^^^^^^^^ - - If NuttX buildroot toolchain source tarball cne can be downloaded from the - NuttX SourceForge download site (https://sourceforge.net/projects/nuttx/files/). - This GNU toolchain builds and executes in the Linux or Cygwin environment. - - 1. You must have already configured Nuttx in /nuttx. - - cd tools - ./configure.sh amber/ - - NOTE: you also must copy avr-libc header files into the NuttX include - directory with command perhaps like: - - cp -a /cygdrive/c/WinAVR/include/avr include/. - - 2. Download the latest buildroot package into - - 3. unpack the buildroot tarball. The resulting directory may - have versioning information on it like buildroot-x.y.z. If so, - rename /buildroot-x.y.z to /buildroot. - - 4. cd /buildroot - - 5. cp configs/avr-defconfig-4.5.2 .config - - 6. make oldconfig - - 7. make - - 8. Edit setenv.h, if necessary, so that the PATH variable includes - the path to the newly built binaries. - - See the file configs/README.txt in the buildroot source tree. That has more - detailed PLUS some special instructions that you will need to follow if you - are building a toolchain for Cygwin under Windows. - -avr-libc -^^^^^^^^ - -Header Files - - In any case, header files from avr-libc are required: http://www.nongnu.org/avr-libc/. - A snapshot of avr-lib is included in the WinAVR installation. For Linux - development platforms, avr-libc package is readily available (and would - be installed in the apt-get command shown above). But if you are using - the NuttX buildroot configuration on Cygwin, then you will have to build - get avr-libc from binaries. - -Header File Installation - - The NuttX build will required that the AVR header files be available via - the NuttX include directory. This can be accomplished by either copying - the avr-libc header files into the NuttX include directory: - - cp -a /include/avr /include/. - - Or simply using a symbolic link: - - ln -s /include/avr /include/. - -Build Notes: - - It may not necessary to have a built version of avr-lib; only header files - are required. Bu if you choose to use the optimized libraru functions of - the flowing point library, then you may have to build avr-lib from sources. - Below are instructions for building avr-lib from fresh sources: - - 1. Download the avr-libc package from: - - http://savannah.nongnu.org/projects/avr-libc/ - - I am using avr-lib-1.7.1.tar.bz2 - - 2. Upack the tarball and cd into the - - tar jxf avr-lib-1.7.1.tar.bz2 - cd avr-lib-1.7.1 - - 3. Configure avr-lib. Assuming that WinAVR is installed at the following - loction: - - export PATH=/cygdrive/c/WinAVR/bin:$PATH - ./configure --build=`./config.guess` --host=avr - - This takes a *long* time. - - 4. Make avr-lib. - - make - - This also takes a long time because it generates variants for nearly - all AVR chips. - - 5. Install avr-lib. - - make install +This port was tested using the OS X / CROSSPACK tool chain, GCC version 4.8.1. +Please see other NuttX documentation for toolchain details. MoteinoMEGA Configuration Options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -364,9 +163,6 @@ MoteinoMEGA Configuration Options CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation of delay loops - CONFIG_ENDIAN_BIG - define if big endian (default is little - endian) - CONFIG_RAM_SIZE - Describes the installed DRAM. One of: CONFIG_RAM_SIZE=(16*1024) - (16Kb) @@ -460,10 +256,6 @@ Common Configuration Notes Where is one of the configuration sub-directories described in the following paragraph. - NOTE: You must also copy avr-libc header files, perhaps like: - - cp -a /cygdrive/c/WinAVR/include/avr include/. - 2. These configurations use the mconf-based configuration tool. To change a configurations using that tool, you should: @@ -473,13 +265,6 @@ Common Configuration Notes b. Execute 'make menuconfig' in nuttx/ in order to start the reconfiguration process. - 3. By default, all configurations assume the NuttX Buildroot toolchain - under Cygwin with Windows. This is easily reconfigured: - - CONFIG_HOST_WINDOWS=y - CONFIG_WINDOWS_CYGWIN=y - CONFIG_AVR_BUILDROOT=y - Configuration Sub-Directories -----------------------------