ESP32 with STM32 on IIC won't work unless USB is plugged in

I made a PCB to have the ESP32C2 connected to multiple(4, actually) STM32 Bluepills which are capturing sensors datas. All MCUs are programmed by Arduino IDE with ESP32C3 for Arduino and STM32Arduino. They are also connected to an IIC bus with CLOCK set to 1000000, the problem is ... I forgot to add a pullup to all the MCUs (It's a shame, I know...). However, i managed to make the ESP32C3 commuicate with all the the STM32s without any error, and the whole set works prefectly while I have the ESP32C3 connected to my PC by USB, printing through the USB serial output to monitor the process of IIC discovery and communication. The set is powered by a LM7805 module with 1.2A power supply and the power consumption is estimated to be lower than 1A. The USB wire also got a ADuM3160 seperator between the board and the PC.
Surprisingly, when i disconnected the USB, all IIC crashed. The ESP32C3 couldn't find the STM32s via IIC and no data was transfered to the ESP32C3.
I have been suspecting that it might be due to the insuffcient power supply, so i connect the USB to a 2A charger. Nothing changed. Remove the ADuM3160 module also made no change.
So my question is: is it the issue about the IIC pullup? Can i just add pullup to the ESP32C3 SCL and SDA instead of adding every STM32 IIC pullups?
Appreciated for any suggestiong.

You must have a pullup but you only need one.

Good news, that means I can just add pullup to the ESP32C3 board.
You have my gratitude ! Thanks a lot !

Besides the missing pullup you may have other problems with the design

that's what I am worrying about. It's really strange that the problem is related to the USB

this is my schematics, with two boards, the first one are the STM32s and the Hall effect sensors


the seconed is the board to contain ESP32C3 and Arduino Mega 2560
1701615392792

How many volts are you supplying to the LM7805 module?

12V input and 5V output to the board, there're also internal LDOs on the ESP32C3 and the bluepills

I did measure the voltage between the SCL/SDA and ground, which is 3.0~3.1V (without pullup)

Is the voltage input to he LM7805 greater than 7V?

Why did you use LDO to 5v, if all of your boards has 3.3v logic?
Please measure voltage on 5v pins on each board when USB is connected and then when it is not.

Yep, its a 12V power, does it matter? Shall i change to some other supply?

WOW, that might be a hint. I used 5V because the sensors need a 5V power. I just noticed that all the boards(stm32, esp32) have their own LDO. I will have it measure. Thanks a lot!

That't fine, just checking.

I checked the voltages, seems all power supplies are normal:
for the STM32
Power 5V, SCL 3.3, SDA 3.3
ESP32
Power 5V, SCL 3.3, SDA 3.3

i checked, but nothing changed. Whether or not the USB is connected, the SCL and SDA are 3.3V all the same on both STM32 and ESP32. Quite confusing

updated:
my measurement showed that there's a 10K resistor between 3.3V and SCL/SDA on the ESP32 board (when power off), is it some kind of internal pullup?
also, i catched the IIC error occasionally, the wire library give me an code 5 error, which is a timeout error.

Some ESP boards do have pullup resistors
I'm not sure if I can be of any further assistance.
There is obviously something wrong with the way you are supplying 5V to all the boards but what I don't know.

Thanks for your concerning , i think i have figure it out: it's all about insufficient power supply. I tested the whole set with my friend's device and found out that the power consumption is around 400~500mA, my power supply module didn't generate sufficient power for it. Once i didn't connect the USB and the IIC worked, generating signals with numeric peaks. Seems the extra power supply from USB activated the set. I am switching to a 3A DC-DC.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.