2021-01-26 21:19:14 +07:00
|
|
|
UF2_FAMILY_ID = 0xADA52840
|
2021-03-18 16:28:44 +07:00
|
|
|
DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/nordic/nrfx
|
2021-01-26 21:19:14 +07:00
|
|
|
|
2020-11-28 10:48:44 +07:00
|
|
|
include $(TOP)/$(BOARD_PATH)/board.mk
|
|
|
|
|
2019-05-02 18:10:06 +07:00
|
|
|
CFLAGS += \
|
2019-11-20 16:06:40 +07:00
|
|
|
-flto \
|
|
|
|
-mthumb \
|
|
|
|
-mabi=aapcs \
|
|
|
|
-mcpu=cortex-m4 \
|
|
|
|
-mfloat-abi=hard \
|
|
|
|
-mfpu=fpv4-sp-d16 \
|
|
|
|
-DCFG_TUSB_MCU=OPT_MCU_NRF5X \
|
2019-05-02 18:10:06 +07:00
|
|
|
-DCONFIG_GPIO_AS_PINRESET
|
|
|
|
|
2020-05-17 14:24:15 +07:00
|
|
|
# suppress warning caused by vendor mcu driver
|
|
|
|
CFLAGS += -Wno-error=undef -Wno-error=unused-parameter -Wno-error=cast-align
|
2019-09-27 00:15:43 +07:00
|
|
|
|
|
|
|
# due to tusb_hal_nrf_power_event
|
2019-10-01 15:43:28 +07:00
|
|
|
GCCVERSION = $(firstword $(subst ., ,$(shell arm-none-eabi-gcc -dumpversion)))
|
2021-01-14 01:19:43 +09:00
|
|
|
ifeq ($(CMDEXE),1)
|
2021-01-22 11:17:10 +07:00
|
|
|
ifeq ($(shell if $(GCCVERSION) geq 8 echo 1), 1)
|
|
|
|
CFLAGS += -Wno-error=cast-function-type
|
|
|
|
endif
|
2021-01-12 01:02:17 +09:00
|
|
|
else
|
2021-01-22 11:17:10 +07:00
|
|
|
ifeq ($(shell expr $(GCCVERSION) \>= 8), 1)
|
|
|
|
CFLAGS += -Wno-error=cast-function-type
|
|
|
|
endif
|
2019-10-01 15:43:28 +07:00
|
|
|
endif
|
2019-05-02 18:10:06 +07:00
|
|
|
|
|
|
|
# All source paths should be relative to the top level.
|
2020-11-28 00:45:44 +07:00
|
|
|
LD_FILE ?= hw/bsp/nrf/boards/$(BOARD)/nrf52840_s140_v6.ld
|
2019-05-02 18:10:06 +07:00
|
|
|
|
|
|
|
LDFLAGS += -L$(TOP)/hw/mcu/nordic/nrfx/mdk
|
|
|
|
|
|
|
|
SRC_C += \
|
2021-03-17 21:36:52 +07:00
|
|
|
src/portable/nordic/nrf5x/dcd_nrf5x.c \
|
2019-11-20 16:06:40 +07:00
|
|
|
hw/mcu/nordic/nrfx/drivers/src/nrfx_power.c \
|
2020-03-08 13:25:14 +07:00
|
|
|
hw/mcu/nordic/nrfx/drivers/src/nrfx_uarte.c \
|
2020-11-28 10:48:44 +07:00
|
|
|
hw/mcu/nordic/nrfx/mdk/system_$(MCU_VARIANT).c
|
2019-05-02 18:10:06 +07:00
|
|
|
|
|
|
|
INC += \
|
2020-11-28 00:16:28 +07:00
|
|
|
$(TOP)/$(BOARD_PATH) \
|
2021-03-02 01:18:05 +07:00
|
|
|
$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
|
2019-11-20 16:06:40 +07:00
|
|
|
$(TOP)/hw/mcu/nordic \
|
|
|
|
$(TOP)/hw/mcu/nordic/nrfx \
|
|
|
|
$(TOP)/hw/mcu/nordic/nrfx/mdk \
|
|
|
|
$(TOP)/hw/mcu/nordic/nrfx/hal \
|
|
|
|
$(TOP)/hw/mcu/nordic/nrfx/drivers/include \
|
|
|
|
$(TOP)/hw/mcu/nordic/nrfx/drivers/src \
|
2019-05-02 18:10:06 +07:00
|
|
|
|
2020-11-28 10:48:44 +07:00
|
|
|
SRC_S += hw/mcu/nordic/nrfx/mdk/gcc_startup_$(MCU_VARIANT).S
|
2019-05-02 18:10:06 +07:00
|
|
|
|
|
|
|
ASFLAGS += -D__HEAP_SIZE=0
|
|
|
|
|
|
|
|
# For freeRTOS port source
|
|
|
|
FREERTOS_PORT = ARM_CM4F
|
|
|
|
|
|
|
|
# For flash-jlink target
|
2020-11-28 10:48:44 +07:00
|
|
|
JLINK_DEVICE = $(MCU_VARIANT)_xxaa
|