Skip to content

Commit 78f25ce

Browse files
committed
Fixed BOOT_LOAD_PIN. Fixed Makefile for Windows. Added filename customization.
1 parent b2462ab commit 78f25ce

20 files changed

+264
-34
lines changed

bootloaders/zero/Makefile

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ ifeq ($(OS),Windows_NT)
8989
else
9090
MODULE_PATH?=$(LOCALAPPDATA)/Arduino15/packages/$(CORE_VENDOR)
9191
MODULE_PATH_ARDUINO?=$(LOCALAPPDATA)/Arduino15/packages/arduino
92-
RM=rm
92+
RM=del
9393
SEP=\\
9494
endif
9595
else
@@ -110,8 +110,9 @@ else
110110
endif
111111
endif
112112

113+
PATHSEP=$(strip $(SEP))
113114
ARM_GCC_PATH?=$(MODULE_PATH_ARDUINO)/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-
114-
BUILD_PATH=build
115+
BUILD_DIR=build
115116

116117
# -----------------------------------------------------------------------------
117118
# Tools
@@ -124,7 +125,7 @@ SIZE=$(ARM_GCC_PATH)size
124125
# Compiler options
125126
# eliminate PARANOIA define to save a tiny amount of code (~40B)
126127
CFLAGS_EXTRA=-D$(SDCARD) -D__$(MCU)__ -DBOARD_ID_$(BOARD_ID) -DPARANOIA
127-
CFLAGS=-mthumb -mcpu=cortex-m0plus -Wall -c -std=gnu99 -ffunction-sections -fdata-sections -nostdlib -nostartfiles --param max-inline-insns-single=500 -Wa,-adhlns=$(<:%.c=$(BUILD_PATH)/%.lst)
128+
CFLAGS=-mthumb -mcpu=cortex-m0plus -Wall -c -std=gnu99 -ffunction-sections -fdata-sections -nostdlib -nostartfiles --param max-inline-insns-single=500 -Wa,-adhlns=$(<:%.c=$(BUILD_DIR)/%.lst)
128129
ifdef DEBUG
129130
CFLAGS+=-g3 -O1 -DDEBUG=1
130131
else
@@ -177,8 +178,8 @@ SOURCES= \
177178
sam_ba_serial.c
178179
endif
179180

180-
OBJECTS=$(addprefix $(BUILD_PATH)/, $(SOURCES:.c=.o))
181-
DEPS=$(addprefix $(BUILD_PATH)/, $(SOURCES:.c=.d))
181+
OBJECTS=$(addprefix $(BUILD_DIR)/, $(SOURCES:.c=.o))
182+
DEPS=$(addprefix $(BUILD_DIR)/, $(SOURCES:.c=.d))
182183

183184
ifneq "test$(AVRSTUDIO_EXE_PATH)" "test"
184185
AS_BUILD=copy_for_atmel_studio
@@ -191,34 +192,34 @@ endif
191192

192193
all: print_info $(SOURCES) $(BIN) $(HEX) $(AS_BUILD)
193194

194-
$(ELF): Makefile $(BUILD_PATH) $(OBJECTS)
195+
$(ELF): Makefile $(BUILD_DIR) $(OBJECTS)
195196
@echo ----------------------------------------------------------
196197
@echo Creating ELF binary
197-
"$(CC)" -L. -L$(BUILD_PATH) $(LDFLAGS) -Os -Wl,--gc-sections -save-temps -Tlinker_scripts/$(LINKER_SCRIPT) -Wl,-Map,"$(BUILD_PATH)/$(NAME).map" -o "$(BUILD_PATH)/$(ELF)" -Wl,--start-group $(OBJECTS) -lm -Wl,--end-group
198-
"$(NM)" "$(BUILD_PATH)/$(ELF)" >"$(BUILD_PATH)/$(NAME)_symbols.txt"
199-
"$(SIZE)" --format=sysv -t -x $(BUILD_PATH)/$(ELF)
198+
"$(CC)" -L. -L$(BUILD_DIR) $(LDFLAGS) -Os -Wl,--gc-sections -save-temps -Tlinker_scripts/$(LINKER_SCRIPT) -Wl,-Map,"$(BUILD_DIR)/$(NAME).map" -o "$(BUILD_DIR)/$(ELF)" -Wl,--start-group $(OBJECTS) -lm -Wl,--end-group
199+
"$(NM)" "$(BUILD_DIR)/$(ELF)" >"$(BUILD_DIR)/$(NAME)_symbols.txt"
200+
"$(SIZE)" --format=sysv -t -x $(BUILD_DIR)/$(ELF)
200201

