Replace architecture specific makefiles in the BuildTests with the new common build...
[pub/USBasp.git] / LUFA / Build / lufa.dfu.in
1 #
2 # LUFA Library
3 # Copyright (C) Dean Camera, 2012.
4 #
5 # dean [at] fourwalledcubicle [dot] com
6 # www.lufa-lib.org
7 #
8
9 LUFA_BUILD_MODULES += DFU
10 LUFA_BUILD_TARGETS += flip flip-ee dfu dfu-ee
11
12 # -----------------------------------------------------------------------------
13 # LUFA DFU Bootloader Buildsystem Makefile Module.
14 # -----------------------------------------------------------------------------
15 # DESCRIPTION:
16 # Provides a set of targets to re-program a device currently running a DFU
17 # class bootloader with a project's FLASH and EEPROM files.
18 # -----------------------------------------------------------------------------
19 # TARGETS:
20 #
21 # flip - Program FLASH into target via Atmel FLIP
22 # flip-ee - Program EEPROM into target via Atmel FLIP
23 # dfu - Program FLASH into target via dfu-programmer
24 # dfu-ee - Program EEPROM into target via dfu-programmer
25 #
26 # MANDATORY PARAMETERS:
27 #
28 # MCU - Microcontroller device model name
29 # TARGET - Application name
30 #
31 # OPTIONAL PARAMETERS:
32 #
33 # (None)
34 #
35 # -----------------------------------------------------------------------------
36
37 # Output Messages
38 MSG_DFU_CMD = ' [DFU] :'
39
40 # Sanity check the user MCU and TARGET makefile options
41 ifeq ($(MCU),)
42 $(error Makefile MCU value not set.)
43 endif
44 ifeq ($(TARGET),)
45 $(error Makefile TARGET value not set.)
46 endif
47
48 flip: $(TARGET).hex
49 @echo $(MSG_DFU_CMD) Programming FLASH with batchisp using \"$(TARGET).hex\"
50 batchisp -hardware usb -device $(MCU) -operation erase f
51 batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
52 batchisp -hardware usb -device $(MCU) -operation start reset 0
53
54 flip-ee: $(TARGET).eep
55 cp $(TARGET).eep $(TARGET)eep.hex
56 @echo $(MSG_DFU_CMD) Programming EEPROM with batchisp using \"$(TARGET).eep\"
57 batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
58 batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
59 batchisp -hardware usb -device $(MCU) -operation start reset 0
60 rm $(TARGET)eep.hex
61
62 dfu: $(TARGET).hex
63 @echo $(MSG_DFU_CMD) Programming FLASH with dfu-programmer using \"$(TARGET).hex\"
64 dfu-programmer $(MCU) erase
65 dfu-programmer $(MCU) flash $(TARGET).hex
66 dfu-programmer $(MCU) reset
67
68 dfu-ee: $(TARGET).hex $(TARGET).eep
69 @echo $(MSG_DFU_CMD) Programming EEPROM with dfu-programmer using \"$(TARGET).eep\"
70 dfu-programmer $(MCU) eeprom-flash $(TARGET).eep
71 dfu-programmer $(MCU) reset