Resolving merge requst issues

This commit is contained in:
Odri Tomas
2019-03-07 14:14:11 +01:00
parent 328c3c28e1
commit 264ff762af
19 changed files with 61301 additions and 23065 deletions
+399 -408
View File
@@ -1,408 +1,399 @@
PROJECT_NAME := ble_app_hrs_freertos_pca10040_s132
TARGETS := nrf52832_xxaa
OUTPUT_DIRECTORY := _build
SDK_ROOT := ../../nRF5_SDK_15.2.0
PROJ_DIR := ../
# edit toolchain path
#GNU_INSTALL_ROOT ?= /home/karlo/gnu_arm_embedded/bin/
#GNU_VERSION ?= 6.3.1
#GNU_PREFIX ?= arm-none-eabi
$(OUTPUT_DIRECTORY)/nrf52832_xxaa.out: \
LINKER_SCRIPT := ble_app_hrs_freertos_gcc_nrf52.ld
PROJ_SRC += \
$(PROJ_DIR)/source/main.cpp \
$(PROJ_DIR)/aconnoHelpers/aconnoHelpers.cpp \
$(PROJ_DIR)/tasks/aconnoTasks.cpp \
$(PROJ_DIR)/aconnoBLE/aconnoBLE.cpp \
$(PROJ_DIR)/aconnoBLE/aconnoGAP.cpp \
$(PROJ_DIR)/aconnoBLE/aconnoGATT.cpp \
$(PROJ_DIR)/aconnoBLE/aconnoBLEChar.cpp \
$(PROJ_DIR)/aconnoBLE/aconnoBLEService.cpp \
$(PROJ_DIR)/aconnoBLE/bleCus.cpp \
$(PROJ_DIR)/slots_and_params/settings.cpp \
$(PROJ_DIR)/slots_and_params/config_params.cpp \
$(PROJ_DIR)/slots_and_params/basic_config.cpp \
$(PROJ_DIR)/slots_and_params/arb_data.cpp \
$(PROJ_DIR)/libs/aconnoGPIO/aconnoGPIO.cpp \
$(PROJ_DIR)/libs/aconnoNordicPAL/aconnoNordicPAL.cpp \
$(PROJ_DIR)/aconnoHelpers/menuStates.cpp \
\
$(PROJ_DIR)/libs/aconnoI2C/aconnoI2C.cpp \
$(PROJ_DIR)/libs/aconnoSPI/aconnoSPI.cpp \
$(PROJ_DIR)/libs/GDEP015OC1/GDEP015OC1.cpp \
$(PROJ_DIR)/libs/MCP23017/MCP23017.cpp \
\
$(SDK_ROOT)/integration/nrfx/legacy/nrf_drv_twi.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_twi.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_twim.c \
\
$(SDK_ROOT)/integration/nrfx/legacy/nrf_drv_spi.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_spi.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_spim.c \
PROJ_INC += \
$(PROJ_DIR)/libs/aconnoGPIO \
$(PROJ_DIR)/libs/aconnoNordicPAL \
$(PROJ_DIR)/config/ \
$(PROJ_DIR)/aconnoHelpers/ \
$(PROJ_DIR)/tasks/ \
$(PROJ_DIR)/aconnoBLE/ \
$(PROJ_DIR)/slots_and_params/ \
\
$(PROJ_DIR)/libs/aconnoI2C \
$(PROJ_DIR)/libs/aconnoSPI \
$(PROJ_DIR)/libs/GDEP015OC1 \
$(PROJ_DIR)/libs/MCP23017 \
#$(PROJ_DIR)/BLE/nordicBLE/ \
# Source files common to all targets
SRC_FILES += \
$(PROJ_SRC) \
$(SDK_ROOT)/modules/nrfx/mdk/gcc_startup_nrf52.S \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_backend_rtt.c \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_backend_serial.c \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_backend_uart.c \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_default_backends.c \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_frontend.c \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_str_formatter.c \
$(SDK_ROOT)/components/libraries/button/app_button.c \
$(SDK_ROOT)/components/libraries/util/app_error.c \
$(SDK_ROOT)/components/libraries/util/app_error_handler_gcc.c \
$(SDK_ROOT)/components/libraries/util/app_error_weak.c \
$(SDK_ROOT)/components/libraries/timer/app_timer_freertos.c \
$(SDK_ROOT)/components/libraries/util/app_util_platform.c \
$(SDK_ROOT)/components/libraries/crc16/crc16.c \
$(SDK_ROOT)/components/libraries/fds/fds.c \
$(SDK_ROOT)/components/libraries/hardfault/nrf52/handler/hardfault_handler_gcc.c \
$(SDK_ROOT)/components/libraries/hardfault/hardfault_implementation.c \
$(SDK_ROOT)/components/libraries/util/nrf_assert.c \
$(SDK_ROOT)/components/libraries/atomic_fifo/nrf_atfifo.c \
$(SDK_ROOT)/components/libraries/atomic_flags/nrf_atflags.c \
$(SDK_ROOT)/components/libraries/atomic/nrf_atomic.c \
$(SDK_ROOT)/components/libraries/balloc/nrf_balloc.c \
$(SDK_ROOT)/external/fprintf/nrf_fprintf.c \
$(SDK_ROOT)/external/fprintf/nrf_fprintf_format.c \
$(SDK_ROOT)/components/libraries/fstorage/nrf_fstorage.c \
$(SDK_ROOT)/components/libraries/fstorage/nrf_fstorage_sd.c \
$(SDK_ROOT)/components/libraries/memobj/nrf_memobj.c \
$(SDK_ROOT)/components/libraries/ringbuf/nrf_ringbuf.c \
$(SDK_ROOT)/components/libraries/experimental_section_vars/nrf_section_iter.c \
$(SDK_ROOT)/components/libraries/strerror/nrf_strerror.c \
$(SDK_ROOT)/components/libraries/sensorsim/sensorsim.c \
$(SDK_ROOT)/modules/nrfx/mdk/system_nrf52.c \
$(SDK_ROOT)/external/freertos/source/croutine.c \
$(SDK_ROOT)/external/freertos/source/event_groups.c \
$(SDK_ROOT)/external/freertos/source/portable/MemMang/heap_1.c \
$(SDK_ROOT)/external/freertos/source/list.c \
$(SDK_ROOT)/external/freertos/portable/GCC/nrf52/port.c \
$(SDK_ROOT)/external/freertos/portable/CMSIS/nrf52/port_cmsis.c \
$(SDK_ROOT)/external/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c \
$(SDK_ROOT)/external/freertos/source/queue.c \
$(SDK_ROOT)/external/freertos/source/stream_buffer.c \
$(SDK_ROOT)/external/freertos/source/tasks.c \
$(SDK_ROOT)/external/freertos/source/timers.c \
$(SDK_ROOT)/components/boards/boards.c \
$(SDK_ROOT)/integration/nrfx/legacy/nrf_drv_clock.c \
$(SDK_ROOT)/integration/nrfx/legacy/nrf_drv_uart.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_clock.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_gpiote.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_power_clock.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/prs/nrfx_prs.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_uart.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_uarte.c \
$(SDK_ROOT)/components/libraries/bsp/bsp.c \
$(SDK_ROOT)/components/libraries/bsp/bsp_btn_ble.c \
$(SDK_ROOT)/external/segger_rtt/SEGGER_RTT.c \
$(SDK_ROOT)/external/segger_rtt/SEGGER_RTT_Syscalls_GCC.c \
$(SDK_ROOT)/external/segger_rtt/SEGGER_RTT_printf.c \
$(SDK_ROOT)/components/ble/peer_manager/auth_status_tracker.c \
$(SDK_ROOT)/components/ble/common/ble_advdata.c \
$(SDK_ROOT)/components/ble/ble_advertising/ble_advertising.c \
$(SDK_ROOT)/components/ble/common/ble_conn_params.c \
$(SDK_ROOT)/components/ble/common/ble_conn_state.c \
$(SDK_ROOT)/components/ble/common/ble_srv_common.c \
$(SDK_ROOT)/components/ble/peer_manager/gatt_cache_manager.c \
$(SDK_ROOT)/components/ble/peer_manager/gatts_cache_manager.c \
$(SDK_ROOT)/components/ble/peer_manager/id_manager.c \
$(SDK_ROOT)/components/ble/nrf_ble_gatt/nrf_ble_gatt.c \
$(SDK_ROOT)/components/ble/nrf_ble_qwr/nrf_ble_qwr.c \
$(SDK_ROOT)/components/ble/peer_manager/peer_data_storage.c \
$(SDK_ROOT)/components/ble/peer_manager/peer_database.c \
$(SDK_ROOT)/components/ble/peer_manager/peer_id.c \
$(SDK_ROOT)/components/ble/peer_manager/peer_manager.c \
$(SDK_ROOT)/components/ble/peer_manager/peer_manager_handler.c \
$(SDK_ROOT)/components/ble/peer_manager/pm_buffer.c \
$(SDK_ROOT)/components/ble/peer_manager/security_dispatcher.c \
$(SDK_ROOT)/components/ble/peer_manager/security_manager.c \
$(SDK_ROOT)/external/utf_converter/utf.c \
$(SDK_ROOT)/components/ble/ble_services/ble_bas/ble_bas.c \
$(SDK_ROOT)/components/ble/ble_services/ble_dis/ble_dis.c \
$(SDK_ROOT)/components/ble/ble_services/ble_hrs/ble_hrs.c \
$(SDK_ROOT)/components/softdevice/common/nrf_sdh.c \
$(SDK_ROOT)/components/softdevice/common/nrf_sdh_ble.c \
$(SDK_ROOT)/components/softdevice/common/nrf_sdh_freertos.c \
$(SDK_ROOT)/components/softdevice/common/nrf_sdh_soc.c \
# Include folders common to all targets
INC_FOLDERS += \
$(PROJ_INC) \
$(SDK_ROOT)/components/nfc/ndef/generic/message \
$(SDK_ROOT)/components/nfc/t2t_lib \
$(SDK_ROOT)/components/nfc/t4t_parser/hl_detection_procedure \
$(SDK_ROOT)/components/ble/ble_services/ble_ancs_c \
$(SDK_ROOT)/components/ble/ble_services/ble_ias_c \
$(SDK_ROOT)/components/libraries/pwm \
$(SDK_ROOT)/components/softdevice/s132/headers/nrf52 \
$(SDK_ROOT)/components/libraries/usbd/class/cdc/acm \
$(SDK_ROOT)/components/libraries/usbd/class/hid/generic \
$(SDK_ROOT)/components/libraries/usbd/class/msc \
$(SDK_ROOT)/components/libraries/usbd/class/hid \
$(SDK_ROOT)/modules/nrfx/hal \
$(SDK_ROOT)/components/nfc/ndef/conn_hand_parser/le_oob_rec_parser \
$(SDK_ROOT)/components/libraries/log \
$(SDK_ROOT)/components/ble/ble_services/ble_gls \
$(SDK_ROOT)/components/libraries/fstorage \
$(SDK_ROOT)/components/nfc/ndef/text \
$(SDK_ROOT)/components/libraries/mutex \
$(SDK_ROOT)/components/libraries/gpiote \
$(SDK_ROOT)/components/libraries/bootloader/ble_dfu \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/common \
$(SDK_ROOT)/components/boards \
$(SDK_ROOT)/components/nfc/ndef/generic/record \
$(SDK_ROOT)/components/nfc/t4t_parser/cc_file \
$(SDK_ROOT)/components/ble/ble_advertising \
$(SDK_ROOT)/external/utf_converter \
$(SDK_ROOT)/components/ble/ble_services/ble_bas_c \
$(SDK_ROOT)/modules/nrfx/drivers/include \
$(SDK_ROOT)/components/libraries/experimental_task_manager \
$(SDK_ROOT)/components/ble/ble_services/ble_hrs_c \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/le_oob_rec \
$(SDK_ROOT)/components/libraries/queue \
$(SDK_ROOT)/components/libraries/pwr_mgmt \
$(SDK_ROOT)/external/freertos/portable/GCC/nrf52 \
$(SDK_ROOT)/components/ble/ble_dtm \
$(SDK_ROOT)/components/toolchain/cmsis/include \
$(SDK_ROOT)/components/ble/ble_services/ble_rscs_c \
$(SDK_ROOT)/components/ble/common \
$(SDK_ROOT)/components/ble/ble_services/ble_lls \
$(SDK_ROOT)/components/libraries/hardfault/nrf52 \
$(SDK_ROOT)/components/libraries/bsp \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/ac_rec \
$(SDK_ROOT)/components/ble/ble_services/ble_bas \
$(SDK_ROOT)/components/libraries/mpu \
$(SDK_ROOT)/components/libraries/experimental_section_vars \
$(SDK_ROOT)/components/softdevice/s132/headers \
$(SDK_ROOT)/components/ble/ble_services/ble_ans_c \
$(SDK_ROOT)/components/libraries/slip \
$(SDK_ROOT)/components/libraries/delay \
$(SDK_ROOT)/components/libraries/mem_manager \
$(SDK_ROOT)/components/libraries/csense_drv \
$(SDK_ROOT)/components/libraries/memobj \
$(SDK_ROOT)/components/ble/ble_services/ble_nus_c \
$(SDK_ROOT)/components/softdevice/common \
$(SDK_ROOT)/components/ble/ble_services/ble_ias \
$(SDK_ROOT)/components/libraries/usbd/class/hid/mouse \
$(SDK_ROOT)/components/libraries/low_power_pwm \
$(SDK_ROOT)/components/nfc/ndef/conn_hand_parser/ble_oob_advdata_parser \
$(SDK_ROOT)/components/ble/ble_services/ble_dfu \
$(SDK_ROOT)/external/fprintf \
$(SDK_ROOT)/components/libraries/svc \
$(SDK_ROOT)/components/libraries/atomic \
$(SDK_ROOT)/components \
$(SDK_ROOT)/components/libraries/scheduler \
$(SDK_ROOT)/components/libraries/cli \
$(SDK_ROOT)/components/ble/ble_services/ble_lbs \
$(SDK_ROOT)/components/ble/ble_services/ble_hts \
$(SDK_ROOT)/components/libraries/crc16 \
$(SDK_ROOT)/components/nfc/t4t_parser/apdu \
$(SDK_ROOT)/external/freertos/config \
$(SDK_ROOT)/components/libraries/util \
$(SDK_ROOT)/external/freertos/portable/CMSIS/nrf52 \
../config \
$(SDK_ROOT)/components/libraries/usbd/class/cdc \
$(SDK_ROOT)/components/libraries/csense \
$(SDK_ROOT)/components/libraries/balloc \
$(SDK_ROOT)/components/libraries/ecc \
$(SDK_ROOT)/components/libraries/hardfault \
$(SDK_ROOT)/components/ble/ble_services/ble_cscs \
$(SDK_ROOT)/components/libraries/hci \
$(SDK_ROOT)/components/libraries/usbd/class/hid/kbd \
$(SDK_ROOT)/components/libraries/timer \
$(SDK_ROOT)/integration/nrfx \
$(SDK_ROOT)/components/nfc/t4t_parser/tlv \
$(SDK_ROOT)/components/libraries/sortlist \
$(SDK_ROOT)/components/libraries/spi_mngr \
$(SDK_ROOT)/components/libraries/led_softblink \
$(SDK_ROOT)/components/nfc/ndef/conn_hand_parser \
$(SDK_ROOT)/components/libraries/sdcard \
$(SDK_ROOT)/components/nfc/ndef/parser/record \
$(SDK_ROOT)/modules/nrfx/mdk \
$(SDK_ROOT)/components/ble/ble_services/ble_cts_c \
$(SDK_ROOT)/components/ble/ble_services/ble_nus \
$(SDK_ROOT)/components/libraries/twi_mngr \
$(SDK_ROOT)/components/ble/ble_services/ble_hids \
$(SDK_ROOT)/components/libraries/strerror \
$(SDK_ROOT)/components/libraries/crc32 \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/ble_oob_advdata \
$(SDK_ROOT)/components/nfc/t2t_parser \
$(SDK_ROOT)/external/freertos/source/include \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/ble_pair_msg \
$(SDK_ROOT)/components/libraries/usbd/class/audio \
$(SDK_ROOT)/components/nfc/t4t_lib/hal_t4t \
$(SDK_ROOT)/components/libraries/sensorsim \
$(SDK_ROOT)/components/nfc/t4t_lib \
$(SDK_ROOT)/components/ble/peer_manager \
$(SDK_ROOT)/components/drivers_nrf/usbd \
$(SDK_ROOT)/components/libraries/ringbuf \
$(SDK_ROOT)/components/ble/ble_services/ble_tps \
$(SDK_ROOT)/components/nfc/ndef/parser/message \
$(SDK_ROOT)/components/ble/ble_services/ble_dis \
$(SDK_ROOT)/components/nfc/ndef/uri \
$(SDK_ROOT)/components/ble/nrf_ble_gatt \
$(SDK_ROOT)/components/ble/nrf_ble_qwr \
$(SDK_ROOT)/components/libraries/gfx \
$(SDK_ROOT)/components/libraries/button \
$(SDK_ROOT)/modules/nrfx \
$(SDK_ROOT)/components/libraries/twi_sensor \
$(SDK_ROOT)/integration/nrfx/legacy \
$(SDK_ROOT)/components/libraries/usbd \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/ep_oob_rec \
$(SDK_ROOT)/external/segger_rtt \
$(SDK_ROOT)/components/libraries/atomic_fifo \
$(SDK_ROOT)/components/ble/ble_services/ble_lbs_c \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/ble_pair_lib \
$(SDK_ROOT)/components/libraries/crypto \
$(SDK_ROOT)/components/ble/ble_racp \
$(SDK_ROOT)/components/libraries/fds \
$(SDK_ROOT)/components/nfc/ndef/launchapp \
$(SDK_ROOT)/components/libraries/atomic_flags \
$(SDK_ROOT)/components/ble/ble_services/ble_hrs \
$(SDK_ROOT)/components/ble/ble_services/ble_rscs \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/hs_rec \
$(SDK_ROOT)/components/nfc/t2t_lib/hal_t2t \
$(SDK_ROOT)/components/nfc/ndef/conn_hand_parser/ac_rec_parser \
$(SDK_ROOT)/components/libraries/stack_guard \
$(SDK_ROOT)/components/libraries/log/src \
# Libraries common to all targets
LIB_FILES += \
# Optimization flags
OPT = -O3 -g3
# Uncomment the line below to enable link time optimization
#OPT += -flto
# C flags common to all targets
CFLAGS += $(OPT)
CFLAGS += -DBOARD_PCA10040
#CFLAGS += -DCONFIG_GPIO_AS_PINRESET
CFLAGS += -DFLOAT_ABI_HARD
CFLAGS += -DFREERTOS
CFLAGS += -DNRF52
CFLAGS += -DNRF52832_XXAA
CFLAGS += -DNRF52_PAN_74
CFLAGS += -DNRF_SD_BLE_API_VERSION=6
CFLAGS += -DS132
CFLAGS += -DSOFTDEVICE_PRESENT
CFLAGS += -mcpu=cortex-m4
CFLAGS += -mthumb -mabi=aapcs
CFLAGS += -Wall
#CFLAGS += -Werror
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
CFLAGS += -DDEBUG
# C++ flags common to all targets
CXXFLAGS += $(OPT)
CXXFLAGS += -DDEBUG
# Assembler flags common to all targets
ASMFLAGS += -g3
ASMFLAGS += -mcpu=cortex-m4
ASMFLAGS += -mthumb -mabi=aapcs
ASMFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
ASMFLAGS += -DBOARD_PCA10040
#ASMFLAGS += -DCONFIG_GPIO_AS_PINRESET
ASMFLAGS += -DFLOAT_ABI_HARD
ASMFLAGS += -DFREERTOS
ASMFLAGS += -DNRF52
ASMFLAGS += -DNRF52832_XXAA
ASMFLAGS += -DNRF52_PAN_74
ASMFLAGS += -DNRF_SD_BLE_API_VERSION=6
ASMFLAGS += -DS132
ASMFLAGS += -DSOFTDEVICE_PRESENT
# Linker flags
LDFLAGS += $(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
nrf52832_xxaa: CFLAGS += -D__HEAP_SIZE=1024
nrf52832_xxaa: CFLAGS += -D__STACK_SIZE=2048
nrf52832_xxaa: ASMFLAGS += -D__HEAP_SIZE=1024
nrf52832_xxaa: ASMFLAGS += -D__STACK_SIZE=2048
# Add standard libraries at the very end of the linker input, after all objects
# that may need symbols provided by these libraries.
LIB_FILES += -lc -lnosys -lm -lstdc++
.PHONY: default help
# Default target - first one defined
default: nrf52832_xxaa
# Print all targets that can be built
help:
@echo following targets are available:
@echo nrf52832_xxaa
@echo flash_softdevice
@echo sdk_config - starting external tool for editing sdk_config.h
@echo flash - flashing binary
TEMPLATE_PATH := $(SDK_ROOT)/components/toolchain/gcc
include $(TEMPLATE_PATH)/Makefile.common
$(foreach target, $(TARGETS), $(call define_target, $(target)))
.PHONY: flash flash_softdevice erase
# Flash the program
flash: default
@echo Flashing: $(OUTPUT_DIRECTORY)/nrf52832_xxaa.hex
nrfjprog -f nrf52 --program $(OUTPUT_DIRECTORY)/nrf52832_xxaa.hex --sectorerase
nrfjprog -f nrf52 --reset
# Flash softdevice
flash_softdevice:
@echo Flashing: s132_nrf52_6.1.0_softdevice.hex
nrfjprog -f nrf52 --program $(SDK_ROOT)/components/softdevice/s132/hex/s132_nrf52_6.1.0_softdevice.hex --sectorerase
nrfjprog -f nrf52 --reset
erase:
nrfjprog -f nrf52 --eraseall
SDK_CONFIG_FILE := ../config/sdk_config.h
CMSIS_CONFIG_TOOL := $(SDK_ROOT)/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar
sdk_config:
java -jar $(CMSIS_CONFIG_TOOL) $(SDK_CONFIG_FILE)
PROJECT_NAME := ble_app_hrs_freertos_pca10040_s132
TARGETS := nrf52832_xxaa
OUTPUT_DIRECTORY := _build
SDK_ROOT := ../../nRF5_SDK_15.2.0
PROJ_DIR := ../
# edit toolchain path
GNU_INSTALL_ROOT ?= /usr/local/gcc_arm/gcc-arm-none-eabi-8-2018-q4-major/bin/
GNU_VERSION ?= 8.2.1
GNU_PREFIX ?= arm-none-eabi
$(OUTPUT_DIRECTORY)/nrf52832_xxaa.out: \
LINKER_SCRIPT := ble_app_hrs_freertos_gcc_nrf52.ld
PROJ_SRC += \
$(PROJ_DIR)/source/main.cpp \
$(PROJ_DIR)/aconnoHelpers/aconnoHelpers.cpp \
$(PROJ_DIR)/tasks/aconnoTasks.cpp \
$(PROJ_DIR)/aconnoBLE/aconnoBLE.cpp \
$(PROJ_DIR)/aconnoBLE/aconnoGAP.cpp \
$(PROJ_DIR)/aconnoBLE/aconnoGATT.cpp \
$(PROJ_DIR)/aconnoBLE/aconnoBLEChar.cpp \
$(PROJ_DIR)/aconnoBLE/aconnoBLEService.cpp \
$(PROJ_DIR)/aconnoBLE/bleCus.cpp \
$(PROJ_DIR)/slots_and_params/settings.cpp \
$(PROJ_DIR)/slots_and_params/config_params.cpp \
$(PROJ_DIR)/slots_and_params/basic_config.cpp \
$(PROJ_DIR)/slots_and_params/arb_data.cpp \
$(PROJ_DIR)/libs/aconnoGPIO/aconnoGPIO.cpp \
$(PROJ_DIR)/libs/aconnoNordicPAL/aconnoNordicPAL.cpp \
$(PROJ_DIR)/aconnoHelpers/menuStates.cpp \
$(PROJ_DIR)/libs/aconnoI2C/aconnoI2C.cpp \
$(PROJ_DIR)/libs/aconnoSPI/aconnoSPI.cpp \
$(PROJ_DIR)/libs/GDEP015OC1/GDEP015OC1.cpp \
$(PROJ_DIR)/libs/MCP23017/MCP23017.cpp \
$(SDK_ROOT)/integration/nrfx/legacy/nrf_drv_twi.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_twi.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_twim.c \
$(SDK_ROOT)/integration/nrfx/legacy/nrf_drv_spi.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_spi.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_spim.c \
PROJ_INC += \
$(PROJ_DIR)/libs/aconnoGPIO \
$(PROJ_DIR)/libs/aconnoNordicPAL \
$(PROJ_DIR)/config/ \
$(PROJ_DIR)/aconnoHelpers/ \
$(PROJ_DIR)/tasks/ \
$(PROJ_DIR)/aconnoBLE/ \
$(PROJ_DIR)/slots_and_params/ \
$(PROJ_DIR)/libs/aconnoI2C \
$(PROJ_DIR)/libs/aconnoSPI \
$(PROJ_DIR)/libs/GDEP015OC1 \
$(PROJ_DIR)/libs/MCP23017 \
#$(PROJ_DIR)/BLE/nordicBLE/ \
# Source files common to all targets
SRC_FILES += \
$(PROJ_SRC) \
$(SDK_ROOT)/modules/nrfx/mdk/gcc_startup_nrf52.S \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_backend_rtt.c \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_backend_serial.c \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_backend_uart.c \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_default_backends.c \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_frontend.c \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_str_formatter.c \
$(SDK_ROOT)/components/libraries/button/app_button.c \
$(SDK_ROOT)/components/libraries/util/app_error.c \
$(SDK_ROOT)/components/libraries/util/app_error_handler_gcc.c \
$(SDK_ROOT)/components/libraries/util/app_error_weak.c \
$(SDK_ROOT)/components/libraries/timer/app_timer_freertos.c \
$(SDK_ROOT)/components/libraries/util/app_util_platform.c \
$(SDK_ROOT)/components/libraries/crc16/crc16.c \
$(SDK_ROOT)/components/libraries/fds/fds.c \
$(SDK_ROOT)/components/libraries/hardfault/nrf52/handler/hardfault_handler_gcc.c \
$(SDK_ROOT)/components/libraries/hardfault/hardfault_implementation.c \
$(SDK_ROOT)/components/libraries/util/nrf_assert.c \
$(SDK_ROOT)/components/libraries/atomic_fifo/nrf_atfifo.c \
$(SDK_ROOT)/components/libraries/atomic_flags/nrf_atflags.c \
$(SDK_ROOT)/components/libraries/atomic/nrf_atomic.c \
$(SDK_ROOT)/components/libraries/balloc/nrf_balloc.c \
$(SDK_ROOT)/external/fprintf/nrf_fprintf.c \
$(SDK_ROOT)/external/fprintf/nrf_fprintf_format.c \
$(SDK_ROOT)/components/libraries/fstorage/nrf_fstorage.c \
$(SDK_ROOT)/components/libraries/fstorage/nrf_fstorage_sd.c \
$(SDK_ROOT)/components/libraries/memobj/nrf_memobj.c \
$(SDK_ROOT)/components/libraries/ringbuf/nrf_ringbuf.c \
$(SDK_ROOT)/components/libraries/experimental_section_vars/nrf_section_iter.c \
$(SDK_ROOT)/components/libraries/strerror/nrf_strerror.c \
$(SDK_ROOT)/components/libraries/sensorsim/sensorsim.c \
$(SDK_ROOT)/modules/nrfx/mdk/system_nrf52.c \
$(SDK_ROOT)/external/freertos/source/croutine.c \
$(SDK_ROOT)/external/freertos/source/event_groups.c \
$(SDK_ROOT)/external/freertos/source/portable/MemMang/heap_1.c \
$(SDK_ROOT)/external/freertos/source/list.c \
$(SDK_ROOT)/external/freertos/portable/GCC/nrf52/port.c \
$(SDK_ROOT)/external/freertos/portable/CMSIS/nrf52/port_cmsis.c \
$(SDK_ROOT)/external/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c \
$(SDK_ROOT)/external/freertos/source/queue.c \
$(SDK_ROOT)/external/freertos/source/stream_buffer.c \
$(SDK_ROOT)/external/freertos/source/tasks.c \
$(SDK_ROOT)/external/freertos/source/timers.c \
$(SDK_ROOT)/components/boards/boards.c \
$(SDK_ROOT)/integration/nrfx/legacy/nrf_drv_clock.c \
$(SDK_ROOT)/integration/nrfx/legacy/nrf_drv_uart.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_clock.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_gpiote.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_power_clock.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/prs/nrfx_prs.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_uart.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_uarte.c \
$(SDK_ROOT)/components/libraries/bsp/bsp.c \
$(SDK_ROOT)/components/libraries/bsp/bsp_btn_ble.c \
$(SDK_ROOT)/external/segger_rtt/SEGGER_RTT.c \
$(SDK_ROOT)/external/segger_rtt/SEGGER_RTT_Syscalls_GCC.c \
$(SDK_ROOT)/external/segger_rtt/SEGGER_RTT_printf.c \
$(SDK_ROOT)/components/ble/peer_manager/auth_status_tracker.c \
$(SDK_ROOT)/components/ble/common/ble_advdata.c \
$(SDK_ROOT)/components/ble/ble_advertising/ble_advertising.c \
$(SDK_ROOT)/components/ble/common/ble_conn_params.c \
$(SDK_ROOT)/components/ble/common/ble_conn_state.c \
$(SDK_ROOT)/components/ble/common/ble_srv_common.c \
$(SDK_ROOT)/components/ble/peer_manager/gatt_cache_manager.c \
$(SDK_ROOT)/components/ble/peer_manager/gatts_cache_manager.c \
$(SDK_ROOT)/components/ble/peer_manager/id_manager.c \
$(SDK_ROOT)/components/ble/nrf_ble_gatt/nrf_ble_gatt.c \
$(SDK_ROOT)/components/ble/nrf_ble_qwr/nrf_ble_qwr.c \
$(SDK_ROOT)/components/ble/peer_manager/peer_data_storage.c \
$(SDK_ROOT)/components/ble/peer_manager/peer_database.c \
$(SDK_ROOT)/components/ble/peer_manager/peer_id.c \
$(SDK_ROOT)/components/ble/peer_manager/peer_manager.c \
$(SDK_ROOT)/components/ble/peer_manager/peer_manager_handler.c \
$(SDK_ROOT)/components/ble/peer_manager/pm_buffer.c \
$(SDK_ROOT)/components/ble/peer_manager/security_dispatcher.c \
$(SDK_ROOT)/components/ble/peer_manager/security_manager.c \
$(SDK_ROOT)/external/utf_converter/utf.c \
$(SDK_ROOT)/components/ble/ble_services/ble_bas/ble_bas.c \
$(SDK_ROOT)/components/ble/ble_services/ble_dis/ble_dis.c \
$(SDK_ROOT)/components/ble/ble_services/ble_hrs/ble_hrs.c \
$(SDK_ROOT)/components/softdevice/common/nrf_sdh.c \
$(SDK_ROOT)/components/softdevice/common/nrf_sdh_ble.c \
$(SDK_ROOT)/components/softdevice/common/nrf_sdh_freertos.c \
$(SDK_ROOT)/components/softdevice/common/nrf_sdh_soc.c \
# Include folders common to all targets
INC_FOLDERS += \
$(PROJ_INC) \
$(SDK_ROOT)/components/nfc/ndef/generic/message \
$(SDK_ROOT)/components/nfc/t2t_lib \
$(SDK_ROOT)/components/nfc/t4t_parser/hl_detection_procedure \
$(SDK_ROOT)/components/ble/ble_services/ble_ancs_c \
$(SDK_ROOT)/components/ble/ble_services/ble_ias_c \
$(SDK_ROOT)/components/libraries/pwm \
$(SDK_ROOT)/components/softdevice/s132/headers/nrf52 \
$(SDK_ROOT)/components/libraries/usbd/class/cdc/acm \
$(SDK_ROOT)/components/libraries/usbd/class/hid/generic \
$(SDK_ROOT)/components/libraries/usbd/class/msc \
$(SDK_ROOT)/components/libraries/usbd/class/hid \
$(SDK_ROOT)/modules/nrfx/hal \
$(SDK_ROOT)/components/nfc/ndef/conn_hand_parser/le_oob_rec_parser \
$(SDK_ROOT)/components/libraries/log \
$(SDK_ROOT)/components/ble/ble_services/ble_gls \
$(SDK_ROOT)/components/libraries/fstorage \
$(SDK_ROOT)/components/nfc/ndef/text \
$(SDK_ROOT)/components/libraries/mutex \
$(SDK_ROOT)/components/libraries/gpiote \
$(SDK_ROOT)/components/libraries/bootloader/ble_dfu \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/common \
$(SDK_ROOT)/components/boards \
$(SDK_ROOT)/components/nfc/ndef/generic/record \
$(SDK_ROOT)/components/nfc/t4t_parser/cc_file \
$(SDK_ROOT)/components/ble/ble_advertising \
$(SDK_ROOT)/external/utf_converter \
$(SDK_ROOT)/components/ble/ble_services/ble_bas_c \
$(SDK_ROOT)/modules/nrfx/drivers/include \
$(SDK_ROOT)/components/libraries/experimental_task_manager \
$(SDK_ROOT)/components/ble/ble_services/ble_hrs_c \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/le_oob_rec \
$(SDK_ROOT)/components/libraries/queue \
$(SDK_ROOT)/components/libraries/pwr_mgmt \
$(SDK_ROOT)/external/freertos/portable/GCC/nrf52 \
$(SDK_ROOT)/components/ble/ble_dtm \
$(SDK_ROOT)/components/toolchain/cmsis/include \
$(SDK_ROOT)/components/ble/ble_services/ble_rscs_c \
$(SDK_ROOT)/components/ble/common \
$(SDK_ROOT)/components/ble/ble_services/ble_lls \
$(SDK_ROOT)/components/libraries/hardfault/nrf52 \
$(SDK_ROOT)/components/libraries/bsp \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/ac_rec \
$(SDK_ROOT)/components/ble/ble_services/ble_bas \
$(SDK_ROOT)/components/libraries/mpu \
$(SDK_ROOT)/components/libraries/experimental_section_vars \
$(SDK_ROOT)/components/softdevice/s132/headers \
$(SDK_ROOT)/components/ble/ble_services/ble_ans_c \
$(SDK_ROOT)/components/libraries/slip \
$(SDK_ROOT)/components/libraries/delay \
$(SDK_ROOT)/components/libraries/mem_manager \
$(SDK_ROOT)/components/libraries/csense_drv \
$(SDK_ROOT)/components/libraries/memobj \
$(SDK_ROOT)/components/ble/ble_services/ble_nus_c \
$(SDK_ROOT)/components/softdevice/common \
$(SDK_ROOT)/components/ble/ble_services/ble_ias \
$(SDK_ROOT)/components/libraries/usbd/class/hid/mouse \
$(SDK_ROOT)/components/libraries/low_power_pwm \
$(SDK_ROOT)/components/nfc/ndef/conn_hand_parser/ble_oob_advdata_parser \
$(SDK_ROOT)/components/ble/ble_services/ble_dfu \
$(SDK_ROOT)/external/fprintf \
$(SDK_ROOT)/components/libraries/svc \
$(SDK_ROOT)/components/libraries/atomic \
$(SDK_ROOT)/components \
$(SDK_ROOT)/components/libraries/scheduler \
$(SDK_ROOT)/components/libraries/cli \
$(SDK_ROOT)/components/ble/ble_services/ble_lbs \
$(SDK_ROOT)/components/ble/ble_services/ble_hts \
$(SDK_ROOT)/components/libraries/crc16 \
$(SDK_ROOT)/components/nfc/t4t_parser/apdu \
$(SDK_ROOT)/external/freertos/config \
$(SDK_ROOT)/components/libraries/util \
$(SDK_ROOT)/external/freertos/portable/CMSIS/nrf52 \
../config \
$(SDK_ROOT)/components/libraries/usbd/class/cdc \
$(SDK_ROOT)/components/libraries/csense \
$(SDK_ROOT)/components/libraries/balloc \
$(SDK_ROOT)/components/libraries/ecc \
$(SDK_ROOT)/components/libraries/hardfault \
$(SDK_ROOT)/components/ble/ble_services/ble_cscs \
$(SDK_ROOT)/components/libraries/hci \
$(SDK_ROOT)/components/libraries/usbd/class/hid/kbd \
$(SDK_ROOT)/components/libraries/timer \
$(SDK_ROOT)/integration/nrfx \
$(SDK_ROOT)/components/nfc/t4t_parser/tlv \
$(SDK_ROOT)/components/libraries/sortlist \
$(SDK_ROOT)/components/libraries/spi_mngr \
$(SDK_ROOT)/components/libraries/led_softblink \
$(SDK_ROOT)/components/nfc/ndef/conn_hand_parser \
$(SDK_ROOT)/components/libraries/sdcard \
$(SDK_ROOT)/components/nfc/ndef/parser/record \
$(SDK_ROOT)/modules/nrfx/mdk \
$(SDK_ROOT)/components/ble/ble_services/ble_cts_c \
$(SDK_ROOT)/components/ble/ble_services/ble_nus \
$(SDK_ROOT)/components/libraries/twi_mngr \
$(SDK_ROOT)/components/ble/ble_services/ble_hids \
$(SDK_ROOT)/components/libraries/strerror \
$(SDK_ROOT)/components/libraries/crc32 \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/ble_oob_advdata \
$(SDK_ROOT)/components/nfc/t2t_parser \
$(SDK_ROOT)/external/freertos/source/include \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/ble_pair_msg \
$(SDK_ROOT)/components/libraries/usbd/class/audio \
$(SDK_ROOT)/components/nfc/t4t_lib/hal_t4t \
$(SDK_ROOT)/components/libraries/sensorsim \
$(SDK_ROOT)/components/nfc/t4t_lib \
$(SDK_ROOT)/components/ble/peer_manager \
$(SDK_ROOT)/components/drivers_nrf/usbd \
$(SDK_ROOT)/components/libraries/ringbuf \
$(SDK_ROOT)/components/ble/ble_services/ble_tps \
$(SDK_ROOT)/components/nfc/ndef/parser/message \
$(SDK_ROOT)/components/ble/ble_services/ble_dis \
$(SDK_ROOT)/components/nfc/ndef/uri \
$(SDK_ROOT)/components/ble/nrf_ble_gatt \
$(SDK_ROOT)/components/ble/nrf_ble_qwr \
$(SDK_ROOT)/components/libraries/gfx \
$(SDK_ROOT)/components/libraries/button \
$(SDK_ROOT)/modules/nrfx \
$(SDK_ROOT)/components/libraries/twi_sensor \
$(SDK_ROOT)/integration/nrfx/legacy \
$(SDK_ROOT)/components/libraries/usbd \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/ep_oob_rec \
$(SDK_ROOT)/external/segger_rtt \
$(SDK_ROOT)/components/libraries/atomic_fifo \
$(SDK_ROOT)/components/ble/ble_services/ble_lbs_c \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/ble_pair_lib \
$(SDK_ROOT)/components/libraries/crypto \
$(SDK_ROOT)/components/ble/ble_racp \
$(SDK_ROOT)/components/libraries/fds \
$(SDK_ROOT)/components/nfc/ndef/launchapp \
$(SDK_ROOT)/components/libraries/atomic_flags \
$(SDK_ROOT)/components/ble/ble_services/ble_hrs \
$(SDK_ROOT)/components/ble/ble_services/ble_rscs \
$(SDK_ROOT)/components/nfc/ndef/connection_handover/hs_rec \
$(SDK_ROOT)/components/nfc/t2t_lib/hal_t2t \
$(SDK_ROOT)/components/nfc/ndef/conn_hand_parser/ac_rec_parser \
$(SDK_ROOT)/components/libraries/stack_guard \
$(SDK_ROOT)/components/libraries/log/src \
# Libraries common to all targets
LIB_FILES += \
# Optimization flags
OPT = -O3 -g3
# Uncomment the line below to enable link time optimization
#OPT += -flto
# C flags common to all targets
CFLAGS += $(OPT)
CFLAGS += -DBOARD_PCA10040
#CFLAGS += -DCONFIG_GPIO_AS_PINRESET
CFLAGS += -DFLOAT_ABI_HARD
CFLAGS += -DFREERTOS
CFLAGS += -DNRF52
CFLAGS += -DNRF52832_XXAA
CFLAGS += -DNRF52_PAN_74
CFLAGS += -DNRF_SD_BLE_API_VERSION=6
CFLAGS += -DS132
CFLAGS += -DSOFTDEVICE_PRESENT
CFLAGS += -mcpu=cortex-m4
CFLAGS += -mthumb -mabi=aapcs
CFLAGS += -Wall
#CFLAGS += -Werror
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
CFLAGS += -DDEBUG
# C++ flags common to all targets
CXXFLAGS += $(OPT)
CXXFLAGS += -DDEBUG
# Assembler flags common to all targets
ASMFLAGS += -g3
ASMFLAGS += -mcpu=cortex-m4
ASMFLAGS += -mthumb -mabi=aapcs
ASMFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
ASMFLAGS += -DBOARD_PCA10040
#ASMFLAGS += -DCONFIG_GPIO_AS_PINRESET
ASMFLAGS += -DFLOAT_ABI_HARD
ASMFLAGS += -DFREERTOS
ASMFLAGS += -DNRF52
ASMFLAGS += -DNRF52832_XXAA
ASMFLAGS += -DNRF52_PAN_74
ASMFLAGS += -DNRF_SD_BLE_API_VERSION=6
ASMFLAGS += -DS132
ASMFLAGS += -DSOFTDEVICE_PRESENT
# Linker flags
LDFLAGS += $(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
nrf52832_xxaa: CFLAGS += -D__HEAP_SIZE=1024
nrf52832_xxaa: CFLAGS += -D__STACK_SIZE=2048
nrf52832_xxaa: ASMFLAGS += -D__HEAP_SIZE=1024
nrf52832_xxaa: ASMFLAGS += -D__STACK_SIZE=2048
# Add standard libraries at the very end of the linker input, after all objects
# that may need symbols provided by these libraries.
LIB_FILES += -lc -lnosys -lm -lstdc++
.PHONY: default help
# Default target - first one defined
default: nrf52832_xxaa
# Print all targets that can be built
help:
@echo following targets are available:
@echo nrf52832_xxaa
@echo flash_softdevice
@echo sdk_config - starting external tool for editing sdk_config.h
@echo flash - flashing binary
TEMPLATE_PATH := $(SDK_ROOT)/components/toolchain/gcc
include $(TEMPLATE_PATH)/Makefile.common
$(foreach target, $(TARGETS), $(call define_target, $(target)))
.PHONY: flash flash_softdevice erase
# Flash the program
flash: default
@echo Flashing: $(OUTPUT_DIRECTORY)/nrf52832_xxaa.hex
nrfjprog -f nrf52 --program $(OUTPUT_DIRECTORY)/nrf52832_xxaa.hex --sectorerase
nrfjprog -f nrf52 --reset
# Flash softdevice
flash_softdevice:
@echo Flashing: s132_nrf52_6.1.0_softdevice.hex
nrfjprog -f nrf52 --program $(SDK_ROOT)/components/softdevice/s132/hex/s132_nrf52_6.1.0_softdevice.hex --sectorerase
nrfjprog -f nrf52 --reset
erase:
nrfjprog -f nrf52 --eraseall
SDK_CONFIG_FILE := ../config/sdk_config.h
CMSIS_CONFIG_TOOL := $(SDK_ROOT)/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar
sdk_config:
java -jar $(CMSIS_CONFIG_TOOL) $(SDK_CONFIG_FILE)
File diff suppressed because it is too large Load Diff
+129 -129
View File
@@ -1,129 +1,129 @@
/* Linker script to configure memory regions. */
SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)
MEMORY
{
FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x5a000
RAM (rwx) : ORIGIN = 0x200057b8, LENGTH = 0xa848
}
SECTIONS
{
}
SECTIONS
{
. = ALIGN(4);
.mem_section_dummy_ram :
{
}
.cli_sorted_cmd_ptrs :
{
PROVIDE(__start_cli_sorted_cmd_ptrs = .);
KEEP(*(.cli_sorted_cmd_ptrs))
PROVIDE(__stop_cli_sorted_cmd_ptrs = .);
} > RAM
.fs_data :
{
PROVIDE(__start_fs_data = .);
KEEP(*(.fs_data))
PROVIDE(__stop_fs_data = .);
} > RAM
.log_dynamic_data :
{
PROVIDE(__start_log_dynamic_data = .);
KEEP(*(SORT(.log_dynamic_data*)))
PROVIDE(__stop_log_dynamic_data = .);
} > RAM
.log_filter_data :
{
PROVIDE(__start_log_filter_data = .);
KEEP(*(SORT(.log_filter_data*)))
PROVIDE(__stop_log_filter_data = .);
} > RAM
} INSERT AFTER .data;
SECTIONS
{
.mem_section_dummy_rom :
{
}
.sdh_soc_observers :
{
PROVIDE(__start_sdh_soc_observers = .);
KEEP(*(SORT(.sdh_soc_observers*)))
PROVIDE(__stop_sdh_soc_observers = .);
} > FLASH
.sdh_ble_observers :
{
PROVIDE(__start_sdh_ble_observers = .);
KEEP(*(SORT(.sdh_ble_observers*)))
PROVIDE(__stop_sdh_ble_observers = .);
} > FLASH
.sdh_stack_observers :
{
PROVIDE(__start_sdh_stack_observers = .);
KEEP(*(SORT(.sdh_stack_observers*)))
PROVIDE(__stop_sdh_stack_observers = .);
} > FLASH
.sdh_req_observers :
{
PROVIDE(__start_sdh_req_observers = .);
KEEP(*(SORT(.sdh_req_observers*)))
PROVIDE(__stop_sdh_req_observers = .);
} > FLASH
.sdh_state_observers :
{
PROVIDE(__start_sdh_state_observers = .);
KEEP(*(SORT(.sdh_state_observers*)))
PROVIDE(__stop_sdh_state_observers = .);
} > FLASH
.nrf_queue :
{
PROVIDE(__start_nrf_queue = .);
KEEP(*(.nrf_queue))
PROVIDE(__stop_nrf_queue = .);
} > FLASH
.nrf_balloc :
{
PROVIDE(__start_nrf_balloc = .);
KEEP(*(.nrf_balloc))
PROVIDE(__stop_nrf_balloc = .);
} > FLASH
.cli_command :
{
PROVIDE(__start_cli_command = .);
KEEP(*(.cli_command))
PROVIDE(__stop_cli_command = .);
} > FLASH
.crypto_data :
{
PROVIDE(__start_crypto_data = .);
KEEP(*(SORT(.crypto_data*)))
PROVIDE(__stop_crypto_data = .);
} > FLASH
.pwr_mgmt_data :
{
PROVIDE(__start_pwr_mgmt_data = .);
KEEP(*(SORT(.pwr_mgmt_data*)))
PROVIDE(__stop_pwr_mgmt_data = .);
} > FLASH
.log_const_data :
{
PROVIDE(__start_log_const_data = .);
KEEP(*(SORT(.log_const_data*)))
PROVIDE(__stop_log_const_data = .);
} > FLASH
.log_backends :
{
PROVIDE(__start_log_backends = .);
KEEP(*(SORT(.log_backends*)))
PROVIDE(__stop_log_backends = .);
} > FLASH
} INSERT AFTER .text
INCLUDE "nrf_common.ld"
/* Linker script to configure memory regions. */
SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)
MEMORY
{
FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x5a000
RAM (rwx) : ORIGIN = 0x200057b8, LENGTH = 0xa848
}
SECTIONS
{
}
SECTIONS
{
. = ALIGN(4);
.mem_section_dummy_ram :
{
}
.cli_sorted_cmd_ptrs :
{
PROVIDE(__start_cli_sorted_cmd_ptrs = .);
KEEP(*(.cli_sorted_cmd_ptrs))
PROVIDE(__stop_cli_sorted_cmd_ptrs = .);
} > RAM
.fs_data :
{
PROVIDE(__start_fs_data = .);
KEEP(*(.fs_data))
PROVIDE(__stop_fs_data = .);
} > RAM
.log_dynamic_data :
{
PROVIDE(__start_log_dynamic_data = .);
KEEP(*(SORT(.log_dynamic_data*)))
PROVIDE(__stop_log_dynamic_data = .);
} > RAM
.log_filter_data :
{
PROVIDE(__start_log_filter_data = .);
KEEP(*(SORT(.log_filter_data*)))
PROVIDE(__stop_log_filter_data = .);
} > RAM
} INSERT AFTER .data;
SECTIONS
{
.mem_section_dummy_rom :
{
}
.sdh_soc_observers :
{
PROVIDE(__start_sdh_soc_observers = .);
KEEP(*(SORT(.sdh_soc_observers*)))
PROVIDE(__stop_sdh_soc_observers = .);
} > FLASH
.sdh_ble_observers :
{
PROVIDE(__start_sdh_ble_observers = .);
KEEP(*(SORT(.sdh_ble_observers*)))
PROVIDE(__stop_sdh_ble_observers = .);
} > FLASH
.sdh_stack_observers :
{
PROVIDE(__start_sdh_stack_observers = .);
KEEP(*(SORT(.sdh_stack_observers*)))
PROVIDE(__stop_sdh_stack_observers = .);
} > FLASH
.sdh_req_observers :
{
PROVIDE(__start_sdh_req_observers = .);
KEEP(*(SORT(.sdh_req_observers*)))
PROVIDE(__stop_sdh_req_observers = .);
} > FLASH
.sdh_state_observers :
{
PROVIDE(__start_sdh_state_observers = .);
KEEP(*(SORT(.sdh_state_observers*)))
PROVIDE(__stop_sdh_state_observers = .);
} > FLASH
.nrf_queue :
{
PROVIDE(__start_nrf_queue = .);
KEEP(*(.nrf_queue))
PROVIDE(__stop_nrf_queue = .);
} > FLASH
.nrf_balloc :
{
PROVIDE(__start_nrf_balloc = .);
KEEP(*(.nrf_balloc))
PROVIDE(__stop_nrf_balloc = .);
} > FLASH
.cli_command :
{
PROVIDE(__start_cli_command = .);
KEEP(*(.cli_command))
PROVIDE(__stop_cli_command = .);
} > FLASH
.crypto_data :
{
PROVIDE(__start_crypto_data = .);
KEEP(*(SORT(.crypto_data*)))
PROVIDE(__stop_crypto_data = .);
} > FLASH
.pwr_mgmt_data :
{
PROVIDE(__start_pwr_mgmt_data = .);
KEEP(*(SORT(.pwr_mgmt_data*)))
PROVIDE(__stop_pwr_mgmt_data = .);
} > FLASH
.log_const_data :
{
PROVIDE(__start_log_const_data = .);
KEEP(*(SORT(.log_const_data*)))
PROVIDE(__stop_log_const_data = .);
} > FLASH
.log_backends :
{
PROVIDE(__start_log_backends = .);
KEEP(*(SORT(.log_backends*)))
PROVIDE(__stop_log_backends = .);
} > FLASH
} INSERT AFTER .text
INCLUDE "nrf_common.ld"
+207 -207
View File
@@ -1,207 +1,207 @@
/*
* FreeRTOS Kernel V10.0.0
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. If you wish to use our Amazon
* FreeRTOS name, please do so in a fair use way that does not cause confusion.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*
* 1 tab == 4 spaces!
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#ifdef SOFTDEVICE_PRESENT
#include "nrf_soc.h"
#endif
#include "app_util_platform.h"
/*-----------------------------------------------------------
* Possible configurations for system timer
*/
#define FREERTOS_USE_RTC 0 /**< Use real time clock for the system */
#define FREERTOS_USE_SYSTICK 1 /**< Use SysTick timer for system */
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
*
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
#define configTICK_SOURCE FREERTOS_USE_RTC
#define configUSE_PREEMPTION 1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configUSE_TICKLESS_IDLE 1
#define configUSE_TICKLESS_IDLE_SIMPLE_DEBUG 1 /* See into vPortSuppressTicksAndSleep source code for explanation */
#define configCPU_CLOCK_HZ (SystemCoreClock )
#define configTICK_RATE_HZ 1024
#define configMAX_PRIORITIES (3)
#define configMINIMAL_STACK_SIZE (60)
#define configTOTAL_HEAP_SIZE (5*4096)
#define configMAX_TASK_NAME_LEN (4)
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_ALTERNATIVE_API 0 /* Deprecated! */
#define configQUEUE_REGISTRY_SIZE 2
#define configUSE_QUEUE_SETS 0
#define configUSE_TIME_SLICING 0
#define configUSE_NEWLIB_REENTRANT 0
#define configENABLE_BACKWARD_COMPATIBILITY 1
/* Hook function related definitions. */
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCHECK_FOR_STACK_OVERFLOW 0
#define configUSE_MALLOC_FAILED_HOOK 0
/* Run time and task stats gathering related definitions. */
#define configGENERATE_RUN_TIME_STATS 0
#define configUSE_TRACE_FACILITY 0
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES (2)
/* Software timer definitions. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY (2)
#define configTIMER_QUEUE_LENGTH 32
#define configTIMER_TASK_STACK_DEPTH (80)
/* Tickless Idle configuration. */
#define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
/* Tickless idle/low power functionality. */
/* Define to trap errors during development. */
#if defined(DEBUG_NRF) || defined(DEBUG_NRF_USER)
#define configASSERT( x ) ASSERT(x)
#endif
/* FreeRTOS MPU specific definitions. */
#define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 1
/* Optional functions - most linkers will remove unused functions anyway. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_xResumeFromISR 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_xTaskGetSchedulerState 1
#define INCLUDE_xTaskGetCurrentTaskHandle 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTaskGetIdleTaskHandle 1
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 1
#define INCLUDE_pcTaskGetTaskName 1
#define INCLUDE_eTaskGetState 1
#define INCLUDE_xEventGroupSetBitFromISR 1
#define INCLUDE_xTimerPendFunctionCall 1
/* The lowest interrupt priority that can be used in a call to a "set priority"
function. */
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf
/* The highest interrupt priority that can be used by any interrupt service
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY _PRIO_APP_HIGH
/* Interrupt priorities used by the kernel port layer itself. These are generic
to all Cortex-M ports, and do not rely on any particular library functions. */
#define configKERNEL_INTERRUPT_PRIORITY configLIBRARY_LOWEST_INTERRUPT_PRIORITY
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
standard names - or at least those used in the unmodified vector table. */
#define vPortSVCHandler SVC_Handler
#define xPortPendSVHandler PendSV_Handler
/*-----------------------------------------------------------
* Settings that are generated automatically
* basing on the settings above
*/
#if (configTICK_SOURCE == FREERTOS_USE_SYSTICK)
// do not define configSYSTICK_CLOCK_HZ for SysTick to be configured automatically
// to CPU clock source
#define xPortSysTickHandler SysTick_Handler
#elif (configTICK_SOURCE == FREERTOS_USE_RTC)
#define configSYSTICK_CLOCK_HZ ( 32768UL )
#define xPortSysTickHandler RTC1_IRQHandler
#else
#error Unsupported configTICK_SOURCE value
#endif
/* Code below should be only used by the compiler, and not the assembler. */
#if !(defined(__ASSEMBLY__) || defined(__ASSEMBLER__))
#include "nrf.h"
#include "nrf_assert.h"
/* This part of definitions may be problematic in assembly - it uses definitions from files that are not assembly compatible. */
/* Cortex-M specific definitions. */
#ifdef __NVIC_PRIO_BITS
/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
#define configPRIO_BITS __NVIC_PRIO_BITS
#else
#error "This port requires __NVIC_PRIO_BITS to be defined"
#endif
/* Access to current system core clock is required only if we are ticking the system by systimer */
#if (configTICK_SOURCE == FREERTOS_USE_SYSTICK)
#include <stdint.h>
extern uint32_t SystemCoreClock;
#endif
#endif /* !assembler */
/** Implementation note: Use this with caution and set this to 1 ONLY for debugging
* ----------------------------------------------------------
* Set the value of configUSE_DISABLE_TICK_AUTO_CORRECTION_DEBUG to below for enabling or disabling RTOS tick auto correction:
* 0. This is default. If the RTC tick interrupt is masked for more than 1 tick by higher priority interrupts, then most likely
* one or more RTC ticks are lost. The tick interrupt inside RTOS will detect this and make a correction needed. This is needed
* for the RTOS internal timers to be more accurate.
* 1. The auto correction for RTOS tick is disabled even though few RTC tick interrupts were lost. This feature is desirable when debugging
* the RTOS application and stepping though the code. After stepping when the application is continued in debug mode, the auto-corrections of
* RTOS tick might cause asserts. Setting configUSE_DISABLE_TICK_AUTO_CORRECTION_DEBUG to 1 will make RTC and RTOS go out of sync but could be
* convenient for debugging.
*/
#define configUSE_DISABLE_TICK_AUTO_CORRECTION_DEBUG 0
#endif /* FREERTOS_CONFIG_H */
/*
* FreeRTOS Kernel V10.0.0
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. If you wish to use our Amazon
* FreeRTOS name, please do so in a fair use way that does not cause confusion.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*
* 1 tab == 4 spaces!
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#ifdef SOFTDEVICE_PRESENT
#include "nrf_soc.h"
#endif
#include "app_util_platform.h"
/*-----------------------------------------------------------
* Possible configurations for system timer
*/
#define FREERTOS_USE_RTC 0 /**< Use real time clock for the system */
#define FREERTOS_USE_SYSTICK 1 /**< Use SysTick timer for system */
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
*
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
#define configTICK_SOURCE FREERTOS_USE_RTC
#define configUSE_PREEMPTION 1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configUSE_TICKLESS_IDLE 1
#define configUSE_TICKLESS_IDLE_SIMPLE_DEBUG 1 /* See into vPortSuppressTicksAndSleep source code for explanation */
#define configCPU_CLOCK_HZ (SystemCoreClock )
#define configTICK_RATE_HZ 1024
#define configMAX_PRIORITIES (3)
#define configMINIMAL_STACK_SIZE (60)
#define configTOTAL_HEAP_SIZE (5*4096)
#define configMAX_TASK_NAME_LEN (4)
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_ALTERNATIVE_API 0 /* Deprecated! */
#define configQUEUE_REGISTRY_SIZE 2
#define configUSE_QUEUE_SETS 0
#define configUSE_TIME_SLICING 0
#define configUSE_NEWLIB_REENTRANT 0
#define configENABLE_BACKWARD_COMPATIBILITY 1
/* Hook function related definitions. */
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCHECK_FOR_STACK_OVERFLOW 0
#define configUSE_MALLOC_FAILED_HOOK 0
/* Run time and task stats gathering related definitions. */
#define configGENERATE_RUN_TIME_STATS 0
#define configUSE_TRACE_FACILITY 0
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES (2)
/* Software timer definitions. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY (2)
#define configTIMER_QUEUE_LENGTH 32
#define configTIMER_TASK_STACK_DEPTH (80)
/* Tickless Idle configuration. */
#define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
/* Tickless idle/low power functionality. */
/* Define to trap errors during development. */
#if defined(DEBUG_NRF) || defined(DEBUG_NRF_USER)
#define configASSERT( x ) ASSERT(x)
#endif
/* FreeRTOS MPU specific definitions. */
#define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 1
/* Optional functions - most linkers will remove unused functions anyway. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_xResumeFromISR 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_xTaskGetSchedulerState 1
#define INCLUDE_xTaskGetCurrentTaskHandle 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTaskGetIdleTaskHandle 1
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 1
#define INCLUDE_pcTaskGetTaskName 1
#define INCLUDE_eTaskGetState 1
#define INCLUDE_xEventGroupSetBitFromISR 1
#define INCLUDE_xTimerPendFunctionCall 1
/* The lowest interrupt priority that can be used in a call to a "set priority"
function. */
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf
/* The highest interrupt priority that can be used by any interrupt service
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY _PRIO_APP_HIGH
/* Interrupt priorities used by the kernel port layer itself. These are generic
to all Cortex-M ports, and do not rely on any particular library functions. */
#define configKERNEL_INTERRUPT_PRIORITY configLIBRARY_LOWEST_INTERRUPT_PRIORITY
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
standard names - or at least those used in the unmodified vector table. */
#define vPortSVCHandler SVC_Handler
#define xPortPendSVHandler PendSV_Handler
/*-----------------------------------------------------------
* Settings that are generated automatically
* basing on the settings above
*/
#if (configTICK_SOURCE == FREERTOS_USE_SYSTICK)
// do not define configSYSTICK_CLOCK_HZ for SysTick to be configured automatically
// to CPU clock source
#define xPortSysTickHandler SysTick_Handler
#elif (configTICK_SOURCE == FREERTOS_USE_RTC)
#define configSYSTICK_CLOCK_HZ ( 32768UL )
#define xPortSysTickHandler RTC1_IRQHandler
#else
#error Unsupported configTICK_SOURCE value
#endif
/* Code below should be only used by the compiler, and not the assembler. */
#if !(defined(__ASSEMBLY__) || defined(__ASSEMBLER__))
#include "nrf.h"
#include "nrf_assert.h"
/* This part of definitions may be problematic in assembly - it uses definitions from files that are not assembly compatible. */
/* Cortex-M specific definitions. */
#ifdef __NVIC_PRIO_BITS
/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
#define configPRIO_BITS __NVIC_PRIO_BITS
#else
#error "This port requires __NVIC_PRIO_BITS to be defined"
#endif
/* Access to current system core clock is required only if we are ticking the system by systimer */
#if (configTICK_SOURCE == FREERTOS_USE_SYSTICK)
#include <stdint.h>
extern uint32_t SystemCoreClock;
#endif
#endif /* !assembler */
/** Implementation note: Use this with caution and set this to 1 ONLY for debugging
* ----------------------------------------------------------
* Set the value of configUSE_DISABLE_TICK_AUTO_CORRECTION_DEBUG to below for enabling or disabling RTOS tick auto correction:
* 0. This is default. If the RTC tick interrupt is masked for more than 1 tick by higher priority interrupts, then most likely
* one or more RTC ticks are lost. The tick interrupt inside RTOS will detect this and make a correction needed. This is needed
* for the RTOS internal timers to be more accurate.
* 1. The auto correction for RTOS tick is disabled even though few RTC tick interrupts were lost. This feature is desirable when debugging
* the RTOS application and stepping though the code. After stepping when the application is continued in debug mode, the auto-corrections of
* RTOS tick might cause asserts. Setting configUSE_DISABLE_TICK_AUTO_CORRECTION_DEBUG to 1 will make RTC and RTOS go out of sync but could be
* convenient for debugging.
*/
#define configUSE_DISABLE_TICK_AUTO_CORRECTION_DEBUG 0
#endif /* FREERTOS_CONFIG_H */
+108
View File
@@ -0,0 +1,108 @@
/**
* @file acd52832Bsp.h
* @author Dominik Kotarski (d.kotarski@aconno.com)
* @brief
* @version 0.1
* @date 2019-02-22
*
* @copyright Copyright (c) 2019
*
*/
/** Communication headers */
#include "aconnoSPI.h"
#include "aconnoI2C.h"
/** EPD header */
#include "GDEP015OC1.h"
/** MCP23017 header */
#include "MCP23017.h"
/** GPIO header */
#include "aconnoGPIO.h"
/** Menu states header */
#include "menuStates.h"
/**
* @defgroup PIN_GROUP
* @note General IO pins
* @{
*/
#define PIN_BUTTON (25) /**< SW1 gpio number (Active low) */
#define PIN_LED (26) /**< LD1 gpio number (Active low) */
#define PIN_IRLED (27) /**< LD4 gpio number (Active high) */
#define PIN_BUZZER (31) /**< LS1 gpio number (Active high) */
#define PIN_LED_RED (22) /**< Module red LED */
#define PIN_LED_BLUE (23) /**< Module blue LED */
#define PIN_LED_GREEN (24) /**< Module green LED */
/** Alternate General IO pins */
#define PIN_SERVO1 (25) /**< Servo1 gpio number */
#define PIN_SERVO2 (26) /**< Servo2 gpio number */
/** @} */
/**
* @defgroup ADC_GROUP
* @note Analog to Digital Conversion (ADC) pins
* @{
*/
#define ADC_BAT (2) /**< Battery */
#define ADC_POT (28) /**< Potentiometer */
#define ADC_LIGHT (29) /**< Light Dependant Resistor */
#define ADC_TEMP (30) /**< Temperature Dependant Resistor */
/** @} */
/**
* @defgroup PIN_EPD_GROUP
* @note Electronic Paper Display (EPD) pins
* @{
*/
#define PIN_EPD_CS (5) /**< EPD Chip select pin (Active low) */
#define PIN_EPD_DC (6) /**< EPD Data/Command pin (Data active high) */
#define PIN_EPD_RST (7) /**< EPD Reset pin (Active low) */
#define PIN_EPD_BUSY (8) /**< EPD Busy pin (Active low) */
#define PIN_EPD_SCK (4) /**< EPD SCK pin */
#define PIN_EPD_MOSI (3) /**< EPD MOSI pin */
#define PIN_EPD_MISO (0xFF) /**< EPD MISO pin not used */
/** @} */
/**
* @defgroup PIN_EXP_GROUP
* @note IO Expander pins
* @{
*/
#define PIN_EXP_RST (19) /**< IO Expander reset pin */
#define EXPDR_A_INT (11) /**< IO Expander */
#define PIN_EXP_INT_A (11) /**< IO Expander interrupt for PORTA */
#define PIN_EXP_INT_B (12) /**< IO Expander interrupt for PORTB */
#define PIN_EXP_SDA (20) /**< TWI SCK pin */
#define PIN_EXP_SCL (21) /**< TWI SCL pin */
/** @} */
/**
* @defgroup MCP23017_GROUP
* @brief GPIO Pin configuration on IO Expander
* @{
*/
#define MCP23017_CENTER 7
#define MCP23017_LEFT 5
#define MCP23017_RIGHT 3
#define MCP23017__UP 6
#define MCP23017__DOWN 4
#define MCP23017_SW2 8
#define MCP23017_LED2 9
#define MCP23017_REL1 11
#define MCP23017_REL2 10
/** @} */
/**
* @defgroup TWI_GROUP
* @note Pins concerning TWI Addresses
* Control bits are added by nrf_drv_twi
* @{
*/
#define TWI_EXPANDER_ADDR (0x40) /**< Port expander address */
#define TWI_AG_ADDR (0x6A << 1) /**< Accelerometer/Gyroscope address */
#define TWI_MAG_ADDR (0x1C << 1) /**< Magnetometer address */
/** @} */
-95
View File
@@ -1,95 +0,0 @@
/**
* @file acn52832Bsp.h
* @author Dominik Kotarski (d.kotarski@aconno.com)
* @brief
* @version 0.1
* @date 2019-02-22
*
* @copyright Copyright (c) 2019
*
*/
/**
* General IO pins
*/
#define PIN_BUTTON (25) //S1 gpio number (Active low)
#define PIN_LED (26) //LD1 gpio number (Active low)
#define PIN_IRLED (27) //LD4 gpio number (Active high)
#define PIN_BUZZER (31) //LS1 gpio number (Active high)
#define PIN_LED_RED (22) //Module red LED
#define PIN_LED_BLUE (23) //Module blue LED
#define PIN_LED_GREEN (24) //Module green LED
/**
* Alternate General IO pins
* Connect:
* (+, c, -) (Orange, Red, Brown)
*/
#define PIN_SERVO1 (25) //Servo1 gpio number
#define PIN_SERVO2 (26) //Servo2 gpio number
/**
* Analog to Digital Conversion (ADC) pins
*/
#define ADC_BAT (2) //Battery
#define ADC_POT (28) //Potentiometer
#define ADC_LIGHT (29) //Light Dependant Resistor
#define ADC_TEMP (30) //Temperature Dependant Resistor
/**
* Electronic Paper Display (EPD) pins
*/
#define PIN_EPD_CS (5) //EPD Chip select pin (Active low)
#define PIN_EPD_DC (6) //EPD Data/Command pin (Data active high)
#define PIN_EPD_RST (7) //EPD Reset pin (Active low)
#define PIN_EPD_BUSY (8) //EPD Busy pin (Active low)
#define PIN_EPD_SCK (4) //EPD SCK pin
#define PIN_EPD_MOSI (3) //EPD MOSI pin
#define PIN_EPD_MISO (0xFF) //EPD MISO pin not used
/**
* IO Expander pins
*/
#define PIN_EXP_RST (19) //IO Expander reset pin
#define EXPDR_A_INT (11) //IO Expander
#define PIN_EXP_INT_A (11) //IO Expander interrupt for PORTA
#define PIN_EXP_INT_B (12) //IO Expander interrupt for PORTB
#define PIN_EXP_SDA (20) //TWI SCK pin
#define PIN_EXP_SCL (21) //TWI SCL pin
/**
* GPIO Pin configuration on IO Expander
*/
#define MCP23017_CENTER 7
#define MCP23017_LEFT 5
#define MCP23017_RIGHT 3
#define MCP23017__UP 6
#define MCP23017__DOWN 4
#define MCP23017_SW2 8
#define MCP23017_LED2 9
#define MCP23017_REL1 11
#define MCP23017_REL2 10
/**
* Pins concerning TWI Addresses
* Control bits are added by nrf_drv_twi
*/
#define TWI_EXPANDER_ADDR (0x40) //Port expander address
#define TWI_AG_ADDR (0x6A << 1) //Accelerometer/Gyroscope address
#define TWI_MAG_ADDR (0x1C << 1) //Magnetometer address
/**
* Define structure used by bluetooth library
* Define if BLE_LIB is defined as preprocessor symbol
*/
#ifdef BLE_LIB
// Low frequency clock source to be used by the SoftDevice
#define NRF_CLOCK_LFCLKSRC { \
.source = NRF_CLOCK_LF_SRC_XTAL, \
.rc_ctiv = 0, \
.rc_temp_ctiv = 0, \
.xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}
#endif
+12704 -12704
View File
File diff suppressed because it is too large Load Diff
+38277
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
Submodule
+1
Submodule libs/KDT00030 added at 281ec099b7
+1
Submodule libs/aconnoSAADC added at 4af2292fe3
+1
Submodule libs/aconnoSensor added at da115e25f3
+82 -82
View File
@@ -1,82 +1,82 @@
/*
* Made by Dominik @ aconno
* All rights reserved
*
*/
#ifndef __CONFIG_SERVICE_H__
#define __CONFIG_SERVICE_H__
#include "mbed.h"
#include "ble/BLE.h"
#include "aconno_ble.h"
#include "service_macros.h"
#include "proj_config.h"
#include "parameter.h"
#include "config_params.h"
#define SERVICE_NAME ConfigService
typedef struct
{
uint8_t nParams;
uint8_t currParam;
char confGroup[MAX_CONF_NAME_SIZE];
Parameter param;
ParamValue value;
} SERVICE_INIT_T(SERVICE_NAME);
class SERVICE_NAME{
public:
const static uint16_t SERVICE_UUID = 0xC000;
const static uint16_t N_PARAMS_UUID = 0xC001;
const static uint16_t CURR_PARAM_UUID = 0xC002;
const static uint16_t CONF_GROUP_UUID = 0xC003;
const static uint16_t PARAM_UUID = 0xC004;
const static uint16_t VALUE_UUID = 0xC005;
SERVICE_NAME(BLEDevice &_ble, SERVICE_INIT_T(SERVICE_NAME) *init) :
ble(_ble),
nParams(N_PARAMS_UUID, &(init->nParams), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
currParam(CURR_PARAM_UUID, &(init->currParam), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
confGroup(CONF_GROUP_UUID, init->confGroup, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
param(PARAM_UUID, &(init->param), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)
//value(VALUE_UUID, &(init->value), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)
{
GattCharacteristic *charTable[] = {&nParams, &currParam, &confGroup,
&param/*, &value*/}; // Add characteristick in table
GattService AckService(SERVICE_UUID, charTable, sizeof(charTable)/sizeof(GattCharacteristic *));
nParams.setReadAuthorizationCallback(readAuthorizationCallback);
currParam.setReadAuthorizationCallback(readAuthorizationCallback);
confGroup.setReadAuthorizationCallback(readAuthorizationCallback);
param.setReadAuthorizationCallback(readAuthorizationCallback);
nParams.setWriteAuthorizationCallback(writeAuthorizationCallback);
currParam.setWriteAuthorizationCallback(writeAuthorizationCallback);
confGroup.setWriteAuthorizationCallback(writeAuthorizationCallback);
param.setWriteAuthorizationCallback(writeAuthorizationCallback);
ble.gattServer().addService(AckService); // Add service in the BLE
}
inline BLEDevice *get_ble(){
return &ble;
}
CHARACTERISTIC_W(ReadOnly, uint8_t, nParams, NParams);
CHARACTERISTIC_W(ReadWrite, uint8_t, currParam, CurrParam);
CHARACTERISTIC_A(ReadOnly, char, MAX_CONF_NAME_SIZE, confGroup,
ConfGroup);
CHARACTERISTIC_W(ReadWrite, Parameter, param, Param);
//CHARACTERISTIC_W(ReadWrite, ParamValue, value, Value);
private:
BLEDevice &ble;
};
#undef SERVICE_NAME
#endif //__CONFIG_SERVICE_H__
/*
* Made by Dominik @ aconno
* All rights reserved
*
*/
#ifndef __CONFIG_SERVICE_H__
#define __CONFIG_SERVICE_H__
#include "mbed.h"
#include "ble/BLE.h"
#include "aconno_ble.h"
#include "service_macros.h"
#include "proj_config.h"
#include "parameter.h"
#include "config_params.h"
#define SERVICE_NAME ConfigService
typedef struct
{
uint8_t nParams;
uint8_t currParam;
char confGroup[MAX_CONF_NAME_SIZE];
Parameter param;
ParamValue value;
} SERVICE_INIT_T(SERVICE_NAME);
class SERVICE_NAME{
public:
const static uint16_t SERVICE_UUID = 0xC000;
const static uint16_t N_PARAMS_UUID = 0xC001;
const static uint16_t CURR_PARAM_UUID = 0xC002;
const static uint16_t CONF_GROUP_UUID = 0xC003;
const static uint16_t PARAM_UUID = 0xC004;
const static uint16_t VALUE_UUID = 0xC005;
SERVICE_NAME(BLEDevice &_ble, SERVICE_INIT_T(SERVICE_NAME) *init) :
ble(_ble),
nParams(N_PARAMS_UUID, &(init->nParams), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
currParam(CURR_PARAM_UUID, &(init->currParam), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
confGroup(CONF_GROUP_UUID, init->confGroup, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
param(PARAM_UUID, &(init->param), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)
//value(VALUE_UUID, &(init->value), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)
{
GattCharacteristic *charTable[] = {&nParams, &currParam, &confGroup,
&param/*, &value*/}; // Add characteristick in table
GattService AckService(SERVICE_UUID, charTable, sizeof(charTable)/sizeof(GattCharacteristic *));
nParams.setReadAuthorizationCallback(readAuthorizationCallback);
currParam.setReadAuthorizationCallback(readAuthorizationCallback);
confGroup.setReadAuthorizationCallback(readAuthorizationCallback);
param.setReadAuthorizationCallback(readAuthorizationCallback);
nParams.setWriteAuthorizationCallback(writeAuthorizationCallback);
currParam.setWriteAuthorizationCallback(writeAuthorizationCallback);
confGroup.setWriteAuthorizationCallback(writeAuthorizationCallback);
param.setWriteAuthorizationCallback(writeAuthorizationCallback);
ble.gattServer().addService(AckService); // Add service in the BLE
}
inline BLEDevice *get_ble(){
return &ble;
}
CHARACTERISTIC_W(ReadOnly, uint8_t, nParams, NParams);
CHARACTERISTIC_W(ReadWrite, uint8_t, currParam, CurrParam);
CHARACTERISTIC_A(ReadOnly, char, MAX_CONF_NAME_SIZE, confGroup,
ConfGroup);
CHARACTERISTIC_W(ReadWrite, Parameter, param, Param);
//CHARACTERISTIC_W(ReadWrite, ParamValue, value, Value);
private:
BLEDevice &ble;
};
#undef SERVICE_NAME
#endif //__CONFIG_SERVICE_H__
+92 -92
View File
@@ -1,92 +1,92 @@
/*
* Made by Dominik @ aconno
* All rights reserved
*
*/
#ifndef __SLOT_SERVICE_H__
#define __SLOT_SERVICE_H__
#include "mbed.h"
#include "ble/BLE.h"
#include "service_macros.h"
#include "slots.h"
typedef struct
{
uint8_t currSlot;
char frameType[FRAME_TYPE_LEN];
uint8_t advData[ADV_FORMAT_SIZE];
uint16_t advInt;
int16_t rssi1m;
int16_t radioTx;
bool triggEn;
uint8_t triggType;
} init_slot_service_t;
class SlotService{
public:
const static uint16_t SERVICE_UUID = 0xB000;
const static uint16_t CURR_SLOT_UUID = 0xB001;
const static uint16_t FRAME_TYPE_UUID = 0xB002;
const static uint16_t ADV_DATA_UUID = 0xB003;
const static uint16_t ADV_INT_UUID = 0xB004;
const static uint16_t RSSI1M_UUID = 0xB005;
const static uint16_t RADIO_TX_UUID = 0xB006;
const static uint16_t TRIGG_EN_UUID = 0xB007;
const static uint16_t TRIGG_TYPE_UUID = 0xB008;
SlotService(BLEDevice &_ble, init_slot_service_t *init) :
ble(_ble),
currSlot(CURR_SLOT_UUID, &(init->currSlot),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
frameType(FRAME_TYPE_UUID, init->frameType,
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
advData(ADV_DATA_UUID, init->advData,
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
advInt(ADV_INT_UUID, &(init->advInt),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
rssi1m(RSSI1M_UUID, &(init->rssi1m),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
radioTx(RADIO_TX_UUID, &(init->radioTx),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
triggEn(TRIGG_EN_UUID, &(init->triggEn),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
triggType(TRIGG_TYPE_UUID, &(init->triggType),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)
{
// Add characteristick in table.
GattCharacteristic *charTable[] = {&currSlot, &frameType, &advData,
&advInt, &rssi1m, &radioTx,
&triggEn, &triggType};
GattService AckService(SERVICE_UUID, charTable,
sizeof(charTable)/sizeof(GattCharacteristic *));
// Add service in the BLE
ble.gattServer().addService(AckService);
}
inline BLEDevice *get_ble(){
return &ble;
}
CHARACTERISTIC_W(ReadWrite, uint8_t, currSlot, CurrSlot);
CHARACTERISTIC_A(ReadWrite, char, FRAME_TYPE_LEN, frameType,
FrameType);
CHARACTERISTIC_A(ReadWrite, uint8_t, ADV_FORMAT_SIZE, advData,
AdvData);
CHARACTERISTIC_W(ReadWrite, uint16_t, advInt, AdvInt);
CHARACTERISTIC_W(ReadWrite, int16_t, rssi1m, Rssi1m);
CHARACTERISTIC_W(ReadWrite, int16_t, radioTx, RadioTx);
CHARACTERISTIC_W(ReadWrite, bool, triggEn, TriggEn);
CHARACTERISTIC_W(ReadWrite, uint8_t, triggType, TriggType);
private:
BLEDevice &ble;
};
#endif //__SLOT_SERVICE_H__
/*
* Made by Dominik @ aconno
* All rights reserved
*
*/
#ifndef __SLOT_SERVICE_H__
#define __SLOT_SERVICE_H__
#include "mbed.h"
#include "ble/BLE.h"
#include "service_macros.h"
#include "slots.h"
typedef struct
{
uint8_t currSlot;
char frameType[FRAME_TYPE_LEN];
uint8_t advData[ADV_FORMAT_SIZE];
uint16_t advInt;
int16_t rssi1m;
int16_t radioTx;
bool triggEn;
uint8_t triggType;
} init_slot_service_t;
class SlotService{
public:
const static uint16_t SERVICE_UUID = 0xB000;
const static uint16_t CURR_SLOT_UUID = 0xB001;
const static uint16_t FRAME_TYPE_UUID = 0xB002;
const static uint16_t ADV_DATA_UUID = 0xB003;
const static uint16_t ADV_INT_UUID = 0xB004;
const static uint16_t RSSI1M_UUID = 0xB005;
const static uint16_t RADIO_TX_UUID = 0xB006;
const static uint16_t TRIGG_EN_UUID = 0xB007;
const static uint16_t TRIGG_TYPE_UUID = 0xB008;
SlotService(BLEDevice &_ble, init_slot_service_t *init) :
ble(_ble),
currSlot(CURR_SLOT_UUID, &(init->currSlot),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
frameType(FRAME_TYPE_UUID, init->frameType,
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
advData(ADV_DATA_UUID, init->advData,
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
advInt(ADV_INT_UUID, &(init->advInt),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
rssi1m(RSSI1M_UUID, &(init->rssi1m),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
radioTx(RADIO_TX_UUID, &(init->radioTx),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
triggEn(TRIGG_EN_UUID, &(init->triggEn),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
triggType(TRIGG_TYPE_UUID, &(init->triggType),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)
{
// Add characteristick in table.
GattCharacteristic *charTable[] = {&currSlot, &frameType, &advData,
&advInt, &rssi1m, &radioTx,
&triggEn, &triggType};
GattService AckService(SERVICE_UUID, charTable,
sizeof(charTable)/sizeof(GattCharacteristic *));
// Add service in the BLE
ble.gattServer().addService(AckService);
}
inline BLEDevice *get_ble(){
return &ble;
}
CHARACTERISTIC_W(ReadWrite, uint8_t, currSlot, CurrSlot);
CHARACTERISTIC_A(ReadWrite, char, FRAME_TYPE_LEN, frameType,
FrameType);
CHARACTERISTIC_A(ReadWrite, uint8_t, ADV_FORMAT_SIZE, advData,
AdvData);
CHARACTERISTIC_W(ReadWrite, uint16_t, advInt, AdvInt);
CHARACTERISTIC_W(ReadWrite, int16_t, rssi1m, Rssi1m);
CHARACTERISTIC_W(ReadWrite, int16_t, radioTx, RadioTx);
CHARACTERISTIC_W(ReadWrite, bool, triggEn, TriggEn);
CHARACTERISTIC_W(ReadWrite, uint8_t, triggType, TriggType);
private:
BLEDevice &ble;
};
#endif //__SLOT_SERVICE_H__
BIN
View File
Binary file not shown.
+156 -134
View File
@@ -1,134 +1,156 @@
/**
* @file main.cpp
* @author Jurica Resetar (Jurica@aconno.de)
* @brief Template project based on FreeRTOS and Nordic's SDK
* @version 0.1
* @date 2019-02-11
*
* @copyright Copyright (c) 2019
*
*/
#include <stdint.h>
#include <string.h>
#include "nordic_common.h"
#include "nrf.h"
#include "nrf_sdh_freertos.h"
#include "FreeRTOS.h"
#include "task.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#include "settings.h"
#include "basic_config.h"
#include "arb_data.h"
#include "aconnoConfig.h"
#include "aconnoHelpers.h"
#include "aconnoTasks.h"
#include "aconnoBLE.h"
#include "aconnoTasks.h"
extern TaskHandle_t initTask;
extern TaskHandle_t blinkyTask;
extern TaskHandle_t blinkyTask2;
extern TaskHandle_t menuStateMachineTask;
#if NRF_LOG_ENABLED
extern TaskHandle_t m_logger_thread;
#endif
/** @brief Function for application main entry.
*/
int main(void)
{
// Initialize modules.
log_init();
clock_init();
NRF_LOG_INFO("\r\n\r\nMain started.");
if(pdPASS != xTaskCreate(logTaskFunction, "INIT", 256, NULL, 1,
&initTask))
{
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
xTaskCreate(menuStateMachineTaskFunction, "MenuStateMachine", 256, NULL, 1,
&menuStateMachineTask);
// Activate deep sleep mode.
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
// Initialize modules.
timers_init();
application_timers_start();
// aconno BLE module init
AconnoBLE &myBLE = *getAconnoBLEInstance();
myBLE.initBLEStack();
myBLE.GATTInit();
#if 1
myBLE.setTXPower(4);
myBLE.startAdvertising(APP_ADV_INTERVAL, APP_ADV_DURATION);
#endif
// Create a FreeRTOS task for the BLE stack.
// The task will run advertising_start() before entering its loop.
nrf_sdh_freertos_init(NULL, NULL);
NRF_LOG_INFO("HRS FreeRTOS example started.");
settingsInit(NULL);
basicConfigInit();
arbDataInit();
// Start FreeRTOS scheduler.
vTaskStartScheduler();
for (;;)
{
APP_ERROR_HANDLER(NRF_ERROR_FORBIDDEN);
}
}
#if NRF_LOG_ENABLED
/**@brief Thread for handling the logger.
*
* @details This thread is responsible for processing log entries if
* logs are deferred. Thread flushes all log entries and suspends. It is
* resumed by idle task hook.
*
* @param[in] arg Pointer used for passing some arbitrary information
* (context) from the osThreadCreate() call to the thread.
*/
void logger_thread(void * arg)
{
UNUSED_PARAMETER(arg);
while (1)
{
NRF_LOG_FLUSH();
vTaskSuspend(NULL); // Suspend myself
}
}
#endif //NRF_LOG_ENABLED
/**@brief A function which is hooked to idle task.
* @note Idle hook must be enabled in FreeRTOS configuration
* (configUSE_IDLE_HOOK).
*/
#ifdef __cplusplus
extern "C"
{
void vApplicationIdleHook( void )
{
#if NRF_LOG_ENABLED
vTaskResume(m_logger_thread);
#endif
}
}
#endif
/**
* @file main.cpp
* @author Jurica Resetar (Jurica@aconno.de)
* @brief Template project based on FreeRTOS and Nordic's SDK
* @version 0.1
* @date 2019-02-11
*
* @copyright Copyright (c) 2019
*
*/
#include <stdint.h>
#include <string.h>
#include "nordic_common.h"
#include "nrf.h"
#include "nrf_sdh_freertos.h"
#include "FreeRTOS.h"
#include "task.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#include "settings.h"
#include "basic_config.h"
#include "arb_data.h"
#include "aconnoConfig.h"
#include "aconnoHelpers.h"
#include "aconnoTasks.h"
#include "aconnoBLE.h"
#include "aconnoTasks.h"
/**
* @brief loger task handler
*
*/
TaskHandle_t initTask;
/**
* @brief State Machine menu task handler
*
*/
TaskHandle_t menuStateMachineTask;
#if NRF_LOG_ENABLED
extern TaskHandle_t m_logger_thread;
#endif
AconnoI2C i2c (PIN_EXP_SDA, PIN_EXP_SCL);
AconnoSPI spi(PIN_EPD_MISO, PIN_EPD_MOSI, PIN_EPD_SCK);
AconnoGPIO ledRed(PIN_LED_RED,GPIO_DIR::GPIO_OUTPUT);
AconnoGPIO ledBlue(PIN_LED_BLUE,GPIO_DIR::GPIO_OUTPUT);
AconnoGPIO ledGreen(PIN_LED_GREEN,GPIO_DIR::GPIO_OUTPUT);
GDEP015OC1 epd(spi, PIN_EPD_CS, PIN_EPD_DC, PIN_EPD_RST, PIN_EPD_BUSY);
MCP23017 expdr (i2c, TWI_EXPANDER_ADDR, EXPDR_A_INT,
GPIO_DIR::GPIO_INTERRUPT,
GPIO_PULL::OFF,
GPIO_EDGE::FALLING,
mainMenuInterruptCallback);
/** @brief Function for application main entry.
*/
int main(void)
{
// Initialize modules.
log_init();
clock_init();
NRF_LOG_INFO("\r\n\r\nMain started.");
if(pdPASS != xTaskCreate(logTaskFunction, "INIT", 256, NULL, 1,
&initTask))
{
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
xTaskCreate(menuStateMachineTaskFunction, "MenuStateMachine", 256, NULL, 1,
&menuStateMachineTask);
// Activate deep sleep mode.
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
// Initialize modules.
timers_init();
application_timers_start();
// aconno BLE module init
AconnoBLE &myBLE = *getAconnoBLEInstance();
myBLE.initBLEStack();
myBLE.GATTInit();
#if 1
myBLE.setTXPower(4);
myBLE.startAdvertising(APP_ADV_INTERVAL, APP_ADV_DURATION);
#endif
// Create a FreeRTOS task for the BLE stack.
// The task will run advertising_start() before entering its loop.
nrf_sdh_freertos_init(NULL, NULL);
NRF_LOG_INFO("HRS FreeRTOS example started.");
settingsInit(NULL);
basicConfigInit();
arbDataInit();
// Start FreeRTOS scheduler.
vTaskStartScheduler();
for (;;)
{
APP_ERROR_HANDLER(NRF_ERROR_FORBIDDEN);
}
}
#if NRF_LOG_ENABLED
/**@brief Thread for handling the logger.
*
* @details This thread is responsible for processing log entries if
* logs are deferred. Thread flushes all log entries and suspends. It is
* resumed by idle task hook.
*
* @param[in] arg Pointer used for passing some arbitrary information
* (context) from the osThreadCreate() call to the thread.
*/
void logger_thread(void * arg)
{
UNUSED_PARAMETER(arg);
while (1)
{
NRF_LOG_FLUSH();
vTaskSuspend(NULL); // Suspend myself
}
}
#endif //NRF_LOG_ENABLED
/**@brief A function which is hooked to idle task.
* @note Idle hook must be enabled in FreeRTOS configuration
* (configUSE_IDLE_HOOK).
*/
#ifdef __cplusplus
extern "C"
{
void vApplicationIdleHook( void )
{
#if NRF_LOG_ENABLED
vTaskResume(m_logger_thread);
#endif
}
}
#endif
+12 -45
View File
@@ -8,62 +8,29 @@
* @copyright Copyright (c) 2019
*
*/
#include "FreeRTOS.h"
#include "aconnoTasks.h"
#include "aconnoBLE.h"
#include "nrf_gpio.h"
#include "aconnoGPIO.h"
#include "semphr.h"
#include "aconnoHelpers.h"
#include "menuStates.h"
#include "acn52832Bsp.h"
/*epd*/
#include "aconnoSPI.h"
#include "GDEP015OC1.h"
#include "pictures.h"
/*ioexp*/
#include "aconnoI2C.h"
#include "MCP23017.h"
TaskHandle_t initTask;
TaskHandle_t blinkyTask;
TaskHandle_t blinkyTask2;
TaskHandle_t batteryServiceTaskMy;
TaskHandle_t menuStateMachineTask;
extern TaskHandle_t menuStateMachineTask;
TaskHandle_t getInterruptSourceTask;
extern AconnoSPI spi;
extern AconnoI2C i2c;
extern AconnoGPIO ledRed;
extern AconnoGPIO ledBlue;
extern AconnoGPIO ledGreen;
extern GDEP015OC1 epd;
extern MCP23017 expdr;
IOEXP_INT_SOURCE intSource = IOEXP_INT_SOURCE::NOTHING;
State* pMenuState;
SemaphoreHandle_t getInterruptSourceSemaphore;
AconnoGPIO ledRed(LED1_PIN,GPIO_DIR::GPIO_OUTPUT);
AconnoGPIO ledBlue(LED2_PIN,GPIO_DIR::GPIO_OUTPUT);
AconnoGPIO ledGreen(LED3_PIN,GPIO_DIR::GPIO_OUTPUT);
/* AconnoGPIO btn1(BTN_1_PIN,
GPIO_DIR::GPIO_INTERRUPT,
GPIO_PULL::OFF,
GPIO_EDGE::FALLING,
testCallback); */
AconnoSPI spi(PIN_EPD_MISO, PIN_EPD_MOSI, PIN_EPD_SCK);
GDEP015OC1 epd(spi, PIN_EPD_CS, PIN_EPD_DC, PIN_EPD_RST, PIN_EPD_BUSY);
AconnoI2C i2c (PIN_EXP_SDA, PIN_EXP_SCL);
MCP23017 expdr (i2c, TWI_EXPANDER_ADDR, EXPDR_A_INT,
GPIO_DIR::GPIO_INTERRUPT,
GPIO_PULL::OFF,
GPIO_EDGE::FALLING,
mainMenuInterruptCallback);
/**< Definition of Logger thread. */
#if NRF_LOG_ENABLED
TaskHandle_t m_logger_thread;
+5 -21
View File
@@ -13,18 +13,16 @@
#define __ACONNO_TASKS_H__
#include "FreeRTOS.h"
#include "aconnoBLE.h"
#include "nrf_gpio.h"
#include "semphr.h"
#include "aconnoHelpers.h"
#include "acd52832Bsp.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#define BLINKY_1_DELAY_MS (1001)
#define BLINKY_2_DELAY_MS (5001)
#define LED1_PIN (22)
#define LED2_PIN (23)
#define LED3_PIN (24)
#define BTN_1_PIN (25)
/**
* @brief Function logger
*
@@ -32,20 +30,6 @@
*/
void logTaskFunction(void *arg);
/**
* @brief Example blinky function 1
*
* @param arg
*/
void blinkyFunction(void *arg);
/**
* @brief Example blinky function 2
*
* @param arg
*/
void blinkyFunction2(void *arg);
/**
* @brief Main state machine task to control the epd menu
*