物联网技术
直播中

gfhtrdfd

8年用户 339经验值
擅长:模拟技术
私信 关注
[问答]

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

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


我在cc2541 256k的开发板上有最大十几k的数据需要,所以首先想到用osal_snv_X系列的函数进行读写,但是在翻阅代码时,发现一共可用的nvram页才2页,因此这是 不够的,我的问题是,为什么只有2页充当nvram,能否向系统多要些页面来充当nvram,如果可以,该如何修改代码

回帖(2)

fdvcxhtg

2016-3-28 13:46:31
本帖最后由 冒汗的心情 于 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
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

2016-3-28 13:49:59
引用: 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

哦,我试试,谢谢
举报

更多回帖

发帖
×
20
完善资料,
赚取积分