Associate II
April 27, 2018
Question
STM32 CubeMX USB CDC does not transmit
- April 27, 2018
- 1 reply
- 561 views
Posted on April 27, 2018 at 23:51
- 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?