Skip to main content
Visitor II
October 30, 2024
Question

CONFLICT WHEN USING I2C1 STM32F4 DISCOVERY

  • October 30, 2024
  • 3 replies
  • 1383 views

I use STM32F4 Discovery, and when using I2C1 for communication, I encounter a situation where the chip becomes unresponsive while using UART and during operation with I2C1. When I use other I2C interfaces, it works normally. I want to understand what is causing I2C1 to make the chip unresponsive.

When I use other I2C interfaces, the response is only within 100ms, but when using this I2C interface, the response takes several seconds

thanks you

    This topic has been closed for replies.

    3 replies

    Super User
    October 30, 2024

    Have you checked the board's User Manual and/or Schematics to see if there's anything else on that pin?

    Example just now:

    https://community.st.com/t5/stm32-mcus-products/low-voltage-for-logic-high-on-nucleo-g431kb/td-p/737306

     

    bacnkAuthor
    Visitor II
    November 2, 2024

    I use resistor connected to 3v3, do I need to configure pull up in the code?

    Super User
    November 2, 2024

    Please show a schematic.

    Trying to describe electronic circuits in text is really ineffective - that's why we have schematics!

    Technical Moderator
    October 30, 2024

    Hello @bacnk 

    Make sure that there are no resource conflicts between I2C1 and other peripherals and that I2C1 is correctly initialized and configured in your code.

    I advise you to enable timeout register and use an oscilloscope or logic analyzer to monitor the I2C bus.

     

    bacnkAuthor
    Visitor II
    November 2, 2024

    I use stm32f4 discovery kit, I configure i2c 2,3 similarly but when using i2c 2,3 it is normal, but when using i2c1 I have the problem of slow response chip. I use uart to check response time

    Super User
    November 2, 2024

    Again, have you checked the board's User Manual and/or Schematics to see if there's anything else on those pins?

    ie, have you checked for conflicts on the board?

     

    Use an oscilloscope to see what's actually happening on the wires.

     

    Super User
    November 2, 2024

    > I use resistor connected to 3v3, do I need to configure pull up in the code?

    No, but the value of the external resistor matters, together with its capacitance.

    > the chip becomes unresponsive while using UART and during operation with I2C1

    Which chip? How do you know it's unresponsive?

    Do you observe the SDA/SCL signals using oscilloscope or logic analyzer (LA)?

    As @Imen.D pointed out above, there may be pins which are already used on the board. In particular, I2C1_SDA can be on pins PB7/PB9, I2C1_SCL on PB6/PB8, but note, that is on-board I2C device on PB6/PB9 (the CS43L22 audio codec) so if you use these pins, note that the on-board I2C device may interfere. See manual and schematics of the Disco board.

    JW