Example "msc": crash HUB: Short device descriptor transfer failed

Emanuel Martins
Posts: 9
Joined: Tue Feb 15, 2022 1:48 pm
Location: Coimbra, Portugal

Example "msc": crash HUB: Short device descriptor transfer failed

Postby Emanuel Martins » Mon Feb 28, 2022 12:00 pm

When monitoring the example msc in an ESP32-S3, ESP32-32-DEVKITC-1 with ESP32-S3-WROOM-1- N8R8 ( .espressif\frameworks\esp-idf-v4.4\examples\peripherals\usb\host\msc ) the program gives an error during Monitor:

...
I (0) cpu_start: Starting scheduler on APP CPU.
I (362) example: Waiting for USB stick to be connected
E (672) HUB: Short device descriptor transfer failed

assert failed: enum_stage_cleanup_failed hub.c:453 (dequeued_enum_urb == p_hub_driver_obj->single_thread.enum_urb)

Backtrace:0x403759b6:0x3fce0f800x40378ee9:0x3fce0fa0 0x4037f45d:0x3fce0fc0 0x42011164:0x3fce10e0 0x4201129b:0x3fce1100 0x420115e2:0x3fce1120 0x4200c554:0x3fce1140 0x42006089:0x3fce1160 0x4037bbb5:0x3fce1190
0x403759b6: panic_abort at C:/Users/emartins/ESP-IDF/components/esp_system/panic.c:402
...

It keeps resetting and giving allways the same error.
The error is the same independently a USB pen is inserted or not in the USB-A female conector.

The folder msc is an example specifically for ESP32-S2 and ESP32-S3 and simply does not work with me.

ESP_Dazz
Posts: 308
Joined: Fri Jun 02, 2017 6:50 am

Re: Example "msc": crash HUB: Short device descriptor transfer failed

Postby ESP_Dazz » Mon Feb 28, 2022 1:00 pm

There were multiple USB Host issues that were fixed on master but haven't been backported to release v4.4. Please try again on master (commit 022fc12 or later).

Emanuel Martins
Posts: 9
Joined: Tue Feb 15, 2022 1:48 pm
Location: Coimbra, Portugal

Re: Example "msc": crash HUB: Short device descriptor transfer failed

Postby Emanuel Martins » Mon Feb 28, 2022 3:01 pm

First, thank you @ESP_Dazz.

I changed the folder of the msc example by the newest one.
Now there are errors because the example uses newer libraries. For example "usb_host.h" has struct "usb_host_config_t" that is different from the stable "ESP-IDF v4.4".

So I replaced the full "esp-idf" folder with the newest one and now I have a LOT of new errors.
So replacing hte esp-idf folder by the newest one it is not the correct way of using the most up to date libraries.
I've lack of information.

I'm sorry, but I am new at this world of trying make a stable and reliable products over a lot of sources that are constantly changing and examples that do not work. It is a first to me.

ESP_Dazz
Posts: 308
Joined: Fri Jun 02, 2017 6:50 am

Re: Example "msc": crash HUB: Short device descriptor transfer failed

Postby ESP_Dazz » Mon Feb 28, 2022 6:58 pm

Nope, copying the MSC example folder from master won't work, you need to update the entirety of ESP-IDF to the master version (I'm assuming you're new to git?)

You can use git to checkout ESP-IDF to master as follows:
  • Open the ESP-IDF Command Prompt
  • Navigate to your ESP-IDF directory using the command prompt
  • Run "git status". Git will report that you have unstaged changes (because you've replaced the msc example files manually)
  • Run "git reset --hard". This will clear all of your changes to the ESP-IDF folder (If you have added any custom code, you may want to save that somewhere before running this)
  • Run "git checkout master" to change the entire ESP-IDF to the master branch
  • Run "git status" again. If git reports that some submodules are changed, run "git submodule update --recursive" to update them as well
  • Navigate to the MSC example. Build and flash as you normally would

Emanuel Martins
Posts: 9
Joined: Tue Feb 15, 2022 1:48 pm
Location: Coimbra, Portugal

Re: Example "msc": crash HUB: Short device descriptor transfer failed

Postby Emanuel Martins » Wed Mar 02, 2022 10:23 am

Thank you again @ESP_Dazz

I've followed your suggestion. ESP-IDF now seems updated. I do not have yet experience with git, only svn.

Unfortunately, the msc example still does not compile because of a Python error:
...
File "C:/Users/emartins/ESP-IDF/tools/ldgen/ldgen.py", line 16, in <module>
from ldgen.entity import EntityDB
File "C:\Users\emartins\ESP-IDF\tools\ldgen\ldgen\entity.py", line 12, in <module>
from pyparsing import (Group, Literal, OneOrMore, ParseException, SkipTo, Suppress, White, Word, ZeroOrMore, alphas,
ImportError: cannot import name 'rest_of_line' from 'pyparsing' (C:\Users\emartins\.espressif\python_env\idf4.4_py3.8_env\lib\site-packages\pyparsing.py)
...

The line in the entity.py:
...
from pyparsing import (Group, Literal, OneOrMore, ParseException, SkipTo, Suppress, White, Word, ZeroOrMore, alphas,
nums, rest_of_line)
...

Google search did not help.
ESP32 forum search did not help.

I know very little of Python, not sufficient to solve this.

My goal is to compile the "msc" example, see it working, and develop from that point. Not easy.

ESP_Dazz
Posts: 308
Joined: Fri Jun 02, 2017 6:50 am

Re: Example "msc": crash HUB: Short device descriptor transfer failed

Postby ESP_Dazz » Wed Mar 02, 2022 12:01 pm

@Emanuel Martins

Just to clear things up. Are you using ESP-IDF natively (i.e., did you install following the IDF Getting started guide)? Or did you install via another method (e.g., VSCode Plugin, Arduino, Platform IO)?

Emanuel Martins
Posts: 9
Joined: Tue Feb 15, 2022 1:48 pm
Location: Coimbra, Portugal

Re: Example "msc": crash HUB: Short device descriptor transfer failed

Postby Emanuel Martins » Wed Mar 02, 2022 1:56 pm

Hi ESP_Dazz.

I've had a lot of problems installing the IDE.
I started with VSCode + ESP-IDF for ESP32 (suggested on internet). The first uses were ok and I could develop for sometime, waiting the ESP-PROG arrival (12 days later).
I had difficulty putting ESP-PROG to debug and I went to the net and installed PlatformIO and with some hours it worked.
Then when I started the first example with ESP32-S3, blink, could not debug with PlatformIO. I went to net (youtube) , tried debug without PlatformIO. It was impossible to me after many wasted hours and many problems.
Then there was a suggestion with eclipse, that I've tried ... compiled, not debug. Other problems.
Then I tried Espressif IDE, that uses eclipse, only compile and flash also, not openOCD.
So basically I gave up the debug with ESP32-S3, expecting better days, and decided to develop without the debug for ESP32-S3.

So, after your question I searched and found 2 ESP-IDF installations in my computer. The one I have "updated" with git, in c:\users\emartins\ESP-IDF (This was installed by an administrator, because it is a company computer and I cannot install myself software in my computer) and the other I found in c:\users\emartins\.espressif\frameworks\esp-idf-V4.4 , that seems a copy.
So basically I have 2 copies and that can be the problem.
The .expressif\frameworks copy does not have git information. I cannot upgrade that folder.
It seems some executables use one copy and others use the other. Great.

Now Nothing of what I've made before compiles. I'll try to solve this installations problems.

Emanuel Martins
Posts: 9
Joined: Tue Feb 15, 2022 1:48 pm
Location: Coimbra, Portugal

Re: Example "msc": crash HUB: Short device descriptor transfer failed

Postby Emanuel Martins » Wed Mar 02, 2022 3:52 pm

I redeleted the git folder and copied the original v4.4 that I made a backup "just in case". My salvation!!!!

My ESP32 code now compiles again.
"msc" example became more condemned because now has new errors. Miss of files in v4.4 ... what an example.

I'll return to this problem again in a few days. I almost lost my past weeks work just because of this example and the git update.
That is enough for now.

Emanuel Martins
Posts: 9
Joined: Tue Feb 15, 2022 1:48 pm
Location: Coimbra, Portugal

Re: Example "msc": crash HUB: Short device descriptor transfer failed

Postby Emanuel Martins » Mon Mar 07, 2022 4:40 pm

I invested my time with ADF examples I needed to try.
I retried to compile msc example from the master branch ESP-IDF v4.4.
Now the example compiles and runs correctly.

I have no explanation. Problem aparently solved.

akmishra99
Posts: 7
Joined: Sat Mar 07, 2020 5:48 pm

Re: Example "msc": crash HUB: Short device descriptor transfer failed

Postby akmishra99 » Thu Oct 20, 2022 12:35 pm

I am using esp-idf 5.1 in (espressif/idf container) , I am able to successfully build and flash, when I connect usb pen/stick drive as shown in photo (msc_forum_pic1.jpg) I keep getting "I (953) example: Waiting for USB stick to be connected" Please see detailed log below), I have checked with multimeter that usb host port has approximately 5v on Vcc, also checked that USB pen drive has FAT16 formatted disk, in idf.py menuconfig I have enabled tiny USB stack and USB on the go (USB-OTG).


what I need to do to get it working properly, I am using examples (


esp5.0/project/peripherals/usb/host/msc/main/msc_example_main.c)



-Thanks
-Alok


ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x18 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fce3810,len:0x16ac
load:0x403c9700,len:0xbd0
load:0x403cc700,len:0x2c64
entry 0x403c9900
I (32) boot: ESP-IDF v5.1-dev-1264-g1c84cfde14 2nd stage bootloader
I (32) boot: compile time Oct 19 2022 22:35:18
I (33) boot: chip revision: V001
I (36) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (43) boot.esp32s3: Boot SPI Speed : 80MHz
I (48) boot.esp32s3: SPI Mode : SLOW READ
I (54) boot.esp32s3: SPI Flash Size : 2MB
I (58) boot: Enabling RNG early entropy source...
I (64) boot: Partition Table:
I (67) boot: ## Label Usage Type ST Offset Length
I (75) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (82) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (89) boot: 2 factory factory app 00 00 00010000 00100000
I (97) boot: End of partition table
I (101) boot_comm: chip revision: 1, min. application chip revision: 0
I (108) esp_image: segment 0: paddr=00010020 vaddr=3c040020 size=0e660h ( 58976) map
I (131) esp_image: segment 1: paddr=0001e688 vaddr=3fc92100 size=01990h ( 6544) load
I (133) esp_image: segment 2: paddr=00020020 vaddr=42000020 size=306dch (198364) map
I (183) esp_image: segment 3: paddr=00050704 vaddr=3fc93a90 size=014e0h ( 5344) load
I (185) esp_image: segment 4: paddr=00051bec vaddr=40374000 size=0e0d0h ( 57552) load
I (205) esp_image: segment 5: paddr=0005fcc4 vaddr=50000000 size=00010h ( 16) load
I (211) boot: Loaded app from partition at offset 0x10000
I (211) boot: Disabling RNG early entropy source...
I (225) cpu_start: Pro cpu up.
I (225) cpu_start: Starting app cpu, entry point is 0x40375254
0x40375254: call_start_cpu1 at /opt/esp/idf/components/esp_system/port/cpu_start.c:146

I (0) cpu_starD: 2pp)ceu up: [n mF
S CALH2__RRT 4_legal eusror2initr clar &ngena h 0sk is: 0
bitAeHE_E: : Eore 1 ac2ess erro_ EGntr clr &8ebia matak ins: 0th1f
D (240) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 20 bit
D (247) efuse: In EFUSE_BLK1__DATA5_REG is used 8 bits starting with 3 bit
D (254) efuse: In EFUSE_BLK1__DATA5_REG is used 5 bits starting with 11 bit
D (261) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 13 bit
D (268) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 20 bit
D (275) efuse: In EFUSE_BLK1__DATA4_REG is used 5 bits starting with 27 bit
D (282) efuse: In EFUSE_BLK1__DATA5_REG is used 3 bits starting with 0 bit
D (289) efuse: In EFUSE_BLK1__DATA5_REG is used 8 bits starting with 3 bit
D (296) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 13 bit
D (303) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 20 bit
D (310) efuse: In EFUSE_BLK1__DATA4_REG is used 5 bits starting with 27 bit
D (317) efuse: In EFUSE_BLK1__DATA5_REG is used 3 bits starting with 0 bit
D (324) efuse: In EFUSE_BLK1__DATA5_REG is used 8 bits starting with 3 bit
D (339) clk: RTC_SLOW_CLK calibration value: 3470797
V CACHE_ERR: illegal error intr clr & ena mask is: 0x3f
V CACHE_ERR: core 0 access error intr clr & ena mask is: 0x1f
I (348) cpu_start: Pro cpu start user code
I (351) cpu_start: cpu freq: 160000000 Hz
I (356) cpu_start: Application information:
I (361) cpu_start: Project name: usb-msc
I (366) cpu_start: App version: 1
I (370) cpu_start: Compile time: Oct 19 2022 22:35:14
I (376) cpu_start: ELF file SHA256: 981da4136beeea5c...
I (382) cpu_start: ESP-IDF: v5.1-dev-1264-g1c84cfde14
V (389) memory_layout: reserved range is 0x3c04e650 - 0x3c04e670
D (395) memory_layout: Checking 5 reserved memory ranges:
D (400) memory_layout: Reserved memory range 0x3fc84000 - 0x3fc92100
D (407) memory_layout: Reserved memory range 0x3fc92100 - 0x3fc95a00
D (413) memory_layout: Reserved memory range 0x3fceee34 - 0x3fcf0000
D (420) memory_layout: Reserved memory range 0x40374000 - 0x40382100
0x40374000: _WindowOverflow4 at /opt/esp/idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S:1742

D (426) memory_layout: Reserved memory range 0x600fe000 - 0x600fe010
D (432) memory_layout: Building list of available memory regions:
V (439) memory_layout: Examining memory region 0x40374000 - 0x40378000
0x40374000: _WindowOverflow4 at /opt/esp/idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S:1742

0x40378000: spi_flash_mmap_pages at /opt/esp/idf/components/spi_flash/flash_mmap.c:247 (discriminator 2)

V (445) memory_layout: Region 0x40374000 - 0x40378000 inside of reserved 0x40374000 - 0x40382100
0x40374000: _WindowOverflow4 at /opt/esp/idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S:1742

0x40378000: spi_flash_mmap_pages at /opt/esp/idf/components/spi_flash/flash_mmap.c:247 (discriminator 2)

0x40374000: _WindowOverflow4 at /opt/esp/idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S:1742

V (454) memory_layout: Examining memory region 0x3fc88000 - 0x3fc90000
V (461) memory_layout: Region 0x3fc88000 - 0x3fc90000 inside of reserved 0x3fc84000 - 0x3fc92100
V (470) memory_layout: Examining memory region 0x3fc90000 - 0x3fca0000
V (476) memory_layout: Start of region 0x3fc90000 - 0x3fca0000 overlaps reserved 0x3fc84000 - 0x3fc92100
V (486) memory_layout: Start of region 0x3fc92100 - 0x3fca0000 overlaps reserved 0x3fc92100 - 0x3fc95a00
D (495) memory_layout: Available memory region 0x3fc95a00 - 0x3fca0000
V (502) memory_layout: Examining memory region 0x3fca0000 - 0x3fcb0000
D (508) memory_layout: Available memory region 0x3fca0000 - 0x3fcb0000
V (515) memory_layout: Examining memory region 0x3fcb0000 - 0x3fcc0000
D (522) memory_layout: Available memory region 0x3fcb0000 - 0x3fcc0000
V (528) memory_layout: Examining memory region 0x3fcc0000 - 0x3fcd0000
D (535) memory_layout: Available memory region 0x3fcc0000 - 0x3fcd0000
V (541) memory_layout: Examining memory region 0x3fcd0000 - 0x3fce0000
D (548) memory_layout: Available memory region 0x3fcd0000 - 0x3fce0000
V (555) memory_layout: Examining memory region 0x3fce0000 - 0x3fce9710
D (561) memory_layout: Available memory region 0x3fce0000 - 0x3fce9710
V (568) memory_layout: Examining memory region 0x3fce9710 - 0x3fcf0000
V (574) memory_layout: End of region 0x3fce9710 - 0x3fcf0000 overlaps reserved 0x3fceee34 - 0x3fcf0000
D (584) memory_layout: Available memory region 0x3fce9710 - 0x3fceee34
V (590) memory_layout: Examining memory region 0x3fcf0000 - 0x3fcf8000
D (597) memory_layout: Available memory region 0x3fcf0000 - 0x3fcf8000
V (604) memory_layout: Examining memory region 0x600fe000 - 0x60100000
V (610) memory_layout: Start of region 0x600fe000 - 0x60100000 overlaps reserved 0x600fe000 - 0x600fe010
D (620) memory_layout: Available memory region 0x600fe010 - 0x60100000
I (626) heap_init: Initializing. RAM available for dynamic allocation:
D (634) heap_init: New heap initialised at 0x3fc95a00
I (639) heap_init: At 3FC95A00 len 00053D10 (335 KiB): D/IRAM
I (645) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DRAM
D (652) heap_init: New heap initialised at 0x3fcf0000
I (657) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
D (663) heap_init: New heap initialised at 0x600fe010
I (668) heap_init: At 600FE010 len 00001FF0 (7 KiB): RTCRAM
V (675) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (681) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x40E
D (689) intr_alloc: Connected src 39 to int 2 (cpu 0)
V (695) memspi: raw_chip_id: 3980C2

V (698) memspi: chip_id: C28039

V (701) memspi: raw_chip_id: 3980C2

V (705) memspi: chip_id: C28039

D (708) spi_flash: trying chip: issi
D (712) spi_flash: trying chip: gd
D (715) spi_flash: trying chip: mxic
I (719) spi_flash: detected chip: mxic
W (724) spi_flash: Detected flash size > 16 MB, but access beyond 16 MB is not supported for this flash model yet.
I (735) spi_flash: flash io: dio
W (739) spi_flash: Detected size(32768k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
D (752) cpu_start: calling init function: 0x420173f8
0x420173f8: esp_ipc_init at /opt/esp/idf/components/esp_system/esp_ipc.c:115

D (757) cpu_start: calling init function: 0x42002b84
0x42002b84: esp_reset_reason_init at /opt/esp/idf/components/esp_system/port/soc/esp32s3/reset_reason.c:67

D (762) cpu_start: calling init function: 0x42001e14
0x42001e14: esp_init_app_elf_sha256 at /opt/esp/idf/components/esp_app_format/esp_app_desc.c:69

D (767) cpu_start: calling init function: 0x42006de4 on core: 0
0x42006de4: __esp_system_init_fn_esp_timer_startup_init at /opt/esp/idf/components/esp_timer/src/esp_timer.c:509

V (773) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (779) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xC02
D (787) intr_alloc: Connected src 59 to int 3 (cpu 0)
D (792) cpu_start: calling init function: 0x42002854 on core: 0
0x42002854: __esp_system_init_fn_init_components0 at /opt/esp/idf/components/esp_system/startup.c:481

V (799) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (805) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x40E
D (813) intr_alloc: Connected src 79 to int 9 (cpu 0)
I (818) cpu_start: Starting scheduler on PRO CPU.
V (823) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (823) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x402
D (823) intr_alloc: Connected src 57 to int 12 (cpu 0)
V (823) intr_alloc: esp_intr_alloc_intrstatus (cpu 1): checking args
V (833) intr_alloc: esp_intr_alloc_intrstatus (cpu 1): Args okay. Resulting flags 0x40E
D (833) intr_alloc: Connected src 80 to int 2 (cpu 1)
I (843) cpu_start: Starting scheduler on APP CPU.
V (843) intr_alloc: esp_intr_alloc_intrstatus (cpu 1): checking args
V (853) intr_alloc: esp_intr_alloc_intrstatus (cpu 1): Args okay. Resulting flags 0x402
D (863) intr_alloc: Connected src 58 to int 3 (cpu 1)
D (863) heap_init: New heap initialised at 0x3fce9710
V (873) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (883) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (883) intr_alloc: Connected src 52 to int 13 (cpu 0)
I (893) gpio: GPIO[10]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
V (903) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (903) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x802
D (913) intr_alloc: Connected src 38 to int 17 (cpu 0)
I (953) example: Waiting for USB stick to be connected
Attachments
msc_forum_pic1.jpg
msc_forum_pic1.jpg (427.91 KiB) Viewed 5352 times

Who is online

Users browsing this forum: No registered users and 281 guests