IoT Sensor: default configuration in FW

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
8 posts / 0 new
Last post
gme_johannes
Offline
Last seen:2 weeks 3 days ago
加入:2017-12-22 10:09
IoT Sensor: default configuration in FW

Hi Dialog support,

I am running a project based on the IoT sensor with SDK 5.160.1.19.

When I connect with the IoT app, the default settings are (e.g.)
- SF rate: 10Hz
- Calibration Mode: Continuous Auto
- Auto Calibration Mode: Basic

I want to change the FW before compilation such that the default is
- SF rate: 25Hz
- Calibration Mode: Continuous Auto
- Auto Calibration Mode: Smart Fusion

I have changed the following line in user_sensor_config.c :

const sensor_config_struct sensor_config_default = { ENABLE_ALL_SENSOR_FLAGS, DEFAULT_BMI160_ACCEL_RANGE, DEFAULT_ACCEL_DATA_RATE, DEFAULT_BMI160_GYRO_RANGE, DEFAULT_GYRO_DATA_RATE, DEFAULT_MAG_DATA_RATE, DEFAULT_ENV_SAMPLE_INTV_MULT, DEFAULT_SFL_RATE_HZ, 1, CAL_SMARTFUSION_AUTOCAL, 0, 0, 0, 0, 0, 0 };

Still when I connect the IoT Sensors app, it shows the "old" default setting. This is inconvenient as the basic calibration never works (sensor always drifts - magnetometer?).

How can I change this behavior?

Best regards

Johannes

Device:
PM_Dialog
Offline
Last seen:2 days 2 hours ago
工作人员
加入:2018-02-08 11:03
嗨gme_johannes,

嗨gme_johannes,

Did you try to change the default values in the user_app_wrbl_config.h file? The default values in the sensor_config_default structure are defined in user_app_wrbl_config.h.

Thanks, PM_Dialog

gme_johannes
Offline
Last seen:2 weeks 3 days ago
加入:2017-12-22 10:09
Hi PM_Dialog,

Hi PM_Dialog,

in this document I found

#define DEFAULT_SFL_RATE_HZ 10

which I changed to

#define DEFAULT_SFL_RATE_HZ 25

but I found nothing about the default calibration method.

Now I changed the struct from

const sensor_config_struct sensor_config_default = { ENABLE_ALL_SENSOR_FLAGS, DEFAULT_BMI160_ACCEL_RANGE, DEFAULT_ACCEL_DATA_RATE, DEFAULT_BMI160_GYRO_RANGE, DEFAULT_GYRO_DATA_RATE, DEFAULT_MAG_DATA_RATE, DEFAULT_ENV_SAMPLE_INTV_MULT, DEFAULT_SFL_RATE_HZ, 1, CAL_BASIC_AUTOCAL, 0, 0, 0, 0, 0, 0 };

to

const sensor_config_struct sensor_config_default = { ENABLE_ALL_SENSOR_FLAGS, DEFAULT_BMI160_ACCEL_RANGE, DEFAULT_ACCEL_DATA_RATE, DEFAULT_BMI160_GYRO_RANGE, DEFAULT_GYRO_DATA_RATE, DEFAULT_MAG_DATA_RATE, DEFAULT_ENV_SAMPLE_INTV_MULT, DEFAULT_SFL_RATE_HZ, 1, CAL_SMARTFUSION_AUTOCAL, 0, 0, 0, 0, 0, 0 };

should this suffice to have the fusion autocalibration at bootup?

edit:
I have recompile and reprogrammed, still the IoT Sensors app shows 10Hz and "Continuous Auto".
Same if I press "Read configuration from NV".

解决这个问题的正确方法是什么?

Thanks,

Johannes

PM_Dialog
Offline
Last seen:2 days 2 hours ago
工作人员
加入:2018-02-08 11:03
嗨gme_johannes,,

嗨gme_johannes,,

Could you please try to undefine the USE_SPI_FLASH_CONFIG macro in user_app_wrbl_config.h file?

Thanks, PM_Dialog

gme_johannes
Offline
Last seen:2 weeks 3 days ago
加入:2017-12-22 10:09
Hi PM_Dialog,

Hi PM_Dialog,

(1) can you explain what happens when USE_SPI_FLASH_CONFIG is defined/undefined?

(2) Where do the default values come from in each case, when it is defined and when it is not?

(3) How are the values stored when I changed the configuration from the app and then "write to NV memory"? Does this still work when USE_SPI_FLASH_CONFIG is undefined?
edit: I have found out that "write to NV memory" does not have any effect with USE_SPI_FLASH_CONFIG undefined. It makes sense.

(4) Although in the code I have set

const sensor_config_struct sensor_config_default = { ENABLE_ALL_SENSOR_FLAGS, DEFAULT_BMI160_ACCEL_RANGE, DEFAULT_ACCEL_DATA_RATE, DEFAULT_BMI160_GYRO_RANGE, DEFAULT_GYRO_DATA_RATE, DEFAULT_MAG_DATA_RATE, DEFAULT_ENV_SAMPLE_INTV_MULT, DEFAULT_SFL_RATE_HZ, 1, CAL_SMARTFUSION_AUTOCAL, 0, 0, 0, 0, 0, 0 };

with CAL_SMARTFUSION_AUTOCAL, the IoT app shows "Basic Autocalibration" instead of "Smart Fusion Autocalibration". Can you confirm? How can I boot up with the latter?

BR Johannes

PM_Dialog
Offline
Last seen:2 days 2 hours ago
工作人员
加入:2018-02-08 11:03
嗨gme_johannes,

嗨gme_johannes,

If you undefine the USE_SPI_FLASH_CONFIG you could load data from the default array and in the user_app_wrbl_config.h change the SENSOR_SAMPLE_RATE_IMU to a user sample case, for example SENSOR_SAMPLE_RATE_USER_CASE2 and choose for that sample case BMI160_ACCEL_OUTPUT_DATA_RATE_200HZ and BMI160_ACCEL_OUTPUT_DATA_RATE_200HZ. Regarding the default values in the IoT app, as you correctly mentioned you should modify the sensor_config_default. After recompiling the code, the values should be changed. In addition, you could change the calibration mode inside the app and press the “store” button.

Thanks, PM_Dialog

gme_johannes
Offline
Last seen:2 weeks 3 days ago
加入:2017-12-22 10:09
Hi PM_Dialog, thanks for your

Hi PM_Dialog, thanks for your answer.

不幸的是,我仍然不能被人注意到我的观点(4),虽然我将默认值设置为“cal_smartfusion_autocal”,但该应用程序仍然显示基本校准。我现在手动改变了所有传感器并用应用程序将其存储到NVRAM。

BR Johannes

PM_Dialog
Offline
Last seen:2 days 2 hours ago
工作人员
加入:2018-02-08 11:03
嗨gme_johannes.

嗨gme_johannes.

Thanks for your indication and for your feedback

Regards, PM_Dialog