softdevice设置keil部分

本文详细介绍了如何在NRF51822平台上烧写softDevice,并手动设置程序的位置和内存分配。具体步骤包括确定softDevice占用的ROM和RAM大小,计算程序存放位置及内存大小,并在Keil中进行相应设置。

需要先烧写softDevice,当然烧写什么样的你自定。

然后你的程序是跟在softDevice后面的,但是keil并不知道这点。所以需要手动设置

先来到options fof target----target

       接下来说下原理,我们的程序要紧跟在softDevice后。softDevice有一定的大小(我一直试着找到那篇文档里面有说各个版本的softDevice的ROM RAM占用大小,但是我还没找到,要是你知道了,我还不知道,请告诉我)。这里给出两个数据。

S110两个版本的ROM占用

                                   6.0.0--------80K

                                   7.0.0--------84K 或者88k(也可能是80k)参照某文档

 

RAM我还不知道,根据某文档的话,s110 ROM都是80k , RAM都是8K。可以根据这个配置,反正我这样配可以用

 

所以,现在的目标是要设置好这些,你的程序放在哪?你的程序用哪的内存?

 

我们刚才已经打开了options fof target----target

可以看到下面的IROM1 和 IRAM1前面已经勾上,这就是设置ROM / RAM空间的地方。

我们假设现在要烧写的是使用 80K ROM 和 8K RAM的softDevice。

NRF51822的ROM为256K ,RAM为16K,RAM基地址0x20000000

其中RAM有基地址,也就是操作内存位置=基地址+被操作内存序数

 

那么,我们放程序的地方就是 80K  ROM开始的地方,RAM就是8K RAM开始的地方

ROM的计算:      起始位置(dec 80)*(dec 1024)=(dec 81920)=(hex 14000)

                            大小计算((dec 256)-(dec 80))*(dec 1024)= (dec 180224)=(hex 2C000)

RAM的计算:     

                            起始位置(dec 8)*(dec 1024)+基地址=(dec 8192)=(hex 2000)+基地址 =0x20002000

                            大小计算((dec 16)-(dec 8))*(dec 1024)= (dec 8192)=(hex 2000)

 

所以根据计算填入就OK了。

如图:

 

在官方的文档中还有一些设置,我并没有关注,原因是不按他们的设置也能用,可能是我个人还有一些东西没有发现,还没调到。如果出现问题,请以官方文档为主

s110_nrf51_8.0.0 The main features of this release are the ability to set the size of the GATT Server Attribute Table when initializing the BLE stack, the possibility for the application to be notified when the SoftDevice receives scan requests, and the ability to disable RF channels for advertising. Changes to CPU availability during radio events, DC/DC converter configuration, and PPI channel allocations have been made to take advantage of the nRF51 series IC revision 3. The BLE API has been aligned to that of the S120 SoftDevice. Notes: This is a major release which has changed the Application Programmer Interface (API), requiring applications to be recompiled. This SoftDevice version is not Production tested on all IC revisions, and is not compatible with nRF51 IC revision 1. Users of the SoftDevice must verify the compatibility of their SoftDevice/IC combination for development and for production. Compatibility information is found in the nRF51 Series Compatibility Matrix, which can be downloaded from the Nordic Semiconductor web page. SoftDevice properties The SoftDevice Specification corresponding to this release is the S110 SoftDevice Specification v2.0. This version of the SoftDevice contains the Master Boot Record (MBR) version 1.0.1. The combined MBR and SoftDevice memory requirements for this version are as follows: Flash: 96 kB (0x18000 bytes). RAM: 8 kB (0x2000 bytes) (default value - dependent upon configured size of the GATT Server Attribute Table). New functionality SoftDevice The application can now configure the amount of memory reserved for the GATT Server Attribute Table when initializing the BLE stack (DRGN-3744). Configuration is optional. By default, the RAM reserved for the Attribute Table will be 0x700 bytes. This is the same default allocation as in the S110 v7.1.0. GAP The application can now configure the SoftDevice to deliver events when scan request packets are received (DRGN-2880, NRFFOETT-281). The application can now selectively dis
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值