2026-01-26 10:08 AM
Hi,
I have NUCLEO-U083RC-B01. I attached X-NUCLEO-IKS5A1 to it. All jumpers are in default positions.
In STM32CubeMX I enabled I2C1 with default values. In the main program I am trying to check the device readiness for MEMS sensors on the X-NUCLEO-IKS5A1, e.g, ISM330IS. HAL_I2C_IsDeviceReady returns HAL_ERROR.
I tried to set the I2C1 GPIO configuration Pull-up but no success. The I2C Speed Mode is standard. I check the readiness by:
HAL_StatusTypeDef status = HAL_I2C_IsDeviceReady(&hi2c1, ISM330IS_I2C_ADD_H, 3, 100);
I am attaching my main file.
Thank you in advance.
2026-01-26 5:16 PM
I don't see your define for ISM330IS_I2C_ADD_H. Did you left shift the slave address by 1? Did you check with oscilloscope to see if there is data activity?
2026-01-27 9:35 AM
The datasheet of the sensor says 0b1101010 and 0b1101011. On the X-NUCLEO-IKS5A1 the jumper setting is such that SA0=1. After the left shift and adding 1 bit for "read" i get 0xD7U which is ISM330IS_I2C_ADD_H.
I tried both ISM330IS_I2C_ADD_L and ISM330IS_I2C_ADD_H. None of them works.
I am an amateur engineer. I have never used oscilloscope before. I will try next week after familiarizing with the user manual.
Below is the extract from the datasheet and the header file with the macro definition.
2026-01-27 10:09 AM
You don't add the read bit after shifting. The HAL driver will add the read bit when needed.
Your define values should be 0xD4 and 0xD6.
If that doesn't work, then you'll need an oscilloscope/logic analyzer to see what is happening on the bus
2026-02-08 7:39 AM
The issue was the I2C1 wiring. STM32CubeMX sets PA8 and PA9. But according the Nucleo-U083RC it should be PB8 and PB9. After modification it works now.