How is pmaadress calculated in HAL_PCDEx_PMAConfig?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-11-25 1:03 AM
Posted on November 25, 2016 at 10:03
Generating USB CDC example in STM32CubeMX for STM32F103 it creates the following code inside
USBD_LL_Init
():HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x00 , PCD_SNG_BUF, 0x18);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x80 , PCD_SNG_BUF, 0x58);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x81 , PCD_SNG_BUF, 0xC0);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x01 , PCD_SNG_BUF, 0x110);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x82 , PCD_SNG_BUF, 0x100);
How are 0x18, x058, x0C0... calculated? I get that they are endpoint positions inside PMA buffer, but could not find the exact calculation.
I read RM0008, ''3 USB functional description'' , the closest I get is ''Figure Packet buffer areas with examples of buffer description table locations''
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-11-29 6:04 AM
Posted on November 29, 2016 at 15:04
Hello,
Refer to this : STM32 USB-FS-Device development kit, maybe this helps you.RegardsOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-12-11 6:05 PM
Posted on December 12, 2016 at 03:05
I'm surprised nobody seems to have an answer. This is definitely not documented either in the Cube HAL or (at least for the stm32f3) reference manual. Without this key bit of information, it is virtually impossible to build a USB device that doesn't simply used the (rather limited) standard examples.
