Skip to main content
tristan
Associate
August 14, 2015
Question

STM32Cube F4 USB CDC Rx only once!

  • August 14, 2015
  • 2 replies
  • 557 views
Posted on August 14, 2015 at 09:54

HW board is stm32f429I-Discovery (MCU: stm32f429ZIT6).

I use STM32Cube MX V4.9 and stm32f429 firmware package V1.7 to generate source code of USB CDC function. GUI select device_only mode, and HSE to external 8MHz crystal, and configure USB clock to 48MHz, CPU: 168MH.

After I increase the heap size in stm32f4xxx_icf, then I can enumerate CDC successfully and TX(device to PC) characters continuously. 

But, the issue I met is RX(PC to device) only can do once. RX IRQ won't come again, even TX still works after that.

anyone met some issue? any thought to figure it out?

Thank you,

I check some internal control variables, such hpcd_USB_OTG_HS (Lock is HAL_UNLOCK, state is HAL_PCD_STATE_READY)

==RX call stack==

USBD_CDC_DataOut()

USBD_LL_DataOutStage()

HAL_PCD_IRQHandler()

    This topic has been closed for replies.

    2 replies

    robert-hartung
    Associate III
    August 14, 2015
    Posted on August 14, 2015 at 22:26

    Hi,

    I had the same issue. You have to manually call the receive function again to receive more data:

    static int8_t CDC_Receive_HS (uint8_t* Buf, uint32_t *Len){ /* USER CODE BEGIN 11 */ USBD_CDC_ReceivePacket(hUsbDevice_1); return (USBD_OK); /* USER CODE END 11 */ }

    Regards, Robert
    tristan
    tristanAuthor
    Associate
    August 17, 2015
    Posted on August 17, 2015 at 07:46

    yes, it really works. Thanks a lot.