2021-10-08 03:39 AM
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?
2021-10-08 08:36 AM
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.
2021-10-11 01:26 AM
it is write 0x8000(32768 decimal) bytes one time, write 3 times can cover 86020 bytes .
2021-10-11 07:19 AM
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.
2021-10-18 06:01 AM
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