You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Submitting large I2S DMA Rx transfer using I2S_RxTransferReceiveDMA(...) splits the transfer into multiple DMA transfers. This happens if I2S_GetTransferBytes() reduce the size. I2S_GetTransferBytes calculates max single DMA transfer which is limited by hardware registers XFERCFGn:XFERCOUNT and XFERCFGn:WIDTH however the function I2S_GetTransferBytes uses:
Which assumes frame width of 4 bytes (sizeof(uint32_t)).
This leads to I2S_GetTransferBytes() limiting it to 4096 bytes. The HW register XFERCFGn is set by DMA_SetChannelXferConfig()
which tries to set the XFERCFGn:XFERCOUNT field to 4096/2=2048 which is bigger than the 10 bits the XFERCFGn:XFERCOUNT allows. As a result only half of the 4096 bytes buffer to be filled.
To Reproduce
Environment (please complete the following information):
maciejmatuszak
changed the title
[BUG] DMA XFERCFG::XFERCOUNT overflow when submitting large I2S transfer
[BUG] DMA XFERCFG::XFERCOUNT overflow when submitting large I2S DMA transfer
Apr 4, 2024
Thanks for raising up the issue and suggest fix, I have forwarded the issue to internal developer, but the feedback maybe delayed, appreciate for your patience.
Describe the bug
Submitting large I2S DMA Rx transfer using I2S_RxTransferReceiveDMA(...) splits the transfer into multiple DMA transfers. This happens if I2S_GetTransferBytes() reduce the size. I2S_GetTransferBytes calculates max single DMA transfer which is limited by hardware registers XFERCFGn:XFERCOUNT and XFERCFGn:WIDTH however the function I2S_GetTransferBytes uses:
Which assumes frame width of 4 bytes
(sizeof(uint32_t))
.This leads to I2S_GetTransferBytes() limiting it to 4096 bytes. The HW register XFERCFGn is set by DMA_SetChannelXferConfig()
which tries to set the XFERCFGn:XFERCOUNT field to 4096/2=2048 which is bigger than the 10 bits the XFERCFGn:XFERCOUNT allows. As a result only half of the 4096 bytes buffer to be filled.
To Reproduce
s_RxTransfer
is updated set thes_Buffer
to known values using memsets_Buffer
only half of it has data second half has the originalr
charactersExpected behavior
The
s_Buffer
should be filled completlyScreenshots and console output
Additional context
The text was updated successfully, but these errors were encountered: