2021-12-10 12:21 AM
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.
Just I notice that for I2C1 I have
and for I2C3 But 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)
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
Solved! Go to Solution.
2021-12-23 04:48 AM
This strange problem comes from this specific accelerometer. I change for an other MC3635 and it works!
2021-12-10 07:26 AM
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.
2021-12-21 07:08 AM
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
2021-12-22 05:52 AM
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
2021-12-22 05:56 AM
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
2021-12-23 04:48 AM
This strange problem comes from this specific accelerometer. I change for an other MC3635 and it works!