-
Notifications
You must be signed in to change notification settings - Fork 26
Panic / coredump when calling esp_core_dump_get_summary() with tinyusb CDC . (IEC-261) #130
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
Comments
Hi @gadget-man, The crash is likely caused by calling To resolve this, use Try replacing // Replace:
printf("ISR log: something happened\n");
// With:
ets_printf("ISR log: something happened\n"); |
Yes I understand that, but |
Yes, it is a bug in our configuration where we use default |
TinyUSB can print logs from ISR. We must use ISR capable ets_printf. Closes #130
@gadget-man Could you try if #132 fixes your problem? If you want to add the change to your project:
## IDF Component Manager Manifest File
dependencies:
espressif/esp_tinyusb:
version: "*"
path: "C:\\github_repos\\esp-usb\\device\\esp_tinyusb" # Update to your path
idf: "^5.0" |
#132 has only partially fixed the problem. With tinyUSB active and logging enabled on ACM_1 (i.e. cable is connected), if I call a function to dump the coredump summary from a separate channel (e.g. I can make RPC calls over secure MQTT), then it still crashes. However, if I do the same thing with tinyUSB configured but no usb cable attached, it works OK. I wonder if this is due to our configuration of logging. In addition to logging either to USBC or UART (depending on which is connected), we also log via UDP. I therefore have the below function:
(please excuse this very sloppy coding - I'll tidy it up properly when everything is working!) Could the way I'm sending the logs over USB be causing the remaining issue? |
Correction, it's not crashing when the usb cable is connected, but it is rebooting due to interrupt watchdog. Also, if I call the coredump RPC function over usb-serial command it fails and the usb disconnects. If I call it over MQTT, the usb disconnects immediately, but then the function does often run OK and the device stays online, sometimes failing due to the interrupt watchdog. |
I suspect the problem is that calls to TinyUSB API are not thread safe. However, BTW, if you use USB only for logging, you can use USB-Serial-JTAG, it has better support for logging support. You can enable it in menuconfig in |
Uh oh!
There was an error while loading. Please reload this page.
Answers checklist.
Which component are you using? If you choose Other, provide details in More Information.
device/esp_tinyusb
ESP-IDF version.
5.4.0
Development Kit.
ESP32S3 DevkIt
Used Component version.
1.7.1
More Information.
I have esp_tinyusb enabled to send serial output over USB. Everything works fine until I call
This is the code I use to initiate tinyusb:
As soon as I call
esp_err_t err = esp_core_dump_get_summary(summary);
, I get a panic, this is the returned coredump summary:It looks as though there's an issue with an ISR running which causes the USB to fail.
The text was updated successfully, but these errors were encountered: