-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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_example triggers panic_abort when USB stick connected (IDFGH-10880) #12082
Comments
i did change the partition table to retain the info there from the main projet i work on. I have used a lot of your example code for wifi and mqtt, i2c, uart, gpio, ADC, etc, this is the first time i run into trouble. |
Try increasing the MSC class driver's task stack size in this line. Maybe something like... .stack_size = 8192, |
Hi I already tried the stack increase, 4096 and 8192, did not help, both for the task-creation and also for the app itself. I also tried to increase the timers according to another ticket. Only things I can think of that differs from plan-vanilla-github is that i have a custom partioning, and changed the lash size to 8MB to match the devkit size. Regardless, this "bug" has been observed historically by other people but has not been fully examined due to other reporters were not able to sumbit usb-communication-logs. I will investigate if I can get hold of an usb-analyzer. |
@savenlid Could you enable GDB stub on panic (via the |
I will as soon, as I find some time, also my saleae analyzer claims to do USB, so I will try to hook it up also. |
Using the saleae did not gain anything useful. I am in the gdb but I will have to google gdb commands, to finf the information you want. A question. |
The crashing thread was thread 8 so i selected that one. (gdb) info threads
(gdb) print *pxCurrentTCB (gdb) print pxCurrentTCB (gdb) p pxCurrentTCB.pxTopOfStack p pxCurrentTCB->pxStack (gdb) x/49wx 0x3fc9ec10 // I am not good at gdb command-line usage |
(gdb) info all-registers |
I took a brand new pristine esp32-s3 devkit directly out of the box, and flashed down same image. I went back to plain vanilla partitions, it still crash. |
Hi @savenlid , Thank you so much so such a full logs. Meanwhile, can I ask you few questions, that will help us a little bit:
Thanks a lot, these answers will help us to reproduce the problem. |
Hi, I tried 6pcs of different sticks, they all fails. #1, #2 #3 We could remote debug it over teams, if you want to have a look. Thanks |
Problem fixed:
Stack size was 2048 in 5.1 |
@savenlid Could you please confirm that the problem was solved by increasing the task stack? |
there are 3 stack sizes in the example One help, one does not help. #1, MSC host task stack, size, increase helped A friend also did a scratch install trying the latest greatest, did not work on 1st attempt, worked on 2nd attempt, I will ask him if he did anything between the attempts. |
This my friend had to do to get it working: Turned on GDBSTUB via GUI och and then it worked: Following changes was made by GUI: diff --git a/sdkconfig b/sdkconfig GDB Stub+CONFIG_ESP_GDBSTUB_ENABLED=y end of GDB Stub@@ -842,9 +845,9 @@ CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 end of Trace memoryCONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set-CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set-# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not setCONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y CONFIG_EVENT_LOOP_PROFILING is not setCONFIG_POST_EVENTS_FROM_ISR=y CONFIG_OTA_ALLOW_HTTP is not setCONFIG_ESP_SYSTEM_PD_FLASH is not setCONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 |
I cant help the strange formatting in the message above. We suspect this to have helped +CONFIG_GDBSTUB_SUPPORT_TASKS=y |
Fixed by e6fde2e Feel free to reopen if the problem persists |
Answers checklist.
IDF version.
v5.2-dev-2164-g3befd5fff7
Operating System used.
Windows
How did you build your project?
Command line with Make
If you are using Windows, please specify command line type.
CMD
Development Kit.
esp32-s3 devkitc
Power Supply used.
USB
What is the expected behavior?
Taking the USB MSC example out of the box, fails in a way already described elsewhere.
Then the issue-poster finally said it was a hardware issue, and it then worked.
But regardless bad soldering of D- or D+, crashing is not an option due to flaky D-/D+ wiring.
What is the actual behavior?
I (287) cpu_start: Chip rev: v0.1
I (292) heap_init: Initializing. RAM available for dynamic allocation:
I (299) heap_init: At 3FC95260 len 000544B0 (337 KiB): DRAM
I (305) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DRAM
I (312) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (318) heap_init: At 600FE010 len 00001FF0 (7 KiB): RTCRAM
I (326) spi_flash: detected chip: generic
I (329) spi_flash: flash io: dio
I (333) sleep: Configure to isolate all GPIO pins in sleep state
I (340) sleep: Enable automatic switching of GPIO sleep configuration
I (347) app_start: Starting scheduler on CPU0
I (352) app_start: Starting scheduler on CPU1
I (352) main_task: Started on CPU0
I (362) main_task: Calling app_main()
I (362) gpio: GPIO[10]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (402) example: Waiting for USB stick to be connected
I (812) example: MSC device connected
ERROR A stack overflow in task USB MSC has been detected.
Backtrace: 0x40375812:0x3fc9cd30 0x40379c09:0x3fc9cd50 0x4037c63e:0x3fc9cd70 0x4037b187:0x3fc9cdf0 0x4037c74c:0x3fc9ce10 0x4037c742:0x00000000 |<-CORRUPTED
0x40375812: panic_abort at C:/Espressif/frameworks/esp-idf-v5.1/components/esp_system/panic.c:452
0x40379c09: esp_system_abort at C:/Espressif/frameworks/esp-idf-v5.1/components/esp_system/port/esp_system_chip.c:84
0x4037c63e: vApplicationStackOverflowHook at C:/Espressif/frameworks/esp-idf-v5.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:581
0x4037b187: vTaskSwitchContext at C:/Espressif/frameworks/esp-idf-v5.1/components/freertos/FreeRTOS-Kernel/tasks.c:3729
0x4037c74c: _frxt_dispatch at C:/Espressif/frameworks/esp-idf-v5.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S:450
0x4037c742: _frxt_int_exit at C:/Espressif/frameworks/esp-idf-v5.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S:245
Steps to reproduce.
Just use last master, using a esp32-s3 devkitc
compile the example USB MSC HOST (OTG)
Connect a usb-memory-stick ( possibly with some connection problem on d-/d+
Crash
Debug Logs.
More Information.
I soldered the USB OTG cable on my own.
I am a professional in soldering, but faults can happen.
I will buy a USB-OTG cable and try, but still it should not crash.
The text was updated successfully, but these errors were encountered: