STM32F072 USBD_LL_Transmit problem
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-07-01 2:04 AM
Posted on July 01, 2016 at 11:04
I'm using STM32F072 MCU in USB Device mode. The USB enumerates nicely creating 1 interface and 2 bulk endpoints. One input and one output. Both with the maximum transfer size 64 bytes.
The problem occurs when I try to transfer more than 16 bytes of data. The transfer data is OK when I transfer less than 16 bytes but gibberish when I transfer more than 16 bytes in a single packet. I am analyzing the stream on a USB analyzer. I have opened the endpoints and I transfer data with USBD_LL_Transmit function. I am using HAL librariesAny ideas what I am doing wrong ? #stmf0 #hal #usb #usb #stm32f0
Labels:
- Labels:
-
STM32Cube MCU Packages
-
STM32F0 Series
-
USB
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-07-02 4:56 AM
Posted on July 02, 2016 at 13:56
Hi martin,
Sound like a problem around assignment of endpoint buffer address for the bulk endpoint, using HAL_PCDEx_PMAConfig(). Using ''search files'' function of your editor, find code lines like this one, HAL_PCDEx_PMAConfig(&hpcd , 0x00 , PCD_SNG_BUF, 0x18); // EP0 OUT HAL_PCDEx_PMAConfig(&hpcd , 0x80 , PCD_SNG_BUF, 0x58); // EP0 IN HAL_PCDEx_PMAConfig(&hpcd , 0x01 , PCD_SNG_BUF, 0x100); // EP1 OUT HAL_PCDEx_PMAConfig(&hpcd , 0x81 , PCD_SNG_BUF, 0x140); // EP1 IN HAL_PCDEx_PMAConfig() assigns starting address of endpoint buffer on USB RAM to each endpoint. - You should have four lines of HAL_PCDEx_PMAConfig(), for the default EPs (EP0 IN/OUT) and the two bulk EPs. Above example assumes EP1 IN/OUT for the bulk EPs. To keep 64 bytes buffer for EP1 OUT (starting at 0x100), EP1 IN starts at 0x140. Modify your code like above one. TsuneoOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-10-30 1:55 AM
I Modify my code like above,but the problem also occurs .what can i do ? the mcu is stm32l433rct.
