Summary of the use of NRF51822 pstorage

Source: Internet
Author: User

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

Hi

You can register for more than one page with a single pstorage_register command. Then you can write to more than one page, but the following rules apply:

    • One pstorage_clear command can only clear data within the same page
    • One pstorage_update command can only update data within the same page
    • One Pstorage_store command can only write data to a single block
    • One pstorage_load command can only read data from a single block

Also, when registering-than a single page, registered blocks must is page aligned.

e.g. registering blocks each with the bytes is registering the whole pages since 128 * 16=2048. It is also page aligned since each page is a bytes and 8*128=1024.

To clear the both pages you must issue and clear commands:

 pstorage_clear(&block_0_handle, 1024); pstorage_clear(&block_8_handle, 1024);

Update 28.10.2014 I include a pstorage sample code below. Hopefully you can use this code to overcome your issues. Report back with any complications.

Ble_app_template_with_flash_operations.zip

Update 27.3.2015 The example above is tested with SDK 6.1, Softdevice 7.0.0/7.1.0 and second revision nRF51 harware. It should also work with SDK 6.1, Softdevice 7.1.0, and third revision nRF51. For further compatibility of different SDKs and softdevices, and to see the nRF51 hardware revision of the Chip/board has, see nRF51 compatibility matrix

Update 18.8.2015 Below is a similar pstorage example made for SDK 8.1 and Softdevice S110 8.0.0

Ble_app_template_with_pstorage_operations_nrf51dk.zip

Update 22.1.2016 Below is another pstorage example for SDK 8.1 and Softdevice S110 8.0.0. Tested on NRF51-DK board. This example writes pstorage The result on the UART (instead of Segger RTT as in example from 18.8.2015). You can see the result in a UART terminal as e.g. Realterm (38,400 BAUD; no parity; 1 stop bit; flow control enabled).

Ble_app_template_with_pstorage_sdk_8_1_0.zip

Summary of the use of NRF51822 pstorage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.