This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Why Bluetooth Go to system-off mode, sramon can not be stored.

Hello: Why Bluetooth Go to system-off mode, sd_power_ramon_set can not be stored. In D: \ RAM save nrf51_sdk_v5_2_0_39364 \ nrf51822 \ Board \ nrf6310 \ s110 \ ble_app_rscs \ arm program。I devzone.nordicsemi.com/.../ram-and-off-mode, where the test is no problem, but the test will not work in the Bluetooth inside,this is why? Here is my code: 1.0 Define a test: static uint8_t test[3] __attribute__( ( section( "NoInit"), zero_init) ); 2.0 In the wake main:

int main(void)
              {
                  // Initialize
                 leds_init();
	         if (test[0]== 0X31)
                 {
		        nrf_gpio_pin_clear(LED_2);
                        nrf_gpio_pin_set(LED_3);
                        nrf_gpio_pin_set(LED_4);
                 } 
		else
	       {
		  nrf_gpio_pin_set(LED_2);
		  nrf_gpio_pin_clear(LED_3);
                  nrf_gpio_pin_clear(LED_4);
	      }
           buttons_init();
           ble_stack_init();
           bond_manager_init();
           timers_init();
          gap_params_init();
          advertising_init();
          services_init();
          sensor_sim_init();
          conn_params_init();
          sec_params_init();

         // Start execution
         application_timers_start();
         advertising_start();

        // Enter main loop
        for (;;)
        {
          power_manage();
        }
}
3.0 This is my code into the system-off mode:
            test[0]=0X31;
	    test[1]=0X32;
	    test[2]=0X33;
	
           // sd_power_ramon_clr (POWER_RAMON_OFFRAM0_Msk | POWER_RAMON_OFFRAM1_Msk);
            sd_power_ramon_set(POWER_RAMON_OFFRAM0_Msk | POWER_RAMON_OFFRAM1_Msk);
	     // Go to system-off mode (this function will not return; wakeup will cause a reset)
             err_code = sd_power_system_off();
             APP_ERROR_CHECK(err_code);

When I wake up when the key value is not saved TEST do not know where is the problem? I sd_power_ramon_set function here plus sd_power_ramon_clr (POWER_RAMON_OFFRAM0_Msk | POWER_RAMON_OFFRAM1_Msk), the value of test is not clear。

2.jpg

1.jpg

Related