Skip to content

Commit f433e95

Browse files
sylvioalvesstephanosio
authored andcommitted
samples: ipm_esp32: use net core source from build ouput
Current ipm_esp32 sample code requires esp32_net_firmware.c file as source input, which is generated after ipm_esp32_net build. esp32_net_firmware.c was manually added as binary blob, which needs to be removed from the repository. This change modifies ipm_esp32 CMakeLists.txt to include the build output of ipm_esp32_net as input source of ipm_esp32 build, allowing the binary blob to be removed. Current approach shall be updated during next release. Signed-off-by: Sylvio Alves <[email protected]>
1 parent 57e6532 commit f433e95

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

samples/drivers/ipm/ipm_esp32/CMakeLists.txt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,23 @@
22

33
cmake_minimum_required(VERSION 3.20.0)
44

5+
set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/ipm_esp32_net-prefix/src/ipm_esp32_net-build/zephyr)
6+
57
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
68
project(ipm_esp32)
79

8-
target_sources(app PRIVATE src/main.c src/esp32_net_firmware.c)
10+
set_source_files_properties(${REMOTE_ZEPHYR_DIR}/esp32_net_firmware.c PROPERTIES GENERATED TRUE)
11+
target_sources(app PRIVATE src/main.c ${REMOTE_ZEPHYR_DIR}/esp32_net_firmware.c)
12+
13+
include(ExternalProject)
14+
15+
ExternalProject_Add(
16+
ipm_esp32_net
17+
SOURCE_DIR ${APPLICATION_SOURCE_DIR}/ipm_esp32_net
18+
INSTALL_COMMAND ""
19+
CMAKE_CACHE_ARGS -DBOARD:STRING=esp32_net
20+
BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}"
21+
BUILD_ALWAYS True
22+
)
23+
24+
add_dependencies(app ipm_esp32_net)

samples/drivers/ipm/ipm_esp32/README.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,23 @@ messages in chunks of 64bytes.
2121
Building and Running the Zephyr Code
2222
************************************
2323

24-
The sample requires two build commands to run, first of all
25-
you need to build the esp32_net firmware as follows:
24+
Build the ESP32 IPM sample code as follows:
2625

2726
.. zephyr-app-commands::
28-
:zephyr-app: samples/drivers/ipm/ipm_esp32/ipm_esp32_net
29-
:board: esp32_net
27+
:zephyr-app: samples/drivers/ipm/ipm_esp32
28+
:board: esp32
3029
:goals: build
3130
:compact:
3231

33-
Copy output file build/zephyr/esp32_net_firmware.c to samples/drivers/ipm/ipm_esp32/src,
34-
then build the main project and flash as stated earlier, and you would see the following output:
32+
Sample Output
33+
*************
34+
35+
To check the output of this sample, run ``west espressif monitor`` or any other serial
36+
console program (e.g., minicom, putty, screen, etc).
3537

3638
.. code-block:: console
3739
38-
*** Booting Zephyr OS build zephyr-v3.0.0-1911-g610f489c861e ***
40+
*** Booting Zephyr OS build v3.3.0-rc3-38-gc9225e4365b9 ***
3941
PRO_CPU is sending a fake request, waiting remote response...
4042
PRO_CPU received a message from APP_CPU : APP_CPU: This is a response
4143
PRO_CPU is sending a fake request, waiting remote response...

0 commit comments

Comments
 (0)