2021-01-26 21:19:14 +07:00
|
|
|
UF2_FAMILY_ID = 0x68ed2b88
|
2023-09-11 11:35:51 +07:00
|
|
|
SDK_DIR = hw/mcu/microchip/samd21
|
2021-01-26 21:19:14 +07:00
|
|
|
|
2020-11-28 11:11:55 +07:00
|
|
|
include $(TOP)/$(BOARD_PATH)/board.mk
|
2023-06-24 18:38:41 +07:00
|
|
|
CPU_CORE ?= cortex-m0plus
|
2020-11-28 11:11:55 +07:00
|
|
|
|
2019-09-01 11:10:28 +07:00
|
|
|
CFLAGS += \
|
2019-11-20 16:06:40 +07:00
|
|
|
-flto \
|
2019-09-01 11:10:28 +07:00
|
|
|
-nostdlib -nostartfiles \
|
2019-11-20 16:06:40 +07:00
|
|
|
-DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
|
2019-09-01 11:10:28 +07:00
|
|
|
-DCFG_TUSB_MCU=OPT_MCU_SAMD21
|
|
|
|
|
2021-10-17 16:26:27 +07:00
|
|
|
# suppress warning caused by vendor mcu driver
|
2023-03-19 12:47:05 +07:00
|
|
|
CFLAGS += -Wno-error=redundant-decls
|
|
|
|
|
|
|
|
# SAM driver is flooded with -Wcast-qual which slow down complication significantly
|
|
|
|
CFLAGS_SKIP += -Wcast-qual
|
2021-10-17 16:26:27 +07:00
|
|
|
|
2019-09-01 11:10:28 +07:00
|
|
|
SRC_C += \
|
2021-03-17 16:52:07 +07:00
|
|
|
src/portable/microchip/samd/dcd_samd.c \
|
2023-09-11 11:35:51 +07:00
|
|
|
${SDK_DIR}/gcc/gcc/startup_samd21.c \
|
|
|
|
${SDK_DIR}/gcc/system_samd21.c \
|
|
|
|
${SDK_DIR}/hpl/gclk/hpl_gclk.c \
|
|
|
|
${SDK_DIR}/hpl/pm/hpl_pm.c \
|
|
|
|
${SDK_DIR}/hpl/sysctrl/hpl_sysctrl.c \
|
|
|
|
${SDK_DIR}/hal/src/hal_atomic.c
|
2019-09-01 11:10:28 +07:00
|
|
|
|
|
|
|
INC += \
|
2020-11-28 11:11:55 +07:00
|
|
|
$(TOP)/$(BOARD_PATH) \
|
2023-09-11 11:35:51 +07:00
|
|
|
$(TOP)/${SDK_DIR}/ \
|
|
|
|
$(TOP)/${SDK_DIR}/config \
|
|
|
|
$(TOP)/${SDK_DIR}/include \
|
|
|
|
$(TOP)/${SDK_DIR}/hal/include \
|
|
|
|
$(TOP)/${SDK_DIR}/hal/utils/include \
|
|
|
|
$(TOP)/${SDK_DIR}/hpl/pm/ \
|
|
|
|
$(TOP)/${SDK_DIR}/hpl/port \
|
|
|
|
$(TOP)/${SDK_DIR}/hri \
|
|
|
|
$(TOP)/${SDK_DIR}/CMSIS/Include
|
2019-09-01 11:10:28 +07:00
|
|
|
|
2020-11-28 11:45:24 +07:00
|
|
|
# flash using bossac at least version 1.8
|
|
|
|
# can be found in arduino15/packages/arduino/tools/bossac/
|
|
|
|
# Add it to your PATH or change BOSSAC variable to match your installation
|
|
|
|
BOSSAC = bossac
|
|
|
|
|
2021-01-26 12:46:24 +07:00
|
|
|
flash-bossac: $(BUILD)/$(PROJECT).bin
|
2020-11-28 11:45:24 +07:00
|
|
|
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
|
|
|
|
$(BOSSAC) --port=$(SERIAL) -U -i --offset=0x2000 -e -w $^ -R
|