Hi, I am using NRF52832 with BMI270 Shuttle Board 3.0. I am able to read Chip ID Register correct value 0x24. With this I confirmed that I2C is working fine between the NRF & BMI. But now When I load the Config file successfully onto the BMI using Bosch BMI270 Library without any modifications, after minimum of 150ms, still the internal register of the BMI270 reads 0x00 which means ASIC is not initialized when internal status register read is done. I have tried with multiple read_write_lens, played with delays inbetween read writes etc. I am attaching the Files which i used to connect the I2C in common.c. And the Config write is same as bmi2.c. Here is my main.c code. /*For I2C on BMI270, Pull CS - HIGH, SDO - LOW */ /* Set INT1 & INT2 as INPUT */ nrf_gpio_cfg_output(BMI_SDO); nrf_gpio_cfg_output(BMI_CS); nrf_gpio_pin_clear(BMI_SDO); nrf_gpio_pin_set(BMI_CS); nrf_gpio_cfg_input(BMI_INT1, GPIO_PIN_CNF_PULL_Pullup); nrf_gpio_cfg_input(BMI_INT2, GPIO_PIN_CNF_PULL_Pullup); /* Status of api are returned to this variable. */ int8_t rslt; /* Variable to define limit to print accel data. */ uint8_t limit = 20; /* Assign accel sensor to variable. */ uint8_t sensor_list = BMI2_ACCEL; struct bmi2_dev bmi2_dev; /* Create an instance of sensor data structure. */ struct bmi2_sens_data sensor_data = { { 0 } }; /* Initialize the interrupt status of accel. */ uint16_t int_status = 0; uint8_t indx = 0; float x = 0, y = 0, z = 0; rslt = bmi2_interface_init(&bmi2_dev, BMI2_I2C_INTF); bmi2_error_codes_print_result(rslt); nrf_delay_ms(500); /* Initialize bmi270. */ printf("BMI270 Init\r\n"); rslt = bmi270_init(&bmi2_dev); bmi2_error_codes_print_result(rslt); if (rslt == BMI2_OK){ /* Accel configuration settings. */ printf("setting accel config \r\n"); rslt = set_accel_config(&bmi2_dev); bmi2_error_codes_print_result(rslt); } if (rslt == BMI2_OK) { /* NOTE: * Accel enable must be done after setting configurations */ printf("Enabling ACC \r\n"); rslt = bmi270_sensor_enable(&sensor_list, 1, &bmi2_dev); bmi2_error_codes_print_result(rslt); printf("Accel and m/s2 data \n"); printf("Accel data collected at 2G Range with 16-bit resolution\n"); /* Loop to print the accel data when interrupt occurs. */ while (indx <= limit){ /* To get the status of accel data ready interrupt. */ rslt = bmi2_get_int_status(&int_status, &bmi2_dev); printf("status val : %X \r\n", int_status); bmi2_error_codes_print_result(rslt); /* To check the accel data ready interrupt status and print the status for 10 samples. */ if (int_status & BMI2_ACC_DRDY_INT_MASK) { /* Get accelerometer data for x, y and z axis. */ rslt = bmi2_get_sensor_data(&sensor_data, &bmi2_dev); bmi2_error_codes_print_result(rslt); printf("\nAcc_X = %d\t", sensor_data.acc.x); printf("Acc_Y = %d\t", sensor_data.acc.y); printf("Acc_Z = %d\r\n", sensor_data.acc.z); /* Converting lsb to meter per second squared for 16 bit accelerometer at 2G range. */ x = lsb_to_mps2(sensor_data.acc.x, 2, bmi2_dev.resolution); y = lsb_to_mps2(sensor_data.acc.y, 2, bmi2_dev.resolution); z = lsb_to_mps2(sensor_data.acc.z, 2, bmi2_dev.resolution); /* Print the data in m/s2. */ printf("\nAcc_ms2_X = %4.2f, Acc_ms2_Y = %4.2f, Acc_ms2_Z = %4.2f\n", x, y, z); indx++; } nrf_delay_ms(500); } } It is really appreciated if anyone could help me out. Thank you in Advance.
... View more