diff --git a/configs/arduino-mega2560/README.txt b/configs/arduino-mega2560/README.txt index a1246ad9de6..3ea5ddd30d7 100644 --- a/configs/arduino-mega2560/README.txt +++ b/configs/arduino-mega2560/README.txt @@ -1,22 +1,38 @@ README ^^^^^ -This is the README file for the port of NuttX to the Arduino Mega 2560 Rev3. + This is the README file for the port of NuttX to the Arduino Mega 2560 Rev3. -https://www.arduino.cc/en/Main/ArduinoBoardMega2560 + https://www.arduino.cc/en/Main/ArduinoBoardMega2560 -The board is based on ATMega2560 chip from Atmel - -http://www.atmel.com/devices/atmega2560.aspx + The board is based on ATMega2560 chip from Atmel + http://www.atmel.com/devices/atmega2560.aspx Toolchain ^^^^^^^^^ -Right now only Atmel's AVR8 Toolchain is supported. You can get it from + Right now only Atmel's AVR8 Toolchain is supported. You can get it from -http://www.atmel.com/tools/atmelavrtoolchainforwindows.aspx + http://www.atmel.com/tools/atmelavrtoolchainforwindows.aspx -It is basically WinAVR compatible so sub-projects may define WinAVR as a -tool-chain but specify path to the Atmel AVR8 in path. See -arduino-mega2560/hello for example. + It is basically WinAVR compatible so sub-projects may define WinAVR as a + tool-chain but specify path to the Atmel AVR8 in path. See + arduino-mega2560/hello for example. + +MEMX +^^^^ + + If you use the GCC AVR toolchain from the Atmel Studio, then you can + enable suppport for the MEMX storage: + + CONFIG_AVR_HAS_MEMX_PTR=y + + If this support is enabled, then all strings will be saved in FLASH and + standard string-oriented interfaces such printf() will change so that + they accept memx pointers. + + This means that (1) ALL strings must lie in FLASH, and (2) since the + strings are moved from SRAM to FLASH, you will save a LOT of SRAM usage + in some configurations that use a lot of string memory (such as the + ostest and nsh configurations). diff --git a/configs/arduino-mega2560/hello/Make.defs b/configs/arduino-mega2560/hello/Make.defs index ecc2d1b5577..c171e62d26e 100644 --- a/configs/arduino-mega2560/hello/Make.defs +++ b/configs/arduino-mega2560/hello/Make.defs @@ -37,6 +37,12 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs +ifeq ($(CONFIG_AVR_HAS_MEMX_PTR),y) + LDSCRIPT = memx.ld +else + LDSCRIPT = nomemx.ld +endif + ifeq ($(WINTOOL),y) # Windows-native toolchains DIRLINK = $(TOPDIR)/tools/copydir.sh @@ -44,13 +50,13 @@ ifeq ($(WINTOOL),y) 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)/scripts/nomemx.ld}" + ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}" 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)/scripts/nomemx.ld + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) endif CC = $(CROSSDEV)gcc @@ -72,6 +78,12 @@ endif ARCHCFLAGS = -fno-builtin ARCHCXXFLAGS = -fno-builtin -fno-exceptions + +ifeq ($(CONFIG_AVR_HAS_MEMX_PTR),y) + ARCHCFLAGS += -fdata-sections + ARCHCXXFLAGS += -fdata-sections +endif + ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHDEFINES = diff --git a/configs/teensy-2.0/README.txt b/configs/teensy-2.0/README.txt index e91d407d132..a3865558cc3 100644 --- a/configs/teensy-2.0/README.txt +++ b/configs/teensy-2.0/README.txt @@ -17,6 +17,7 @@ Contents o Windows Native Toolchains o NuttX buildroot Toolchain o avr-libc + o MEMX o Teensy++ Configuration Options o Configurations @@ -387,6 +388,23 @@ Build Notes: make install +MEMX +^^^^ + + If you use the GCC AVR toolchain from the Atmel Studio, then you can + enable suppport for the MEMX storage: + + CONFIG_AVR_HAS_MEMX_PTR=y + + If this support is enabled, then all strings will be saved in FLASH and + standard string-oriented interfaces such printf() will change so that + they accept memx pointers. + + This means that (1) ALL strings must lie in FLASH, and (2) since the + strings are moved from SRAM to FLASH, you will save a LOT of SRAM usage + in some configurations that use a lot of string memory (such as the + ostest and nsh configurations). + Teensy++ Configuration Options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^