nRF51822之pstorage使用摘要
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 for more than a single page, registered blocks must be page aligned.
E.g. registering 16 blocks each with 128 bytes is registering two whole pages since 128 * 16=2048. It is also page aligned since each page is 1024 bytes and 8*128=1024.
To clear the two pages you must issue two 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 that 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 hardware. For further compatibility of different SDKs and softdevices, and to see the nRF51 hardware revision of the chip/board you have, 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 result on 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
nRF51822之pstorage使用摘要的更多相关文章
- NRF51822之pstorage介绍
This information applies to the following SoftDevices: S110, S120, S130, S310 Introduction Persisten ...
- nRF51822 配对之device_manager_init 调用,以及保证 用户数据存储 的Flash 操作不与device manager 模块冲突
昨天 遇到了一个烦心的问题,被老外客户怼了两句,恼火,很想发火,发现英文不够用,算了,就不跟直肠的鬼佬一般见识.说正事. 最近的一个nRF51822+MT2503 钱包防丢项目,准备接近量产了.昨天做 ...
- java根据html生成摘要
转自:http://java.freesion.com/article/48772295755/ 开发一个系统,需要用到这个,根据html生成你指定多少位的摘要 package com.chendao ...
- Atitit HTTP 认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结
Atitit HTTP认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结 1.1. 最广泛使用的是基本验证 ( ...
- 2、摘要函数——MD2/MD4/MD5数字签名
摘要是用来防止数据被私自改动的方法,其中用到的函数叫做摘要函数.这些函数的输入可以是任意大小的信息,但是输出是大小固定的摘要.摘要有个重要的特性:如果改变了输入信息的任何内容,即使改变一位,输出也将发 ...
- 前端学HTTP之摘要认证
前面的话 上一篇介绍的基本认证便捷灵活,但极不安全.用户名和密码都是以明文形式传送的,也没有采取任何措施防止对报文的篡改.安全使用基本认证的唯一方式就是将其与SSL配合使用 摘要认证与基本认证兼容,但 ...
- Java 消息摘要 散列 MD5 SHA
package xxx.common.util; import java.math.BigInteger; import java.security.MessageDigest; import jav ...
- rpm查询命令摘要
任务 命令 显示软件包的相关信息 rpm -q -i NAME 列出软件包中含有的所有文件 rpm -q -i NAME 列出软件包中含有的配置文件 rpm -q -c NAME 列出软件包中含有的文 ...
- [nRF51822] 14、浅谈蓝牙低功耗(BLE)的几种常见的应用场景及架构(科普类干货)
蓝牙在短距离无线通信领域占据举足轻重的地位—— 从手机.平板.PC到车载设备, 到耳机.游戏手柄.音响.电视, 再到手环.电子秤.智能医疗器械(血糖仪.数字血压计.血气计.数字脉搏/心率监视器.数字体 ...
随机推荐
- loadrunner解决“服务器正在运行中”方法
问题现象: 这个问题在上家公司遇见过,今天无意中找到了解决办法: 解决方法: 打开任务管理器: 找到这个进程:ThumbProcess.exe,关掉这个进程即可解决. 今天运行lr的vugen报错 解 ...
- H5开发之Eclipes 编码乱码问题
1.编码不对 a.对某文件或某工程更改编码: 鼠标移到工程名或文件名,右键->Properties->Resource->Text file enCoding ->更改编码(G ...
- 2016.6.17 计算机网络复习要点之PPP协议
点对点协议PPP是目前使用最广泛的数据链路层协议. 1.PPP协议的特点: **我们知道因特网用户通常需要连接到某个ISP才能接入到因特网,PPP协议就是用计算机和ISP进行通信时所使用的数据链路层协 ...
- js:数据结构笔记14--高级算法
动态规划: 递归是从顶部开始将问题分解,通过解决所有分解出小问题来解决整体问题: 动态规划从底部开始解决问题,将所有小问题解决,然后合并掉一个整体解决方案: function dynFib(n) { ...
- hbase0.95.2部署
hbase0.95.2部署 下载安装包 hbase-0.95.2-cdh5.0.0-beta-1.tar.gz hbase需对应hadoop版本 解压 tar zxvf hbase-0.95.2-cd ...
- 【Linux/unix网络编程】之使用socket进行TCP编程
实验一 TCP数据发送与接收 [实验目的] 1.熟练掌握套接字函数的使用方法. 2.应用套接字函数完成基本TCP通讯,实现服务器与客户端的信息交互. [实验学时] 4学时 [实验内容] 实现一个服务器 ...
- 【BZOJ】1084: [SCOI2005]最大子矩阵(DP)
http://www.lydsy.com/JudgeOnline/problem.php?id=1084 有一个1A--- 本题没看懂,,不会啊囧..感觉完全设不了状态..看了题解,囧,m<=2 ...
- POJ 3270 Cow Sorting(置换群)
题目链接 很早之前就看过这题,思路题把,确实挺难想的,黑书248页有讲解. #include <cstdio> #include <cstring> #include < ...
- Mysql_mysql 性能分析及explain用法
1 使用explain语句去查看分析结果,如 explain select * from test1 where id=1;会出现:id selecttype table type possi ...
- winform学习-----理解小概念-20160517
1.MouseDown事件 当鼠标指针位于控件上并按下鼠标键时发生. 2.MouseUp事件 当鼠标指针在控件上并释放鼠标按键时发生. 与 mouseout 事件不同,只有在鼠标指针离开被选元素时,才 ...