2021-01-26 15:19:14 +01:00
|
|
|
UF2_FAMILY_ID = 0x55114460
|
2021-03-18 10:28:44 +01:00
|
|
|
DEPS_SUBMODULES += hw/mcu/microchip
|
2021-01-26 15:19:14 +01:00
|
|
|
|
2020-11-28 06:09:45 +01:00
|
|
|
include $(TOP)/$(BOARD_PATH)/board.mk
|
|
|
|
|
2019-07-01 17:57:23 +02:00
|
|
|
CFLAGS += \
|
2019-11-20 10:06:40 +01:00
|
|
|
-flto \
|
2019-07-01 17:57:23 +02:00
|
|
|
-mthumb \
|
2020-11-28 06:09:45 +01:00
|
|
|
-mabi=aapcs \
|
2019-07-01 17:57:23 +02:00
|
|
|
-mcpu=cortex-m4 \
|
|
|
|
-mfloat-abi=hard \
|
|
|
|
-mfpu=fpv4-sp-d16 \
|
|
|
|
-nostdlib -nostartfiles \
|
|
|
|
-DCFG_TUSB_MCU=OPT_MCU_SAMD51
|
|
|
|
|
2021-10-17 11:26:27 +02:00
|
|
|
# suppress warning caused by vendor mcu driver
|
|
|
|
CFLAGS += -Wno-error=cast-qual
|
2019-07-01 17:57:23 +02:00
|
|
|
|
|
|
|
SRC_C += \
|
2021-03-17 10:52:07 +01:00
|
|
|
src/portable/microchip/samd/dcd_samd.c \
|
2021-03-01 15:24:11 +01:00
|
|
|
hw/mcu/microchip/samd51/gcc/gcc/startup_samd51.c \
|
|
|
|
hw/mcu/microchip/samd51/gcc/system_samd51.c \
|
|
|
|
hw/mcu/microchip/samd51/hpl/gclk/hpl_gclk.c \
|
|
|
|
hw/mcu/microchip/samd51/hpl/mclk/hpl_mclk.c \
|
|
|
|
hw/mcu/microchip/samd51/hpl/osc32kctrl/hpl_osc32kctrl.c \
|
|
|
|
hw/mcu/microchip/samd51/hpl/oscctrl/hpl_oscctrl.c \
|
|
|
|
hw/mcu/microchip/samd51/hal/src/hal_atomic.c
|
2019-07-01 17:57:23 +02:00
|
|
|
|
|
|
|
INC += \
|
2020-11-28 06:09:45 +01:00
|
|
|
$(TOP)/$(BOARD_PATH) \
|
2021-03-01 15:24:11 +01:00
|
|
|
$(TOP)/hw/mcu/microchip/samd51/ \
|
|
|
|
$(TOP)/hw/mcu/microchip/samd51/config \
|
|
|
|
$(TOP)/hw/mcu/microchip/samd51/include \
|
|
|
|
$(TOP)/hw/mcu/microchip/samd51/hal/include \
|
|
|
|
$(TOP)/hw/mcu/microchip/samd51/hal/utils/include \
|
|
|
|
$(TOP)/hw/mcu/microchip/samd51/hpl/port \
|
|
|
|
$(TOP)/hw/mcu/microchip/samd51/hri \
|
|
|
|
$(TOP)/hw/mcu/microchip/samd51/CMSIS/Include
|
2019-07-01 17:57:23 +02:00
|
|
|
|
|
|
|
# For freeRTOS port source
|
2023-03-16 17:11:11 +01:00
|
|
|
FREERTOS_PORTABLE_SRC = $(FREERTOS_PORTABLE_PATH)/ARM_CM4F
|
2019-07-01 17:57:23 +02:00
|
|
|
|
2020-07-22 20:39:15 +02: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 06:46:24 +01:00
|
|
|
flash-bossac: $(BUILD)/$(PROJECT).bin
|
2020-07-22 20:39:15 +02:00
|
|
|
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
|
|
|
|
$(BOSSAC) --port=$(SERIAL) -U -i --offset=0x4000 -e -w $^ -R
|