Arduino-MEGA2560: Add an NSH configuration

This commit is contained in:
Gregory Nutt 2016-01-16 13:42:54 -06:00
parent 7d40f26b3e
commit 3763cafe55
4 changed files with 173 additions and 65 deletions

View File

@ -1,5 +1,5 @@
README
^^^^^
======
This is the README file for the port of NuttX to the Arduino Mega 2560 Rev3.
@ -9,8 +9,15 @@ README
http://www.atmel.com/devices/atmega2560.aspx
Contents
========
o Toolchain
o Serial Console
o Configurations
Toolchain
^^^^^^^^^
=========
Right now only Atmel's AVR8 Toolchain is supported. You can get it from
@ -20,3 +27,57 @@ Toolchain
tool-chain but specify path to the Atmel AVR8 in path. See
arduino-mega2560/hello for example.
Serial Console
==============
The serial console is available on USART0. You will need to connect an
RS-232 shield or an external RS-232 driver as follows:
TXD: TX0->1
RXD: RX0->0
GND: Power GND
+5V: Power +5V
You will then need to use a terminal program configured at 38400 8N1.
Configurations
==============
Common Configuration Notes
--------------------------
1. Each Arduino MEGA2560 configuration is maintained in a sub-directory
and can be selected as follow:
cd tools
./configure.sh arduino-mega2560/<subdir>
cd -
. ./setenv.sh
Where <subdir> is one of the configuration sub-directories described in
the following paragraph.
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
see additional README.txt files in the NuttX tools repository.
b. Execute 'make menuconfig' in nuttx/ in order to start the
reconfiguration process.
3. By default, all configurations assume the Atmel Studio AVR8 toolchain
under Cygwin with Windows. This is easily reconfigured:
CONFIG_HOST_WINDOWS=y
CONFIG_WINDOWS_CYGWIN=y
CONFIG_AVR_BUILDROOT_TOOLCHAIN=y
Configuration Sub-Directories
-----------------------------
hello:
The simple apps/examples/hello "Hello, World!" example.
nsh:
This is a reduce NuttShell (NSH) configuration using apps/example/nsh.
The serial console is provided on USART0 and can be accessed via
an external RS-232 driver as described above under "Serial Console".

View File

@ -1,5 +1,5 @@
############################################################################
# configs/arduino-mega2560/ostest/Make.defs
# configs/arduino-mega2560/nsh/Make.defs
#
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>

View File