201202
$(BIN): $(ELF)
202203
@echo ----------------------------------------------------------
203204
@echo Creating flash binary
204-
"$(OBJCOPY)" -O binary $(BUILD_PATH)/$< $@
205+
"$(OBJCOPY)" -O binary $(BUILD_DIR)/$< $@
205206

206207
$(HEX): $(ELF)
207208
@echo ----------------------------------------------------------
208209
@echo Creating flash binary
209-
"$(OBJCOPY)" -O ihex $(BUILD_PATH)/$< $@
210+
"$(OBJCOPY)" -O ihex $(BUILD_DIR)/$< $@
210211

211-
$(BUILD_PATH)/%.o: %.c
212+
$(BUILD_DIR)/%.o: %.c
212213
@echo ----------------------------------------------------------
213214
@echo Compiling $< to $@
214215
"$(CC)" $(CFLAGS) $(CFLAGS_EXTRA) $(INCLUDES) $< -o $@
215216
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
216217

217-
$(BUILD_PATH):
218+
$(BUILD_DIR):
218219
@echo ----------------------------------------------------------
219220
@echo Creating build folder
220-
-mkdir $(BUILD_PATH)
221-
-mkdir $(BUILD_PATH)/SDCard
221+
-mkdir $(BUILD_DIR)
222+
-mkdir $(BUILD_DIR)$(PATHSEP)SDCard
222223

223224
print_info:
224225
@echo ----------------------------------------------------------
@@ -234,30 +235,30 @@ print_info:
234235
copy_for_atmel_studio: $(BIN) $(HEX)
235236
@echo ----------------------------------------------------------
236237
@echo Atmel Studio detected, copying ELF to project root for debug
237-
cp $(BUILD_PATH)/$(ELF) .
238+
cp $(BUILD_DIR)$(PATHSEP)$(ELF) .
238239

239240
clean_for_atmel_studio:
240241
@echo ----------------------------------------------------------
241242
@echo Atmel Studio detected, cleaning ELF from project root
242-
-$(RM) ./$(ELF)
243+
-$(RM) .$(PATHSEP)$(ELF)
243244

