2024-11-30 09:24 PM
Hi all,
I recently purchased an STM32H723VGT6 breakout board [https://github.com/WeActStudio/WeActStudio.MiniSTM32H723] (not a NUCLEO) and a VL53L5CX sensor breakout from Pololu [https://www.pololu.com/product/3417], and, as I'm a beginner and struggling to navigate all the literature as it relates to STM32, I was wondering if anyone here could give me a step-by-step guide on what documents I need to read in order to set up this custom hardware before I design a similar setup myself with an STM32H523 instead of an STM32H723.
I've already went through the user manual, quite a few YouTube videos, and some more stuff, and I'm confused, since I can't seem to find documents on working with X-CUBE-TOF1 and custom hardware.
The main issue I have is the fact that I only want just that two pin I2C connection between the MCU and the sensor and nothing else due to the space constraints of my upcoming custom design [PB10 = SCL, PB11 = SDA]. Therefore, I have done the same in the prototype with the off-the-shelf boards I've bought. I tried setting up 'Board Part Ranging' and 'Board Support STM32Cube Custom BSP drivers', since those didn't throw up errors with the hardware configuration I had already set up, but the platform settings was giving me errors, since I selected I2C2 for the BSP, but in the 'application' section of 'Platform proposal', I didn't have PWR_EN, LPn, I2C_RST pins since they aren't in the prototype circuit I've made.
15:20:08 **** Incremental Build of configuration Debug for project H723_VL53L5CX ****
make -j24 all
arm-none-eabi-gcc "../X-CUBE-TOF1/Target/custom_ranging_sensor.c" -mcpu=cortex-m7 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32H723xx -c -I../Core/Inc -I../Drivers/STM32H7xx_HAL_Driver/Inc -I../Drivers/STM32H7xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../Drivers/CMSIS/Include -I../X-CUBE-TOF1/Target -I../Drivers/BSP/Components/vl53l7cx/modules -I../Drivers/BSP/Components/vl53l7cx/porting -I../Drivers/BSP/Components/vl53l7cx -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"X-CUBE-TOF1/Target/custom_ranging_sensor.d" -MT"X-CUBE-TOF1/Target/custom_ranging_sensor.o" --specs=nano.specs -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -o "X-CUBE-TOF1/Target/custom_ranging_sensor.o"
arm-none-eabi-gcc "../Core/Src/system_stm32h7xx.c" -mcpu=cortex-m7 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32H723xx -c -I../Core/Inc -I../Drivers/STM32H7xx_HAL_Driver/Inc -I../Drivers/STM32H7xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../Drivers/CMSIS/Include -I../X-CUBE-TOF1/Target -I../Drivers/BSP/Components/vl53l7cx/modules -I../Drivers/BSP/Components/vl53l7cx/porting -I../Drivers/BSP/Components/vl53l7cx -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/system_stm32h7xx.d" -MT"Core/Src/system_stm32h7xx.o" --specs=nano.specs -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -o "Core/Src/system_stm32h7xx.o"
../X-CUBE-TOF1/Target/custom_ranging_sensor.c: In function 'reset_device':
../X-CUBE-TOF1/Target/custom_ranging_sensor.c:475:21: error: 'CUSTOM_VL53L7CX_PWR_EN_PORT' undeclared (first use in this function); did you mean 'CUSTOM_VL53L7CX_I2C_INIT'?
475 | HAL_GPIO_WritePin(CUSTOM_VL53L7CX_PWR_EN_PORT, CUSTOM_VL53L7CX_PWR_EN_PIN, GPIO_PIN_RESET);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| CUSTOM_VL53L7CX_I2C_INIT
../X-CUBE-TOF1/Target/custom_ranging_sensor.c:475:21: note: each undeclared identifier is reported only once for each function it appears in
../X-CUBE-TOF1/Target/custom_ranging_sensor.c:475:50: error: 'CUSTOM_VL53L7CX_PWR_EN_PIN' undeclared (first use in this function); did you mean 'CUSTOM_VL53L7CX_I2C_INIT'?
475 | HAL_GPIO_WritePin(CUSTOM_VL53L7CX_PWR_EN_PORT, CUSTOM_VL53L7CX_PWR_EN_PIN, GPIO_PIN_RESET);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| CUSTOM_VL53L7CX_I2C_INIT
../X-CUBE-TOF1/Target/custom_ranging_sensor.c:479:21: error: 'CUSTOM_VL53L7CX_LPn_PORT' undeclared (first use in this function); did you mean 'CUSTOM_VL53L7CX_I2C_INIT'?
479 | HAL_GPIO_WritePin(CUSTOM_VL53L7CX_LPn_PORT, CUSTOM_VL53L7CX_LPn_PIN, GPIO_PIN_RESET);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| CUSTOM_VL53L7CX_I2C_INIT
../X-CUBE-TOF1/Target/custom_ranging_sensor.c:479:47: error: 'CUSTOM_VL53L7CX_LPn_PIN' undeclared (first use in this function); did you mean 'CUSTOM_VL53L7CX_I2C_INIT'?
479 | HAL_GPIO_WritePin(CUSTOM_VL53L7CX_LPn_PORT, CUSTOM_VL53L7CX_LPn_PIN, GPIO_PIN_RESET);
| ^~~~~~~~~~~~~~~~~~~~~~~
| CUSTOM_VL53L7CX_I2C_INIT
make: *** [X-CUBE-TOF1/Target/subdir.mk:19: X-CUBE-TOF1/Target/custom_ranging_sensor.o] Error 1
make: *** Waiting for unfinished jobs....
"make -j24 all" terminated with exit code 2. Build might be incomplete.
15:20:09 Build Failed. 6 errors, 0 warnings. (took 1s.31ms)
Also, if there's any other literature you could recommend as it relates to using data interfaces like I2C, SPI, I3C, etc, with sensors, PMICs, even other MCUs, I would really appreciate it. Currently, my software knowledge lags so far behind my hardware and PCB design knowledge right now that I am limiting my ability to use smarter chips with STM32 which require I2C configuration because I'm hesitant on having to write the drivers and stuff by myself. With Arduino and ESP32, I was so used to being spoon-fed with easy-to-use libraries and not even seeing all the HAL stuff, so starting to move into STM32 I felt was a great way to fill this gap in my knowledge while learning how to optimise for better performance, power consumption, etc.
Thank you so much, all help is appreciated.