DA14531 - Sensor values reading for a long time without BLE advertise - Does not trigger the callback by wkupct_register_callback.

Hi Team,

We are using DA14531MOd and are trying to build a device that should capture the sensor data and send over BLE un-directed. The application uses an accelerometer and pressure sensor. The main application flow is like this:

1. On user_app_init(), initialize accelerometer and enable wakeup controller callback using 'wkupct_register_callback(accel_sensor_interrupt_cb)' and 'wkupct_enable_irq()'.
2. Once it calls accel_sensor_interrupt_cb(), initialize the pressure sensor and enable pressure_sensorr_callback for this using another GPIO pin using 'wkupct_enable_irq()'.
3.  In the pressure_sensorr_callback function read pressure values, and check whether the accelerometer INT pin is still active or not using GPIO_GetPinStatus(). If yes, enable pressure sensor interrupt using 'wkupct_enable_irq()'. This might happen repeatedly as the accelerometer has movement for a long time say 30 seconds.
4. After the accelerometer come to a stable state, analyzes the data, and sends the result over BLE. Until then do not advertise any data over BLE. 
5. Once BLE advertisement completes, put the device into extended sleep mode and wait for the accelerometer to interrupt again by calling 'wkupct_enable_irq()'.

The accelerometer and pressure sensor is working fine and able to trigger accel_sensor_interrupt_cb() and initialize the pressure sensor. However, the pressure sensor interrupt is not triggering sometimes. Sometimes it works for 3 or 4 interrupts and stops after that, it never calls call back. At this stage, I need to reset the device to work again. On the logic analyzer, I could see that the pressure sensor generated the interrupt as expected but no callback was called in DA14531.

I looked into the samples like 'ble_pressure_sensor_bmp388', 'accel-Sensor'. However, they are reading sensor values for a shorter time. 

I thought, there may be some issue in sleep mode and disabled extended sleep mode by using ARCH_SLEEP_OFF. However, when the sleep mode is off, after getting the accelerometer interrupted and starts reading pressure sensor values, after a couple of seconds, the processor is entering into HardFault. I reset the watchdog in the pressure sensor callback however it did not help. I have looked into getting the statement using registres to know the method that caused HardFault, however, it did not help to identify the cause/source of the HardFault call. Anyway I do not want to disable sleep mode so did not spend more time on it and I need a solution with ARCH_EXT_SLEEP_ON mode.

Please advise what would be the best way to achieve this kind of long reading process instead of BLE advertising, but advertise only after the complete reading is done.

Please let me know if you need any further information.

