What the biggest size of file system can be adjusted? (20737S)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

===

SDK: 2.1.

Tag: 920737.

app: hello-sensor.
OS: Android smarphone

Download size ~ 25KB

NV size: need to use "8KB"

===

We need to enlarge our file system(NV) size in btp file as

DLConfigVSLength from 1024(1KB) to 8KB but
system seems to fail storing data to NV; I wonder that
how the max. size of NV (DLConfigVSLength) can I adjust in
SDK2.1 with 920737S? smaller than 8K?

0 Likes
1 Solution

I think the link hinted by boont does contain the answer you want to know

nvram: number of locations to write to

>>>

Each page is 32 bytes long. There is a 3 byte overhead per item. If your item takes 1 byte, the items is 4 bytes long, but will take up the entire 32 byte page. The next item will start at the next page. If you item is 30 bytes long, it will get 2 pages because the header needs to be stored with it too.

<<<


Can you paste the settings for ConfigDSLocation and DLConfigVSLength so people may be able to provide some suggestions.


View solution in original post

0 Likes
7 Replies
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

I think this was discussed in the following thread...

nvram: number of locations to write to

Anonymous
Not applicable

Hi boont and j.t

From the link I didnt find the answer yet.

coz from the link,
it's file system known to 1K(1024B) and then based on total file system (1K) to decide
- how many IDs(0 to 0x6F) can be used, or how much size each ID can have.

- What is stored for each ID in file system, like header or some bits for a ID besides ID body.

but for the current problem i meet with is how much size of total file system can I use in 920737.
in 20737_EEPROM.btp file, I found when  I adjust DLConfigVSLength  from 1K to 4K, my test codes
read/write will be failed (where, ConfigDSLocation is also modified correctly) so the question is
can NV size enlarge to > 4k, like 10k or other bigger size? TKS.


)

0 Likes

I think the link hinted by boont does contain the answer you want to know

nvram: number of locations to write to

>>>

Each page is 32 bytes long. There is a 3 byte overhead per item. If your item takes 1 byte, the items is 4 bytes long, but will take up the entire 32 byte page. The next item will start at the next page. If you item is 30 bytes long, it will get 2 pages because the header needs to be stored with it too.

<<<


Can you paste the settings for ConfigDSLocation and DLConfigVSLength so people may be able to provide some suggestions.


0 Likes
Anonymous
Not applicable

If you use EEPROM, you may try to use cfa_bsc_OpExtended() to access full range of EEPROM space.

There is no need to change the default VS location and size.

Just use the space after the DS to store whatever you want.

Hope it helps~~

Anonymous
Not applicable

To use full range of eeprom, check following discussion to see if it helps:

WICED Smart BCM92073X EEPROM and SFLASH Layout

0 Likes
Anonymous
Not applicable

Hi, maxsong,

thanks for ur detail info.

0 Likes
Anonymous
Not applicable

The maximum size of NVRAM that can be accessed/used depends on:

  • the size of the storage media(eeprom or sflash)
  • the size of VS section defined by DLConfigVSLength
  • the maximum ID of the record(This is fixed, 0x6F for user, 0x7E for system)
  • the size of each record(max size is 255Byte)

If the size of each record you save to NVRAM is less than 29 byte(plus 3 byte header info), it will occupy a page which is 32 bytes. Then total size of NVRAM you can use is:

32*0x6F= 3552 bytes

If the size of each record occupies 255+3 bytes, the total size of NVRAM you can use is:

(255+3)*0x6F= 28638 bytes

Check function prototype of bleprofile_WriteNVRAM(). Attention to type of itemLength is UINT8.

vsID: ID number of NVRAM.  Valid values are 0 to 0x6F.


/**

* \brief Write NVRAM

* \ingroup bleprofile

*

* \details This function writes bytes to the NVRAM(EEPROM).  Application can specify

//* any \c vsID between 0 and 0x6F.  Stack allocates memory and copies contents of the

* payload provided.  The same payload can be retrieved later on using the same

* @ vsID by calling \c bleprofile_ReadNVRAM.

*

* \param vsID ID number of NVRAM.  Valid values are 0 to 0x6F.

* \param itemLength Number of bytes to write.

* \param payload Address of the \c itemLength bytes to be stored in the NVRAM.

*

* \return

*        \li Number of bytes written to the NVRAM.

*        \li 0 if attempt to write failed.

*

*/

UINT8 bleprofile_WriteNVRAM(UINT8 vsID, UINT8 itemLength, UINT8 *payload);