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.

CC1310: Write to NV Api

Part Number: CC1310


Hello All,


I am trying to write / read custom data to the flash memory in CC1310 along with TI Stack 15.4. As per the Stack 15.4 Guide, there are 2 pages available for user data. I am trying to use the NVOCTP driver provided with the stack.


The function I have created to read is:

static NVINTF_nvFuncts_t *pNV = NULL;

void provisioning_init(void)
{
	mac_Config_t Main_user1Cfg = { 0 };
	pNV = &Main_user1Cfg.nvFps;
}

int8_t provisioning_check(void)
{
	//check if the sensor mote has already been provisioned
	//check the 23rd byte from the end of the user NV page
	//if 0xAA : mote provisioned

	CUSTOM_UART_write_string("--- doing provisioning check", 1);

	NVINTF_itemID_t temp = {0,0,0};
	uint8_t prov_check_val;
	uint8_t ret;

	if((pNV != NULL) && (pNV->readItem != NULL))
	{
		pNV->readItem(temp, 0, 1, (void*)&prov_check_val);
		CUSTOM_UART_write_num_32("--- NV read provisioning check value : 0x", prov_check_val, 16, 1);
	}
}

The contents of provisioning_init function have been copied from the file ssf.c

I am not quite sure what the first argument of the NV readItem function (of the type NVINTF_itemID_t) is supposed to be so I just used 0.

Thanks for the help