Updated AVR32 demos and added AVR32 UC3B demo.

This commit is contained in:
Richard Barry 2007-07-27 07:59:50 +00:00
parent 45e7e5ac55
commit 94c94d3c0e
164 changed files with 21458 additions and 3994 deletions

View file

@ -13,12 +13,17 @@
# elf file.elf Link: create ELF output file from object files.
# lss file.lss Create extended listing from target output file.
# sym file.sym Create symbol table from target output file.
# hex file.hex Create Intel HEX image from ELF output file.
# bin file.bin Create binary image from ELF output file.
# sizes Display target size information.
# isp Use ISP instead of JTAGICE mkII when programming.
# cpuinfo Get CPU information.
# halt Stop CPU execution.
# chiperase Perform a JTAG Chip Erase command.
# erase Perform a flash chip erase.
# program Program MCU memory from ELF output file.
# reset Reset CPU.
# secureflash Protect chip by setting security bit.
# reset Reset MCU.
# debug Open a debug connection with the MCU.
# run Start CPU execution.
# readregs Read CPU registers.
@ -78,11 +83,13 @@ DPNDFILES = $(CSRCS:.c=.d) $(ASSRCS:.S=.d)
CPPFILES = $(CSRCS:.c=.i)
CC = avr32-gcc
CFLAGS = $(DEBUG) $(OPTIMIZATION) $(C_EXTRA_FLAGS)
CFLAGS = $(DEBUG) $(OPTIMIZATION) $(C_EXTRA_FLAGS) \
$(PLATFORM_INC_PATH:%=-Wa,-I%) $(INC_PATH:%=-Wa,-I%) $(AS_EXTRA_FLAGS)
ASFILES = $(CSRCS:.c=.x) $(ASSRCS:.S=.x)
AS = avr32-as
ASFLAGS = $(DEBUG) $(AS_EXTRA_FLAGS)
ASFLAGS = $(DEBUG) \
$(PLATFORM_INC_PATH:%=-Wa,-I%) $(INC_PATH:%=-Wa,-I%) $(AS_EXTRA_FLAGS)
OBJFILES = $(CSRCS:.c=.o) $(ASSRCS:.S=.o)
LD = avr32-ld
@ -98,17 +105,19 @@ NM = avr32-nm
SYM = $(TGTFILE:$(TGTTYPE)=.sym)
OBJCOPY = avr32-objcopy
HEX = $(TGTFILE:$(TGTTYPE)=.hex)
BIN = $(TGTFILE:$(TGTTYPE)=.bin)
SIZE = avr32-size
SUDO = $(shell if [ -x /usr/bin/sudo ]; then echo sudo; fi)
SLEEP = sleep
SLEEPUSB = 9
PROGRAM = avr32program
ISP = batchisp
ISPFLAGS = -device at32$(PART) -hardware usb -operation
DBGPROXY = avr32gdbproxy
DOCGEN = doxygen
@ -127,11 +136,15 @@ MSG_ARCHIVING = Archiving to \`$@\'.
MSG_LINKING = Linking to \`$@\'.
MSG_EXTENDED_LISTING = Creating extended listing to \`$@\'.
MSG_SYMBOL_TABLE = Creating symbol table to \`$@\'.
MSG_IHEX_IMAGE = Creating Intel HEX image to \`$@\'.
MSG_BINARY_IMAGE = Creating binary image to \`$@\'.
MSG_GETTING_CPU_INFO = Getting CPU information.
MSG_HALTING = Stopping CPU execution.
MSG_PROGRAMMING = Programming MCU memory from \`$<\'.
MSG_RESETTING = Resetting CPU.
MSG_ERASING_CHIP = Performing a JTAG Chip Erase command.
MSG_ERASING = Performing a flash chip erase.
MSG_PROGRAMMING = Programming MCU memory from \`$(TGTFILE)\'.
MSG_SECURING_FLASH = Protecting chip by setting security bit.
MSG_RESETTING = Resetting MCU.
MSG_DEBUGGING = Opening debug connection with MCU.
MSG_RUNNING = Starting CPU execution.
MSG_READING_CPU_REGS = Reading CPU registers.
@ -151,11 +164,11 @@ include $(MAKECFG)
# Default goal: build the project.
ifeq ($(TGTTYPE),.a)
.PHONY: all
all: ccversion a lss sym
all: ccversion a lss sym sizes
else
ifeq ($(TGTTYPE),.elf)
.PHONY: all
all: ccversion elf lss sym bin sizes
all: ccversion elf lss sym hex bin sizes
else
$(error $(ERR_TARGET_TYPE))
endif
@ -166,6 +179,7 @@ endif
clean:
@echo $(MSG_CLEANING)
-$(VERBOSE_CMD)$(RM) $(BIN)
-$(VERBOSE_CMD)$(RM) $(HEX)
-$(VERBOSE_CMD)$(RM) $(SYM)
-$(VERBOSE_CMD)$(RM) $(LSS)
-$(VERBOSE_CMD)$(RM) $(TGTFILE)
@ -219,9 +233,15 @@ lss: $(LSS)
sym: $(SYM)
ifeq ($(TGTTYPE),.elf)
# Create Intel HEX image from ELF output file.
.PHONY: hex
hex: $(HEX)
# Create binary image from ELF output file.
.PHONY: bin
bin: $(BIN)
endif
# Display target size information.
@ -229,17 +249,37 @@ endif
sizes: $(TGTFILE)
@echo
@echo
ifeq ($(TGTTYPE),.a)
@$(SIZE) -Bxt $<
else
ifeq ($(TGTTYPE),.elf)
@$(SIZE) -Ax $<
@$(SIZE) -Bx $<
endif
endif
@echo
@echo
ifeq ($(TGTTYPE),.elf)
# Use ISP instead of JTAGICE mkII when programming.
.PHONY: isp
ifeq ($(filter-out isp verbose,$(MAKECMDGOALS)),)
isp: all
else
isp:
@:
endif
ifeq ($(findstring isp,$(MAKECMDGOALS)),)
# Get CPU information.
.PHONY: cpuinfo
cpuinfo:
@echo
@echo $(MSG_GETTING_CPU_INFO)
$(VERBOSE_CMD)$(SUDO) $(PROGRAM) -cUSB cpuinfo
ifneq ($(call LastWord,$(filter cpuinfo program reset debug run readregs,$(MAKECMDGOALS))),cpuinfo)
$(VERBOSE_CMD)$(PROGRAM) cpuinfo
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase program secureflash reset debug run readregs,$(MAKECMDGOALS))),cpuinfo)
@$(SLEEP) $(SLEEPUSB)
else
@echo
@ -248,45 +288,85 @@ endif
# Stop CPU execution.
.PHONY: halt
halt:
ifeq ($(filter cpuinfo program reset run readregs,$(MAKECMDGOALS)),)
ifeq ($(filter cpuinfo chiperase erase program secureflash reset run readregs,$(MAKECMDGOALS)),)
@echo
@echo $(MSG_HALTING)
$(VERBOSE_CMD)$(SUDO) $(PROGRAM) -cUSB halt
$(VERBOSE_CMD)$(PROGRAM) halt
ifneq ($(call LastWord,$(filter halt debug,$(MAKECMDGOALS))),halt)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
else
@echo > /dev/null
@:
endif
# Program MCU memory from ELF output file.
.PHONY: program
program: $(TGTFILE)
# Perform a JTAG Chip Erase command.
.PHONY: chiperase
chiperase:
@echo
@echo $(MSG_PROGRAMMING)
$(VERBOSE_CMD)$(SUDO) $(PROGRAM) -cUSB program $(FLASH:%=-f%) -e -v -R $(if $(findstring run,$(MAKECMDGOALS)),-r) $<
ifneq ($(call LastWord,$(filter cpuinfo program debug readregs,$(MAKECMDGOALS))),program)
@echo $(MSG_ERASING_CHIP)
$(VERBOSE_CMD)$(PROGRAM) chiperase
ifneq ($(call LastWord,$(filter cpuinfo chiperase program secureflash reset debug run readregs,$(MAKECMDGOALS))),chiperase)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
# Reset CPU.
# Perform a flash chip erase.
.PHONY: erase
erase:
ifeq ($(filter chiperase program,$(MAKECMDGOALS)),)
@echo
@echo $(MSG_ERASING)
$(VERBOSE_CMD)$(PROGRAM) erase $(FLASH:%=-f%)
ifneq ($(call LastWord,$(filter cpuinfo erase secureflash reset debug run readregs,$(MAKECMDGOALS))),erase)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
else
@:
endif
# Program MCU memory from ELF output file.
.PHONY: program
program: all
@echo
@echo $(MSG_PROGRAMMING)
$(VERBOSE_CMD)$(PROGRAM) program $(FLASH:%=-f%) $(PROG_CLOCK:%=-c%) -e -v -R $(if $(findstring run,$(MAKECMDGOALS)),-r) $(TGTFILE)
ifneq ($(call LastWord,$(filter cpuinfo chiperase program secureflash debug readregs,$(MAKECMDGOALS))),program)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
# Protect chip by setting security bit.
.PHONY: secureflash
secureflash:
@echo
@echo $(MSG_SECURING_FLASH)
$(VERBOSE_CMD)$(PROGRAM) secureflash
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase program secureflash reset debug run readregs,$(MAKECMDGOALS))),secureflash)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
# Reset MCU.
.PHONY: reset
reset:
ifeq ($(filter program run,$(MAKECMDGOALS)),)
@echo
@echo $(MSG_RESETTING)
$(VERBOSE_CMD)$(SUDO) $(PROGRAM) -cUSB reset
ifneq ($(call LastWord,$(filter cpuinfo reset debug readregs,$(MAKECMDGOALS))),reset)
$(VERBOSE_CMD)$(PROGRAM) reset
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase secureflash reset debug readregs,$(MAKECMDGOALS))),reset)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
else
@echo > /dev/null
@:
endif
# Open a debug connection with the MCU.
@ -294,8 +374,8 @@ endif
debug:
@echo
@echo $(MSG_DEBUGGING)
$(VERBOSE_CMD)$(SUDO) $(DBGPROXY) -cUSB $(patsubst cfi@%,-f%,$(FLASH:internal@%=-f%))
ifneq ($(call LastWord,$(filter cpuinfo halt program reset debug run readregs,$(MAKECMDGOALS))),debug)
$(VERBOSE_CMD)$(DBGPROXY) $(FLASH:%=-f%)
ifneq ($(call LastWord,$(filter cpuinfo halt chiperase erase program secureflash reset debug run readregs,$(MAKECMDGOALS))),debug)
@$(SLEEP) $(SLEEPUSB)
else
@echo
@ -307,14 +387,14 @@ run:
ifeq ($(findstring program,$(MAKECMDGOALS)),)
@echo
@echo $(MSG_RUNNING)
$(VERBOSE_CMD)$(SUDO) $(PROGRAM) -cUSB run $(if $(findstring reset,$(MAKECMDGOALS)),-R)
ifneq ($(call LastWord,$(filter cpuinfo debug run readregs,$(MAKECMDGOALS))),run)
$(VERBOSE_CMD)$(PROGRAM) run $(if $(findstring reset,$(MAKECMDGOALS)),-R)
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase secureflash debug run readregs,$(MAKECMDGOALS))),run)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
else
@echo > /dev/null
@:
endif
# Read CPU registers.
@ -322,13 +402,80 @@ endif
readregs:
@echo
@echo $(MSG_READING_CPU_REGS)
$(VERBOSE_CMD)$(SUDO) $(PROGRAM) -cUSB readregs
ifneq ($(call LastWord,$(filter cpuinfo program reset debug run readregs,$(MAKECMDGOALS))),readregs)
$(VERBOSE_CMD)$(PROGRAM) readregs
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase program secureflash reset debug run readregs,$(MAKECMDGOALS))),readregs)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
else
# Perform a flash chip erase.
.PHONY: erase
erase:
ifeq ($(findstring program,$(MAKECMDGOALS)),)
@echo
@echo $(MSG_ERASING)
$(VERBOSE_CMD)$(ISP) $(ISPFLAGS) erase f memory flash blankcheck
ifeq ($(call LastWord,$(filter erase secureflash debug run,$(MAKECMDGOALS))),erase)
@echo
endif
else
@:
endif
# Program MCU memory from ELF output file.
.PHONY: program
program: all
@echo
@echo $(MSG_PROGRAMMING)
$(VERBOSE_CMD)$(ISP) $(ISPFLAGS) erase f memory flash blankcheck loadbuffer $(TGTFILE) program verify $(if $(findstring run,$(MAKECMDGOALS)),$(if $(findstring secureflash,$(MAKECMDGOALS)),,start $(if $(findstring reset,$(MAKECMDGOALS)),,no)reset 0))
ifeq ($(call LastWord,$(filter program secureflash debug,$(MAKECMDGOALS))),program)
@echo
endif
# Protect chip by setting security bit.
.PHONY: secureflash
secureflash:
@echo
@echo $(MSG_SECURING_FLASH)
$(VERBOSE_CMD)$(ISP) $(ISPFLAGS) memory security addrange 0x0 0x0 fillbuffer 0x01 program $(if $(findstring run,$(MAKECMDGOALS)),start $(if $(findstring reset,$(MAKECMDGOALS)),,no)reset 0)
ifeq ($(call LastWord,$(filter erase program secureflash debug,$(MAKECMDGOALS))),secureflash)
@echo
endif
# Reset MCU.
.PHONY: reset
reset:
@:
# Open a debug connection with the MCU.
.PHONY: debug
debug:
@echo
@echo $(MSG_DEBUGGING)
$(VERBOSE_CMD)$(DBGPROXY) $(FLASH:%=-f%)
ifeq ($(call LastWord,$(filter erase program secureflash debug run,$(MAKECMDGOALS))),debug)
@echo
endif
# Start CPU execution.
.PHONY: run
run:
ifeq ($(filter program secureflash,$(MAKECMDGOALS)),)
@echo
@echo $(MSG_RUNNING)
$(VERBOSE_CMD)$(ISP) $(ISPFLAGS) start $(if $(findstring reset,$(MAKECMDGOALS)),,no)reset 0
ifeq ($(call LastWord,$(filter erase debug run,$(MAKECMDGOALS))),run)
@echo
endif
else
@:
endif
endif
endif
# Build the documentation.
@ -352,11 +499,11 @@ rebuilddoc: cleandoc doc
# Display main executed commands.
.PHONY: verbose
ifeq ($(MAKECMDGOALS),verbose)
ifeq ($(filter-out isp verbose,$(MAKECMDGOALS)),)
verbose: all
else
verbose:
@echo > /dev/null
@:
endif
ifneq ($(findstring verbose,$(MAKECMDGOALS)),)
# Prefix displaying the following command if and only if verbose is a goal.
@ -456,9 +603,17 @@ $(SYM): $(TGTFILE)
$(VERBOSE_NL)
ifeq ($(TGTTYPE),.elf)
# Create Intel HEX image from ELF output file.
$(HEX): $(TGTFILE)
@echo $(MSG_IHEX_IMAGE)
$(VERBOSE_CMD)$(OBJCOPY) -O ihex $< $@
$(VERBOSE_NL)
# Create binary image from ELF output file.
$(BIN): $(TGTFILE)
@echo $(MSG_BINARY_IMAGE)
$(VERBOSE_CMD)$(OBJCOPY) -O binary $< $@
$(VERBOSE_NL)
endif

View file

@ -42,12 +42,15 @@ UTIL_PATH = $(PRJ_PATH)/UTILS
# CPU architecture: {ap|uc}
ARCH = uc
# Part: {none|ap7000|ap7010|ap7020|uc3a0256|uc3a0512|uc3a1128|uc3a1256|uc3a1512}
# Part: {none|ap7xxx|uc3xxxxx}
PART = uc3a0512
# Flash memories: [type@address,size]...
# Flash memories: [{cfi|internal}@address,size]...
FLASH = internal@0x80000000,512Kb
# Clock source to use when programming: [{xtal|extclk|int}]
PROG_CLOCK = xtal
# Device/Platform/Board include path
PLATFORM_INC_PATH = \
$(BRDS_PATH)/
@ -57,13 +60,15 @@ TARGET = rtosdemo.elf
# Definitions: [-D name[=definition]...] [-U name...]
# Things that might be added to DEFS:
# BOARD Board used: {EVK1100}
# BOARD Board used: {EVKxxxx}
# EXT_BOARD Extension board used (if any): {EXTxxxx}
DEFS = -D BOARD=EVK1100
# Include path
INC_PATH = \
$(UTIL_PATH)/ \
$(UTIL_PATH)/PREPROCESSOR/ \
$(SERV_PATH)/USB/CLASS/DFU/EXAMPLES/ISP/BOOT/ \
$(DRVR_PATH)/INTC/ \
$(DRVR_PATH)/PM/ \
$(DRVR_PATH)/GPIO/ \
@ -81,7 +86,7 @@ CSRCS = \
$(DRVR_PATH)/GPIO/gpio.c \
$(DRVR_PATH)/TC/tc.c \
../../../../Source/portable/GCC/AVR32_UC3/port.c \
../../../../Source/portable/MemMang/heap_3.c \
../../../../Source/portable/MemMang/heap_2.c \
../../../../Source/list.c \
../../../../Source/queue.c \
../../../../Source/tasks.c \
@ -100,6 +105,7 @@ CSRCS = \
# Assembler source files
ASSRCS = \
$(SERV_PATH)/USB/CLASS/DFU/EXAMPLES/ISP/BOOT/trampoline.S \
../../../../Source/portable/GCC/AVR32_UC3/exception.S
# Library path
@ -109,7 +115,7 @@ LIB_PATH =
LIBS =
# Linker script file if any
LINKER_SCRIPT =
LINKER_SCRIPT = $(UTIL_PATH)/LINKER_SCRIPTS/AT32UC3A/0512/GCC/link_uc3a0512.lds
# Options to request or suppress warnings: [-fsyntax-only] [-pedantic[-errors]] [-w] [-Wwarning...]
# For further details, refer to the chapter "GCC Command Options" of the GCC manual.
@ -127,13 +133,13 @@ OPTIMIZATION = -O0 -ffunction-sections -fdata-sections
CPP_EXTRA_FLAGS =
# Extra flags to use when compiling
C_EXTRA_FLAGS = -DGCC_AVR32_PORT
C_EXTRA_FLAGS =
# Extra flags to use when assembling
AS_EXTRA_FLAGS =
# Extra flags to use when linking
LD_EXTRA_FLAGS = -Wl,--gc-sections
LD_EXTRA_FLAGS = -Wl,--gc-sections -Wl,-e,_trampoline
# Documentation path
DOC_PATH = \
@ -141,4 +147,4 @@ DOC_PATH = \
# Documentation configuration file
DOC_CFG = \
../../doxyfile.doxygen
../doxyfile.doxygen

View file

@ -0,0 +1,29 @@
target extended-remote :4711
symbol uc3a0512-rtosdemo.elf
b _handle_Unrecoverable_Exception
b _handle_TLB_Multiple_Hit
b _handle_Bus_Error_Data_Fetch
b _handle_Bus_Error_Instruction_Fetch
b _handle_NMI
b _handle_Instruction_Address
b _handle_ITLB_Protection
b _handle_Breakpoint
b _handle_Illegal_Opcode
b _handle_Unimplemented_Instruction
b _handle_Privilege_Violation
b _handle_Floating_Point
b _handle_Coprocessor_Absent
b _handle_Data_Address_Read
b _handle_Data_Address_Write
b _handle_DTLB_Protection_Read
b _handle_DTLB_Protection_Write
b _handle_DTLB_Modified
b _handle_ITLB_Miss
b _handle_DTLB_Miss_Read
b _handle_DTLB_Miss_Write
define current_task
printf "Task name: %s\n", ((tskTCB *)pxCurrentTCB)->pcTaskName
printf "pxTopOfStack: %x\n", ((tskTCB *)pxCurrentTCB)->pxTopOfStack
end

View file

@ -71,9 +71,9 @@
</settings>
<settings>
<name>JTAGICEMKIIAVR32</name>
<archiveVersion>2</archiveVersion>
<archiveVersion>3</archiveVersion>
<data>
<version>0</version>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -143,6 +143,14 @@
<name>CJtagIceMkIIDaisyChainAfterBits</name>
<state>0</state>
</option>
<option>
<name>FlashLoaders</name>
<state></state>
</option>
<option>
<name>UseFlashLoader</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -160,19 +168,19 @@
</settings>
<debuggerPlugins>
<plugin>
<file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ewplugin</file>
<file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Orti\Orti.ewplugin</file>
<file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Profiling\Profiling.ewplugin</file>
<file>$EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Stack\Stack.ewplugin</file>
<file>$EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
</debuggerPlugins>
@ -246,9 +254,9 @@
</settings>
<settings>
<name>JTAGICEMKIIAVR32</name>
<archiveVersion>2</archiveVersion>
<archiveVersion>3</archiveVersion>
<data>
<version>0</version>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
@ -318,6 +326,14 @@
<name>CJtagIceMkIIDaisyChainAfterBits</name>
<state>0</state>
</option>
<option>
<name>FlashLoaders</name>
<state></state>
</option>
<option>
<name>UseFlashLoader</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -335,19 +351,19 @@
</settings>
<debuggerPlugins>
<plugin>
<file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ewplugin</file>
<file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Orti\Orti.ewplugin</file>
<file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Profiling\Profiling.ewplugin</file>
<file>$EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Stack\Stack.ewplugin</file>
<file>$EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
</debuggerPlugins>

View file

@ -149,15 +149,14 @@
</settings>
<settings>
<name>ICCAVR32</name>
<archiveVersion>2</archiveVersion>
<archiveVersion>3</archiveVersion>
<data>
<version>4</version>
<version>5</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>CCDefines</name>
<state>BOARD=EVK1100</state>
<state>IAR_AVR32_PORT</state>
</option>
<option>
<name>CCPreprocFile</name>
@ -247,15 +246,6 @@
<name>CCCharIs</name>
<state>1</state>
</option>
<option>
<name>CCOptSizeSpeed</name>
<state>1</state>
</option>
<option>
<name>CCOptimization</name>
<version>0</version>
<state>1</state>
</option>
<option>
<name>CCAllowList</name>
<version>0</version>
@ -289,15 +279,6 @@
<name>CCLangSelect</name>
<state>0</state>
</option>
<option>
<name>CCOptSizeSpeedSlave</name>
<state>1</state>
</option>
<option>
<name>CCOptimizationSlave</name>
<version>0</version>
<state>1</state>
</option>
<option>
<name>CCLibConfigHeader</name>
<state>1</state>
@ -354,6 +335,19 @@
<name>CCModuleType</name>
<state>0</state>
</option>
<option>
<name>CCOptLevel</name>
<state>1</state>
</option>
<option>
<name>CCOptStrategy</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CCOptLevelSlave</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
@ -503,15 +497,7 @@
<settings>
<name>JAVATOC</name>
<archiveVersion>0</archiveVersion>
<data>
<version>0</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>JavaToCDummy</name>
<state>1</state>
</option>
</data>
<data/>
</settings>
<settings>
<name>CUSTOM</name>
@ -556,7 +542,7 @@
</option>
<option>
<name>FormatVariant</name>
<version>7</version>
<version>8</version>
<state>2</state>
</option>
<option>
@ -609,11 +595,11 @@
</option>
<option>
<name>XclOverride</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>XclFile</name>
<state>$TOOLKIT_DIR$\config\lnkuc3a0512.xcl</state>
<state>$PROJ_DIR$\..\..\UTILS\LINKER_SCRIPTS\AT32UC3A\0512\IAR\lnkuc3a0512.xcl</state>
</option>
<option>
<name>XclFileSlave</name>
@ -697,7 +683,7 @@
</option>
<option>
<name>xcProgramEntryLabel</name>
<state>__program_start</state>
<state>__trampoline</state>
</option>
<option>
<name>DebugInformation</name>
@ -713,19 +699,19 @@
</option>
<option>
<name>AllowExtraOutput</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>GenerateExtraOutput</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>XExtraOutOverride</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>ExtraOutputFile</name>
<state>rtosdemo.a82</state>
<state>rtosdemo.hex</state>
</option>
<option>
<name>ExtraOutputFormat</name>
@ -734,12 +720,12 @@
</option>
<option>
<name>ExtraFormatVariant</name>
<version>7</version>
<version>8</version>
<state>2</state>
</option>
<option>
<name>xcOverrideProgramEntryLabel</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>xcProgramEntryLabelSelect</name>
@ -973,15 +959,14 @@
</settings>
<settings>
<name>ICCAVR32</name>
<archiveVersion>2</archiveVersion>
<archiveVersion>3</archiveVersion>
<data>
<version>4</version>
<version>5</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>CCDefines</name>
<state>BOARD=EVK1100</state>
<state>IAR_AVR32_PORT</state>
</option>
<option>
<name>CCPreprocFile</name>
@ -1071,15 +1056,6 @@
<name>CCCharIs</name>
<state>1</state>
</option>
<option>
<name>CCOptSizeSpeed</name>
<state>1</state>
</option>
<option>
<name>CCOptimization</name>
<version>0</version>
<state>3</state>
</option>
<option>
<name>CCAllowList</name>
<version>0</version>
@ -1113,15 +1089,6 @@
<name>CCLangSelect</name>
<state>0</state>
</option>
<option>
<name>CCOptSizeSpeedSlave</name>
<state>1</state>
</option>
<option>
<name>CCOptimizationSlave</name>
<version>0</version>
<state>3</state>
</option>
<option>
<name>CCLibConfigHeader</name>
<state>1</state>
@ -1178,6 +1145,19 @@
<name>CCModuleType</name>
<state>0</state>
</option>
<option>
<name>CCOptLevel</name>
<state>3</state>
</option>
<option>
<name>CCOptStrategy</name>
<version>0</version>
<state>2</state>
</option>
<option>
<name>CCOptLevelSlave</name>
<state>3</state>
</option>
</data>
</settings>
<settings>
@ -1327,15 +1307,7 @@
<settings>
<name>JAVATOC</name>
<archiveVersion>0</archiveVersion>
<data>
<version>0</version>
<wantNonLocal>1</wantNonLocal>
<debug>0</debug>
<option>
<name>JavaToCDummy</name>
<state>1</state>
</option>
</data>
<data/>
</settings>
<settings>
<name>CUSTOM</name>
@ -1380,7 +1352,7 @@
</option>
<option>
<name>FormatVariant</name>
<version>7</version>
<version>8</version>
<state>2</state>
</option>
<option>
@ -1433,11 +1405,11 @@
</option>
<option>
<name>XclOverride</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>XclFile</name>
<state>$TOOLKIT_DIR$\config\lnkuc3a0512.xcl</state>
<state>$PROJ_DIR$\..\..\UTILS\LINKER_SCRIPTS\AT32UC3A\0512\IAR\lnkuc3a0512.xcl</state>
</option>
<option>
<name>XclFileSlave</name>
@ -1521,7 +1493,7 @@
</option>
<option>
<name>xcProgramEntryLabel</name>
<state>__program_start</state>
<state>__trampoline</state>
</option>
<option>
<name>DebugInformation</name>
@ -1537,19 +1509,19 @@
</option>
<option>
<name>AllowExtraOutput</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>GenerateExtraOutput</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>XExtraOutOverride</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>ExtraOutputFile</name>
<state>rtosdemo.a82</state>
<state>rtosdemo.hex</state>
</option>
<option>
<name>ExtraOutputFormat</name>
@ -1558,12 +1530,12 @@
</option>
<option>
<name>ExtraFormatVariant</name>
<version>7</version>
<version>8</version>
<state>2</state>
</option>
<option>
<name>xcOverrideProgramEntryLabel</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>xcProgramEntryLabelSelect</name>
@ -1655,6 +1627,9 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\portable\IAR\AVR32_UC3\read.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\SERVICES\USB\CLASS\DFU\EXAMPLES\ISP\BOOT\trampoline.s82</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\portable\IAR\AVR32_UC3\write.c</name>
</file>

View file

@ -0,0 +1,232 @@
# Doxyfile 1.4.7
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "AVR32 UC3 - FreeRTOS Real Time Kernel"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = ../DOC
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = YES
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = YES
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
BUILTIN_STL_SUPPORT = NO
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = YES
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = YES
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = NO
SHOW_DIRECTORIES = NO
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ./../ ./../../../Source ./../../Common/include ./../../Common/Minimal
FILE_PATTERNS = *.c \
*.h \
*.S
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH = ./../
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT =
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = RTF
COMPACT_RTF = NO
RTF_HYPERLINKS = YES
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES
INCLUDE_PATH = ../../../../../BOARDS/
INCLUDE_FILE_PATTERNS =
PREDEFINED = __GNUC__=4 \
__attribute__()= \
__AVR32__=1 \
__AVR32_UC3A0512__=1 \
__AVR32_ABI_COMPILER__ \
BOARD=EVK1100
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = NO
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
CLASS_GRAPH = NO
COLLABORATION_GRAPH = NO
GROUP_GRAPHS = NO
UML_LOOK = YES
TEMPLATE_RELATIONS = YES
INCLUDE_GRAPH = NO
INCLUDED_BY_GRAPH = NO
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = NO
DIRECTORY_GRAPH = NO
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO

View file

@ -0,0 +1,619 @@
# Hey Emacs, this is a -*- makefile -*-
# Goals available on make command line:
#
# [all] Default goal: build the project.
# clean Clean up the project.
# rebuild Rebuild the project.
# ccversion Display CC version information.
# cppfiles file.i Generate preprocessed files from C source files.
# asfiles file.x Generate preprocessed assembler files from C and assembler source files.
# objfiles file.o Generate object files from C and assembler source files.
# a file.a Archive: create A output file from object files.
# elf file.elf Link: create ELF output file from object files.
# lss file.lss Create extended listing from target output file.
# sym file.sym Create symbol table from target output file.
# hex file.hex Create Intel HEX image from ELF output file.
# bin file.bin Create binary image from ELF output file.
# sizes Display target size information.
# isp Use ISP instead of JTAGICE mkII when programming.
# cpuinfo Get CPU information.
# halt Stop CPU execution.
# chiperase Perform a JTAG Chip Erase command.
# erase Perform a flash chip erase.
# program Program MCU memory from ELF output file.
# secureflash Protect chip by setting security bit.
# reset Reset MCU.
# debug Open a debug connection with the MCU.
# run Start CPU execution.
# readregs Read CPU registers.
# doc Build the documentation.
# cleandoc Clean up the documentation.
# rebuilddoc Rebuild the documentation.
# verbose Display main executed commands.
# Copyright (c) 2007, Atmel Corporation All rights reserved.
#
# 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. The name of ATMEL may not be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
# SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **
# ENVIRONMENT SETTINGS
# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **
FirstWord = $(if $(1),$(word 1,$(1)))
LastWord = $(if $(1),$(word $(words $(1)),$(1)))
MAKE = make
MAKECFG = config.mk
TGTTYPE = $(suffix $(TARGET))
TGTFILE = $(PART)-$(TARGET)
RM = rm -Rf
AR = avr32-ar
ARFLAGS = rcs
CPP = $(CC) -E
CPPFLAGS = -march=$(ARCH) -mpart=$(PART) $(WARNINGS) $(DEFS) \
$(PLATFORM_INC_PATH:%=-I%) $(INC_PATH:%=-I%) $(CPP_EXTRA_FLAGS)
DPNDFILES = $(CSRCS:.c=.d) $(ASSRCS:.S=.d)
CPPFILES = $(CSRCS:.c=.i)
CC = avr32-gcc
CFLAGS = $(DEBUG) $(OPTIMIZATION) $(C_EXTRA_FLAGS) \
$(PLATFORM_INC_PATH:%=-Wa,-I%) $(INC_PATH:%=-Wa,-I%) $(AS_EXTRA_FLAGS)
ASFILES = $(CSRCS:.c=.x) $(ASSRCS:.S=.x)
AS = avr32-as
ASFLAGS = $(DEBUG) \
$(PLATFORM_INC_PATH:%=-Wa,-I%) $(INC_PATH:%=-Wa,-I%) $(AS_EXTRA_FLAGS)
OBJFILES = $(CSRCS:.c=.o) $(ASSRCS:.S=.o)
LD = avr32-ld
LDFLAGS = -march=$(ARCH) -mpart=$(PART) \
$(LIB_PATH:%=-L%) $(LINKER_SCRIPT:%=-T%) $(LD_EXTRA_FLAGS)
LOADLIBES =
LDLIBS = $(LIBS:%=-l%)
OBJDUMP = avr32-objdump
LSS = $(TGTFILE:$(TGTTYPE)=.lss)
NM = avr32-nm
SYM = $(TGTFILE:$(TGTTYPE)=.sym)
OBJCOPY = avr32-objcopy
HEX = $(TGTFILE:$(TGTTYPE)=.hex)
BIN = $(TGTFILE:$(TGTTYPE)=.bin)
SIZE = avr32-size
SLEEP = sleep
SLEEPUSB = 9
PROGRAM = avr32program
ISP = batchisp
ISPFLAGS = -device at32$(PART) -hardware usb -operation
DBGPROXY = avr32gdbproxy
DOCGEN = doxygen
# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **
# MESSAGES
# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **
ERR_TARGET_TYPE = Target type not supported: `$(TGTTYPE)'
MSG_CLEANING = Cleaning project.
MSG_PREPROCESSING = Preprocessing \`$<\' to \`$@\'.
MSG_COMPILING = Compiling \`$<\' to \`$@\'.
MSG_ASSEMBLING = Assembling \`$<\' to \`$@\'.
MSG_ARCHIVING = Archiving to \`$@\'.
MSG_LINKING = Linking to \`$@\'.
MSG_EXTENDED_LISTING = Creating extended listing to \`$@\'.
MSG_SYMBOL_TABLE = Creating symbol table to \`$@\'.
MSG_IHEX_IMAGE = Creating Intel HEX image to \`$@\'.
MSG_BINARY_IMAGE = Creating binary image to \`$@\'.
MSG_GETTING_CPU_INFO = Getting CPU information.
MSG_HALTING = Stopping CPU execution.
MSG_ERASING_CHIP = Performing a JTAG Chip Erase command.
MSG_ERASING = Performing a flash chip erase.
MSG_PROGRAMMING = Programming MCU memory from \`$(TGTFILE)\'.
MSG_SECURING_FLASH = Protecting chip by setting security bit.
MSG_RESETTING = Resetting MCU.
MSG_DEBUGGING = Opening debug connection with MCU.
MSG_RUNNING = Starting CPU execution.
MSG_READING_CPU_REGS = Reading CPU registers.
MSG_CLEANING_DOC = Cleaning documentation.
MSG_GENERATING_DOC = Generating documentation to \`$(DOC_PATH)\'.
# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **
# MAKE RULES
# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **
# Include the make configuration file.
include $(MAKECFG)
# ** ** TOP-LEVEL RULES ** **
# Default goal: build the project.
ifeq ($(TGTTYPE),.a)
.PHONY: all
all: ccversion a lss sym sizes
else
ifeq ($(TGTTYPE),.elf)
.PHONY: all
all: ccversion elf lss sym hex bin sizes
else
$(error $(ERR_TARGET_TYPE))
endif
endif
# Clean up the project.
.PHONY: clean
clean:
@echo $(MSG_CLEANING)
-$(VERBOSE_CMD)$(RM) $(BIN)
-$(VERBOSE_CMD)$(RM) $(HEX)
-$(VERBOSE_CMD)$(RM) $(SYM)
-$(VERBOSE_CMD)$(RM) $(LSS)
-$(VERBOSE_CMD)$(RM) $(TGTFILE)
-$(VERBOSE_CMD)$(RM) $(OBJFILES)
-$(VERBOSE_CMD)$(RM) $(ASFILES)
-$(VERBOSE_CMD)$(RM) $(CPPFILES)
-$(VERBOSE_CMD)$(RM) $(DPNDFILES)
$(VERBOSE_NL)
# Rebuild the project.
.PHONY: rebuild
rebuild: clean all
# Display CC version information.
.PHONY: ccversion
ccversion:
@echo
@echo
@$(CC) --version
# Generate preprocessed files from C source files.
.PHONY: cppfiles
cppfiles: $(CPPFILES)
# Generate preprocessed assembler files from C and assembler source files.
.PHONY: asfiles
asfiles: $(ASFILES)
# Generate object files from C and assembler source files.
.PHONY: objfiles
objfiles: $(OBJFILES)
ifeq ($(TGTTYPE),.a)
# Archive: create A output file from object files.
.PHONY: a
a: $(TGTFILE)
else
ifeq ($(TGTTYPE),.elf)
# Link: create ELF output file from object files.
.PHONY: elf
elf: $(TGTFILE)
endif
endif
# Create extended listing from target output file.
.PHONY: lss
lss: $(LSS)
# Create symbol table from target output file.
.PHONY: sym
sym: $(SYM)
ifeq ($(TGTTYPE),.elf)
# Create Intel HEX image from ELF output file.
.PHONY: hex
hex: $(HEX)
# Create binary image from ELF output file.
.PHONY: bin
bin: $(BIN)
endif
# Display target size information.
.PHONY: sizes
sizes: $(TGTFILE)
@echo
@echo
ifeq ($(TGTTYPE),.a)
@$(SIZE) -Bxt $<
else
ifeq ($(TGTTYPE),.elf)
@$(SIZE) -Ax $<
@$(SIZE) -Bx $<
endif
endif
@echo
@echo
ifeq ($(TGTTYPE),.elf)
# Use ISP instead of JTAGICE mkII when programming.
.PHONY: isp
ifeq ($(filter-out isp verbose,$(MAKECMDGOALS)),)
isp: all
else
isp:
@:
endif
ifeq ($(findstring isp,$(MAKECMDGOALS)),)
# Get CPU information.
.PHONY: cpuinfo
cpuinfo:
@echo
@echo $(MSG_GETTING_CPU_INFO)
$(VERBOSE_CMD)$(PROGRAM) cpuinfo
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase program secureflash reset debug run readregs,$(MAKECMDGOALS))),cpuinfo)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
# Stop CPU execution.
.PHONY: halt
halt:
ifeq ($(filter cpuinfo chiperase erase program secureflash reset run readregs,$(MAKECMDGOALS)),)
@echo
@echo $(MSG_HALTING)
$(VERBOSE_CMD)$(PROGRAM) halt
ifneq ($(call LastWord,$(filter halt debug,$(MAKECMDGOALS))),halt)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
else
@:
endif
# Perform a JTAG Chip Erase command.
.PHONY: chiperase
chiperase:
@echo
@echo $(MSG_ERASING_CHIP)
$(VERBOSE_CMD)$(PROGRAM) chiperase
ifneq ($(call LastWord,$(filter cpuinfo chiperase program secureflash reset debug run readregs,$(MAKECMDGOALS))),chiperase)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
# Perform a flash chip erase.
.PHONY: erase
erase:
ifeq ($(filter chiperase program,$(MAKECMDGOALS)),)
@echo
@echo $(MSG_ERASING)
$(VERBOSE_CMD)$(PROGRAM) erase $(FLASH:%=-f%)
ifneq ($(call LastWord,$(filter cpuinfo erase secureflash reset debug run readregs,$(MAKECMDGOALS))),erase)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
else
@:
endif
# Program MCU memory from ELF output file.
.PHONY: program
program: all
@echo
@echo $(MSG_PROGRAMMING)
$(VERBOSE_CMD)$(PROGRAM) program $(FLASH:%=-f%) $(PROG_CLOCK:%=-c%) -e -v -R $(if $(findstring run,$(MAKECMDGOALS)),-r) $(TGTFILE)
ifneq ($(call LastWord,$(filter cpuinfo chiperase program secureflash debug readregs,$(MAKECMDGOALS))),program)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
# Protect chip by setting security bit.
.PHONY: secureflash
secureflash:
@echo
@echo $(MSG_SECURING_FLASH)
$(VERBOSE_CMD)$(PROGRAM) secureflash
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase program secureflash reset debug run readregs,$(MAKECMDGOALS))),secureflash)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
# Reset MCU.
.PHONY: reset
reset:
ifeq ($(filter program run,$(MAKECMDGOALS)),)
@echo
@echo $(MSG_RESETTING)
$(VERBOSE_CMD)$(PROGRAM) reset
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase secureflash reset debug readregs,$(MAKECMDGOALS))),reset)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
else
@:
endif
# Open a debug connection with the MCU.
.PHONY: debug
debug:
@echo
@echo $(MSG_DEBUGGING)
$(VERBOSE_CMD)$(DBGPROXY) $(FLASH:%=-f%)
ifneq ($(call LastWord,$(filter cpuinfo halt chiperase erase program secureflash reset debug run readregs,$(MAKECMDGOALS))),debug)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
# Start CPU execution.
.PHONY: run
run:
ifeq ($(findstring program,$(MAKECMDGOALS)),)
@echo
@echo $(MSG_RUNNING)
$(VERBOSE_CMD)$(PROGRAM) run $(if $(findstring reset,$(MAKECMDGOALS)),-R)
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase secureflash debug run readregs,$(MAKECMDGOALS))),run)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
else
@:
endif
# Read CPU registers.
.PHONY: readregs
readregs:
@echo
@echo $(MSG_READING_CPU_REGS)
$(VERBOSE_CMD)$(PROGRAM) readregs
ifneq ($(call LastWord,$(filter cpuinfo chiperase erase program secureflash reset debug run readregs,$(MAKECMDGOALS))),readregs)
@$(SLEEP) $(SLEEPUSB)
else
@echo
endif
else
# Perform a flash chip erase.
.PHONY: erase
erase:
ifeq ($(findstring program,$(MAKECMDGOALS)),)
@echo
@echo $(MSG_ERASING)
$(VERBOSE_CMD)$(ISP) $(ISPFLAGS) erase f memory flash blankcheck
ifeq ($(call LastWord,$(filter erase secureflash debug run,$(MAKECMDGOALS))),erase)
@echo
endif
else
@:
endif
# Program MCU memory from ELF output file.
.PHONY: program
program: all
@echo
@echo $(MSG_PROGRAMMING)
$(VERBOSE_CMD)$(ISP) $(ISPFLAGS) erase f memory flash blankcheck loadbuffer $(TGTFILE) program verify $(if $(findstring run,$(MAKECMDGOALS)),$(if $(findstring secureflash,$(MAKECMDGOALS)),,start $(if $(findstring reset,$(MAKECMDGOALS)),,no)reset 0))
ifeq ($(call LastWord,$(filter program secureflash debug,$(MAKECMDGOALS))),program)
@echo
endif
# Protect chip by setting security bit.
.PHONY: secureflash
secureflash:
@echo
@echo $(MSG_SECURING_FLASH)
$(VERBOSE_CMD)$(ISP) $(ISPFLAGS) memory security addrange 0x0 0x0 fillbuffer 0x01 program $(if $(findstring run,$(MAKECMDGOALS)),start $(if $(findstring reset,$(MAKECMDGOALS)),,no)reset 0)
ifeq ($(call LastWord,$(filter erase program secureflash debug,$(MAKECMDGOALS))),secureflash)
@echo
endif
# Reset MCU.
.PHONY: reset
reset:
@:
# Open a debug connection with the MCU.
.PHONY: debug
debug:
@echo
@echo $(MSG_DEBUGGING)
$(VERBOSE_CMD)$(DBGPROXY) $(FLASH:%=-f%)
ifeq ($(call LastWord,$(filter erase program secureflash debug run,$(MAKECMDGOALS))),debug)
@echo
endif
# Start CPU execution.
.PHONY: run
run:
ifeq ($(filter program secureflash,$(MAKECMDGOALS)),)
@echo
@echo $(MSG_RUNNING)
$(VERBOSE_CMD)$(ISP) $(ISPFLAGS) start $(if $(findstring reset,$(MAKECMDGOALS)),,no)reset 0
ifeq ($(call LastWord,$(filter erase debug run,$(MAKECMDGOALS))),run)
@echo
endif
else
@:
endif
endif
endif
# Build the documentation.
.PHONY: doc
doc:
@echo
@echo $(MSG_GENERATING_DOC)
$(VERBOSE_CMD)cd $(dir $(DOC_CFG)) && $(DOCGEN) $(notdir $(DOC_CFG))
@echo
# Clean up the documentation.
.PHONY: cleandoc
cleandoc:
@echo $(MSG_CLEANING_DOC)
-$(VERBOSE_CMD)$(RM) $(DOC_PATH)
$(VERBOSE_NL)
# Rebuild the documentation.
.PHONY: rebuilddoc
rebuilddoc: cleandoc doc
# Display main executed commands.
.PHONY: verbose
ifeq ($(filter-out isp verbose,$(MAKECMDGOALS)),)
verbose: all
else
verbose:
@:
endif
ifneq ($(findstring verbose,$(MAKECMDGOALS)),)
# Prefix displaying the following command if and only if verbose is a goal.
VERBOSE_CMD =
# New line displayed if and only if verbose is a goal.
VERBOSE_NL = @echo
else
VERBOSE_CMD = @
VERBOSE_NL =
endif
# ** ** COMPILATION RULES ** **
# Include silently the dependency files.
-include $(DPNDFILES)
# The dependency files are not built alone but along with first generation files.
$(DPNDFILES):
# First generation files depend on make files.
$(CPPFILES) $(ASFILES) $(OBJFILES): Makefile $(MAKECFG)
ifeq ($(TGTTYPE),.elf)
# Files resulting from linking depend on linker script.
$(TGTFILE): $(LINKER_SCRIPT)
endif
# Preprocess: create preprocessed files from C source files.
%.i: %.c %.d
@echo $(MSG_PREPROCESSING)
$(VERBOSE_CMD)$(CPP) $(CPPFLAGS) -MD -MP -MT '$*.i $*.x $*.o' -o $@ $<
@touch $*.d
@touch $@
$(VERBOSE_NL)
# Preprocess & compile: create assembler files from C source files.
%.x: %.c %.d
@echo $(MSG_COMPILING)
$(VERBOSE_CMD)$(CC) -S $(CPPFLAGS) -MD -MP -MT '$*.i $*.o' $(CFLAGS) -o $@ $<
@touch $*.d
@touch $@
$(VERBOSE_NL)
# Preprocess: create preprocessed files from assembler source files.
%.x: %.S %.d
@echo $(MSG_PREPROCESSING)
$(VERBOSE_CMD)$(CPP) $(CPPFLAGS) -MD -MP -MT '$*.x $*.o' -o $@ $<
@touch $*.d
@touch $@
$(VERBOSE_NL)
# Preprocess, compile & assemble: create object files from C source files.
%.o: %.c %.d
@echo $(MSG_COMPILING)
$(VERBOSE_CMD)$(CC) -c $(CPPFLAGS) -MD -MP -MT '$*.i $*.x' $(CFLAGS) -o $@ $<
@touch $*.d
@touch $@
$(VERBOSE_NL)
# Preprocess & assemble: create object files from assembler source files.
%.o: %.S %.d
@echo $(MSG_ASSEMBLING)
$(VERBOSE_CMD)$(CC) -c $(CPPFLAGS) -MD -MP -MT '$*.x' $(ASFLAGS) -o $@ $<
@touch $*.d
@touch $@
$(VERBOSE_NL)
.PRECIOUS: $(OBJFILES)
ifeq ($(TGTTYPE),.a)
# Archive: create A output file from object files.
.SECONDARY: $(TGTFILE)
$(TGTFILE): $(OBJFILES)
@echo $(MSG_ARCHIVING)
$(VERBOSE_CMD)$(AR) $(ARFLAGS) $@ $(filter %.o,$+)
$(VERBOSE_NL)
else
ifeq ($(TGTTYPE),.elf)
# Link: create ELF output file from object files.
.SECONDARY: $(TGTFILE)
$(TGTFILE): $(OBJFILES)
@echo $(MSG_LINKING)
$(VERBOSE_CMD)$(CC) $(LDFLAGS) $(filter %.o,$+) $(LOADLIBES) $(LDLIBS) -o $@
$(VERBOSE_NL)
endif
endif
# Create extended listing from target output file.
$(LSS): $(TGTFILE)
@echo $(MSG_EXTENDED_LISTING)
$(VERBOSE_CMD)$(OBJDUMP) -h -S $< > $@
$(VERBOSE_NL)
# Create symbol table from target output file.
$(SYM): $(TGTFILE)
@echo $(MSG_SYMBOL_TABLE)
$(VERBOSE_CMD)$(NM) -n $< > $@
$(VERBOSE_NL)
ifeq ($(TGTTYPE),.elf)
# Create Intel HEX image from ELF output file.
$(HEX): $(TGTFILE)
@echo $(MSG_IHEX_IMAGE)
$(VERBOSE_CMD)$(OBJCOPY) -O ihex $< $@
$(VERBOSE_NL)
# Create binary image from ELF output file.
$(BIN): $(TGTFILE)
@echo $(MSG_BINARY_IMAGE)
$(VERBOSE_CMD)$(OBJCOPY) -O binary $< $@
$(VERBOSE_NL)
endif

View file

@ -0,0 +1,150 @@
# Hey Emacs, this is a -*- makefile -*-
# The purpose of this file is to define the build configuration variables used
# by the generic Makefile. See Makefile header for further information.
# Copyright (c) 2007, Atmel Corporation All rights reserved.
#
# 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. The name of ATMEL may not be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
# SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
# Base paths
PRJ_PATH = ../..
APPS_PATH = $(PRJ_PATH)/APPLICATIONS
BRDS_PATH = $(PRJ_PATH)/BOARDS
COMP_PATH = $(PRJ_PATH)/COMPONENTS
DRVR_PATH = $(PRJ_PATH)/DRIVERS
SERV_PATH = $(PRJ_PATH)/SERVICES
UTIL_PATH = $(PRJ_PATH)/UTILS
# CPU architecture: {ap|uc}
ARCH = uc
# Part: {none|ap7xxx|uc3xxxxx}
PART = uc3b0256
# Flash memories: [{cfi|internal}@address,size]...
FLASH = internal@0x80000000,256Kb
# Clock source to use when programming: [{xtal|extclk|int}]
PROG_CLOCK = xtal
# Device/Platform/Board include path
PLATFORM_INC_PATH = \
$(BRDS_PATH)/
# Target name: {*.a|*.elf}
TARGET = rtosdemo.elf
# Definitions: [-D name[=definition]...] [-U name...]
# Things that might be added to DEFS:
# BOARD Board used: {EVKxxxx}
# EXT_BOARD Extension board used (if any): {EXTxxxx}
DEFS = -D BOARD=EVK1101
# Include path
INC_PATH = \
$(UTIL_PATH)/ \
$(UTIL_PATH)/PREPROCESSOR/ \
$(SERV_PATH)/USB/CLASS/DFU/EXAMPLES/ISP/BOOT/ \
$(DRVR_PATH)/INTC/ \
$(DRVR_PATH)/PM/ \
$(DRVR_PATH)/GPIO/ \
$(DRVR_PATH)/TC/ \
../../../../Source/portable/GCC/AVR32_UC3/ \
../../../../Source/include/ \
../../../Common/include/ \
../../
# C source files
CSRCS = \
$(BRDS_PATH)/EVK1101/led.c \
$(DRVR_PATH)/INTC/intc.c \
$(DRVR_PATH)/PM/pm.c \
$(DRVR_PATH)/GPIO/gpio.c \
$(DRVR_PATH)/TC/tc.c \
../../../../Source/portable/GCC/AVR32_UC3/port.c \
../../../../Source/portable/MemMang/heap_2.c \
../../../../Source/list.c \
../../../../Source/queue.c \
../../../../Source/tasks.c \
../../../Common/Minimal/BlockQ.c \
../../../Common/Minimal/comtest.c \
../../../Common/Minimal/death.c \
../../../Common/Minimal/dynamic.c \
../../../Common/Minimal/flash.c \
../../../Common/Minimal/flop.c \
../../../Common/Minimal/integer.c \
../../../Common/Minimal/PollQ.c \
../../../Common/Minimal/semtest.c \
../../ParTest/ParTest.c \
../../serial/serial.c \
../../main.c
# Assembler source files
ASSRCS = \
$(SERV_PATH)/USB/CLASS/DFU/EXAMPLES/ISP/BOOT/trampoline.S \
../../../../Source/portable/GCC/AVR32_UC3/exception.S
# Library path
LIB_PATH =
# Libraries to link with the project
LIBS =
# Linker script file if any
LINKER_SCRIPT = $(UTIL_PATH)/LINKER_SCRIPTS/AT32UC3B/0256/GCC/link_uc3b0256.lds
# Options to request or suppress warnings: [-fsyntax-only] [-pedantic[-errors]] [-w] [-Wwarning...]
# For further details, refer to the chapter "GCC Command Options" of the GCC manual.
WARNINGS = -Wall
# Options for debugging: [-g]...
# For further details, refer to the chapter "GCC Command Options" of the GCC manual.
DEBUG = -g
# Options that control optimization: [-O[0|1|2|3|s]]...
# For further details, refer to the chapter "GCC Command Options" of the GCC manual.
OPTIMIZATION = -O0 -ffunction-sections -fdata-sections
# Extra flags to use when preprocessing
CPP_EXTRA_FLAGS =
# Extra flags to use when compiling
C_EXTRA_FLAGS =
# Extra flags to use when assembling
AS_EXTRA_FLAGS =
# Extra flags to use when linking
LD_EXTRA_FLAGS = -Wl,--gc-sections -Wl,-e,_trampoline
# Documentation path
DOC_PATH = \
../../DOC/
# Documentation configuration file
DOC_CFG = \
../doxyfile.doxygen

View file

@ -0,0 +1,29 @@
target extended-remote :4711
symbol uc3b0256-rtosdemo.elf
b _handle_Unrecoverable_Exception
b _handle_TLB_Multiple_Hit
b _handle_Bus_Error_Data_Fetch
b _handle_Bus_Error_Instruction_Fetch
b _handle_NMI
b _handle_Instruction_Address
b _handle_ITLB_Protection
b _handle_Breakpoint
b _handle_Illegal_Opcode
b _handle_Unimplemented_Instruction
b _handle_Privilege_Violation
b _handle_Floating_Point
b _handle_Coprocessor_Absent
b _handle_Data_Address_Read
b _handle_Data_Address_Write
b _handle_DTLB_Protection_Read
b _handle_DTLB_Protection_Write
b _handle_DTLB_Modified
b _handle_ITLB_Miss
b _handle_DTLB_Miss_Read
b _handle_DTLB_Miss_Write
define current_task
printf "Task name: %s\n", ((tskTCB *)pxCurrentTCB)->pcTaskName
printf "pxTopOfStack: %x\n", ((tskTCB *)pxCurrentTCB)->pxTopOfStack
end

View file

@ -0,0 +1,232 @@
# Doxyfile 1.4.7
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "AVR32 UC3 - FreeRTOS Real Time Kernel"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = ../DOC
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = YES
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = YES
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
BUILTIN_STL_SUPPORT = NO
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = YES
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = YES
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = NO
SHOW_DIRECTORIES = NO
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ./../ ./../../../Source ./../../Common/include ./../../Common/Minimal
FILE_PATTERNS = *.c \
*.h \
*.S
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH = ./../
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT =
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = RTF
COMPACT_RTF = NO
RTF_HYPERLINKS = YES
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES
INCLUDE_PATH = ../../../../../BOARDS/
INCLUDE_FILE_PATTERNS =
PREDEFINED = __GNUC__=4 \
__attribute__()= \
__AVR32__=1 \
__AVR32_UC3B0256__=1 \
__AVR32_ABI_COMPILER__ \
BOARD=EVK1101
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = NO
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
CLASS_GRAPH = NO
COLLABORATION_GRAPH = NO
GROUP_GRAPHS = NO
UML_LOOK = YES
TEMPLATE_RELATIONS = YES
INCLUDE_GRAPH = NO
INCLUDED_BY_GRAPH = NO
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = NO
DIRECTORY_GRAPH = NO
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO

View file

@ -1,5 +1,3 @@
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
@ -13,7 +11,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
@ -64,7 +62,7 @@
// part.
//#define FRCOSC 115200 //!< RCOsc frequency: Hz.
#define FOSC32 32000 //!< Osc32 frequency: Hz.
#define FOSC32 32768 //!< Osc32 frequency: Hz.
#define OSC32_STARTUP 3 //!< Osc32 startup time: RCOsc periods.
#define FOSC0 12000000 //!< Osc0 frequency: Hz.
@ -117,6 +115,13 @@
# define USB_VBOF_ACTIVE_LEVEL LOW
#endif
//! USB overcurrent detection pin.
#ifdef EVK1100_REVA
# define USB_OVERCURRENT_DETECT_PIN AVR32_PIN_PB18
#else
# define USB_OVERCURRENT_DETECT_PIN AVR32_PIN_PX33
#endif
//! @}
@ -278,7 +283,7 @@
*/
//! @{
#define DIP204_BACKLIGHT_PIN AVR32_PIN_PB18
#define DIP204_PWM_CHANNEL AVR32_PWM_CHID6
#define DIP204_PWM_CHANNEL 6
#define DIP204_PWM_PIN AVR32_PWM_PWM_6_PIN
#define DIP204_PWM_FUNCTION AVR32_PWM_PWM_6_FUNCTION
//! @}
@ -299,9 +304,11 @@
//! @}
/*! \name SPI Connections of the SD/MMC Connector
/*! \name GPIO and SPI Connections of the SD/MMC Connector
*/
//! @{
#define SD_MMC_CARD_DETECT_PIN AVR32_PIN_PA02
#define SD_MMC_WRITE_PROTECT_PIN AVR32_PIN_PA07
#define SD_MMC_SPI (&AVR32_SPI1)
#define SD_MMC_SPI_CS 1
#define SD_MMC_SPI_SCK_PIN AVR32_SPI1_SCK_0_PIN

View file

@ -1,5 +1,3 @@
/* This source file is part of the ATMEL FREERTOS-0.9.0 Release */
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
@ -13,7 +11,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
@ -45,14 +43,7 @@
*/
#if __GNUC__
# include <avr32/io.h>
#elif __ICCAVR32__
# include <avr32/iouc3a0512.h>
#else
# error Unknown compiler
#endif
#include <avr32/io.h>
#include "preprocessor.h"
#include "compiler.h"
#include "evk1100.h"
@ -89,7 +80,7 @@ static tLED_DESCRIPTOR LED_DESCRIPTOR[LED_COUNT] =
//! Saved state of all LEDs.
static U32 LED_State = (1 << LED_COUNT) - 1;
static volatile U32 LED_State = (1 << LED_COUNT) - 1;
U32 LED_Read_Display(void)

View file

@ -1,5 +1,3 @@
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
@ -13,7 +11,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/

View file

@ -0,0 +1,239 @@
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
* \brief AT32UC3B EVK1101 board header file.
*
* This file contains definitions and services related to the features of the
* EVK1101 board.
*
* - Compiler: IAR EWAVR32 and GNU GCC for AVR32
* - Supported devices: All AVR32 AT32UC3B devices can be used.
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _EVK1101_H_
#define _EVK1101_H_
#include "compiler.h"
#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.
# include "led.h"
#endif // __AVR32_ABI_COMPILER__
/*! \name Oscillator Definitions
*/
//! @{
// RCOsc has no custom calibration by default. Set the following definition to
// the appropriate value if a custom RCOsc calibration has been applied to your
// part.
//#define FRCOSC 115200 //!< RCOsc frequency: Hz.
#define FOSC32 32768 //!< Osc32 frequency: Hz.
#define OSC32_STARTUP 3 //!< Osc32 startup time: RCOsc periods.
#define FOSC0 12000000 //!< Osc0 frequency: Hz.
#define OSC0_STARTUP 3 //!< Osc0 startup time: RCOsc periods.
// Osc1 crystal is not mounted by default. Set the following definitions to the
// appropriate values if a custom Osc1 crystal is mounted on your board.
//#define FOSC1 12000000 //!< Osc1 frequency: Hz.
//#define OSC1_STARTUP 3 //!< Osc1 startup time: RCOsc periods.
//! @}
/*! \name USB Definitions
*/
//! @{
//! Multiplexed pin used for USB_ID: AVR32_USBB_USB_ID_x_x.
//! To be selected according to the AVR32_USBB_USB_ID_x_x_PIN and
//! AVR32_USBB_USB_ID_x_x_FUNCTION definitions from <avr32/uc3bxxxx.h>.
#define USB_ID AVR32_USBB_USB_ID_0_0
//! Multiplexed pin used for USB_VBOF: AVR32_USBB_USB_VBOF_x_x.
//! To be selected according to the AVR32_USBB_USB_VBOF_x_x_PIN and
//! AVR32_USBB_USB_VBOF_x_x_FUNCTION definitions from <avr32/uc3bxxxx.h>.
#define USB_VBOF AVR32_USBB_USB_VBOF_0_0
//! Active level of the USB_VBOF output pin.
#define USB_VBOF_ACTIVE_LEVEL LOW
//! USB overcurrent detection pin.
#define USB_OVERCURRENT_DETECT_PIN AVR32_PIN_PA20
//! @}
//! Number of LEDs.
#define LED_COUNT 4
/*! \name GPIO Connections of LEDs
*/
//! @{
#define LED0_GPIO AVR32_PIN_PA07
#define LED1_GPIO AVR32_PIN_PA08
#define LED2_GPIO AVR32_PIN_PA21
#define LED3_GPIO AVR32_PIN_PA22
//! @}
/*! \name PWM Channels of LEDs
*/
//! @{
#define LED0_PWM 0
#define LED1_PWM 1
#define LED2_PWM 2
#define LED3_PWM 6
//! @}
/*! \name PWM Functions of LEDs
*/
//! @{
#define LED0_PWM_FUNCTION AVR32_PWM_PWM_0_0_FUNCTION
#define LED1_PWM_FUNCTION AVR32_PWM_PWM_1_0_FUNCTION
#define LED2_PWM_FUNCTION AVR32_PWM_PWM_2_0_FUNCTION
#define LED3_PWM_FUNCTION AVR32_PWM_PWM_6_0_FUNCTION
//! @}
/*! \name Color Identifiers of LEDs to Use with LED Functions
*/
//! @{
#define LED_MONO0_GREEN LED0
#define LED_MONO1_GREEN LED1
#define LED_MONO2_GREEN LED2
#define LED_MONO3_GREEN LED3
//! @}
/*! \name GPIO Connections of Push Buttons
*/
//! @{
#define GPIO_PUSH_BUTTON_0 AVR32_PIN_PB02
#define GPIO_PUSH_BUTTON_1 AVR32_PIN_PB03
//! @}
/*! \name GPIO Connections of the Joystick
*/
//! @{
#define GPIO_JOYSTICK_PUSH AVR32_PIN_PA13
#define GPIO_JOYSTICK_LEFT AVR32_PIN_PB06
#define GPIO_JOYSTICK_RIGHT AVR32_PIN_PB09
#define GPIO_JOYSTICK_UP AVR32_PIN_PB07
#define GPIO_JOYSTICK_DOWN AVR32_PIN_PB08
//! @}
/*! \name ADC Connection of the Temperature Sensor
*/
//! @{
#define ADC_TEMPERATURE_CHANNEL 7
#define ADC_TEMPERATURE_PIN AVR32_ADC_AD_7_PIN
#define ADC_TEMPERATURE_FUNCTION AVR32_ADC_AD_7_FUNCTION
//! @}
/*! \name ADC Connection of the Light Sensor
*/
//! @{
#define ADC_LIGHT_CHANNEL 6
#define ADC_LIGHT_PIN AVR32_ADC_AD_6_PIN
#define ADC_LIGHT_FUNCTION AVR32_ADC_AD_6_FUNCTION
//! @}
/*! \name ADC Connections of the Accelerometer
*/
//! @{
#define ADC_ACC_X_CHANNEL 1
#define ADC_ACC_X_PIN AVR32_ADC_AD_1_PIN
#define ADC_ACC_X_FUNCTION AVR32_ADC_AD_1_FUNCTION
#define ADC_ACC_Y_CHANNEL 2
#define ADC_ACC_Y_PIN AVR32_ADC_AD_2_PIN
#define ADC_ACC_Y_FUNCTION AVR32_ADC_AD_2_FUNCTION
#define ADC_ACC_Z_CHANNEL 3
#define ADC_ACC_Z_PIN AVR32_ADC_AD_3_PIN
#define ADC_ACC_Z_FUNCTION AVR32_ADC_AD_3_FUNCTION
//! @}
/*! \name PWM Connections of Audio
*/
//! @{
#define AUDIO_LOW_PWM_CHANNEL 5
#define AUDIO_LOW_PWM_PIN AVR32_PWM_PWM_5_0_PIN
#define AUDIO_LOW_PWM_FUNCTION AVR32_PWM_PWM_5_0_FUNCTION
#define AUDIO_HIGH_PWM_CHANNEL 6
#define AUDIO_HIGH_PWM_PIN AVR32_PWM_PWM_6_1_PIN
#define AUDIO_HIGH_PWM_FUNCTION AVR32_PWM_PWM_6_1_FUNCTION
//! @}
/*! \name SPI Connections of the AT45DBX Data Flash Memory
*/
//! @{
#define AT45DBX_SPI (&AVR32_SPI)
#define AT45DBX_SPI_SCK_PIN AVR32_SPI_SCK_0_0_PIN
#define AT45DBX_SPI_SCK_FUNCTION AVR32_SPI_SCK_0_0_FUNCTION
#define AT45DBX_SPI_MISO_PIN AVR32_SPI_MISO_0_0_PIN
#define AT45DBX_SPI_MISO_FUNCTION AVR32_SPI_MISO_0_0_FUNCTION
#define AT45DBX_SPI_MOSI_PIN AVR32_SPI_MOSI_0_0_PIN
#define AT45DBX_SPI_MOSI_FUNCTION AVR32_SPI_MOSI_0_0_FUNCTION
#define AT45DBX_SPI_NPCS0_PIN AVR32_SPI_NPCS_0_0_PIN
#define AT45DBX_SPI_NPCS0_FUNCTION AVR32_SPI_NPCS_0_0_FUNCTION
//! @}
/*! \name GPIO and SPI Connections of the SD/MMC Connector
*/
//! @{
#define SD_MMC_CARD_DETECT_PIN AVR32_PIN_PB00
#define SD_MMC_WRITE_PROTECT_PIN AVR32_PIN_PB01
#define SD_MMC_SPI (&AVR32_SPI)
#define SD_MMC_SPI_CS 1
#define SD_MMC_SPI_SCK_PIN AVR32_SPI_SCK_0_0_PIN
#define SD_MMC_SPI_SCK_FUNCTION AVR32_SPI_SCK_0_0_FUNCTION
#define SD_MMC_SPI_MISO_PIN AVR32_SPI_MISO_0_0_PIN
#define SD_MMC_SPI_MISO_FUNCTION AVR32_SPI_MISO_0_0_FUNCTION
#define SD_MMC_SPI_MOSI_PIN AVR32_SPI_MOSI_0_0_PIN
#define SD_MMC_SPI_MOSI_FUNCTION AVR32_SPI_MOSI_0_0_FUNCTION
#define SD_MMC_SPI_NPCS_PIN AVR32_SPI_NPCS_1_0_PIN
#define SD_MMC_SPI_NPCS_FUNCTION AVR32_SPI_NPCS_1_0_FUNCTION
//! @}
#endif // _EVK1101_H_

View file

@ -0,0 +1,305 @@
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
* \brief AT32UC3B EVK1101 board LEDs support package.
*
* This file contains definitions and services related to the LED features of
* the EVK1101 board.
*
* - Compiler: IAR EWAVR32 and GNU GCC for AVR32
* - Supported devices: All AVR32 AT32UC3B devices can be used.
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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 <avr32/io.h>
#include "preprocessor.h"
#include "compiler.h"
#include "evk1101.h"
#include "led.h"
//! Structure describing LED hardware connections.
typedef const struct
{
struct
{
U32 PORT; //!< LED GPIO port.
U32 PIN_MASK; //!< Bit-mask of LED pin in GPIO port.
} GPIO; //!< LED GPIO descriptor.
struct
{
S32 CHANNEL; //!< LED PWM channel (< 0 if N/A).
S32 FUNCTION; //!< LED pin PWM function (< 0 if N/A).
} PWM; //!< LED PWM descriptor.
} tLED_DESCRIPTOR;
//! Hardware descriptors of all LEDs.
static tLED_DESCRIPTOR LED_DESCRIPTOR[LED_COUNT] =
{
#define INSERT_LED_DESCRIPTOR(LED_NO, unused) \
{ \
{LED##LED_NO##_GPIO / 32, 1 << (LED##LED_NO##_GPIO % 32)},\
{LED##LED_NO##_PWM, LED##LED_NO##_PWM_FUNCTION } \
},
MREPEAT(LED_COUNT, INSERT_LED_DESCRIPTOR, ~)
#undef INSERT_LED_DESCRIPTOR
};
//! Saved state of all LEDs.
static volatile U32 LED_State = (1 << LED_COUNT) - 1;
U32 LED_Read_Display(void)
{
return LED_State;
}
void LED_Display(U32 leds)
{
tLED_DESCRIPTOR *led_descriptor;
volatile avr32_gpio_port_t *led_gpio_port;
leds &= (1 << LED_COUNT) - 1;
LED_State = leds;
for (led_descriptor = &LED_DESCRIPTOR[0];
led_descriptor < LED_DESCRIPTOR + LED_COUNT;
led_descriptor++)
{
led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];
if (leds & 1)
{
led_gpio_port->ovrc = led_descriptor->GPIO.PIN_MASK;
}
else
{
led_gpio_port->ovrs = led_descriptor->GPIO.PIN_MASK;
}
led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;
led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;
leds >>= 1;
}
}
U32 LED_Read_Display_Mask(U32 mask)
{
return Rd_bits(LED_State, mask);
}
void LED_Display_Mask(U32 mask, U32 leds)
{
tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;
volatile avr32_gpio_port_t *led_gpio_port;
U8 led_shift;
mask &= (1 << LED_COUNT) - 1;
Wr_bits(LED_State, mask, leds);
while (mask)
{
led_shift = 1 + ctz(mask);
led_descriptor += led_shift;
led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];
leds >>= led_shift - 1;
if (leds & 1)
{
led_gpio_port->ovrc = led_descriptor->GPIO.PIN_MASK;
}
else
{
led_gpio_port->ovrs = led_descriptor->GPIO.PIN_MASK;
}
led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;
led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;
leds >>= 1;
mask >>= led_shift;
}
}
Bool LED_Test(U32 leds)
{
return Tst_bits(LED_State, leds);
}
void LED_Off(U32 leds)
{
tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;
volatile avr32_gpio_port_t *led_gpio_port;
U8 led_shift;
leds &= (1 << LED_COUNT) - 1;
Clr_bits(LED_State, leds);
while (leds)
{
led_shift = 1 + ctz(leds);
led_descriptor += led_shift;
led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];
led_gpio_port->ovrs = led_descriptor->GPIO.PIN_MASK;
led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;
led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;
leds >>= led_shift;
}
}
void LED_On(U32 leds)
{
tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;
volatile avr32_gpio_port_t *led_gpio_port;
U8 led_shift;
leds &= (1 << LED_COUNT) - 1;
Set_bits(LED_State, leds);
while (leds)
{
led_shift = 1 + ctz(leds);
led_descriptor += led_shift;
led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];
led_gpio_port->ovrc = led_descriptor->GPIO.PIN_MASK;
led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;
led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;
leds >>= led_shift;
}
}
void LED_Toggle(U32 leds)
{
tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;
volatile avr32_gpio_port_t *led_gpio_port;
U8 led_shift;
leds &= (1 << LED_COUNT) - 1;
Tgl_bits(LED_State, leds);
while (leds)
{
led_shift = 1 + ctz(leds);
led_descriptor += led_shift;
led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];
led_gpio_port->ovrt = led_descriptor->GPIO.PIN_MASK;
led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;
led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;
leds >>= led_shift;
}
}
U32 LED_Read_Display_Field(U32 field)
{
return Rd_bitfield(LED_State, field);
}
void LED_Display_Field(U32 field, U32 leds)
{
LED_Display_Mask(field, leds << ctz(field));
}
U8 LED_Get_Intensity(U32 led)
{
tLED_DESCRIPTOR *led_descriptor;
// Check that the argument value is valid.
led = ctz(led);
led_descriptor = &LED_DESCRIPTOR[led];
if (led >= LED_COUNT || led_descriptor->PWM.CHANNEL < 0) return 0;
// Return the duty cycle value if the LED PWM channel is enabled, else 0.
return (AVR32_PWM.sr & (1 << led_descriptor->PWM.CHANNEL)) ?
AVR32_PWM.channel[led_descriptor->PWM.CHANNEL].cdty : 0;
}
void LED_Set_Intensity(U32 leds, U8 intensity)
{
tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;
volatile avr32_pwm_channel_t *led_pwm_channel;
volatile avr32_gpio_port_t *led_gpio_port;
U8 led_shift;
// For each specified LED...
for (leds &= (1 << LED_COUNT) - 1; leds; leds >>= led_shift)
{
// Select the next specified LED and check that it has a PWM channel.
led_shift = 1 + ctz(leds);
led_descriptor += led_shift;
if (led_descriptor->PWM.CHANNEL < 0) continue;
// Initialize or update the LED PWM channel.
led_pwm_channel = &AVR32_PWM.channel[led_descriptor->PWM.CHANNEL];
if (!(AVR32_PWM.sr & (1 << led_descriptor->PWM.CHANNEL)))
{
led_pwm_channel->cmr = (AVR32_PWM_CPRE_MCK << AVR32_PWM_CPRE_OFFSET) &
~(AVR32_PWM_CALG_MASK |
AVR32_PWM_CPOL_MASK |
AVR32_PWM_CPD_MASK);
led_pwm_channel->cprd = 0x000000FF;
led_pwm_channel->cdty = intensity;
AVR32_PWM.ena = 1 << led_descriptor->PWM.CHANNEL;
}
else
{
AVR32_PWM.isr;
while (!(AVR32_PWM.isr & (1 << led_descriptor->PWM.CHANNEL)));
led_pwm_channel->cupd = intensity;
}
// Switch the LED pin to its PWM function.
led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];
if (led_descriptor->PWM.FUNCTION & 0x1)
{
led_gpio_port->pmr0s = led_descriptor->GPIO.PIN_MASK;
}
else
{
led_gpio_port->pmr0c = led_descriptor->GPIO.PIN_MASK;
}
if (led_descriptor->PWM.FUNCTION & 0x2)
{
led_gpio_port->pmr1s = led_descriptor->GPIO.PIN_MASK;
}
else
{
led_gpio_port->pmr1c = led_descriptor->GPIO.PIN_MASK;
}
led_gpio_port->gperc = led_descriptor->GPIO.PIN_MASK;
}
}

View file

@ -0,0 +1,182 @@
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
* \brief AT32UC3B EVK1101 board LEDs support package.
*
* This file contains definitions and services related to the LED features of
* the EVK1101 board.
*
* - Compiler: IAR EWAVR32 and GNU GCC for AVR32
* - Supported devices: All AVR32 AT32UC3B devices can be used.
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _LED_H_
#define _LED_H_
#include "compiler.h"
/*! \name Identifiers of LEDs to Use with LED Functions
*/
//! @{
#define LED0 0x01
#define LED1 0x02
#define LED2 0x04
#define LED3 0x08
//! @}
/*! \brief Gets the last state of all LEDs set through the LED API.
*
* \return State of all LEDs (1 bit per LED).
*
* \note The GPIO pin configuration of all LEDs is left unchanged.
*/
extern U32 LED_Read_Display(void);
/*! \brief Sets the state of all LEDs.
*
* \param leds New state of all LEDs (1 bit per LED).
*
* \note The pins of all LEDs are set to GPIO output mode.
*/
extern void LED_Display(U32 leds);
/*! \brief Gets the last state of the specified LEDs set through the LED API.
*
* \param mask LEDs of which to get the state (1 bit per LED).
*
* \return State of the specified LEDs (1 bit per LED).
*
* \note The GPIO pin configuration of all LEDs is left unchanged.
*/
extern U32 LED_Read_Display_Mask(U32 mask);
/*! \brief Sets the state of the specified LEDs.
*
* \param mask LEDs of which to set the state (1 bit per LED).
*
* \param leds New state of the specified LEDs (1 bit per LED).
*
* \note The pins of the specified LEDs are set to GPIO output mode.
*/
extern void LED_Display_Mask(U32 mask, U32 leds);
/*! \brief Tests the last state of the specified LEDs set through the LED API.
*
* \param leds LEDs of which to test the state (1 bit per LED).
*
* \return \c TRUE if at least one of the specified LEDs has a state on, else
* \c FALSE.
*
* \note The GPIO pin configuration of all LEDs is left unchanged.
*/
extern Bool LED_Test(U32 leds);
/*! \brief Turns off the specified LEDs.
*
* \param leds LEDs to turn off (1 bit per LED).
*
* \note The pins of the specified LEDs are set to GPIO output mode.
*/
extern void LED_Off(U32 leds);
/*! \brief Turns on the specified LEDs.
*
* \param leds LEDs to turn on (1 bit per LED).
*
* \note The pins of the specified LEDs are set to GPIO output mode.
*/
extern void LED_On(U32 leds);
/*! \brief Toggles the specified LEDs.
*
* \param leds LEDs to toggle (1 bit per LED).
*
* \note The pins of the specified LEDs are set to GPIO output mode.
*/
extern void LED_Toggle(U32 leds);
/*! \brief Gets as a bit-field the last state of the specified LEDs set through
* the LED API.
*
* \param field LEDs of which to get the state (1 bit per LED).
*
* \return State of the specified LEDs (1 bit per LED, beginning with the first
* specified LED).
*
* \note The GPIO pin configuration of all LEDs is left unchanged.
*/
extern U32 LED_Read_Display_Field(U32 field);
/*! \brief Sets as a bit-field the state of the specified LEDs.
*
* \param field LEDs of which to set the state (1 bit per LED).
* \param leds New state of the specified LEDs (1 bit per LED, beginning with
* the first specified LED).
*
* \note The pins of the specified LEDs are set to GPIO output mode.
*/
extern void LED_Display_Field(U32 field, U32 leds);
/*! \brief Gets the intensity of the specified LED.
*
* \param led LED of which to get the intensity (1 bit per LED; only the least
* significant set bit is used).
*
* \return Intensity of the specified LED (0x00 to 0xFF).
*
* \warning The PWM channel of the specified LED is supposed to be used only by
* this module.
*
* \note The GPIO pin configuration of all LEDs is left unchanged.
*/
extern U8 LED_Get_Intensity(U32 led);
/*! \brief Sets the intensity of the specified LEDs.
*
* \param leds LEDs of which to set the intensity (1 bit per LED).
* \param intensity New intensity of the specified LEDs (0x00 to 0xFF).
*
* \warning The PWM channels of the specified LEDs are supposed to be used only
* by this module.
*
* \note The pins of the specified LEDs are set to PWM output mode.
*/
extern void LED_Set_Intensity(U32 leds, U8 intensity);
#endif // _LED_H_

View file

@ -1,5 +1,3 @@
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
@ -13,7 +11,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
@ -48,22 +46,33 @@
#ifndef _BOARD_H_
#define _BOARD_H_
#if __GNUC__
# include <avr32/io.h>
#elif __ICCAVR32__ || __AAVR32__
# include <avr32/iouc3a0512.h>
#else
# error Unknown compiler
#endif
#include <avr32/io.h>
/*! \name Base Boards
*/
//! @{
#define EVK1100 1 //!< AT32UC3A EVK1100 board.
#define EVK1101 2 //!< AT32UC3B EVK1101 board.
//! @}
/*! \name Extension Boards
*/
//! @{
#define EXT1102 1 //!< AT32UC3B EXT1102 board.
//! @}
#if BOARD == EVK1100
# include "EVK1100/evk1100.h"
#elif BOARD == EVK1101
# include "EVK1101/evk1101.h"
#else
# error No known AVR32 board defined
#endif
#if EXT_BOARD == EXT1102
# include "EXT1102/ext1102.h"
#endif
#ifndef FRCOSC
# define FRCOSC AVR32_PM_RCOSC_FREQUENCY //!< Default RCOsc frequency.

View file

@ -6,11 +6,11 @@
* This file defines a useful set of functions for the GPIO.
*
* - Compiler: IAR EWAVR32 and GNU GCC for AVR32
* - Supported devices: All AVR32 devices with a PWM module can be used.
* - Supported devices: All AVR32 devices with a GPIO module can be used.
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
*****************************************************************************/

View file

@ -10,7 +10,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
*****************************************************************************/
@ -45,13 +45,7 @@
#ifndef _GPIO_H_
#define _GPIO_H_
#if __GNUC__
# include <avr32/io.h>
#elif __ICCAVR32__
# include <avr32/iouc3a0512.h>
#else
# error Unknown compiler
#endif
#include <avr32/io.h>
/*! \name Return Values of the GPIO API
@ -90,8 +84,16 @@ extern int gpio_enable_module(const gpio_map_t gpiomap, unsigned int size);
/*! \brief Enables a specific module mode for a pin.
*
* \param pin The pin number.
* \param function The pin function.
* \param pin The pin number.\n
* Refer to the product header file `uc3x.h' (where x is the part
* number; e.g. x = a0512) for module pins. E.g., to enable a PWM
* channel output, the pin number can be AVR32_PWM_PWM_3_PIN for PWM
* channel 3.
* \param function The pin function.\n
* Refer to the product header file `uc3x.h' (where x is the
* part number; e.g. x = a0512) for module pin functions. E.g.,
* to enable a PWM channel output, the pin function can be
* AVR32_PWM_PWM_3_FUNCTION for PWM channel 3.
*
* \return \ref GPIO_SUCCESS or \ref GPIO_INVALID_ARGUMENT.
*/
@ -106,7 +108,12 @@ extern void gpio_enable_gpio(const gpio_map_t gpiomap, unsigned int size);
/*! \brief Enables the GPIO mode of a pin.
*
* \param pin The pin number.
* \param pin The pin number.\n
* Refer to the product header file `uc3x.h' (where x is the part
* number; e.g. x = a0512) for pin definitions. E.g., to enable the
* GPIO mode of PX21, AVR32_PIN_PX21 can be used. Module pins such as
* AVR32_PWM_PWM_3_PIN for PWM channel 3 can also be used to release
* module pins for GPIO.
*/
extern void gpio_enable_gpio_pin(unsigned int pin);

