Skip to content

Commit

Permalink
Fixed bugs related to config file loads on certain platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
BST-Github-Admin authored and kegov committed Mar 16, 2022
1 parent c02e738 commit 631a966
Show file tree
Hide file tree
Showing 16 changed files with 216 additions and 197 deletions.
55 changes: 17 additions & 38 deletions DataSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,24 @@ _Note: data synchronization is designed for applications requiring high bandwidt
## Concept
Synchronized data means that the acquisition of the gyroscope and accelerometer data is happening at the same time and the signals have same propagation time. The time between motion to register read-out depends on the physical propagation time mainly caused by signal filtering path. The synchronization between accelerometer and gyroscope data to a common point of time and a common group delay can be realized with the approach described in the following sections.

The hardware interrupts pins (INT1 / INT3) of the BMI085 are used for data synchronization purposes and must be connected. The interrupt pin INT2 can be used for data ready notification to the host by BMI085.

## Technical realization
The data synchronization feature requires physical interrupt pin’s connection of the sensors on the pcb and a special configuration of the BMI085. Requirements and the steps are described below.

### Connection diagram
### Connection diagram (APP3.0)

```
MCU BMI085
+-----------+ +---------------+
| | 8 | | 16
| SCK +------------>| SCK INT1 |<-----+
| | 9 | | 12 |
| MOSI +------------>| SDO INT3 |>-----+
| | 15 | |
| MISO +<------+-----| SDO1 |
| | | 10 | |
| | +-----| SDO2 |
| | 14 | |
| ACC_CSB +------------>| CSB1 |
| | 5 | |
| GYRO_CSB +------------>| CSB2 |
| | 1 | |
| DATA_RDY +<------------| INT2 PS +------+
| | | | |
+-----------+ +---------------+ |
|
---
INT2 A 1 JP3 2 INT4 G
------------- (-|-) ------------
```

For latency-critical multisensory applications, it is recommended to use SPI interface for fastest sensor data read (recommended SPI clock speed is >2MHz).

