Skip to content

Commit

Permalink
coprocessor: add coprocessor project
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo Soares committed Mar 28, 2022
1 parent 8e3b23b commit 0c13e4d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
26 changes: 26 additions & 0 deletions coprocessor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.20.0)

set(NRF_SDK_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../ncs/nrf)

set(COPROCESSOR_SAMPLE_ROOT_DIR ${NRF_SDK_ROOT_DIR}/ncs/nrf/samples/openthread/coprocessor)

set(OT_NCP_VENDOR_HOOK_SOURCE_DIR ${COPROCESSOR_SAMPLE_ROOT_DIR})

set(PROJECT_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(openthread_coprocessor)

# NORDIC SDK APP START
target_sources(app PRIVATE
${COPROCESSOR_SAMPLE_ROOT_DIR}/src/main.c
${COPROCESSOR_SAMPLE_ROOT_DIR}/src/nrf_802154_radio_wrapper.c
)
# NORDIC SDK APP END
23 changes: 23 additions & 0 deletions coprocessor/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
PROJECT_ROOT_PATH := $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))))

TARGET_BOARD = nrf52840dongle_nrf52840

include $(PROJECT_ROOT_PATH)/../common.mk

NRF_SDK_ROOT_DIR = $(NCS_SRC_PATH)/nrf
COPROCESSOR_SAMPLE_DIR = $(NRF_SDK_ROOT_DIR)/samples/openthread/coprocessor

RCP_OVERLAY := $(COPROCESSOR_SAMPLE_DIR)/overlay-rcp.conf
USB_OVERLAY := $(COPROCESSOR_SAMPLE_DIR)/overlay-usb.conf
USB_DTC_OVERLAY := -DDTC_OVERLAY_FILE="$(COPROCESSOR_SAMPLE_DIR)/usb.overlay"
# default overlays
OVERLAY_CONFIG_DEFAULT := $(COPROCESSOR_SAMPLE_DIR)/prj.conf;$(RCP_OVERLAY);$(USB_OVERLAY)


.PHONY: build
build: check_deps
$(call build_env,\
west build -b $(TARGET_BOARD) --build-dir $(PROJECT_ROOT_PATH)/build $(COPROCESSOR_SAMPLE_DIR) -- \
-DOVERLAY_CONFIG="$(OVERLAY_CONFIG_DEFAULT)" \
$(USB_DTC_OVERLAY) \
)

0 comments on commit 0c13e4d

Please sign in to comment.