2020-01-04 10:31:55 -06:00
|
|
|
CFLAGS += \
|
|
|
|
-flto \
|
|
|
|
-mthumb \
|
|
|
|
-mabi=aapcs-linux \
|
|
|
|
-mcpu=cortex-m0 \
|
|
|
|
-D__ARM_FEATURE_DSP=0 \
|
|
|
|
-DUSE_ASSERT=0 \
|
2020-01-07 16:57:18 +07:00
|
|
|
-DCFG_EXAMPLE_MSC_READONLY \
|
2020-01-04 10:31:55 -06:00
|
|
|
-DCFG_TUSB_MCU=OPT_MCU_NUC121
|
|
|
|
|
|
|
|
# All source paths should be relative to the top level.
|
2020-03-07 17:49:30 +07:00
|
|
|
LD_FILE = hw/bsp/$(BOARD)/nuc125_flash.ld
|
2020-01-04 10:31:55 -06:00
|
|
|
|
|
|
|
SRC_C += \
|
|
|
|
hw/mcu/nuvoton/nuc121_125/Device/Nuvoton/NUC121/Source/system_NUC121.c \
|
2020-01-14 18:13:42 +07:00
|
|
|
hw/mcu/nuvoton/nuc121_125/StdDriver/src/clk.c \
|
|
|
|
hw/mcu/nuvoton/nuc121_125/StdDriver/src/gpio.c
|
2020-01-04 10:31:55 -06:00
|
|
|
|
|
|
|
SRC_S += \
|
|
|
|
hw/mcu/nuvoton/nuc121_125/Device/Nuvoton/NUC121/Source/GCC/startup_NUC121.S
|
|
|
|
|
|
|
|
INC += \
|
|
|
|
$(TOP)/hw/mcu/nuvoton/nuc121_125/Device/Nuvoton/NUC121/Include \
|
|
|
|
$(TOP)/hw/mcu/nuvoton/nuc121_125/StdDriver/inc \
|
|
|
|
$(TOP)/hw/mcu/nuvoton/nuc121_125/CMSIS/Include
|
|
|
|
|
|
|
|
# For TinyUSB port source
|
|
|
|
VENDOR = nuvoton
|
|
|
|
CHIP_FAMILY = nuc121
|
|
|
|
|
|
|
|
# For freeRTOS port source
|
|
|
|
FREERTOS_PORT = ARM_CM0
|
|
|
|
|
|
|
|
# For flash-jlink target
|
|
|
|
JLINK_DEVICE = NUC125SC2AE
|
|
|
|
|
2020-01-14 18:13:42 +07:00
|
|
|
# Flash using Nuvoton's openocd fork at https://github.com/OpenNuvoton/OpenOCD-Nuvoton
|
|
|
|
# Please compile and install it from github source
|
2021-01-26 12:46:24 +07:00
|
|
|
flash: $(BUILD)/$(PROJECT).elf
|
2020-01-14 18:19:33 +07:00
|
|
|
openocd -f interface/nulink.cfg -f target/numicroM0.cfg -c "program $< reset exit"
|