Skip to content
Snippets Groups Projects
  1. Nov 26, 2018
  2. Nov 15, 2018
  3. Nov 01, 2018
  4. Oct 30, 2018
  5. Oct 27, 2018
  6. Oct 23, 2018
  7. Oct 22, 2018
  8. Oct 19, 2018
  9. Oct 18, 2018
  10. Oct 17, 2018
  11. Oct 15, 2018
    • Damien George's avatar
      stm32/usbd_cdc_interface: Refactor USB CDC tx code to not use SOF IRQ. · 0f6f86ca
      Damien George authored
      Prior to this commit the USB CDC used the USB start-of-frame (SOF) IRQ to
      regularly check if buffered data needed to be sent out to the USB host.
      This wasted resources (CPU, power) if no data needed to be sent.
      
      This commit changes how the USB CDC transmits buffered data:
      - When new data is first available to send the data is queued immediately
        on the USB IN endpoint, ready to be sent as soon as possible.
      - Subsequent additions to the buffer (via usbd_cdc_try_tx()) will wait.
      - When the low-level USB driver has finished sending out the data queued
        in the USB IN endpoint it calls usbd_cdc_tx_ready() which immediately
        queues any outstanding data, waiting for the next IN frame.
      
      The benefits on this new approach are:
      - SOF IRQ does not need to run continuously so device has a better chance
        to sleep for longer, and be more responsive to other IRQs.
      - Because SOF IRQ is off, current consumption is reduced by a small amount,
        roughly 200uA when USB is connected (measured on PYBv1.0).
      - CDC tx throughput (USB IN) on PYBv1.0 is about 2.3 faster (USB OUT is
        unchanged).
      - When USB is connected, Python code that is executing is slightly faster
        because SOF IRQ no longer interrupts continuously.
      - On F733 with USB HS, CDC tx throughput is about the same as prior to this
        commit.
      - On F733 with USB HS, Python code is about 5% faster because of no SOF.
      
      As part of this refactor, the serial port should no longer echo initial
      characters when the serial port is first opened (this only used to happen
      rarely on USB FS, but on USB HS is was more evident).
      0f6f86ca
    • Damien George's avatar
      stm32/usbd_cdc_interface: Handle disconnect IRQ to set VCP disconnected. · 53ccbe6c
      Damien George authored
      pyb.USB_VCP().isconnected() will now return False if the USB is
      disconnected after having previously been connected.
      
      See issue #4210.
      53ccbe6c
  12. Oct 14, 2018
Loading