Question
BLE timeout when using I2C1
STM32WB55 - dongle
I’m trying to send I2C data over BLE. The dongle board only has I2C1 exposed but whenever I try to use I2C1 I get a BLE time out error. If I change to I2C3, which is not connected to anything, I get no time out error & get a whole load of 0’s as expected. Also when I send dummy data with no I2C at all the BLE works as expected.
I looked at what I thought were similar problems on here but so far the proposed solutions haven’t had any effect in the behaviour.
Additional info, this code worked fine on the P-NUCLEO-WB55 board.
I2C_HandleTypeDef hi2c1;
I2C_HandleTypeDef hi2c3;
// Timeouts when I use hi2c1 as below but send expected 0's when using hi2c3
/* ADT7410 set up */
/* temp_0 at 0x48
* temp_1 at 0x49 */
temp_0.adti2c = &hi2c1; // I2C Handler
ADT7410_Init(&temp_0, 0x48); // I2C address depends of A0 and A1 pins
ADT7410_Reset(&temp_0); // Optional
ADT7410_SetResolution(&temp_0, ADT7410_16BITS); // Put the device in 16 bits resolution
temp_1.adti2c = &hi2c1; // I2C Handler
ADT7410_Init(&temp_1, 0x49); // I2C address depends of A0 and A1 pins
ADT7410_Reset(&temp_1); // Optional
ADT7410_SetResolution(&temp_1, ADT7410_16BITS); // Put the device in 16 bits resolution
/* ADXL345 set up
* acc_0 at 0x1D, write 0x3A, read 0x3B
* acc_1 at 0x53, write 0xA6, read 0xA7
*/
acc_0.adxl345i2c = &hi2c1; // I2C handler - might have to change this
acc_1.adxl345i2c = &hi2c1; // ~CS needs to be tied to Vdd for I2C comms
ADXL345_Init(&acc_0, 0x1D, 0x3A, 0x3B); // ALT_ADDRESS tied to Vdd
ADXL345_Init(&acc_1, 0x53, 0xA6, 0xA7); // ALT_ADDRESS tied to GND
