Skip to content

Commit 4edee4b

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

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

atmel-samd/Makefile

Lines changed: 3 additions & 1 deletion
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 := \
@@ -319,7 +321,7 @@ $(BUILD)/firmware.bin: $(BUILD)/firmware.elf
319321

320322
$(BUILD)/firmware.uf2: $(BUILD)/firmware.bin
321323
$(ECHO) "Create $@"
322-
python2 $(TOP)/tools/uf2/utils/uf2conv.py -c -o $@ $^
324+
python2 $(TOP)/tools/uf2/utils/uf2conv.py -b $(BOOTLOADER_SIZE) -c -o $@ $^
323325

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

0 commit comments

Comments
 (0)