Skip to content

Commit 1f54601

Browse files
committed
samples: openamp: Port sample to use multi-image
Port the openamp sample to use multi-image. Signed-off-by: Sebastian Bøe <[email protected]>
1 parent 1707136 commit 1f54601

File tree

5 files changed

+26
-14
lines changed

5 files changed

+26
-14
lines changed

samples/subsys/ipc/openamp/CMakeLists.txt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.13.1)
55
#
66
set(BOARD lpcxpresso54114_m4)
77

8+
list(APPEND ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_LIST_DIR}/remote)
9+
810
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
911
project(openamp)
1012

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

1719
target_sources(app PRIVATE src/main.c)
1820

19-
include(ExternalProject)
20-
21-
ExternalProject_Add(
22-
openamp_remote
23-
SOURCE_DIR ${APPLICATION_SOURCE_DIR}/remote
24-
INSTALL_COMMAND "" # This particular build system has no install command
25-
BUILD_BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/openamp_remote-prefix/src/openamp_remote-build/zephyr/zephyr.bin"
26-
# NB: Do we need to pass on more CMake variables?
27-
)
28-
add_dependencies(${IMAGE}core_m0_inc_target openamp_remote)
29-
3021
target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

samples/subsys/ipc/openamp/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Copyright (c) 2019 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
mainmenu "OpenAMP sample application"
8+
9+
image = REMOTE
10+
source "cmake/Kconfig.template.build_strategy"
11+
12+
source "Kconfig.zephyr"

samples/subsys/ipc/openamp/prj.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CONFIG_PRINTK=y
22
CONFIG_IPM=y
33
CONFIG_IPM_MCUX=y
44
CONFIG_SLAVE_CORE_MCUX=y
5-
CONFIG_SLAVE_IMAGE_MCUX="${ZEPHYR_BINARY_DIR}/../openamp_remote-prefix/src/openamp_remote-build/zephyr/zephyr.bin"
5+
CONFIG_SLAVE_IMAGE_MCUX="${CMAKE_BINARY_DIR}/remote/zephyr/zephyr.bin"
66
CONFIG_TIMESLICE_SIZE=1
77
CONFIG_MAIN_STACK_SIZE=2048
88
CONFIG_HEAP_MEM_POOL_SIZE=4096

samples/subsys/ipc/openamp/remote/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ if(NOT ("${BOARD}" STREQUAL "lpcxpresso54114_m0"))
1212
message(FATAL_ERROR "${BOARD} was specified, but this sample only supports lpcxpresso54114_m0")
1313
endif()
1414

15-
target_sources(app PRIVATE src/main.c)
16-
target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
15+
zephyr_library_sources(src/main.c)
16+
zephyr_library_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
if(FIRST_BOILERPLATE_EXECUTION)
4+
zephyr_add_image(remote output_variable)
5+
6+
if(output_variable)
7+
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/.. ${CMAKE_BINARY_DIR}/remote)
8+
endif()
9+
endif()

0 commit comments

Comments
 (0)