STM32U575 FMAC DMA wong amount of bytes
I have experimented with STM32U575Z using FMAC.
I run the FMAC doing a convolution (sFmacConfig.Filter = FMAC_FUNC_CONVO_FIR)
I run the FMAC in DMA mode.
I registerd a HAL_FMAC_OUTPUT_DATA_READY Callback
But it is never triggered.
According to AN5593 Rev 4, GPDMA1 should be set for FMAC to work to "half word" transfer.
When reading through the source code in file "stm32u5xx_hal_fmac.c
/**
* @brief Register the new output buffer, update DMA configuration if needed and change the FMAC state.
* @param hfmac pointer to a FMAC_HandleTypeDef structure that contains
* the configuration information for FMAC module.
* @param pOutput New output vector.
* @param pOutputSize Size of the output vector (if the vector can't
* be entirely filled, pOutputSize will be updated with the number
* of data read from FMAC).
* @retval HAL_StatusTypeDef HAL status
*/
static HAL_StatusTypeDef FMAC_ConfigFilterOutputBufferUpdateState(FMAC_HandleTypeDef *hfmac, int16_t *pOutput,
uint16_t *pOutputSize)
{
HAL_StatusTypeDef status;
/* Reset the current size */
hfmac->OutputCurrentSize = 0U;
....
else
{
status = HAL_DMA_Start_IT(hfmac->hdmaOut, (uint32_t)&hfmac->Instance->RDATA, \
(uint32_t)pOutput, (uint32_t)(4UL * (*pOutputSize)));
}
in line 2270 (in this snipet line 24) the DMA is setup with 4 times the size of the output vector. (4UL * pOutputSize)
Obviously the code is written for a fixed data size of 32Bit per DMA transfer.
But FMAC is designed for 16 bit transfer.
As a result the DMA_complete_Callback is never called.
Is this wrong? Should the amount of bytes being transfered here changed to 2 * pOutSize ? Or do I have to change the DMA transfer to 32 Bit? (different from the recommendation of AN5593)
