Thank you for responding, Sol!
Reflecting back what I'm hearing...when my Kinetis USB device receives data that it can't process, I should
* call _usb_device_stall_endpoint(devicePtr->controller_handle, ep_num, USB_RECV);
* wait until the queue has emptied enough to receive more data
* add the data to the queue
* call _usb_device_unstall_endpoint(devicePtr->controller_handle, ep_num, USB_RECV); to unstall the queue
* call _usb_device_recv_data with a new buffer
Or must I do this BEFORE I'm out of space?
When my Kinetis USB device receives any data it should:
* add data to queue
* call _usb_device_recv_data with a new buffer
* test queue, if it is within one packet of being full, call _usb_device_stall
* (wait for queue below threshold)
* call _usb_device_unstall
Which is recommended? The first is much easier, I suspect the latter will require setting a semaphore for stalled and letting the serial tx isr clear it and send the unstall.
John