Skip to content

Commit

Permalink
samples: openamp: Port sample to use multi-image
Browse files Browse the repository at this point in the history
Port the openamp sample to use multi-image.

Signed-off-by: Sebastian Bøe <[email protected]>
  • Loading branch information
SebastianBoe committed Oct 17, 2019
1 parent 1707136 commit 1f54601
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
13 changes: 2 additions & 11 deletions samples/subsys/ipc/openamp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.13.1)
#
set(BOARD lpcxpresso54114_m4)

list(APPEND ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_LIST_DIR}/remote)

include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(openamp)

Expand All @@ -16,15 +18,4 @@ enable_language(C ASM)

target_sources(app PRIVATE src/main.c)

include(ExternalProject)

ExternalProject_Add(
openamp_remote
SOURCE_DIR ${APPLICATION_SOURCE_DIR}/remote
INSTALL_COMMAND "" # This particular build system has no install command
BUILD_BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/openamp_remote-prefix/src/openamp_remote-build/zephyr/zephyr.bin"
# NB: Do we need to pass on more CMake variables?
)
add_dependencies(${IMAGE}core_m0_inc_target openamp_remote)

target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
12 changes: 12 additions & 0 deletions samples/subsys/ipc/openamp/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
#

mainmenu "OpenAMP sample application"

image = REMOTE
source "cmake/Kconfig.template.build_strategy"

source "Kconfig.zephyr"
2 changes: 1 addition & 1 deletion samples/subsys/ipc/openamp/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CONFIG_PRINTK=y
CONFIG_IPM=y
CONFIG_IPM_MCUX=y
CONFIG_SLAVE_CORE_MCUX=y
CONFIG_SLAVE_IMAGE_MCUX="${ZEPHYR_BINARY_DIR}/../openamp_remote-prefix/src/openamp_remote-build/zephyr/zephyr.bin"
CONFIG_SLAVE_IMAGE_MCUX="${CMAKE_BINARY_DIR}/remote/zephyr/zephyr.bin"
CONFIG_TIMESLICE_SIZE=1
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_HEAP_MEM_POOL_SIZE=4096
Expand Down
4 changes: 2 additions & 2 deletions samples/subsys/ipc/openamp/remote/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ 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.c)
target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
zephyr_library_sources(src/main.c)
zephyr_library_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
9 changes: 9 additions & 0 deletions samples/subsys/ipc/openamp/remote/zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-License-Identifier: Apache-2.0

if(FIRST_BOILERPLATE_EXECUTION)
zephyr_add_image(remote output_variable)

if(output_variable)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/.. ${CMAKE_BINARY_DIR}/remote)
endif()
endif()

0 comments on commit 1f54601

Please sign in to comment.