I'm not able to successfully load init data into BMI270 chip using the code below. Since maximum bytes is 255, I load 32 bytes at the time. I get 0x02 as a result from reading 0x21 (status). I do not have any available SPI ports. These are the first register readouts: 24200010000000000000000000000000000000000000000026960101000000000002adff00008000800 242000100000000000000000000000000000000000000000fcc40100000000000002310000008000800 242000100000000000000000000000000000000000000000c7f30100000000000002310000008000800 242000100000000000000000000000000000000000000000a222020000000000000200800000800080 2420001000000000000000000000000000000000000000007551020000000000000200800000800080 Any obvious errors? Greatful for any hints or trixes. uint16_t i; uint16_t j; uint32_t err_code; uint8_t d[33]; uint32_t addr; nrf_delay_us(500); bmi270_write(BMI2_PWR_CONF_ADDR, 0x00); // Power on nrf_delay_us(500); bmi270_write(BMI2_CMD_REG_ADDR, 0xb6); // Reset nrf_delay_ms(500); bmi270_write(BMI2_INIT_CTRL_ADDR, 0x00); // init start nrf_delay_us(500); for(i = 0; i < 256; i++) { bmi270_write(BMI2_INIT_ADDR_0, 0); bmi270_write(BMI2_INIT_ADDR_1, i); d[0] = BMI2_INIT_DATA_ADDR; addr = i << 5; for(j = 0; j < 32; j++) { d[j+1] = bmi270_config_file[addr + j]; } err_code = nrf_drv_twi_tx(&m_twi, BMI2_I2C_PRIM_ADDR, d, 33, false); nrf_delay_us(500); } nrf_delay_ms(500); bmi270_write(BMI2_INIT_CTRL_ADDR, 0x01); nrf_delay_ms(500); bmi270_write(BMI2_PWR_CONF_ADDR, 0x00); // Power on nrf_delay_us(500); bmi270_write(BMI2_PWR_CTRL_ADDR, 0x0e); // Accelerometer and gyroscope on nrf_delay_us(500); bmi270_write(BMI2_FIFO_CONFIG_1_ADDR, 0x00); // FIFO off nrf_delay_us(500); bmi270_write(BMI2_PWR_CTRL_ADDR, 0x0e); // Accelerometer and gyroscope on bmi270_write(BMI2_ACC_CONF_ADDR, 0xbb); // Performance, Avg32, 100Hz bmi270_write(BMI2_ACC_RANGE_ADDR,0x00); // Range +- 2g bmi270_write(BMI2_GYR_CONF_ADDR, 0xcb); // Performance, normal operation, 200Hz bmi270_write(BMI2_GYR_RANGE_ADDR, 0x04); // Gyre range +- 125dps bmi270_write(BMI2_FIFO_DOWNS_ADDR, 0x00); // Filtering off bmi270_write(BMI2_FIFO_CONFIG_1_ADDR, 0xd0); // Store acc and Gyro in FIFO
... View more