Resolving I2C Timeout Error When Updating STM32G4 Firmware with ESP32
Hi guys i'm trying to use an ESP32 to update the firmware on an STM32G4 over I2C, but I'm getting an
I2C timeout
error when trying to initiate the update. I've connected the SDA and SCL pins, and I'm controlling the BOOT0 and RESET pins on the STM32G4. My ESP32 is running a custom Arduino sketch for I2C communication, and the STM32G4 has a minimal bootloader expecting I2C programming mode.
ESP32 I2C Connection Code :
I expect the ESP32 to connect to the STM32G4, enter programming mode, and update the firmware. Instead, I get the I2C timeout
error. Any advice on how to resolve this issue would be greatly appreciated.3 Replies
Check your wiring and your pull up resistors
The SDA data line on ESP32 should be connected to SDA on STM32G4
SCL clock Line on ESP32 should be connected to SCL on STM32G4
BOOT0 and RESET should be controlled properly to put the STM32G4 in bootloader mode
Even the pull up resistors , I2C needs pull up resistors mainly about like 4.7kohms or 10kohms on both SDA and SCL lines. If these resistors are missing, I2C communication can fail normally
I'll double-check the wiring and add 4.7kΩ pull-up resistors to both the SDA and SCL lines, as I hadn’t included them initially. Then make sure that BOOT0 and RESET are correctly toggled to put the STM32G4 into bootloader mode.
I'll update if anything goes wrong Thanks again for pointing that out 🙏
Yh lets see if the issue still persists after that