Hi,
I saw at the latest firmware release that the Vl53L8Cx is now supported. But I didn’t understand how can I connect the .C library to the MicroPython Code.
I’ve downloaded the latest firmware (Dev version) and updated my OpenMv.
Would appreciate any assitance on the subject.
Thanks,
Naty
It hasn’t been tested yet so it’s not enabled for stm32 port. To enable it for a board, you should just need to add this to the board config file:
#define OMV_TOF_VL53L8CX_ENABLE (1)
But like I said, it’s not compiled for stm32 port yet.
Thansk for the prompt response!
Once I’ve done that and reflashed the OpenMv.
What’s the next step? How do I read it in the MicroPy script?
What do I need to import to gain access to the TOF API?
There are examples in the IDE and here
Thanks!
I tried the example but the TOF import didn’t work.
Then I realized that the TOF didn’t even compile.
I’ve needed to add a few things in order for it to compile the new driver (Please let me know if it makes sense)
in omv_boardconfig.h
#define OMV_TOF_VL53L8CX_ENABLE (1)
#define MICROPY_PY_TOF (1)
And then I got issues with missing defines so I’ve added that to py_tof.c:
#define OMV_TOF_I2C_ID 0x29
#define OMV_TOF_I2C_SPEED 400000
Then I needed to add the driver DIR to the omv_portconfig.mk for it to find the headers.
After all of that I’ve encountred the real problem that there wasn’t enough memory.
/source/gcc/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /source/src/build/bin/firmware.elf section `.text' will not fit in region `FLASH_TEXT'
/source/gcc/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /source/src/build/bin/firmware.elf section `.gc.block0' will not fit in region `SRAM1'
make[1]: Leaving directory '/source/src/omv/ports/stm32/uvc'
/source/gcc/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: section .dma.memory0 VMA [30040000,30043fff] overlaps section .gc.block0 VMA [300045c0,300401bf]
/source/gcc/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: region `SRAM1' overflowed by 448 bytes
/source/gcc/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: region `FLASH_TEXT' overflowed by 17452 bytes
Memory region Used Size Region Size %age Used
DTCM: 0 GB 128 KB 0.00%
ITCM: 64 KB 64 KB 100.00%
SRAM0: 496 KB 512 KB 96.88%
SRAM1: 262592 B 256 KB 100.17%
SRAM3: 16 KB 32 KB 50.00%
SRAM4: 38 KB 64 KB 59.38%
DRAM: 32 MB 32 MB 100.00%
FLASH_FFS: 0 GB 128 KB 0.00%
FLASH_TEXT: 1852460 B 1792 KB 100.95%
collect2: error: ld returned 1 exit status
make: *** [/source/src/omv/ports/stm32/omv_portconfig.mk:759: firmware] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory '/source/src'
exit status 2
FATA[0253] exit status 2
Did i do anything wrong? I’ve got a feeling that the 4P just doesn’t have enough memory to cope with the large buffer file?
Yes, those changes are wrong. As I’ve mentioned the driver hasn’t been tested yet, so I didn’t add it to any Makefiles. Also, as you’ve noticed the driver has a large firmware blob that will overflow the flash for some boards. I’ll be freeing some flash memory for all boards soon, so I’ll consider enabling it by default, or at least making it easier to enable.