You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's missing false positives detection but already works well, but now comes the question how to integrate it into esp-hal properly (As an example / driver), some ideas:
Using add embassy #[main] callback passing #3813 and steal() and a atomic bool, with a function which unpacks it. Would be pretty similar to esp idf, but well, unsafe. usb_serial_jtag_ll_clr_intsts_mask writes to USB_SERIAL_JTAG_INT_CLR_REG which clears things, shouldnt be an issue?
Add this functionality to UsbSerialJtag, this assumes that the user will need to run it in a loop themselves, because I also assume that esp-idf put it as a esp_register_freertos_tick_hook for a reason and not just a regular function (if the reason is only power management, then that's weird), if it's not in a loop, then adding it in UsbSerialJtag is easy (if it's the right place to add it which I also don't know, I need registers from USB_DEVICE)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
esp-idf has this cool functionality: https://github.com/espressif/esp-idf/blob/d7b0a45ddbddbac53afb4fc28168f9f9259dbb79/components/driver/usb_serial_jtag/usb_serial_jtag_connection_monitor.c#L38-L69
Which detects if USB is connected to the device. I have this code snippet (Only esp32c6 tested):
It's missing false positives detection but already works well, but now comes the question how to integrate it into esp-hal properly (As an example / driver), some ideas:
usb_serial_jtag_ll_clr_intsts_mask
writes to USB_SERIAL_JTAG_INT_CLR_REG which clears things, shouldnt be an issue?esp_register_freertos_tick_hook
for a reason and not just a regular function (if the reason is only power management, then that's weird), if it's not in a loop, then adding it in UsbSerialJtag is easy (if it's the right place to add it which I also don't know, I need registers fromUSB_DEVICE
)Beta Was this translation helpful? Give feedback.
All reactions