Hi,
From your photo, there are no pull up resistance of SCL and SDA line, please refer to bma253 datesheet to get the connection diagram of I2C.
Maybe, you could try config SCL(PB10) and SDA(PB11) of STM32L051 internal pull up, meanwhile in I2C mode.
Best regards.
... View more