diff --git a/samples/drivers/ipm/ipm_esp32/CMakeLists.txt b/samples/drivers/ipm/ipm_esp32/CMakeLists.txt index eb8a0dc3ee6..458f0c9f256 100644 --- a/samples/drivers/ipm/ipm_esp32/CMakeLists.txt +++ b/samples/drivers/ipm/ipm_esp32/CMakeLists.txt @@ -2,7 +2,23 @@ cmake_minimum_required(VERSION 3.20.0) +set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/ipm_esp32_net-prefix/src/ipm_esp32_net-build/zephyr) + find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(ipm_esp32) -target_sources(app PRIVATE src/main.c src/esp32_net_firmware.c) +set_source_files_properties(${REMOTE_ZEPHYR_DIR}/esp32_net_firmware.c PROPERTIES GENERATED TRUE) +target_sources(app PRIVATE src/main.c ${REMOTE_ZEPHYR_DIR}/esp32_net_firmware.c) + +include(ExternalProject) + +ExternalProject_Add( + ipm_esp32_net + SOURCE_DIR ${APPLICATION_SOURCE_DIR}/ipm_esp32_net + INSTALL_COMMAND "" + CMAKE_CACHE_ARGS -DBOARD:STRING=esp32_net + BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}" + BUILD_ALWAYS True +) + +add_dependencies(app ipm_esp32_net) diff --git a/samples/drivers/ipm/ipm_esp32/README.rst b/samples/drivers/ipm/ipm_esp32/README.rst index 3ffa77820a4..6c1e793baf6 100644 --- a/samples/drivers/ipm/ipm_esp32/README.rst +++ b/samples/drivers/ipm/ipm_esp32/README.rst @@ -21,21 +21,23 @@ messages in chunks of 64bytes. Building and Running the Zephyr Code ************************************ -The sample requires two build commands to run, first of all -you need to build the esp32_net firmware as follows: +Build the ESP32 IPM sample code as follows: .. zephyr-app-commands:: - :zephyr-app: samples/drivers/ipm/ipm_esp32/ipm_esp32_net - :board: esp32_net + :zephyr-app: samples/drivers/ipm/ipm_esp32 + :board: esp32 :goals: build :compact: -Copy output file build/zephyr/esp32_net_firmware.c to samples/drivers/ipm/ipm_esp32/src, -then build the main project and flash as stated earlier, and you would see the following output: +Sample Output +************* + +To check the output of this sample, run ``west espressif monitor`` or any other serial +console program (e.g., minicom, putty, screen, etc). .. code-block:: console - *** Booting Zephyr OS build zephyr-v3.0.0-1911-g610f489c861e *** + *** Booting Zephyr OS build v3.3.0-rc3-38-gc9225e4365b9 *** PRO_CPU is sending a fake request, waiting remote response... PRO_CPU received a message from APP_CPU : APP_CPU: This is a response PRO_CPU is sending a fake request, waiting remote response...