From 8a94ea112b94055d17d06bb2ca1ca69f5a454489 Mon Sep 17 00:00:00 2001 From: Andrei Gansari Date: Wed, 16 Dec 2020 20:03:43 +0200 Subject: [PATCH] samples: ipm_mcux: add lpc55s69 support Adds multicore support for lpcxpresso55s69 board. Documentation to be updated in a later commit. Signed-off-by: Andrei Gansari --- samples/subsys/ipc/ipm_mcux/CMakeLists.txt | 29 ++++++++++++++----- samples/subsys/ipc/ipm_mcux/prj.conf | 4 +-- .../subsys/ipc/ipm_mcux/remote/CMakeLists.txt | 13 +++++---- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/samples/subsys/ipc/ipm_mcux/CMakeLists.txt b/samples/subsys/ipc/ipm_mcux/CMakeLists.txt index 1253cf75ecf..88c1eb3e10d 100644 --- a/samples/subsys/ipc/ipm_mcux/CMakeLists.txt +++ b/samples/subsys/ipc/ipm_mcux/CMakeLists.txt @@ -3,14 +3,25 @@ cmake_minimum_required(VERSION 3.13.1) # # SPDX-License-Identifier: Apache-2.0 # -set(BOARD lpcxpresso54114_m4) +set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/ipm_mcux_remote-prefix/src/ipm_mcux_remote-build/zephyr) + +if("${BOARD}" STREQUAL "lpcxpresso54114_m4") + set(BOARD_REMOTE "lpcxpresso54114_m0") +elseif("${BOARD}" STREQUAL "lpcxpresso55s69_cpu0") + set(BOARD_REMOTE "lpcxpresso55s69_cpu1") +else() + message(FATAL_ERROR "${BOARD} was not supported for this sample") +endif() + +message(INFO " ${BOARD} compile as Master in this sample") find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(ipm_mcux) -if(NOT ("${BOARD}" STREQUAL "lpcxpresso54114_m4")) - message(FATAL_ERROR "${BOARD} was specified, but this sample only supports lpcxpresso54114_m4") -endif() +enable_language(C ASM) + +target_sources(app PRIVATE src/main_master.c) include(ExternalProject) @@ -18,10 +29,12 @@ ExternalProject_Add( ipm_mcux_remote SOURCE_DIR ${APPLICATION_SOURCE_DIR}/remote INSTALL_COMMAND "" # This particular build system has no install command - BUILD_BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/ipm_mcux_remote-prefix/src/ipm_mcux_remote-build/zephyr/${KERNEL_BIN_NAME}" + CMAKE_CACHE_ARGS -DBOARD:STRING=${BOARD_REMOTE} + CMAKE_CACHE_ARGS -DDTC_OVERLAY_FILE:STRING=${DTC_OVERLAY_FILE} + BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}" + BUILD_ALWAYS True ) -project(ipm_mcux) +add_dependencies(second_core_inc_target ipm_mcux_remote) -target_sources(app PRIVATE src/main_master.c) -add_dependencies(core_m0_inc_target ipm_mcux_remote) +target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/samples/subsys/ipc/ipm_mcux/prj.conf b/samples/subsys/ipc/ipm_mcux/prj.conf index 77d6b51a210..8440b829816 100644 --- a/samples/subsys/ipc/ipm_mcux/prj.conf +++ b/samples/subsys/ipc/ipm_mcux/prj.conf @@ -1,7 +1,7 @@ CONFIG_PRINTK=y CONFIG_IPM=y CONFIG_IPM_MCUX=y -CONFIG_SLAVE_CORE_MCUX=y -CONFIG_SLAVE_IMAGE_MCUX="${ZEPHYR_BINARY_DIR}/../ipm_mcux_remote-prefix/src/ipm_mcux_remote-build/zephyr/${KERNEL_BIN_NAME}" +CONFIG_SECOND_CORE_MCUX=y +CONFIG_SECOND_IMAGE_MCUX="${ZEPHYR_BINARY_DIR}/../ipm_mcux_remote-prefix/src/ipm_mcux_remote-build/zephyr/${KERNEL_BIN_NAME}" CONFIG_TIMESLICE_SIZE=1 CONFIG_MAIN_STACK_SIZE=2048 diff --git a/samples/subsys/ipc/ipm_mcux/remote/CMakeLists.txt b/samples/subsys/ipc/ipm_mcux/remote/CMakeLists.txt index b0d3cbf4b43..038d0be4da3 100644 --- a/samples/subsys/ipc/ipm_mcux/remote/CMakeLists.txt +++ b/samples/subsys/ipc/ipm_mcux/remote/CMakeLists.txt @@ -3,13 +3,16 @@ cmake_minimum_required(VERSION 3.13.1) # # SPDX-License-Identifier: Apache-2.0 # -set(BOARD lpcxpresso54114_m0) + +if(("${BOARD}" STREQUAL "lpcxpresso54114_m0") + OR "${BOARD}" STREQUAL "lpcxpresso55s69_cpu1") + message(INFO " ${BOARD} compiles as remote in this sample") +else() + message(FATAL_ERROR "${BOARD} was not supported for this sample") +endif() find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(ipm_mcux_remote) -if(NOT ("${BOARD}" STREQUAL "lpcxpresso54114_m0")) - message(FATAL_ERROR "${BOARD} was specified, but this sample only supports lpcxpresso54114_m0") -endif() - target_sources(app PRIVATE src/main_remote.c) +target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)