@ -41,36 +41,13 @@ CONFIG_INTELHEX_BINARY=y
# CONFIG_ARCH_MATH_H is not set
# CONFIG_ARCH_FLOAT_H is not set
# CONFIG_ARCH_STDARG_H is not set
CONFIG_ARCH_DEBUG_H=y
# CONFIG_ARCH_DEBUG_H is not set
#
# Debug Options
#
CONFIG_DEBUG=y
# CONFIG_DEBUG is not set
# CONFIG_ARCH_HAVE_HEAPCHECK is not set
# CONFIG_DEBUG_VERBOSE is not set
#
# Subsystem Debug Options
#
# CONFIG_DEBUG_AUDIO is not set
# CONFIG_DEBUG_BINFMT is not set
# CONFIG_DEBUG_FS is not set
# CONFIG_DEBUG_GRAPHICS is not set
# CONFIG_DEBUG_LIB is not set
# CONFIG_DEBUG_MM is not set
# CONFIG_DEBUG_SCHED is not set
#
# OS Function Debug Options
#
# CONFIG_DEBUG_IRQ is not set
#
# Driver Debug Options
#
# CONFIG_DEBUG_ANALOG is not set
# CONFIG_DEBUG_GPIO is not set
CONFIG_ARCH_HAVE_STACKCHECK=y
# CONFIG_STACK_COLORATION is not set
CONFIG_DEBUG_SYMBOLS=y
@ -105,14 +82,9 @@ CONFIG_ARCH_FAMILY_AVR=y
#
# AVR Configuration Options
#
# CONFIG_AVR_WINAVR_TOOLCHAIN is not set
CONFIG_AVR_ATMEL_AVR_TOOLCHAIN=y
CONFIG_AVR_WINAVR_TOOLCHAIN=y
# CONFIG_AVR_ATMEL_AVR_TOOLCHAIN is not set
# CONFIG_AVR_BUILDROOT_TOOLCHAIN is not set
#
# Atmel AVR Toolchain options
#
CONFIG_AVR_HAS_MEMX_PTR=y
# CONFIG_AVR_USART1 is not set
#
@ -194,6 +166,7 @@ CONFIG_ARCH_BOARD="arduino-mega2560"
#
# Common Board Options
#
CONFIG_NSH_MMCSDMINOR=0
#
# Board-Specific Options
@ -204,9 +177,9 @@ CONFIG_ARCH_BOARD="arduino-mega2560"
# RTOS Features
#
CONFIG_DISABLE_OS_API=y
# CONFIG_DISABLE_POSIX_TIMERS is not set
CONFIG_DISABLE_POSIX_TIMERS=y
CONFIG_DISABLE_PTHREAD=y
# CONFIG_DISABLE_SIGNALS is not set
CONFIG_DISABLE_SIGNALS=y
CONFIG_DISABLE_MQUEUE=y
CONFIG_DISABLE_ENVIRON=y
@ -231,7 +204,7 @@ CONFIG_PREALLOC_TIMERS=0
# CONFIG_INIT_NONE is not set
CONFIG_INIT_ENTRYPOINT=y
# CONFIG_INIT_FILEPATH is not set
CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_RR_INTERVAL=0
# CONFIG_SCHED_SPORADIC is not set
CONFIG_TASK_NAME_SIZE=0
@ -264,29 +237,19 @@ CONFIG_NAME_MAX=32
# CONFIG_SCHED_STARTHOOK is not set
# CONFIG_SCHED_ATEXIT is not set
# CONFIG_SCHED_ONEXIT is not set
#
# Signal Numbers
#
CONFIG_SIG_SIGUSR1=1
CONFIG_SIG_SIGUSR2=2
CONFIG_SIG_SIGALARM=3
# CONFIG_MODULE is not set
#
# Work queue support
#
# CONFIG_SCHED_WORKQUEUE is not set
# CONFIG_SCHED_HPWORK is not set
# CONFIG_SCHED_LPWORK is not set
#
# Stack and heap information
#
CONFIG_IDLETHREAD_STACKSIZE=256
CONFIG_USERMAIN_STACKSIZE=512
CONFIG_PTHREAD_STACK_MIN=256
CONFIG_PTHREAD_STACK_DEFAULT=512
CONFIG_IDLETHREAD_STACKSIZE=128
CONFIG_USERMAIN_STACKSIZE=128
CONFIG_PTHREAD_STACK_MIN=128
CONFIG_PTHREAD_STACK_DEFAULT=128
# CONFIG_LIB_SYSCALL is not set
#
@ -339,7 +302,7 @@ 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_UART is not set
# CONFIG_ARCH_HAVE_UART0 is not set
@ -369,10 +332,10 @@ CONFIG_ARCH_HAVE_USART0=y
#
CONFIG_USART0_ISUART=y
CONFIG_MCU_SERIAL=y
CONFIG_STANDARD_SERIAL=y
# CONFIG_SERIAL_IFLOWCONTROL is not set
# CONFIG_SERIAL_OFLOWCONTROL is not set
# CONFIG_SERIAL_DMA is not set
# CONFIG_SERIAL_TIOCSERGSTRUCT is not set
# CONFIG_ARCH_HAVE_SERIAL_TERMIOS is not set
CONFIG_USART0_SERIAL_CONSOLE=y
# CONFIG_OTHER_SERIAL_CONSOLE is not set
@ -537,7 +500,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512
# 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_NSH=y
# CONFIG_EXAMPLES_NULL is not set
# CONFIG_EXAMPLES_NX is not set
# CONFIG_EXAMPLES_NXTERM is not set
@ -546,12 +509,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512
# CONFIG_EXAMPLES_NXIMAGE is not set
# CONFIG_EXAMPLES_NXLINES is not set
# CONFIG_EXAMPLES_NXTEXT is not set
CONFIG_EXAMPLES_OSTEST=y
CONFIG_EXAMPLES_OSTEST_LOOPS=1
CONFIG_EXAMPLES_OSTEST_STACKSIZE=512
CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=2
CONFIG_EXAMPLES_OSTEST_RR_RANGE=1000
CONFIG_EXAMPLES_OSTEST_RR_RUNS=10
# CONFIG_EXAMPLES_OSTEST is not set
# CONFIG_EXAMPLES_PCA9635 is not set
# CONFIG_EXAMPLES_PIPE is not set
# CONFIG_EXAMPLES_POLL is not set
@ -607,7 +565,89 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10
#
# NSH Library
#
# CONFIG_NSH_LIBRARY is not set
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=y
#
# Disable Individual commands
#
CONFIG_NSH_DISABLE_ADDROUTE=y
CONFIG_NSH_DISABLE_BASENAME=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_DATE=y
CONFIG_NSH_DISABLE_DD=y
CONFIG_NSH_DISABLE_DF=y
CONFIG_NSH_DISABLE_DELROUTE=y
CONFIG_NSH_DISABLE_DIRNAME=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=y
CONFIG_NSH_DISABLE_IFUPDOWN=y
# CONFIG_NSH_DISABLE_KILL is not set
CONFIG_NSH_DISABLE_LOSETUP=y
CONFIG_NSH_DISABLE_LOSMART=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_MV is not set
# CONFIG_NSH_DISABLE_MW is not set
CONFIG_NSH_DISABLE_PS=y
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_TIME=y
# CONFIG_NSH_DISABLE_TEST is not set
# CONFIG_NSH_DISABLE_UMOUNT is not set
CONFIG_NSH_DISABLE_UNAME=y
# 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
#
# Scripting Support
#
CONFIG_NSH_DISABLESCRIPT=y
#
# Console Configuration
#
CONFIG_NSH_CONSOLE=y
# CONFIG_NSH_ALTCONDEV is not set
# CONFIG_NSH_ARCHINIT is not set
#
# NxWidgets/NxWM
@ -629,10 +669,17 @@ CONFIG_EXAMPLES_OSTEST_RR_RUNS=10
# CONFIG_SYSTEM_INIFILE is not set
# CONFIG_SYSTEM_HEXED is not set
# CONFIG_SYSTEM_RAMTEST is not set
# CONFIG_READLINE_HAVE_EXTMATCH is not set
# CONFIG_SYSTEM_READLINE is not set
CONFIG_READLINE_HAVE_EXTMATCH=y
CONFIG_SYSTEM_READLINE=y
CONFIG_READLINE_ECHO=y
# CONFIG_READLINE_TABCOMPLETION is not set
# CONFIG_READLINE_CMD_HISTORY is not set
# CONFIG_SYSTEM_RAMTRON is not set
# CONFIG_SYSTEM_SDCARD is not set
# CONFIG_SYSTEM_SUDOKU is not set
# CONFIG_SYSTEM_VI is not set
# CONFIG_SYSTEM_ZMODEM is not set
# Application configuration
CONFIG_APPS_DIR="../apps"

View File

@ -1,5 +1,5 @@
#!/bin/bash
# configs/arduino-mega2560/ostest/setenv.sh
# configs/arduino-mega2560/nsh/setenv.sh
#
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>