chegewara/esp32-usb-host

building failed

mkandy opened this issue · 6 comments

open the example/"read_write"by VScode

FAILED: esp-idf/usb_host/CMakeFiles/__idf_usb_host.dir/host/usb_host.cpp.obj
F:\esp32_tools\tools\xtensa-esp32s2-elf\esp-2021r2-8.4.0\xtensa-esp32s2-elf\bin\xtensa-esp32s2-elf-g++.exe -Iconfig -IE:/esp32project/esp32-usb-host/components/usb_host/include -IF:/ESP32VSCODE/esp-idf/components/newlib/platform_include -IF:/ESP32VSCODE/esp-idf/components/freertos/include -IF:/ESP32VSCODE/esp-idf/components/freertos/include/esp_additions/freertos -IF:/ESP32VSCODE/esp-idf/components/freertos/port/xtensa/include -IF:/ESP32VSCODE/esp-idf/components/freertos/include/esp_additions -IF:/ESP32VSCODE/esp-idf/components/esp_hw_support/include -IF:/ESP32VSCODE/esp-idf/components/esp_hw_support/include/soc -IF:/ESP32VSCODE/esp-idf/components/esp_hw_support/include/soc/esp32s2 -IF:/ESP32VSCODE/esp-idf/components/esp_hw_support/port/esp32s2/. -IF:/ESP32VSCODE/esp-idf/components/esp_hw_support/port/esp32s2/private_include -IF:/ESP32VSCODE/esp-idf/components/heap/include -IF:/ESP32VSCODE/esp-idf/components/log/include -IF:/ESP32VSCODE/esp-idf/components/lwip/include/apps -IF:/ESP32VSCODE/esp-idf/components/lwip/include/apps/sntp -IF:/ESP32VSCODE/esp-idf/components/lwip/lwip/src/include -IF:/ESP32VSCODE/esp-idf/components/lwip/port/esp32/include -IF:/ESP32VSCODE/esp-idf/components/lwip/port/esp32/include/arch -IF:/ESP32VSCODE/esp-idf/components/soc/include -IF:/ESP32VSCODE/esp-idf/components/soc/esp32s2/. -IF:/ESP32VSCODE/esp-idf/components/soc/esp32s2/include -IF:/ESP32VSCODE/esp-idf/components/hal/esp32s2/include -IF:/ESP32VSCODE/esp-idf/components/hal/include -IF:/ESP32VSCODE/esp-idf/components/hal/platform_port/include -IF:/ESP32VSCODE/esp-idf/components/esp_rom/include -IF:/ESP32VSCODE/esp-idf/components/esp_rom/include/esp32s2 -IF:/ESP32VSCODE/esp-idf/components/esp_rom/esp32s2 -IF:/ESP32VSCODE/esp-idf/components/esp_common/include -IF:/ESP32VSCODE/esp-idf/components/esp_system/include -IF:/ESP32VSCODE/esp-idf/components/esp_system/port/soc -IF:/ESP32VSCODE/esp-idf/components/esp_system/port/public_compat -IF:/ESP32VSCODE/esp-idf/components/xtensa/include -IF:/ESP32VSCODE/esp-idf/components/xtensa/esp32s2/include -IF:/ESP32VSCODE/esp-idf/components/driver/include -IF:/ESP32VSCODE/esp-idf/components/driver/esp32s2/include -IF:/ESP32VSCODE/esp-idf/components/esp_pm/include -IF:/ESP32VSCODE/esp-idf/components/esp_ringbuf/include -IF:/ESP32VSCODE/esp-idf/components/efuse/include -IF:/ESP32VSCODE/esp-idf/components/efuse/esp32s2/include -IF:/ESP32VSCODE/esp-idf/components/vfs/include -IF:/ESP32VSCODE/esp-idf/components/esp_wifi/include -IF:/ESP32VSCODE/esp-idf/components/esp_event/include -IF:/ESP32VSCODE/esp-idf/components/esp_netif/include -IF:/ESP32VSCODE/esp-idf/components/esp_eth/include -IF:/ESP32VSCODE/esp-idf/components/tcpip_adapter/include -IF:/ESP32VSCODE/esp-idf/components/esp_phy/include -IF:/ESP32VSCODE/esp-idf/components/esp_phy/esp32s2/include -IF:/ESP32VSCODE/esp-idf/components/esp_ipc/include -IF:/ESP32VSCODE/esp-idf/components/app_trace/include -IF:/ESP32VSCODE/esp-idf/components/esp_timer/include -IF:/ESP32VSCODE/esp-idf/components/usb/include -IF:/ESP32VSCODE/esp-idf/components/fatfs/diskio -IF:/ESP32VSCODE/esp-idf/components/fatfs/vfs -IF:/ESP32VSCODE/esp-idf/components/fatfs/src -IF:/ESP32VSCODE/esp-idf/components/wear_levelling/include -IF:/ESP32VSCODE/esp-idf/components/spi_flash/include -IF:/ESP32VSCODE/esp-idf/components/sdmmc/include -mlongcalls -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -fmacro-prefix-map=E:/esp32project/esp32-usb-host/examples/read_write=. -fmacro-prefix-map=F:/ESP32VSCODE/esp-idf=IDF -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu++11 -fno-exceptions -fno-rtti -D_GNU_SOURCE -DIDF_VER="v4.4-dev-3703-gddc44956bf" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS -MD -MT esp-idf/usb_host/CMakeFiles/__idf_usb_host.dir/host/usb_host.cpp.obj -MF esp-idf\usb_host\CMakeFiles__idf_usb_host.dir\host\usb_host.cpp.obj.d -o esp-idf/usb_host/CMakeFiles/__idf_usb_host.dir/host/usb_host.cpp.obj -c E:/esp32project/esp32-usb-host/components/usb_host/host/usb_host.cpp
E:/esp32project/esp32-usb-host/components/usb_host/host/usb_host.cpp: In member function 'bool USBhost::init(bool)':
E:/esp32project/esp32-usb-host/components/usb_host/host/usb_host.cpp:68:31: error: 'const usb_host_client_config_t' has no non-static data member named 'client_event_callback'
.max_num_event_msg = 5};
^
E:/esp32project/esp32-usb-host/components/usb_host/host/usb_host.cpp: In member function 'bool USBhost::open(const usb_host_client_event_msg_t*)':
E:/esp32project/esp32-usb-host/components/usb_host/host/usb_host.cpp:83:15: warning: unused variable 'err' [-Wunused-variable]
esp_err_t err = usb_host_device_open(client_hdl, event_msg->new_dev.address, &dev_hdl);
^~~
[1022/1032] Building CXX object esp-idf/usb_host/CMakeFiles/__idf_usb_host.dir/acm/usb_acm.cpp.obj
E:/esp32project/esp32-usb-host/components/usb_host/acm/usb_acm.cpp: In member function 'void USBacmDevice::setControlLine(bool, bool)':
E:/esp32project/esp32-usb-host/components/usb_host/acm/usb_acm.cpp:115:15: warning: unused variable 'err' [-Wunused-variable]
esp_err_t err = usb_host_transfer_submit_control(_host->clientHandle(), xfer_ctrl);
^~~
E:/esp32project/esp32-usb-host/components/usb_host/acm/usb_acm.cpp: In member function 'void USBacmDevice::setLineCoding(uint32_t, uint8_t, uint8_t, uint8_t)':
E:/esp32project/esp32-usb-host/components/usb_host/acm/usb_acm.cpp:128:15: warning: unused variable 'err' [-Wunused-variable]
esp_err_t err = usb_host_transfer_submit_control(_host->clientHandle(), xfer_ctrl);
^~~
E:/esp32project/esp32-usb-host/components/usb_host/acm/usb_acm.cpp: In member function 'void USBacmDevice::getLineCoding()':
E:/esp32project/esp32-usb-host/components/usb_host/acm/usb_acm.cpp:135:15: warning: unused variable 'err' [-Wunused-variable]
esp_err_t err = usb_host_transfer_submit_control(_host->clientHandle(), xfer_ctrl);
^~~
[1024/1032] Building CXX object esp-idf/usb_host/CMakeFiles/__idf_usb_host.dir/msc/usb_msc.cpp.obj
E:/esp32project/esp32-usb-host/components/usb_host/msc/usb_msc.cpp: In member function 'void USBmscDevice::reset()':
E:/esp32project/esp32-usb-host/components/usb_host/msc/usb_msc.cpp:149:15: warning: unused variable 'err' [-Wunused-variable]
esp_err_t err = usb_host_transfer_submit_control(_host->clientHandle(), xfer_ctrl);
^~~
[1025/1032] Building CXX object esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj
../main/main.cpp: In function 'void inquiry_cb(usb_transfer_t*)':
../main/main.cpp:59:37: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
device->mount(MOUNT_POINT, 0);
^
../main/main.cpp:60:38: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
device->mount(MOUNT_POINT1, 1);
^
../main/main.cpp: In function 'void client_event_callback(const usb_host_client_event_msg_t*, void*)':
../main/main.cpp:105:17: warning: missing initializer for member 'msc_transfer_cb_t::cbw_cb' [-Wmissing-field-initializers]
};
^
../main/main.cpp:105:17: warning: missing initializer for member 'msc_transfer_cb_t::data_cb' [-Wmissing-field-initializers]
../main/main.cpp:105:17: warning: missing initializer for member 'msc_transfer_cb_t::csw_cb' [-Wmissing-field-initializers]
../main/main.cpp:105:17: warning: missing initializer for member 'msc_transfer_cb_t::unit_ready_cb' [-Wmissing-field-initializers]
../main/main.cpp:105:17: warning: missing initializer for member 'msc_transfer_cb_t::max_luns_cb' [-Wmissing-field-initializers]
../main/main.cpp:105:17: warning: missing initializer for member 'msc_transfer_cb_t::sense_cb' [-Wmissing-field-initializers]
../main/main.cpp: In function 'void read_test(int)':
../main/main.cpp:46:21: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
#define MOUNT_POINT "/msc"
^~~~~~
../main/main.cpp:136:17: note: in expansion of macro 'MOUNT_POINT'
mount = MOUNT_POINT;
^~~~~~~~~~~
../main/main.cpp:46:21: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
#define MOUNT_POINT "/msc"
^~~~~~
../main/main.cpp:140:17: note: in expansion of macro 'MOUNT_POINT'
mount = MOUNT_POINT;
^~~~~~~~~~~
../main/main.cpp:167:21: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
char* dirpath = "/msc/";
^~~~~~~
../main/main.cpp: At global scope:
../main/main.cpp:75:13: warning: 'void sense_cb(usb_transfer_t*)' defined but not used [-Wunused-function]
static void sense_cb(usb_transfer_t transfer)
^~~~~~~~
../main/main.cpp:70:13: warning: 'void max_luns_cb(usb_transfer_t
)' defined but not used [-Wunused-function]
static void max_luns_cb(usb_transfer_t transfer)
^~~~~~~~~~~
../main/main.cpp:65:13: warning: 'void unit_ready_cb(usb_transfer_t
)' defined but not used [-Wunused-function]
static void unit_ready_cb(usb_transfer_t transfer)
^~~~~~~~~~~~~
../main/main.cpp:36:13: warning: 'void csw_cb(usb_transfer_t
)' defined but not used [-Wunused-function]
static void csw_cb(usb_transfer_t *transfer)
^~~~~~
ninja: build stopped: subcommand failed.
终端进程“C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command cmake --build .”已终止,退出代码: 1。

What is your configuration? esp-idf or PIO?
Errors are meaningless without full info about environment.

What is your configuration? esp-idf or PIO? Errors are meaningless without full info about environment.

Hello, building environment : esp32s2 board + VScode IDE + ESP-IDF explorer +esp-idf V4.4

Ok, i think this library is a bit outdated (not sure), because esp-idf USB host is still in development.
I didnt work on it for quite some time, and espressif has few changes in past few months.

Hi @mkandy
this repo is probably not compatible with v4.4 IDF, because i can build it with master branch with no issue, or you have to check if your USB component is up to date.

Hi @chegewara,thank you for your demo, I have found the USB HOST example from ESP32 github,it supports IDF V4.4 :
https://github.com/espressif/esp-iot-solution.git