You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure why, but my BMP581 does not seem to properly initialize during POR.
I think in any case, to be on the safe side performing soft reset during init may be a good idea - in my case it fixed the issue.
Improved bmp5_init() code below.
int8_tbmp5_init(structbmp5_dev*dev) {
int8_trslt;
uint8_treg_data;
uint8_tchip_id;
/* Check for null pointer in the device structure */rslt=null_ptr_check(dev);
if (rslt!=BMP5_OK) returnrslt;
dev->chip_id=0;
if (dev->intf==BMP5_SPI_INTF) {
/* Performing a single read via SPI of registers, * e.g. registers CHIP_ID, before the actual * SPI communication with the device. */rslt=bmp5_get_regs(BMP5_REG_CHIP_ID, ®_data, 1, dev);
if (rslt!=BMP5_OK) returnrslt;
}
/* perform soft reset */reg_data=BMP5_SOFT_RESET_CMD;
rslt=bmp5_set_regs(BMP5_REG_CMD, ®_data, 1, dev);
dev->delay_us(BMP5_DELAY_US_SOFT_RESET, dev->intf_ptr);
if (rslt!=BMP5_OK) returnrslt;
rslt=bmp5_get_interrupt_status(®_data, dev);
if (rslt!=BMP5_OK) returnrslt;
if ((reg_data&BMP5_INT_ASSERTED_POR_SOFTRESET_COMPLETE) !=BMP5_INT_ASSERTED_POR_SOFTRESET_COMPLETE) {
returnBMP5_E_POR_SOFTRESET;
}
/* Read chip_id */rslt=bmp5_get_regs(BMP5_REG_CHIP_ID, &chip_id, 1, dev);
if (rslt!=BMP5_OK) returnrslt;
if (chip_id!=0) {
/* Validate post power-up procedure */rslt=power_up_check(dev);
} else {
returnBMP5_E_INVALID_CHIP_ID;
}
rslt=validate_chip_id(chip_id, dev);
returnrslt;
}```
The text was updated successfully, but these errors were encountered:
Not sure why, but my BMP581 does not seem to properly initialize during POR.
I think in any case, to be on the safe side performing soft reset during init may be a good idea - in my case it fixed the issue.
Improved bmp5_init() code below.
The text was updated successfully, but these errors were encountered: