patch : fix dma_mask for F76X F77X I2C4_RX Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

patch : fix dma_mask for F76X F77X I2C4_RX  Topic is solved

Postby alex31 » Thu Apr 18, 2019 10:49 pm

Hello,

STM32_DMA_STREAM_ID_MSK(1, 5) is a missing for STM32_I2C4_TX_DMA_MSK in 18.2, 19.1 and trunk

patch for 18.2 :
[code]
[diff --git a/os/hal/ports/STM32/STM32F7xx/stm32_registry.h b/os/hal/ports/STM32/STM32F7xx/stm32_registry.h
index 124a57f92..ce9138395 100644
--- a/os/hal/ports/STM32/STM32F7xx/stm32_registry.h
+++ b/os/hal/ports/STM32/STM32F7xx/stm32_registry.h
@@ -1177,7 +1177,8 @@
STM32_DMA_STREAM_ID_MSK(1, 2) |\
STM32_DMA_STREAM_ID_MSK(1, 1))
#define STM32_I2C4_RX_DMA_CHN 0x00200280
-#define STM32_I2C4_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 6)
+#define STM32_I2C4_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\^M
+ STM32_DMA_STREAM_ID_MSK(1, 6))^M
#define STM32_I2C4_TX_DMA_CHN 0x08000000

/* QUADSPI attributes.*/
/code]

Alexandre

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: patch : fix dma_mask for F76X F77X I2C4_RX

Postby Giovanni » Mon Apr 22, 2019 8:14 am

The manual seems to be wrong, because (1, 5) is shown as I2C4 RX and (1, 5) is I2C4 TX.

Do you confirm? if so then I also need to remove (1, 5) from I2C4 RX.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: patch : fix dma_mask for F76X F77X I2C4_RX

Postby Giovanni » Mon Apr 22, 2019 8:20 am

In the meanwhile, fixed as bug #1026.

Giovanni

User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

Re: patch : fix dma_mask for F76X F77X I2C4_RX

Postby alex31 » Mon Apr 22, 2019 2:33 pm

Do you confirm? if so then I also need to remove (1, 5) from I2C4 RX.


Did not verify on the reference manual, but that's what is in CUBEMX files :

from cubemx (5.1.0) files for stm32f[6/7]xx :

I2C4_TX : [stream(1, 5) Channel 2]

I2C4_TX : [stream(1, 6) Channel 8]

I2C4_RX : [stream(1, 1) Channel 8]

I2C4_RX : [stream(1, 2) Channel 2]

Don't have hardware on the hand right now, but i will check that is works with all the above setting tomorrow and will report here.

In the past, when i found mismatch between RM and CUBEMX, CUBEMX was right, will see tomorrow how true is this rule :-)

Alexandre

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: patch : fix dma_mask for F76X F77X I2C4_RX

Postby Giovanni » Mon Apr 22, 2019 4:23 pm

I think the RM is wrong too, I fixed like in cubemx.

Giovanni

User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

Re: patch : fix dma_mask for F76X F77X I2C4_RX

Postby alex31 » Wed Apr 24, 2019 3:52 pm

Hello,

I have made tests on the target, and as usual, CUBE is right over RM, so your patch resolves the problem, thanks.

There is another one line patch needed to use I2C4 on chibios 18.2 (its already OK on 19.x and trunk) :

Code: Select all

diff --git a/os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.c b/os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.c
index beb7c63fe..e94e48afe 100644
--- a/os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.c
+++ b/os/hal/ports/STM32/LLD/I2Cv2/hal_i2c_lld.c
@@ -1658,7 +1658,7 @@ void i2c_lld_stop(I2CDriver *i2cp) {
 #error "I2C4 interrupt numbers not defined"
 #endif
 
-      rccDisableI2C4(FALSE);
+      rccDisableI2C4();
     }
 #endif
   }


Alexandre

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: patch : fix dma_mask for F76X F77X I2C4_RX

Postby Giovanni » Sun May 12, 2019 12:59 pm

Hi,

Are you sure? it is OK here, perhaps I fixed it and don't remember.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest