2025-02-23 9:55 PM
Hello, I am having trouble with the VL53L4CX Sensor for my Capstone Design Project. My group created our own breakout board for the sensor, and I was able to get it up and running with the VL53L4CX_SimpleRanging project provided by ST.
However, I am having trouble figuring out the setup for our own project. Here's my steps to get to my problem:
This code compiles and I enter debug mode. However, when I click run, it immediately stops and I see this HardFault_Handler() as shown below:
This is where I am stuck. I've provided some files/screenshots that may help, including the breakout board design. Please feel free to ask for further information if needed. Any help is much appreciated, thank you so much.
Additional Screenshots:
Schematic for VL53L4CX Breakout Board.
PCB Design for VL53L4CX Breakout Board.
X-CUBE-TOF1 setup and MCU pinout.
Physical Setup with Nucleo and Breakout Board.
2025-02-23 10:32 PM
> This code compiles and I enter debug mode. However, when I click run, it immediately stops and I see this HardFault_Handler() as shown below: ...
The window on the left side in this image is the call trace.
Which seems to indicate something is missing with the timer / delay implementation.
2025-02-23 11:37 PM
Thanks for giving me a lead, although I'm not sure what my next steps are since the example project does not have any timers enabled. Also, I forgot to provide this is the debugger console error that I receive:
2025-02-24 1:11 AM
You are using Cube / HAL, which uses the Systick timer for delay purposes by default.
One of the reasons for me to not use Cube / HAL.
> ... and I was able to get it up and running with the VL53L4CX_SimpleRanging project provided by ST.
You can compare the code of your current project with this one, especially the sensor startup phase and the related timing.
Perhaps setting a breakpoint in the systick handler.