USB endpoint limitations?
Hi there,
I am trying to implement 3 CDC interfaces over USB. I'm using the USB stack generated by CubeMX, I enabled composite devices and call 3 times "USBD_RegisterClassComposite" in my "MX_USB_Device_Init".
I am having troubles with endpoint numbering as if I choose the simple sequence:
CDC1: 0x81/0x01 + CMD1: 0x82
CDC2: 0x83/0x03 + CMD2: 0x84
CDC3: 0x85/0x05 + CMD3: 0x86
Then CDC 1 and 3 work as expected but I get problems on CDC 2. Testing a bunch of numbers for the endpoints there seams to be a lot of limitations but one sequence that works for my applications is:
CDC1: 0x81/0x01 + CMD1: 0x82
CDC2: 0x87/0x07 + CMD2: 0x84
CDC3: 0x85/0x05 + CMD3: 0x86
For some reason, this configuration works. This fixes my problem but I would like to know why. Many combo of endpoints do not work but the number 3 seams to be especially cursed in my tests. Is there a reason for that? I cannot find anything in the doc that would relate to limitations or logics to follow when it comes to endpoint numbering.
Thanks a lot
Have a nice day
PS: The PMA memory in my application is allocated as follow in all my testing (this is part of "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 , CDC_IN1_EP , PCD_SNG_BUF, 0x100);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , CDC_OUT1_EP , PCD_SNG_BUF, 0x140);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , CDC_CMD1_EP , PCD_SNG_BUF, 0x180);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , CDC_IN2_EP , PCD_SNG_BUF, 0x200);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , CDC_OUT2_EP , PCD_SNG_BUF, 0x240);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , CDC_CMD2_EP , PCD_SNG_BUF, 0x280);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , CDC_IN3_EP , PCD_SNG_BUF, 0x300);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , CDC_OUT3_EP , PCD_SNG_BUF, 0x340);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , CDC_CMD3_EP , PCD_SNG_BUF, 0x380);
