Hi all, I'm trying to get BMM150 magnetometer data @100Hz using the BMI270 as master device, but when I configure the sensor in forced mode I only get the first measure, the next measures are all equals. This is my configuration code for BMM150: int8_t BMM150_DEVICE_Init() {
int8_t rslt = BMM150_OK;
// ----> BMM150 initialization over I2C (BMI270 aux)
bmm150_dev.dev_id = BMM150_DEFAULT_I2C_ADDRESS;
bmm150_dev.intf = BMM150_I2C_INTF;
bmm150_dev.read = bmm150_read;
bmm150_dev.write = bmm150_write;
bmm150_dev.delay_ms = bmm150_delay_ms;
rslt = bmm150_init(&bmm150_dev);
if(rslt!=BMM150_OK) {
goto exit;
}
// <---- BMM150 initialization over I2C (BMI270 aux)
//perform_self_tests(&bmm150_dev);
// ----> Configuration
bmm150_dev.settings.preset_mode = BMM150_PRESETMODE_REGULAR;
rslt = bmm150_set_presetmode(&bmm150_dev);
if(rslt!=BMM150_OK) {
goto exit;
}
bmm150_dev.settings.pwr_mode = BMM150_FORCED_MODE;
rslt = bmm150_set_op_mode(&bmm150_dev);
// <---- Configuration
exit:
if( rslt == BMM150_OK ) {
systemStatus.bmm150_initialized = 1;
} else {
systemStatus.bmm150_initialized = 0;
}
return rslt;
}
void bmm150_delay_ms(uint32_t msec) {
HAL_Delay(msec);
}
int8_t bmm150_read(uint8_t dev_id, uint8_t reg_addr, uint8_t *read_data, uint16_t len) {
return bmi2_read_aux_man_mode(reg_addr, read_data, len, &bmi270_dev);
}
int8_t bmm150_write(uint8_t dev_id, uint8_t reg_addr, uint8_t *write_data, uint16_t len) {
return bmi2_write_aux_man_mode(reg_addr, write_data, len, &bmi270_dev);
} Is there something to be changed to get it working correctly? Thank you, Walter
... View more