View file

@ -10,7 +10,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
@ -42,14 +42,7 @@
*/
#if __GNUC__
# include <avr32/io.h>
#elif __ICCAVR32__
# include <avr32/iouc3a0512.h>
#else
# error Unknown compiler
#endif
#include <avr32/io.h>
#include "compiler.h"
#include "preprocessor.h"
#include "intc.h"
@ -61,7 +54,7 @@ extern const unsigned int ipr_val[AVR32_INTC_NUM_INT_LEVELS];
//! Creates a table of interrupt line handlers per interrupt group in order to optimize RAM space.
//! Each line handler table contains a set of pointers to interrupt handlers.
#define DECL_INT_LINE_HANDLER_TABLE(GRP, unused) \
static volatile __int_handler _int_line_handler_table_##GRP[AVR32_INTC_NUM_IRQS_PER_GRP##GRP];
static volatile __int_handler _int_line_handler_table_##GRP[Max(AVR32_INTC_NUM_IRQS_PER_GRP##GRP, 1)];
MREPEAT(AVR32_INTC_NUM_INT_GRPS, DECL_INT_LINE_HANDLER_TABLE, ~);
#undef DECL_INT_LINE_HANDLER_TABLE
@ -186,6 +179,7 @@ void INTC_init_interrupts(void)
void INTC_register_interrupt(__int_handler handler, unsigned int irq, unsigned int int_lev)
{
// Determine the group of the IRQ.
unsigned int int_grp = irq / AVR32_INTC_MAX_NUM_IRQS_PER_GRP;
// Store in _int_line_handler_table_x the pointer to the interrupt handler, so

View file

@ -10,7 +10,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/

View file

@ -9,7 +9,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
*****************************************************************************/
@ -44,297 +44,275 @@
#include "pm.h"
/*! \name PM Writable Bit-Field Registers
*/
//! @{
typedef union
{
unsigned long mcctrl;
avr32_pm_mcctrl_t MCCTRL;
} u_avr32_pm_mcctrl_t;
typedef union
{
unsigned long cksel;
avr32_pm_cksel_t CKSEL;
} u_avr32_pm_cksel_t;
typedef union
{
unsigned long pll;
avr32_pm_pll_t PLL;
} u_avr32_pm_pll_t;
typedef union
{
unsigned long oscctrl0;
avr32_pm_oscctrl0_t OSCCTRL0;
} u_avr32_pm_oscctrl0_t;
typedef union
{
unsigned long oscctrl1;
avr32_pm_oscctrl1_t OSCCTRL1;
} u_avr32_pm_oscctrl1_t;
typedef union
{
unsigned long oscctrl32;
avr32_pm_oscctrl32_t OSCCTRL32;
} u_avr32_pm_oscctrl32_t;
typedef union
{
unsigned long ier;
avr32_pm_ier_t IER;
} u_avr32_pm_ier_t;
typedef union
{
unsigned long idr;
avr32_pm_idr_t IDR;
} u_avr32_pm_idr_t;
typedef union
{
unsigned long icr;
avr32_pm_icr_t ICR;
} u_avr32_pm_icr_t;
typedef union
{
unsigned long gcctrl;
avr32_pm_gcctrl_t GCCTRL;
} u_avr32_pm_gcctrl_t;
typedef union
{
unsigned long rccr;
avr32_pm_rccr_t RCCR;
} u_avr32_pm_rccr_t;
typedef union
{
unsigned long bgcr;
avr32_pm_bgcr_t BGCR;
} u_avr32_pm_bgcr_t;
typedef union
{
unsigned long vregcr;
avr32_pm_vregcr_t VREGCR;
} u_avr32_pm_vregcr_t;
typedef union
{
unsigned long bod;
avr32_pm_bod_t BOD;
} u_avr32_pm_bod_t;
//! @}
/*! \brief Sets the mode of the oscillator 0.
*
* \param pm Base address of the Power Manager (i.e. &AVR32_PM).
* \param mode Oscillator 0 mode (i.e. AVR32_PM_OSCCTRL0_MODE_x).
*/
static void pm_set_osc0_mode(volatile avr32_pm_t *pm, unsigned int mode)
{
// Read
u_avr32_pm_oscctrl0_t u_avr32_pm_oscctrl0 = {pm->oscctrl0};
// Modify
u_avr32_pm_oscctrl0.OSCCTRL0.mode = mode;
// Write
pm->oscctrl0 = u_avr32_pm_oscctrl0.oscctrl0;
}
void pm_enable_osc0_ext_clock(volatile avr32_pm_t *pm)
{
union {
unsigned long oscctrl0;
avr32_pm_oscctrl0_t OSCCTRL0;
} oscctrl0 ;
// Read
oscctrl0.oscctrl0 = pm->oscctrl0;
// Modify
oscctrl0.OSCCTRL0.mode = AVR32_PM_OSCCTRL0_MODE_EXT_CLOCK;
// Write
pm->oscctrl0 = oscctrl0.oscctrl0;
pm_set_osc0_mode(pm, AVR32_PM_OSCCTRL0_MODE_EXT_CLOCK);
}
void pm_enable_osc0_crystal(volatile avr32_pm_t *pm, unsigned int fosc0)
{
union {
unsigned long oscctrl0;
avr32_pm_oscctrl0_t OSCCTRL0;
} oscctrl0 ;
// Read
oscctrl0.oscctrl0 = pm->oscctrl0;
// Modify
oscctrl0.OSCCTRL0.mode = (fosc0 < 8000000) ? AVR32_PM_OSCCTRL0_MODE_CRYSTAL_G2 :
AVR32_PM_OSCCTRL0_MODE_CRYSTAL_G3;
// Write
pm->oscctrl0 = oscctrl0.oscctrl0;
pm_set_osc0_mode(pm, (fosc0 < 8000000) ? AVR32_PM_OSCCTRL0_MODE_CRYSTAL_G2 :
AVR32_PM_OSCCTRL0_MODE_CRYSTAL_G3);
}
void pm_enable_clk0(volatile avr32_pm_t *pm, unsigned int startup)
{
union {
avr32_pm_mcctrl_t MCCTRL;
unsigned long mcctrl;
} mcctrl;
union {
unsigned long oscctrl0;
avr32_pm_oscctrl0_t OSCCTRL0;
} oscctrl0 ;
// Read register
mcctrl.mcctrl = pm->mcctrl;
oscctrl0.oscctrl0 = pm->oscctrl0;
// Modify
mcctrl.MCCTRL.osc0en = 1;
oscctrl0.OSCCTRL0.startup = startup;
// Write back
pm->oscctrl0 = oscctrl0.oscctrl0;
pm->mcctrl = mcctrl.mcctrl;
while(!pm->ISR.osc0rdy); //For osc output valid
pm_enable_clk0_no_wait(pm, startup);
pm_wait_for_clk0_ready(pm);
}
void pm_disable_clk0(volatile avr32_pm_t *pm)
{
union {
avr32_pm_mcctrl_t MCCTRL;
unsigned long mcctrl;
} mcctrl;
// Read register
mcctrl.mcctrl = pm->mcctrl;
// Modify
mcctrl.MCCTRL.osc0en = 0;
// Write back
pm->mcctrl = mcctrl.mcctrl;
pm->mcctrl &= ~AVR32_PM_MCCTRL_OSC0EN_MASK;
}
void pm_enable_clk0_no_wait(volatile avr32_pm_t *pm, unsigned int startup)
{
union {
avr32_pm_mcctrl_t MCCTRL;
unsigned long mcctrl;
} mcctrl;
union {
unsigned long oscctrl0;
avr32_pm_oscctrl0_t OSCCTRL0;
} oscctrl0 ;
// Read register
mcctrl.mcctrl = pm->mcctrl;
oscctrl0.oscctrl0 = pm->oscctrl0;
u_avr32_pm_oscctrl0_t u_avr32_pm_oscctrl0 = {pm->oscctrl0};
// Modify
mcctrl.MCCTRL.osc0en = 1;
oscctrl0.OSCCTRL0.startup=startup;
u_avr32_pm_oscctrl0.OSCCTRL0.startup = startup;
// Write back
pm->mcctrl = mcctrl.mcctrl;
pm->oscctrl0 = oscctrl0.oscctrl0;
pm->oscctrl0 = u_avr32_pm_oscctrl0.oscctrl0;
pm->mcctrl |= AVR32_PM_MCCTRL_OSC0EN_MASK;
}
void pm_wait_for_clk0_ready(volatile avr32_pm_t *pm)
{
while(!pm->ISR.osc0rdy);
while (!(pm->poscsr & AVR32_PM_POSCSR_OSC0RDY_MASK));
}
/*! \brief Sets the mode of the oscillator 1.
*
* \param pm Base address of the Power Manager (i.e. &AVR32_PM).
* \param mode Oscillator 1 mode (i.e. AVR32_PM_OSCCTRL1_MODE_x).
*/
static void pm_set_osc1_mode(volatile avr32_pm_t *pm, unsigned int mode)
{
// Read
u_avr32_pm_oscctrl1_t u_avr32_pm_oscctrl1 = {pm->oscctrl1};
// Modify
u_avr32_pm_oscctrl1.OSCCTRL1.mode = mode;
// Write
pm->oscctrl1 = u_avr32_pm_oscctrl1.oscctrl1;
}
void pm_enable_osc1_ext_clock(volatile avr32_pm_t *pm)
{
union {
unsigned long oscctrl1;
avr32_pm_oscctrl1_t OSCCTRL1;
} oscctrl1 ;
// Read
oscctrl1.oscctrl1= pm->oscctrl1;
// Modify
oscctrl1.OSCCTRL1.mode = AVR32_PM_OSCCTRL1_MODE_EXT_CLOCK;
// Write
pm->oscctrl1 = oscctrl1.oscctrl1;
pm_set_osc1_mode(pm, AVR32_PM_OSCCTRL1_MODE_EXT_CLOCK);
}
void pm_enable_osc1_crystal(volatile avr32_pm_t *pm, unsigned int fosc1)
{
union {
unsigned long oscctrl1;
avr32_pm_oscctrl1_t OSCCTRL1;
} oscctrl1 ;
// Read
oscctrl1.oscctrl1= pm->oscctrl1;
// Modify
oscctrl1.OSCCTRL1.mode = (fosc1 < 8000000) ? AVR32_PM_OSCCTRL1_MODE_CRYSTAL_G2 :
AVR32_PM_OSCCTRL1_MODE_CRYSTAL_G3;
// Write
pm->oscctrl1 = oscctrl1.oscctrl1;
pm_set_osc1_mode(pm, (fosc1 < 8000000) ? AVR32_PM_OSCCTRL1_MODE_CRYSTAL_G2 :
AVR32_PM_OSCCTRL1_MODE_CRYSTAL_G3);
}
void pm_enable_clk1(volatile avr32_pm_t *pm, unsigned int startup)
{
union {
avr32_pm_mcctrl_t MCCTRL;
unsigned long mcctrl;
} mcctrl;
union {
unsigned long oscctrl1;
avr32_pm_oscctrl1_t OSCCTRL1;
} oscctrl1 ;
// Read register
mcctrl.mcctrl = pm->mcctrl;
oscctrl1.oscctrl1 = pm->oscctrl1;
mcctrl.MCCTRL.osc1en = 1;
oscctrl1.OSCCTRL1.startup=startup;
// Write back
pm->oscctrl1 = oscctrl1.oscctrl1;
pm->mcctrl = mcctrl.mcctrl;
while(!pm->ISR.osc1rdy);
pm_enable_clk1_no_wait(pm, startup);
pm_wait_for_clk1_ready(pm);
}
void pm_disable_clk1(volatile avr32_pm_t *pm)
{
union {
avr32_pm_mcctrl_t MCCTRL;
unsigned long mcctrl;
} mcctrl;
// Read register
mcctrl.mcctrl = pm->mcctrl;
// Modify
mcctrl.MCCTRL.osc1en = 0;
// Write back
pm->mcctrl = mcctrl.mcctrl;
pm->mcctrl &= ~AVR32_PM_MCCTRL_OSC1EN_MASK;
}
void pm_enable_clk1_no_wait(volatile avr32_pm_t *pm, unsigned int startup)
{
union {
avr32_pm_mcctrl_t MCCTRL;
unsigned long mcctrl;
} mcctrl;
union {
unsigned long oscctrl1;
avr32_pm_oscctrl1_t OSCCTRL1;
} oscctrl1 ;
// Read register
mcctrl.mcctrl = pm->mcctrl;
oscctrl1.oscctrl1 = pm->oscctrl1;
mcctrl.MCCTRL.osc1en = 1;
oscctrl1.OSCCTRL1.startup=startup;
u_avr32_pm_oscctrl1_t u_avr32_pm_oscctrl1 = {pm->oscctrl1};
// Modify
u_avr32_pm_oscctrl1.OSCCTRL1.startup = startup;
// Write back
pm->oscctrl1 = oscctrl1.oscctrl1;
pm->mcctrl = mcctrl.mcctrl;
pm->oscctrl1 = u_avr32_pm_oscctrl1.oscctrl1;
pm->mcctrl |= AVR32_PM_MCCTRL_OSC1EN_MASK;
}
void pm_wait_for_clk1_ready(volatile avr32_pm_t *pm)
{
while(!pm->ISR.osc1rdy);
while (!(pm->poscsr & AVR32_PM_POSCSR_OSC1RDY_MASK));
}
/*! \brief Sets the mode of the 32-kHz oscillator.
*
* \param pm Base address of the Power Manager (i.e. &AVR32_PM).
* \param mode 32-kHz oscillator mode (i.e. AVR32_PM_OSCCTRL32_MODE_x).
*/
static void pm_set_osc32_mode(volatile avr32_pm_t *pm, unsigned int mode)
{
// Read
u_avr32_pm_oscctrl32_t u_avr32_pm_oscctrl32 = {pm->oscctrl32};
// Modify
u_avr32_pm_oscctrl32.OSCCTRL32.mode = mode;
// Write
pm->oscctrl32 = u_avr32_pm_oscctrl32.oscctrl32;
}
void pm_enable_osc32_ext_clock(volatile avr32_pm_t *pm)
{
union {
unsigned long oscctrl32;
avr32_pm_oscctrl32_t OSCCTRL32;
} u_ctrl;
u_ctrl.oscctrl32 = pm->oscctrl32;
u_ctrl.OSCCTRL32.mode = AVR32_PM_OSCCTRL32_MODE_EXT_CLOCK;
pm->oscctrl32 = u_ctrl.oscctrl32;
pm_set_osc32_mode(pm, AVR32_PM_OSCCTRL32_MODE_EXT_CLOCK);
}
void pm_enable_osc32_crystal(volatile avr32_pm_t *pm)
{
union {
unsigned long oscctrl32;
avr32_pm_oscctrl32_t OSCCTRL32;
} u_ctrl;
u_ctrl.oscctrl32 = pm->oscctrl32;
u_ctrl.OSCCTRL32.mode = AVR32_PM_OSCCTRL32_MODE_CRYSTAL;
pm->oscctrl32 = u_ctrl.oscctrl32;
pm_set_osc32_mode(pm, AVR32_PM_OSCCTRL32_MODE_CRYSTAL);
}
void pm_enable_clk32(volatile avr32_pm_t *pm, unsigned int startup)
{
union {
unsigned long oscctrl32;
avr32_pm_oscctrl32_t OSCCTRL32;
} oscctrl32 ;
// Read register
oscctrl32.oscctrl32 = pm->oscctrl32;
// Modify
oscctrl32.OSCCTRL32.osc32en = 1;
oscctrl32.OSCCTRL32.startup=startup;
// Write back
pm->oscctrl32 = oscctrl32.oscctrl32;
while(!pm->ISR.osc32rdy);
pm_enable_clk32_no_wait(pm, startup);
pm_wait_for_clk32_ready(pm);
}
void pm_disable_clk32(volatile avr32_pm_t *pm)
{
// To get rid of a GCC bug
// This makes C code longer, but not ASM
union {
unsigned long oscctrl32;
avr32_pm_oscctrl32_t OSCCTRL32;
} oscctrl32 ;
// Read register
oscctrl32.oscctrl32 = pm->oscctrl32;
// Modify
oscctrl32.OSCCTRL32.osc32en = 0;
// Write back
pm->oscctrl32 = oscctrl32.oscctrl32;
pm->oscctrl32 &= ~AVR32_PM_OSCCTRL32_OSC32EN_MASK;
}
void pm_enable_clk32_no_wait(volatile avr32_pm_t *pm, unsigned int startup)
{
union {
unsigned long oscctrl32;
avr32_pm_oscctrl32_t OSCCTRL32;
} oscctrl32 ;
// Read register
oscctrl32.oscctrl32 = pm->oscctrl32;
u_avr32_pm_oscctrl32_t u_avr32_pm_oscctrl32 = {pm->oscctrl32};
// Modify
oscctrl32.OSCCTRL32.osc32en = 1;
oscctrl32.OSCCTRL32.startup=startup;
u_avr32_pm_oscctrl32.OSCCTRL32.osc32en = 1;
u_avr32_pm_oscctrl32.OSCCTRL32.startup = startup;
// Write back
pm->oscctrl32 = oscctrl32.oscctrl32;
pm->oscctrl32 = u_avr32_pm_oscctrl32.oscctrl32;
}
void pm_wait_for_clk32_ready(volatile avr32_pm_t *pm)
{
// To get rid of a GCC bug
// This makes C code longer, but not ASM
while(!pm->ISR.osc32rdy);
while (!(pm->poscsr & AVR32_PM_POSCSR_OSC32RDY_MASK));
}
@ -346,29 +324,21 @@ void pm_cksel(volatile avr32_pm_t *pm,
unsigned int hsbdiv,
unsigned int hsbsel)
{
// Force the compiler to generate only one 32 bits access
union {
avr32_pm_cksel_t selval ;
unsigned long uword32;
} cksel;
u_avr32_pm_cksel_t u_avr32_pm_cksel = {0};
cksel.uword32 = 0;
u_avr32_pm_cksel.CKSEL.cpusel = hsbsel;
u_avr32_pm_cksel.CKSEL.cpudiv = hsbdiv;
u_avr32_pm_cksel.CKSEL.hsbsel = hsbsel;
u_avr32_pm_cksel.CKSEL.hsbdiv = hsbdiv;
u_avr32_pm_cksel.CKSEL.pbasel = pbasel;
u_avr32_pm_cksel.CKSEL.pbadiv = pbadiv;
u_avr32_pm_cksel.CKSEL.pbbsel = pbbsel;
u_avr32_pm_cksel.CKSEL.pbbdiv = pbbdiv;
cksel.selval.cpudiv = hsbdiv;
cksel.selval.cpusel = hsbsel;
cksel.selval.hsbdiv = hsbdiv;
cksel.selval.hsbsel = hsbsel;
cksel.selval.pbbdiv = pbbdiv;
cksel.selval.pbbsel = pbbsel;
cksel.selval.pbadiv = pbadiv;
cksel.selval.pbasel = pbasel;
pm->cksel = cksel.uword32;
pm->cksel = u_avr32_pm_cksel.cksel;
// Wait for ckrdy bit and then clear it
while(!(pm->ISR.ckrdy));
return;
while (!(pm->poscsr & AVR32_PM_POSCSR_CKRDY_MASK));
}
@ -377,42 +347,30 @@ void pm_gc_setup(volatile avr32_pm_t *pm,
unsigned int osc_or_pll, // Use Osc (=0) or PLL (=1)
unsigned int pll_osc, // Sel Osc0/PLL0 or Osc1/PLL1
unsigned int diven,
unsigned int div) {
union {
unsigned long gcctrl;
avr32_pm_gcctrl_t GCCTRL;
} u_gc;
unsigned int div)
{
u_avr32_pm_gcctrl_t u_avr32_pm_gcctrl = {0};
u_gc.GCCTRL.oscsel = pll_osc;
u_gc.GCCTRL.pllsel = osc_or_pll;
u_gc.GCCTRL.diven = diven;
u_gc.GCCTRL.div = div;
u_gc.GCCTRL.cen = 0; // Disable GC first
pm->gcctrl[gc] = u_gc.gcctrl;
u_avr32_pm_gcctrl.GCCTRL.oscsel = pll_osc;
u_avr32_pm_gcctrl.GCCTRL.pllsel = osc_or_pll;
u_avr32_pm_gcctrl.GCCTRL.diven = diven;
u_avr32_pm_gcctrl.GCCTRL.div = div;
pm->gcctrl[gc] = u_avr32_pm_gcctrl.gcctrl;
}
void pm_gc_enable(volatile avr32_pm_t *pm,
unsigned int gc) {
union {
unsigned long gcctrl;
avr32_pm_gcctrl_t GCCTRL;
} u_gc;
u_gc.gcctrl = pm->gcctrl[gc];
u_gc.GCCTRL.cen = 1;
pm->gcctrl[gc] = u_gc.gcctrl;
unsigned int gc)
{
pm->gcctrl[gc] |= AVR32_PM_GCCTRL_CEN_MASK;
}
void pm_gc_disable(volatile avr32_pm_t *pm,
unsigned int gc) {
union {
unsigned long gcctrl;
avr32_pm_gcctrl_t GCCTRL;
} u_gc;
u_gc.gcctrl = pm->gcctrl[gc];
u_gc.GCCTRL.cen = 0;
pm->gcctrl[gc] = u_gc.gcctrl;
unsigned int gc)
{
pm->gcctrl[gc] &= ~AVR32_PM_GCCTRL_CEN_MASK;
}
@ -421,25 +379,16 @@ void pm_pll_setup(volatile avr32_pm_t *pm,
unsigned int mul,
unsigned int div,
unsigned int osc,
unsigned int lockcount) {
unsigned int lockcount)
{
u_avr32_pm_pll_t u_avr32_pm_pll = {0};
union {
unsigned long pll ;
avr32_pm_pll_t PLL ;
} u_pll;
u_avr32_pm_pll.PLL.pllosc = osc;
u_avr32_pm_pll.PLL.plldiv = div;
u_avr32_pm_pll.PLL.pllmul = mul;
u_avr32_pm_pll.PLL.pllcount = lockcount;
u_pll.pll=0;
u_pll.PLL.pllmul = mul;
u_pll.PLL.plldiv = div;
u_pll.PLL.pllosc = osc;
u_pll.PLL.pllcount = lockcount;
u_pll.PLL.pllopt = 0;
u_pll.PLL.plltest = 0;
(pm->pll)[pll] = u_pll.pll;
pm->pll[pll] = u_avr32_pm_pll.pll;
}
@ -447,53 +396,38 @@ void pm_pll_set_option(volatile avr32_pm_t *pm,
unsigned int pll,
unsigned int pll_freq,
unsigned int pll_div2,
unsigned int pll_wbwdisable) {
union {
unsigned long pll ;
avr32_pm_pll_t PLL ;
} u_pll;
u_pll.pll = (pm->pll)[pll];
u_pll.PLL.pllopt = pll_freq | (pll_div2<<1) | (pll_wbwdisable<<2);
(pm->pll)[pll] = u_pll.pll;
unsigned int pll_wbwdisable)
{
u_avr32_pm_pll_t u_avr32_pm_pll = {pm->pll[pll]};
u_avr32_pm_pll.PLL.pllopt = pll_freq | (pll_div2 << 1) | (pll_wbwdisable << 2);
pm->pll[pll] = u_avr32_pm_pll.pll;
}
unsigned int pm_pll_get_option(volatile avr32_pm_t *pm,
unsigned int pll) {
return (pm->PLL)[pll].pllopt;
unsigned int pll)
{
return (pm->pll[pll] & AVR32_PM_PLLOPT_MASK) >> AVR32_PM_PLLOPT_OFFSET;
}
void pm_pll_enable(volatile avr32_pm_t *pm,
unsigned int pll) {
union {
unsigned long pll ;
avr32_pm_pll_t PLL ;
} u_pll;
u_pll.pll = (pm->pll)[pll];
u_pll.PLL.pllen = 1;
(pm->pll)[pll] = u_pll.pll;
unsigned int pll)
{
pm->pll[pll] |= AVR32_PM_PLLEN_MASK;
}
void pm_pll_disable(volatile avr32_pm_t *pm,
unsigned int pll) {
union {
unsigned long pll ;
avr32_pm_pll_t PLL ;
} u_pll;
u_pll.pll = (pm->pll)[pll];
u_pll.PLL.pllen = 0;
(pm->pll)[pll] = u_pll.pll;
unsigned int pll)
{
pm->pll[pll] &= ~AVR32_PM_PLLEN_MASK;
}
void pm_wait_for_pll0_locked(volatile avr32_pm_t *pm)
{
while(!pm->ISR.lock0);
while (!(pm->poscsr & AVR32_PM_POSCSR_LOCK0_MASK));
// Bypass the lock signal of the PLL
pm->pll[0] |= AVR32_PM_PLL0_PLLBPL_MASK;
@ -502,7 +436,7 @@ void pm_wait_for_pll0_locked(volatile avr32_pm_t *pm)
void pm_wait_for_pll1_locked(volatile avr32_pm_t *pm)
{
while(!pm->ISR.lock1);
while (!(pm->poscsr & AVR32_PM_POSCSR_LOCK1_MASK));
// Bypass the lock signal of the PLL
pm->pll[1] |= AVR32_PM_PLL1_PLLBPL_MASK;
@ -511,16 +445,12 @@ void pm_wait_for_pll1_locked(volatile avr32_pm_t *pm)
void pm_switch_to_clock(volatile avr32_pm_t *pm, unsigned long clock)
{
union {
avr32_pm_mcctrl_t MCCTRL;
unsigned long mcctrl;
} mcctrl;
// Read
mcctrl.mcctrl = pm->mcctrl;
u_avr32_pm_mcctrl_t u_avr32_pm_mcctrl = {pm->mcctrl};
// Modify
mcctrl.MCCTRL.mcsel = clock;
// Write Back
pm->MCCTRL.mcsel = mcctrl.mcctrl;
u_avr32_pm_mcctrl.MCCTRL.mcsel = clock;
// Write back
pm->mcctrl = u_avr32_pm_mcctrl.mcctrl;
}
@ -532,77 +462,49 @@ void pm_switch_to_osc0(volatile avr32_pm_t *pm, unsigned int fosc0, unsigned int
}
void pm_bod_enable_irq(volatile struct avr32_pm_t *pm) {
union {
unsigned long ier ;
avr32_pm_ier_t IER ;
} u_ier;
u_ier.ier = 0;
u_ier.IER.boddet = 1;
pm->ier = u_ier.ier;
void pm_bod_enable_irq(volatile avr32_pm_t *pm)
{
pm->ier = AVR32_PM_IER_BODDET_MASK;
}
void pm_bod_disable_irq(volatile struct avr32_pm_t *pm) {
union {
unsigned long idr ;
avr32_pm_idr_t IDR ;
} u_idr;
u_idr.idr = 0;
u_idr.IDR.boddet = 1;
pm->idr = u_idr.idr;
void pm_bod_disable_irq(volatile avr32_pm_t *pm)
{
pm->idr = AVR32_PM_IDR_BODDET_MASK;
}
void pm_bod_clear_irq(volatile struct avr32_pm_t *pm) {
union {
unsigned long icr ;
avr32_pm_idr_t ICR ;
} u_icr;
u_icr.icr = 0;
u_icr.ICR.boddet = 1;
pm->icr = u_icr.icr;
void pm_bod_clear_irq(volatile avr32_pm_t *pm)
{
pm->icr = AVR32_PM_ICR_BODDET_MASK;
}
unsigned long pm_bod_get_irq_status(volatile struct avr32_pm_t *pm) {
return pm->ISR.boddet;
unsigned long pm_bod_get_irq_status(volatile avr32_pm_t *pm)
{
return ((pm->isr & AVR32_PM_ISR_BODDET_MASK) != 0);
}
unsigned long pm_bod_get_irq_enable_bit(volatile struct avr32_pm_t *pm) {
return pm->IMR.boddet;
unsigned long pm_bod_get_irq_enable_bit(volatile avr32_pm_t *pm)
{
return ((pm->imr & AVR32_PM_IMR_BODDET_MASK) != 0);
}
unsigned long pm_bod_get_level(volatile avr32_pm_t *pm) {
union {
unsigned long bod ;
avr32_pm_bod_t BOD ;
} u_bod;
u_bod.bod = pm->bod;
return (unsigned long) u_bod.BOD.level;
unsigned long pm_bod_get_level(volatile avr32_pm_t *pm)
{
return (pm->bod & AVR32_PM_BOD_LEVEL_MASK) >> AVR32_PM_BOD_LEVEL_OFFSET;
}
void pm_write_gplp(volatile avr32_pm_t *pm,unsigned long gplp, unsigned long value) {
(pm->gplp)[gplp] = value;
void pm_write_gplp(volatile avr32_pm_t *pm,unsigned long gplp, unsigned long value)
{
pm->gplp[gplp] = value;
}
unsigned long pm_read_gplp(volatile avr32_pm_t *pm,unsigned long gplp) {
return (pm->gplp)[gplp];
unsigned long pm_read_gplp(volatile avr32_pm_t *pm,unsigned long gplp)
{
return pm->gplp[gplp];
}

View file

@ -9,7 +9,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
*****************************************************************************/
@ -44,15 +44,7 @@
#ifndef _PM_H_
#define _PM_H_
#if __GNUC__
# include <avr32/io.h>
#elif __ICCAVR32__
# include <avr32/iouc3a0512.h>
# include <avr32/uc3a0512.h>
#else
# error Unknown compiler
#endif
#include <avr32/io.h>
#include "compiler.h"
#include "preprocessor.h"
@ -70,6 +62,22 @@
#define SLEEP(mode) {__asm__ __volatile__ ("sleep "STRINGZ(mode));}
/*! \brief Gets the MCU reset cause.
*
* \param pm Base address of the Power Manager instance (i.e. &AVR32_PM).
*
* \return The MCU reset cause which can be masked with the
* \c AVR32_PM_RCAUSE_x_MASK bit-masks to isolate specific causes.
*/
#if __GNUC__
__attribute__((__always_inline__))
#endif
extern __inline__ unsigned int pm_get_reset_cause(volatile avr32_pm_t *pm)
{
return pm->rcause;
}
/*!
* \brief This function will enable the external clock mode of the oscillator 0.
* \param pm Base address of the Power Manager (i.e. &AVR32_PM)

View file

@ -10,7 +10,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
@ -42,14 +42,7 @@
*/
#if __GNUC__
# include <avr32/io.h>
#elif __ICCAVR32__
# include <avr32/iouc3a0512.h>
#else
# error Unknown compiler
#endif
#include <avr32/io.h>
#include "compiler.h"
#include "tc.h"

View file

@ -10,7 +10,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
@ -45,17 +45,11 @@
#ifndef _TC_H_
#define _TC_H_
#if __GNUC__
# include <avr32/io.h>
#elif __ICCAVR32__
# include <avr32/iouc3a0512.h>
#else
# error Unknown compiler
#endif
#include <avr32/io.h>
//! TC driver functions return value in case of invalid argument(s).
#define TC_INVALID_ARGUMENT -1
#define TC_INVALID_ARGUMENT (-1)
//! Number of timer/counter channels.
#define TC_NUMBER_OF_CHANNELS (sizeof(((avr32_tc_t *)0)->channel) / sizeof(avr32_tc_channel_t))

View file

@ -11,7 +11,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
@ -70,9 +70,12 @@ static __inline__ int usart_mode_is_multidrop(volatile avr32_usart_t *usart)
/*! \brief Calculates a clock divider (\e CD) that gets the USART as close to a
* wanted baudrate as possible.
*
* \todo manage the FP fractal part to avoid big errors
*
* Baudrate calculation:
* \f$ baudrate = \frac{Selected Clock}{16 \times CD} \f$ with 16x oversampling or
* \f$ baudrate = \frac{Selected Clock}{8 \times CD} \f$ with 8x oversampling.
* \f$ baudrate = \frac{Selected Clock}{8 \times CD} \f$ with 8x oversampling or
* \f$ baudrate = \frac{Selected Clock}{CD} \f$ with SYNC bit set to allow high speed.
*
* \param usart Base address of the USART instance.
* \param baudrate Wanted baudrate.
@ -90,20 +93,30 @@ static int usart_set_baudrate(volatile avr32_usart_t *usart, unsigned int baudra
// Baudrate calculation.
if (baudrate < pba_hz / 16)
{
// Use 16x oversampling.
usart->mr &=~ AVR32_USART_MR_OVER_MASK;
cd = pba_hz / (16 * baudrate);
// Use 16x oversampling, clear SYNC bit.
usart->mr &=~ (AVR32_USART_MR_OVER_MASK | AVR32_USART_MR_SYNC_MASK);
cd = (pba_hz + 8 * baudrate) / (16 * baudrate);
if ((cd >65535)) return USART_INVALID_INPUT;
}
else
else if (baudrate < pba_hz / 8)
{
// Use 8x oversampling.
usart->mr |= AVR32_USART_MR_OVER_MASK;
cd = pba_hz / (8 * baudrate);
// clear SYNC bit
usart->mr &=~ AVR32_USART_MR_SYNC_MASK;
cd = (pba_hz + 4 * baudrate) / (8 * baudrate);
if ((cd < 1)||(cd >65535)) return USART_INVALID_INPUT;
}
else
{
// set SYNC to 1
usart->mr |= AVR32_USART_MR_SYNC_MASK;
// use PBA/BaudRate
cd = (pba_hz / baudrate);
}
usart->brgr = cd << AVR32_USART_BRGR_CD_OFFSET;
return USART_SUCCESS;
@ -303,8 +316,6 @@ int usart_init_iso7816(volatile avr32_usart_t *usart, const iso7816_options_t *o
return USART_SUCCESS;
}
//! @}

View file

@ -11,7 +11,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
@ -46,14 +46,7 @@
#ifndef _USART_H_
#define _USART_H_
#if __GNUC__
# include <avr32/io.h>
#elif __ICCAVR32__
# include <avr32/iouc3a0512.h>
#else
# error Unknown compiler
#endif
#include <avr32/io.h>
#include "compiler.h"
@ -97,6 +90,7 @@
#define USART_MODE_SW_HSH AVR32_USART_MR_MODE_SOFTWARE //!< RS232 mode with software handshaking.
//! @}
/*! \name Channel Modes
*/
//! @{
@ -171,6 +165,26 @@ typedef struct
int bit_order;
} iso7816_options_t;
//! Input parameters when initializing ISO7816 modes.
typedef struct
{
//! Set the frequency of the SPI clock.
unsigned long baudrate;
//! Number of bits to transmit as a character (5 to 9).
unsigned char charlength;
//! Run the channel in testmode: \ref USART_NORMAL_CHMODE, \ref USART_AUTO_ECHO,
//! \ref USART_LOCAL_LOOPBACK or \ref USART_REMOTE_LOOPBACK.
unsigned char channelmode;
//! Which SPI mode to use when transmitting.
unsigned char spimode;
} usart_spi_options_t;
//------------------------------------------------------------------------------
/*! \name Initialization Functions
@ -254,8 +268,50 @@ extern int usart_init_rs485(volatile avr32_usart_t *usart, const usart_options_t
*/
extern int usart_init_iso7816(volatile avr32_usart_t *usart, const iso7816_options_t *opt, int t, long pba_hz);
/*! \brief Sets up the USART to use the SPI mode as master.
*
* \param usart Base address of the USART instance.
* \param opt Options needed to set up SPI mode (see \ref usart_spi_options_t).
* \param pba_hz USART module input clock frequency (PBA clock, Hz).
*
* \retval USART_SUCCESS Mode successfully initialized.
* \retval USART_INVALID_INPUT One or more of the arguments is out of valid range.
*/
extern int usart_init_spi_master(volatile avr32_usart_t *usart, const usart_spi_options_t *opt, long pba_hz);
/*! \brief Sets up the USART to use the SPI mode as slave.
*
* \param usart Base address of the USART instance.
* \param opt Options needed to set up SPI mode (see \ref usart_spi_options_t).
* \param pba_hz USART module input clock frequency (PBA clock, Hz).
*
* \retval USART_SUCCESS Mode successfully initialized.
* \retval USART_INVALID_INPUT One or more of the arguments is out of valid range.
*/
extern int usart_init_spi_slave(volatile avr32_usart_t *usart, const usart_spi_options_t *opt, long pba_hz);
//! @}
//------------------------------------------------------------------------------
/*! \brief Selects slave chip.
*
* \param usart Base address of the USART instance.
*
* \return Status.
* \retval USART_SUCCESS Success.
*/
extern int usart_spi_selectChip(volatile avr32_usart_t *usart);
/*! \brief Unselects slave chip.
*
* \param usart Base address of the USART instance.
*
* \return Status.
* \retval USART_SUCCESS Success.
* \retval USART_FAILURE Time out.
*/
extern int usart_spi_unselectChip(volatile avr32_usart_t *usart);
//------------------------------------------------------------------------------
/*! \name Read and Reset Error Status Bits

View file

@ -1,4 +1,4 @@
/*This file has been prepared for Doxygen automatic documentation generation.*/
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
* \brief FreeRTOS demonstration for AVR32 UC3.
@ -8,9 +8,9 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
*****************************************************************************/
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
@ -64,7 +64,7 @@
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 8 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 128 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 1024*30 ) )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 1024*25 ) )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
@ -77,23 +77,29 @@
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_xTaskGetCurrentTaskHandle 0
/* configTICK_USE_TC is a boolean indicating whether to use a Timer Counter
for the tick generation. Timer Counter will generate an accurate Tick;
otherwise the CPU will generate a tick but with time drift.
configTICK_TC_CHANNEL is the TC channel.*/
configTICK_TC_CHANNEL is the TC channel. */
#define configTICK_USE_TC 1
#define configTICK_TC_CHANNEL 2
/* configHEAP_INIT is a boolean indicating whether to initialize the heap with
0xA5 in order to be able to determine the maximal heap consumption. */
#define configHEAP_INIT 0
/* Debug trace configuration.
configDBG is a boolean indicating whether to activate the debug trace. */
#if BOARD == EVK1100
#define configDBG 1
#define configDBG_USART (&AVR32_USART1)
#define configDBG_USART_RX_PIN AVR32_USART1_RXD_0_PIN
@ -101,5 +107,29 @@ to exclude the API function. */
#define configDBG_USART_TX_PIN AVR32_USART1_TXD_0_PIN
#define configDBG_USART_TX_FUNCTION AVR32_USART1_TXD_0_FUNCTION
#define configDBG_USART_BAUDRATE 57600
#define serialPORT_USART (&AVR32_USART0)
#define serialPORT_USART_RX_PIN AVR32_USART0_RXD_0_PIN
#define serialPORT_USART_RX_FUNCTION AVR32_USART0_RXD_0_FUNCTION
#define serialPORT_USART_TX_PIN AVR32_USART0_TXD_0_PIN
#define serialPORT_USART_TX_FUNCTION AVR32_USART0_TXD_0_FUNCTION
#define serialPORT_USART_IRQ AVR32_USART0_IRQ
#define serialPORT_USART_BAUDRATE 57600
#elif BOARD == EVK1101
#define configDBG 1
#define configDBG_USART (&AVR32_USART1)
#define configDBG_USART_RX_PIN AVR32_USART1_RXD_0_0_PIN
#define configDBG_USART_RX_FUNCTION AVR32_USART1_RXD_0_0_FUNCTION
#define configDBG_USART_TX_PIN AVR32_USART1_TXD_0_0_PIN
#define configDBG_USART_TX_FUNCTION AVR32_USART1_TXD_0_0_FUNCTION
#define configDBG_USART_BAUDRATE 57600
#define serialPORT_USART (&AVR32_USART1)
#define serialPORT_USART_RX_PIN AVR32_USART1_RXD_0_0_PIN
#define serialPORT_USART_RX_FUNCTION AVR32_USART1_RXD_0_0_FUNCTION
#define serialPORT_USART_TX_PIN AVR32_USART1_TXD_0_0_PIN
#define serialPORT_USART_TX_FUNCTION AVR32_USART1_TXD_0_0_FUNCTION
#define serialPORT_USART_IRQ AVR32_USART1_IRQ
#define serialPORT_USART_BAUDRATE 57600
#endif
#endif /* FREERTOS_CONFIG_H */

View file

@ -1,5 +1,3 @@
/* This source file is part of the ATMEL FREERTOS-0.9.0 Release */
/*This file has been prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
@ -10,7 +8,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
*****************************************************************************/
@ -43,14 +41,7 @@
#if __GNUC__
#include <avr32/io.h>
#elif __ICCAVR32__
#include <avr32/iouc3a0512.h>
#else
#error Unknown compiler
#endif
#include <avr32/io.h>
#include "FreeRTOS.h"
#include "task.h"
#include "partest.h"

View file

@ -0,0 +1,72 @@
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
* \brief AVR32 UC3 ISP trampoline.
*
* In order to be able to program a project with both BatchISP and JTAGICE mkII
* without having to take the general-purpose fuses into consideration, add this
* file to the project and change the program entry point to _trampoline.
*
* The pre-programmed ISP will be erased if JTAGICE mkII is used.
*
* - Compiler: GNU GCC for AVR32
* - Supported devices: All AVR32UC devices can be used.
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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 "../conf_isp.h"
//! @{
//! \verbatim
// This must be linked @ 0x80000000 if it is to be run upon reset.
.section .reset, "ax", @progbits
.global _trampoline
.type _trampoline, @function
_trampoline:
// Jump to program start.
rjmp program_start
.org PROGRAM_START_OFFSET
program_start:
// Jump to the C runtime startup routine.
lda.w pc, _stext
//! \endverbatim
//! @}

View file

@ -0,0 +1,91 @@
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
* \brief AVR32 UC3 ISP trampoline.
*
* In order to be able to program a project with both BatchISP and JTAGICE mkII
* without having to take the general-purpose fuses into consideration, add this
* file to the project and change the program entry point to __trampoline.
*
* The pre-programmed ISP will be erased if JTAGICE mkII is used.
*
* - Compiler: IAR EWAVR32
* - Supported devices: All AVR32UC devices can be used.
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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 "../conf_isp.h"
//! @{
//! \verbatim
RSEG SSTACK:DATA:NOROOT(2)
// This must be linked @ 0x80000000 if it is to be run upon reset.
RSEG RESET:CODE:NOROOT(1)
PUBLIC __trampoline
__trampoline:
// Jump to program start.
rjmp program_start
ORG PROGRAM_START_OFFSET
program_start:
// Initialize the stack pointer.
lddpc sp, ??SPS
// Jump to the C runtime startup routine.
lddpc pc, ??cmain
// Constant data area.
ALIGN 2
??SPS:
DC32 SFE(SSTACK) & ~3
EXTERN ?main
??cmain:
DC32 ?main
END
//! \endverbatim
//! @}

View file

@ -0,0 +1,119 @@
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file ******************************************************************
*
* \brief ISP configuration file.
*
* This file contains the possible external configuration of the ISP.
*
* - Compiler: IAR EWAVR32 and GNU GCC for AVR32
* - Supported devices: All AVR32 devices with a USB module can be used.
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
***************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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 _CONF_ISP_H_
#define _CONF_ISP_H_
#include <avr32/io.h>
#include "compiler.h"
//_____ D E F I N I T I O N S ______________________________________________
#define PRODUCT_MANUFACTURER_ID 0x58
#define PRODUCT_FAMILY_ID 0x20
#define ISP_VERSION 0x00
#define ISP_ID0 0x00
#define ISP_ID1 0x00
#define ISP_GPFB_FORCE 31
#define ISP_GPFB_FORCE_MASK 0x80000000
#define ISP_GPFB_FORCE_OFFSET 31
#define ISP_GPFB_FORCE_SIZE 1
#define ISP_GPFB_IO_COND_EN 30
#define ISP_GPFB_IO_COND_EN_MASK 0x40000000
#define ISP_GPFB_IO_COND_EN_OFFSET 30
#define ISP_GPFB_IO_COND_EN_SIZE 1
#define ISP_GPFB_BOD_EN 29
#define ISP_GPFB_BOD_EN_MASK 0x20000000
#define ISP_GPFB_BOD_EN_OFFSET 29
#define ISP_GPFB_BOD_EN_SIZE 1
#define ISP_CFG (*(volatile U32 *)ISP_CFG_ADDRESS)
#define ISP_CFG_ADDRESS (AVR32_FLASHC_USER_PAGE_ADDRESS + ISP_CFG_OFFSET)
#define ISP_CFG_OFFSET 0x000001FC
#define ISP_CFG_SIZE 4
#define ISP_CFG_BOOT_KEY 17
#define ISP_CFG_BOOT_KEY_MASK 0xFFFE0000
#define ISP_CFG_BOOT_KEY_OFFSET 17
#define ISP_CFG_BOOT_KEY_SIZE 15
#define ISP_CFG_BOOT_KEY_VALUE 0x494F
#define ISP_CFG_IO_COND_LEVEL 16
#define ISP_CFG_IO_COND_LEVEL_MASK 0x00010000
#define ISP_CFG_IO_COND_LEVEL_OFFSET 16
#define ISP_CFG_IO_COND_LEVEL_SIZE 1
#define ISP_CFG_IO_COND_PIN 8
#define ISP_CFG_IO_COND_PIN_MASK 0x0000FF00
#define ISP_CFG_IO_COND_PIN_OFFSET 8
#define ISP_CFG_IO_COND_PIN_SIZE 8
#define ISP_CFG_CRC8 0
#define ISP_CFG_CRC8_MASK 0x000000FF
#define ISP_CFG_CRC8_OFFSET 0
#define ISP_CFG_CRC8_SIZE 8
#define ISP_CFG_CRC8_POLYNOMIAL 0x107
#define ISP_KEY (*(volatile U32 *)ISP_KEY_ADDRESS)
#define ISP_KEY_ADDRESS (AVR32_SRAM_ADDRESS + ISP_KEY_OFFSET)
#define ISP_KEY_OFFSET 0x00000000
#define ISP_KEY_SIZE 4
#define ISP_KEY_VALUE ('I' << 24 | 'S' << 16 | 'P' << 8 | 'K')
#ifndef ISP_OSC
#define ISP_OSC 0
#endif
#define DFU_FRAME_LENGTH 2048
#define PROGRAM_START_ADDRESS (AVR32_FLASH_ADDRESS + PROGRAM_START_OFFSET)
#define PROGRAM_START_OFFSET 0x00002000
#endif // _CONF_ISP_H_

View file

@ -0,0 +1,263 @@
/******************************************************************************
* AVR32 AT32UC3A0128 GNU LD script file.
*
* - Compiler: GNU GCC for AVR32
* - Supported devices: AVR32 AT32UC3A0128
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
OUTPUT_ARCH(avr32:uc)
ENTRY(_start)
MEMORY
{
FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00020000
INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x00007FFC
USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 0x00000200
}
PHDRS
{
FLASH PT_LOAD;
INTRAM PT_NULL;
USERPAGE PT_LOAD;
FACTORYPAGE PT_LOAD;
}
SECTIONS
{
/* If this heap size is selected, all the INTRAM space from the end of the
data area to the beginning of the stack will be allocated for the heap. */
__max_heap_size__ = -1;
/* Use a default heap size if heap size was not defined. */
__heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
/* Use a default stack size if stack size was not defined. */
__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
/* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
.interp : { *(.interp) } >FLASH AT>FLASH :FLASH
.reset : { *(.reset) } >FLASH AT>FLASH :FLASH
.hash : { *(.hash) } >FLASH AT>FLASH :FLASH
.dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
.dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
.gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
.gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
.gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
.rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
.rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
.rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
.rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
.rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
.rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
.rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
.rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
.rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
.init :
{
KEEP (*(.init))
} >FLASH AT>FLASH :FLASH =0xd703d703
.plt : { *(.plt) } >FLASH AT>FLASH :FLASH
.text :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} >FLASH AT>FLASH :FLASH =0xd703d703
.fini :
{
KEEP (*(.fini))
} >FLASH AT>FLASH :FLASH =0xd703d703
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
.eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
.lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
. = ORIGIN(INTRAM);
.dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :FLASH
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :FLASH
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :FLASH
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
PROVIDE (__preinit_array_start = ALIGN(32 / 8));
.preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__preinit_array_end = .);
PROVIDE (__init_array_start = .);
.init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__init_array_end = .);
PROVIDE (__fini_array_start = .);
.fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__fini_array_end = .);
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} >INTRAM AT>FLASH :FLASH
.dtors :
{
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} >INTRAM AT>FLASH :FLASH
.jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :FLASH
.data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :FLASH
.dynamic : { *(.dynamic) } >INTRAM AT>FLASH :FLASH
.got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :FLASH
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
} >INTRAM AT>FLASH :FLASH
.data1 : { *(.data1) } >INTRAM AT>FLASH :FLASH
.balign : { . = ALIGN(8); _edata = .; } >INTRAM AT>FLASH :FLASH
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(8);
} >INTRAM AT>INTRAM :INTRAM
. = ALIGN(8);
_end = .;
PROVIDE (end = .);
__heap_start__ = ALIGN(8);
.heap :
{
*(.heap)
. = (__heap_size__ == __max_heap_size__) ?
ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
__heap_size__;
} >INTRAM AT>INTRAM :INTRAM
__heap_end__ = .;
/* 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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
{
_stack = .;
*(.stack)
. = __stack_size__;
_estack = .;
} >INTRAM AT>INTRAM :INTRAM
.userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
.factorypage : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE :FACTORYPAGE
/DISCARD/ : { *(.note.GNU-stack) }
}

View file

@ -0,0 +1,138 @@
/******************************************************************************
* AVR32 AT32UC3A0128 XLINK command file for AVR32 IAR C/C++ Compiler.
*
* The assumed memory layout is the one of the AT32UC3A0128:
*
* Start Stop Name Type
* ---------- ---------- ----- --------------
* 0x00000000 0x00007FFF SRAM RAM
* 0x80000000 0x8001FFFF FLASH FLASH
*
* Usage: xlink your_file(s) -f xcl-file libraries
*
* - Compiler: IAR EWAVR32
* - Supported devices: AVR32 AT32UC3A0128
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
/************************************************************************/
/* The following segments are defined in this link file: */
/* */
/* Code segments */
/* CODE32 -- Program code used by __code32 functions. */
/* RESET -- Reset code. */
/* EVSEG -- Exception vector handlers. */
/* */
/* Constant segments */
/* INITTAB -- Segment initializer table. */
/* DIFUNCT -- Dynamic initialization vector used by C++. */
/* SWITCH -- Switch tables. */
/* ACTAB -- Table of pointers to acall functions. */
/* */
/* DATA21_ID -- Initialization data for DATA21_I. */
/* DATA32_ID -- Initialization data for DATA32_I. */
/* DATA32_C -- Constant __data32 data. */
/* */
/* CHECKSUM -- Checksum segment. */
/* */
/* Data segments */
/* DATA21_I -- Initialized __data21 data with non-zero */
/* initial value. */
/* DATA32_I -- Initialized __data32 data with non-zero */
/* initial value. */
/* DATA21_Z -- Initialized __data21 data with zero initial value. */
/* DATA32_Z -- Initialized __data32 data with zero initial value. */
/* DATA21_N -- Non-initialized __data21. */
/* DATA32_N -- Non-initialized __data32. */
/* SSTACK -- The system stack. */
/* CSTACK -- The application stack. */
/* HEAP -- The heap used by malloc and free. */
/* */
/************************************************************************/
/************************************************************************/
/* Define CPU */
/************************************************************************/
-cavr32
// Declare the IPR0 memory location
-DIPR0=FFFF0800
/************************************************************************/
/* Reset code is located at address 0x80000000 and up. */
/************************************************************************/
-Z(CODE)RESET=80000000-8001FFFF
/************************************************************************/
/* The exception handler code is located at address 0x80000000 */
/* and up. Make sure that the exception table gets properly */
/* allocated. By using the special -Z@ allocation primitive, the */
/* placement is guaranteed to be at _EVBASE and onwards. */
/************************************************************************/
-Z@(CODE)EVTAB=80004000-8001FFFF
-Z@(CODE)EV100=80004100-8001FFFF
-P(CODE)EVSEG=80004000-8001FFFF
/************************************************************************/
/* Allocate code and const segments. */
/************************************************************************/
-P(CODE)CODE32=80000000-8001FFFF
-P(CONST)DATA32_C=80000000-8001FFFF
// Initializers
-Z(CONST)INITTAB,DIFUNCT=80000000-8001FFFF
-Z(CONST)CHECKSUM,SWITCH=80000000-8001FFFF
-Z(CONST)DATA21_ID,DATA32_ID=80000000-8001FFFF
-Z(CONST)ACTAB,HTAB=80000000-8001FFFF
/************************************************************************/
/* Allocate the read/write segments that are mapped to RAM. */
/************************************************************************/
-Z(DATA)DATA21_I,DATA21_Z,DATA21_N=00000004-00007FFF
-Z(DATA)DATA32_I,DATA32_Z,DATA32_N=00000004-00007FFF
-Z(DATA)TRACEBUFFER=00000004-00007FFF
-Z(DATA)SSTACK+_SSTACK_SIZE#00000004-00007FFF
-Z(DATA)CSTACK+_CSTACK_SIZE#00000004-00007FFF
-Z(DATA)HEAP+_HEAP_SIZE=00000004-00007FFF
/************************************************************************/
/* End of File */
/************************************************************************/

View file

@ -0,0 +1,263 @@
/******************************************************************************
* AVR32 AT32UC3A0256 GNU LD script file.
*
* - Compiler: GNU GCC for AVR32
* - Supported devices: AVR32 AT32UC3A0256
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
OUTPUT_ARCH(avr32:uc)
ENTRY(_start)
MEMORY
{
FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00040000
INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x0000FFFC
USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 0x00000200
}
PHDRS
{
FLASH PT_LOAD;
INTRAM PT_NULL;
USERPAGE PT_LOAD;
FACTORYPAGE PT_LOAD;
}
SECTIONS
{
/* If this heap size is selected, all the INTRAM space from the end of the
data area to the beginning of the stack will be allocated for the heap. */
__max_heap_size__ = -1;
/* Use a default heap size if heap size was not defined. */
__heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
/* Use a default stack size if stack size was not defined. */
__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
/* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
.interp : { *(.interp) } >FLASH AT>FLASH :FLASH
.reset : { *(.reset) } >FLASH AT>FLASH :FLASH
.hash : { *(.hash) } >FLASH AT>FLASH :FLASH
.dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
.dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
.gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
.gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
.gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
.rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
.rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
.rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
.rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
.rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
.rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
.rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
.rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
.rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
.init :
{
KEEP (*(.init))
} >FLASH AT>FLASH :FLASH =0xd703d703
.plt : { *(.plt) } >FLASH AT>FLASH :FLASH
.text :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} >FLASH AT>FLASH :FLASH =0xd703d703
.fini :
{
KEEP (*(.fini))
} >FLASH AT>FLASH :FLASH =0xd703d703
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
.eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
.lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
. = ORIGIN(INTRAM);
.dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :FLASH
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :FLASH
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :FLASH
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
PROVIDE (__preinit_array_start = ALIGN(32 / 8));
.preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__preinit_array_end = .);
PROVIDE (__init_array_start = .);
.init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__init_array_end = .);
PROVIDE (__fini_array_start = .);
.fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__fini_array_end = .);
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} >INTRAM AT>FLASH :FLASH
.dtors :
{
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} >INTRAM AT>FLASH :FLASH
.jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :FLASH
.data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :FLASH
.dynamic : { *(.dynamic) } >INTRAM AT>FLASH :FLASH
.got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :FLASH
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
} >INTRAM AT>FLASH :FLASH
.data1 : { *(.data1) } >INTRAM AT>FLASH :FLASH
.balign : { . = ALIGN(8); _edata = .; } >INTRAM AT>FLASH :FLASH
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(8);
} >INTRAM AT>INTRAM :INTRAM
. = ALIGN(8);
_end = .;
PROVIDE (end = .);
__heap_start__ = ALIGN(8);
.heap :
{
*(.heap)
. = (__heap_size__ == __max_heap_size__) ?
ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
__heap_size__;
} >INTRAM AT>INTRAM :INTRAM
__heap_end__ = .;
/* 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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
{
_stack = .;
*(.stack)
. = __stack_size__;
_estack = .;
} >INTRAM AT>INTRAM :INTRAM
.userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
.factorypage : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE :FACTORYPAGE
/DISCARD/ : { *(.note.GNU-stack) }
}

View file

@ -0,0 +1,138 @@
/******************************************************************************
* AVR32 AT32UC3A0256 XLINK command file for AVR32 IAR C/C++ Compiler.
*
* The assumed memory layout is the one of the AT32UC3A0256:
*
* Start Stop Name Type
* ---------- ---------- ----- --------------
* 0x00000000 0x0000FFFF SRAM RAM
* 0x80000000 0x8003FFFF FLASH FLASH
*
* Usage: xlink your_file(s) -f xcl-file libraries
*
* - Compiler: IAR EWAVR32
* - Supported devices: AVR32 AT32UC3A0256
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
/************************************************************************/
/* The following segments are defined in this link file: */
/* */
/* Code segments */
/* CODE32 -- Program code used by __code32 functions. */
/* RESET -- Reset code. */
/* EVSEG -- Exception vector handlers. */
/* */
/* Constant segments */
/* INITTAB -- Segment initializer table. */
/* DIFUNCT -- Dynamic initialization vector used by C++. */
/* SWITCH -- Switch tables. */
/* ACTAB -- Table of pointers to acall functions. */
/* */
/* DATA21_ID -- Initialization data for DATA21_I. */
/* DATA32_ID -- Initialization data for DATA32_I. */
/* DATA32_C -- Constant __data32 data. */
/* */
/* CHECKSUM -- Checksum segment. */
/* */
/* Data segments */
/* DATA21_I -- Initialized __data21 data with non-zero */
/* initial value. */
/* DATA32_I -- Initialized __data32 data with non-zero */
/* initial value. */
/* DATA21_Z -- Initialized __data21 data with zero initial value. */
/* DATA32_Z -- Initialized __data32 data with zero initial value. */
/* DATA21_N -- Non-initialized __data21. */
/* DATA32_N -- Non-initialized __data32. */
/* SSTACK -- The system stack. */
/* CSTACK -- The application stack. */
/* HEAP -- The heap used by malloc and free. */
/* */
/************************************************************************/
/************************************************************************/
/* Define CPU */
/************************************************************************/
-cavr32
// Declare the IPR0 memory location
-DIPR0=FFFF0800
/************************************************************************/
/* Reset code is located at address 0x80000000 and up. */
/************************************************************************/
-Z(CODE)RESET=80000000-8003FFFF
/************************************************************************/
/* The exception handler code is located at address 0x80000000 */
/* and up. Make sure that the exception table gets properly */
/* allocated. By using the special -Z@ allocation primitive, the */
/* placement is guaranteed to be at _EVBASE and onwards. */
/************************************************************************/
-Z@(CODE)EVTAB=80004000-8003FFFF
-Z@(CODE)EV100=80004100-8003FFFF
-P(CODE)EVSEG=80004000-8003FFFF
/************************************************************************/
/* Allocate code and const segments. */
/************************************************************************/
-P(CODE)CODE32=80000000-8003FFFF
-P(CONST)DATA32_C=80000000-8003FFFF
// Initializers
-Z(CONST)INITTAB,DIFUNCT=80000000-8003FFFF
-Z(CONST)CHECKSUM,SWITCH=80000000-8003FFFF
-Z(CONST)DATA21_ID,DATA32_ID=80000000-8003FFFF
-Z(CONST)ACTAB,HTAB=80000000-8003FFFF
/************************************************************************/
/* Allocate the read/write segments that are mapped to RAM. */
/************************************************************************/
-Z(DATA)DATA21_I,DATA21_Z,DATA21_N=00000004-0000FFFF
-Z(DATA)DATA32_I,DATA32_Z,DATA32_N=00000004-0000FFFF
-Z(DATA)TRACEBUFFER=00000004-0000FFFF
-Z(DATA)SSTACK+_SSTACK_SIZE#00000004-0000FFFF
-Z(DATA)CSTACK+_CSTACK_SIZE#00000004-0000FFFF
-Z(DATA)HEAP+_HEAP_SIZE=00000004-0000FFFF
/************************************************************************/
/* End of File */
/************************************************************************/

View file

@ -0,0 +1,263 @@
/******************************************************************************
* AVR32 AT32UC3A0512 GNU LD script file.
*
* - Compiler: GNU GCC for AVR32
* - Supported devices: AVR32 AT32UC3A0512
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
OUTPUT_ARCH(avr32:uc)
ENTRY(_start)
MEMORY
{
FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00080000
INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x0000FFFC
USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 0x00000200
}
PHDRS
{
FLASH PT_LOAD;
INTRAM PT_NULL;
USERPAGE PT_LOAD;
FACTORYPAGE PT_LOAD;
}
SECTIONS
{
/* If this heap size is selected, all the INTRAM space from the end of the
data area to the beginning of the stack will be allocated for the heap. */
__max_heap_size__ = -1;
/* Use a default heap size if heap size was not defined. */
__heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
/* Use a default stack size if stack size was not defined. */
__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
/* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
.interp : { *(.interp) } >FLASH AT>FLASH :FLASH
.reset : { *(.reset) } >FLASH AT>FLASH :FLASH
.hash : { *(.hash) } >FLASH AT>FLASH :FLASH
.dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
.dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
.gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
.gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
.gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
.rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
.rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
.rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
.rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
.rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
.rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
.rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
.rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
.rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
.init :
{
KEEP (*(.init))
} >FLASH AT>FLASH :FLASH =0xd703d703
.plt : { *(.plt) } >FLASH AT>FLASH :FLASH
.text :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} >FLASH AT>FLASH :FLASH =0xd703d703
.fini :
{
KEEP (*(.fini))
} >FLASH AT>FLASH :FLASH =0xd703d703
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
.eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
.lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
. = ORIGIN(INTRAM);
.dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :FLASH
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :FLASH
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :FLASH
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
PROVIDE (__preinit_array_start = ALIGN(32 / 8));
.preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__preinit_array_end = .);
PROVIDE (__init_array_start = .);
.init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__init_array_end = .);
PROVIDE (__fini_array_start = .);
.fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__fini_array_end = .);
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} >INTRAM AT>FLASH :FLASH
.dtors :
{
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} >INTRAM AT>FLASH :FLASH
.jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :FLASH
.data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :FLASH
.dynamic : { *(.dynamic) } >INTRAM AT>FLASH :FLASH
.got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :FLASH
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
} >INTRAM AT>FLASH :FLASH
.data1 : { *(.data1) } >INTRAM AT>FLASH :FLASH
.balign : { . = ALIGN(8); _edata = .; } >INTRAM AT>FLASH :FLASH
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(8);
} >INTRAM AT>INTRAM :INTRAM
. = ALIGN(8);
_end = .;
PROVIDE (end = .);
__heap_start__ = ALIGN(8);
.heap :
{
*(.heap)
. = (__heap_size__ == __max_heap_size__) ?
ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
__heap_size__;
} >INTRAM AT>INTRAM :INTRAM
__heap_end__ = .;
/* 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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
{
_stack = .;
*(.stack)
. = __stack_size__;
_estack = .;
} >INTRAM AT>INTRAM :INTRAM
.userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
.factorypage : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE :FACTORYPAGE
/DISCARD/ : { *(.note.GNU-stack) }
}

View file

@ -0,0 +1,138 @@
/******************************************************************************
* AVR32 AT32UC3A0512 XLINK command file for AVR32 IAR C/C++ Compiler.
*
* The assumed memory layout is the one of the AT32UC3A0512:
*
* Start Stop Name Type
* ---------- ---------- ----- --------------
* 0x00000000 0x0000FFFF SRAM RAM
* 0x80000000 0x8007FFFF FLASH FLASH
*
* Usage: xlink your_file(s) -f xcl-file libraries
*
* - Compiler: IAR EWAVR32
* - Supported devices: AVR32 AT32UC3A0512
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
/************************************************************************/
/* The following segments are defined in this link file: */
/* */
/* Code segments */
/* CODE32 -- Program code used by __code32 functions. */
/* RESET -- Reset code. */
/* EVSEG -- Exception vector handlers. */
/* */
/* Constant segments */
/* INITTAB -- Segment initializer table. */
/* DIFUNCT -- Dynamic initialization vector used by C++. */
/* SWITCH -- Switch tables. */
/* ACTAB -- Table of pointers to acall functions. */
/* */
/* DATA21_ID -- Initialization data for DATA21_I. */
/* DATA32_ID -- Initialization data for DATA32_I. */
/* DATA32_C -- Constant __data32 data. */
/* */
/* CHECKSUM -- Checksum segment. */
/* */
/* Data segments */
/* DATA21_I -- Initialized __data21 data with non-zero */
/* initial value. */
/* DATA32_I -- Initialized __data32 data with non-zero */
/* initial value. */
/* DATA21_Z -- Initialized __data21 data with zero initial value. */
/* DATA32_Z -- Initialized __data32 data with zero initial value. */
/* DATA21_N -- Non-initialized __data21. */
/* DATA32_N -- Non-initialized __data32. */
/* SSTACK -- The system stack. */
/* CSTACK -- The application stack. */
/* HEAP -- The heap used by malloc and free. */
/* */
/************************************************************************/
/************************************************************************/
/* Define CPU */
/************************************************************************/
-cavr32
// Declare the IPR0 memory location
-DIPR0=FFFF0800
/************************************************************************/
/* Reset code is located at address 0x80000000 and up. */
/************************************************************************/
-Z(CODE)RESET=80000000-8007FFFF
/************************************************************************/
/* The exception handler code is located at address 0x80000000 */
/* and up. Make sure that the exception table gets properly */
/* allocated. By using the special -Z@ allocation primitive, the */
/* placement is guaranteed to be at _EVBASE and onwards. */
/************************************************************************/
-Z@(CODE)EVTAB=80004000-8007FFFF
-Z@(CODE)EV100=80004100-8007FFFF
-P(CODE)EVSEG=80004000-8007FFFF
/************************************************************************/
/* Allocate code and const segments. */
/************************************************************************/
-P(CODE)CODE32=80000000-8007FFFF
-P(CONST)DATA32_C=80000000-8007FFFF
// Initializers
-Z(CONST)INITTAB,DIFUNCT=80000000-8007FFFF
-Z(CONST)CHECKSUM,SWITCH=80000000-8007FFFF
-Z(CONST)DATA21_ID,DATA32_ID=80000000-8007FFFF
-Z(CONST)ACTAB,HTAB=80000000-8007FFFF
/************************************************************************/
/* Allocate the read/write segments that are mapped to RAM. */
/************************************************************************/
-Z(DATA)DATA21_I,DATA21_Z,DATA21_N=00000004-0000FFFF
-Z(DATA)DATA32_I,DATA32_Z,DATA32_N=00000004-0000FFFF
-Z(DATA)TRACEBUFFER=00000004-0000FFFF
-Z(DATA)SSTACK+_SSTACK_SIZE#00000004-0000FFFF
-Z(DATA)CSTACK+_CSTACK_SIZE#00000004-0000FFFF
-Z(DATA)HEAP+_HEAP_SIZE=00000004-0000FFFF
/************************************************************************/
/* End of File */
/************************************************************************/

View file

@ -0,0 +1,263 @@
/******************************************************************************
* AVR32 AT32UC3A1128 GNU LD script file.
*
* - Compiler: GNU GCC for AVR32
* - Supported devices: AVR32 AT32UC3A1128
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
OUTPUT_ARCH(avr32:uc)
ENTRY(_start)
MEMORY
{
FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00020000
INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x00007FFC
USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 0x00000200
}
PHDRS
{
FLASH PT_LOAD;
INTRAM PT_NULL;
USERPAGE PT_LOAD;
FACTORYPAGE PT_LOAD;
}
SECTIONS
{
/* If this heap size is selected, all the INTRAM space from the end of the
data area to the beginning of the stack will be allocated for the heap. */
__max_heap_size__ = -1;
/* Use a default heap size if heap size was not defined. */
__heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
/* Use a default stack size if stack size was not defined. */
__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
/* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
.interp : { *(.interp) } >FLASH AT>FLASH :FLASH
.reset : { *(.reset) } >FLASH AT>FLASH :FLASH
.hash : { *(.hash) } >FLASH AT>FLASH :FLASH
.dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
.dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
.gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
.gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
.gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
.rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
.rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
.rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
.rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
.rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
.rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
.rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
.rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
.rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
.init :
{
KEEP (*(.init))
} >FLASH AT>FLASH :FLASH =0xd703d703
.plt : { *(.plt) } >FLASH AT>FLASH :FLASH
.text :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} >FLASH AT>FLASH :FLASH =0xd703d703
.fini :
{
KEEP (*(.fini))
} >FLASH AT>FLASH :FLASH =0xd703d703
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
.eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
.lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
. = ORIGIN(INTRAM);
.dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :FLASH
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :FLASH
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :FLASH
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
PROVIDE (__preinit_array_start = ALIGN(32 / 8));
.preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__preinit_array_end = .);
PROVIDE (__init_array_start = .);
.init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__init_array_end = .);
PROVIDE (__fini_array_start = .);
.fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__fini_array_end = .);
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} >INTRAM AT>FLASH :FLASH
.dtors :
{
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} >INTRAM AT>FLASH :FLASH
.jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :FLASH
.data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :FLASH
.dynamic : { *(.dynamic) } >INTRAM AT>FLASH :FLASH
.got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :FLASH
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
} >INTRAM AT>FLASH :FLASH
.data1 : { *(.data1) } >INTRAM AT>FLASH :FLASH
.balign : { . = ALIGN(8); _edata = .; } >INTRAM AT>FLASH :FLASH
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(8);
} >INTRAM AT>INTRAM :INTRAM
. = ALIGN(8);
_end = .;
PROVIDE (end = .);
__heap_start__ = ALIGN(8);
.heap :
{
*(.heap)
. = (__heap_size__ == __max_heap_size__) ?
ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
__heap_size__;
} >INTRAM AT>INTRAM :INTRAM
__heap_end__ = .;
/* 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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
{
_stack = .;
*(.stack)
. = __stack_size__;
_estack = .;
} >INTRAM AT>INTRAM :INTRAM
.userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
.factorypage : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE :FACTORYPAGE
/DISCARD/ : { *(.note.GNU-stack) }
}

View file

@ -0,0 +1,138 @@
/******************************************************************************
* AVR32 AT32UC3A1128 XLINK command file for AVR32 IAR C/C++ Compiler.
*
* The assumed memory layout is the one of the AT32UC3A1128:
*
* Start Stop Name Type
* ---------- ---------- ----- --------------
* 0x00000000 0x00007FFF SRAM RAM
* 0x80000000 0x8001FFFF FLASH FLASH
*
* Usage: xlink your_file(s) -f xcl-file libraries
*
* - Compiler: IAR EWAVR32
* - Supported devices: AVR32 AT32UC3A1128
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
/************************************************************************/
/* The following segments are defined in this link file: */
/* */
/* Code segments */
/* CODE32 -- Program code used by __code32 functions. */
/* RESET -- Reset code. */
/* EVSEG -- Exception vector handlers. */
/* */
/* Constant segments */
/* INITTAB -- Segment initializer table. */
/* DIFUNCT -- Dynamic initialization vector used by C++. */
/* SWITCH -- Switch tables. */
/* ACTAB -- Table of pointers to acall functions. */
/* */
/* DATA21_ID -- Initialization data for DATA21_I. */
/* DATA32_ID -- Initialization data for DATA32_I. */
/* DATA32_C -- Constant __data32 data. */
/* */
/* CHECKSUM -- Checksum segment. */
/* */
/* Data segments */
/* DATA21_I -- Initialized __data21 data with non-zero */
/* initial value. */
/* DATA32_I -- Initialized __data32 data with non-zero */
/* initial value. */
/* DATA21_Z -- Initialized __data21 data with zero initial value. */
/* DATA32_Z -- Initialized __data32 data with zero initial value. */
/* DATA21_N -- Non-initialized __data21. */
/* DATA32_N -- Non-initialized __data32. */
/* SSTACK -- The system stack. */
/* CSTACK -- The application stack. */
/* HEAP -- The heap used by malloc and free. */
/* */
/************************************************************************/
/************************************************************************/
/* Define CPU */
/************************************************************************/
-cavr32
// Declare the IPR0 memory location
-DIPR0=FFFF0800
/************************************************************************/
/* Reset code is located at address 0x80000000 and up. */
/************************************************************************/
-Z(CODE)RESET=80000000-8001FFFF
/************************************************************************/
/* The exception handler code is located at address 0x80000000 */
/* and up. Make sure that the exception table gets properly */
/* allocated. By using the special -Z@ allocation primitive, the */
/* placement is guaranteed to be at _EVBASE and onwards. */
/************************************************************************/
-Z@(CODE)EVTAB=80004000-8001FFFF
-Z@(CODE)EV100=80004100-8001FFFF
-P(CODE)EVSEG=80004000-8001FFFF
/************************************************************************/
/* Allocate code and const segments. */
/************************************************************************/
-P(CODE)CODE32=80000000-8001FFFF
-P(CONST)DATA32_C=80000000-8001FFFF
// Initializers
-Z(CONST)INITTAB,DIFUNCT=80000000-8001FFFF
-Z(CONST)CHECKSUM,SWITCH=80000000-8001FFFF
-Z(CONST)DATA21_ID,DATA32_ID=80000000-8001FFFF
-Z(CONST)ACTAB,HTAB=80000000-8001FFFF
/************************************************************************/
/* Allocate the read/write segments that are mapped to RAM. */
/************************************************************************/
-Z(DATA)DATA21_I,DATA21_Z,DATA21_N=00000004-00007FFF
-Z(DATA)DATA32_I,DATA32_Z,DATA32_N=00000004-00007FFF
-Z(DATA)TRACEBUFFER=00000004-00007FFF
-Z(DATA)SSTACK+_SSTACK_SIZE#00000004-00007FFF
-Z(DATA)CSTACK+_CSTACK_SIZE#00000004-00007FFF
-Z(DATA)HEAP+_HEAP_SIZE=00000004-00007FFF
/************************************************************************/
/* End of File */
/************************************************************************/

View file

@ -0,0 +1,263 @@
/******************************************************************************
* AVR32 AT32UC3A1256 GNU LD script file.
*
* - Compiler: GNU GCC for AVR32
* - Supported devices: AVR32 AT32UC3A1256
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
OUTPUT_ARCH(avr32:uc)
ENTRY(_start)
MEMORY
{
FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00040000
INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x0000FFFC
USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 0x00000200
}
PHDRS
{
FLASH PT_LOAD;
INTRAM PT_NULL;
USERPAGE PT_LOAD;
FACTORYPAGE PT_LOAD;
}
SECTIONS
{
/* If this heap size is selected, all the INTRAM space from the end of the
data area to the beginning of the stack will be allocated for the heap. */
__max_heap_size__ = -1;
/* Use a default heap size if heap size was not defined. */
__heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
/* Use a default stack size if stack size was not defined. */
__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
/* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
.interp : { *(.interp) } >FLASH AT>FLASH :FLASH
.reset : { *(.reset) } >FLASH AT>FLASH :FLASH
.hash : { *(.hash) } >FLASH AT>FLASH :FLASH
.dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
.dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
.gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
.gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
.gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
.rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
.rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
.rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
.rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
.rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
.rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
.rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
.rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
.rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
.init :
{
KEEP (*(.init))
} >FLASH AT>FLASH :FLASH =0xd703d703
.plt : { *(.plt) } >FLASH AT>FLASH :FLASH
.text :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} >FLASH AT>FLASH :FLASH =0xd703d703
.fini :
{
KEEP (*(.fini))
} >FLASH AT>FLASH :FLASH =0xd703d703
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
.eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
.lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
. = ORIGIN(INTRAM);
.dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :FLASH
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :FLASH
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :FLASH
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
PROVIDE (__preinit_array_start = ALIGN(32 / 8));
.preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__preinit_array_end = .);
PROVIDE (__init_array_start = .);
.init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__init_array_end = .);
PROVIDE (__fini_array_start = .);
.fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__fini_array_end = .);
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} >INTRAM AT>FLASH :FLASH
.dtors :
{
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} >INTRAM AT>FLASH :FLASH
.jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :FLASH
.data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :FLASH
.dynamic : { *(.dynamic) } >INTRAM AT>FLASH :FLASH
.got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :FLASH
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
} >INTRAM AT>FLASH :FLASH
.data1 : { *(.data1) } >INTRAM AT>FLASH :FLASH
.balign : { . = ALIGN(8); _edata = .; } >INTRAM AT>FLASH :FLASH
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(8);
} >INTRAM AT>INTRAM :INTRAM
. = ALIGN(8);
_end = .;
PROVIDE (end = .);
__heap_start__ = ALIGN(8);
.heap :
{
*(.heap)
. = (__heap_size__ == __max_heap_size__) ?
ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
__heap_size__;
} >INTRAM AT>INTRAM :INTRAM
__heap_end__ = .;
/* 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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
{
_stack = .;
*(.stack)
. = __stack_size__;
_estack = .;
} >INTRAM AT>INTRAM :INTRAM
.userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
.factorypage : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE :FACTORYPAGE
/DISCARD/ : { *(.note.GNU-stack) }
}

View file

@ -0,0 +1,138 @@
/******************************************************************************
* AVR32 AT32UC3A1256 XLINK command file for AVR32 IAR C/C++ Compiler.
*
* The assumed memory layout is the one of the AT32UC3A1256:
*
* Start Stop Name Type
* ---------- ---------- ----- --------------
* 0x00000000 0x0000FFFF SRAM RAM
* 0x80000000 0x8003FFFF FLASH FLASH
*
* Usage: xlink your_file(s) -f xcl-file libraries
*
* - Compiler: IAR EWAVR32
* - Supported devices: AVR32 AT32UC3A1256
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
/************************************************************************/
/* The following segments are defined in this link file: */
/* */
/* Code segments */
/* CODE32 -- Program code used by __code32 functions. */
/* RESET -- Reset code. */
/* EVSEG -- Exception vector handlers. */
/* */
/* Constant segments */
/* INITTAB -- Segment initializer table. */
/* DIFUNCT -- Dynamic initialization vector used by C++. */
/* SWITCH -- Switch tables. */
/* ACTAB -- Table of pointers to acall functions. */
/* */
/* DATA21_ID -- Initialization data for DATA21_I. */
/* DATA32_ID -- Initialization data for DATA32_I. */
/* DATA32_C -- Constant __data32 data. */
/* */
/* CHECKSUM -- Checksum segment. */
/* */
/* Data segments */
/* DATA21_I -- Initialized __data21 data with non-zero */
/* initial value. */
/* DATA32_I -- Initialized __data32 data with non-zero */
/* initial value. */
/* DATA21_Z -- Initialized __data21 data with zero initial value. */
/* DATA32_Z -- Initialized __data32 data with zero initial value. */
/* DATA21_N -- Non-initialized __data21. */
/* DATA32_N -- Non-initialized __data32. */
/* SSTACK -- The system stack. */
/* CSTACK -- The application stack. */
/* HEAP -- The heap used by malloc and free. */
/* */
/************************************************************************/
/************************************************************************/
/* Define CPU */
/************************************************************************/
-cavr32
// Declare the IPR0 memory location
-DIPR0=FFFF0800
/************************************************************************/
/* Reset code is located at address 0x80000000 and up. */
/************************************************************************/
-Z(CODE)RESET=80000000-8003FFFF
/************************************************************************/
/* The exception handler code is located at address 0x80000000 */
/* and up. Make sure that the exception table gets properly */
/* allocated. By using the special -Z@ allocation primitive, the */
/* placement is guaranteed to be at _EVBASE and onwards. */
/************************************************************************/
-Z@(CODE)EVTAB=80004000-8003FFFF
-Z@(CODE)EV100=80004100-8003FFFF
-P(CODE)EVSEG=80004000-8003FFFF
/************************************************************************/
/* Allocate code and const segments. */
/************************************************************************/
-P(CODE)CODE32=80000000-8003FFFF
-P(CONST)DATA32_C=80000000-8003FFFF
// Initializers
-Z(CONST)INITTAB,DIFUNCT=80000000-8003FFFF
-Z(CONST)CHECKSUM,SWITCH=80000000-8003FFFF
-Z(CONST)DATA21_ID,DATA32_ID=80000000-8003FFFF
-Z(CONST)ACTAB,HTAB=80000000-8003FFFF
/************************************************************************/
/* Allocate the read/write segments that are mapped to RAM. */
/************************************************************************/
-Z(DATA)DATA21_I,DATA21_Z,DATA21_N=00000004-0000FFFF
-Z(DATA)DATA32_I,DATA32_Z,DATA32_N=00000004-0000FFFF
-Z(DATA)TRACEBUFFER=00000004-0000FFFF
-Z(DATA)SSTACK+_SSTACK_SIZE#00000004-0000FFFF
-Z(DATA)CSTACK+_CSTACK_SIZE#00000004-0000FFFF
-Z(DATA)HEAP+_HEAP_SIZE=00000004-0000FFFF
/************************************************************************/
/* End of File */
/************************************************************************/

View file

@ -0,0 +1,263 @@
/******************************************************************************
* AVR32 AT32UC3A1512 GNU LD script file.
*
* - Compiler: GNU GCC for AVR32
* - Supported devices: AVR32 AT32UC3A1512
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
OUTPUT_ARCH(avr32:uc)
ENTRY(_start)
MEMORY
{
FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00080000
INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x0000FFFC
USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 0x00000200
}
PHDRS
{
FLASH PT_LOAD;
INTRAM PT_NULL;
USERPAGE PT_LOAD;
FACTORYPAGE PT_LOAD;
}
SECTIONS
{
/* If this heap size is selected, all the INTRAM space from the end of the
data area to the beginning of the stack will be allocated for the heap. */
__max_heap_size__ = -1;
/* Use a default heap size if heap size was not defined. */
__heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
/* Use a default stack size if stack size was not defined. */
__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
/* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
.interp : { *(.interp) } >FLASH AT>FLASH :FLASH
.reset : { *(.reset) } >FLASH AT>FLASH :FLASH
.hash : { *(.hash) } >FLASH AT>FLASH :FLASH
.dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
.dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
.gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
.gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
.gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
.rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
.rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
.rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
.rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
.rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
.rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
.rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
.rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
.rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
.init :
{
KEEP (*(.init))
} >FLASH AT>FLASH :FLASH =0xd703d703
.plt : { *(.plt) } >FLASH AT>FLASH :FLASH
.text :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} >FLASH AT>FLASH :FLASH =0xd703d703
.fini :
{
KEEP (*(.fini))
} >FLASH AT>FLASH :FLASH =0xd703d703
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
.eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
.lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
. = ORIGIN(INTRAM);
.dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :FLASH
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :FLASH
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :FLASH
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
PROVIDE (__preinit_array_start = ALIGN(32 / 8));
.preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__preinit_array_end = .);
PROVIDE (__init_array_start = .);
.init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__init_array_end = .);
PROVIDE (__fini_array_start = .);
.fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__fini_array_end = .);
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} >INTRAM AT>FLASH :FLASH
.dtors :
{
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} >INTRAM AT>FLASH :FLASH
.jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :FLASH
.data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :FLASH
.dynamic : { *(.dynamic) } >INTRAM AT>FLASH :FLASH
.got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :FLASH
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
} >INTRAM AT>FLASH :FLASH
.data1 : { *(.data1) } >INTRAM AT>FLASH :FLASH
.balign : { . = ALIGN(8); _edata = .; } >INTRAM AT>FLASH :FLASH
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(8);
} >INTRAM AT>INTRAM :INTRAM
. = ALIGN(8);
_end = .;
PROVIDE (end = .);
__heap_start__ = ALIGN(8);
.heap :
{
*(.heap)
. = (__heap_size__ == __max_heap_size__) ?
ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
__heap_size__;
} >INTRAM AT>INTRAM :INTRAM
__heap_end__ = .;
/* 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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
{
_stack = .;
*(.stack)
. = __stack_size__;
_estack = .;
} >INTRAM AT>INTRAM :INTRAM
.userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
.factorypage : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE :FACTORYPAGE
/DISCARD/ : { *(.note.GNU-stack) }
}

View file

@ -0,0 +1,138 @@
/******************************************************************************
* AVR32 AT32UC3A1512 XLINK command file for AVR32 IAR C/C++ Compiler.
*
* The assumed memory layout is the one of the AT32UC3A1512:
*
* Start Stop Name Type
* ---------- ---------- ----- --------------
* 0x00000000 0x0000FFFF SRAM RAM
* 0x80000000 0x8007FFFF FLASH FLASH
*
* Usage: xlink your_file(s) -f xcl-file libraries
*
* - Compiler: IAR EWAVR32
* - Supported devices: AVR32 AT32UC3A1512
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
/************************************************************************/
/* The following segments are defined in this link file: */
/* */
/* Code segments */
/* CODE32 -- Program code used by __code32 functions. */
/* RESET -- Reset code. */
/* EVSEG -- Exception vector handlers. */
/* */
/* Constant segments */
/* INITTAB -- Segment initializer table. */
/* DIFUNCT -- Dynamic initialization vector used by C++. */
/* SWITCH -- Switch tables. */
/* ACTAB -- Table of pointers to acall functions. */
/* */
/* DATA21_ID -- Initialization data for DATA21_I. */
/* DATA32_ID -- Initialization data for DATA32_I. */
/* DATA32_C -- Constant __data32 data. */
/* */
/* CHECKSUM -- Checksum segment. */
/* */
/* Data segments */
/* DATA21_I -- Initialized __data21 data with non-zero */
/* initial value. */
/* DATA32_I -- Initialized __data32 data with non-zero */
/* initial value. */
/* DATA21_Z -- Initialized __data21 data with zero initial value. */
/* DATA32_Z -- Initialized __data32 data with zero initial value. */
/* DATA21_N -- Non-initialized __data21. */
/* DATA32_N -- Non-initialized __data32. */
/* SSTACK -- The system stack. */
/* CSTACK -- The application stack. */
/* HEAP -- The heap used by malloc and free. */
/* */
/************************************************************************/
/************************************************************************/
/* Define CPU */
/************************************************************************/
-cavr32
// Declare the IPR0 memory location
-DIPR0=FFFF0800
/************************************************************************/
/* Reset code is located at address 0x80000000 and up. */
/************************************************************************/
-Z(CODE)RESET=80000000-8007FFFF
/************************************************************************/
/* The exception handler code is located at address 0x80000000 */
/* and up. Make sure that the exception table gets properly */
/* allocated. By using the special -Z@ allocation primitive, the */
/* placement is guaranteed to be at _EVBASE and onwards. */
/************************************************************************/
-Z@(CODE)EVTAB=80004000-8007FFFF
-Z@(CODE)EV100=80004100-8007FFFF
-P(CODE)EVSEG=80004000-8007FFFF
/************************************************************************/
/* Allocate code and const segments. */
/************************************************************************/
-P(CODE)CODE32=80000000-8007FFFF
-P(CONST)DATA32_C=80000000-8007FFFF
// Initializers
-Z(CONST)INITTAB,DIFUNCT=80000000-8007FFFF
-Z(CONST)CHECKSUM,SWITCH=80000000-8007FFFF
-Z(CONST)DATA21_ID,DATA32_ID=80000000-8007FFFF
-Z(CONST)ACTAB,HTAB=80000000-8007FFFF
/************************************************************************/
/* Allocate the read/write segments that are mapped to RAM. */
/************************************************************************/
-Z(DATA)DATA21_I,DATA21_Z,DATA21_N=00000004-0000FFFF
-Z(DATA)DATA32_I,DATA32_Z,DATA32_N=00000004-0000FFFF
-Z(DATA)TRACEBUFFER=00000004-0000FFFF
-Z(DATA)SSTACK+_SSTACK_SIZE#00000004-0000FFFF
-Z(DATA)CSTACK+_CSTACK_SIZE#00000004-0000FFFF
-Z(DATA)HEAP+_HEAP_SIZE=00000004-0000FFFF
/************************************************************************/
/* End of File */
/************************************************************************/

View file

@ -0,0 +1,263 @@
/******************************************************************************
* AVR32 AT32UC3B0128 GNU LD script file.
*
* - Compiler: GNU GCC for AVR32
* - Supported devices: AVR32 AT32UC3B0128
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
OUTPUT_ARCH(avr32:uc)
ENTRY(_start)
MEMORY
{
FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00020000
INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x00007FFC
USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 0x00000200
}
PHDRS
{
FLASH PT_LOAD;
INTRAM PT_NULL;
USERPAGE PT_LOAD;
FACTORYPAGE PT_LOAD;
}
SECTIONS
{
/* If this heap size is selected, all the INTRAM space from the end of the
data area to the beginning of the stack will be allocated for the heap. */
__max_heap_size__ = -1;
/* Use a default heap size if heap size was not defined. */
__heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
/* Use a default stack size if stack size was not defined. */
__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
/* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
.interp : { *(.interp) } >FLASH AT>FLASH :FLASH
.reset : { *(.reset) } >FLASH AT>FLASH :FLASH
.hash : { *(.hash) } >FLASH AT>FLASH :FLASH
.dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
.dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
.gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
.gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
.gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
.rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
.rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
.rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
.rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
.rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
.rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
.rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
.rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
.rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
.init :
{
KEEP (*(.init))
} >FLASH AT>FLASH :FLASH =0xd703d703
.plt : { *(.plt) } >FLASH AT>FLASH :FLASH
.text :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} >FLASH AT>FLASH :FLASH =0xd703d703
.fini :
{
KEEP (*(.fini))
} >FLASH AT>FLASH :FLASH =0xd703d703
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
.eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
.lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
. = ORIGIN(INTRAM);
.dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :FLASH
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :FLASH
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :FLASH
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
PROVIDE (__preinit_array_start = ALIGN(32 / 8));
.preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__preinit_array_end = .);
PROVIDE (__init_array_start = .);
.init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__init_array_end = .);
PROVIDE (__fini_array_start = .);
.fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__fini_array_end = .);
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} >INTRAM AT>FLASH :FLASH
.dtors :
{
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} >INTRAM AT>FLASH :FLASH
.jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :FLASH
.data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :FLASH
.dynamic : { *(.dynamic) } >INTRAM AT>FLASH :FLASH
.got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :FLASH
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
} >INTRAM AT>FLASH :FLASH
.data1 : { *(.data1) } >INTRAM AT>FLASH :FLASH
.balign : { . = ALIGN(8); _edata = .; } >INTRAM AT>FLASH :FLASH
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(8);
} >INTRAM AT>INTRAM :INTRAM
. = ALIGN(8);
_end = .;
PROVIDE (end = .);
__heap_start__ = ALIGN(8);
.heap :
{
*(.heap)
. = (__heap_size__ == __max_heap_size__) ?
ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
__heap_size__;
} >INTRAM AT>INTRAM :INTRAM
__heap_end__ = .;
/* 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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
{
_stack = .;
*(.stack)
. = __stack_size__;
_estack = .;
} >INTRAM AT>INTRAM :INTRAM
.userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
.factorypage : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE :FACTORYPAGE
/DISCARD/ : { *(.note.GNU-stack) }
}

View file

@ -0,0 +1,138 @@
/******************************************************************************
* AVR32 AT32UC3B0128 XLINK command file for AVR32 IAR C/C++ Compiler.
*
* The assumed memory layout is the one of the AT32UC3B0128:
*
* Start Stop Name Type
* ---------- ---------- ----- --------------
* 0x00000000 0x00007FFF SRAM RAM
* 0x80000000 0x8001FFFF FLASH FLASH
*
* Usage: xlink your_file(s) -f xcl-file libraries
*
* - Compiler: IAR EWAVR32
* - Supported devices: AVR32 AT32UC3B0128
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
/************************************************************************/
/* The following segments are defined in this link file: */
/* */
/* Code segments */
/* CODE32 -- Program code used by __code32 functions. */
/* RESET -- Reset code. */
/* EVSEG -- Exception vector handlers. */
/* */
/* Constant segments */
/* INITTAB -- Segment initializer table. */
/* DIFUNCT -- Dynamic initialization vector used by C++. */
/* SWITCH -- Switch tables. */
/* ACTAB -- Table of pointers to acall functions. */
/* */
/* DATA21_ID -- Initialization data for DATA21_I. */
/* DATA32_ID -- Initialization data for DATA32_I. */
/* DATA32_C -- Constant __data32 data. */
/* */
/* CHECKSUM -- Checksum segment. */
/* */
/* Data segments */
/* DATA21_I -- Initialized __data21 data with non-zero */
/* initial value. */
/* DATA32_I -- Initialized __data32 data with non-zero */
/* initial value. */
/* DATA21_Z -- Initialized __data21 data with zero initial value. */
/* DATA32_Z -- Initialized __data32 data with zero initial value. */
/* DATA21_N -- Non-initialized __data21. */
/* DATA32_N -- Non-initialized __data32. */
/* SSTACK -- The system stack. */
/* CSTACK -- The application stack. */
/* HEAP -- The heap used by malloc and free. */
/* */
/************************************************************************/
/************************************************************************/
/* Define CPU */
/************************************************************************/
-cavr32
// Declare the IPR0 memory location
-DIPR0=FFFF0800
/************************************************************************/
/* Reset code is located at address 0x80000000 and up. */
/************************************************************************/
-Z(CODE)RESET=80000000-8001FFFF
/************************************************************************/
/* The exception handler code is located at address 0x80000000 */
/* and up. Make sure that the exception table gets properly */
/* allocated. By using the special -Z@ allocation primitive, the */
/* placement is guaranteed to be at _EVBASE and onwards. */
/************************************************************************/
-Z@(CODE)EVTAB=80004000-8001FFFF
-Z@(CODE)EV100=80004100-8001FFFF
-P(CODE)EVSEG=80004000-8001FFFF
/************************************************************************/
/* Allocate code and const segments. */
/************************************************************************/
-P(CODE)CODE32=80000000-8001FFFF
-P(CONST)DATA32_C=80000000-8001FFFF
// Initializers
-Z(CONST)INITTAB,DIFUNCT=80000000-8001FFFF
-Z(CONST)CHECKSUM,SWITCH=80000000-8001FFFF
-Z(CONST)DATA21_ID,DATA32_ID=80000000-8001FFFF
-Z(CONST)ACTAB,HTAB=80000000-8001FFFF
/************************************************************************/
/* Allocate the read/write segments that are mapped to RAM. */
/************************************************************************/
-Z(DATA)DATA21_I,DATA21_Z,DATA21_N=00000004-00007FFF
-Z(DATA)DATA32_I,DATA32_Z,DATA32_N=00000004-00007FFF
-Z(DATA)TRACEBUFFER=00000004-00007FFF
-Z(DATA)SSTACK+_SSTACK_SIZE#00000004-00007FFF
-Z(DATA)CSTACK+_CSTACK_SIZE#00000004-00007FFF
-Z(DATA)HEAP+_HEAP_SIZE=00000004-00007FFF
/************************************************************************/
/* End of File */
/************************************************************************/

View file

@ -0,0 +1,263 @@
/******************************************************************************
* AVR32 AT32UC3B0256 GNU LD script file.
*
* - Compiler: GNU GCC for AVR32
* - Supported devices: AVR32 AT32UC3B0256
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
OUTPUT_ARCH(avr32:uc)
ENTRY(_start)
MEMORY
{
FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00040000
INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x00007FFC
USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 0x00000200
}
PHDRS
{
FLASH PT_LOAD;
INTRAM PT_NULL;
USERPAGE PT_LOAD;
FACTORYPAGE PT_LOAD;
}
SECTIONS
{
/* If this heap size is selected, all the INTRAM space from the end of the
data area to the beginning of the stack will be allocated for the heap. */
__max_heap_size__ = -1;
/* Use a default heap size if heap size was not defined. */
__heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
/* Use a default stack size if stack size was not defined. */
__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
/* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
.interp : { *(.interp) } >FLASH AT>FLASH :FLASH
.reset : { *(.reset) } >FLASH AT>FLASH :FLASH
.hash : { *(.hash) } >FLASH AT>FLASH :FLASH
.dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
.dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
.gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
.gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
.gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
.rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
.rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
.rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
.rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
.rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
.rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
.rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
.rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
.rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
.init :
{
KEEP (*(.init))
} >FLASH AT>FLASH :FLASH =0xd703d703
.plt : { *(.plt) } >FLASH AT>FLASH :FLASH
.text :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} >FLASH AT>FLASH :FLASH =0xd703d703
.fini :
{
KEEP (*(.fini))
} >FLASH AT>FLASH :FLASH =0xd703d703
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
.eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
.lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
. = ORIGIN(INTRAM);
.dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :FLASH
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :FLASH
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :FLASH
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
PROVIDE (__preinit_array_start = ALIGN(32 / 8));
.preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__preinit_array_end = .);
PROVIDE (__init_array_start = .);
.init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__init_array_end = .);
PROVIDE (__fini_array_start = .);
.fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__fini_array_end = .);
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} >INTRAM AT>FLASH :FLASH
.dtors :
{
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} >INTRAM AT>FLASH :FLASH
.jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :FLASH
.data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :FLASH
.dynamic : { *(.dynamic) } >INTRAM AT>FLASH :FLASH
.got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :FLASH
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
} >INTRAM AT>FLASH :FLASH
.data1 : { *(.data1) } >INTRAM AT>FLASH :FLASH
.balign : { . = ALIGN(8); _edata = .; } >INTRAM AT>FLASH :FLASH
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(8);
} >INTRAM AT>INTRAM :INTRAM
. = ALIGN(8);
_end = .;
PROVIDE (end = .);
__heap_start__ = ALIGN(8);
.heap :
{
*(.heap)
. = (__heap_size__ == __max_heap_size__) ?
ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
__heap_size__;
} >INTRAM AT>INTRAM :INTRAM
__heap_end__ = .;
/* 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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
{
_stack = .;
*(.stack)
. = __stack_size__;
_estack = .;
} >INTRAM AT>INTRAM :INTRAM
.userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
.factorypage : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE :FACTORYPAGE
/DISCARD/ : { *(.note.GNU-stack) }
}

View file

@ -0,0 +1,138 @@
/******************************************************************************
* AVR32 AT32UC3B0256 XLINK command file for AVR32 IAR C/C++ Compiler.
*
* The assumed memory layout is the one of the AT32UC3B0256:
*
* Start Stop Name Type
* ---------- ---------- ----- --------------
* 0x00000000 0x00007FFF SRAM RAM
* 0x80000000 0x8003FFFF FLASH FLASH
*
* Usage: xlink your_file(s) -f xcl-file libraries
*
* - Compiler: IAR EWAVR32
* - Supported devices: AVR32 AT32UC3B0256
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
/************************************************************************/
/* The following segments are defined in this link file: */
/* */
/* Code segments */
/* CODE32 -- Program code used by __code32 functions. */
/* RESET -- Reset code. */
/* EVSEG -- Exception vector handlers. */
/* */
/* Constant segments */
/* INITTAB -- Segment initializer table. */
/* DIFUNCT -- Dynamic initialization vector used by C++. */
/* SWITCH -- Switch tables. */
/* ACTAB -- Table of pointers to acall functions. */
/* */
/* DATA21_ID -- Initialization data for DATA21_I. */
/* DATA32_ID -- Initialization data for DATA32_I. */
/* DATA32_C -- Constant __data32 data. */
/* */
/* CHECKSUM -- Checksum segment. */
/* */
/* Data segments */
/* DATA21_I -- Initialized __data21 data with non-zero */
/* initial value. */
/* DATA32_I -- Initialized __data32 data with non-zero */
/* initial value. */
/* DATA21_Z -- Initialized __data21 data with zero initial value. */
/* DATA32_Z -- Initialized __data32 data with zero initial value. */
/* DATA21_N -- Non-initialized __data21. */
/* DATA32_N -- Non-initialized __data32. */
/* SSTACK -- The system stack. */
/* CSTACK -- The application stack. */
/* HEAP -- The heap used by malloc and free. */
/* */
/************************************************************************/
/************************************************************************/
/* Define CPU */
/************************************************************************/
-cavr32
// Declare the IPR0 memory location
-DIPR0=FFFF0800
/************************************************************************/
/* Reset code is located at address 0x80000000 and up. */
/************************************************************************/
-Z(CODE)RESET=80000000-8003FFFF
/************************************************************************/
/* The exception handler code is located at address 0x80000000 */
/* and up. Make sure that the exception table gets properly */
/* allocated. By using the special -Z@ allocation primitive, the */
/* placement is guaranteed to be at _EVBASE and onwards. */
/************************************************************************/
-Z@(CODE)EVTAB=80004000-8003FFFF
-Z@(CODE)EV100=80004100-8003FFFF
-P(CODE)EVSEG=80004000-8003FFFF
/************************************************************************/
/* Allocate code and const segments. */
/************************************************************************/
-P(CODE)CODE32=80000000-8003FFFF
-P(CONST)DATA32_C=80000000-8003FFFF
// Initializers
-Z(CONST)INITTAB,DIFUNCT=80000000-8003FFFF
-Z(CONST)CHECKSUM,SWITCH=80000000-8003FFFF
-Z(CONST)DATA21_ID,DATA32_ID=80000000-8003FFFF
-Z(CONST)ACTAB,HTAB=80000000-8003FFFF
/************************************************************************/
/* Allocate the read/write segments that are mapped to RAM. */
/************************************************************************/
-Z(DATA)DATA21_I,DATA21_Z,DATA21_N=00000004-00007FFF
-Z(DATA)DATA32_I,DATA32_Z,DATA32_N=00000004-00007FFF
-Z(DATA)TRACEBUFFER=00000004-00007FFF
-Z(DATA)SSTACK+_SSTACK_SIZE#00000004-00007FFF
-Z(DATA)CSTACK+_CSTACK_SIZE#00000004-00007FFF
-Z(DATA)HEAP+_HEAP_SIZE=00000004-00007FFF
/************************************************************************/
/* End of File */
/************************************************************************/

View file

@ -0,0 +1,263 @@
/******************************************************************************
* AVR32 AT32UC3B064 GNU LD script file.
*
* - Compiler: GNU GCC for AVR32
* - Supported devices: AVR32 AT32UC3B064
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
OUTPUT_ARCH(avr32:uc)
ENTRY(_start)
MEMORY
{
FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00010000
INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x00003FFC
USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 0x00000200
}
PHDRS
{
FLASH PT_LOAD;
INTRAM PT_NULL;
USERPAGE PT_LOAD;
FACTORYPAGE PT_LOAD;
}
SECTIONS
{
/* If this heap size is selected, all the INTRAM space from the end of the
data area to the beginning of the stack will be allocated for the heap. */
__max_heap_size__ = -1;
/* Use a default heap size if heap size was not defined. */
__heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
/* Use a default stack size if stack size was not defined. */
__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
/* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
.interp : { *(.interp) } >FLASH AT>FLASH :FLASH
.reset : { *(.reset) } >FLASH AT>FLASH :FLASH
.hash : { *(.hash) } >FLASH AT>FLASH :FLASH
.dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
.dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
.gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
.gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
.gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
.rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
.rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
.rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
.rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
.rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
.rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
.rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
.rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
.rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
.init :
{
KEEP (*(.init))
} >FLASH AT>FLASH :FLASH =0xd703d703
.plt : { *(.plt) } >FLASH AT>FLASH :FLASH
.text :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} >FLASH AT>FLASH :FLASH =0xd703d703
.fini :
{
KEEP (*(.fini))
} >FLASH AT>FLASH :FLASH =0xd703d703
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
.eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
.lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
. = ORIGIN(INTRAM);
.dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :FLASH
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :FLASH
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :FLASH
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
PROVIDE (__preinit_array_start = ALIGN(32 / 8));
.preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__preinit_array_end = .);
PROVIDE (__init_array_start = .);
.init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__init_array_end = .);
PROVIDE (__fini_array_start = .);
.fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__fini_array_end = .);
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} >INTRAM AT>FLASH :FLASH
.dtors :
{
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} >INTRAM AT>FLASH :FLASH
.jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :FLASH
.data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :FLASH
.dynamic : { *(.dynamic) } >INTRAM AT>FLASH :FLASH
.got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :FLASH
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
} >INTRAM AT>FLASH :FLASH
.data1 : { *(.data1) } >INTRAM AT>FLASH :FLASH
.balign : { . = ALIGN(8); _edata = .; } >INTRAM AT>FLASH :FLASH
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(8);
} >INTRAM AT>INTRAM :INTRAM
. = ALIGN(8);
_end = .;
PROVIDE (end = .);
__heap_start__ = ALIGN(8);
.heap :
{
*(.heap)
. = (__heap_size__ == __max_heap_size__) ?
ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
__heap_size__;
} >INTRAM AT>INTRAM :INTRAM
__heap_end__ = .;
/* 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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
{
_stack = .;
*(.stack)
. = __stack_size__;
_estack = .;
} >INTRAM AT>INTRAM :INTRAM
.userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
.factorypage : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE :FACTORYPAGE
/DISCARD/ : { *(.note.GNU-stack) }
}

View file

@ -0,0 +1,138 @@
/******************************************************************************
* AVR32 AT32UC3B064 XLINK command file for AVR32 IAR C/C++ Compiler.
*
* The assumed memory layout is the one of the AT32UC3B064:
*
* Start Stop Name Type
* ---------- ---------- ----- --------------
* 0x00000000 0x00003FFF SRAM RAM
* 0x80000000 0x8000FFFF FLASH FLASH
*
* Usage: xlink your_file(s) -f xcl-file libraries
*
* - Compiler: IAR EWAVR32
* - Supported devices: AVR32 AT32UC3B064
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
/************************************************************************/
/* The following segments are defined in this link file: */
/* */
/* Code segments */
/* CODE32 -- Program code used by __code32 functions. */
/* RESET -- Reset code. */
/* EVSEG -- Exception vector handlers. */
/* */
/* Constant segments */
/* INITTAB -- Segment initializer table. */
/* DIFUNCT -- Dynamic initialization vector used by C++. */
/* SWITCH -- Switch tables. */
/* ACTAB -- Table of pointers to acall functions. */
/* */
/* DATA21_ID -- Initialization data for DATA21_I. */
/* DATA32_ID -- Initialization data for DATA32_I. */
/* DATA32_C -- Constant __data32 data. */
/* */
/* CHECKSUM -- Checksum segment. */
/* */
/* Data segments */
/* DATA21_I -- Initialized __data21 data with non-zero */
/* initial value. */
/* DATA32_I -- Initialized __data32 data with non-zero */
/* initial value. */
/* DATA21_Z -- Initialized __data21 data with zero initial value. */
/* DATA32_Z -- Initialized __data32 data with zero initial value. */
/* DATA21_N -- Non-initialized __data21. */
/* DATA32_N -- Non-initialized __data32. */
/* SSTACK -- The system stack. */
/* CSTACK -- The application stack. */
/* HEAP -- The heap used by malloc and free. */
/* */
/************************************************************************/
/************************************************************************/
/* Define CPU */
/************************************************************************/
-cavr32
// Declare the IPR0 memory location
-DIPR0=FFFF0800
/************************************************************************/
/* Reset code is located at address 0x80000000 and up. */
/************************************************************************/
-Z(CODE)RESET=80000000-8000FFFF
/************************************************************************/
/* The exception handler code is located at address 0x80000000 */
/* and up. Make sure that the exception table gets properly */
/* allocated. By using the special -Z@ allocation primitive, the */
/* placement is guaranteed to be at _EVBASE and onwards. */
/************************************************************************/
-Z@(CODE)EVTAB=80004000-8000FFFF
-Z@(CODE)EV100=80004100-8000FFFF
-P(CODE)EVSEG=80004000-8000FFFF
/************************************************************************/
/* Allocate code and const segments. */
/************************************************************************/
-P(CODE)CODE32=80000000-8000FFFF
-P(CONST)DATA32_C=80000000-8000FFFF
// Initializers
-Z(CONST)INITTAB,DIFUNCT=80000000-8000FFFF
-Z(CONST)CHECKSUM,SWITCH=80000000-8000FFFF
-Z(CONST)DATA21_ID,DATA32_ID=80000000-8000FFFF
-Z(CONST)ACTAB,HTAB=80000000-8000FFFF
/************************************************************************/
/* Allocate the read/write segments that are mapped to RAM. */
/************************************************************************/
-Z(DATA)DATA21_I,DATA21_Z,DATA21_N=00000004-00003FFF
-Z(DATA)DATA32_I,DATA32_Z,DATA32_N=00000004-00003FFF
-Z(DATA)TRACEBUFFER=00000004-00003FFF
-Z(DATA)SSTACK+_SSTACK_SIZE#00000004-00003FFF
-Z(DATA)CSTACK+_CSTACK_SIZE#00000004-00003FFF
-Z(DATA)HEAP+_HEAP_SIZE=00000004-00003FFF
/************************************************************************/
/* End of File */
/************************************************************************/

View file

@ -0,0 +1,263 @@
/******************************************************************************
* AVR32 AT32UC3B1128 GNU LD script file.
*
* - Compiler: GNU GCC for AVR32
* - Supported devices: AVR32 AT32UC3B1128
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
OUTPUT_ARCH(avr32:uc)
ENTRY(_start)
MEMORY
{
FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00020000
INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x00007FFC
USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 0x00000200
}
PHDRS
{
FLASH PT_LOAD;
INTRAM PT_NULL;
USERPAGE PT_LOAD;
FACTORYPAGE PT_LOAD;
}
SECTIONS
{
/* If this heap size is selected, all the INTRAM space from the end of the
data area to the beginning of the stack will be allocated for the heap. */
__max_heap_size__ = -1;
/* Use a default heap size if heap size was not defined. */
__heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
/* Use a default stack size if stack size was not defined. */
__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
/* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
.interp : { *(.interp) } >FLASH AT>FLASH :FLASH
.reset : { *(.reset) } >FLASH AT>FLASH :FLASH
.hash : { *(.hash) } >FLASH AT>FLASH :FLASH
.dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
.dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
.gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
.gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
.gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
.rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
.rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
.rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
.rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
.rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
.rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
.rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
.rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
.rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
.init :
{
KEEP (*(.init))
} >FLASH AT>FLASH :FLASH =0xd703d703
.plt : { *(.plt) } >FLASH AT>FLASH :FLASH
.text :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} >FLASH AT>FLASH :FLASH =0xd703d703
.fini :
{
KEEP (*(.fini))
} >FLASH AT>FLASH :FLASH =0xd703d703
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
.eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
.lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
. = ORIGIN(INTRAM);
.dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :FLASH
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :FLASH
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :FLASH
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
PROVIDE (__preinit_array_start = ALIGN(32 / 8));
.preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__preinit_array_end = .);
PROVIDE (__init_array_start = .);
.init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__init_array_end = .);
PROVIDE (__fini_array_start = .);
.fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__fini_array_end = .);
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} >INTRAM AT>FLASH :FLASH
.dtors :
{
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} >INTRAM AT>FLASH :FLASH
.jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :FLASH
.data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :FLASH
.dynamic : { *(.dynamic) } >INTRAM AT>FLASH :FLASH
.got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :FLASH
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
} >INTRAM AT>FLASH :FLASH
.data1 : { *(.data1) } >INTRAM AT>FLASH :FLASH
.balign : { . = ALIGN(8); _edata = .; } >INTRAM AT>FLASH :FLASH
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(8);
} >INTRAM AT>INTRAM :INTRAM
. = ALIGN(8);
_end = .;
PROVIDE (end = .);
__heap_start__ = ALIGN(8);
.heap :
{
*(.heap)
. = (__heap_size__ == __max_heap_size__) ?
ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
__heap_size__;
} >INTRAM AT>INTRAM :INTRAM
__heap_end__ = .;
/* 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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
{
_stack = .;
*(.stack)
. = __stack_size__;
_estack = .;
} >INTRAM AT>INTRAM :INTRAM
.userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
.factorypage : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE :FACTORYPAGE
/DISCARD/ : { *(.note.GNU-stack) }
}

View file

@ -0,0 +1,138 @@
/******************************************************************************
* AVR32 AT32UC3B1128 XLINK command file for AVR32 IAR C/C++ Compiler.
*
* The assumed memory layout is the one of the AT32UC3B1128:
*
* Start Stop Name Type
* ---------- ---------- ----- --------------
* 0x00000000 0x00007FFF SRAM RAM
* 0x80000000 0x8001FFFF FLASH FLASH
*
* Usage: xlink your_file(s) -f xcl-file libraries
*
* - Compiler: IAR EWAVR32
* - Supported devices: AVR32 AT32UC3B1128
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
/************************************************************************/
/* The following segments are defined in this link file: */
/* */
/* Code segments */
/* CODE32 -- Program code used by __code32 functions. */
/* RESET -- Reset code. */
/* EVSEG -- Exception vector handlers. */
/* */
/* Constant segments */
/* INITTAB -- Segment initializer table. */
/* DIFUNCT -- Dynamic initialization vector used by C++. */
/* SWITCH -- Switch tables. */
/* ACTAB -- Table of pointers to acall functions. */
/* */
/* DATA21_ID -- Initialization data for DATA21_I. */
/* DATA32_ID -- Initialization data for DATA32_I. */
/* DATA32_C -- Constant __data32 data. */
/* */
/* CHECKSUM -- Checksum segment. */
/* */
/* Data segments */
/* DATA21_I -- Initialized __data21 data with non-zero */
/* initial value. */
/* DATA32_I -- Initialized __data32 data with non-zero */
/* initial value. */
/* DATA21_Z -- Initialized __data21 data with zero initial value. */
/* DATA32_Z -- Initialized __data32 data with zero initial value. */
/* DATA21_N -- Non-initialized __data21. */
/* DATA32_N -- Non-initialized __data32. */
/* SSTACK -- The system stack. */
/* CSTACK -- The application stack. */
/* HEAP -- The heap used by malloc and free. */
/* */
/************************************************************************/
/************************************************************************/
/* Define CPU */
/************************************************************************/
-cavr32
// Declare the IPR0 memory location
-DIPR0=FFFF0800
/************************************************************************/
/* Reset code is located at address 0x80000000 and up. */
/************************************************************************/
-Z(CODE)RESET=80000000-8001FFFF
/************************************************************************/
/* The exception handler code is located at address 0x80000000 */
/* and up. Make sure that the exception table gets properly */
/* allocated. By using the special -Z@ allocation primitive, the */
/* placement is guaranteed to be at _EVBASE and onwards. */
/************************************************************************/
-Z@(CODE)EVTAB=80004000-8001FFFF
-Z@(CODE)EV100=80004100-8001FFFF
-P(CODE)EVSEG=80004000-8001FFFF
/************************************************************************/
/* Allocate code and const segments. */
/************************************************************************/
-P(CODE)CODE32=80000000-8001FFFF
-P(CONST)DATA32_C=80000000-8001FFFF
// Initializers
-Z(CONST)INITTAB,DIFUNCT=80000000-8001FFFF
-Z(CONST)CHECKSUM,SWITCH=80000000-8001FFFF
-Z(CONST)DATA21_ID,DATA32_ID=80000000-8001FFFF
-Z(CONST)ACTAB,HTAB=80000000-8001FFFF
/************************************************************************/
/* Allocate the read/write segments that are mapped to RAM. */
/************************************************************************/
-Z(DATA)DATA21_I,DATA21_Z,DATA21_N=00000004-00007FFF
-Z(DATA)DATA32_I,DATA32_Z,DATA32_N=00000004-00007FFF
-Z(DATA)TRACEBUFFER=00000004-00007FFF
-Z(DATA)SSTACK+_SSTACK_SIZE#00000004-00007FFF
-Z(DATA)CSTACK+_CSTACK_SIZE#00000004-00007FFF
-Z(DATA)HEAP+_HEAP_SIZE=00000004-00007FFF
/************************************************************************/
/* End of File */
/************************************************************************/

View file

@ -0,0 +1,263 @@
/******************************************************************************
* AVR32 AT32UC3B1256 GNU LD script file.
*
* - Compiler: GNU GCC for AVR32
* - Supported devices: AVR32 AT32UC3B1256
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
OUTPUT_ARCH(avr32:uc)
ENTRY(_start)
MEMORY
{
FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00040000
INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x00007FFC
USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 0x00000200
}
PHDRS
{
FLASH PT_LOAD;
INTRAM PT_NULL;
USERPAGE PT_LOAD;
FACTORYPAGE PT_LOAD;
}
SECTIONS
{
/* If this heap size is selected, all the INTRAM space from the end of the
data area to the beginning of the stack will be allocated for the heap. */
__max_heap_size__ = -1;
/* Use a default heap size if heap size was not defined. */
__heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
/* Use a default stack size if stack size was not defined. */
__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
/* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
.interp : { *(.interp) } >FLASH AT>FLASH :FLASH
.reset : { *(.reset) } >FLASH AT>FLASH :FLASH
.hash : { *(.hash) } >FLASH AT>FLASH :FLASH
.dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
.dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
.gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
.gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
.gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
.rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
.rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
.rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
.rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
.rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
.rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
.rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
.rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
.rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
.init :
{
KEEP (*(.init))
} >FLASH AT>FLASH :FLASH =0xd703d703
.plt : { *(.plt) } >FLASH AT>FLASH :FLASH
.text :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} >FLASH AT>FLASH :FLASH =0xd703d703
.fini :
{
KEEP (*(.fini))
} >FLASH AT>FLASH :FLASH =0xd703d703
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
.eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
.lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
. = ORIGIN(INTRAM);
.dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :FLASH
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :FLASH
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :FLASH
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
PROVIDE (__preinit_array_start = ALIGN(32 / 8));
.preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__preinit_array_end = .);
PROVIDE (__init_array_start = .);
.init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__init_array_end = .);
PROVIDE (__fini_array_start = .);
.fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__fini_array_end = .);
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} >INTRAM AT>FLASH :FLASH
.dtors :
{
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} >INTRAM AT>FLASH :FLASH
.jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :FLASH
.data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :FLASH
.dynamic : { *(.dynamic) } >INTRAM AT>FLASH :FLASH
.got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :FLASH
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
} >INTRAM AT>FLASH :FLASH
.data1 : { *(.data1) } >INTRAM AT>FLASH :FLASH
.balign : { . = ALIGN(8); _edata = .; } >INTRAM AT>FLASH :FLASH
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(8);
} >INTRAM AT>INTRAM :INTRAM
. = ALIGN(8);
_end = .;
PROVIDE (end = .);
__heap_start__ = ALIGN(8);
.heap :
{
*(.heap)
. = (__heap_size__ == __max_heap_size__) ?
ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
__heap_size__;
} >INTRAM AT>INTRAM :INTRAM
__heap_end__ = .;
/* 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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
{
_stack = .;
*(.stack)
. = __stack_size__;
_estack = .;
} >INTRAM AT>INTRAM :INTRAM
.userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
.factorypage : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE :FACTORYPAGE
/DISCARD/ : { *(.note.GNU-stack) }
}

View file

@ -0,0 +1,138 @@
/******************************************************************************
* AVR32 AT32UC3B1256 XLINK command file for AVR32 IAR C/C++ Compiler.
*
* The assumed memory layout is the one of the AT32UC3B1256:
*
* Start Stop Name Type
* ---------- ---------- ----- --------------
* 0x00000000 0x00007FFF SRAM RAM
* 0x80000000 0x8003FFFF FLASH FLASH
*
* Usage: xlink your_file(s) -f xcl-file libraries
*
* - Compiler: IAR EWAVR32
* - Supported devices: AVR32 AT32UC3B1256
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
/************************************************************************/
/* The following segments are defined in this link file: */
/* */
/* Code segments */
/* CODE32 -- Program code used by __code32 functions. */
/* RESET -- Reset code. */
/* EVSEG -- Exception vector handlers. */
/* */
/* Constant segments */
/* INITTAB -- Segment initializer table. */
/* DIFUNCT -- Dynamic initialization vector used by C++. */
/* SWITCH -- Switch tables. */
/* ACTAB -- Table of pointers to acall functions. */
/* */
/* DATA21_ID -- Initialization data for DATA21_I. */
/* DATA32_ID -- Initialization data for DATA32_I. */
/* DATA32_C -- Constant __data32 data. */
/* */
/* CHECKSUM -- Checksum segment. */
/* */
/* Data segments */
/* DATA21_I -- Initialized __data21 data with non-zero */
/* initial value. */
/* DATA32_I -- Initialized __data32 data with non-zero */
/* initial value. */
/* DATA21_Z -- Initialized __data21 data with zero initial value. */
/* DATA32_Z -- Initialized __data32 data with zero initial value. */
/* DATA21_N -- Non-initialized __data21. */
/* DATA32_N -- Non-initialized __data32. */
/* SSTACK -- The system stack. */
/* CSTACK -- The application stack. */
/* HEAP -- The heap used by malloc and free. */
/* */
/************************************************************************/
/************************************************************************/
/* Define CPU */
/************************************************************************/
-cavr32
// Declare the IPR0 memory location
-DIPR0=FFFF0800
/************************************************************************/
/* Reset code is located at address 0x80000000 and up. */
/************************************************************************/
-Z(CODE)RESET=80000000-8003FFFF
/************************************************************************/
/* The exception handler code is located at address 0x80000000 */
/* and up. Make sure that the exception table gets properly */
/* allocated. By using the special -Z@ allocation primitive, the */
/* placement is guaranteed to be at _EVBASE and onwards. */
/************************************************************************/
-Z@(CODE)EVTAB=80004000-8003FFFF
-Z@(CODE)EV100=80004100-8003FFFF
-P(CODE)EVSEG=80004000-8003FFFF
/************************************************************************/
/* Allocate code and const segments. */
/************************************************************************/
-P(CODE)CODE32=80000000-8003FFFF
-P(CONST)DATA32_C=80000000-8003FFFF
// Initializers
-Z(CONST)INITTAB,DIFUNCT=80000000-8003FFFF
-Z(CONST)CHECKSUM,SWITCH=80000000-8003FFFF
-Z(CONST)DATA21_ID,DATA32_ID=80000000-8003FFFF
-Z(CONST)ACTAB,HTAB=80000000-8003FFFF
/************************************************************************/
/* Allocate the read/write segments that are mapped to RAM. */
/************************************************************************/
-Z(DATA)DATA21_I,DATA21_Z,DATA21_N=00000004-00007FFF
-Z(DATA)DATA32_I,DATA32_Z,DATA32_N=00000004-00007FFF
-Z(DATA)TRACEBUFFER=00000004-00007FFF
-Z(DATA)SSTACK+_SSTACK_SIZE#00000004-00007FFF
-Z(DATA)CSTACK+_CSTACK_SIZE#00000004-00007FFF
-Z(DATA)HEAP+_HEAP_SIZE=00000004-00007FFF
/************************************************************************/
/* End of File */
/************************************************************************/

View file

@ -0,0 +1,263 @@
/******************************************************************************
* AVR32 AT32UC3B164 GNU LD script file.
*
* - Compiler: GNU GCC for AVR32
* - Supported devices: AVR32 AT32UC3B164
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
OUTPUT_ARCH(avr32:uc)
ENTRY(_start)
MEMORY
{
FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00010000
INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x00003FFC
USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 0x00000200
}
PHDRS
{
FLASH PT_LOAD;
INTRAM PT_NULL;
USERPAGE PT_LOAD;
FACTORYPAGE PT_LOAD;
}
SECTIONS
{
/* If this heap size is selected, all the INTRAM space from the end of the
data area to the beginning of the stack will be allocated for the heap. */
__max_heap_size__ = -1;
/* Use a default heap size if heap size was not defined. */
__heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
/* Use a default stack size if stack size was not defined. */
__stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
/* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
.interp : { *(.interp) } >FLASH AT>FLASH :FLASH
.reset : { *(.reset) } >FLASH AT>FLASH :FLASH
.hash : { *(.hash) } >FLASH AT>FLASH :FLASH
.dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
.dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
.gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
.gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
.gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
.rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
.rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
.rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
.rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
.rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
.rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
.rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
.rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
.rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
.rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
.rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
.rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
.init :
{
KEEP (*(.init))
} >FLASH AT>FLASH :FLASH =0xd703d703
.plt : { *(.plt) } >FLASH AT>FLASH :FLASH
.text :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
} >FLASH AT>FLASH :FLASH =0xd703d703
.fini :
{
KEEP (*(.fini))
} >FLASH AT>FLASH :FLASH =0xd703d703
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
.rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
.eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
.lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
. = ORIGIN(INTRAM);
.dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM
/* Exception handling */
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :FLASH
.gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :FLASH
/* Thread Local Storage sections */
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :FLASH
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :FLASH
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
PROVIDE (__preinit_array_start = ALIGN(32 / 8));
.preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__preinit_array_end = .);
PROVIDE (__init_array_start = .);
.init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__init_array_end = .);
PROVIDE (__fini_array_start = .);
.fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :FLASH
PROVIDE (__fini_array_end = .);
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin*.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} >INTRAM AT>FLASH :FLASH
.dtors :
{
KEEP (*crtbegin*.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} >INTRAM AT>FLASH :FLASH
.jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :FLASH
.data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :FLASH
.dynamic : { *(.dynamic) } >INTRAM AT>FLASH :FLASH
.got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :FLASH
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
} >INTRAM AT>FLASH :FLASH
.data1 : { *(.data1) } >INTRAM AT>FLASH :FLASH
.balign : { . = ALIGN(8); _edata = .; } >INTRAM AT>FLASH :FLASH
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(8);
} >INTRAM AT>INTRAM :INTRAM
. = ALIGN(8);
_end = .;
PROVIDE (end = .);
__heap_start__ = ALIGN(8);
.heap :
{
*(.heap)
. = (__heap_size__ == __max_heap_size__) ?
ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
__heap_size__;
} >INTRAM AT>INTRAM :INTRAM
__heap_end__ = .;
/* 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) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
{
_stack = .;
*(.stack)
. = __stack_size__;
_estack = .;
} >INTRAM AT>INTRAM :INTRAM
.userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
.factorypage : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE :FACTORYPAGE
/DISCARD/ : { *(.note.GNU-stack) }
}

View file

@ -0,0 +1,138 @@
/******************************************************************************
* AVR32 AT32UC3B164 XLINK command file for AVR32 IAR C/C++ Compiler.
*
* The assumed memory layout is the one of the AT32UC3B164:
*
* Start Stop Name Type
* ---------- ---------- ----- --------------
* 0x00000000 0x00003FFF SRAM RAM
* 0x80000000 0x8000FFFF FLASH FLASH
*
* Usage: xlink your_file(s) -f xcl-file libraries
*
* - Compiler: IAR EWAVR32
* - Supported devices: AVR32 AT32UC3B164
*
* - author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2007, Atmel Corporation All rights reserved.
*
* 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. The name of ATMEL may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL ``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 EXPRESSLY AND
* SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*/
/************************************************************************/
/* The following segments are defined in this link file: */
/* */
/* Code segments */
/* CODE32 -- Program code used by __code32 functions. */
/* RESET -- Reset code. */
/* EVSEG -- Exception vector handlers. */
/* */
/* Constant segments */
/* INITTAB -- Segment initializer table. */
/* DIFUNCT -- Dynamic initialization vector used by C++. */
/* SWITCH -- Switch tables. */
/* ACTAB -- Table of pointers to acall functions. */
/* */
/* DATA21_ID -- Initialization data for DATA21_I. */
/* DATA32_ID -- Initialization data for DATA32_I. */
/* DATA32_C -- Constant __data32 data. */
/* */
/* CHECKSUM -- Checksum segment. */
/* */
/* Data segments */
/* DATA21_I -- Initialized __data21 data with non-zero */
/* initial value. */
/* DATA32_I -- Initialized __data32 data with non-zero */
/* initial value. */
/* DATA21_Z -- Initialized __data21 data with zero initial value. */
/* DATA32_Z -- Initialized __data32 data with zero initial value. */
/* DATA21_N -- Non-initialized __data21. */
/* DATA32_N -- Non-initialized __data32. */
/* SSTACK -- The system stack. */
/* CSTACK -- The application stack. */
/* HEAP -- The heap used by malloc and free. */
/* */
/************************************************************************/
/************************************************************************/
/* Define CPU */
/************************************************************************/
-cavr32
// Declare the IPR0 memory location
-DIPR0=FFFF0800
/************************************************************************/
/* Reset code is located at address 0x80000000 and up. */
/************************************************************************/
-Z(CODE)RESET=80000000-8000FFFF
/************************************************************************/
/* The exception handler code is located at address 0x80000000 */
/* and up. Make sure that the exception table gets properly */
/* allocated. By using the special -Z@ allocation primitive, the */
/* placement is guaranteed to be at _EVBASE and onwards. */
/************************************************************************/
-Z@(CODE)EVTAB=80004000-8000FFFF
-Z@(CODE)EV100=80004100-8000FFFF
-P(CODE)EVSEG=80004000-8000FFFF
/************************************************************************/
/* Allocate code and const segments. */
/************************************************************************/
-P(CODE)CODE32=80000000-8000FFFF
-P(CONST)DATA32_C=80000000-8000FFFF
// Initializers
-Z(CONST)INITTAB,DIFUNCT=80000000-8000FFFF
-Z(CONST)CHECKSUM,SWITCH=80000000-8000FFFF
-Z(CONST)DATA21_ID,DATA32_ID=80000000-8000FFFF
-Z(CONST)ACTAB,HTAB=80000000-8000FFFF
/************************************************************************/
/* Allocate the read/write segments that are mapped to RAM. */
/************************************************************************/
-Z(DATA)DATA21_I,DATA21_Z,DATA21_N=00000004-00003FFF
-Z(DATA)DATA32_I,DATA32_Z,DATA32_N=00000004-00003FFF
-Z(DATA)TRACEBUFFER=00000004-00003FFF
-Z(DATA)SSTACK+_SSTACK_SIZE#00000004-00003FFF
-Z(DATA)CSTACK+_CSTACK_SIZE#00000004-00003FFF
-Z(DATA)HEAP+_HEAP_SIZE=00000004-00003FFF
/************************************************************************/
/* End of File */
/************************************************************************/

View file

@ -1,5 +1,3 @@
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
@ -9,7 +7,7 @@
* - Supported devices: All AVR32 devices can be used.
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/

View file

@ -1,5 +1,3 @@
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
@ -9,7 +7,7 @@
* - Supported devices: All AVR32 devices can be used.
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/

View file

@ -1,5 +1,3 @@
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
@ -9,7 +7,7 @@
* - Supported devices: All AVR32 devices can be used.
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
@ -47,23 +45,23 @@
/*! \brief Stringize.
*
* Stringize a preprocessing token, this token being allowed to be #defined.
* Stringize a preprocessing token, this token being allowed to be \#defined.
*
* May be used only within macros with the token passed as an argument if the token is #defined.
* May be used only within macros with the token passed as an argument if the token is \#defined.
*
* For example, writing STRINGZ(PIN) within a macro #defined by PIN_NAME(PIN)
* and invoked as PIN_NAME(PIN0) with PIN0 #defined as A0 is equivalent to
* For example, writing STRINGZ(PIN) within a macro \#defined by PIN_NAME(PIN)
* and invoked as PIN_NAME(PIN0) with PIN0 \#defined as A0 is equivalent to
* writing "A0".
*/
#define STRINGZ(x) #x
/*! \brief Absolute stringize.
*
* Stringize a preprocessing token, this token being allowed to be #defined.
* Stringize a preprocessing token, this token being allowed to be \#defined.
*
* No restriction of use if the token is #defined.
* No restriction of use if the token is \#defined.
*
* For example, writing ASTRINGZ(PIN0) anywhere with PIN0 #defined as A0 is
* For example, writing ASTRINGZ(PIN0) anywhere with PIN0 \#defined as A0 is
* equivalent to writing "A0".
*/
#define ASTRINGZ(x) STRINGZ(x)

View file

@ -1,5 +1,3 @@
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
@ -9,7 +7,7 @@
* - Supported devices: All AVR32 devices can be used.
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
@ -47,12 +45,12 @@
/*! \name Token Paste
*
* Paste N preprocessing tokens together, these tokens being allowed to be #defined.
* Paste N preprocessing tokens together, these tokens being allowed to be \#defined.
*
* May be used only within macros with the tokens passed as arguments if the tokens are #defined.
* May be used only within macros with the tokens passed as arguments if the tokens are \#defined.
*
* For example, writing TPASTE2(U, WIDTH) within a macro #defined by
* UTYPE(WIDTH) and invoked as UTYPE(UL_WIDTH) with UL_WIDTH #defined as 32 is
* For example, writing TPASTE2(U, WIDTH) within a macro \#defined by
* UTYPE(WIDTH) and invoked as UTYPE(UL_WIDTH) with UL_WIDTH \#defined as 32 is
* equivalent to writing U32.
*/
//! @{
@ -69,11 +67,11 @@
/*! \name Absolute Token Paste
*
* Paste N preprocessing tokens together, these tokens being allowed to be #defined.
* Paste N preprocessing tokens together, these tokens being allowed to be \#defined.
*
* No restriction of use if the tokens are #defined.
* No restriction of use if the tokens are \#defined.
*
* For example, writing ATPASTE2(U, UL_WIDTH) anywhere with UL_WIDTH #defined
* For example, writing ATPASTE2(U, UL_WIDTH) anywhere with UL_WIDTH \#defined
* as 32 is equivalent to writing U32.
*/
//! @{

View file

@ -1,5 +1,3 @@
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
@ -12,7 +10,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
@ -47,18 +45,10 @@
#ifndef _COMPILER_H_
#define _COMPILER_H_
#if __GNUC__
# include <avr32/io.h>
#elif __ICCAVR32__ || __AAVR32__
# include <avr32/iouc3a0512.h>
# include <avr32/uc3a0512.h>
# if __ICCAVR32__
# include <intrinsics.h>
# endif
#else
# error Unknown compiler
#include <avr32/io.h>
#if __ICCAVR32__
# include <intrinsics.h>
#endif
#include "preprocessor.h"
@ -69,6 +59,22 @@
#include <stddef.h>
#include <stdlib.h>
#if __ICCAVR32__
/*! \name Compiler Keywords
*
* Port of some keywords from GNU GCC for AVR32 to IAR Embedded Workbench for Atmel AVR32.
*/
//! @{
#define __asm__ asm
#define __inline__ inline
#define __volatile__
//! @}
#endif
/*! \name Usual Types
*/
//! @{
@ -85,6 +91,7 @@ typedef float F32; //!< 32-bit floating-point number.
typedef double F64; //!< 64-bit floating-point number.
//! @}
/*! \name Status Types
*/
//! @{
@ -92,19 +99,6 @@ typedef Bool Status_bool_t; //!< Boolean status.
typedef U8 Status_t; //!< 8-bit-coded status.
//! @}
#if __ICCAVR32__
/*! \name Compiler Keywords
*
* Translation of some keywords from GNU GCC for AVR32 to IAR Embedded Workbench for Atmel AVR32.
*/
//! @{
#define __asm__ asm
#define __inline__ inline
#define __volatile__
//! @}
#endif
/*! \name Aliasing Aggregate Types
*/
@ -210,6 +204,7 @@ typedef struct
#endif // __AVR32_ABI_COMPILER__
//_____ M A C R O S ________________________________________________________
/*! \name Usual Constants
@ -233,9 +228,10 @@ typedef struct
#define SET 1
//! @}
#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.
/*! \name Bit-Field Handling Macros
/*! \name Bit-Field Handling
*/
//! @{
@ -316,6 +312,7 @@ typedef struct
//! @}
/*! \brief This macro is used to test fatal errors.
*
* The macro tests if the expression is FALSE. If it is, a fatal error is
@ -332,7 +329,8 @@ typedef struct
#define Assert(expr)
#endif
/*! \name Zero-Bit Counting Macros
/*! \name Zero-Bit Counting
*
* Under AVR32-GCC, __builtin_clz and __builtin_ctz behave like macros when
* applied to constant expressions (values known at compile time), so they are
@ -372,7 +370,8 @@ typedef struct
//! @}
/*! \name Alignment Macros
/*! \name Alignment
*/
//! @{
@ -424,7 +423,8 @@ typedef struct
//! @}
/*! \name Mathematics Macros
/*! \name Mathematics
*
* The same considerations as for clz and ctz apply here but AVR32-GCC does not
* provide built-in functions to access the assembly instructions abs, min and
@ -536,6 +536,7 @@ typedef struct
//! @}
/*! \brief Calls the routine at address \a addr.
*
* It generates a long call opcode.
@ -558,18 +559,39 @@ typedef struct
(\
{\
__asm__ __volatile__ (\
"lda.w r8, _start\n\t"\
"lddpc r9, 1f\n\t"\
"stm --sp, r8-r9\n\t"\
"lddpc r9, 3f\n\t"\
"mfsr r8, %[SR]\n\t"\
"bfextu r8, r8, %[SR_MX_OFFSET], %[SR_MX_SIZE]\n\t"\
"cp.w r8, 0b001\n\t"\
"breq 0f\n\t"\
"sub r8, pc, $ - 1f\n\t"\
"pushm r8-r9\n\t"\
"rete\n"\
"0:\n\t"\
"rets\n\t"\
".balign 4\n"\
"mtsr %[SR], r9\n"\
"1:\n\t"\
"mov r0, 0\n\t"\
"mov r1, 0\n\t"\
"mov r2, 0\n\t"\
"mov r3, 0\n\t"\
"mov r4, 0\n\t"\
"mov r5, 0\n\t"\
"mov r6, 0\n\t"\
"mov r7, 0\n\t"\
"mov r8, 0\n\t"\
"mov r9, 0\n\t"\
"mov r10, 0\n\t"\
"mov r11, 0\n\t"\
"mov r12, 0\n\t"\
"mov sp, 0\n\t"\
"stdsp sp[0], sp\n\t"\
"ldmts sp, sp\n\t"\
"mov lr, 0\n\t"\
"lddpc pc, 2f\n\t"\
".balign 4\n"\
"2:\n\t"\
".word _start\n"\
"3:\n\t"\
".word %[RESET_SR]"\
:\
: [SR] "i" (AVR32_SR),\
@ -584,81 +606,44 @@ typedef struct
{\
extern void *volatile __program_start;\
__asm__ __volatile__ (\
"mov r8, LWRD(__program_start)\n\t"\
"orh r8, HWRD(__program_start)\n\t"\
"mov r7, LWRD(__program_start)\n\t"\
"orh r7, HWRD(__program_start)\n\t"\
"mov r9, LWRD("ASTRINGZ(AVR32_SR_GM_MASK | AVR32_SR_EM_MASK | AVR32_SR_M0_MASK)")\n\t"\
"orh r9, HWRD("ASTRINGZ(AVR32_SR_GM_MASK | AVR32_SR_EM_MASK | AVR32_SR_M0_MASK)")\n\t"\
"stm --sp, r8-r9\n\t"\
"mfsr r8, "ASTRINGZ(AVR32_SR)"\n\t"\
"bfextu r8, r8, "ASTRINGZ(AVR32_SR_M0_OFFSET)", "ASTRINGZ(AVR32_SR_M0_SIZE + AVR32_SR_M1_SIZE + AVR32_SR_M2_SIZE)"\n\t"\
"cp.w r8, 001b\n\t"\
"breq $ + 4\n\t"\
"breq $ + 10\n\t"\
"sub r8, pc, -12\n\t"\
"pushm r8-r9\n\t"\
"rete\n\t"\
"rets"\
"mtsr "ASTRINGZ(AVR32_SR)", r9\n\t"\
"mov r0, 0\n\t"\
"mov r1, 0\n\t"\
"mov r2, 0\n\t"\
"mov r3, 0\n\t"\
"mov r4, 0\n\t"\
"mov r5, 0\n\t"\
"mov r6, 0\n\t"\
"st.w r0[4], r7\n\t"\
"mov r7, 0\n\t"\
"mov r8, 0\n\t"\
"mov r9, 0\n\t"\
"mov r10, 0\n\t"\
"mov r11, 0\n\t"\
"mov r12, 0\n\t"\
"mov sp, 0\n\t"\
"stdsp sp[0], sp\n\t"\
"ldmts sp, sp\n\t"\
"mov lr, 0\n\t"\
"ld.w pc, lr[4]"\
);\
__program_start;\
}
}
#endif
/*! \name CPU Status Register Macros
*/
//! @{
/*! \brief Disables all exceptions.
*/
#if __GNUC__
#define Disable_global_exception() ({__asm__ __volatile__ ("ssrf\t%0" : : "i" (AVR32_SR_EM_OFFSET));})
#elif __ICCAVR32__
#define Disable_global_exception() (__set_status_flag(AVR32_SR_EM_OFFSET))
#endif
/*! \brief Enables all exceptions.
*/
#if __GNUC__
#define Enable_global_exception() ({__asm__ __volatile__ ("csrf\t%0" : : "i" (AVR32_SR_EM_OFFSET));})
#elif __ICCAVR32__
#define Enable_global_exception() (__clear_status_flag(AVR32_SR_EM_OFFSET))
#endif
/*! \brief Disables all interrupts.
*/
#if __GNUC__
#define Disable_global_interrupt() ({__asm__ __volatile__ ("ssrf\t%0\n\tnop\n\tnop" : : "i" (AVR32_SR_GM_OFFSET));})
#elif __ICCAVR32__
#define Disable_global_interrupt() {__asm__ __volatile__ ("ssrf\t"ASTRINGZ(AVR32_SR_GM_OFFSET)"\n\tnop\n\tnop");}
#endif
/*! \brief Enables all interrupts.
*/
#if __GNUC__
#define Enable_global_interrupt() ({__asm__ __volatile__ ("csrf\t%0" : : "i" (AVR32_SR_GM_OFFSET));})
#elif __ICCAVR32__
#define Enable_global_interrupt() (__enable_interrupt())
#endif
/*! \brief Disables interrupt level \a int_lev.
*
* \param int_lev Interrupt level to disable (0 to 3).
*/
#if __GNUC__
#define Disable_interrupt_level(int_lev) ({__asm__ __volatile__ ("ssrf\t%0\n\tnop\n\tnop" : : "i" (TPASTE3(AVR32_SR_I, int_lev, M_OFFSET)));})
#elif __ICCAVR32__
#define Disable_interrupt_level(int_lev) {__asm__ __volatile__ ("ssrf\t"ASTRINGZ(TPASTE3(AVR32_SR_I, int_lev, M_OFFSET))"\n\tnop\n\tnop");}
#endif
/*! \brief Enables interrupt level \a int_lev.
*
* \param int_lev Interrupt level to enable (0 to 3).
*/
#if __GNUC__
#define Enable_interrupt_level(int_lev) ({__asm__ __volatile__ ("csrf\t%0" : : "i" (TPASTE3(AVR32_SR_I, int_lev, M_OFFSET)));})
#elif __ICCAVR32__
#define Enable_interrupt_level(int_lev) (__clear_status_flag(TPASTE3(AVR32_SR_I, int_lev, M_OFFSET)))
#endif
//! @}
/*! \name System Register Access Macros
/*! \name System Register Access
*/
//! @{
@ -687,8 +672,88 @@ typedef struct
//! @}
/*! \name CPU Status Register Access
*/
//! @{
/*! \brief Tells whether exceptions are globally enabled.
*
* \return \c 1 if exceptions are globally enabled, else \c 0.
*/
#define Is_global_exception_enabled() (!Tst_bits(Get_system_register(AVR32_SR), AVR32_SR_EM_MASK))
/*! \brief Disables exceptions globally.
*/
#if __GNUC__
#define Disable_global_exception() ({__asm__ __volatile__ ("ssrf\t%0" : : "i" (AVR32_SR_EM_OFFSET));})
#elif __ICCAVR32__
#define Disable_global_exception() (__set_status_flag(AVR32_SR_EM_OFFSET))
#endif
/*! \brief Enables exceptions globally.
*/
#if __GNUC__
#define Enable_global_exception() ({__asm__ __volatile__ ("csrf\t%0" : : "i" (AVR32_SR_EM_OFFSET));})
#elif __ICCAVR32__
#define Enable_global_exception() (__clear_status_flag(AVR32_SR_EM_OFFSET))
#endif
/*! \brief Tells whether interrupts are globally enabled.
*
* \return \c 1 if interrupts are globally enabled, else \c 0.
*/
#define Is_global_interrupt_enabled() (!Tst_bits(Get_system_register(AVR32_SR), AVR32_SR_GM_MASK))
/*! \brief Disables interrupts globally.
*/
#if __GNUC__
#define Disable_global_interrupt() ({__asm__ __volatile__ ("ssrf\t%0\n\tnop\n\tnop" : : "i" (AVR32_SR_GM_OFFSET));})
#elif __ICCAVR32__
#define Disable_global_interrupt() {__asm__ __volatile__ ("ssrf\t"ASTRINGZ(AVR32_SR_GM_OFFSET)"\n\tnop\n\tnop");}
#endif
/*! \brief Enables interrupts globally.
*/
#if __GNUC__
#define Enable_global_interrupt() ({__asm__ __volatile__ ("csrf\t%0" : : "i" (AVR32_SR_GM_OFFSET));})
#elif __ICCAVR32__
#define Enable_global_interrupt() (__enable_interrupt())
#endif
/*! \brief Tells whether interrupt level \a int_lev is enabled.
*
* \param int_lev Interrupt level (0 to 3).
*
* \return \c 1 if interrupt level \a int_lev is enabled, else \c 0.
*/
#define Is_interrupt_level_enabled(int_lev) (!Tst_bits(Get_system_register(AVR32_SR), TPASTE3(AVR32_SR_I, int_lev, M_MASK)))
/*! \brief Disables interrupt level \a int_lev.
*
* \param int_lev Interrupt level to disable (0 to 3).
*/
#if __GNUC__
#define Disable_interrupt_level(int_lev) ({__asm__ __volatile__ ("ssrf\t%0\n\tnop\n\tnop" : : "i" (TPASTE3(AVR32_SR_I, int_lev, M_OFFSET)));})
#elif __ICCAVR32__
#define Disable_interrupt_level(int_lev) {__asm__ __volatile__ ("ssrf\t"ASTRINGZ(TPASTE3(AVR32_SR_I, int_lev, M_OFFSET))"\n\tnop\n\tnop");}
#endif
/*! \brief Enables interrupt level \a int_lev.
*
* \param int_lev Interrupt level to enable (0 to 3).
*/
#if __GNUC__
#define Enable_interrupt_level(int_lev) ({__asm__ __volatile__ ("csrf\t%0" : : "i" (TPASTE3(AVR32_SR_I, int_lev, M_OFFSET)));})
#elif __ICCAVR32__
#define Enable_interrupt_level(int_lev) (__clear_status_flag(TPASTE3(AVR32_SR_I, int_lev, M_OFFSET)))
#endif
//! @}
#endif // __AVR32_ABI_COMPILER__
//! Boolean evaluating MCU little endianism.
#if (__GNUC__ && __AVR32__) || (__ICCAVR32__ || __AAVR32__)
#define LITTLE_ENDIAN_MCU FALSE
@ -702,34 +767,39 @@ typedef struct
//! Boolean evaluating MCU big endianism.
#define BIG_ENDIAN_MCU (!LITTLE_ENDIAN_MCU)
#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.
/*! \name U16/U32/U64 MCU Endianism Handling Macros
/*! \name MCU Endianism Handling
*/
//! @{
#if LITTLE_ENDIAN_MCU
#define LSB(u16) (((U8 *)&(u16))[0]) //!< Least significant byte of \a u16.
#define MSB(u16) (((U8 *)&(u16))[1]) //!< Most significant byte of \a u16.
#define LSH(u32) (((U16 *)&(u32))[0]) //!< Least significant half-word of \a u32.
#define MSH(u32) (((U16 *)&(u32))[1]) //!< Most significant half-word of \a u32.
#define LSB0W(u32) (((U8 *)&(u32))[0]) //!< Least significant byte of 1st rank of \a u32.
#define LSB1W(u32) (((U8 *)&(u32))[1]) //!< Least significant byte of 2nd rank of \a u32.
#define LSB2W(u32) (((U8 *)&(u32))[2]) //!< Least significant byte of 3rd rank of \a u32.
#define LSB3W(u32) (((U8 *)&(u32))[3]) //!< Least significant byte of 4th rank of \a u32.
#define MSB3W(u32) LSB0W(u32) //!< Most significant byte of 1st rank of \a u32.
#define MSB2W(u32) LSB1W(u32) //!< Most significant byte of 2nd rank of \a u32.
#define MSB1W(u32) LSB2W(u32) //!< Most significant byte of 3rd rank of \a u32.
#define MSB0W(u32) LSB3W(u32) //!< Most significant byte of 4th rank of \a u32.
#define MSB3W(u32) LSB0W(u32) //!< Most significant byte of 4th rank of \a u32.
#define MSB2W(u32) LSB1W(u32) //!< Most significant byte of 3rd rank of \a u32.
#define MSB1W(u32) LSB2W(u32) //!< Most significant byte of 2nd rank of \a u32.
#define MSB0W(u32) LSB3W(u32) //!< Most significant byte of 1st rank of \a u32.
#define LSW(u64) (((U32 *)&(u64))[0]) //!< Least significant word of \a u64.
#define MSW(u64) (((U32 *)&(u64))[1]) //!< Most significant word of \a u64.
#define LSH0(u64) (((U16 *)&(u64))[0]) //!< Least significant half-word of 1st rank of \a u64.
#define LSH1(u64) (((U16 *)&(u64))[1]) //!< Least significant half-word of 2nd rank of \a u64.
#define LSH2(u64) (((U16 *)&(u64))[2]) //!< Least significant half-word of 3rd rank of \a u64.
#define LSH3(u64) (((U16 *)&(u64))[3]) //!< Least significant half-word of 4th rank of \a u64.
#define MSH3(u64) LSH0(u64) //!< Most significant half-word of 1st rank of \a u64.
#define MSH2(u64) LSH1(u64) //!< Most significant half-word of 2nd rank of \a u64.
#define MSH1(u64) LSH2(u64) //!< Most significant half-word of 3rd rank of \a u64.
#define MSH0(u64) LSH3(u64) //!< Most significant half-word of 4th rank of \a u64.
#define MSH3(u64) LSH0(u64) //!< Most significant half-word of 4th rank of \a u64.
#define MSH2(u64) LSH1(u64) //!< Most significant half-word of 3rd rank of \a u64.
#define MSH1(u64) LSH2(u64) //!< Most significant half-word of 2nd rank of \a u64.
#define MSH0(u64) LSH3(u64) //!< Most significant half-word of 1st rank of \a u64.
#define LSB0D(u64) (((U8 *)&(u64))[0]) //!< Least significant byte of 1st rank of \a u64.
#define LSB1D(u64) (((U8 *)&(u64))[1]) //!< Least significant byte of 2nd rank of \a u64.
#define LSB2D(u64) (((U8 *)&(u64))[2]) //!< Least significant byte of 3rd rank of \a u64.
@ -738,37 +808,41 @@ typedef struct
#define LSB5D(u64) (((U8 *)&(u64))[5]) //!< Least significant byte of 6th rank of \a u64.
#define LSB6D(u64) (((U8 *)&(u64))[6]) //!< Least significant byte of 7th rank of \a u64.
#define LSB7D(u64) (((U8 *)&(u64))[7]) //!< Least significant byte of 8th rank of \a u64.
#define MSB7D(u64) LSB0D(u64) //!< Most significant byte of 1st rank of \a u64.
#define MSB6D(u64) LSB1D(u64) //!< Most significant byte of 2nd rank of \a u64.
#define MSB5D(u64) LSB2D(u64) //!< Most significant byte of 3rd rank of \a u64.
#define MSB4D(u64) LSB3D(u64) //!< Most significant byte of 4th rank of \a u64.
#define MSB3D(u64) LSB4D(u64) //!< Most significant byte of 5th rank of \a u64.
#define MSB2D(u64) LSB5D(u64) //!< Most significant byte of 6th rank of \a u64.
#define MSB1D(u64) LSB6D(u64) //!< Most significant byte of 7th rank of \a u64.
#define MSB0D(u64) LSB7D(u64) //!< Most significant byte of 8th rank of \a u64.
#define MSB7D(u64) LSB0D(u64) //!< Most significant byte of 8th rank of \a u64.
#define MSB6D(u64) LSB1D(u64) //!< Most significant byte of 7th rank of \a u64.
#define MSB5D(u64) LSB2D(u64) //!< Most significant byte of 6th rank of \a u64.
#define MSB4D(u64) LSB3D(u64) //!< Most significant byte of 5th rank of \a u64.
#define MSB3D(u64) LSB4D(u64) //!< Most significant byte of 4th rank of \a u64.
#define MSB2D(u64) LSB5D(u64) //!< Most significant byte of 3rd rank of \a u64.
#define MSB1D(u64) LSB6D(u64) //!< Most significant byte of 2nd rank of \a u64.
#define MSB0D(u64) LSB7D(u64) //!< Most significant byte of 1st rank of \a u64.
#else // BIG_ENDIAN_MCU
#define MSB(u16) (((U8 *)&(u16))[0]) //!< Most significant byte of \a u16.
#define LSB(u16) (((U8 *)&(u16))[1]) //!< Least significant byte of \a u16.
#define MSH(u32) (((U16 *)&(u32))[0]) //!< Most significant half-word of \a u32.
#define LSH(u32) (((U16 *)&(u32))[1]) //!< Least significant half-word of \a u32.
#define MSB0W(u32) (((U8 *)&(u32))[0]) //!< Most significant byte of 1st rank of \a u32.
#define MSB1W(u32) (((U8 *)&(u32))[1]) //!< Most significant byte of 2nd rank of \a u32.
#define MSB2W(u32) (((U8 *)&(u32))[2]) //!< Most significant byte of 3rd rank of \a u32.
#define MSB3W(u32) (((U8 *)&(u32))[3]) //!< Most significant byte of 4th rank of \a u32.
#define LSB3W(u32) MSB0W(u32) //!< Least significant byte of 1st rank of \a u32.
#define LSB2W(u32) MSB1W(u32) //!< Least significant byte of 2nd rank of \a u32.
#define LSB1W(u32) MSB2W(u32) //!< Least significant byte of 3rd rank of \a u32.
#define LSB0W(u32) MSB3W(u32) //!< Least significant byte of 4th rank of \a u32.
#define LSB3W(u32) MSB0W(u32) //!< Least significant byte of 4th rank of \a u32.
#define LSB2W(u32) MSB1W(u32) //!< Least significant byte of 3rd rank of \a u32.
#define LSB1W(u32) MSB2W(u32) //!< Least significant byte of 2nd rank of \a u32.
#define LSB0W(u32) MSB3W(u32) //!< Least significant byte of 1st rank of \a u32.
#define MSW(u64) (((U32 *)&(u64))[0]) //!< Most significant word of \a u64.
#define LSW(u64) (((U32 *)&(u64))[1]) //!< Least significant word of \a u64.
#define MSH0(u64) (((U16 *)&(u64))[0]) //!< Most significant half-word of 1st rank of \a u64.
#define MSH1(u64) (((U16 *)&(u64))[1]) //!< Most significant half-word of 2nd rank of \a u64.
#define MSH2(u64) (((U16 *)&(u64))[2]) //!< Most significant half-word of 3rd rank of \a u64.
#define MSH3(u64) (((U16 *)&(u64))[3]) //!< Most significant half-word of 4th rank of \a u64.
#define LSH3(u64) MSH0(u64) //!< Least significant half-word of 1st rank of \a u64.
#define LSH2(u64) MSH1(u64) //!< Least significant half-word of 2nd rank of \a u64.
#define LSH1(u64) MSH2(u64) //!< Least significant half-word of 3rd rank of \a u64.
#define LSH0(u64) MSH3(u64) //!< Least significant half-word of 4th rank of \a u64.
#define LSH3(u64) MSH0(u64) //!< Least significant half-word of 4th rank of \a u64.
#define LSH2(u64) MSH1(u64) //!< Least significant half-word of 3rd rank of \a u64.
#define LSH1(u64) MSH2(u64) //!< Least significant half-word of 2nd rank of \a u64.
#define LSH0(u64) MSH3(u64) //!< Least significant half-word of 1st rank of \a u64.
#define MSB0D(u64) (((U8 *)&(u64))[0]) //!< Most significant byte of 1st rank of \a u64.
#define MSB1D(u64) (((U8 *)&(u64))[1]) //!< Most significant byte of 2nd rank of \a u64.
#define MSB2D(u64) (((U8 *)&(u64))[2]) //!< Most significant byte of 3rd rank of \a u64.
@ -777,18 +851,21 @@ typedef struct
#define MSB5D(u64) (((U8 *)&(u64))[5]) //!< Most significant byte of 6th rank of \a u64.
#define MSB6D(u64) (((U8 *)&(u64))[6]) //!< Most significant byte of 7th rank of \a u64.
#define MSB7D(u64) (((U8 *)&(u64))[7]) //!< Most significant byte of 8th rank of \a u64.
#define LSB7D(u64) MSB0D(u64) //!< Least significant byte of 1st rank of \a u64.
#define LSB6D(u64) MSB1D(u64) //!< Least significant byte of 2nd rank of \a u64.
#define LSB5D(u64) MSB2D(u64) //!< Least significant byte of 3rd rank of \a u64.
#define LSB4D(u64) MSB3D(u64) //!< Least significant byte of 4th rank of \a u64.
#define LSB3D(u64) MSB4D(u64) //!< Least significant byte of 5th rank of \a u64.
#define LSB2D(u64) MSB5D(u64) //!< Least significant byte of 6th rank of \a u64.
#define LSB1D(u64) MSB6D(u64) //!< Least significant byte of 7th rank of \a u64.
#define LSB0D(u64) MSB7D(u64) //!< Least significant byte of 8th rank of \a u64.
#define LSB7D(u64) MSB0D(u64) //!< Least significant byte of 8th rank of \a u64.
#define LSB6D(u64) MSB1D(u64) //!< Least significant byte of 7th rank of \a u64.
#define LSB5D(u64) MSB2D(u64) //!< Least significant byte of 6th rank of \a u64.
#define LSB4D(u64) MSB3D(u64) //!< Least significant byte of 5th rank of \a u64.
#define LSB3D(u64) MSB4D(u64) //!< Least significant byte of 4th rank of \a u64.
#define LSB2D(u64) MSB5D(u64) //!< Least significant byte of 3rd rank of \a u64.
#define LSB1D(u64) MSB6D(u64) //!< Least significant byte of 2nd rank of \a u64.
#define LSB0D(u64) MSB7D(u64) //!< Least significant byte of 1st rank of \a u64.
#endif
//! @}
/*! \name Endianism Conversion Macros
/*! \name Endianism Conversion
*
* The same considerations as for clz and ctz apply here but AVR32-GCC's
* __builtin_bswap_16 and __builtin_bswap_32 do not behave like macros when
@ -874,6 +951,35 @@ typedef struct
//! @}
/*! \name Target Abstraction
*/
//! @{
#define _GLOBEXT_ extern //!< extern storage-class specifier.
#define _CONST_TYPE_ const //!< const type qualifier.
#define _MEM_TYPE_SLOW_ //!< Slow memory type.
#define _MEM_TYPE_MEDFAST_ //!< Fairly fast memory type.
#define _MEM_TYPE_FAST_ //!< Fast memory type.
typedef U8 Byte; //!< 8-bit unsigned integer.
#define memcmp_ram2ram memcmp //!< Target-specific memcmp of RAM to RAM.
#define memcmp_code2ram memcmp //!< Target-specific memcmp of RAM to NVRAM.
#define memcpy_ram2ram memcpy //!< Target-specific memcpy from RAM to RAM.
#define memcpy_code2ram memcpy //!< Target-specific memcpy from NVRAM to RAM.
#define LSB0(u32) LSB0W(u32) //!< Least significant byte of 1st rank of \a u32.
#define LSB1(u32) LSB1W(u32) //!< Least significant byte of 2nd rank of \a u32.
#define LSB2(u32) LSB2W(u32) //!< Least significant byte of 3rd rank of \a u32.
#define LSB3(u32) LSB3W(u32) //!< Least significant byte of 4th rank of \a u32.
#define MSB3(u32) MSB3W(u32) //!< Most significant byte of 4th rank of \a u32.
#define MSB2(u32) MSB2W(u32) //!< Most significant byte of 3rd rank of \a u32.
#define MSB1(u32) MSB1W(u32) //!< Most significant byte of 2nd rank of \a u32.
#define MSB0(u32) MSB0W(u32) //!< Most significant byte of 1st rank of \a u32.
//! @}
#endif // __AVR32_ABI_COMPILER__

View file

@ -8,7 +8,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
@ -68,5 +68,5 @@
* For further information, visit
* <A href="http://www.atmel.com/products/AVR32/" >Atmel AVR32</A>. and
* <A href="http://www.freertos.org/" >FreeRTOS home page</A>.\n
* Support e-mail address: avr32@atmel.com.
* Support and FAQ: http://support.atmel.no/
*/

View file

@ -138,7 +138,7 @@
//! @{
#define mainMEM_CHECK_SIZE_1 ( ( size_t ) 51 )
#define mainMEM_CHECK_SIZE_2 ( ( size_t ) 52 )
#define mainMEM_CHECK_SIZE_3 ( ( size_t ) 151 )
#define mainMEM_CHECK_SIZE_3 ( ( size_t ) 15 )
//! @}

View file

@ -1,5 +1,3 @@
/* This source file is part of the ATMEL FREERTOS-0.9.0 Release */
/*This file has been prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
@ -10,7 +8,7 @@
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support email: avr32@atmel.com
* Support and FAQ: http://support.atmel.no/
*
*****************************************************************************/
@ -43,7 +41,7 @@
/*
BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR USART0.
BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR USART.
*/
/* Scheduler includes. */
@ -53,15 +51,7 @@
/* Demo application includes. */
#include "serial.h"
#if __GNUC__
#include <avr32/io.h>
#elif __ICCAVR32__
#include <avr32/iouc3a0512.h>
#else
#error Unknown compiler
#endif
#include <avr32/io.h>
#include "board.h"
#include "gpio.h"
@ -95,17 +85,17 @@ static void vprvSerialCreateQueues( unsigned portBASE_TYPE uxQueueLength,
#pragma optimize = no_inline
#endif
static portBASE_TYPE prvUSART0_ISR_NonNakedBehaviour( void )
static portBASE_TYPE prvUSART_ISR_NonNakedBehaviour( void )
{
/* Now we can declare the local variables. */
signed portCHAR cChar;
portBASE_TYPE xTaskWokenByTx = pdFALSE, xTaskWokenByRx = pdFALSE;
unsigned portLONG ulStatus;
volatile avr32_usart_t *usart0 = &AVR32_USART0;
volatile avr32_usart_t *usart = serialPORT_USART;
portBASE_TYPE retstatus;
/* What caused the interrupt? */
ulStatus = usart0->csr & usart0->imr;
ulStatus = usart->csr & usart->imr;
if (ulStatus & AVR32_USART_CSR_TXRDY_MASK)
{
@ -121,19 +111,19 @@ static portBASE_TYPE prvUSART0_ISR_NonNakedBehaviour( void )
{
/* A character was retrieved from the queue so can be sent to the
THR now. */
usart0->thr = cChar;
usart->thr = cChar;
}
else
{
/* Queue empty, nothing to send so turn off the Tx interrupt. */
usart0->idr = AVR32_USART_IDR_TXRDY_MASK;
usart->idr = AVR32_USART_IDR_TXRDY_MASK;
}
}
if (ulStatus & AVR32_USART_CSR_RXRDY_MASK)
{
/* The interrupt was caused by the receiver getting data. */
cChar = usart0->rhr; //TODO
cChar = usart->rhr; //TODO
/* Because FreeRTOS is not supposed to run with nested interrupts, put all OS
calls in a critical section . */
@ -154,7 +144,7 @@ static portBASE_TYPE prvUSART0_ISR_NonNakedBehaviour( void )
/*-----------------------------------------------------------*/
/*
* USART0 interrupt service routine.
* USART interrupt service routine.
*/
#if __GNUC__
__attribute__((__naked__))
@ -162,15 +152,15 @@ static portBASE_TYPE prvUSART0_ISR_NonNakedBehaviour( void )
#pragma shadow_registers = full // Naked.
#endif
static void vUSART0_ISR( void )
static void vUSART_ISR( void )
{
/* This ISR can cause a context switch, so the first statement must be a
call to the portENTER_SWITCHING_ISR() macro. This must be BEFORE any
variable declarations. */
portENTER_SWITCHING_ISR();
prvUSART0_ISR_NonNakedBehaviour();
prvUSART_ISR_NonNakedBehaviour();
/* Exit the ISR. If a task was woken by either a character being received
or transmitted then a context switch will occur. */
portEXIT_SWITCHING_ISR();
@ -183,14 +173,20 @@ static void vUSART0_ISR( void )
*/
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
static const gpio_map_t USART_GPIO_MAP =
{
{ serialPORT_USART_RX_PIN, serialPORT_USART_RX_FUNCTION },
{ serialPORT_USART_TX_PIN, serialPORT_USART_TX_FUNCTION }
};
xComPortHandle xReturn = serHANDLE;
volatile avr32_usart_t *usart0 = &AVR32_USART0;
int cd; /* USART0 Clock Divider. */
volatile avr32_usart_t *usart = serialPORT_USART;
int cd; /* USART Clock Divider. */
/* Create the rx and tx queues. */
vprvSerialCreateQueues( uxQueueLength, &xRxedChars, &xCharsForTx );
/* Configure USART0. */
/* Configure USART. */
if( ( xRxedChars != serINVALID_QUEUE ) &&
( xCharsForTx != serINVALID_QUEUE ) &&
( ulWantedBaud != ( unsigned portLONG ) 0 ) )
@ -198,20 +194,20 @@ int cd; /* USART0 Clock Divider. */
portENTER_CRITICAL();
{
/**
** Reset USART0.
** Reset USART.
**/
/* Disable all USART0 interrupt sources to begin... */
usart0->idr = 0xFFFFFFFF;
/* Disable all USART interrupt sources to begin... */
usart->idr = 0xFFFFFFFF;
/* Reset mode and other registers that could cause unpredictable
behaviour after reset */
usart0->mr = 0; /* Reset Mode register. */
usart0->rtor = 0; /* Reset Receiver Time-out register. */
usart0->ttgr = 0; /* Reset Transmitter Timeguard register. */
usart->mr = 0; /* Reset Mode register. */
usart->rtor = 0; /* Reset Receiver Time-out register. */
usart->ttgr = 0; /* Reset Transmitter Timeguard register. */
/* Shutdown RX and TX, reset status bits, reset iterations in CSR, reset NACK
and turn off DTR and RTS */
usart0->cr = AVR32_USART_CR_RSTRX_MASK |
usart->cr = AVR32_USART_CR_RSTRX_MASK |
AVR32_USART_CR_RSTTX_MASK |
AVR32_USART_CR_RXDIS_MASK |
AVR32_USART_CR_TXDIS_MASK |
@ -222,13 +218,12 @@ int cd; /* USART0 Clock Divider. */
AVR32_USART_CR_RTSDIS_MASK;
/**
** Configure USART0.
** Configure USART.
**/
/* Enable USART0 RXD & TXD pins. */
gpio_enable_module_pin(AVR32_USART0_RXD_0_PIN, AVR32_USART0_RXD_0_FUNCTION);
gpio_enable_module_pin(AVR32_USART0_TXD_0_PIN, AVR32_USART0_TXD_0_FUNCTION);
/* Enable USART RXD & TXD pins. */
gpio_enable_module( USART_GPIO_MAP, sizeof( USART_GPIO_MAP ) / sizeof( USART_GPIO_MAP[0] ) );
/* Set the USART0 baudrate to be as close as possible to the wanted baudrate. */
/* Set the USART baudrate to be as close as possible to the wanted baudrate. */
/*
* ** BAUDRATE CALCULATION **
*
@ -242,52 +237,52 @@ int cd; /* USART0 Clock Divider. */
if( ulWantedBaud < ( configCPU_CLOCK_HZ / 16 ) )
{
/* Use 8x oversampling */
usart0->mr |= (1<<AVR32_USART_MR_OVER_OFFSET);
usart->mr |= (1<<AVR32_USART_MR_OVER_OFFSET);
cd = configCPU_CLOCK_HZ / (8*ulWantedBaud);
if( cd < 2 )
if( cd < 2 )
{
return serINVALID_COMPORT_HANDLER;
}
usart0->brgr = (cd << AVR32_USART_BRGR_CD_OFFSET);
}
else
usart->brgr = (cd << AVR32_USART_BRGR_CD_OFFSET);
}
else
{
/* Use 16x oversampling */
usart0->mr &= ~(1<<AVR32_USART_MR_OVER_OFFSET);
usart->mr &= ~(1<<AVR32_USART_MR_OVER_OFFSET);
cd = configCPU_CLOCK_HZ / (16*ulWantedBaud);
if( cd > 65535 )
if( cd > 65535 )
{
/* Baudrate is too low */
return serINVALID_COMPORT_HANDLER;
}
}
usart0->brgr = (cd << AVR32_USART_BRGR_CD_OFFSET);
usart->brgr = (cd << AVR32_USART_BRGR_CD_OFFSET);
/* Set the USART0 Mode register: Mode=Normal(0), Clk selection=MCK(0),
/* Set the USART Mode register: Mode=Normal(0), Clk selection=MCK(0),
CHRL=8, SYNC=0(asynchronous), PAR=None, NBSTOP=1, CHMODE=0, MSBF=0,
MODE9=0, CKLO=0, OVER(previously done when setting the baudrate),
other fields not used in this mode. */
usart0->mr |= ((8-5) << AVR32_USART_MR_CHRL_OFFSET ) |
usart->mr |= ((8-5) << AVR32_USART_MR_CHRL_OFFSET ) |
( 4 << AVR32_USART_MR_PAR_OFFSET ) |
( 1 << AVR32_USART_MR_NBSTOP_OFFSET);
/* Write the Transmit Timeguard Register */
usart0->ttgr = 0;
usart->ttgr = 0;
/* Register the USART0 interrupt handler to the interrupt controller and
enable the USART0 interrupt. */
INTC_register_interrupt((__int_handler)&vUSART0_ISR, AVR32_USART0_IRQ, INT1);
/* Enable USART0 interrupt sources (but not Tx for now)... */
usart0->ier = AVR32_USART_IER_RXRDY_MASK;
/* Register the USART interrupt handler to the interrupt controller and
enable the USART interrupt. */
INTC_register_interrupt((__int_handler)&vUSART_ISR, serialPORT_USART_IRQ, INT1);
/* Enable USART interrupt sources (but not Tx for now)... */
usart->ier = AVR32_USART_IER_RXRDY_MASK;
/* Enable receiver and transmitter... */
usart0->cr |= AVR32_USART_CR_TXEN_MASK | AVR32_USART_CR_RXEN_MASK;
usart->cr |= AVR32_USART_CR_TXEN_MASK | AVR32_USART_CR_RXEN_MASK;
}
portEXIT_CRITICAL();
}
@ -340,7 +335,7 @@ signed portCHAR *pxNext;
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
{
volatile avr32_usart_t *usart0 = &AVR32_USART0;
volatile avr32_usart_t *usart = serialPORT_USART;
/* Place the character in the queue of characters to be transmitted. */
if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )
@ -352,7 +347,7 @@ volatile avr32_usart_t *usart0 = &AVR32_USART0;
queue and send it. This does not need to be in a critical section as
if the interrupt has already removed the character the next interrupt
will simply turn off the Tx interrupt again. */
usart0->ier = (1 << AVR32_USART_IER_TXRDY_OFFSET);
usart->ier = (1 << AVR32_USART_IER_TXRDY_OFFSET);
return pdPASS;
}