espressif / esp-rainmaker

ESP RainMaker Agent for firmware development
Apache License 2.0
431 stars 145 forks source link

Build led_light error for ESP32C2 (MEGH-5195) #296

Open rillhu opened 5 months ago

rillhu commented 5 months ago

Answers checklist.

IDF / ESP32-Arduino version.

idf-v5.1.2

Operating System used.

Windows

How did you build your project?

Command line with Make

Development Kit.

ESPC2-12

What is the expected behavior?

Build led_light successfully

What is the actual behavior?

Build the example with below error message:

C:/Z/esp-rainmaker/components/esp_rainmaker/src/core/esp_rmaker_claim.c
C:/Z/esp-rainmaker/components/esp_rainmaker/src/core/esp_rmaker_claim.c: In function 'read_hmac_key':
C:/Z/esp-rainmaker/components/esp_rainmaker/src/core/esp_rmaker_claim.c:303:47: error: 'ESP_EFUSE_OPTIONAL_UNIQUE_ID' undeclared (first use in this function)
  303 |     esp_err_t err = esp_efuse_read_field_blob(ESP_EFUSE_OPTIONAL_UNIQUE_ID, out_hmac_key, hmac_key_size * 8);
      |                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Z/esp-rainmaker/components/esp_rainmaker/src/core/esp_rmaker_claim.c:303:47: note: each undeclared identifier is reported only once for each function it appears in
[1023/1033] Building C object esp-idf/esp_rainmaker/CMakeFiles/__idf_esp_rainmaker.dir/src/ota/esp_rmaker_ota.c.obj
[1024/1033] Building C object esp-idf/esp_rainmaker/CMakeFiles/__idf_esp_rainmaker.dir/src/core/esp_rmaker_local_ctrl.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the C:\Z\esp-rainmaker\examples\led_light\build\log\idf_py_stderr_output_17084 and C:\Z\esp-rainmaker\examples\led_light\build\log\idf_py_stdout_output_17084

Steps to reproduce.

Step 1: PS C:\Z\esp-idf-v5.1.2> .\export.ps1

Step 2: PS C:\Z\esp-idf-v5.1.2> cd C:\Z\esp-rainmaker\examples\led_light PS C:\Z\esp-rainmaker\examples\led_light> idf.py fullclean

Step 3: PS C:\Z\esp-rainmaker\examples\led_light> idf.py flash monitor

Build Logs.

Step 1: PS C:\Z\esp-idf-v5.1.2> .\export.ps1

Detected installed tools that are not currently used by active ESP-IDF version.
For removing old versions of ccache, cmake, dfu-util, openocd-esp32, riscv32-esp-elf, xtensa-esp32-elf, xtensa-esp32s2-elf, xtensa-esp32s3-elf use command 'python.exe C:\Z\esp-idf-v5.1.2\tools\idf_tools.py uninstall'
For free up even more space, remove installation packages of those tools. Use option 'python.exe C:\Z\esp-idf-v5.1.2\tools\idf_tools.py uninstall --remove-archives'.

Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
    idf.py build

Step 2: PS C:\Z\esp-idf-v5.1.2> cd C:\Z\esp-rainmaker\examples\led_light PS C:\Z\esp-rainmaker\examples\led_light> idf.py fullclean

Executing action: fullclean
Executing action: remove_managed_components
Done

PS C:\Z\esp-rainmaker\examples\led_light> idf.py set-target esp32c2

...
ts/spiffs C:/Z/esp-idf-v5.1.2/components/tcp_transport C:/Z/esp-idf-v5.1.2/components/ulp C:/Z/esp-idf-v5.1.2/components/unity C:/Z/esp-idf-v5.1.2/components/usb C:/Z/esp-idf-v5.1.2/components/vfs C:/Z/esp-idf-v5.1.2/components/wear_levelling C:/Z/esp-idf-v5.1.2/components/wifi_provisioning C:/Z/esp-idf-v5.1.2/components/wpa_supplicant C:/Z/esp-rainmaker/examples/common/ws2812_led
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Z/esp-rainmaker/examples/led_light/build

Step 3: PS C:\Z\esp-rainmaker\examples\led_light> idf.py flash monitor

Executing action: flash
Serial port COM3
Connecting....
Detecting chip type... ESP32-C2
Running ninja in directory C:\Z\esp-rainmaker\examples\led_light\build
...
FAILED: esp-idf/esp_rainmaker/CMakeFiles/__idf_esp_rainmaker.dir/src/core/esp_rmaker_claim.c.obj
...
C:/Z/esp-rainmaker/components/esp_rainmaker/src/core/esp_rmaker_claim.c: In function 'read_hmac_key':
C:/Z/esp-rainmaker/components/esp_rainmaker/src/core/esp_rmaker_claim.c:303:47: error: 'ESP_EFUSE_OPTIONAL_UNIQUE_ID' undeclared (first use in this function)
  303 |     esp_err_t err = esp_efuse_read_field_blob(ESP_EFUSE_OPTIONAL_UNIQUE_ID, out_hmac_key, hmac_key_size * 8);
      |                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Z/esp-rainmaker/components/esp_rainmaker/src/core/esp_rmaker_claim.c:303:47: note: each undeclared identifier is reported only once for each function it appears in
[1023/1033] Building C object esp-idf/esp_rainmaker/CMakeFiles/__idf_esp_rainmaker.dir/src/ota/esp_rmaker_ota.c.obj
[1024/1033] Building C object esp-idf/esp_rainmaker/CMakeFiles/__idf_esp_rainmaker.dir/src/core/esp_rmaker_local_ctrl.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the C:\Z\esp-rainmaker\examples\led_light\build\log\idf_py_stderr_output_17084 and C:\Z\esp-rainmaker\examples\led_light\build\log\idf_py_stdout_output_17084

More Information.

No response

shahpiyushv commented 3 months ago

@rillhu esp32c2 is not yet an officially supported platform for RainMaker. We will add it soon.