Add SUSPEND/RESUME handling for Renesas RX family.#949
Conversation
| } | ||
| if (is0 & USB_IS0_SOFR) { | ||
| if (_dcd.suspended) { | ||
| dcd_event_bus_signal(rhport, DCD_EVENT_RESUME, true); |
There was a problem hiding this comment.
hmm, this is a bit odd, SOF should be recognized by hardware as Resume signal. Do we really need to do it manually ?
There was a problem hiding this comment.
I am agree your guessing. But unfortunately, RX65N does not signal resume interrupt caused by dcd_remote_wakeup() , in my experience. Of course, when the host resumes on its own, it occurs resume interrupt.
There was a problem hiding this comment.
@kkitayam I see, that is a bit odd for rx65n controller for not raising Resume interrupt in this case. Could you put an comment explaining why we need to manually send resume event here. Just in case when going back to this and/or we could figure out a better way to detect resume.
| (void)rhport; | ||
| /* TODO */ | ||
| USB0.DVSTCTR0.BIT.WKUP = 1; | ||
| while (USB0.DVSTCTR0.BIT.WKUP) ; |
There was a problem hiding this comment.
I think we don't really need to blocking wait here,which could take a few ms, just return. We will send resume event later on with SOF walkaround. The usbd has its own suspended status bit, and shouldn't do any transfer until RESUME event is reported by dcd.
There was a problem hiding this comment.
OK, I will remove this statement.
add comments why resume event is sent manually.
hathach
left a comment
There was a problem hiding this comment.
perfect ! Thank you very much for the PR.
Describe the PR
Add SUSPEND/RESUME handling for Renesas RX family.
Additional context
I have confirmed suspend/resume works with
hid_compositeexample onrx65n_target.But,
DCD_EVENT_UNPLUGGEDis not issued like before. I have no idea why VBINT(it is the VBUS changing interruption) is not occurred when the USB cable is removed.