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

Pstorage and flash crash

Hi Nordic team,

This problem bothers me for a very long time. I cannot find the root cause. I used nRF51822 IC. It uses SDK11 with softdevice S130 and bootloader (but I use it as a peropheral). I used pstorage to save device name, name length and os on. I found a problem that our product cannot work. I dumped the hex code from many sets. I found the isuue is that the pstorage is crash at 0x3b800 (please see the attach, left side is OK, right side is showing that the pstorage is modified and the set cannot work). Why the pstorage is modified? How to prevent the pstorage from being destroyed? It run default device name and device name length if the pstorage doesn't save any data. I use the pstorage data for device name and device name length if the pstorage has saved data. The address at 0x3b809 is just device name length and get it 0xc0 (see attach right side).

System locks at the following code. Incorrect device name length cause system reset at APP_ERROR_CHECK(err_code). Can anyone help me to solve it?

void gap_params_init(void)
{
...
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
    err_code = sd_ble_gap_device_name_set(&sec_mode, (const uint8_t *)pack.device_name, pack.device_name_length);
    APP_ERROR_CHECK(err_code);
...
}

err.png err2.png

Related