Hello, this is my code: I am using STM32F769NI with BMI160 sensor main: typedef struct { struct bmi160_sensor_data accel; struct bmi160_sensor_data gyro; uint16_t temperature; uint16_t postfix; } new_data_t; static new_data_t sd_data0[SAMPLE_COUNT][BMI160_COUNT]; HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_DMA_Init(); MX_SDMMC2_SD_Init(); MX_SPI2_Init(); BMI160_Init(0); BMI160_Config(0); while(1) { for(int k = 0; k < SAMPLE_COUNT; k++) { for(uint32_t i = 0; i < BMI160_COUNT; i++) { HAL_Delay(50) if ( BMI160_Read(0, &sd_data0[k][i].accel, &sd_data0[k][i].gyro) != BMI160_OK) err_counter_read++; if (k == 0) { if ( BMI160_ReadReg(i, 0x20, temp, 2) != BMI160_OK) err_counter_read++; sd_data0[k][i].temperature = (temp[1] << 😎 | temp[0]; } else { sd_data0[k][i].temperature = 0xFFFF; } } } } I can read the data from the sensors but when I check it it look wrong, the sensor time counter should always go up, but what I recieve is that the timer going up and down. In addition I buy the APP2.0 board and tested the BMI160 shuttle board, in the BOSCH gui everything look ok and the value looks correct. also attached zip files with the BMI160 folder code that i downloaded in github. Can you maybe point to me what wrong with my code ?
... View more