-
-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable build process #34
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
cat vidpid.txt | while read mcu vid pid name; do | ||
make clean | ||
make VID=$vid PID=$pid MCU=$mcu NAME="$name" "$@" all | ||
# Please tell me where to find thebuild products... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of a move you could possibly change the target in the makefile. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is much more complicated. This build script, being a Shell script, expects the Make command have a consistent output file name. |
||
#mv build-product.ihex hoodloader_$mcu_$vid_$pid.ihex | ||
done |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,9 @@ | |
|
||
# Run "make help" for target help. | ||
|
||
ifeq ($(MCU),) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this required? What id you use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure you can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
MCU = atmega16u2 | ||
endif | ||
ARCH = AVR8 | ||
BOARD = USER | ||
F_CPU = 16000000 | ||
|
@@ -23,6 +25,15 @@ LUFA_PATH = ../lufa-LUFA-140928/LUFA | |
CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ $(HOODLOADER2_OPTS) -DBOOT_START_ADDR=$(BOOT_START_OFFSET) $(REGS) -flto -fuse-linker-plugin | ||
LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS),--section-start=.data=$(RAM_OFFSET) $(REGS) -flto -fuse-linker-plugin | ||
|
||
ifneq ($(MCU),atmega8u2) | ||
ifneq ($(MCU),atmega16u2) | ||
ifneq ($(MCU),atmega16u4) | ||
ifneq ($(MCU),atmega32u4) | ||
$(error MCU must be one of atmega8u2, atmega16u2, atmega16u4 or atmega32u4) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is not required as the build would just fail. Also you missed the at90usb devices. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright. Nuke this. |
||
endif | ||
endif | ||
endif | ||
endif | ||
|
||
# Flash size and bootloader section sizes of the target, in KB. These must | ||
# match the target's total FLASH size and the bootloader size set in the | ||
|
@@ -41,8 +52,20 @@ BOOT_SECTION_SIZE_KB = 4 | |
#define ARDUINO_MICRO_PID 0x0037 // Bootloader, not program! | ||
#define ARDUINO_DUE_PID 0x003D | ||
|
||
HOODLOADER2_OPTS = -DVENDORID=ARDUINO_VID | ||
HOODLOADER2_OPTS += -DPRODUCTID=ARDUINO_UNO_PID | ||
ifeq ($(VID),) | ||
VID := ARDUINO_VID | ||
endif | ||
|
||
ifeq ($(PID),) | ||
PID := ARDUINO_UNO_PID | ||
endif | ||
|
||
HOODLOADER2_OPTS = -DVENDORID=$(VID) | ||
HOODLOADER2_OPTS += -DPRODUCTID=$(PID) | ||
|
||
ifneq ($(NAME),) | ||
HOODLOADER2_OPTS += "-DUSB_DESCRIPTOR_STRING=\"$(NAME)\"" | ||
endif | ||
|
||
# 1200 is the baud to load the Bootloader from an Arduino sketch, | ||
# 57600 turns out to be the actual baud rate for uploading for default arduino bootloaders (and arduino nano by default!) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
atmega16u2 0x2341 0x0043 HoodLoader2 Uno | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sure to also add 8u2, 32u2 and at90usb builds. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just add lines following that format. |
||
atmega16u2 0x2341 0x0042 HoodLoader2 Mega | ||
atmega16u2 0x2341 0x0044 HoodLoader2 ADK | ||
atmega32u4 0x2341 0x0036 HoodLoader2 Leo | ||
atmeag32u4 0x2341 0x0037 HoodLoader2 Micro | ||
atmega32u4 0x2341 0x003c HoodLoader2 Esplora |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you using this for? If no "normal" VID/PID is recognized it will use "Lufa" as string. I think there is an else path missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows
vidpid.txt
to redefine the display string to whatever the user want to.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. But I cannot see where this is done on the c code. I might be wrong and missunderstand.
edit: looks okay