projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update the incomplete StandaloneProgrammer project to be compatible with the latest...
[pub/USBasp.git]
/
Bootloaders
/
CDC
/
makefile
diff --git
a/Bootloaders/CDC/makefile
b/Bootloaders/CDC/makefile
index
494381e
..
6598226
100644
(file)
--- a/
Bootloaders/CDC/makefile
+++ b/
Bootloaders/CDC/makefile
@@
-35,7
+35,7
@@
# make doxygen = Generate DoxyGen documentation for the project (must have
# DoxyGen installed)
#
# make doxygen = Generate DoxyGen documentation for the project (must have
# DoxyGen installed)
#
-# make debug = Start either simulavr or avarice as specified for debugging,
+# make debug = Start either simulavr or avarice as specified for debugging,
# with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
# with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
@@
-51,20
+51,24
@@
MCU = at90usb1287
MCU = at90usb1287
+# Target architecture (see library "Board Types" documentation).
+ARCH = AVR8
+
+
# Target board (see library "Board Types" documentation, NONE for projects not requiring
# Target board (see library "Board Types" documentation, NONE for projects not requiring
-# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
+# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
# "Board" inside the application directory.
# "Board" inside the application directory.
-BOARD
= USBKEY
+BOARD = USBKEY
# Processor frequency.
# Processor frequency.
-# This will define a symbol, F_CPU, in all source code files equal to the
-# processor frequency in Hz. You can then use this symbol in your source code to
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
-# This will be an integer division of F_
CLOCK
below, as it is sourced by
-# F_
CLOCK
after it has run through any CPU prescalers. Note that this value
+# This will be an integer division of F_
USB
below, as it is sourced by
+# F_
USB
after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
@@
-72,7
+76,7
@@
F_CPU = 8000000
# Input clock frequency.
# Input clock frequency.
-# This will define a symbol, F_
CLOCK, in all source code files equal to the
+# This will define a symbol, F_
USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
@@
-82,15
+86,18
@@
F_CPU = 8000000
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
-F_
CLOCK
= $(F_CPU)
+F_
USB
= $(F_CPU)
# Starting byte address of the bootloader, as a byte address - computed via the formula
# Starting byte address of the bootloader, as a byte address - computed via the formula
-# BOOT_START = ((
TOTAL_FLASH_BYTES - BOOTLOADER_SECTION_SIZE_BYTES
) * 1024)
+# BOOT_START = ((
FLASH_SIZE_KB - BOOT_SECTION_SIZE_KB
) * 1024)
#
# Note that the bootloader size and start address given in AVRStudio is in words and not
# bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC.
#
# Note that the bootloader size and start address given in AVRStudio is in words and not
# bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC.
-BOOT_START = 0x1E000
+FLASH_SIZE_KB = 128
+BOOT_SECTION_SIZE_KB = 4
+BOOT_START = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
+BOOT_API_TABLESTART = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 32)" | bc)
# Output format. (can be srec, ihex, binary)
# Output format. (can be srec, ihex, binary)
@@
-114,6
+121,7
@@
LUFA_PATH = ../..
# LUFA library compile-time options and predefined tokens
LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0
# LUFA library compile-time options and predefined tokens
LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0
+LUFA_OPTS += -D ORDERED_EP_CONFIG
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_RAM_DESCRIPTORS
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_RAM_DESCRIPTORS
@@
-121,7
+129,12
@@
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENAB
LUFA_OPTS += -D NO_INTERNAL_SERIAL
LUFA_OPTS += -D NO_DEVICE_SELF_POWER
LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP
LUFA_OPTS += -D NO_INTERNAL_SERIAL
LUFA_OPTS += -D NO_DEVICE_SELF_POWER
LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP
-LUFA_OPTS += -D NO_STREAM_CALLBACKS
+LUFA_OPTS += -D NO_SOF_EVENTS
+
+#LUFA_OPTS += -D NO_BLOCK_SUPPORT
+#LUFA_OPTS += -D NO_EEPROM_BYTE_SUPPORT
+#LUFA_OPTS += -D NO_FLASH_BYTE_SUPPORT
+#LUFA_OPTS += -D NO_LOCK_BYTE_WRITE_SUPPORT
# Create the LUFA source path variables by including the LUFA root makefile
# Create the LUFA source path variables by including the LUFA root makefile
@@
-130,12
+143,13
@@
include $(LUFA_PATH)/LUFA/makefile
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c \
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c \
+ BootloaderAPI.c \
Descriptors.c \
$(LUFA_SRC_USB) \
# List C++ source files here. (C dependencies are automatically generated.)
Descriptors.c \
$(LUFA_SRC_USB) \
# List C++ source files here. (C dependencies are automatically generated.)
-CPPSRC =
+CPPSRC =
# List Assembler source files here.
# List Assembler source files here.
@@
-145,10
+159,10
@@
CPPSRC =
# Even though the DOS/Win* filesystem matches both .s and .S the same,
# it will preserve the spelling of the filenames, and gcc itself does
# care about how the name is spelled on its command-line.
# Even though the DOS/Win* filesystem matches both .s and .S the same,
# it will preserve the spelling of the filenames, and gcc itself does
# care about how the name is spelled on its command-line.
-ASRC =
+ASRC =
BootloaderAPITable.S
-# Optimization level, can be [0, 1, 2, 3, s].
+# Optimization level, can be [0, 1, 2, 3, s].
# 0 = turn off optimization. s = optimize for size.
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s
# 0 = turn off optimization. s = optimize for size.
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s
@@
-178,24
+192,25
@@
CSTANDARD = -std=c99
# Place -D or -U options here for C sources
CDEFS = -DF_CPU=$(F_CPU)UL
# Place -D or -U options here for C sources
CDEFS = -DF_CPU=$(F_CPU)UL
-CDEFS += -DF_
CLOCK=$(F_CLOCK
)UL
-CDEFS += -DBOARD=BOARD_$(BOARD)
+CDEFS += -DF_
USB=$(F_USB
)UL
+CDEFS += -DBOARD=BOARD_$(BOARD)
-DARCH=ARCH_$(ARCH)
CDEFS += -DBOOT_START_ADDR=$(BOOT_START)UL
CDEFS += $(LUFA_OPTS)
# Place -D or -U options here for ASM sources
ADEFS = -DF_CPU=$(F_CPU)
CDEFS += -DBOOT_START_ADDR=$(BOOT_START)UL
CDEFS += $(LUFA_OPTS)
# Place -D or -U options here for ASM sources
ADEFS = -DF_CPU=$(F_CPU)
-ADEFS += -DF_
CLOCK=$(F_CLOCK
)UL
+ADEFS += -DF_
USB=$(F_USB
)UL
ADEFS += -DBOARD=BOARD_$(BOARD)
ADEFS += -DBOARD=BOARD_$(BOARD)
-
C
DEFS += -DBOOT_START_ADDR=$(BOOT_START)UL
+
A
DEFS += -DBOOT_START_ADDR=$(BOOT_START)UL
ADEFS += $(LUFA_OPTS)
ADEFS += $(LUFA_OPTS)
+
# Place -D or -U options here for C++ sources
CPPDEFS = -DF_CPU=$(F_CPU)UL
# Place -D or -U options here for C++ sources
CPPDEFS = -DF_CPU=$(F_CPU)UL
-CPPDEFS += -DF_
CLOCK=$(F_CLOCK
)UL
+CPPDEFS += -DF_
USB=$(F_USB
)UL
CPPDEFS += -DBOARD=BOARD_$(BOARD)
CPPDEFS += -DBOARD=BOARD_$(BOARD)
-CDEFS += -DBOOT_START_ADDR=$(BOOT_START)UL
+C
PP
DEFS += -DBOOT_START_ADDR=$(BOOT_START)UL
CPPDEFS += $(LUFA_OPTS)
#CPPDEFS += -D__STDC_LIMIT_MACROS
#CPPDEFS += -D__STDC_CONSTANT_MACROS
CPPDEFS += $(LUFA_OPTS)
#CPPDEFS += -D__STDC_LIMIT_MACROS
#CPPDEFS += -D__STDC_CONSTANT_MACROS
@@
-265,7
+280,7
@@
CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
# for use in COFF files, additional information about filenames
# and function names needs to be present in the assembler source
# files -- see avr-libc docs [FIXME: not yet described there]
# for use in COFF files, additional information about filenames
# and function names needs to be present in the assembler source
# files -- see avr-libc docs [FIXME: not yet described there]
-# -listing-cont-lines: Sets the maximum number of continuation lines of hex
+# -listing-cont-lines: Sets the maximum number of continuation lines of hex
# dump that will be displayed for a given single line of source input.
ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
# dump that will be displayed for a given single line of source input.
ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
@@
-278,7
+293,7
@@
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
# If this is left blank, then it will use the Standard printf version.
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
# If this is left blank, then it will use the Standard printf version.
-PRINTF_LIB =
+PRINTF_LIB =
#PRINTF_LIB = $(PRINTF_LIB_MIN)
#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
#PRINTF_LIB = $(PRINTF_LIB_MIN)
#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
@@
-290,7
+305,7
@@
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
# If this is left blank, then it will use the Standard scanf version.
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
# If this is left blank, then it will use the Standard scanf version.
-SCANF_LIB =
+SCANF_LIB =
#SCANF_LIB = $(SCANF_LIB_MIN)
#SCANF_LIB = $(SCANF_LIB_FLOAT)
#SCANF_LIB = $(SCANF_LIB_MIN)
#SCANF_LIB = $(SCANF_LIB_FLOAT)
@@
-302,7
+317,7
@@
MATH_LIB = -lm
# Each directory must be seperated by a space.
# Use forward slashes for directory separators.
# For a directory that has spaces, enclose it in quotes.
# Each directory must be seperated by a space.
# Use forward slashes for directory separators.
# For a directory that has spaces, enclose it in quotes.
-EXTRALIBDIRS =
+EXTRALIBDIRS =
@@
-325,8
+340,8
@@
EXTMEMOPTS =
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
-LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
-LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
-Wl,--section-start=.apitable=$(BOOT_API_TABLESTART)
+LDFLAGS += -Wl,--relax
LDFLAGS += -Wl,--gc-sections
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
LDFLAGS += -Wl,--gc-sections
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
@@
-360,7
+375,7
@@
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
#AVRDUDE_NO_VERIFY = -V
# Increase verbosity level. Please use this when submitting bug
#AVRDUDE_NO_VERIFY = -V
# Increase verbosity level. Please use this when submitting bug
-# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
# to submit bug reports.
#AVRDUDE_VERBOSE = -v -v
# to submit bug reports.
#AVRDUDE_VERBOSE = -v -v
@@
-394,7
+409,7
@@
JTAG_DEV = /dev/com1
DEBUG_PORT = 4242
# Debugging host used to communicate between GDB / avarice / simulavr, normally
DEBUG_PORT = 4242
# Debugging host used to communicate between GDB / avarice / simulavr, normally
-# just set to localhost unless doing some sort of crazy debugging when
+# just set to localhost unless doing some sort of crazy debugging when
# avarice is running on a different computer.
DEBUG_HOST = localhost
# avarice is running on a different computer.
DEBUG_HOST = localhost
@@
-423,7
+438,7
@@
WINSHELL = cmd
MSG_ERRORS_NONE = Errors: none
MSG_BEGIN = -------- begin --------
MSG_END = -------- end --------
MSG_ERRORS_NONE = Errors: none
MSG_BEGIN = -------- begin --------
MSG_END = -------- end --------
-MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_BEFORE = Size before:
MSG_SIZE_AFTER = Size after:
MSG_COFF = Converting to AVR COFF:
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
MSG_SIZE_AFTER = Size after:
MSG_COFF = Converting to AVR COFF:
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
@@
-442,10
+457,10
@@
MSG_CREATING_LIBRARY = Creating library:
# Define all object files.
# Define all object files.
-OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
+OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
# Define all listing files.
# Define all listing files.
-LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
+LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
# Compiler flags to generate dependency files.
# Compiler flags to generate dependency files.
@@
-510,19
+525,19
@@
sizeafter:
# Display compiler version information.
# Display compiler version information.
-gccversion :
+gccversion :
@$(CC) --version
@$(CC) --version
-# Program the device.
+# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
# Generate avr-gdb config/init file which does the following:
program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
# Generate avr-gdb config/init file which does the following:
-# define the reset signal, load the target file, connect to target, and set
+# define the reset signal, load the target file, connect to target, and set
# a breakpoint at main().
# a breakpoint at main().
-gdb-config:
+gdb-config:
@$(REMOVE) $(GDBINIT_FILE)
@echo define reset >> $(GDBINIT_FILE)
@echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
@$(REMOVE) $(GDBINIT_FILE)
@echo define reset >> $(GDBINIT_FILE)
@echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
@@
-620,14
+635,14
@@
extcoff: $(TARGET).elf
$(OBJDIR)/%.o : %.c
@echo
@echo $(MSG_COMPILING) $<
$(OBJDIR)/%.o : %.c
@echo
@echo $(MSG_COMPILING) $<
- $(CC) -c $(ALL_CFLAGS) $< -o $@
+ $(CC) -c $(ALL_CFLAGS) $< -o $@
# Compile: create object files from C++ source files.
$(OBJDIR)/%.o : %.cpp
@echo
@echo $(MSG_COMPILING_CPP) $<
# Compile: create object files from C++ source files.
$(OBJDIR)/%.o : %.cpp
@echo
@echo $(MSG_COMPILING_CPP) $<
- $(CC) -c $(ALL_CPPFLAGS) $< -o $@
+ $(CC) -c $(ALL_CPPFLAGS) $< -o $@
# Compile: create assembler files from C source files.
# Compile: create assembler files from C source files.
@@
-649,7
+664,7
@@
$(OBJDIR)/%.o : %.S
# Create preprocessed source for use in sending a bug report.
%.i : %.c
# Create preprocessed source for use in sending a bug report.
%.i : %.c
- $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
+ $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
# Target: clean project.
# Target: clean project.
@@
-673,13
+688,22
@@
clean_list :
$(REMOVEDIR) .dep
doxygen:
$(REMOVEDIR) .dep
doxygen:
- @echo Generating Project Documentation...
+ @echo Generating Project Documentation
\($(TARGET)\)
...
@doxygen Doxygen.conf
@echo Documentation Generation Complete.
clean_doxygen:
rm -rf Documentation
@doxygen Doxygen.conf
@echo Documentation Generation Complete.
clean_doxygen:
rm -rf Documentation
+checksource:
+ @for f in $(SRC) $(CPPSRC) $(ASRC); do \
+ if [ -f $$f ]; then \
+ echo "Found Source File: $$f" ; \
+ else \
+ echo "Source File Not Found: $$f" ; \
+ fi; done
+
+
# Create object files directory
$(shell mkdir $(OBJDIR) 2>/dev/null)
# Create object files directory
$(shell mkdir $(OBJDIR) 2>/dev/null)
@@
-691,4
+715,5
@@
$(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
.PHONY : all begin finish end sizebefore sizeafter gccversion \
build elf hex eep lss sym coff extcoff doxygen clean \
# Listing of phony targets.
.PHONY : all begin finish end sizebefore sizeafter gccversion \
build elf hex eep lss sym coff extcoff doxygen clean \
-clean_list clean_doxygen program debug gdb-config
+clean_list clean_doxygen program debug gdb-config checksource
+