i2c SDA and SCL stuck in 0 state
Posted: Thu Jun 20, 2019 12:17 pm
Hello,
I would like to connect my nucleo F446RE to an external imu sensor using i2c driver 1.
I have set the pins with the required pal mode and connected them to an logic analyzer.
After calling the two function below:
palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN); /* SCL */
palSetPadMode(GPIOB, 9, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN); /* SDA */
the pins goes to 0 and remain like this forever. I have no signal going on the i2c bus after doing:
The result of i2cErr is 0. Anyone has an idea why I cannot see anything on the bus ?
I also tried driver 2 without success. The serial driver 2 is working and I can send log to my computer.
Greetings,
Lyris
I would like to connect my nucleo F446RE to an external imu sensor using i2c driver 1.
I have set the pins with the required pal mode and connected them to an logic analyzer.
After calling the two function below:
palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN); /* SCL */
palSetPadMode(GPIOB, 9, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN); /* SDA */
the pins goes to 0 and remain like this forever. I have no signal going on the i2c bus after doing:
Code: Select all
i2cStart(&I2CD1, &i2ccfg);
i2cAcquireBus(&I2CD1);
result = i2cMasterTransmitTimeout(&I2CD1,
LSM9DS1_AG,
tx_buf,
sizeof(tx_buf),
rx_buff,
count,
LSM9DS1_COMMUNICATION_TIMEOUT);
i2cReleaseBus(&I2CD1);
i2cErr = i2cGetErrors(&I2CD1);
i2cStop(&I2CD1);
The result of i2cErr is 0. Anyone has an idea why I cannot see anything on the bus ?
I also tried driver 2 without success. The serial driver 2 is working and I can send log to my computer.
Greetings,
Lyris