Further details in [https://www.bosch-sensortec.com/media/boschsensortec/downloads/shuttle_board_flyer/application_board_3_1/bst-bmi088-sf000.pdf](https://www.bosch-sensortec.com/media/boschsensortec/downloads/shuttle_board_flyer/application_board_3_1/bst-bmi088-sf000.pdf "Shuttle Board 3.0 Flyer")

### Configuring BMI085 for data synchronization

Include the bmi08x header

``` c
#include "bmi08x.h"
```
#include "bmi08x.h"
```

Update variant of bmi08x_dev to BMI085_VARIANT to use the BMI085 sensor feature
Expand Down Expand Up @@ -105,12 +85,11 @@ rslt = bmi08g_init(&dev);
rslt = bmi08a_soft_reset(&bmi08xdev);


/*! Max read/write length (maximum supported length is 32).
To be set by the user */
/* Read/write length */

bmi08xdev.read_write_len = 32;

/*set accel power mode */
/* Set accel power mode */

bmi08xdev.accel_cfg.power = BMI08X_ACCEL_PM_ACTIVE;

Expand All @@ -125,24 +104,24 @@ bmi08g_set_power_mode(&bmi08xdev);

rslt = bmi08a_load_config_file(&bmi08xdev);

/*assign accel range setting*/
/* Assign accel range setting*/

bmi08xdev.accel_cfg.range = BMI085_ACCEL_RANGE_4G;

/*assign gyro range setting*/
/* Assign gyro range setting*/

bmi08xdev.gyro_cfg.range = BMI08X_GYRO_RANGE_2000_DPS;

/*! Mode (0 = off, 1 = 400Hz, 2 = 1kHz, 3 = 2kHz) */
/* Mode (0 = off, 1 = 400Hz, 2 = 1kHz, 3 = 2kHz) */

sync_cfg.mode = BMI08X_ACCEL_DATA_SYNC_MODE_2000HZ;

rslt = bmi08a_configure_data_synchronization(sync_cfg, &bmi08xdev);


/*set accel interrupt pin configuration*/
/* Set accel interrupt pin configuration*/

/*configure host data ready interrupt */
/* Configure host data ready interrupt */

int_config.accel_int_config_1.int_channel = BMI08X_INT_CHANNEL_1;

Expand All @@ -154,7 +133,7 @@ int_config.accel_int_config_1.int_pin_cfg.lvl = BMI08X_INT_ACTIVE_HIGH;

int_config.accel_int_config_1.int_pin_cfg.enable_int_pin = BMI08X_ENABLE;

/*configure Accel syncronization input interrupt pin */
/* Configure Accel syncronization input interrupt pin */

int_config.accel_int_config_2.int_channel = BMI08X_INT_CHANNEL_2;

Expand All @@ -166,7 +145,7 @@ int_config.accel_int_config_2.int_pin_cfg.lvl = BMI08X_INT_ACTIVE_HIGH;

int_config.accel_int_config_2.int_pin_cfg.enable_int_pin = BMI08X_ENABLE;

/*set gyro interrupt pin configuration*/
/* Set gyro interrupt pin configuration*/

int_config.gyro_int_config_1.int_channel = BMI08X_INT_CHANNEL_3;

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2021 Bosch Sensortec GmbH. All rights reserved.
Copyright (c) 2022 Bosch Sensortec GmbH. All rights reserved.

BSD-3-Clause

Expand Down
22 changes: 19 additions & 3 deletions bmi08a.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021 Bosch Sensortec GmbH. All rights reserved.
* Copyright (c) 2022 Bosch Sensortec GmbH. All rights reserved.
*
* BSD-3-Clause
*
Expand Down Expand Up @@ -31,8 +31,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @file bmi08a.c
* @date 2021-06-22
* @version v1.5.7
* @date 2022-01-03
* @version v1.5.8
*
*/

Expand Down Expand Up @@ -904,6 +904,22 @@ int8_t bmi08a_set_regs(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len,
{
/* Writing to the register */
rslt = set_regs(reg_addr, reg_data, len, dev);

/* Delay for suspended mode of the sensor is 450 us */
if (dev->accel_cfg.power == BMI08X_ACCEL_PM_SUSPEND)
{
dev->delay_us(450, dev->intf_ptr_accel);
}
/* Delay for Normal mode of the sensor is 2 us */
else if (dev->accel_cfg.power == BMI08X_ACCEL_PM_ACTIVE)
{
dev->delay_us(2, dev->intf_ptr_accel);
}
else
{
/* Invalid power input */
rslt = BMI08X_E_INVALID_INPUT;
}
}
else
{
Expand Down
22 changes: 19 additions & 3 deletions bmi08g.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021 Bosch Sensortec GmbH. All rights reserved.
* Copyright (c) 2022 Bosch Sensortec GmbH. All rights reserved.
*
* BSD-3-Clause
*
Expand Down Expand Up @@ -31,8 +31,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @file bmi08g.c
* @date 2021-06-22
* @version v1.5.7
* @date 2022-01-03
* @version v1.5.8
*
*/

Expand Down Expand Up @@ -302,6 +302,22 @@ int8_t bmi08g_set_regs(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len,
{
/* Writing to the register */
rslt = set_regs(reg_addr, reg_data, len, dev);

/* Delay for suspended mode of the sensor is 450 us */
if (dev->gyro_cfg.power == BMI08X_GYRO_PM_SUSPEND || dev->gyro_cfg.power == BMI08X_GYRO_PM_DEEP_SUSPEND)
{
dev->delay_us(450, dev->intf_ptr_gyro);
}
/* Delay for Normal mode of the sensor is 2 us */
else if (dev->gyro_cfg.power == BMI08X_GYRO_PM_NORMAL)
{
dev->delay_us(2, dev->intf_ptr_gyro);
}
else
{
/* Invalid power input */
rslt = BMI08X_E_INVALID_INPUT;
}
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions bmi08x.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021 Bosch Sensortec GmbH. All rights reserved.
* Copyright (c) 2022 Bosch Sensortec GmbH. All rights reserved.
*
* BSD-3-Clause
*
Expand Down Expand Up @@ -31,8 +31,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @file bmi08x.h
* @date 2021-06-22
* @version v1.5.7
* @date 2022-01-03
* @version v1.5.8
*
*/

Expand Down
8 changes: 4 additions & 4 deletions bmi08x_defs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021 Bosch Sensortec GmbH. All rights reserved.
* Copyright (c) 2022 Bosch Sensortec GmbH. All rights reserved.
*
* BSD-3-Clause
*
Expand Down Expand Up @@ -31,8 +31,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @file bmi08x_defs.h
* @date 2021-06-22
* @version v1.5.7
* @date 2022-01-03
* @version v1.5.8
*
*/

Expand Down Expand Up @@ -1118,7 +1118,7 @@ struct bmi08x_dev
/*! Config stream data buffer address will be assigned */
const uint8_t *config_file_ptr;

/*! Max read/write length (maximum supported length is 32).
/*! Max read/write length
* To be set by the user */
uint8_t read_write_len;

Expand Down
2 changes: 1 addition & 1 deletion examples/accel_fifo_full/accel_fifo_full.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2021 Bosch Sensortec GmbH
* Copyright (C) 2022 Bosch Sensortec GmbH
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
2 changes: 1 addition & 1 deletion examples/accel_fifo_watermark/accel_fifo_watermark.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2021 Bosch Sensortec GmbH
* Copyright (C) 2022 Bosch Sensortec GmbH
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
5 changes: 1 addition & 4 deletions examples/common/common.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2021 Bosch Sensortec GmbH. All rights reserved.
* Copyright (C) 2022 Bosch Sensortec GmbH. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down Expand Up @@ -114,23 +114,20 @@ int8_t bmi08x_interface_init(struct bmi08x_dev *bmi08x, uint8_t intf, uint8_t va
printf(
"! Warning - BMI085 sensor shuttle and BMI088 variant used \n ,"
"This application will not support this combination \n");
exit(COINES_E_FAILURE);
}

if ((board_info.shuttle_id == BMI088_SHUTTLE_ID) && (variant == BMI085_VARIANT))
{
printf(
"! Warning - BMI088 sensor shuttle and BMI085 variant used \n ,"
"This application will not support this combination \n");
exit(COINES_E_FAILURE);
}

if ((board_info.shuttle_id != BMI085_SHUTTLE_ID) && (board_info.shuttle_id != BMI088_SHUTTLE_ID))
{
printf(
"! Warning invalid sensor shuttle (neither BMI085 nor BMI088 used) \n ,"
"This application will not support this sensor \n");
exit(COINES_E_FAILURE);
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/common/common.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**\
* Copyright (c) 2021 Bosch Sensortec GmbH. All rights reserved.
* Copyright (c) 2022 Bosch Sensortec GmbH. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
**/
Expand Down
2 changes: 1 addition & 1 deletion examples/gyro_fifo_full/gyro_fifo_full.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**\
* Copyright (c) 2021 Bosch Sensortec GmbH. All rights reserved.
* Copyright (c) 2022 Bosch Sensortec GmbH. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
2 changes: 1 addition & 1 deletion examples/gyro_fifo_watermark/gyro_fifo_watermark.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**\
* Copyright (c) 2021 Bosch Sensortec GmbH. All rights reserved.
* Copyright (c) 2022 Bosch Sensortec GmbH. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
2 changes: 1 addition & 1 deletion examples/interrupt_streaming_pc/interrupt_streaming_pc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2021 Bosch Sensortec GmbH
* Copyright (C) 2022 Bosch Sensortec GmbH
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
Loading

0 comments on commit 631a966

Please sign in to comment.