Commit a8ab8b49 authored by Marek Matej's avatar Marek Matej Committed by Mahesh Mahadevan
Browse files

samples: drivers: IPM fixes

Updates and fixes to support IPM sample on ESP32:

- fix IPM sample code for APPCPU and PROCPU
- align with memory layout, add flash awarenes
- shell commands to stop/start APPCPU
- reorganize overlays

Signed-off-by: default avatarMarek Matej <marek.matej@espressif.com>
parent ed117971
Loading
Loading
Loading
Loading
+4 −26
Changes for samples/drivers/ipm/ipm_esp32/CMakeLists.txt: 4 added lines, 26 removed lines.
Original line number Diff line number Diff line
@@ -2,33 +2,11 @@

cmake_minimum_required(VERSION 3.20.0)

set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/ipm_esp32_appcpu-prefix/src/ipm_esp32_appcpu-build/zephyr)

if("${BOARD}" STREQUAL "esp32_devkitc_wrover/esp32/procpu")
  set(BOARD_REMOTE "esp32_devkitc_wrover/esp32/appcpu")
elseif("${BOARD}" STREQUAL "esp32_devkitc_wroom/esp32/procpu")
  set(BOARD_REMOTE "esp32_devkitc_wroom/esp32/appcpu")
elseif("${BOARD}" STREQUAL "esp32s3_devkitm/esp32s3/procpu")
  set(BOARD_REMOTE "esp32s3_devkitm/esp32s3/appcpu")
else()
  message(FATAL_ERROR "${BOARD} was not supported for this sample")
endif()
set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/../ipm_esp32_remote/zephyr)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(ipm_esp32)

set_source_files_properties(${REMOTE_ZEPHYR_DIR}/esp32_appcpu_firmware.c PROPERTIES GENERATED TRUE)
target_sources(app PRIVATE src/main.c ${REMOTE_ZEPHYR_DIR}/esp32_appcpu_firmware.c)

include(ExternalProject)

ExternalProject_Add(
	ipm_esp32_appcpu
	SOURCE_DIR ${APPLICATION_SOURCE_DIR}/ipm_esp_appcpu
	INSTALL_COMMAND ""
	CMAKE_CACHE_ARGS -DBOARD:STRING=${BOARD_REMOTE}
	BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}"
	BUILD_ALWAYS True
)
message(STATUS "${BOARD} compile as Master in this sample")
project(ipm_esp32)

add_dependencies(app ipm_esp32_appcpu)
target_sources(app PRIVATE src/main.c src/procpu_shell.c)
+11 −0
Changes for samples/drivers/ipm/ipm_esp32/Kconfig.sysbuild: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Copyright 2022 NXP
#
# SPDX-License-Identifier: Apache-2.0

source "share/sysbuild/Kconfig"

config IPM_REMOTE_BOARD
	string
	default "esp32_devkitc_wrover/esp32/appcpu" if $(BOARD) = "esp32_devkitc_wroom"
	default "esp32_devkitc_wroom/esp32/appcpu" if $(BOARD) = "esp32_devkitc_wroom"
	default "esp32s3_devkitm/esp32s3/appcpu" if $(BOARD) = "esp32s3_devkitm"
+19 −16
Changes for samples/drivers/ipm/ipm_esp32/README.rst: 19 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@ Build the ESP32 IPM sample code as follows:

.. zephyr-app-commands::
   :zephyr-app: samples/drivers/ipm/ipm_esp32
   :board: esp32_devkitc_wroom/esp32/procpu
   :board: esp32s3_devkitm/esp32s3/procpu
   :west-args: --sysbuild
   :goals: build
   :compact:

@@ -38,18 +39,20 @@ console program (e.g., minicom, putty, screen, etc).

.. code-block:: console

   *** 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...
   PRO_CPU received a message from APP_CPU : APP_CPU: This is a response
   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...
   PRO_CPU received a message from APP_CPU : APP_CPU: This is a response
   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...
   PRO_CPU received a message from APP_CPU : APP_CPU: This is a response
   PRO_CPU is sending a fake request, waiting remote response...
   PRO_CPU received a message from APP_CPU : APP_CPU: This is a response
   *** Booting Zephyr OS build v4.0.0-rc2-61-ga24efebe15e2 ***
   PRO_CPU is sending a request, waiting remote response...
   PRO_CPU received a message from APP_CPU : APP_CPU uptime ticks 502
   PRO_CPU is sending a request, waiting remote response...
   PRO_CPU received a message from APP_CPU : APP_CPU uptime ticks 10502
   PRO_CPU is sending a request, waiting remote response...
   PRO_CPU received a message from APP_CPU : APP_CPU uptime ticks 20503
   PRO_CPU is sending a request, waiting remote response...
   PRO_CPU received a message from APP_CPU : APP_CPU uptime ticks 30504
   PRO_CPU is sending a request, waiting remote response...
   PRO_CPU received a message from APP_CPU : APP_CPU uptime ticks 40505
   PRO_CPU is sending a request, waiting remote response...
   PRO_CPU received a message from APP_CPU : APP_CPU uptime ticks 50506
   PRO_CPU is sending a request, waiting remote response...
   PRO_CPU received a message from APP_CPU : APP_CPU uptime ticks 60507
   PRO_CPU is sending a request, waiting remote response...
   PRO_CPU received a message from APP_CPU : APP_CPU uptime ticks 70508
+0 −2
Changes for samples/drivers/ipm/ipm_esp32/ipm_esp_appcpu/prj.conf: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
CONFIG_HEAP_MEM_POOL_SIZE=256
CONFIG_IPM=y
+3 −1
Changes for samples/drivers/ipm/ipm_esp32/remote/CMakeLists.txt: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@
cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(ipm_esp32_appcpu)

message(STATUS "${BOARD} compiles as remote in this sample")
project(ipm_esp32_remote)

target_sources(app PRIVATE src/main.c)
Loading