Question
How is pmaadress calculated in HAL_PCDEx_PMAConfig?
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''