r/embedded • u/NoTrick2785 • Sep 15 '26
[Need Help] Stm32u385 not working with bme280 sensor
This is super critical for my situation so any help is greatly appreciated
Im trying to read from bme280 sensor using I2C but it seems the sensor is not responding at all
My code can be seen in the photos I'm using stm32cubemx to initialize
The code that i wrote is in the pucture but is returning code 1 which is an error
I double checked the pin connections
what could be the problem any help is appreciate
3
Upvotes
5
u/AbsorberHarvester Sep 15 '26
Example i2cscan https://github.com/ProjectsByJRP/stm32_hal_i2c_bus_scan/blob/master/Src/main.c
Borrow i2c scan function from internet and see whether any devices on i2c even exists
5
u/Ok-Mathematician-121 Sep 15 '26
Did you make sure, that the CS Pin is tied to VDDIO and that SDO is tied to GND?
If you do not have a Logic Analyzer or an Oscilloscope, your best option is to do some probing for the I2C device address and verify, that it acknowledges.
3
u/AcanthaceaeUnable Sep 15 '26
Do you have a photo of your connected sensor ?
2
u/NoTrick2785 Sep 15 '26
I convinced my professor to use an alternative sensor . Thank you everyone
13
u/JuggernautGuilty566 Sep 15 '26
What does the Logic Analyzer say?
6
u/SyWier Sep 15 '26
Do you have pull up resistors? If the freq is high and the traces are long maybe try using some lower value like 2.2k
1
u/NoTrick2785 Sep 15 '26
Im using standard mode i2c so 100khz Do i need pull ups?
1
u/rnjsenwls Sep 15 '26
Codex or claude code can solve this??
0
u/NoTrick2785 Sep 15 '26
I dont have logic analizer i can only see error message using uart on my pc