Thank you.

  • Hi Harish,

    Thank you for posting your question online. 
    From my understanding, you are not triggering the wake-up controller manually, but when the sensors are ready to send data, they will trigger their INT pin which will trigger the wake-up controller. 
    Are you using the same wake-up controller for both sensors? Are you sure that inside your work flow you are configuring the wake up controller multiple times for different reasons (for accel sensor and pressure sensor)? 
    For DA14531 the SDK6 provides two wake up controller interrupts. 
    You are working with wkupct_enable_irq and wkupct_register_callback functions. You can use these functions for the accelerometer sensor and the wkupct2_enable_irq and wkupct_register_callback functions for the pressure sensor. This way you can handle both sensor callback functions. Keep in mind that both of them have the same Priority. You will have to modify the wkupct_quade.c file if you want one sensor to have higher priority than the other. 
    In the user_app_init custom callback function you can declare both wake up controllers with their respective sensor callback functions and enable Extended Sleep Mode.
    When the accelerometer INT pin has been triggered, the wake-up controller (1) will be triggered, and you will go on the accel_sensor_interrupt_cb function. Inside that function you should disable the Extended Sleep mode, initialize the Accelerometer Sensor and initialize the Communication interface you are using (I2C, SPI, UART etc). Then you will be able to get the accelerometer values. When you have read the measurements you were interested in, you should re-initialize the wake-up controller (1) and enter Extended Sleep Mode. 
    The same logic applies for the pressure sensor as well but for the wake-up controller (2). 
    You stated:

    On the logic analyzer, I could see that the pressure sensor generated the interrupt as expected but no callback was called in DA14531.

    This sounds like the wake-up controller was not properly initialized and set. Could you provide the implementation for the wake-up controller?
    You also stated:

    In the pressure_sensorr_callback function read pressure values, and check whether the accelerometer INT pin is still active or not using GPIO_GetPinStatus(). If yes, enable pressure sensor interrupt using 'wkupct_enable_irq()'. This might happen repeatedly as the accelerometer has movement for a long time say 30 seconds.

    Could you kindly give more information regarding step 3?
    First you start getting the Accelerometer measurements and you initialize the Pressure Sensor, when the Pressure Sensor INT pin is triggered, you stop reading the Accelerometer values and you start reading pressure values. If the accelerometer INT pin is still high, are you going to go back to the accelerometer values or continue reading the pressure values? You should decide, which sensor should have the higher interrupt, so in case that both INT pins are triggered, your application will know which sensor to handle first. 

    When you have read both sensors, you should de-activate/put them into sleep mode and have Extended Sleep Mode enabled. After that you should be able to start advertising, connect with your central and send the sensor measurements over a characteristic. 

    Kind Regards,
    OV_Renesas

     

  • Any feed back on my reply to your questions? When I posted it said the replies will be moderated but did not saw it posted here. And just now with this reply I observed that it was showing here immediately. Can you please confirm you received my reply and is still in moderation, otherwise I will reply again.

  • Hi Harish,

    Thank you for the reply.
    I have not received any replies to my questions. 
    Could you please write your message again?

    Kind Regards,
    OV_Renesas

  • Oh!. Let me reply again.

    OV_Renesas said:
    You are working with wkupct_enable_irq and wkupct_register_callback functions. You can use these functions for the accelerometer sensor and the wkupct2_enable_irq and wkupct_register_callback functions for the pressure sensor. This way you can handle both sensor callback functions.


    OV_Renesas said:
    Are you using the same wake-up controller for both sensors? Are you sure that inside your work flow you are configuring the wake up controller multiple times for different reasons (for accel sensor and pressure sensor)?
    No, I am using same wkupct_register_callback() for both accelerometer and pressure sensor interrupts. However, I am taking care of setting wkupct_register_callback() and wkupct_enable_irq() for each GPIO pin only when required.

    The flow is like: in user_app_init() calling accelerometer_init() and in this, setting accelerometer wakeup callback for ACCEL_INT_PIN, with call back say accel_sensor_interrupt_cb(). Once it triggers, in this callback calling pressure_sensor_init(). This pressure_sensor_init() powering up the pressure sensor and initializing INT, and configuring call back like wkupct_register_callback(pressure_sensor_range_complete_cb) and wkupct_enable_irq(...PRESSURE_INT_PIN...);

    In in user_app_init(), initializing accelerometer sensor and wake-up controller as below:

    void user_app_init(void){
     ...
    
     accel_sensor_init();
     ...
    
    }
    
    
    int8_t accel_sensor_init(void){
     bma400_interface_init(...);
     ...
    
     enable_accel_sensor_interrupt();
    }
    
    static void enable_accel_sensor_interrupt(void)
    {
        wkupct_register_callback(accel_sensor_interrupt_cb);
        wkupct_enable_irq(WKUPCT_PIN_SELECT(GPIO_ACCEL_PORT, GPIO_ACCEL_PIN),
                          WKUPCT_PIN_POLARITY(GPIO_ACCEL_PORT, GPIO_ACCEL_PIN, WKUPCT_PIN_POLARITY_HIGH),
                                              1, // 1 event
                                              40); // debouncing time = 0
    }
    
    
    
    In accel_sensor_interrupt_cb(), powering up ad initializing pressure sensor along with its wake-up controller like:
    
    static void accel_sensor_interrupt_cb(){
    
     ...
     app_resume_system_from_sleep();
     ...
     analysis_timer = app_easy_timer(10, _on_start_analysis_cb);
    }
    
    void _on_start_analysis_cb(void){
     pressure_sensor_init();
    }
    
    void pressure_sensor_init(void){
      pressure_sensor_wakeup();
      enable_pressure_sensor_interrupt();
    }
    
    void enable_pressure_sensor_interrupt(void){
    	wkupct_register_callback(pressure_sensor_range_complete_cb);
    	wkupct_enable_irq(WKUPCT_PIN_SELECT(GPIO_PRESSURE_INT_PORT, GPIO_PRESSURE_INT_PIN),
    										WKUPCT_PIN_POLARITY(GPIO_PRESSURE_INT_PORT, GPIO_PRESSURE_INT_PIN, WKUPCT_PIN_POLARITY_LOW),
    																				1, // 1 event
    																				10); // debouncing time = 0
    }
    
    
    static void pressure_sensor_range_complete_cb(void){
    
      int16_t sensor_value = get_sensor_value();
      
      ...
      
      
      if(!GPIO_GetPinStatus(GPIO_ACCEL_PORT, GPIO_ACCEL_PIN)){	// Accel INT changed to LOW, so stop measuring.
    		if (_timer_on_accel_stable_timer_expired == EASY_TIMER_INVALID_TIMER){
    		_timer_on_accel_stable_timer_expired = app_easy_timer(WAIT_FOR_NEXT_ACTION_TIME_GAP_THRESHOLD_SECONDS, _on_accel_stable_timer_expired);
    		}
    	}else{		// Changed to HIGH
    		if (_timer_on_accel_stable_timer_expired != EASY_TIMER_INVALID_TIMER){
    			app_easy_timer_cancel(_timer_on_accel_stable_timer_expired);
    			_timer_on_accel_stable_timer_expired = EASY_TIMER_INVALID_TIMER;
    		}
    	}
      
    
      if(!_analysis_completed){
        enable_pressure_sensor_interrupt(); // Setup wake-up controller again.
      }
    }
    
    
    void _on_accel_stable_timer_expired(void){
      _analysis_completed = true;
      _timer_on_accel_stable_timer_expired = EASY_TIMER_INVALID_TIMER;
    	
      on_analysis_completed();
    }
    
    static void on_analysis_completed(void){
    	pressure_sensor_shutdown();
    	disable_pressure_sensor_interrupt();
    	
    	bool send_ble_signal = ... (analyse and get value);
    
    
    	analysis_complete_callback(send_ble_signal);
    	enable_accel_sensor_interrupt();
    }
    
    

    All this flow works for some time. After some time, pressure_sensor_range_complete_cb() or _on_accel_stable_timer_expired() will not trigger. Hence the sensor check will not complete.

    OV_Renesas said:
    You are working with wkupct_enable_irq and wkupct_register_callback functions. You can use these functions for the accelerometer sensor and the wkupct2_enable_irq and wkupct_register_callback functions for the pressure sensor. This way you can handle both sensor callback functions.
    This is good to know thank you for highlighting it. E...ven though with single wake-up controller it kind of works, I will use both separately for more code clarity.

    OV_Renesas said:
    This sounds like the wake-up controller was not properly initialized and set. Could you provide the implementation for the wake-up controller?
    I have provided the snippet how I am initializing wake-up controllers, especially in enable_accel_sensor_interrupt() and enable_pressure_sensor_interrupt(). They both trigger correctly for some time, like accel-wake-up, could measure pressure sensor until accel-halts and sends BLE advertisement. This whole cycle works for 3 or 4 times and after that those wake-controller call back or time call back(_on_accel_stable_timer_expired()) does not get called.

    OV_Renesas said:
    Could you kindly give more information regarding step 3?
    I have provided the code snippet above.

    OV_Renesas said:
    If the accelerometer INT pin is still high, are you going to go back to the accelerometer values or continue reading the pressure values?
    Accelerometer was used just to get INT when any movement happens. Apart from that no accelerometer values will be read form accelerometer sensor. As long as any movement happens in accelerometer, it starts measuring the pressure sensor value and stop when accelerometer comes to a stable state, which is identified by INT pin of accelerometer.

    OV_Renesas said:
    When you have read both sensors, you should de-activate/put them into sleep mode and have Extended Sleep Mode enabled.
    After reading data from pressure sensor, the sensor is put int shutdown mode using its shutdown pin.

    After sensor is shutdown, user_app_adv_start() is called which is same as mentioned in "ble_app_sleepmode" example. And in this method just before starting advertisement its setting extended sleep mentioned in below code snippet.

    void user_app_adv_start(void)
    {
        // Schedule the next advertising data update
        app_adv_data_update_timer_used = app_easy_timer(APP_ADV_DATA_UPDATE_TO, adv_data_update_timer_cb);
        
        struct gapm_start_advertise_cmd* cmd;
        cmd = app_easy_gap_undirected_advertise_get_active();
        
        // Add manufacturer data to initial advertising or scan response data, if there is enough space
        app_add_ad_struct(cmd, &mnf_data, sizeof(struct mnf_specific_data_ad_structure), 1);
    
        // Set extended sleep with OTP copy during advertising
        arch_set_extended_sleep(true);
    
        app_easy_gap_undirected_advertise_start();
    }

    Hence, I am assuming device will be in extended sleep mode after advertisement is completed. Or should I explicitly call arch_set_extended_sleep() after user_app_adv_start() is called?

    I hope I have covered all the points here. Please let me know if any more information is required.

    Kind Regards,

    Harish.

  • Sorry for replying in unformatted, as when I posted with format text, it said again it require moderation and did not showed here. Not sure what was the problem here.

  • Hi Harish,

    Thank you for the reply.
    I can confirm I have received your replies. 
    Let me check on this and I will get back to you as soon as possible.

    Kind Regards,
    OV_Renesas

  • Hi Harish,

    On Extended Sleep Mode, all the peripheral blocks are shut down but the BLE core is active so you can advertise/scan and maintain a connection as well. 
    However, when you want to access any of the peripheral blocks, you should call the following function to get into Active State:

    arch_set_sleep_mode(ARCH_SLEEP_OFF);

    On user_config.h file you can set the default value of the Extended Sleep Mode that the device will get:
    /******************************************
     * Default sleep mode. Possible values are:
     *
     * - ARCH_SLEEP_OFF
     * - ARCH_EXT_SLEEP_ON
     * - ARCH_EXT_SLEEP_OTP_COPY_ON
     *
     ******************************************
     */
    static const sleep_state_t app_default_sleep_mode = ARCH_EXT_SLEEP_ON;

    I suppose you have set that to ARCH_SLEEP_OFF, because the default sleep mode value will be used before going into the user_app_init custom callback function.
    So, you go on the user_app_init custom callback function (I assume with Extended Sleep Off) and you initialize the Accel Sensor, the pressure sensor and you set the wake-up controller for the INT pin of the Accel Sensor.
    When the INT pin of the Accel sensor goes High, the accel_sensor_interrupt_cb function is called. 
    In the accel_sensor_interrupt_cb function you call the app_resume_system_from_sleep function. Where do you enter in any Sleep Mode? Which Sleep Mode is that and can you share the implementation? 
    On the accel_sensor_interrupt_cb function, you call the analysis_timer which immediately ends up calling the pressure_sensor_init function, which will initialize the pressure sensor again and register the INT pin of the pressure sensor on the Wake-Up controller. This way, the wake-up controller is overwritten, and the Accel Sensor INT pin is no longer registered in the wake-up controller. That is why I suggest using the wkupct2_register_callback and wkupct2_enable_irq functions for the Pressure sensor. 
    When the Pressure Sensor INT pin goes into Low state, you will end up on the pressure_sensor_range_complete_cb function where you will read the pressure sensor values and check the State of the Accel INT pin. 
    If the Accel INT pin is still high, you will keep on reading the pressure sensor data, but if the Accel INT pin goes to Low state, you will start an app_easy_timer which when it expires it will end up triggering the on_analysis_completed function. 
    In the on_analysis_completed function, you shut down the pressure sensor and you disable the Wake-up controller set for the pressure sensor. This should be done by the following function:
    /**
     ****************************************************************************************
     * @brief Unregisters WKUP_QUADEC_IRQn use by Wakeup controller and calls
     * wkupct_quad_disable_IRQ.
     * @note WKUP_QUADEC_IRQn interrupt will be disabled, only if also the Quadrature Decoder
     * has unregistered from using the IRQ.
     * @return WKUPCT_QUADEC_ERR_OK, WKUPCT_QUADEC_ERR_RESERVED
     ****************************************************************************************
     */
    wkupct_quadec_error_t wkupct_disable_irq(void);
    
    #if defined (__DA14531__)
    /**
     ****************************************************************************************
     * @brief Unregisters WKUP_QUADEC_IRQn use by Wakeup controller and calls
     * wkupct_quad_disable_IRQ.
     * @note WKUP_QUADEC_IRQn interrupt will be disabled, only if also the Quadrature Decoder
     * and Wakeup controller has unregistered from using the IRQ.
     * @return WKUPCT_QUADEC_ERR_OK, WKUPCT_QUADEC_ERR_RESERVED
     ****************************************************************************************
     */
    wkupct_quadec_error_t wkupct2_disable_irq(void);
    #endif

    After that you call another function, analysis_complete_callback, which I do not see what it does but I suppose it calls the user_app_adv_start function. In the user_app_adv_start you enable the Extended Sleep Mode with OTP copy on. Do you intend to burn your FW into the OTP or the SPI Flash? 
    If you burn the FW into the SPI Flash you should use the arch_set_extended_sleep(false); parameter in the function. 
    This way, you should start advertising in Extended Sleep Mode and wait until a central device initiates a connection. 
    However, before you start advertising you set the Wake-up controller for the Accel INT pin. If the Accel INT pin gets triggered while you are advertising what do you want to happen? 
    Also, in the pressure_sensor_range_complete_cb function, when you check the status of the Accel INT pin, if it has changed from High to Low and back to High before you were able to get the pressure sensor data how would you know to stop the Pressure Sensor and send the first data via BLE? 
    This is why I suggest the 2 different wake-up controllers for both Sensors. You can set the wake-up controller for the Accel sensor, one time at the beginning of your project in order to catch the Accel INT pin and initialize the Pressure Sensor, and you can set it again while the Pressure Sensor is reading data in order to see if the INT pin has gone to Low state so it can trigger a stop. 

    From what you have shared, I believe you are handling the app_easy_timers you are using correctly. 
    However, I would like to know how you have implemented any sleep mode. 
    I can see that you followed the ble_app_sleepmode example. But on this specific example when we go into Extended Sleep Mode without any advertising, we shut down the BLE core as well.
    This is done in the user_app_adv_undirect_complete custom callback function which is triggered when advertising is stopped:
    void user_app_adv_undirect_complete(uint8_t status)
    {
        // Disable wakeup for BLE and timer events. Only external (GPIO) wakeup events can wakeup processor.
        if (status == GAP_ERR_CANCELED)
        {
            arch_ble_ext_wakeup_on();
    
            // Configure wakeup button
            app_button_enable();
        }
    }

    Generally, in Extended Sleep Mode the device can wake-up from:

    But by calling the arch_ble_ext_wakeup_on function we disable the BLE core, and we are no longer able to wake-up by the BLE timer (app_easy_timer) or by BLE events:
    /**
     ****************************************************************************************
     * @brief       Puts the BLE core to permanent sleep. Only an external event can wake it up.\
     *              BLE sleeps forever waiting a forced wakeup. After waking up from an external 
     *              event, if the system has to wake BLE up it needs to restore the default mode 
     *              of operation by calling app_ble_ext_wakeup_off() or the BLE won't be able to
     *              wake up in order to serve BLE events!
     *
     * @exception   Warning Assertion
     *              if rwip_env.ext_wakeup_enable is 0 since it wouldn't be possible to wake-up the 
     *              BLE core in this case.
     ****************************************************************************************
     */
    void arch_ble_ext_wakeup_on(void);

    So, your Sleep Mode implementation might affect your timers and the work flow of your project.
    You could also run the project with debugger attached, no sleep mode will be implemented with debugger attached, and monitor the timer_hnd variables to see if there is an issue when initializing or expiring the timers. 
    I hope this could be helpful so you can see where your project halts. 

    Kind Regards,
    OV_Renesas

  • Hi OV_Renesas,

    Thanks a lot for the detailed response.

    I suppose you have set that to ARCH_SLEEP_OFF, because the default sleep mode value will be used before going into the user_app_init custom callback function.
    So, you go on the user_app_init custom callback function (I assume with Extended Sleep Off) and you initialize the Accel Sensor, the pressure sensor and you set the wake-up controller for the INT pin of the Accel Sensor.

    I am using ARCH_EXT_SLEEP_ON as a default sleep mode in user_config.h:

    I suppose you have set that to ARCH_SLEEP_OFF, because the default sleep mode value will be used before going into the user_app_init custom callback function.

    This is surprising, as I am setting ARCH_EXT_SLEEP_ON as default mode and in user_app_init() I could call accel_sensor_init() which is interacting with sensor over I2C and is working fine as I could see I2C data in Logic Analyser and also Accel sensor is giving INT as per my initialization.

    In the accel_sensor_init() it is calling enable_accel_sensor_interrupt() which is setting wake-up controller as is working fine:

    When the INT pin of the Accel sensor goes High, the accel_sensor_interrupt_cb function is called. 
    In the accel_sensor_interrupt_cb function you call the app_resume_system_from_sleep function. Where do you enter in any Sleep Mode? Which Sleep Mode is that and can you share the implementation? 

    Yes, in this accel_sensor_interrupt_cb() method I am calling app_resume_system_from_sleep() which has code like:

     

    I am calling wdg_freeze() as I do not want to advertise as soon as wakeup(Please refer the tread for the reason of doing it (:nmi_handlerc-issue), I need to do some sensor access and analysis and then advertise. I am taking care of calling wdg_resume() in like this:

     

    On the accel_sensor_interrupt_cb function, you call the analysis_timer which immediately ends up calling the pressure_sensor_init function, which will initialize the pressure sensor again and register the INT pin of the pressure sensor on the Wake-Up controller. This way, the wake-up controller is overwritten, and the Accel Sensor INT pin is no longer registered in the wake-up controller. That is why I suggest using the wkupct2_register_callback and wkupct2_enable_irq functions for the Pressure sensor. 

    Definitely I can start using two wake-controllers separately like wkupct1 for accel and wkupct2 for pressure sensor. However, once accel gives the INT via wkupct1, I no longer need it to wake-up until pressure sensor analysis is done. Hence I re-configured wkupct1 to take care of pressure sensor interrupt. Once all the analysis is done, in on_analysis_completed() I am calling enable_accel_sensor_interrupt() again which will take care of enabling wkupct1 for accelerometer sensor INT. I hope this is fine. However, as suggested I will start using both wkupct1 and wkupct2.

    However, I would like to know how you have implemented any sleep mode. 
    I can see that you followed the ble_app_sleepmode example. But on this specific example when we go into Extended Sleep Mode without any advertising, we shut down the BLE core as well.
    This is done in the user_app_adv_undirect_complete custom callback function which is triggered when advertising is stopped:

    So,on on_analysis_completed() the following actions are done in the following sequene:

    1. pressure_sensor_power_off();

    2. disable_pressure_sensor_interrupt();

    3. Evaluate "send_ble_signal" to TRUE or FALSE depend on the application logic.

    3. analysis_complete_callback(send_ble_signal); // This is callback handler for analysis_complete_cb() which code was mentioned below: 

    4. enable_accel_sensor_interrupt();

    static void analysis_complete_cb(bool send_ble_signal){
      if(send_ble_signal){
       user_app_adv_start();
      }
    }
    
    

    And the user_app_adv_start is default method with just one change in the morning on line 333, changed to "false" after seeing your suggestion.

    But by calling the arch_ble_ext_wakeup_on function we disable the BLE core, and we are no longer able to wake-up by the BLE timer (app_easy_timer) or by BLE events:

    Once analysis is completed, after completing the advertisement, module is went into extended sleep mode and as I mentioned in the above, I am setting up wake-up controller to wake from accel INT by calling enable_accel_sensor_interrupt(); in step-4 of on_analysis_completed(). app_easy_timer() was used after the system wake to start the pressure sensor measurements and to create a delay after the accelerometer come to stable state.

    I hope I have answered all and is clear now. 

    Just an update, I am still facing the issue of  not calling pressure_sensor_range_complete_cb() by wkupct1 after some time, once more observation I did after enabling wdg_freeze() and wdg_resume() was, as soon as I stop debugging session, accel INT is working fine, but pressure_sensor_range_complete_cb() never called, not even once.

    As you mentioned my sleep modes are not working or some thing related to it, but could not figure out what I missed. As a next immediate step, from my side I will change code to use two separate wake-up controllers for accel INT and pressure sensor INT. However, shall I do any changes or any suggestions?  

    Thanks & Regards,

    Harish. 

  • Hi Harish,

    Thank you for the reply and the feedback.

    This is surprising, as I am setting ARCH_EXT_SLEEP_ON as default mode and in user_app_init() I could call accel_sensor_init() which is interacting with sensor over I2C and is working fine as I could see I2C data in Logic Analyser and also Accel sensor is giving INT as per my initialization.

    Are you working with one of our Development Kits or with a custom board?
    If it is one of our Development Kits, could you use the SmartSnippets Toolbox with the Power Profiler tool in order to monitor the current consumption of the device? 
    Are you able to see the device going into Extended Sleep Mode? 
    The Extended Sleep Mode could be halted until all the Peripherals was shutdown. That is why you should initialize the I2C communication each time you want to access the sensors, and release the I2C when you are not using it. 
    Another explanation would be that you are in Extended Sleep Mode, you are trying to receive the data but you are receiving wrong data. I do not think this is the case since you are able to see the data being transferred though the logic analyzer on the I2C lines.

    Just an update, I am still facing the issue of  not calling pressure_sensor_range_complete_cb() by wkupct1 after some time, once more observation I did after enabling wdg_freeze() and wdg_resume() was, as soon as I stop debugging session, accel INT is working fine, but pressure_sensor_range_complete_cb() never called, not even once.

    While you have the debugger attached you will not be able to enter to any sleep mode. 
    If you want to monitor the device while in sleep mode you should use the arch_printf function to print messages into a terminal so you can have an understanding of what functions have been executed.
    Could you also please clarify which GPIOs have you used for the Accel sensor INT pin and the Pressure sensor INT pin? 

    As you mentioned my sleep modes are not working or some thing related to it, but could not figure out what I missed. As a next immediate step, from my side I will change code to use two separate wake-up controllers for accel INT and pressure sensor INT. However, shall I do any changes or any suggestions?  

    Thank you for following our recommendations. Try to make sure that you are handling the Wake-Up controller and the app_easy_timers correctly. So there is not a chance that a timer is still running if it is not supposed to and that you initialize each timer and the wake-up controller each time you want to use it. 
    Keep also in mind that the app_easy_timer is from the BLE core so it has a Priority of 1 and the Wake-up controller sets a Priority of 2. So if they occur on the same time, the app_easy_timer will be executed first.

    Kind Regards,
    OV_Renesas

  • After entering all the data and replies, when I posted replies it showed like this and the reply was not showing here. Last time also the same problem. Not sure how to get rid of this. Please suggest shall I type all the replies again or you already got the replies and you can do moderate and post here.