M5Stack ESP32 Timer Camera (not ESP-EYE)

I’m following the steps from this documentation (adapting pins for Timer Camera). I took “from firmware folder” in the text to mean “from firmware-sdk folder”.

I have installed the various tool chains, etc. However, on clear && idf.py I get the following error:
CMake Error at CMakeLists.txt4 (message): Please create a target named 'app' (ex: add_executable(app)) before adding this file.

What have I missed/doing wrong?

Tried adding the directory “include”, now numerous errors e.g.:

CMake Error at /home/.../esp/esp-idf/components/mbedtls/CMakeLists.txt
   Cannot specify compile definitions for target "mbedtls" which is not built by this project.

Basically, I’m missing a number of the submodules, which is unclear why.

Went to a new host (fresh Linux install), attempted install of ESP-IDF v4.4 first error:

Error: Externally Managed Environment

Fixed by this. Cleared that error and now I have error after error:

Error compiling Cython file

Is ESP-IDF v4.4 actually a prescriptive requirement or can any latest ESP-IDF be used please?

To be honest, and has been said in other posts, it would be better to do the firmware builds in Arduino for a wider range of camera support. I literally want to change one #define line to my camera, now two days in and I’m still just trying to get build environment right.

Fresh Linux build, fresh install of ESP-IDF master (latest). Got rid of Externally Managed Environment and Cython file - put down to older ESP-IDF version clash somewhere.

Ran $ idf.py build and got the following errors…

FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/__/edge-impulse-sdk/porting/espressif/ei_classifier_porting.cpp.obj 
...
/home/gavin67890/esp/firmware-espressif-esp32/edge-impulse-sdk/porting/espressif/ei_classifier_porting.cpp: In function 'EI_IMPULSE_ERROR ei_sleep(int32_t)':
/home/gavin67890/esp/firmware-espressif-esp32/edge-impulse-sdk/porting/espressif/ei_classifier_porting.cpp:38:26: error: 'portTICK_RATE_MS' was not declared in this scope; did you mean 'portTICK_PERIOD_MS'?
   38 |     vTaskDelay(time_ms / portTICK_RATE_MS);
      |                          ^~~~~~~~~~~~~~~~
      |                          portTICK_PERIOD_MS
[926/1205] Building CXX object esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj
FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj 
...
In file included from /home/gavin67890/esp/firmware-espressif-esp32/main/main.cpp:35:
/home/gavin67890/esp/firmware-espressif-esp32/edge-impulse/ingestion-sdk-platform/sensors/ei_analogsensor.h:51:1: warning: missing initializer for member 'ei_device_fusion_sensor_t::axis_flag_used' [-Wmissing-field-initializers]
   51 | };
      | ^
/home/gavin67890/esp/firmware-espressif-esp32/main/main.cpp: In function 'int app_main()':
/home/gavin67890/esp/firmware-espressif-esp32/main/main.cpp:47:5: error: 'gpio_pad_select_gpio' was not declared in this scope; did you mean 'esp_rom_gpio_pad_select_gpio'?
   47 |     gpio_pad_select_gpio(GPIO_NUM_21);
      |     ^~~~~~~~~~~~~~~~~~~~
      |     esp_rom_gpio_pad_select_gpio

Hi @gavin67890

What version of IDF are you using?

portTICK_RATE_MS has been replaced with portTICK_PERIOD_MS on later versions. v4.4 is stated in that git so should be used for now.

Best

Eoin

My starting point was v4.4, which appears to clash with other things (Cython being one). Although I stuck explicitly to the installation guide, I couldn’t even get through the ESP-IDF install script.

Freshly installed Ubuntu 22.04.3 LTS (most benign thing I could think of)
idf.py build indicates the following and other messages:

[3/13] Building CXX object esp-idf/main/CMakeFi...on-sdk-platform/sensors/ei_analogsensor.cpp.obj
In file included from /home/gavin67890/esp/firmware-espressif-esp32/edge-impulse/ingestion-sdk-platform/sensors/ei_analogsensor.cpp:31:
/home/gavin67890/esp/firmware-espressif-esp32/edge-impulse/ingestion-sdk-platform/sensors/ei_analogsensor.h:51:1: warning: missing initializer for member 'ei_device_fusion_sensor_t::axis_flag_used' [-Wmissing-field-initializers]
 };
 ^
