cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot load Firmware to VL53L5CX

LCord.1
Associate III

With the following code the VL53L5CX should get it's firmware uploaded.

"   /* Download FW into VL53L5 */

   status |= WrByte(&(p_dev->platform), 0x7fff, 0x09);

   status |= WrMulti(&(p_dev->platform),0,

           (uint8_t*)&VL53L5CX_FIRMWARE[0],0x8000);

   status |= WrByte(&(p_dev->platform), 0x7fff, 0x0a);

   status |= WrMulti(&(p_dev->platform),0,

           (uint8_t*)&VL53L5CX_FIRMWARE[0x8000],0x8000);

   status |= WrByte(&(p_dev->platform), 0x7fff, 0x0b);

   status |= WrMulti(&(p_dev->platform),0,

           (uint8_t*)&VL53L5CX_FIRMWARE[0x10000],0x5000);

   status |= WrByte(&(p_dev->platform), 0x7fff, 0x01);

"

 (code is from https://github.com/simondlevy/VL53L5 for arduino)

I get an Error saying failed to write 0x8000 bytes to 0x00. (see line 3)

So not even the first byte of the firmware gets transmitted, why is that so?

Thanks for any answers or pointers

Lucordes

PS the firmware is 86020 bytes why would it only write 0x8000(32768 decimal) bytes?

4 REPLIES 4
John E KVAM
ST Employee

Some MCUs have a limit to the number of bytes they can write in one go. I'm going to guess you are exceeding that limit by a lot.

Some MCUS are limited to 16, 64 or 128 bytes per write.

The trick is to re-write the function to do the transmission in chunks of the correct size.

  • john

If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
EXUE.2
ST Employee

it is write 0x8000(32768 decimal) bytes one time, write 3 times can cover 86020 bytes .

John E KVAM
ST Employee

If you have known working code and the I2C write will not complete, there are only a couple of failure modes.

Either the Power is not correct, or the I2C is not on.

So double check the power to make sure it's correct and double check pin A1 (I2C reset is grounded).

With proper power and the I2C grounded the sensor should come up with it's bootloader running.

  • john

If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
LCord.1
Associate III

The code was not working properly but there is a fix on the github that fixed it. But thanks anyway for your answers :D

L