3 커밋 e0c758bc2d ... 7d4b81f787

작성자 SHA1 메시지 날짜
  Dmitry Filimonchuk 7d4b81f787 #135 revert clear STALL on write 2 년 전
  Dmitry Filimonchuk 823c025702 #135 set demo code back to loopback 2 년 전
  Dmitry Filimonchuk 0b4b77ae28 #135 fix F105 RX buffer overflow 2 년 전
3개의 변경된 파일3개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 1
      demo/cdc_loop.c
  2. 1 3
      src/usbd_stm32f105_otgfs.c
  3. 1 2
      src/usbd_stm32f429_otgfs.c

+ 1 - 1
demo/cdc_loop.c

@@ -32,7 +32,7 @@
 #define HID_RIN_EP      0x83
 #define HID_RIN_SZ      0x10
 
-//#define CDC_LOOPBACK
+#define CDC_LOOPBACK
 #define ENABLE_HID_COMBO
 
 //#define SIGNAL_MODEM  /* uncomment to signal modem capabilities */

+ 1 - 3
src/usbd_stm32f105_otgfs.c

@@ -338,6 +338,7 @@ static int32_t ep_read(uint8_t ep, void* buf, uint16_t blen) {
             tmp >>= 8;
         }
     }
+    _BST(EPOUT(ep)->DOEPCTL, USB_OTG_DOEPCTL_CNAK | USB_OTG_DOEPCTL_EPENA);
     return (len < blen) ? len : blen;
 }
 
@@ -413,9 +414,6 @@ static void evt_poll(usbd_device *dev, usbd_evt_callback callback) {
                 }
                 evt = usbd_evt_epsetup;
                 break;
-            case 0x03:  /* OUT completed */
-            case 0x04:  /* SETUP completed */
-                _BST(EPOUT(ep)->DOEPCTL, USB_OTG_DOEPCTL_CNAK | USB_OTG_DOEPCTL_EPENA);
                 // fall through
             default:
                 /* pop GRXSTSP */

+ 1 - 2
src/usbd_stm32f429_otgfs.c

@@ -350,9 +350,8 @@ static int32_t ep_write(uint8_t ep, const void *buf, uint16_t blen) {
     len = (blen + 3) >> 2;
     /* no enough space in TX fifo */
     if (len > 0 && len > _FLD2VAL(USB_OTG_DTXFSTS_INEPTFSAV, epi->DTXFSTS)) return -1;
-    //epi->DIEPTSIZ = 0;
     epi->DIEPTSIZ = (1 << 19) + blen;
-    _BST(epi->DIEPCTL, USB_OTG_DIEPCTL_EPENA | USB_OTG_DIEPCTL_CNAK);
+    _BMD(epi->DIEPCTL, USB_OTG_DIEPCTL_STALL, USB_OTG_DOEPCTL_EPENA | USB_OTG_DOEPCTL_CNAK);
     /* push data to FIFO */
     for (int idx = 0; idx < blen; idx++) {
         tmp |= (uint32_t)((const uint8_t*)buf)[idx] << ((idx & 0x03) << 3);