How to use extra 9K flash memory in LSM5DSO for storing accelerometer and gyroscope data
Hi,
I am using LSM6DSOx for a wearable device project. Currently all the accelerometer data is written in FIFO and device wait for data ready interrupt. This helps system to maintain low power mode and operate only when FIFO data is ready.
Currently FIFO is using only 3K of memory. But I want to use the additional 9K flash memory so that I can increase system sleep period.
Below is the accelerometer configurations that I am using. Please guide me what changes needs to be done to use 9K flash memory
------------------------------------------------------
/* Restore default configuration */
lsm6dsox_reset_set(&dev_ctx, PROPERTY_ENABLE);
ACCL_DEBUG("Sent reset command\r\n");
do {
lsm6dsox_reset_get(&dev_ctx, &rst);
} while (rst);
/* Disable I3C interface */
lsm6dsox_i3c_disable_set(&dev_ctx, LSM6DSOX_I3C_DISABLE);
/* Enable Block Data Update */
lsm6dsox_block_data_update_set(&dev_ctx, PROPERTY_ENABLE);
/* Set full scale */
lsm6dsox_xl_full_scale_set(&dev_ctx, LSM6DSOX_2g);
lsm6dsox_xl_data_rate_set(&dev_ctx, LSM6DSOX_XL_ODR_OFF);
/*
* Set FIFO watermark (number of unread sensor data TAG + 6 bytes
* stored in FIFO) to 10 samples
*/
//lsm6dsox_fifo_watermark_set(&dev_ctx, 0x1FF);
/* Set FIFO batch XL/Gyro ODR to 12.5Hz */
lsm6dsox_fifo_xl_batch_set(&dev_ctx, LSM6DSOX_XL_BATCHED_AT_104Hz);
/* Set FIFO mode to Stream mode (aka Continuous Mode) */
lsm6dsox_fifo_mode_set(&dev_ctx, LSM6DSOX_STREAM_MODE);
/* Enable drdy 75 μs pulse: uncomment if interrupt must be pulsed */
/* Uncomment if interrupt generation on Free Fall INT1 pin */
lsm6dsox_pin_int1_route_get(&dev_ctx, &int1_route);
int1_route.fifo_th = PROPERTY_ENABLE;
int1_route.fifo_full = PROPERTY_ENABLE;
int1_route.fifo_ovr = PROPERTY_ENABLE;
int1_route.fifo_bdr = PROPERTY_ENABLE;
lsm6dsox_pin_int1_route_set(&dev_ctx, int1_route);
/* Uncomment if interrupt generation on Free Fall INT2 pin */
//lsm6dsox_pin_int2_route_get(&dev_ctx, &int2_route);
//int2_route.reg.int2_ctrl.int2_fifo_th = PROPERTY_ENABLE;
//lsm6dsox_pin_int2_route_set(&dev_ctx, &int2_route);
/* Set Output Data Rate */
lsm6dsox_xl_data_rate_set(&dev_ctx, LSM6DSOX_XL_ODR_104Hz);
lsm6dsox_compression_algo_init_set(&dev_ctx, 1);
lsm6dsox_compression_algo_set(&dev_ctx, LSM6DSOX_CMP_ALWAYS);
lsm6dsox_emb_sens_t emb_sens;
emb_sens.fifo_compr = PROPERTY_ENABLE;
lsm6dsox_embedded_sens_set(&dev_ctx, &emb_sens);
