Skip to main content
Associate
August 11, 2024
Question

I2C3 Slave need to re-power to work

  • August 11, 2024
  • 3 replies
  • 787 views

Hi All,

I am Ketan, and I am implementing own driver for STM32F4 device. I have STM32F4-DISCO Development, everything looks fine when I2C talks on-board slave device (CS43L22) but when I2C talk to external slave, which is connected thorough Jumper wire, it seems start condition not able to generate. most of time, I switch off the external slave and switch on, then works fine. but without power off external slave, looks start condition is not able to generate. I am not suspecting driver issue, because on-board slave device address able to read.

This topic has been closed for replies.

3 replies

TDK
August 11, 2024

Some possibilities:

  • Ensure external pullups are present.
  • Ensure board is powered.
  • Ensure pins are connected correctly.
  • Ensure slave address is correct. It should be left-shifted.
  • Use a logic analyzer to see what is happening on the line.
  • If bus is interrupted mid-transaction, slave could be stuck. Toggle SCL 9 times as a GPIO to reset the bus.
"If you feel a post has answered your question, please click ""Accept as Solution""."
ketan_vdAuthor
Associate
August 11, 2024

Hi,

Thank you for reply. as I mention, external slave device also working fine but only when restart the power cycle. that means pins are connected correctly, board is powered, slave address is correct. 

I feel, I didn't connected external pullups register but instead off, I am using GPIO pullups configuration while initializing the pins.

TDK
August 12, 2024

Debug the code, figure out why it's not working, or at least how. Do HAL functions return HAL_OK? Where in the process does the code fail? Perhaps show some code. Are you respecting startup times? Do you have a logic analyzer to further debug?

> I feel, I didn't connected external pullups register but instead off, I am using GPIO pullups configuration while initializing the pins.

I can't decipher this. Does this mean external pullups in the region of 1-5 kOhm are present or not?

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