[4/13] Building CXX object esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj
In file included from /home/gavin67890/esp/firmware-espressif-esp32/main/main.cpp:35:
/home/gavin67890/esp/firmware-espressif-esp32/edge-impulse/ingestion-sdk-platform/sensors/ei_analogsensor.h:51:1: warning: missing initializer for member 'ei_device_fusion_sensor_t::axis_flag_used' [-Wmissing-field-initializers]
 };
 ^
[5/13] Building CXX object esp-idf/main/CMakeFi...pressif_esp32/ei_device_espressif_esp32.cpp.obj
In file included from /home/gavin67890/esp/firmware-espressif-esp32/edge-impulse/ingestion-sdk-platform/espressif_esp32/ei_device_espressif_esp32.h:28,
                 from /home/gavin67890/esp/firmware-espressif-esp32/edge-impulse/ingestion-sdk-platform/espressif_esp32/ei_device_espressif_esp32.cpp:24:
/home/gavin67890/esp/firmware-espressif-esp32/firmware-sdk/ei_device_info_lib.h: In member function 'virtual bool EiDeviceInfo::save_config()':
/home/gavin67890/esp/firmware-espressif-esp32/firmware-sdk/ei_device_info_lib.h:126:16: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 128 equals destination size [-Wstringop-truncation]
         strncpy(buf.wifi_ssid, wifi_ssid.c_str(), 128);
         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gavin67890/esp/firmware-espressif-esp32/firmware-sdk/ei_device_info_lib.h:127:16: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 128 equals destination size [-Wstringop-truncation]
         strncpy(buf.wifi_password, wifi_password.c_str(), 128);
         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gavin67890/esp/firmware-espressif-esp32/firmware-sdk/ei_device_info_lib.h:131:16: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 128 equals destination size [-Wstringop-truncation]
         strncpy(buf.sample_label, sample_label.c_str(), 128);
         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gavin67890/esp/firmware-espressif-esp32/firmware-sdk/ei_device_info_lib.h:132:16: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 33 equals destination size [-Wstringop-truncation]
         strncpy(buf.sample_hmac_key, sample_hmac_key.c_str(), 33);
         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gavin67890/esp/firmware-espressif-esp32/firmware-sdk/ei_device_info_lib.h:133:16: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 128 equals destination size [-Wstringop-truncation]
         strncpy(buf.upload_host, upload_host.c_str(), 128);
         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gavin67890/esp/firmware-espressif-esp32/firmware-sdk/ei_device_info_lib.h:134:16: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 128 equals destination size [-Wstringop-truncation]
         strncpy(buf.upload_path, upload_path.c_str(), 128);
         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gavin67890/esp/firmware-espressif-esp32/firmware-sdk/ei_device_info_lib.h:135:16: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 128 equals destination size [-Wstringop-truncation]
         strncpy(buf.upload_api_key, upload_api_key.c_str(), 128);
         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gavin67890/esp/firmware-espressif-esp32/firmware-sdk/ei_device_info_lib.h:136:16: warning: 'char* strncpy(char*, const char*, size_t)' specified bound 128 equals destination size [-Wstringop-truncation]
         strncpy(buf.mgmt_url, management_url.c_str(), 128);
         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Although it does finish build. However, on attempt to flash:

A fatal error occurred: No serial data received.
CMake Error at run_serial_tool.cmake:56 (message):
  /home/gavin67890/.espressif/python_env/idf4.4_py3.10_env/bin/python
  /home/gavin67890/esp/esp-idf/components/esptool_py/esptool/esptool.py
  --chip esp32 failed


FAILED: CMakeFiles/flash /home/gavin67890/esp/firmware-espressif-esp32/build/CMakeFiles/flash 
cd /home/gavin67890/esp/esp-idf/components/esptool_py && /usr/bin/cmake -D IDF_PATH="/home/gavin67890/esp/esp-idf" -D SERIAL_TOOL="/home/gavin67890/.espressif/python_env/idf4.4_py3.10_env/bin/python /home/gavin67890/esp/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32" -D SERIAL_TOOL_ARGS="--before=default_reset --after=hard_reset write_flash @flash_args" -D WORKING_DIRECTORY="/home/gavin67890/esp/firmware-espressif-esp32/build" -P /home/gavin67890/esp/esp-idf/components/esptool_py/run_serial_tool.cmake
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

Timer Camera X (used #define of …_M5STACK_PSRAM) is the device, which connects fine and flashes fine with Burner software.