09-28-2021 07:18 AM
I'm attempting to use the example code in the Sensortec gitub repo to make the tap interrupt work.
I have defined the shim functions, and have confirmed that all of the high level example code correctly returns OK. I am loading the "config file". I can read gyro XYZ fine, and the values look good.
No matter what I do, I cannot make the example code for the tap, double tap, no motion, or any motion interrupts actually fire. Using the exact example code from the repo doesn't work.
Was this code ever tested? I suspect the driver is actually broken.
This is the exact code I am running: https://github.com/BoschSensortec/BMA423-Sensor-API/blob/master/examples/generic/wakeup_interrupt/wa...
the return value for all function calls is `BMA4_OK`. I can see the I2C transactions occuring. The value assigned by `bma423_read_int_status` is always 0, no matter what.
Thanks,
09-28-2021 08:05 AM
Hello chris11seto,
For your SW code, change ODR to 200 Hz.
accel_conf.odr = BMA4_OUTPUT_DATA_RATE_200HZ;
Before you call bma423_map_interrupt() function, you could add the following code. And see whether it has interrupt signal change fromo INT1 pin when you do TAP operation.
/* Variable to define two interrupt lines */
uint8_t int_line = BMA4_INTR1_MAP;
struct bma4_int_pin_config int_pin_config;
rslt = bma4_get_int_pin_config(&int_pin_config, int_line, dev);
int_pin_config.edge_ctrl |= BMA4_EDGE_TRIGGER;
int_pin_config.lvl = BMA4_ACTIVE_HIGH;
int_pin_config.od = BMA4_PUSH_PULL;
int_pin_config.output_en = BMA4_OUTPUT_ENABLE;
rslt = bma4_set_int_pin_config(&int_pin_config, int_line, dev);
dev->delay(5);
10-01-2021 05:43 PM
Hi,
Thank you for the reply. This is kind of my point though. I suspect that the example code from BST is outright broken. I have changed the ODR and it still doesn not work. Note that in the file below, ODR is set to 100hz, and the datasheet calls this out as too slow for the tap interrupt. Would it be possible for you to run this code and verify that it works at all on a known good platform? Thanks!
10-06-2021 10:59 PM
Hi,
Bumping this to follow up. I still need a solution to this issue.
10-07-2021 06:59 PM
Hello Chris,
First, we don't supply BMA423 anymore next year, so please consider BMA456.
BMA423 doesn't support tap function, but BMA456 currently supports tap functions. (Signle, double)
What Robin said, technically our examples read interrupt status for the feature.
Therefore, if you want to fire physical interrupt configuration as below at the last congiruation part of example.
/* INT1 active high, output enable */
int_pin_config.edge_ctrl = 0x00; // 0 = level, 1 = edge
int_pin_config.lvl = 0x01; // 0 = active low, 1 = active high
int_pin_config.od = 0x0; // 0 = push-pull, 1 = open drain
int_pin_config.output_en = 0x01; // 0 = output disabled, 1 = output enabled
int_pin_config.input_en = 0x0; // 0 = input disabled, 1 = input enabled. input used for fifo things
// INT1 active high, pushpull, output enabled
rslt = bma4_set_int_pin_config(&int_pin_config, 0, &bma);
We released our examples before upload, but I checked the github source code, and quite old.
Please download COINES example.
https://www.bosch-sensortec.com/software-tools/tools/coines/
There is motion interrupt and it should work.
Thanks,