AnsweredAssumed Answered

STM32 CubeMX USB CDC does not transmit

Question asked by johnson.seth on Apr 27, 2018
  • STM32F407VETx
  • Blank CubeMX project template plus USB_DEVICE middleware using CDC class
  • SW4STM32
  • firmware STM32Cube FW_F4 V1.16.0
  • only modified code from generated templates is this (in main.c):
      /* USER CODE BEGIN 2 */
      char buf[] = {0x01,0x02,0x03,0x04};
      CDC_Transmit_FS(buf, 4);
      /* USER CODE END 2 */
  • Using Beagle USB hardware capture device to monitor USB traffic
  • Host is Linux running Python script using usb.core and usb.util (verified working to read/write similar USB device)
  • Expected result: seeing an IN packet on the USB capture
  • Actual result: no IN packet (NAK was issued when host polled for data)
  • CDC_Transmit_FS returns USBD_OK
  • STM32 device can read data from host application (with additional modified code)
  • Tried: increasing heap to 0x400, adding delays in various places, using different packet/data sizes/lengths
  • CubeMX & project code attached


Any ideas?