cancel
Showing results for 
Search instead for 
Did you mean: 

I2C3 issue on NUCLEO STM32WL using CubeMX : I2C1 working well

LLr.1
Senior

Hello,

I have a problem to use another bus (I2C2 or I2C3) than the I2C1 bus in the nulceo STM32WL55JC1

My code is working with I2C1 but when I just change hi2c1 into hi2c3. Then, HAL_I2C_Mem_Write() is no longer working. I cannot see any signal with an oscilloscope.

I use Cube MX to make the initilization so it has to be the same between I2C1 and I2C3.

0693W00000Ho8XQQAZ.png0693W00000Ho8XfQAJ.pngJust I notice that for I2C1 I have

0693W00000Ho8X1QAJ.pngand for I2C3 0693W00000Ho8WwQAJ.pngBut I cannot change that.

I have tried with an another board... but not working also

I have try to put Fast mode to try the high speed as said here : HAL for I2C is horribly broken (st.com)

0693W00000Ho8bcQAB.png 

Wouldn't that be a CubeMX problem ?

Unless there is another error on the pins of the NUCELO in the table of UM2592? and that it is not these pins 36 and 38 of CN7 but others? (Irritating documentation for I2C1 Pins on NUCLEO WL55JC1 (st.com))

Thank you by advance

1 ACCEPTED SOLUTION

Accepted Solutions
LLr.1
Senior

This strange problem comes from this specific accelerometer. I change for an other MC3635 and it works!

View solution in original post

5 REPLIES 5
TDK
Guru

Do you have an external pullup on the line? The internal pullup of ~40kOhm is insufficient for I2C in general, but especially for 1MHz mode.

Initialize the pin as GPIO output and toggle it to verify connectivity. Or consult the schematic.

If you feel a post has answered your question, please click "Accept as Solution".
Khouloud ZEMMELI
ST Employee

Hello @LLr.1​ ,

Thank you for your post,

I have checked using CubeMX 6.4.0 and issue doesn't appear, you can change set GPIO pull up for I2C2 and I2C3 signals, please switch to the latest version, if you still face a problem, don't hesitate to mention it.

Thanks, Khouloud

Yes, 4k7 pullup. I use standard mode. The 1MHz mode is just to try that "HAL for I2C is horribly broken (st.com)"

Thank you, it is the good pins

LLr.1
Senior

Thank you for your reply. I updated my CubeMx and tried with other I2C sensors (MS5637, SHTC3...) : the I2C3 works ! but the I2C3 is not working for the MC3635 accelerometer whereas this sensor works with the I2C1... it drives me crazy

LLr.1
Senior

This strange problem comes from this specific accelerometer. I change for an other MC3635 and it works!