Skip to main content
Visitor II
December 31, 2024
Solved

VL53L8CX Platform Integration with ChibiOS

  • December 31, 2024
  • 1 reply
  • 507 views

Hi, I am trying to integrate the VL53L8CX ULD driver with a project that utilizes chibios on an F4 based board.
The TOF sensor firmware seems to be about 86KB. For a transfer of this size, the device fails to setup and use DMA-safe bouncebuffers. I cannot get it to transfer more than 9865 bytes at once. Can the VL53L8CX_WrMulti(...) calls be broken down into smaller chunks as a work around? If I understand correctly, this is using the auto increment feature of the I2C bus. So to further break the VL53L8CX_WrMulti(...) calls, I will have to ensure the address for each call is sent appropriately. So will this work?
//in vl53l8cx_init(...)
status |= VL53L8CX_WrMulti(&(p_dev->platform),0,(uint8_t*)&VL53L8CX_FIRMWARE[0],0x2000);
status |= VL53L8CX_WrMulti(&(p_dev->platform),0x2000,(uint8_t*)&VL53L8CX_FIRMWARE[0x2000],0x2000);
status |= VL53L8CX_WrMulti(&(p_dev->platform),0x4000,(uint8_t*)&VL53L8CX_FIRMWARE[0x4000],0x2000);
status |= VL53L8CX_WrMulti(&(p_dev->platform),0x6000,(uint8_t*)&VL53L8CX_FIRMWARE[0x6000],0x2000);

Instead of
status |= VL53L8CX_WrMulti(&(p_dev->platform),0,(uint8_t*)&VL53L8CX_FIRMWARE[0],0x8000);

Also, what is the purpose of the register with address 0x7fff?

TIA

Best answer by John E KVAM

That is exactly what you have to do if you cannot write a huge I2C transaction in one go. 

And the 0x7fff is a page register. Unless it's the last write of a long transaction in which case it a 'go' command. 

- john

1 reply

John E KVAM
John E KVAMBest answer
ST Employee
January 2, 2025

That is exactly what you have to do if you cannot write a huge I2C transaction in one go. 

And the 0x7fff is a page register. Unless it's the last write of a long transaction in which case it a 'go' command. 

- john