cc2541开发板存储不够,怎么拓展?

2019-07-18 15:17发布

cc2541开发板存储不够,怎么拓展?

我在cc2541 256k的开发板上有最大十几k的数据需要,所以首先想到用osal_snv_X系列的函数进行读写,但是在翻阅代码时,发现一共可用的nvram页才2页,因此这是 不够的,我的问题是,为什么只有2页充当nvram,能否向系统多要些页面来充当nvram,如果可以,该如何修改代码
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
2条回答
fdvcxhtg
1楼-- · 2019-07-18 15:29
本帖最后由 冒汗的心情 于 2016-3-28 13:49 编辑

Performing Flash Erase From Flash Memory
Note that while executing program code from within flash memory, when a flash erase or write operation is
initiated the CPU stalls, and program execution resumes from the next instruction when the flash controller
has completed the operation.
The following code example of how to erase one flash page in the CC2530 is given for use with the IAR
compiler:
#include <ioCC2530.h>
unsigned char erase_page_num = 3; /* page number to erase, here: flash page #3 */
/* Erase one flash page */
EA = 0; /* disable interrupts */
while (FCTL & 0x80); /* poll FCTL.BUSY and wait until flash controller is ready */
FADDRH = erase_page_num << 1; /* select the flash page via FADDRH[7:1] bits */
FCTL |= 0x01; /* set FCTL.ERASE bit to start page erase */
while (FCTL & 0x80); /* optional: wait until flash write has completed (~20 ms) */
EA = 1; /* enable interrupts */
6.3.2 Different Flash Page Size on CC2533
The flash page size has been reduced from 2 KB (2048 bytes) on CC2530, CC2531, CC2540, and
CC2541 to 1 KB (1024 bytes) on CC2533. When performing page-erase operations on the flash memory,
the page to be erased is addressed with the register bits FADDRH[6:0] on CC2533 as opposed to
FADDRH[7:1] on CC2530, CC2531, CC2540, and CC2541. The page-lock bits are still placed in the
upper 16 bytes of the last accessible flash page.这个是在其他帖子看到的,可以吗
gfhtrdfd
2楼-- · 2019-07-18 16:01
fdvcxhtg 发表于 2016-3-28 13:46
Performing Flash Erase From Flash Memory
Note that while executing program code from within flash memory, when a flash erase or write operation is
initiated the CPU stalls, and program execution resumes from the next instruction when the flash controller

哦,我试试,谢谢

一周热门 更多>