Other Parts Discussed in Thread: CC2530, Z-STACK
Dear all,
I have been studying using CC2530 to collect data continuously for a long period of time. The total size I'm about to store is around 100KB (I'm using 256KB version). I first checked out the OSAL.c and tried the method of creating nv_item and read/write the item, but I'm not sure about the max item size and item operations seem to be inside one page (2KB). So if the item size is small, I need a lot of items for my 100KB data. Even worse is that every time I create an item, it also creates a header structure, wasting available memory. I checked the memory space and now I'm able to view the content of each flash bank (only content from 0x800~0xFFFF will change accordingly) in the debug mode, after I added below codes during initialization:
for(int i = 0;i<8;i++)
MEMCTR = i;
But I'm not sure where I can start storing my data without overwriting anything crucial for the zstack. Inside f8w2530.xcl, I can see that there are 7 pages reserved:
// Internal flash used for NV address space: reserving 6 pages.
// NV memory segment size must coincide with page declarations in "hal_board_cfg.h" file.
//
-D_ZIGNV_ADDRESS_SPACE_START=(((_NR_OF_BANKS+1)*_FIRST_BANK_ADDR)-0x3800) //My guessing: (8+1)*0x8000-0x3800=0x4 8000 -0x3800 = 0x4 4800, which is in the bank4 ?
-D_ZIGNV_ADDRESS_SPACE_END=(_ZIGNV_ADDRESS_SPACE_START+0x2FFF)
-Z(CODE)ZIGNV_ADDRESS_SPACE=_ZIGNV_ADDRESS_SPACE_START-_ZIGNV_ADDRESS_SPACE_END
//
// The last available page of flash is reserved for special use as follows
// (addressing from the end of the page down):
// 16 bytes Lock bits
// 8 bytes IEEE address space (EUI-64)
...
As for other 121 pages, I didn't find any information and I'm wondering if these pages are free for use.
Another peculiar thing is that when I increased the bank number, I could see only bank 4,5,6,7 are filled with 0xFFFF (bank 0,1,2,3 are filled with other values), while I had already performed 'erase' using flash programmer. And the last page of bank 7 contained 0xFFFF rather than the information page, which I found is actually in the space 0x7800~0x7FFF (not XBANK space).
Does that mean I can use bank 4~7 without any concern of damaging the firmware?
Thank you very much for your time and I'm looking forward to your replies. Have a nice day.
Best regards, Ray