2022-03-28 11:17 AM
I have a problem when I try to run the Example for NUCLEO-F401RE. I'm using a NUCLEO-F401RE and SATEL-VL53L5CX. For the connection, I'm following the main.h, here are presents all the pins useful to manage the sensors. I noticed that the I2C_RST pin is not configured in the MX_GPIO_INIT function. Can someone help me to understand why the application does not work?
2022-03-29 07:09 AM
That's very strange - works for me.
But it appears I was using the 1.2.0 version and there appears to be a 1.3.0 version
I downloaded the 1.3.0 version, and unzipped it.
Navigated to:
C:\...\VL53L5CX_ULD_driver_1.3.0\CubeIDE_F401RE_Example
clicked on the .cproject file, and up came the STM32CubeIDE.
I gave it a new workspace. (I've seen people with many workspaces - but use one per project.)
I selected the project, by clicking on VL53L5CS_Example_F401RE and hit the build icon.
I then hit the green 'run' triangle and it re-built. downloaded the code, and ran.
I use Tera Term and set the baud to 460800 and found the terminal:
STMicroelectronics STLink Virtual Com Port (Com29)
And I found it running.
I changed nothing,
Although I do this all the time and there could be a setting on my computer that I got elsewhere.
What was you exact procedure?
2022-03-29 09:59 AM
Thank you John,
this is my procedure (I donìt use any X-NUCLEO, I use directly the breakout board)
1) I downloaded the 1.3.0 version, and I unzipped it inside C: to avoid too long path
2) I opened the file .project in this path C:\ST\en.VL53L5CX_ULD_v1.3.0\VL53L5CX_ULD_driver_1.3.0\CubeIDE_F401RE_Example
3) I selected the project and I clicked on the build icon
4) I realized the connections by following the main.h
5) I connected the NUCLEO-F401RE to my PC with a USB cable
6) I opened TeraTerm and I set the baud to 460800 and found the terminal: STMicroelectronics STLink Virtual Com Port (Com29)
7) I Dragged and dropped the .bin in the debug folder
I cannot see anything in the terminal.
If I remove the connections I can see that in the Terminal is printed "VL53L5CXV0 not detected at requested address (0x52)
If I establish the connections I cannot see anything again. I noticed that the LD1 continuously blink green and red light when all the connections are present, the blink does not occur when the connections are removed.
2022-03-29 10:03 AM
I used the same procedure for the example in the CUSTOM folder of the X-CUBE-TOF1 package, I changed the connections according to the pin allocated in this other application and I saw that the it works, but I prefer to use the previous application since here I can study better the APIs flows to perform measurements with the VL53L5CX
2022-03-29 10:20 AM
Dragging and dropping that bin works for me. But I do use the expansion board. Perhaps that expansion board is doing something to the sensor that you are not doing. Like a pullup somewhere.
AVDD should not be 5V. That's a 3v3 pin. I'm guessing the expansion board has a regulator somewhere.
Change that pin to 3v3.
PWR_EN turns on the voltage regulator, that is not a sensor pin.
good luck,
2022-03-29 10:40 AM
I think that I can use +5V for AVDD since I'm using the complete breakout board, not the mini PCB. But reading better the documentation, in particular the AN5717 I saw that there is a note regarding the flying lead connections:
"Two additional pull up resistors to I2C lines are required. The resistors value can be in the range of [2.2K to 4.7K]"
I thought that the pull up configuration in CubeMx is enough, but maybe I have to add also two pull up resistors. I have to check, since how I said before I tested the flying lead connections with the CUSTOM example in the X-CUBE-TOF1 package, which works without further pull-up resistor.
Thank you very much for your suggestion and for your valuable support! I will update you in this post.
Vincenzo
2022-03-29 01:03 PM
Ah, the famous I2C issues. The amount of pull-up required is related to the capacitance of the line, the number of devices on the bus and how fast you want go. NXP (who bought Philips) still has the most information on how to tune an I2C bus. And if you get it wrong, the bus still works - sometimes.
To get it to work reliably is a real trick, and one has to think about it.
good luck.
2022-05-19 03:46 AM
Hello,
I use the driver "VL53L5CX_ULD_driver_1.3.1" and compiled the "CubeIDE_F401RE_Example" without any problems.
Then I pressed Debug and the code was flashed to my Nucleo Board. But when I let it RUN, I get the message "VL53L5CXV0 not detected at requested address (0x52)" printed on my terminal program.
When I end the debug session and press the reset button the firmware starts up without problems and prints the distances to my terminal.
So, what is the problem with debugging the firmware? I just imported the unzipped project into my workspace and made no other changes.
Every time I start the firmware with the debugger, I run into the HardFault_Handler()
Has anyone a solution for this problem or encountered the same problem?