This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 5feb1c4b8b3 arch/arm: fix DMA transfers with sizes smaller than 4 
bytes.
5feb1c4b8b3 is described below

commit 5feb1c4b8b3fda0bfeccbf49a2be8865169cdfd4
Author: Carlos Sanchez <[email protected]>
AuthorDate: Wed Jun 24 10:46:43 2026 +0200

    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 <[email protected]>
---
 arch/arm/src/common/stm32/stm32_sdio_m3m4_v1.c | 2 +-
 arch/arm/src/stm32f7/stm32_sdmmc.c             | 2 +-
 arch/arm/src/stm32h7/stm32_sdmmc.c             | 2 +-
 arch/arm/src/stm32l4/stm32l4_sdmmc.c           | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/src/common/stm32/stm32_sdio_m3m4_v1.c 
b/arch/arm/src/common/stm32/stm32_sdio_m3m4_v1.c
index 3387e111c4e..460ce937c48 100644
--- a/arch/arm/src/common/stm32/stm32_sdio_m3m4_v1.c
+++ b/arch/arm/src/common/stm32/stm32_sdio_m3m4_v1.c
@@ -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;
diff --git a/arch/arm/src/stm32f7/stm32_sdmmc.c 
b/arch/arm/src/stm32f7/stm32_sdmmc.c
index d82877095a1..772e62572bf 100644
--- a/arch/arm/src/stm32f7/stm32_sdmmc.c
+++ b/arch/arm/src/stm32f7/stm32_sdmmc.c
@@ -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;
diff --git a/arch/arm/src/stm32h7/stm32_sdmmc.c 
b/arch/arm/src/stm32h7/stm32_sdmmc.c
index 2aca3035cd2..0e713eadb07 100644
--- a/arch/arm/src/stm32h7/stm32_sdmmc.c
+++ b/arch/arm/src/stm32h7/stm32_sdmmc.c
@@ -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;
diff --git a/arch/arm/src/stm32l4/stm32l4_sdmmc.c 
b/arch/arm/src/stm32l4/stm32l4_sdmmc.c
index bea2a35c088..3f1aaef30c8 100644
--- a/arch/arm/src/stm32l4/stm32l4_sdmmc.c
+++ b/arch/arm/src/stm32l4/stm32l4_sdmmc.c
@@ -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;

Reply via email to