Skip to content

Commit a1be272

Browse files
committed
atmel-samd: Correct the UF2 bootloader offset when converting the bin to uf2.
1 parent bb008cd commit a1be272

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

atmel-samd/Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,11 @@ LIBS := -lgcc -lc
159159
ifeq ($(CHIP_FAMILY), samd21)
160160
LDFLAGS += -mthumb -mcpu=cortex-m0plus -Lasf/thirdparty/CMSIS/Lib/GCC/
161161
LIBS := -lm $(LIBS) # -larm_cortexM0l_math
162+
BOOTLOADER_SIZE := 0x2000
162163
else ifeq ($(CHIP_FAMILY), samd51)
163164
LDFLAGS += -mthumb -mcpu=cortex-m4
164165
LIBS := -lm $(LIBS)
166+
BOOTLOADER_SIZE := 0x4000
165167
endif
166168

167169
SRC_ASF := \
@@ -320,7 +322,7 @@ $(BUILD)/firmware.bin: $(BUILD)/firmware.elf
320322

321323
$(BUILD)/firmware.uf2: $(BUILD)/firmware.bin
322324
$(ECHO) "Create $@"
323-
python2 $(TOP)/tools/uf2/utils/uf2conv.py -c -o $@ $^
325+
python2 $(TOP)/tools/uf2/utils/uf2conv.py -b $(BOOTLOADER_SIZE) -c -o $@ $^
324326

325327
deploy: $(BUILD)/firmware.bin
326328
$(ECHO) "Writing $< to the board"

0 commit comments

Comments
 (0)