Hi
I see you are using a GPIO simulated I2C, please check you I2C function well.
Below are the codes for I2C read/write function check:
uint8_t byteData;
uint16_t wordData;
uint32_t DwordData;
uint8_t test_buffer_write[4]={0x5A,0xA5,0XAA,0x55};
uint8_t test_buffer_read[4];
VL53L1_RdByte(Dev, 0x010F, &byteData);
printf("VL53L1X Model_ID: %02X\n\r", byteData);
VL53L1_RdByte(Dev, 0x0110, &byteData);
printf("VL53L1X Module_Type: %02X\n\r", byteData);
VL53L1_RdWord(Dev, 0x010F, &wordData);
printf("VL53L1X: %02X\n\r", wordData);
VL53L1_WrWord(Dev, 0x0016, 0x5AA5);
VL53L1_RdWord(Dev, 0x0016, &wordData);
printf("Write 0x5AA5, read value: %02X\n\r", wordData);
VL53L1_WrDWord(Dev, 0x0016, 0x5AA5AA55);
VL53L1_RdDWord(Dev, 0x0016, &DwordData);
printf("Write 0x5AA5AA55, read value: %02X\n\r", DwordData);
VL53L1_WriteMulti(Dev, 0x0016, test_buffer_write,4);
VL53L1_ReadMulti(Dev, 0x0016, test_buffer_read,4);
printf("WriteMulti 4 byte: 0x5AA5AA55\n\r");
printf("ReadMulti 0: %02X\n\r", test_buffer_read[0]);
printf("ReadMulti 1: %02X\n\r", test_buffer_read[1]);
printf("ReadMulti 2: %02X\n\r", test_buffer_read[2]);
printf("ReadMulti 3: %02X\n\r", test_buffer_read[3]);
Log list as below from Nucleo:
VL53L1X Model_ID: EA
VL53L1X Module_Type: CC
VL53L1X: EACC
Write 0x5AA5, read value: 5AA5
Write 0x5AA5AA55, read value: 5AA5AA55
WriteMulti 4 byte: 0x5AA5AA55
ReadMulti 0: 5A
ReadMulti 1: A5
ReadMulti 2: AA
ReadMulti 3: 55
Br
Zhiyuan.Han
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.