123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- #VPATH += :$(HALPATH)/k24f
- #TMPSRC += $(wildcard $(HALPATH)/k24f/*.c)
- #DVRSRC += $(wildcard $(HALPATH)/k24f/Drivers/*.c)
- #SRC += $(subst $(HALPATH)/k24f/,,$(TMPSRC))
- #$(info SRC is $(SRC))
- #EXTRAINCDIRS += $(HALPATH)/k24f $(HALPATH)/k24f/CMSIS $(HALPATH)/k24f/Drivers
- EXTRAINCDIRS +=
- #ASRC += startup_MK24F12.S
- #MCU_FLAGS = -mcpu=cortex-m4
- CC = arm-none-eabi-gcc
- OBJCOPY = arm-none-eabi-objcopy
- OBJDUMP = arm-none-eabi-objdump
- SIZE = arm-none-eabi-size
- AR = arm-none-eabi-ar rcs
- NM = arm-none-eabi-nm
- #Output Format = Binary for this target
- FORMAT = binary
- TARGETS := nrf52840_xxaa
- OUTPUT_DIRECTORY := _build
- SDK_ROOT := ../hal/nrf52840/nrf_sdk_15.0.0
- PROJ_DIR := ../hal/nrf52840/nrf_sdk_15.0.0/examples/peripheral/serial/ufo/blank/config
- LINKER_SCRIPT := $(PROJ_DIR)/../armgcc/serial_gcc_nrf52.ld
- VPATH += :$(SDK_ROOT):../hal/nrf52840
- # Source files common to all targets
- ASRC += \
- modules/nrfx/mdk/gcc_startup_nrf52840.S
- SRC += \
- nrf52840_hal.c \
- components/boards/boards.c \
- components/libraries/button/app_button.c \
- components/libraries/util/app_error.c \
- components/libraries/util/app_error_handler_gcc.c \
- components/libraries/util/app_error_weak.c \
- components/libraries/scheduler/app_scheduler.c \
- components/libraries/timer/app_timer.c \
- components/libraries/util/app_util_platform.c \
- components/libraries/hardfault/nrf52/handler/hardfault_handler_gcc.c \
- components/libraries/hardfault/hardfault_implementation.c \
- components/libraries/util/nrf_assert.c \
- components/libraries/atomic/nrf_atomic.c \
- components/libraries/queue/nrf_queue.c \
- components/libraries/serial/nrf_serial.c \
- components/libraries/strerror/nrf_strerror.c \
- integration/nrfx/legacy/nrf_drv_clock.c \
- integration/nrfx/legacy/nrf_drv_power.c \
- integration/nrfx/legacy/nrf_drv_uart.c \
- components/drivers_nrf/nrf_soc_nosd/nrf_nvic.c \
- components/drivers_nrf/nrf_soc_nosd/nrf_soc.c \
- modules/nrfx/drivers/src/nrfx_clock.c \
- modules/nrfx/drivers/src/nrfx_gpiote.c \
- modules/nrfx/drivers/src/nrfx_power.c \
- modules/nrfx/drivers/src/nrfx_power_clock.c \
- modules/nrfx/drivers/src/prs/nrfx_prs.c \
- modules/nrfx/drivers/src/nrfx_uart.c \
- modules/nrfx/drivers/src/nrfx_uarte.c \
- components/libraries/bsp/bsp.c \
- modules/nrfx/mdk/system_nrf52840.c \
-
- # This is a bit of a hack, used to make build directory.
- # As windows mkdir does't have -p option you need to build out
- # this list in order of depth
- MKDIR_LIST = components \
- components/boards \
- components/libraries \
- components/libraries/button \
- components/libraries/util \
- components/libraries/scheduler \
- components/libraries/timer \
- components/libraries/hardfault \
- components/libraries/hardfault/nrf52 \
- components/libraries/hardfault/nrf52/handler \
- components/libraries/atomic \
- components/libraries/queue \
- components/libraries/serial \
- components/libraries/strerror \
- components/libraries/bsp \
- integration \
- integration/nrfx \
- integration/nrfx/legacy \
- components/drivers_nrf \
- components/drivers_nrf/nrf_soc_nosd \
- modules \
- modules/nrfx \
- modules/nrfx/drivers \
- modules/nrfx/drivers/src \
- modules/nrfx/drivers/src/prs \
- modules/nrfx/mdk
-
- # Include folders common to all targets
- EXTRAINCDIRS += \
- $(SDK_ROOT)/components \
- $(SDK_ROOT)/modules/nrfx/mdk \
- $(SDK_ROOT)/components/libraries/scheduler \
- $(SDK_ROOT)/components/libraries/experimental_log \
- $(SDK_ROOT)/components/libraries/queue \
- $(SDK_ROOT)/components/libraries/timer \
- $(SDK_ROOT)/components/libraries/strerror \
- $(SDK_ROOT)/components/libraries/serial \
- $(SDK_ROOT)/components/toolchain/cmsis/include \
- $(SDK_ROOT)/components/libraries/util \
- $(SDK_ROOT)/components/libraries/bsp \
- ../config \
- $(SDK_ROOT)/components/libraries/balloc \
- $(SDK_ROOT)/components/libraries/hardfault/nrf52 \
- $(SDK_ROOT)/modules/nrfx/hal \
- $(SDK_ROOT)/components/libraries/hardfault \
- $(SDK_ROOT)/components/libraries/button \
- $(SDK_ROOT)/modules/nrfx \
- $(SDK_ROOT)/components/libraries/experimental_section_vars \
- $(SDK_ROOT)/integration/nrfx/legacy \
- $(SDK_ROOT)/components/libraries/mutex \
- $(PROJ_DIR) \
- $(SDK_ROOT)/components/libraries/experimental_log/src \
- $(SDK_ROOT)/components/libraries/delay \
- $(SDK_ROOT)/integration/nrfx \
- $(SDK_ROOT)/components/drivers_nrf/nrf_soc_nosd \
- $(SDK_ROOT)/components/libraries/atomic \
- $(SDK_ROOT)/components/boards \
- $(SDK_ROOT)/components/libraries/experimental_memobj \
- $(SDK_ROOT)/modules/nrfx/drivers/include \
- $(SDK_ROOT)/external/nrf_cc310/include \
- $(SDK_ROOT)/external/nrf_cc310/common \
- # Optimization flags
- OPT = 3
- # Uncomment the line below to enable link time optimization
- #CFLAGS += -flto
- # C flags common to all targets
- CFLAGS += -O$(OPT)
- CFLAGS += -DBOARD_CW308T_NRF52840
- CFLAGS += -DCONFIG_GPIO_AS_PINRESET
- CFLAGS += -DDEBUG
- CFLAGS += -DDEBUG_NRF
- CFLAGS += -DFLOAT_ABI_HARD
- CFLAGS += -DNRF52840_XXAA
- #CFLAGS += -DSWI_DISABLE0
- CFLAGS += -mcpu=cortex-m4
- CFLAGS += -mthumb -mabi=aapcs
- CFLAGS += -Wall
- CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
- # keep every function in a separate section, this allows linker to discard unused ones
- CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
- CFLAGS += -fno-builtin -fshort-enums
- # C++ flags common to all targets
- CXXFLAGS += -O$(OPT)
- # Assembler flags common to all targets
- ASFLAGS += -g3
- ASFLAGS += -mcpu=cortex-m4
- ASFLAGS += -mthumb -mabi=aapcs
- ASFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
- ASFLAGS += -DBOARD_CW308T_NRF52840
- ASFLAGS += -DCONFIG_GPIO_AS_PINRESET
- ASFLAGS += -DDEBUG
- ASFLAGS += -DDEBUG_NRF
- ASFLAGS += -DFLOAT_ABI_HARD
- ASFLAGS += -DNRF52840_XXAA
- ASFLAGS += -DSWI_DISABLE0
- # Linker flags
- LDFLAGS += -O$(OPT)
- LDFLAGS += -mthumb -mabi=aapcs -L$(SDK_ROOT)/modules/nrfx/mdk -T$(LINKER_SCRIPT)
- LDFLAGS += -mcpu=cortex-m4
- LDFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
- # let linker dump unused sections
- LDFLAGS += -Wl,--gc-sections
- # use newlib in nano version
- LDFLAGS += --specs=nano.specs
- nrf52840_xxaa: CFLAGS += -D__HEAP_SIZE=8192
- nrf52840_xxaa: CFLAGS += -D__STACK_SIZE=8192
- nrf52840_xxaa: ASMFLAGS += -D__HEAP_SIZE=8192
- nrf52840_xxaa: ASMFLAGS += -D__STACK_SIZE=8192
- LDFLAGS += -L $(SDK_ROOT)/external/nrf_cc310/lib/ -l:libnrf_cc310_0.9.9.a
- # Add standard libraries at the very end of the linker input, after all objects
- # that may need symbols provided by these libraries.
- LDFLAGS += -lc -lnosys -lm
|