cancel
Showing results for 
Search instead for 
Did you mean: 

X NUCLEO 53L7A1 with I2C COMMUNICATION

Freedy
Associate II

Edit by ST Moderator: This post has been translated from French to comply with the ST Community Terms and Conditions (§10.2).

Hello to the ST community
I have a problem with my X NUCLEO 53L7A1. I want to use it with a NUCLEO F401RE for intelligent presence detection but I can't manage it after several attempts.

Here is the output I have in my serial monitor:

I2C initialised at 100 kHz
I2C state after init :
- SCL (PB8) : HIGH
- SDA (PB9): HIGH
Program started!
Initialisation X-NUCLEO-53L7A1...
- I2C address: 0x29
- VDDIO (PB0): HIGH
- LPn (PA10) : HIGH
- SCL (PB8): HIGH
- SDA (PB9): HIGH
Note: Check J9 (2-3) for I2C mode
Sensor reset...
I2C scan in progress...
I2C device detected at address: 0x29
I2C scan complete.
I2C status before test: 32
Sensor detected at 0x29!
Manual reading of register 0x00F0...
Value read from register 0x00F0: 0x00

Enclosed is my main.c

2 REPLIES 2
John E KVAM
ST Employee

Looks like you are on the right track. I'd suggest using a 400KHz i2C bus, as the sensor does send a lot of data. 

But you stopped just short of the critical question... What is the result of your call to:

status = vl53l7cx_init(&Dev);

If you can 'see' the device at address 0x29, you should be able to call this function. 

It sure looks like you are running on some variant of an STM32. That means you don't have a byteswap issue. (This is the most common I2C failure.)

I'd comment out your demand that the SensorID be 0xF0. 

In our code, I see:

	status = vl53l5_read_multi(&L5Dev.dev, 0x00, &device_id, 1);
	status = vl53l5_read_multi(&L5Dev.dev, 0x01, &revision_id, 1);
	uart_printf("Sensor Dev ID: %d, Rev: %d\n",device_id,revision_id );

 in your code you appear to be reading 0x7fff and expecting the device ID.

0x7fff is an interesting register. It has two purposes; It's the last byte of the firmware download and it's the 'go' byte. Writing to this byte is going to try to start the program and you have not downloaded the code yet. 

Remove that bit of code and see what happens. 

(Perhaps some of my French collogues can chime in. My French is sorely lacking here.)

- john

 


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.

I've taken your recommendations into account, but here's what I still got in my serial monitor output:
I2C scan completed.
I2C status before test: 32
Sensor detected at 0x29!
Reading sensor ID...
Device ID: 0xF0 (expected: 0xF0 for VL53L7CX)
Revision ID: 0x02
Attempting to initialize VL53L7CX...
VL53L7CX Init failed: 1
Sensor initialization failed.
Sensor initialization failed.
Sensor initialization failed.
Sensor initialization failed.