USB host MSC example fail

username
Posts: 534
Joined: Thu May 03, 2018 1:18 pm

USB host MSC example fail

Postby username » Sun Sep 08, 2024 4:35 am

ESP v5.3.1

I created a new project using the example USB/HOST/MSC
https://github.com/espressif/esp-idf/tr ... b/host/msc

When I run it and stick a USB stick in i get the following in the terminal.
Its failing on this line: ESP_ERROR_CHECK(msc_host_vfs_register(msc_device, MNT_PATH, &mount_config, &vfs_handle));

I (371) example: Waiting for USB flash drive to be connected
I (1351) example: MSC device connected
ESP_ERROR_CHECK failed: esp_err_t 0x1701 (ERROR) at 0x42007c80
0x42007c80: app_main at J:/ESP_5.3.1/Projects/z/main/msc_example_main.c:294 (discriminator 1)

file: "./main/msc_example_main.c" line 294
func: app_main
expression: msc_host_vfs_register(msc_device, MNT_PATH, &mount_config, &vfs_handle)

abort() was called at PC 0x4037a05f on core 0
0x4037a05f: _esp_error_check_failed at J:/ESP_5.3.1/esp/v5.3.1/esp-idf/components/esp_system/esp_err.c:49

Backtrace: 0x40375b96:0x3fc98010 0x4037a069:0x3fc98030 0x4037fea2:0x3fc98050 0x4037a05f:0x3fc980c0 0x42007c80:0x3fc980f0 0x4202f80b:0x3fc982d0
0x40375b96: panic_abort at J:/ESP_5.3.1/esp/v5.3.1/esp-idf/components/esp_system/panic.c:463
0x4037a069: esp_system_abort at J:/ESP_5.3.1/esp/v5.3.1/esp-idf/components/esp_system/port/esp_system_chip.c:92
0x4037fea2: abort at J:/ESP_5.3.1/esp/v5.3.1/esp-idf/components/newlib/abort.c:38
0x4037a05f: _esp_error_check_failed at J:/ESP_5.3.1/esp/v5.3.1/esp-idf/components/esp_system/esp_err.c:49
0x42007c80: app_main at J:/ESP_5.3.1/Projects/z/main/msc_example_main.c:294 (discriminator 1)
0x4202f80b: main_task at J:/ESP_5.3.1/esp/v5.3.1/esp-idf/components/freertos/app_startup.c:208

ELF file SHA256: 549afd0e5

CPU halted.

Any thoughts why ?

aliarifat794
Posts: 188
Joined: Sun Jun 23, 2024 6:18 pm

Re: USB host MSC example fail

Postby aliarifat794 » Sun Sep 08, 2024 3:57 pm

The error code 0x1701 that you're encountering is ESP_ERR_INVALID_STATE. Looks like the system is not in the correct state to perform the requested operation. Check the mount path (MNT_PATH).

username
Posts: 534
Joined: Thu May 03, 2018 1:18 pm

Re: USB host MSC example fail

Postby username » Tue Sep 10, 2024 11:19 am

I would think the example should work out of the box though.

username
Posts: 534
Joined: Thu May 03, 2018 1:18 pm

Re: USB host MSC example fail

Postby username » Sun Sep 15, 2024 5:42 am

Found the cause. USB drive needs to be formatted as FAT. Mine was formatted with exFAT.
Be nice if that was in the README file.

Who is online

Users browsing this forum: Bing [Bot] and 94 guests