CMake Error Setting Up Zephyr Environment for MicroPython on ESP32

Hello guys am working on a simple temperature monitoring system using MicroPython on a Zephyr RTOS-supported microcontroller, such as the ESP32, and transmit the data over Bluetooth Low Energy (BLE) to a mobile app? Am currently trying to setup a Zephyr environment for MicroPython I tried
cmake_minimum_required(VERSION 3.13.1)
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(micropython_project)

target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib)
target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/py/objstr.c)
cmake_minimum_required(VERSION 3.13.1)
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(micropython_project)

target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib)
target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/py/objstr.c)
Along with my MicroPython Script (main.py)
print("Hello, Zephyr with MicroPython!")
print("Hello, Zephyr with MicroPython!")
But during the build process, an error occurs indicating that the MicroPython module is not found.
CMake Error at CMakeLists.txt:10 (find_package):
By not providing "FindZephyr.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Zephyr", but
CMake did not find one.
CMake Error at CMakeLists.txt:10 (find_package):
By not providing "FindZephyr.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Zephyr", but
CMake did not find one.
Do any one have any suggestions as to how I can resolve this??
1 Reply
wafa_ath
wafa_ath7mo ago
Hey @Enthernet Code , Set the ZEPHYR_BASE environment variable to your Zephyr directory:
export ZEPHYR_BASE=/path/to/zephyrproject/zephyr
export ZEPHYR_BASE=/path/to/zephyrproject/zephyr
Then, source the environment script:
source $ZEPHYR_BASE/zephyr-env.sh
source $ZEPHYR_BASE/zephyr-env.sh
This should help CMake find the FindZephyr.cmake file during the build process. Try this out...

Did you find this page helpful?