This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640R2F: How to change sector size for NVS?

Part Number: CC2640R2F


Hello,

I want to change sector size to 2KB for NVS.

I changed sector size in my app code like below for example, but it caused hard fault exception.

Is there anything else to do for it?

#define MY_NVS_REGIONS_BASE     0x18000
#define MY_NVS_SECTORSIZE       0x800
#define MY_NVS_REGIONSIZE       (MY_NVS_SECTORSIZE * 4)

/* Allocate objects for NVS Internal Regions */
NVSCC26XX_Object nvsCC26xxObjects[4];

/* Hardware attributes for NVS Internal Regions */
const NVSCC26XX_HWAttrs nvsCC26xxHWAttrs[4] = {
	{
		.regionBase = (void *)flashBuf,
		.regionSize = MY_NVS_SECTORSIZE,
	},
	{
		.regionBase = (void *)(flashBuf + MY_NVS_SECTORSIZE),
		.regionSize = MY_NVS_SECTORSIZE,
	},
	{
		.regionBase = (void *)(flashBuf + MY_NVS_SECTORSIZE*2),
		.regionSize = MY_NVS_SECTORSIZE,
	},
	{
		.regionBase = (void *)(flashBuf + MY_NVS_SECTORSIZE*3),
		.regionSize = MY_NVS_SECTORSIZE,
	}
};

Thanks,

Calvin

  • Hello Calvin,

    Are you sourcing your work from the nvsinternal example?  Can you attach your full CC2640R2_LAUNCHXL.c/ file along with the Board.h and application file (i.e. nvsinternal.c), provide a debug screenshot of the hard fault exception as well as determine what function is called to cause it, and explain what NVS settings you've used previously which did not cause a similar issue?

    Regards,
    Ryan