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

read/write flash in 51422

Hi,

I am using nRF51422 with s130 soft device along with SDK v9.0. I am trying to read/write flash memory using pstorage module. I am using BLE nus service for data transfer. I am following thread as mention below :

https://devzone.nordicsemi.com/question/15271/how-can-i-write-10kb-of-data-to-internal-flash/?answer=17300#post-id-17300

In my code example_cb_handler is never called. Code snippet is like this:

SampleCode.txt.txt

Can u please tell me, where i am going wrong?

  • Hi, have you made sure to pass the SoC events received from the softdevice to pstorage_sys_event_handler() in your application? If not you can do it by adding the following code to your application:

    at the end of ble_stack init() in main.c:

    // Register with the SoftDevice handler module for sys events.
    err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
    APP_ERROR_CHECK(err_code);
    

    Then declare the system event handler above stack init:

    static void sys_evt_dispatch(uint32_t sys_evt)
    {
        pstorage_sys_event_handler(sys_evt);
    }
    
Related