Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    bma456 no motion interrupt happens when it's not supposed to

    bma456 no motion interrupt happens when it's not supposed to


    We are using a modified example of the bma456w example 'motion_hw_int.c'

    We set the no motion duration to 5 seconds but sometimes we get no motion interrupts right after a motion interrupt (less than 1 second after).

    See code attached in zip file in examples -> motion_hw_int

    We modified it to not use the coines library so we could run the bma456 on our custom board...

    The dependencies for running our code are not included but it's pretty self explanatory

    All we want to do is
    1. receive one interrupt when there is a any motion event

    2. receve one interrupt when there a no motion event after 5 seconds of no motion

    What we are seeing

    1. sometimes we receive an any motion event followed quickly (less than 1 second) by a no motion event and then it just keeps doing that over and over for a few seconds while we move the bma456 around slowly


    What should we do to prevent this behavior?

    3 REPLIES 3


    This bug is easy to reproduce

    1. start the main application

    2. slowly rotate the bma456 about the x or y axis 

    3. notice that the no motion / any motion interrupt fires over and over even though the no motion duration is set to 5 seconds it happens instantly after the any motion interrupt fires

    4. if I just move the device in short bursts this issue does not happen and I get the no motion interrupt 5 seconds later after I stop moving

    Community Moderator
    Community Moderator

    Hi jwhistle,
    For your requirement:"All we want to do is: 1. receive one interrupt when there is a any motion event;2. receve one interrupt when there a no motion event after 5 seconds of no motion"
    I upload example code which works on STM32F4 for your reference.


    Hi, we found the issue.

    Looks like we needed to make a call to 'bma456w_set_no_mot_config' before disabling interrupts:

    bma456w_set_no_mot_config(no_mo_conf, &dev); // no_mo_conf has all axis disabled
    bma456w_map_interrupt(BMA4_INTR1_MAP, BMA456W_NO_MOT_INT, false, &dev);
    now we no longer get the erratic interrupt behavior