Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msc flashdisk compile error on Platformio with ESP32-S2 #135

Open
PaffAngryDragon opened this issue Feb 4, 2023 · 1 comment
Open

msc flashdisk compile error on Platformio with ESP32-S2 #135

PaffAngryDragon opened this issue Feb 4, 2023 · 1 comment

Comments

@PaffAngryDragon
Copy link

When compiling on VSC+Platformio with ArduinoEspressif 4.1.0 I get errors for missing FS.h and SD.h, which could be fixed by simply adding #include <...> lines. Next error is trickier:
Compiling .pio\build\esp32-s2-saola-1\liba36\ESP32TinyUSB\host\msc\vfs\diskio_rawmsc.cpp.o .pio/libdeps/esp32-s2-saola-1/ESP32TinyUSB/src/host/common/usb_host.cpp: In member function 'bool USBhost::init(bool)': .pio/libdeps/esp32-s2-saola-1/ESP32TinyUSB/src/host/common/usb_host.cpp:72:5: error: 'const usb_host_client_config_t' has no non-static data member named 'is_synchronous' }; ^ *** [.pio\build\esp32-s2-saola-1\liba36\ESP32TinyUSB\host\common\usb_host.cpp.o] Error 1

It is because the struct declared is:
const usb_host_client_config_t client_config = { .is_synchronous = false, .max_num_event_msg = 5, .async = { .client_event_callback = _client_event_callback, .callback_arg = this } }; but the defined usb_host_client_config_t declared in in esp32-s2 tools/sdk looks like this:
`
/**

  • @brief USB Host Library Client configuration
  • Configuration structure for a USB Host Library client. Provided in usb_host_client_register()
    */
    typedef struct {
    usb_host_client_event_cb_t client_event_callback; /< Client's event callback function */
    void *callback_arg; /
    < Event callback function argument */
    int max_num_event_msg; /**< Maximum number of event messages that can be stored (e.g., 3) */
    } usb_host_client_config_t;
    Of course, I corrected it manually, but later run in some issues - perhaps because of this. I know that you are working on a new version - but until then, perhaps you could fix this issue? Or even better, if you have some version of MSC perhaps I could try it?

I am trying to write a program ewhere the esp32-s2 would have HIDUSB capability (done..) + become an USB MSC device with one FAT partition toward a PC and at the same time to have FATFS open on that partition (done, but separatelly of HIDUSB). When I try all three together I hit the wall for 2 dys now. All available USB librarys seems to have some issues with MSC +FAT on the internal flash of ESP32.
`

@chegewara
Copy link
Owner

This library is working pretty good with MSC + FATFS, tested and confirmed by many users.

It is possible that API has been changed in arduino-esp32 (esp-idf) you are trying to build with.
What you can do is to edit host code, or even to delete it, because you dont need it.
You can also try to use my v2 library, but its still a bit messy, because ive been trying to write code compatible with arduino and esp-idf, which is not easy, because they are using different tinyusb ports (kind of sucks).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants