From a7869bb28b393dbc439951670df2c8298564ce90 Mon Sep 17 00:00:00 2001 From: bazooka Joe Date: Thu, 19 Dec 2024 12:06:30 +0200 Subject: [PATCH] stm32_i2c: fix sending large data over i2c To trigger TC interrupt NBYTES needs to be set before RELOAD is disabled similar to previous commitdone on stm32h7 510b6221ca61b4209ffcf97fbaf64df8528e4870 --- arch/arm/src/stm32/stm32_i2c_v2.c | 4 ++-- arch/arm/src/stm32f0l0g0/stm32_i2c.c | 4 ++-- arch/arm/src/stm32f7/stm32_i2c.c | 4 ++-- arch/arm/src/stm32h5/stm32_i2c.c | 4 ++-- arch/arm/src/stm32u5/stm32_i2c.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/src/stm32/stm32_i2c_v2.c b/arch/arm/src/stm32/stm32_i2c_v2.c index d88bd4c6e1..aeebc3b4d1 100644 --- a/arch/arm/src/stm32/stm32_i2c_v2.c +++ b/arch/arm/src/stm32/stm32_i2c_v2.c @@ -1984,9 +1984,9 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) i2cinfo("TCR: DISABLE RELOAD: NBYTES = dcnt = %i msgc = %i\n", priv->dcnt, priv->msgc); - stm32_i2c_disable_reload(priv); - stm32_i2c_set_bytes_to_transfer(priv, priv->dcnt); + + stm32_i2c_disable_reload(priv); } i2cinfo("TCR: EXIT dcnt = %i msgc = %i status 0x%08" PRIx32 "\n", diff --git a/arch/arm/src/stm32f0l0g0/stm32_i2c.c b/arch/arm/src/stm32f0l0g0/stm32_i2c.c index 1ec684189b..070d425054 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_i2c.c +++ b/arch/arm/src/stm32f0l0g0/stm32_i2c.c @@ -1984,9 +1984,9 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) i2cinfo("TCR: DISABLE RELOAD: NBYTES = dcnt = %i msgc = %i\n", priv->dcnt, priv->msgc); - stm32_i2c_disable_reload(priv); - stm32_i2c_set_bytes_to_transfer(priv, priv->dcnt); + + stm32_i2c_disable_reload(priv); } i2cinfo("TCR: EXIT dcnt = %i msgc = %i status 0x%08" PRIx32 "\n", diff --git a/arch/arm/src/stm32f7/stm32_i2c.c b/arch/arm/src/stm32f7/stm32_i2c.c index 4802bcc0f4..b5fba286de 100644 --- a/arch/arm/src/stm32f7/stm32_i2c.c +++ b/arch/arm/src/stm32f7/stm32_i2c.c @@ -2018,9 +2018,9 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) i2cinfo("TCR: DISABLE RELOAD: NBYTES = dcnt = %i msgc = %i\n", priv->dcnt, priv->msgc); - stm32_i2c_disable_reload(priv); - stm32_i2c_set_bytes_to_transfer(priv, priv->dcnt); + + stm32_i2c_disable_reload(priv); } i2cinfo("TCR: EXIT dcnt = %i msgc = %i status 0x%08" PRIx32 "\n", diff --git a/arch/arm/src/stm32h5/stm32_i2c.c b/arch/arm/src/stm32h5/stm32_i2c.c index b3c011c7f2..6f299beda8 100644 --- a/arch/arm/src/stm32h5/stm32_i2c.c +++ b/arch/arm/src/stm32h5/stm32_i2c.c @@ -2176,9 +2176,9 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) * the transfer. */ - stm32_i2c_enable_reload(priv); - stm32_i2c_set_bytes_to_transfer(priv, 255); + + stm32_i2c_enable_reload(priv); } else { diff --git a/arch/arm/src/stm32u5/stm32_i2c.c b/arch/arm/src/stm32u5/stm32_i2c.c index e1dfda92a7..b34c86a8f1 100644 --- a/arch/arm/src/stm32u5/stm32_i2c.c +++ b/arch/arm/src/stm32u5/stm32_i2c.c @@ -2223,9 +2223,9 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) i2cinfo("TCR: DISABLE RELOAD: NBYTES = dcnt = %i msgc = %i\n", priv->dcnt, priv->msgc); - stm32_i2c_disable_reload(priv); - stm32_i2c_set_bytes_to_transfer(priv, priv->dcnt); + + stm32_i2c_disable_reload(priv); } i2cinfo("TCR: EXIT dcnt = %i msgc = %i status 0x%08" PRIx32 "\n",