Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BMA423 step acquisition?

    BMA423 step acquisition?

    New Poster

    BMA423 step acquisition?

    I followed the operation, but I can't get the reason for the interrupt from the interrupt, because it returns 0 every time, the direct reading step is also 0, other functions, such as writing the configuration file, getting the acceleration The values are all normal. Is it only normal to get the number of steps? Did I miss something?

    static void Step_Interrupt(void)
        motion_sensor_command_t command = PROCESS_STEP_INTERRUPT;
        xQueueSendFromISR(motionCommandQ, &command, &xHigherPriorityTaskWoken);
    //The return value is normal, ignore the return value check here
    rslt |= bma423_init(&bmd4_dev);
    rslt |= bma423_write_config_file(&bmd4_dev);
    rslt |= bma423_step_counter_set_watermark(1, &bmd4_dev);
    rslt |= bma423_reset_step_counter(&bmd4_dev);
    rslt |= bma423_feature_enable(BMA423_STEP_CNTR, BMA4_ENABLE, &bmd4_dev);
    rslt |= bma423_step_detector_enable(BMA4_ENABLE, &bmd4_dev);
    rslt |= bma423_map_interrupt(BMA4_INTR1_MAP, BMA423_STEP_CNTR_INT, BMA4_ENABLE, &bmd4_dev);
    attachInterrupt(BMA423_INT1_PIN, Step_Interrupt, RISING);
        rtosApiResult = xQueueReceive(motionCommandQ, &motionCommand, portMAX_DELAY);
        if (rtosApiResult == pdTRUE) {
            switch (motionCommand) {
                case PROCESS_STEP_INTERRUPT:
                bma423_read_int_status(&int_status, &bmd4_dev);
                if (int_status & BMA423_STEP_CNTR_INT) {
                    bma423_step_counter_output(&stepCount, &bmd4_dev);


    3 REPLIES 3

    Community Moderator
    Community Moderator

    In order to see interrupt signal from INT1 pin or INT2 pin, you need to configure register 0x53 or 0x54 to set the pin to be "Output enable" and "active high". In addition the step counter will show up when you do more than 7 steps. If you do 5 steps and stop for example, then the step counter will be 0. If you do 7 steps or more everytime, then the step couinter will show the correct value. This is the internal step counter buffer to avoid accident steps.

    Sorry, late reply. Interrupt me is not configured, but it works the same. Normally, when it is picked up, it will be interrupted. I can't get the number of steps according to the above code. Every time it returns, it is 0, but it is strange when there is The number of steps is displayed when I run it. I am very curious.

    is this issue still there?  Your description seems confusing, that you can get the step counter number during running, while you can only get 0 when you read the step counter number registers. please elaborate more here.

    To understand clearly the sensor status and run further analysis, please read out the entire sensor register map when the issue happens:

    0x00~0x25, 0x27~0x5D, 0x5F~0x7E

    and read ~100bytes from 0x5E by a burst read.