I'm seeing similar results on 6.3.2.
1 Like
Not very familiar with how the underlying Device OS operates, but when it sends a packet to the Realtek PCD, that's blocking isn't it?
int RtlUsbDriver::transferIn(unsigned ep, const uint8_t* ptr, size_t size) {
SPARK_ASSERT(rtlDev_);
auto self = instance();
std::lock_guard<RtlUsbDriver> lk(*self);
if (ptr == nullptr && size == 0) {
// FIXME
void* pcd = *((void**)((uint8_t*)rtlDev_ + RTL_USB_DEV_PCD_OFFSET));
usb_spinlock_t* lock = *((usb_spinlock_t**)((uint8_t*)pcd + RTL_USB_PCD_SPINLOCK_OFFSET));
usb_os_spinlock(lock);
auto r = usb_hal_write_packet(nullptr, ep & 0x7f, 0);
usb_os_spinunlock(lock);
return CHECK_RTL_USB_TO_SYSTEM(r);
}
return CHECK_RTL_USB_TO_SYSTEM(usbd_ep_transmit(rtlDev_, ep | SetupRequest::DIRECTION_DEVICE_TO_HOST, (uint8_t*)ptr, size));
}
If usbd_ep_transmit()
is synchronous, we'd be waiting there until it takes our data even though we're no longer adding extra 1 ms delays in the HAL in 6.3.2.