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

nrf51822 can't sleep

my project can't goto sysoff mode, (desktop2)( project based on mouse demo)

m_prw_mgmt_set_sysoff_timeout(DEFAULT_BTLE_INACTIVITY_DISCONNECT_PERIOD);//can't sleep here!

my code.DEFAULT_BTLE_INACTIVITY_DISCONNECT_PERIOD //10s The default: 1hour

when timeout,system goto off,

m_coms_ble_wakeup_prepare

goto↓

m_coms_ble_disable

goto↓

/ /Save bond information to flash
    err_code = ble_bondmngr_bonded_centrals_store();
    APP_ERROR_CHECK(err_code);

goto↓

// Save System Attributes, if changed.
if(sys_attr_changed())//==1

M_cmd_queue.conut change "1" from "0"

:goto↓

pstorage_access_wait()

do
    {
             app_sched_execute();        
               err_code = pstorage_access_status_get(&count);
        if (err_code != NRF_SUCCESS)
        {
            return err_code;
        }        
    }
    while(count != 0);//***can't pass***

my steps:

1, download the hex 2, power on mouse 3, try to connect 4, not found any host
5, connect timeout 6, error

: System Attributes in RAM is different from that in flash.

is this ↑cause the proble? how to fix it?

Parents Reply Children
No Data
Related