2021-12-22 11:31 PM
Hello,
I've been trying to port the X-CUBE-USB-AUDIO library onto a STM32G0B1RE nucleo board.
Right now, I'm struggling with the configuration of PMA buffers.
My configuration right now :
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData, 0x00, PCD_SNG_BUF, 0x18);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData, 0x80, PCD_SNG_BUF, 0x58);
/* USER CODE END EndPoint_Configuration */
/* USER CODE BEGIN EndPoint_Configuration_AUDIO */
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData, 0x01, PCD_DBL_BUF, 0x01580098);
HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData, 0x82, PCD_DBL_BUF, 0x02d80218);
// HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData, 0x81, PCD_DBL_BUF, 0x04580398);
I need 48KHz stereo 16-bits packets, the board is setup as a USB Device acting as a speaker and microphone. The library makes use of asynchronous synchronization for the speaker using a feedback endpoint.
Right know I think I have 3 endpoints :
The X-CUBE-USB-AUDIO library gives examples with F4 and F7 boards, but those boards have dedicated FIFO buffers for USB transactions, which means the setup is different.
Can anyone help ?
Thanks