02-02-2021 02:44 PM
Hello,
I am facing an issue while initializing BMA456, I am using PN7462 as a master.
I have the following doubts.
1) BMA456 init sequence required configuration file to load. As there is no documentation regarding how to load the configuration file. Some of the details of the register are not mentioned in the datasheet which is used in its driver file (https://github.com/BoschSensortec/BMA456-Sensor-API).
2) As the 0x5E FEATURES_IN register is one byte how can we load the feature register?
As per the application note “Wearable feature set” we can load feature configuration on ) 0x5E.
How 0x5E register data will be mapped with which feature.
Ex: if we load 0xE005 in 0X5E, then data will be used for "any motion" or "no motion"?
3) I have tried to load the configuration file which is located in the “bma456.c” file, but still after loading the file INIT status is message shows not initialize. To load the configuration file I have used the following API.
/*!
* @brief This API writes the config stream data in memory using burst mode
* @note index value should be even number.
*/
static int8_t stream_transfer_write(const uint8_t *stream_data, uint16_t index, struct bma4_dev *dev)
{
int8_t rslt = -1;
uint8_t asic_msb = (uint8_t)((index / 2) >> 4);
uint8_t asic_lsb = ((index / 2) & 0x0F);
/* Check the dev structure as NULL */
if ((rslt == BMA4_OK) && (stream_data != NULL))
{
rslt = bma4_write_regs(0x5B, &asic_lsb, 1);
if (rslt == BMA4_OK)
{
rslt = bma4_write_regs(0x5C, &asic_msb, 1);
if (rslt == BMA4_OK)
{
rslt = bma4_write_regs(0x5E, (uint8_t *)stream_data, dev->read_write_len);
}
}
}
else
{
rslt = -1;
}
return rslt;
}
where read_write_len = 127, because at a time I am able to send 127 byte. it’s call is as below:
/* Write the config stream */
for (index = 0; index < dev.config_size; index += dev.read_write_len)
{
stream_transfer_write((bma456_config_file + index), index, &dev);
}
I have written custom code based on https://github.com/BoschSensortec/BMA456-Sensor-API
Solved! Go to Solution.
10-13-2021 09:17 AM
Please refer example code in your other topic: https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/BMA456-Init-fail/m-p/47081#M8520