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

What is the Module ID and Block ID

I am using the nrf51822 and I want to use the pstorage library to save some data which is "power lost can save",but I cloud not find the example of it.I am using the SDK 8.1.0 and after init the pstorage by pstorage_init() function.I got error when I store and load .I think maybe is the module ID and block ID problem.I don't know if I set it at this way is right pstorage_handle_t PID_local={1,260096};

Parents
  • Yes ,you are right!!
    Now I want to transplant the pstorage function to the BLE mesh.But I found it stucked in while(pstorage_wait_flag) { power_manage(); } //Sleep until store operation is finished.
    Here is my main function:

        /** @brief main function */
    int main(void)
    {   	
    		uint32_t err_code;
    
        /* Enable Softdevice (including sd_ble before framework */
        SOFTDEVICE_HANDLER_INIT(MESH_CLOCK_SOURCE, NULL);
    		
        // Enable BLE stack 
        ble_enable_params_t ble_enable_params;
        memset(&ble_enable_params, 0, sizeof(ble_enable_params));
        ifdef S130
        ble_enable_params.gatts_enable_params.attr_tab_size   = BLE_GATTS_ATTR_TAB_SIZE_DEFAULT;
     
        endif
        ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
        err_code = sd_ble_enable(&ble_enable_params);
        APP_ERROR_CHECK(err_code);
        endif
        err_code = softdevice_ble_evt_handler_set(sd_ble_evt_handler); 
        APP_ERROR_CHECK(err_code);
    	err_code = softdevice_sys_evt_handler_set(rbc_mesh_sd_evt_handler);
    	APP_ERROR_CHECK(err_code);
    
    		scheduler_init();       
    		pstorage_test_store_and_update();
    
        while (true)
        {
            app_sched_execute();			
            power_manage();
        }    
    }
    
Reply
  • Yes ,you are right!!
    Now I want to transplant the pstorage function to the BLE mesh.But I found it stucked in while(pstorage_wait_flag) { power_manage(); } //Sleep until store operation is finished.
    Here is my main function:

        /** @brief main function */
    int main(void)
    {   	
    		uint32_t err_code;
    
        /* Enable Softdevice (including sd_ble before framework */
        SOFTDEVICE_HANDLER_INIT(MESH_CLOCK_SOURCE, NULL);
    		
        // Enable BLE stack 
        ble_enable_params_t ble_enable_params;
        memset(&ble_enable_params, 0, sizeof(ble_enable_params));
        ifdef S130
        ble_enable_params.gatts_enable_params.attr_tab_size   = BLE_GATTS_ATTR_TAB_SIZE_DEFAULT;
     
        endif
        ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
        err_code = sd_ble_enable(&ble_enable_params);
        APP_ERROR_CHECK(err_code);
        endif
        err_code = softdevice_ble_evt_handler_set(sd_ble_evt_handler); 
        APP_ERROR_CHECK(err_code);
    	err_code = softdevice_sys_evt_handler_set(rbc_mesh_sd_evt_handler);
    	APP_ERROR_CHECK(err_code);
    
    		scheduler_init();       
    		pstorage_test_store_and_update();
    
        while (true)
        {
            app_sched_execute();			
            power_manage();
        }    
    }
    
Children
Related