Skip to content

Instantly share code, notes, and snippets.

@brianredbeard
Created May 8, 2023 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianredbeard/0332a67966f98ec965d242eed63af5ef to your computer and use it in GitHub Desktop.
Save brianredbeard/0332a67966f98ec965d242eed63af5ef to your computer and use it in GitHub Desktop.
ESP-IDF MicroPython Component errors
### Current Directory Structure (micropython submodule pruned)
❯ tree --gitignore
.
├── CMakeLists.txt
├── components
│   └── micropython
├── main
│   ├── CMakeLists.txt
│   ├── idf_component.yml
│   └── mp-test.c
└── sdkconfig
4 directories, 5 files
-----
### definition of ESP-IDF component dependency for micropython
❯ cat main/idf_component.yml
## IDF Component Manager Manifest File
dependencies:
## Required IDF version
idf:
version: ">=4.1.0"
micropython:
path: ../components/micropython/ports/esp32
-----
### additional debug messages added to ../components/micropython/ports/esp32/CMakeLists.txt
❯ head -n 30 components/micropython/ports/esp32/CMakeLists.txt
# Top-level cmake file for building MicroPython on ESP32.
cmake_minimum_required(VERSION 3.12)
# Set the location of this port's directory.
set(MICROPY_PORT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
# Set the board if it's not already set.
if(NOT MICROPY_BOARD)
set(MICROPY_BOARD GENERIC)
endif()
# Set the board directory and check that it exists.
if(NOT MICROPY_BOARD_DIR)
set(MICROPY_BOARD_DIR ${MICROPY_PORT_DIR}/boards/${MICROPY_BOARD})
endif()
if(NOT EXISTS ${MICROPY_BOARD_DIR}/mpconfigboard.cmake)
message(STATUS " - PROJECT_NAME: ${PROJECT_NAME}")
message(STATUS " - CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}")
message(STATUS " - CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS " - PROJECT_SOURCE_DIR: ${PROJECT_SOURCE_DIR}")
message(STATUS " - MICROPY_PORT_DIR: ${MICROPY_PORT_DIR}")
message(STATUS " - MICROPY_BOARD: ${MICROPY_BOARD}")
message(STATUS " - MICROPY_BOARD_DIR: ${MICROPY_BOARD_DIR}")
message(FATAL_ERROR "Invalid MICROPY_BOARD specified: ${MICROPY_BOARD}")
endif()
# Include main IDF cmake file.
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-----
### output of idf.py reconfigure showing directory parsing failure
❯ idf.py reconfigure
Executing action: reconfigure
Running cmake in directory /Users/bharrington/Projects/hardware/mp-test/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DIDF_TARGET=esp32 -DCCACHE_ENABLE=0 /Users/bharrington/Projects/hardware/mp-test"...
-- Found Git: /opt/homebrew/bin/git (found version "2.40.1")
-- Component directory /Users/bharrington/Projects/hardware/mp-test/components/micropython does not contain a CMakeLists.txt file. No component will be added
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /Users/bharrington/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/bharrington/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Users/bharrington/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32
Solving dependencies requirements
..Updating lock file at /Users/bharrington/Projects/hardware/mp-test/dependencies.lock
Processing 2 dependencies:
[1/2] idf (4.4.4)
[2/2] micropython (*)
-- - PROJECT_NAME: mp-test
-- - CMAKE_SOURCE_DIR: /Users/bharrington/Projects/hardware/mp-test/build
-- - CMAKE_CURRENT_SOURCE_DIR: /Users/bharrington/Projects/hardware/mp-test/build
-- - PROJECT_SOURCE_DIR:
-- - MICROPY_PORT_DIR: /Users/bharrington/Projects/hardware/mp-test/build
-- - MICROPY_BOARD: GENERIC
-- - MICROPY_BOARD_DIR: /Users/bharrington/Projects/hardware/mp-test/build/boards/GENERIC
CMake Error at /Users/bharrington/Projects/hardware/badgePython/esp-idf/tools/cmake/component.cmake:219 (message):
CMake Warning (dev) at build_properties.temp.cmake:8:
Syntax Warning in cmake code at column 51
Argument not separated from preceding token by whitespace.
Call Stack (most recent call first):
/Users/bharrington/Projects/hardware/badgePython/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:3 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at
/Users/bharrington/Projects/hardware/mp-test/components/micropython/ports/esp32/CMakeLists.txt:25
(message):
Invalid MICROPY_BOARD specified: GENERIC
Call Stack (most recent call first):
/Users/bharrington/Projects/hardware/badgePython/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:106 (include)
/Users/bharrington/Projects/hardware/badgePython/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:124 (__component_get_requirements)
Call Stack (most recent call first):
/Users/bharrington/Projects/hardware/badgePython/esp-idf/tools/cmake/build.cmake:497 (__component_get_requirements)
/Users/bharrington/Projects/hardware/badgePython/esp-idf/tools/cmake/project.cmake:393 (idf_build_process)
CMakeLists.txt:8 (project)
-- Configuring incomplete, errors occurred!
cmake failed with exit code 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment