Hello Sara,
Let's do step by step.
Here is my i2c config file upload function. For uploading config file, you have to consider about INIT_ADDR_0 as well unless you upload config file at once.
For burst write, you ensure that your system supports the length of bytes. Therefore, I don't recommened 8kB config file burst write at first time.
void upload_I2C_file(int config_size_, int file_count_, byte* filepos_) { Wire.beginTransmission(BMI270_ADDR); Wire.write(INIT_ADDR_0); Wire.write(0x00); Wire.write(file_count_); Wire.endTransmission();
Wire.beginTransmission(BMI270_ADDR); Wire.write(INIT_DATA); Wire.write(filepos_,32); Wire.endTransmission(); }
//load config file and save as array config_size = sizeof(bmi2xx_config_file); //Serial.println(config_size);
file_count = 0;
byte* filepos = (byte *) bmi2xx_config_file;
while (config_size > 0) { upload_I2C_file(config_size, file_count, filepos);
filepos += 32; file_count += 1; config_size -= 32; delay(1); }
If it works, you can increase 64 bytes. At that time file_count should be "file_count +=2;"
Thanks,
... View more