2026-04-17 1:00 AM - last edited on 2026-04-17 2:13 AM by mƎALLEm
Hello,
I am experiencing an I²C communication issue between my MPU6050 sensor and an STM32F429I-DISC1 board. The sensor is properly powered at 3.3 V, and I have already verified its operation with an ESP32 board (communication is successful). However, with the STM32, no communication is established.
Actions performed:
Observed behavior:
Blocking point: The same sensor, using the same basic I²C code, works perfectly on the ESP32. Therefore, the sensor is not the cause. The issue appears to be related to the I²C configuration on the STM32 or a hardware detail.
Question: Has anyone encountered this behavior with an MPU6050 on STM32? Are there specific parameters to configure in the I²C interface (timing, clock stretching, or others)? Could there be an initialization sequence issue?
Thank you in advance for your assistance.
-----------------------------------------------------------------------------------------------------------------
Bonjour à tous,
Je rencontre un problème de communication I2C entre mon capteur MPU6050 et une carte STM32F429I-DISC1. Le capteur est correctement alimenté (3,3V), et j’ai déjà vérifié son bon fonctionnement avec une carte ESP32 (communication OK). Cependant, avec la STM32, aucune communication n’est établie.
Ce que j’ai fait :
Configuration de l’I2C1 sur la STM32 (essai en mode Fast Mode (400 kHz) et aussi en Standard Mode (100 kHz))
Adresse du MPU6050 vérifiée (0x68 par défaut, broche AD0 à GND)
Pull-ups externes ? (j’ai essayé avec et sans résistances de 4,7 kΩ sur SCL et SDA)
Vérification des connexions physiques (SCL → PB6, SDA → PB7 pour I2C1 sur ma carte)
Il y a aussi la configuration de l'écran LCD
Ce que j’observe :
Le scan I2C ne trouve aucune adresse
Ce qui me bloque :
Le même capteur, avec le même code I2C de base, fonctionne parfaitement sur ESP32. Donc le capteur n’est pas en cause. Le problème semble venir de la configuration I2C de la STM32 ou d’un détail matériel .
Question :
Avez-vous déjà rencontré ce genre de comportement avec un MPU6050 sur STM32 ? Y a-t-il des paramètres spécifiques à configurer dans l’I2C (timing, clock stretching, ou autre) ? Peut-être un problème de séquence d’initialisation ?
Merci d’avance pour votre aide !
------
Post Edited by ST moderator to apply source code formatting and translate from Frensh to English to comply with the community rule.
Best regards,
Gyessine
2026-04-17 2:17 AM
Hello,
Hard to tell what the problem is ..
-> you should definitely have 4.7k on SCL/SDA lines
You need to check what is going-on on the I2C lines with an oscilloscope or a logic analyzer otherwise you cannot go further ..
2026-04-17 2:22 AM
> Le scan I2C ne trouve aucune adresse
Probably because the STM32 driver and ESP have different format of I2C address. For STM32 the address should be shifted left: the MSB of the address is bit #7, and bit #0 is read/write flag.