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

pm_peer_new() causing "PM_EVT_ERROR_UNEXPECTED"

Hi,

I want to add new peer to peer manager using pm_peer_new().

pm_peer_id_t p1 = 0;

pm_peer_new(&p1,&bond_info,NULL);

there are no peers, so trying to add as peer_id 0. but this causing "PM_EVT_ERROR_UNEXPECTED" error in pm_evt_handler() function.

bond_info is filled with information.

Parents Reply
  • I have done the following

    1.Registering a Handler for fds events
    err_code = fds_register(fds_evt_handler);
    APP_ERROR_CHECK(err_code);

    2. Handle FDS_EVT_INIT event

    static void fds_evt_handler(fds_evt_t const * const p_evt)
    {
        if (p_evt->id == FDS_EVT_GC)
        {
           NRF_LOG_DEBUG("GC completed\n");
        }
        else if(p_evt->id == FDS_EVT_INIT)
        { 
           bFDSInitialized = true;
        }
    }

    but bFDSInitialized never becomes true. 

    and also I tried to give a delay of 25 Seconds before calling pm_peer_new() but the same error is coming.

    I don't think it will take that much time, is it?

    I am using the following setting in sdk_config.h

     #ifndef FDS_VIRTUAL_PAGES
    #define FDS_VIRTUAL_PAGES 3
    #endif

    means 2 for Data 1 for Garbage Collection

    but when I read memory garbage collection page tag is correct whereas the remaining 2 pages page tag is not correct (it has to be 0xDEADC0DE 0xF11E01FE)


Children
No Data
Related