summaryrefslogtreecommitdiff
path: root/hw/bsp/samg/family.mk
blob: 037ac4709a121cb3e9ac98abb643e7a3ae41f2db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
include $(TOP)/$(BOARD_PATH)/board.mk
CPU_CORE ?= cortex-m4

SDK_DIR = hw/mcu/microchip/samg55

CFLAGS += \
  -flto \
  -DCFG_TUSB_MCU=OPT_MCU_SAMG

# suppress following warnings from mcu driver
CFLAGS += -Wno-error=undef -Wno-error=null-dereference -Wno-error=redundant-decls

# SAM driver is flooded with -Wcast-qual which slow down complication significantly
CFLAGS_SKIP += -Wcast-qual

LDFLAGS += \
  -nostdlib -nostartfiles \
  --specs=nosys.specs --specs=nano.specs \

SRC_C += \
	src/portable/microchip/samg/dcd_samg.c \
	${SDK_DIR}/samg55/gcc/gcc/startup_samg55.c \
	${SDK_DIR}/samg55/gcc/system_samg55.c \
	${SDK_DIR}/hal/src/hal_atomic.c \
	${SDK_DIR}/hpl/core/hpl_init.c \
	${SDK_DIR}/hpl/usart/hpl_usart.c \
	${SDK_DIR}/hpl/pmc/hpl_pmc.c \

INC += \
  $(TOP)/$(FAMILY_PATH) \
  $(TOP)/$(BOARD_PATH) \
	$(TOP)/${SDK_DIR} \
	$(TOP)/${SDK_DIR}/config \
	$(TOP)/${SDK_DIR}/samg55/include \
	$(TOP)/${SDK_DIR}/hal/include \
	$(TOP)/${SDK_DIR}/hal/utils/include \
	$(TOP)/${SDK_DIR}/hpl/core \
	$(TOP)/${SDK_DIR}/hpl/pio \
	$(TOP)/${SDK_DIR}/hpl/pmc \
	$(TOP)/${SDK_DIR}/hri \
	$(TOP)/${SDK_DIR}/CMSIS/Core/Include

# flash using edbg from https://github.com/ataradov/edbg
flash-edbg: $(BUILD)/$(PROJECT).bin
	edbg --verbose -t samg55 -pv -f $<