AVR: Introduce Atmel Toolchain as a configuration option

Atmel's AVR8 toolchain is similar to WinAVR, but at present moment
it has one important feature that WinAVR does not. The __flash and __memx
allow built in comiler support for transparent program memory pointers.
Functions that use such pointers will work both with RAM arrays and
flash memory arrays. The compiler generates an appropriate code automatically.
For systems with tiny memory like atmega, this is very important and
allows to move all static const strings into flash.
This commit is contained in:
Dimitry Kloper 2016-01-04 21:42:24 +02:00
parent b9f06dc5e3
commit 16212f19e7
2 changed files with 39 additions and 1 deletions

View File

@ -27,6 +27,14 @@ config AVR_WINAVR
correct cygwin.dll file precedes the path to the WinAVR
binaries!
config AVR_ATMEL_AVR_TOOLCHAIN
bool "Atmel AVR Toolchain"
depends on HOST_WINDOWS
---help---
Atmel provides GNU Toolchain for AVR development. It can
be obtained by installing Atmel Studio 6 and later or
as standalone package from Atmel.
config AVR_LINUXGCC
bool "Linux GCC"
depends on HOST_LINUX
@ -59,4 +67,20 @@ config AVR_BUILDROOT
endchoice
menu "Atmel AVR Toolchain options"
depends on AVR_ATMEL_AVR_TOOLCHAIN
config AVR_HAS_MEMX_PTR
bool "Enable in-flash static const stings"
depends on AVR_ATMEL_AVR_TOOLCHAIN
default y
---help---
Enabling this option (recommended) will place all constant
strings used for debugging and assertion in program memory
and allow the corresponding routines to get the strings
directly from there. This will dramatically decrease amount
of RAM needed to hold this static data.
endmenu
endif

View File

@ -66,6 +66,12 @@ ifeq ($(filter y, \
CONFIG_AVR_TOOLCHAIN ?= WINAVR
endif
ifeq ($(filter y, \
$(CONFIG_AVR_ATMEL_AVR_TOOLCHAIN) \
),y)
CONFIG_AVR_TOOLCHAIN ?= ATMEL
endif
# Chip-specific CPU flags
ifeq ($(CONFIG_ARCH_CHIP_ATMEGA128),y)
@ -114,9 +120,17 @@ ifeq ($(CONFIG_AVR_TOOLCHAIN),LINUXGCC)
LDFLAGS += -nostartfiles -nodefaultlibs
endif
# WinAVR toolchain under Windows/Cygwin
# WinAVR or Atmel toolchain under Windows/Cygwin
_WINAVR = 0
ifeq ($(CONFIG_AVR_TOOLCHAIN),WINAVR)
_WINAVR = 1
endif
ifeq ($(CONFIG_AVR_TOOLCHAIN),ATMEL)
_WINAVR = 1
endif
ifeq ($(_WINAVR),1)
CROSSDEV ?= avr-
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
WINTOOL = y