I followed the instructions and cannot get Arduino project to compile.
Using latest version of VSCODE, WROOM32 device, esp-idf extension v1.2.0, esp-idf version 4.3
I made changes to setup
- Autostart Arduino
- Disable Mutex locks for HAL
- Set FreeRTOS tick rate to 1000
I get compile errors related to I2C for some reason?
../components/arduino/cores/esp32/esp32-hal-i2c.c:152:22: error: implicit declaration of function 'I2C_LINK_RECOMMENDED_SIZE' [-Werror=implicit-function-declaration]
uint8_t cmd_buff[I2C_LINK_RECOMMENDED_SIZE(1)] = { 0 };
../components/arduino/cores/esp32/esp32-hal-i2c.c:152:56: warning: excess elements in array initializer
uint8_t cmd_buff[I2C_LINK_RECOMMENDED_SIZE(1)] = { 0 };
^
../components/arduino/cores/esp32/esp32-hal-i2c.c:152:56: note: (near initialization for 'cmd_buff')
../components/arduino/cores/esp32/esp32-hal-i2c.c:153:11: error: implicit declaration of function 'i2c_cmd_link_create_static'; did you mean 'i2c_cmd_link_create'? [-Werror=implicit-function-declaration]
cmd = i2c_cmd_link_create_static(cmd_buff, I2C_LINK_RECOMMENDED_SIZE(1));
^~~~~~~~~~~~~~~~~~~~~~~~~~
i2c_cmd_link_create
../components/arduino/cores/esp32/esp32-hal-i2c.c:153:9: warning: assignment to 'i2c_cmd_handle_t' {aka 'void
*'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
cmd = i2c_cmd_link_create_static(cmd_buff, I2C_LINK_RECOMMENDED_SIZE(1));
^
../components/arduino/cores/esp32/esp32-hal-i2c.c:145:9: error: jump into scope of identifier with variably modified type
goto end;
^~~~
../components/arduino/cores/esp32/esp32-hal-i2c.c:174:1: note: label 'end' defined here
end:
^~~
../components/arduino/cores/esp32/esp32-hal-i2c.c:152:13: note: 'cmd_buff' declared here
uint8_t cmd_buff[I2C_LINK_RECOMMENDED_SIZE(1)] = { 0 };
^~~~~~~~
Need help with Arduino as component for ESP32
Re: Need help with Arduino as component for ESP32
Hi there,
I have got the same problem plus one more build error for ETH.cpp when trying to add a Arduino core component to ESP-IDF in the VS Code ESP-IDF environment.
Here is the build log from ESP-IDF terminal after idf.py build.
It will be super helpful if someone could help looking into this.
Thanks!
- build error for esp32-hal-i2c.c
- build error for ETH.cpp
I have got the same problem plus one more build error for ETH.cpp when trying to add a Arduino core component to ESP-IDF in the VS Code ESP-IDF environment.
Here is the build log from ESP-IDF terminal after idf.py build.
It will be super helpful if someone could help looking into this.
Thanks!
- build error for esp32-hal-i2c.c
- [2/9] Building C object esp-idf/arduino/CMakeFiles/__idf_arduino.dir/cores/esp32/esp32-hal-i2c.c.obj
- FAILED: esp-idf/arduino/CMakeFiles/__idf_arduino.dir/cores/esp32/esp32-hal-i2c.c.obj
- ... ...
- ... ...
- ../components/arduino/cores/esp32/esp32-hal-i2c.c: In function 'i2cWrite':
- ../components/arduino/cores/esp32/esp32-hal-i2c.c:152:22: error: implicit declaration of function 'I2C_LINK_RECOMMENDED_SIZE' [-Werror=implicit-function-declaration]
- uint8_t cmd_buff[I2C_LINK_RECOMMENDED_SIZE(1)] = { 0 };
- ^~~~~~~~~~~~~~~~~~~~~~~~~
- ../components/arduino/cores/esp32/esp32-hal-i2c.c:152:5: error: variable-sized object may not be initialized
- uint8_t cmd_buff[I2C_LINK_RECOMMENDED_SIZE(1)] = { 0 };
- ^~~~~~~
- ../components/arduino/cores/esp32/esp32-hal-i2c.c:152:56: warning: excess elements in array initializer
- uint8_t cmd_buff[I2C_LINK_RECOMMENDED_SIZE(1)] = { 0 };
- ^
- ../components/arduino/cores/esp32/esp32-hal-i2c.c:152:56: note: (near initialization for 'cmd_buff')
- ../components/arduino/cores/esp32/esp32-hal-i2c.c:153:11: error: implicit declaration of function 'i2c_cmd_link_create_static'; did you mean 'i2c_cmd_link_create'? [-Werror=implicit-function-declaration]
- cmd = i2c_cmd_link_create_static(cmd_buff, I2C_LINK_RECOMMENDED_SIZE(1));
- ^~~~~~~~~~~~~~~~~~~~~~~~~~
- i2c_cmd_link_create
- ../components/arduino/cores/esp32/esp32-hal-i2c.c:153:9: warning: assignment to 'i2c_cmd_handle_t' {aka 'void *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
- cmd = i2c_cmd_link_create_static(cmd_buff, I2C_LINK_RECOMMENDED_SIZE(1));
- ^
- ../components/arduino/cores/esp32/esp32-hal-i2c.c:145:9: error: jump into scope of identifier with variably modified type
- goto end;
- ^~~~
- ../components/arduino/cores/esp32/esp32-hal-i2c.c:174:1: note: label 'end' defined here
- end:
- ^~~
- ../components/arduino/cores/esp32/esp32-hal-i2c.c:152:13: note: 'cmd_buff' declared here
- uint8_t cmd_buff[I2C_LINK_RECOMMENDED_SIZE(1)] = { 0 };
- ^~~~~~~~
- ../components/arduino/cores/esp32/esp32-hal-i2c.c:176:9: error: implicit declaration of function 'i2c_cmd_link_delete_static'; did you mean 'i2c_cmd_link_delete'? [-Werror=implicit-function-declaration]
- i2c_cmd_link_delete_static(cmd);
- ^~~~~~~~~~~~~~~~~~~~~~~~~~
- i2c_cmd_link_delete
- ../components/arduino/cores/esp32/esp32-hal-i2c.c: In function 'i2cRead':
- ../components/arduino/cores/esp32/esp32-hal-i2c.c:200:15: error: implicit declaration of function 'i2c_master_read_from_device'; did you mean 'i2c_master_read_byte'? [-Werror=implicit-function-declaration]
- ret = i2c_master_read_from_device((i2c_port_t)i2c_num, address, buff, size, timeOutMillis / portTICK_RATE_MS);
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~
- i2c_master_read_byte
- ../components/arduino/cores/esp32/esp32-hal-i2c.c: In function 'i2cWriteReadNonStop':
- ../components/arduino/cores/esp32/esp32-hal-i2c.c:229:15: error: implicit declaration of function 'i2c_master_write_read_device'; did you mean 'i2c_master_write_byte'? [-Werror=implicit-function-declaration]
- ret = i2c_master_write_read_device((i2c_port_t)i2c_num, address, wbuff, wsize, rbuff, rsize, timeOutMillis / portTICK_RATE_MS);
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
- i2c_master_write_byte
- cc1.exe: some warnings being treated as errors
- build error for ETH.cpp
- [3/9] Building CXX object esp-idf/arduino/CMakeFiles/__idf_arduino.dir/libraries/WiFi/src/ETH.cpp.obj
- FAILED: esp-idf/arduino/CMakeFiles/__idf_arduino.dir/libraries/WiFi/src/ETH.cpp.obj
- ... ...
- ... ...
- ../components/arduino/libraries/WiFi/src/ETH.cpp
- ../components/arduino/libraries/WiFi/src/ETH.cpp: In member function 'bool ETHClass::begin(uint8_t, int, int, int, eth_phy_type_t, eth_clock_mode_t)':
- ../components/arduino/libraries/WiFi/src/ETH.cpp:286:23: error: 'esp_eth_phy_new_ksz8081' was not declared in this scope
- eth_phy = esp_eth_phy_new_ksz8081(&phy_config);
- ^~~~~~~~~~~~~~~~~~~~~~~
- ../components/arduino/libraries/WiFi/src/ETH.cpp:286:23: note: suggested alternative: 'esp_eth_phy_new_ksz8041'
- eth_phy = esp_eth_phy_new_ksz8081(&phy_config);
- ^~~~~~~~~~~~~~~~~~~~~~~
- esp_eth_phy_new_ksz8041
- ninja: build stopped: subcommand failed.
- The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command cmake --build ." terminated with exit code: 1.
Who is online
Users browsing this forum: No registered users and 75 guests