This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Make unable to find routines when linking

I am attempting to build some ptorotype code using SDK 12.2.0 and GCC and I just added calls to the app_schedukler library and to the saadc driver. I added the relevant source and include paths to the makefile, the appropriate source files are being built and placed in the _build folder. However, the linker is unable to find the routines I am calling. I have compared my makefile to some of the Nordic example makefiles but I was unable to identify what the problem is. I suspect there is something simple I am missing.

The output that is displayed in the Console tab of Eclipse is as follows:

07:44:16 **** Build of configuration Default for project dumb_stim_pulse_generator_CStim_1_0_0_SDK_12_2 ****
make VERBOSE=1 all 
mkdir _build
Compiling file: nrf_log_backend_serial.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_nrf_log_backend_serial.c.o ../../../../../../components/libraries/log/src/nrf_log_backend_serial.c
Compiling file: nrf_log_frontend.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_nrf_log_frontend.c.o ../../../../../../components/libraries/log/src/nrf_log_frontend.c
Compiling file: app_error.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_app_error.c.o ../../../../../../components/libraries/util/app_error.c
Compiling file: app_error_weak.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_app_error_weak.c.o ../../../../../../components/libraries/util/app_error_weak.c
Compiling file: app_util_platform.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_app_util_platform.c.o ../../../../../../components/libraries/util/app_util_platform.c
Compiling file: nrf_assert.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_nrf_assert.c.o ../../../../../../components/libraries/util/nrf_assert.c
Compiling file: sdk_errors.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_sdk_errors.c.o ../../../../../../components/libraries/util/sdk_errors.c
Compiling file: app_scheduler.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_app_scheduler.c.o ../../../../../../components/libraries/scheduler/app_scheduler.c
Compiling file: boards.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_boards.c.o ../../../../../../components/boards/boards.c
Compiling file: nrf_drv_common.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_nrf_drv_common.c.o ../../../../../../components/drivers_nrf/common/nrf_drv_common.c
Compiling file: nrf_drv_twi.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_nrf_drv_twi.c.o ../../../../../../components/drivers_nrf/twi_master/nrf_drv_twi.c
Compiling file: nrf_drv_uart.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_nrf_drv_uart.c.o ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.c
Compiling file: nrf_drv_timer.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_nrf_drv_timer.c.o ../../../../../../components/drivers_nrf/timer/nrf_drv_timer.c
Compiling file: nrf_drv_saadc.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_nrf_drv_saadc.c.o ../../../../../../components/drivers_nrf/saadc/nrf_drv_saadc.c
Compiling file: main.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_main.c.o ../../../main.c
Compiling file: RTT_Syscalls_GCC.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_RTT_Syscalls_GCC.c.o ../../../../../../external/segger_rtt/RTT_Syscalls_GCC.c
Compiling file: SEGGER_RTT.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_SEGGER_RTT.c.o ../../../../../../external/segger_rtt/SEGGER_RTT.c
Compiling file: SEGGER_RTT_printf.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_SEGGER_RTT_printf.c.o ../../../../../../external/segger_rtt/SEGGER_RTT_printf.c
Assembling file: gcc_startup_nrf52.S
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -x assembler-with-cpp -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_gcc_startup_nrf52.S.o ../../../../../../components/toolchain/gcc/gcc_startup_nrf52.S
Compiling file: system_nrf52.c
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -std=c99 -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52 -DNRF52_PAN_51 -DNRF52_PAN_36 -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_64 -DNRF52_PAN_55 -DBOARD_CStim_1_0_0 -DNRF52_PAN_31 -DNRF52832 -DBSP_DEFINES_ONLY -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wall -Werror -O0 -g3 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums  -I../../../../../../components   -I../../../../../../components/libraries/util   -I../../../../../../components/toolchain/gcc   -I../../../../../../components/drivers_nrf/uart   -I../../../../../../components/drivers_nrf/timer   -I../../../../../../components/drivers_nrf/saadc   -I../config   -I../../../../../../components/drivers_nrf/common   -I../../..   -I../../../../../../components/drivers_nrf/twi_master   -I../../../../../../external/segger_rtt   -I../../../../../../components/libraries/bsp   -I../../../../../../components/drivers_nrf/nrf_soc_nosd   -I../../../../../../components/toolchain   -I../../../../../../components/device   -I../../../../../../components/libraries/log   -I../../../../../../components/boards   -I../../../../../../components/drivers_nrf/delay   -I../../../../../../components/toolchain/cmsis/include   -I../../../../../../components/drivers_nrf/hal   -I../../../../../../components/libraries/scheduler   -I../../../../../../components/libraries/log/src -c -o _build/nrf52832_xxaa_system_nrf52.c.o ../../../../../../components/toolchain/system_nrf52.c
Linking target: _build/nrf52832_xxaa.out
'C:/Program Files/GNU Tools ARM Embedded/5.3 2016q1/bin/arm-none-eabi-gcc' -Wl,-Map=_build/nrf52832_xxaa.map -mthumb -mabi=aapcs -L ../../../../../../components/toolchain/gcc -Tdumb_stim_pulse_generator_gcc_nrf52.ld -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys _build/nrf52832_xxaa_nrf_log_backend_serial.c.o _build/nrf52832_xxaa_nrf_log_frontend.c.o _build/nrf52832_xxaa_app_error.c.o _build/nrf52832_xxaa_app_error_weak.c.o _build/nrf52832_xxaa_app_util_platform.c.o _build/nrf52832_xxaa_nrf_assert.c.o _build/nrf52832_xxaa_sdk_errors.c.o _build/nrf52832_xxaa_app_scheduler.c.o _build/nrf52832_xxaa_boards.c.o _build/nrf52832_xxaa_nrf_drv_common.c.o _build/nrf52832_xxaa_nrf_drv_twi.c.o _build/nrf52832_xxaa_nrf_drv_uart.c.o _build/nrf52832_xxaa_nrf_drv_timer.c.o _build/nrf52832_xxaa_nrf_drv_saadc.c.o _build/nrf52832_xxaa_main.c.o _build/nrf52832_xxaa_RTT_Syscalls_GCC.c.o _build/nrf52832_xxaa_SEGGER_RTT.c.o _build/nrf52832_xxaa_SEGGER_RTT_printf.c.o _build/nrf52832_xxaa_gcc_startup_nrf52.S.o _build/nrf52832_xxaa_system_nrf52.c.o  -lm -o _build/nrf52832_xxaa.out
_build/nrf52832_xxaa_main.c.o: In function `saadc_callback':
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:363: undefined reference to `nrf_drv_saadc_buffer_convert'
_build/nrf52832_xxaa_main.c.o: In function `ADC_Sampling_Initiate':
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:401: undefined reference to `nrf_drv_saadc_channel_init'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:403: undefined reference to `nrf_drv_saadc_channel_init'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:405: undefined reference to `nrf_drv_saadc_buffer_convert'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:407: undefined reference to `nrf_drv_saadc_sample'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:421: undefined reference to `nrf_drv_saadc_channel_init'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:423: undefined reference to `nrf_drv_saadc_buffer_convert'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:425: undefined reference to `nrf_drv_saadc_sample'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:440: undefined reference to `nrf_drv_saadc_channel_init'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:442: undefined reference to `nrf_drv_saadc_channel_init'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:444: undefined reference to `nrf_drv_saadc_buffer_convert'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:446: undefined reference to `nrf_drv_saadc_sample'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:460: undefined reference to `nrf_drv_saadc_channel_init'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:462: undefined reference to `nrf_drv_saadc_buffer_convert'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:464: undefined reference to `nrf_drv_saadc_sample'
_build/nrf52832_xxaa_main.c.o: In function `timer_event_handler':
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:692: undefined reference to `app_sched_event_put'
_build/nrf52832_xxaa_main.c.o: In function `scheduler_init':
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:722: undefined reference to `app_sched_init'
_build/nrf52832_xxaa_main.c.o: In function `main':
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:741: undefined reference to `nrf_drv_saadc_init'
C:\Nordic_nRF52_Development\nRF5_SDK_12.2.0_f012efa\RHT_Test_Projects\peripheral\dumb_stim_pulse_generator\CStim_1_0_0\blank\armgcc/../../../main.c:834: undefined reference to `app_sched_execute'
collect2.exe: error: ld returned 1 exit status
make: *** [_build/nrf52832_xxaa.out] Error 1

07:44:30 Build Finished (took 13s.446ms)

The relevant object files are being passed to ld but it seems they are being ignored.

The contents of my Makefile are as follows:

    PROJECT_NAME     := dumb_stim_pulse_generator_CStim_1_0_0
TARGETS          := nrf52832_xxaa
OUTPUT_DIRECTORY := _build

SDK_ROOT := ../../../../../..
PROJ_DIR := ../../..

$(OUTPUT_DIRECTORY)/nrf52832_xxaa.out: \
  LINKER_SCRIPT  := dumb_stim_pulse_generator_gcc_nrf52.ld

# Source files common to all targets
SRC_FILES += \
  $(SDK_ROOT)/components/libraries/log/src/nrf_log_backend_serial.c \
  $(SDK_ROOT)/components/libraries/log/src/nrf_log_frontend.c \
  $(SDK_ROOT)/components/libraries/util/app_error.c \
  $(SDK_ROOT)/components/libraries/util/app_error_weak.c \
  $(SDK_ROOT)/components/libraries/util/app_util_platform.c \
  $(SDK_ROOT)/components/libraries/util/nrf_assert.c \
  $(SDK_ROOT)/components/libraries/util/sdk_errors.c \
  $(SDK_ROOT)/components/libraries/scheduler/app_scheduler.c \
  $(SDK_ROOT)/components/boards/boards.c \
  $(SDK_ROOT)/components/drivers_nrf/common/nrf_drv_common.c \
  $(SDK_ROOT)/components/drivers_nrf/twi_master/nrf_drv_twi.c \
  $(SDK_ROOT)/components/drivers_nrf/uart/nrf_drv_uart.c \
  $(SDK_ROOT)/components/drivers_nrf/timer/nrf_drv_timer.c \
  $(SDK_ROOT)/components/drivers_nrf/saadc/nrf_drv_saadc.c \
  $(PROJ_DIR)/main.c \
  $(SDK_ROOT)/external/segger_rtt/RTT_Syscalls_GCC.c \
  $(SDK_ROOT)/external/segger_rtt/SEGGER_RTT.c \
  $(SDK_ROOT)/external/segger_rtt/SEGGER_RTT_printf.c \
  $(SDK_ROOT)/components/toolchain/gcc/gcc_startup_nrf52.S \
  $(SDK_ROOT)/components/toolchain/system_nrf52.c \

# Include folders common to all targets
INC_FOLDERS += \
  $(SDK_ROOT)/components \
  $(SDK_ROOT)/components/libraries/util \
  $(SDK_ROOT)/components/toolchain/gcc \
  $(SDK_ROOT)/components/drivers_nrf/uart \
  $(SDK_ROOT)/components/drivers_nrf/timer \
  $(SDK_ROOT)/components/drivers_nrf/saadc \
  ../config \
  $(SDK_ROOT)/components/drivers_nrf/common \
  $(PROJ_DIR) \
  $(SDK_ROOT)/components/drivers_nrf/twi_master \
  $(SDK_ROOT)/external/segger_rtt \
  $(SDK_ROOT)/components/libraries/bsp \
  $(SDK_ROOT)/components/drivers_nrf/nrf_soc_nosd \
  $(SDK_ROOT)/components/toolchain \
  $(SDK_ROOT)/components/device \
  $(SDK_ROOT)/components/libraries/log \
  $(SDK_ROOT)/components/boards \
  $(SDK_ROOT)/components/drivers_nrf/delay \
  $(SDK_ROOT)/components/toolchain/cmsis/include \
  $(SDK_ROOT)/components/drivers_nrf/hal \
  $(SDK_ROOT)/components/libraries/scheduler \
  $(SDK_ROOT)/components/libraries/log/src \

# Libraries common to all targets
LIB_FILES += \

# C flags common to all targets
CFLAGS += -DNRF52_PAN_12
CFLAGS += -DNRF52_PAN_15
CFLAGS += -DNRF52_PAN_58
CFLAGS += -DNRF52_PAN_20
CFLAGS += -DNRF52_PAN_54
CFLAGS += -DNRF52
CFLAGS += -DNRF52_PAN_51
CFLAGS += -DNRF52_PAN_36
CFLAGS += -DCONFIG_GPIO_AS_PINRESET
CFLAGS += -DNRF52_PAN_64
CFLAGS += -DNRF52_PAN_55
CFLAGS += -DBOARD_CStim_1_0_0
CFLAGS += -DNRF52_PAN_31
CFLAGS += -DNRF52832
CFLAGS += -DBSP_DEFINES_ONLY
CFLAGS += -mcpu=cortex-m4
CFLAGS += -mthumb -mabi=aapcs
CFLAGS +=  -Wall -Werror -O0 -g3
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
# keep every function in separate section, this allows linker to discard unused ones
CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
CFLAGS += -fno-builtin --short-enums 

# C++ flags common to all targets
CXXFLAGS += \

# Assembler flags common to all targets
ASMFLAGS += -x assembler-with-cpp
ASMFLAGS += -DNRF52_PAN_12
ASMFLAGS += -DNRF52_PAN_15
ASMFLAGS += -DNRF52_PAN_58
ASMFLAGS += -DNRF52_PAN_20
ASMFLAGS += -DNRF52_PAN_54
ASMFLAGS += -DNRF52
ASMFLAGS += -DNRF52_PAN_51
ASMFLAGS += -DNRF52_PAN_36
ASMFLAGS += -DCONFIG_GPIO_AS_PINRESET
ASMFLAGS += -DNRF52_PAN_64
ASMFLAGS += -DNRF52_PAN_55
ASMFLAGS += -DBOARD_CStim_1_0_0
ASMFLAGS += -DNRF52_PAN_31
ASMFLAGS += -DNRF52832
ASMFLAGS += -DBSP_DEFINES_ONLY

# Linker flags
LDFLAGS += -mthumb -mabi=aapcs -L $(TEMPLATE_PATH) -T$(LINKER_SCRIPT)
LDFLAGS += -mcpu=cortex-m4
LDFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
# let linker to dump unused sections
LDFLAGS += -Wl,--gc-sections
# use newlib in nano version
LDFLAGS += --specs=nano.specs -lc -lnosys


.PHONY: $(TARGETS) default all clean help flash 

# Default target - first one defined
default: nrf52832_xxaa

# Print all targets that can be built
help:
	@echo following targets are available:
	@echo 	nrf52832_xxaa

TEMPLATE_PATH := $(SDK_ROOT)/components/toolchain/gcc

include $(TEMPLATE_PATH)/Makefile.common

$(foreach target, $(TARGETS), $(call define_target, $(target)))

# Flash the program
flash: $(OUTPUT_DIRECTORY)/nrf52832_xxaa.hex
	@echo Flashing: $<
	nrfjprog --program $< -f nrf52 --sectorerase
	nrfjprog --reset -f nrf52

erase:
	nrfjprog --eraseall -f nrf52

Feel free to embarass me by pointing out anything simple I have missed.

Related