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

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

commit fb07855d51413cecc1b791385b69051927d27594
Author: raiden00pl <[email protected]>
AuthorDate: Sat Oct 24 09:50:08 2026 +0200

    arch/arm/src/common/stm32: complete LPTIM interrupt clear before return
    
    ackint() wrote ICR only.  On STM32H7 LPTIM2-5 the write had not taken
    effect when the interrupt returned, so every event was taken twice.
    Read ISR back after the write.
    
    Signed-off-by: raiden00pl <[email protected]>
    Assisted-by: Claude Code
---
 arch/arm/src/common/stm32/stm32_lptim.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/src/common/stm32/stm32_lptim.c 
b/arch/arm/src/common/stm32/stm32_lptim.c
index ac880b92deb..eada6d72a48 100644
--- a/arch/arm/src/common/stm32/stm32_lptim.c
+++ b/arch/arm/src/common/stm32/stm32_lptim.c
@@ -910,6 +910,10 @@ static void stm32_lptim_disableint(struct 
stm32_lptim_dev_s *dev,
 static void stm32_lptim_ackint(struct stm32_lptim_dev_s *dev, int source)
 {
   stm32_putreg32(dev, STM32_LPTIM_ICR_OFFSET, source);
+
+  /* Read back so the flag is cleared before the interrupt returns */
+
+  stm32_getreg32(dev, STM32_LPTIM_ISR_OFFSET);
 }
 
 /****************************************************************************

Reply via email to