244245
clean: $(AS_CLEAN)
245246
@echo ----------------------------------------------------------
246247
@echo Cleaning project
247248
-$(RM) $(BIN)
248249
-$(RM) $(HEX)
249-
-$(RM) $(BUILD_PATH)/SDCard/*.*
250-
-$(RM) $(BUILD_PATH)/*.*
251-
-rmdir $(BUILD_PATH)/SDCard
252-
-rmdir $(BUILD_PATH)
250+
-$(RM) $(BUILD_DIR)$(PATHSEP)SDCard$(PATHSEP)*.*
251+
-$(RM) $(BUILD_DIR)$(PATHSEP)*.*
252+
-rmdir $(BUILD_DIR)$(PATHSEP)SDCard
253+
-rmdir $(BUILD_DIR)
253254

254255
mostly_clean: $(AS_CLEAN)
255256
@echo ----------------------------------------------------------
256257
@echo Cleaning project except bin
257258
-$(RM) $(HEX)
258-
-$(RM) $(BUILD_PATH)/SDCard/*.*
259-
-$(RM) $(BUILD_PATH)/*.*
260-
-rmdir $(BUILD_PATH)/SDCard
261-
-rmdir $(BUILD_PATH)
259+
-$(RM) $(BUILD_DIR)$(PATHSEP)SDCard$(PATHSEP)*.*
260+
-$(RM) $(BUILD_DIR)$(PATHSEP)*.*
261+
-rmdir $(BUILD_DIR)$(PATHSEP)SDCard
262+
-rmdir $(BUILD_DIR)
262263

263-
.phony: print_info $(BUILD_PATH)
264+
.phony: print_info $(BUILD_DIR)

bootloaders/zero/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ This driver is the same as the one used by the MattairTech SAM M0+ Core.
240240
7. Click Tools->Burn Bootloader. Ignore any messages about not supporting shutdown or reset.
241241
8. Continue with driver installation above.
242242

243-
A running sketch *may* interfere with the bootloader installation process. Be sure you are running the existing bootloader or using a blank chip.
243+
**A running sketch *may* interfere with the bootloader installation process. Be sure you are running the existing bootloader or using a blank chip.**
244244

245245
#### Bootloader Installation Using Another Tool (ie: Atmel Studio, openocd)
246246

@@ -479,6 +479,17 @@ binary file on the SD card already matches the installed firmware. In this
479479
case, the LED will blink with status code LED_STATUS_FILE_ALREADY_MATCHES.
480480
By default, SDCARD_AUTORUN_DISABLED is defined.
481481

482+
### SDCARD_FILENAME_PRIMARY
483+
### SDCARD_FILENAME_SECONDARY
484+
485+
Two different binary files can be loaded, depending on external pin settings.
486+
By default, the filenames are UPDATE.BIN and UPDATE2.BIN, but these can be
487+
overridden by defining SDCARD_FILENAME_PRIMARY and SDCARD_FILENAME_SECONDARY.
488+
If both pins are configured, SDCARD_FILENAME_PRIMARY (UPDATE.BIN) will be
489+
loaded when PIN1 is enabled, and SDCARD_FILENAME_PRIMARY (UPDATE2.BIN) is
490+
loaded when PIN2 is enabled. If only one pin or no pin is configured, only
491+
SDCARD_FILENAME_PRIMARY is loaded.
492+
482493
### SAM_BA_INTERFACE
483494

484495
Set SAM_BA_INTERFACE to SAM_BA_USBCDC_ONLY, SAM_BA_UART_ONLY, SAM_BA_NONE, or
@@ -651,6 +662,10 @@ which will produce a binary named sam_ba_sdcard_Generic_x21J_SAMD21J18A.bin
651662

652663
## Technical Details
653664

665+
**TTL Serial**
666+
667+
The TX and RX pins are defined in the relevant board_definitions_* file. The baud rate is 115200 (8N1).
668+
654669
**Arduino IDE Auto-Reset**
655670

656671
When the Arduino IDE initiates the bootloader, the following procedure is used:
@@ -700,6 +715,8 @@ of the system stack. The applet in this case is a very simple word copy function
700715
applet has its own stack at the top of RAM, but the word copy applet uses little/none of this.
701716
The bossac tool is responsible for loading the applet. See Devices.h from the Bossa source.
702717

718+
**A running sketch *may* interfere with the bootloader installation process. Be sure you are running the existing bootloader or using a blank chip.**
719+
703720

704721
## License
705722

bootloaders/zero/SDCard/sdBootloader.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@
2222
FATFS Fatfs; /* Petit-FatFs work area */
2323
BYTE Buff[FLASH_PAGE_SIZE]; /* Page data buffer */
2424

25-
char updateBin[] = "UPDATE.BIN";
26-
char update2Bin[] = "UPDATE2.BIN";
25+
#ifndef SDCARD_FILENAME_PRIMARY
26+
#define SDCARD_FILENAME_PRIMARY "UPDATE.BIN"
27+
#endif
28+
#ifndef SDCARD_FILENAME_SECONDARY
29+
#define SDCARD_FILENAME_SECONDARY "UPDATE2.BIN"
30+
#endif
31+
32+
char updateBin[] = SDCARD_FILENAME_PRIMARY;
33+
char update2Bin[] = SDCARD_FILENAME_SECONDARY;
2734

