arch/arm: fix DMA transfers with sizes smaller than 4 bytes.

When the buffer to send has a size not multiple of 4 bytes, 4-byte words
are sent correctly, but when the code reaches the section to send the
remaining bytes (1, 2 or 3) it was taking the remaining byte count as origin
of the copy, instead of the buffer (as it should). This commit fixes it
to correctly copy from the buffer pointer.

Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
This commit is contained in:
Carlos Sanchez 2026-06-24 10:46:43 +02:00 committed by Alan C. Assis
parent 21def97623
commit 5feb1c4b8b
4 changed files with 4 additions and 4 deletions

View file

@ -1087,7 +1087,7 @@ static void stm32_sendfifo(struct stm32_dev_s *priv)
* padding with zero as necessary to extend to a full word.
*/
uint8_t *ptr = (uint8_t *)priv->remaining;
uint8_t *ptr = (uint8_t *)priv->buffer;
int i;
data.w = 0;

View file

@ -1313,7 +1313,7 @@ static void stm32_sendfifo(struct stm32_dev_s *priv)
* padding with zero as necessary to extend to a full word.
*/
uint8_t *ptr = (uint8_t *)priv->remaining;
uint8_t *ptr = (uint8_t *)priv->buffer;
int i;
data.w = 0;

View file

@ -1232,7 +1232,7 @@ static void stm32_sendfifo(struct stm32_dev_s *priv)
* padding with zero as necessary to extend to a full word.
*/
uint8_t *ptr = (uint8_t *)priv->remaining;
uint8_t *ptr = (uint8_t *)priv->buffer;
int i;
data.w = 0;

View file

@ -1177,7 +1177,7 @@ static void stm32_sendfifo(struct stm32_dev_s *priv)
* padding with zero as necessary to extend to a full word.
*/
uint8_t *ptr = (uint8_t *)priv->remaining;
uint8_t *ptr = (uint8_t *)priv->buffer;
int i;
data.w = 0;