2021-09-02 09:18 PM
Hi - I can't seem to get the driver to compile on a RPi 3+..
Grateful for any assistance !!
This is the error message I get:
pi@raspberrypi:~/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx $ make VL53LX_FULL_KERNEL=1
CONFIG_STMVL53LX=m make -C /lib/modules/`uname -r`/build M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-5.10.17-v7+'
CC [M] /home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx_module.o
In file included from /home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx_module.c:49:
/home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx.h:208:17: error: field ‘start_tv’ has incomplete type
struct timeval start_tv;/*!< stream start time */
^~~~~~~~
/home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx.h:240:18: error: field ‘start_tv’ has incomplete type
struct timeval start_tv;
^~~~~~~~
/home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx.h:241:18: error: field ‘comp_tv’ has incomplete type
struct timeval comp_tv;
^~~~~~~
/home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx_module.c: In function ‘st_gettimeofday’:
/home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx_module.c:103:4: error: dereferencing pointer to incomplete type ‘struct timeval’
tv->tv_sec = now.tv_sec;
^~
/home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx_module.c: In function ‘stmvl53lx_intr_process’:
/home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx_module.c:2414:17: error: storage size of ‘tv_now’ isn’t known
struct timeval tv_now;
^~~~~~
/home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx_module.c:2414:17: warning: unused variable ‘tv_now’ [-Wunused-variable]
/home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx_module.c: In function ‘stmvl53lx_input_push_data_multiobject’:
/home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx_module.c:2508:17: error: storage size of ‘tv’ isn’t known
struct timeval tv;
^~
/home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx_module.c:2508:17: warning: unused variable ‘tv’ [-Wunused-variable]
make[2]: *** [scripts/Makefile.build:279: /home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx/stmvl53lx_module.o] Error 1
make[1]: *** [Makefile:1804: /home/pi/VL53L3CX_LinuxDriver_1.0.5_bare_1.2.4/driver/vl53Lx] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.17-v7+'
make: *** [Makefile:8: default] Error 2
Solved! Go to Solution.
2021-09-20 07:58 AM
Well it sure looks like you were right.
And it took my team a bit to solve it.
They had to rework a bit the deprecated timeval structure to make it work in both old kernel and 5.10.X
I2c_new_device function has been deprecated too, the modified files use i2c_new_client_device
Future releases will include these changes
2021-09-07 10:49 AM
Something is really odd. I downloaded a fresh copy of STSW_IMG0021 and looked for start_tv.
it's not in there. Nor are there any instances of "_tv".
So I'm very confused.
I might consider starting over with a fresh download.
2021-09-07 03:03 PM
Hi John, thanks I did as you suggested but still have the same error. As per the error messages - most of these reference can be found in stmvl53l.h
2021-09-08 09:41 AM
Seems there is a known problem compiling struct timeval with 5.x kernels:
https://github.com/draios/sysdig/issues/1609
I'm going to investigate what to do about it. I have not run across this before.
2021-09-20 07:58 AM
Well it sure looks like you were right.
And it took my team a bit to solve it.
They had to rework a bit the deprecated timeval structure to make it work in both old kernel and 5.10.X
I2c_new_device function has been deprecated too, the modified files use i2c_new_client_device
Future releases will include these changes
2021-09-20 02:47 PM
Awesome - thanks for the support!