2835
uint8_t sdBootloader (uint8_t mode)
2936
{

bootloaders/zero/board_definitions/board_definitions_Generic_D11C14A.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
* makefile (so it can be used with the build_all_bootloaders.sh script).
3939
* Size: ~2788B. Disabled by default. Available with 4KB bootloader.
4040
*/
41+
#ifndef SDCARD_ENABLED
4142
//#define SDCARD_ENABLED
43+
#endif
4244

4345
/* If SDCARD_ENABLED is defined, then all SDCARD_SPI_* defines must also be set.
4446
* When setting SDCARD_SPI_PADx defines, consult the appropriate header file
@@ -96,6 +98,17 @@
9698
*/
9799
#define SDCARD_AUTORUN_DISABLED
98100

101+
/* Two different binary files can be loaded, depending on external pin settings.
102+
* By default, the filenames are UPDATE.BIN and UPDATE2.BIN, but these can be
103+
* overridden by defining SDCARD_FILENAME_PRIMARY and SDCARD_FILENAME_SECONDARY.
104+
* If both pins are configured, SDCARD_FILENAME_PRIMARY (UPDATE.BIN) will be
105+
* loaded when PIN1 is enabled, and SDCARD_FILENAME_PRIMARY (UPDATE2.BIN) is
106+
* loaded when PIN2 is enabled. If only one pin or no pin is configured, only
107+
* SDCARD_FILENAME_PRIMARY is loaded.
108+
*/
109+
//#define SDCARD_FILENAME_PRIMARY "UPDATE.BIN"
110+
//#define SDCARD_FILENAME_SECONDARY "UPDATE2.BIN"
111+
99112
/* Set SAM_BA_INTERFACE to SAM_BA_USBCDC_ONLY, SAM_BA_UART_ONLY, SAM_BA_NONE, or
100113
* SAM_BA_BOTH_INTERFACES. With 4KB bootloaders, select only one interface (except
101114
* when using SDCARD_ENABLED, then set SAM_BA_INTERFACE to SAM_BA_NONE). The C21

bootloaders/zero/board_definitions/board_definitions_Generic_D11D14AM.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
* makefile (so it can be used with the build_all_bootloaders.sh script).
3939
* Size: ~2788B. Disabled by default. Available with 4KB bootloader.
4040
*/
41+
#ifndef SDCARD_ENABLED
4142
//#define SDCARD_ENABLED
43+
#endif
4244

4345
/* If SDCARD_ENABLED is defined, then all SDCARD_SPI_* defines must also be set.
4446
* When setting SDCARD_SPI_PADx defines, consult the appropriate header file
@@ -96,6 +98,17 @@
9698
*/
9799
#define SDCARD_AUTORUN_DISABLED
98100

101+
/* Two different binary files can be loaded, depending on external pin settings.
102+
* By default, the filenames are UPDATE.BIN and UPDATE2.BIN, but these can be
103+
* overridden by defining SDCARD_FILENAME_PRIMARY and SDCARD_FILENAME_SECONDARY.
104+
* If both pins are configured, SDCARD_FILENAME_PRIMARY (UPDATE.BIN) will be
105+
* loaded when PIN1 is enabled, and SDCARD_FILENAME_PRIMARY (UPDATE2.BIN) is
106+
* loaded when PIN2 is enabled. If only one pin or no pin is configured, only
107+
* SDCARD_FILENAME_PRIMARY is loaded.
108+
*/
109+
//#define SDCARD_FILENAME_PRIMARY "UPDATE.BIN"
110+
//#define SDCARD_FILENAME_SECONDARY "UPDATE2.BIN"
111+
99112
/* Set SAM_BA_INTERFACE to SAM_BA_USBCDC_ONLY, SAM_BA_UART_ONLY, SAM_BA_NONE, or
100113
* SAM_BA_BOTH_INTERFACES. With 4KB bootloaders, select only one interface (except
101114
* when using SDCARD_ENABLED, then set SAM_BA_INTERFACE to SAM_BA_NONE). The C21

bootloaders/zero/board_definitions/board_definitions_Generic_D11D14AS.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
* makefile (so it can be used with the build_all_bootloaders.sh script).
3939
* Size: ~2788B. Disabled by default. Available with 4KB bootloader.
4040
*/
41+
#ifndef SDCARD_ENABLED
4142
//#define SDCARD_ENABLED
43+
#endif
4244

4345
/* If SDCARD_ENABLED is defined, then all SDCARD_SPI_* defines must also be set.
4446
* When setting SDCARD_SPI_PADx defines, consult the appropriate header file
@@ -96,6 +98,17 @@
9698
*/
9799
#define SDCARD_AUTORUN_DISABLED
98100

101+
/* Two different binary files can be loaded, depending on external pin settings.
102+
* By default, the filenames are UPDATE.BIN and UPDATE2.BIN, but these can be
103+
* overridden by defining SDCARD_FILENAME_PRIMARY and SDCARD_FILENAME_SECONDARY.
104+
* If both pins are configured, SDCARD_FILENAME_PRIMARY (UPDATE.BIN) will be
105+
* loaded when PIN1 is enabled, and SDCARD_FILENAME_PRIMARY (UPDATE2.BIN) is
106+
* loaded when PIN2 is enabled. If only one pin or no pin is configured, only
107+
* SDCARD_FILENAME_PRIMARY is loaded.
108+
*/
109+
//#define SDCARD_FILENAME_PRIMARY "UPDATE.BIN"
110+
//#define SDCARD_FILENAME_SECONDARY "UPDATE2.BIN"
111+
99112
/* Set SAM_BA_INTERFACE to SAM_BA_USBCDC_ONLY, SAM_BA_UART_ONLY, SAM_BA_NONE, or
100113
* SAM_BA_BOTH_INTERFACES. With 4KB bootloaders, select only one interface (except
101114
* when using SDCARD_ENABLED, then set SAM_BA_INTERFACE to SAM_BA_NONE). The C21

bootloaders/zero/board_definitions/board_definitions_Generic_x21E.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
* makefile (so it can be used with the build_all_bootloaders.sh script).
3939
* Size: ~2788B. Disabled by default. Available with 4KB bootloader.
4040
*/
41+
#ifndef SDCARD_ENABLED
4142
//#define SDCARD_ENABLED
43+
#endif
4244

4345
/* If SDCARD_ENABLED is defined, then all SDCARD_SPI_* defines must also be set.
4446
* When setting SDCARD_SPI_PADx defines, consult the appropriate header file
@@ -96,6 +98,17 @@
9698
*/
9799
#define SDCARD_AUTORUN_DISABLED
98100

101+
/* Two different binary files can be loaded, depending on external pin settings.
102+
* By default, the filenames are UPDATE.BIN and UPDATE2.BIN, but these can be
103+
* overridden by defining SDCARD_FILENAME_PRIMARY and SDCARD_FILENAME_SECONDARY.
104+
* If both pins are configured, SDCARD_FILENAME_PRIMARY (UPDATE.BIN) will be
105+
* loaded when PIN1 is enabled, and SDCARD_FILENAME_PRIMARY (UPDATE2.BIN) is
106+
* loaded when PIN2 is enabled. If only one pin or no pin is configured, only
107+
* SDCARD_FILENAME_PRIMARY is loaded.
108+
*/
109+
//#define SDCARD_FILENAME_PRIMARY "UPDATE.BIN"
110+
//#define SDCARD_FILENAME_SECONDARY "UPDATE2.BIN"
111+
99112
/* Set SAM_BA_INTERFACE to SAM_BA_USBCDC_ONLY, SAM_BA_UART_ONLY, SAM_BA_NONE, or
100113
* SAM_BA_BOTH_INTERFACES. With 4KB bootloaders, select only one interface (except
101114
* when using SDCARD_ENABLED, then set SAM_BA_INTERFACE to SAM_BA_NONE). The C21

bootloaders/zero/board_definitions/board_definitions_Generic_x21G.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
* makefile (so it can be used with the build_all_bootloaders.sh script).
3939
* Size: ~2788B. Disabled by default. Available with 4KB bootloader.
4040
*/
41+
#ifndef SDCARD_ENABLED
4142
//#define SDCARD_ENABLED
43+
#endif
4244

4345
/* If SDCARD_ENABLED is defined, then all SDCARD_SPI_* defines must also be set.
4446
* When setting SDCARD_SPI_PADx defines, consult the appropriate header file
@@ -96,6 +98,17 @@
9698
*/
9799
#define SDCARD_AUTORUN_DISABLED
98100

101+
/* Two different binary files can be loaded, depending on external pin settings.
102+
* By default, the filenames are UPDATE.BIN and UPDATE2.BIN, but these can be
103+
* overridden by defining SDCARD_FILENAME_PRIMARY and SDCARD_FILENAME_SECONDARY.
104+
* If both pins are configured, SDCARD_FILENAME_PRIMARY (UPDATE.BIN) will be
105+
* loaded when PIN1 is enabled, and SDCARD_FILENAME_PRIMARY (UPDATE2.BIN) is
106+
* loaded when PIN2 is enabled. If only one pin or no pin is configured, only
107+
* SDCARD_FILENAME_PRIMARY is loaded.
108+
*/
109+
//#define SDCARD_FILENAME_PRIMARY "UPDATE.BIN"
110+
//#define SDCARD_FILENAME_SECONDARY "UPDATE2.BIN"
111+
99112
/* Set SAM_BA_INTERFACE to SAM_BA_USBCDC_ONLY, SAM_BA_UART_ONLY, SAM_BA_NONE, or
100113
* SAM_BA_BOTH_INTERFACES. With 4KB bootloaders, select only one interface (except
101114
* when using SDCARD_ENABLED, then set SAM_BA_INTERFACE to SAM_BA_NONE). The C21

bootloaders/zero/board_definitions/board_definitions_Generic_x21J.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
* makefile (so it can be used with the build_all_bootloaders.sh script).
3939
* Size: ~2788B. Disabled by default. Available with 4KB bootloader.
4040
*/
41+
#ifndef SDCARD_ENABLED
4142
//#define SDCARD_ENABLED
43+
#endif
4244

4345
/* If SDCARD_ENABLED is defined, then all SDCARD_SPI_* defines must also be set.
4446
* When setting SDCARD_SPI_PADx defines, consult the appropriate header file
@@ -96,6 +98,17 @@
9698
*/
9799
#define SDCARD_AUTORUN_DISABLED
98100

101+
/* Two different binary files can be loaded, depending on external pin settings.
102+
* By default, the filenames are UPDATE.BIN and UPDATE2.BIN, but these can be
103+
* overridden by defining SDCARD_FILENAME_PRIMARY and SDCARD_FILENAME_SECONDARY.
104+
* If both pins are configured, SDCARD_FILENAME_PRIMARY (UPDATE.BIN) will be
105+
* loaded when PIN1 is enabled, and SDCARD_FILENAME_PRIMARY (UPDATE2.BIN) is
106+
* loaded when PIN2 is enabled. If only one pin or no pin is configured, only
107+
* SDCARD_FILENAME_PRIMARY is loaded.
108+
*/
109+
//#define SDCARD_FILENAME_PRIMARY "UPDATE.BIN"
110+
//#define SDCARD_FILENAME_SECONDARY "UPDATE2.BIN"
111+
99112
/* Set SAM_BA_INTERFACE to SAM_BA_USBCDC_ONLY, SAM_BA_UART_ONLY, SAM_BA_NONE, or
100113
* SAM_BA_BOTH_INTERFACES. With 4KB bootloaders, select only one interface (except
101114
* when using SDCARD_ENABLED, then set SAM_BA_INTERFACE to SAM_BA_NONE). The C21

bootloaders/zero/board_definitions/board_definitions_MT_D11.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
* makefile (so it can be used with the build_all_bootloaders.sh script).
3939
* Size: ~2788B. Disabled by default. Available with 4KB bootloader.
4040
*/
41+
#ifndef SDCARD_ENABLED
4142
//#define SDCARD_ENABLED
43+
#endif
4244

4345
/* If SDCARD_ENABLED is defined, then all SDCARD_SPI_* defines must also be set.
4446
* When setting SDCARD_SPI_PADx defines, consult the appropriate header file
@@ -96,6 +98,17 @@
9698
*/
9799
#define SDCARD_AUTORUN_DISABLED
98100

101+
/* Two different binary files can be loaded, depending on external pin settings.
102+
* By default, the filenames are UPDATE.BIN and UPDATE2.BIN, but these can be
103+
* overridden by defining SDCARD_FILENAME_PRIMARY and SDCARD_FILENAME_SECONDARY.
104+
* If both pins are configured, SDCARD_FILENAME_PRIMARY (UPDATE.BIN) will be
105+
* loaded when PIN1 is enabled, and SDCARD_FILENAME_PRIMARY (UPDATE2.BIN) is
106+
* loaded when PIN2 is enabled. If only one pin or no pin is configured, only
107+
* SDCARD_FILENAME_PRIMARY is loaded.
108+
*/
109+
//#define SDCARD_FILENAME_PRIMARY "UPDATE.BIN"
110+
//#define SDCARD_FILENAME_SECONDARY "UPDATE2.BIN"
111+
99112
/* Set SAM_BA_INTERFACE to SAM_BA_USBCDC_ONLY, SAM_BA_UART_ONLY, SAM_BA_NONE, or
100113
* SAM_BA_BOTH_INTERFACES. With 4KB bootloaders, select only one interface (except
101114
* when using SDCARD_ENABLED, then set SAM_BA_INTERFACE to SAM_BA_NONE). The C21

0 commit comments

Comments
 (0)