Hi,
I am working on a CC2640 custom application, 4x4 package. I am using the BLE stack 2.2.
I am trying to add the code for the FCC test. I am setting the test up so that the sensor switches
to the next of the 3 modulated carriers every time it is powered off and powered back on.
While the application is running, it is reading a byte from the SNV and re-writing the SNV byte with
its incremented value. The write to the SNV is happening correctly (I checked this by re-reading
the write). When I power off and power the sensor back on, it does not remember the re-written
value. It is defaulting the test number to 0 every time I power it back on.
What am I missing?
Thanks,
Priya
#define FCC_TEST_NUM_NVID 0x80
static void SimpleBLEPeripheral_init(void)
uint8_t status = SUCCESS;
status = osal_snv_read(FCC_TEST_NUM_NVID, 1, &test_number); //read the test number from non-volatile memory
if (status != SUCCESS)
System_printf("SNV read fail");
uint8_t inc_test_number = (test_number+1)%3;
osal_snv_write(FCC_TEST_NUM_NVID, 1, &inc_test_number); //store the test number incremented by 1 back into the memory
//in preparation for power down followed by the next radio frequency test.
static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1)
{
// Initialize application
SimpleBLEPeripheral_init();
System_printf(" test_number = %d", test_number);
switch (test_number)
{
case 0:
// Power on first test TX_MOD, 2402 MHz, 0 dBm
{
HCI_EXT_ModemTestTxCmd(HCI_EXT_TX_MODULATED_CARRIER, 0);
}
break;
case 1:
// Power on second test TX_MOD, 2440 MHz, 0 dBm
{
HCI_EXT_ModemTestTxCmd(HCI_EXT_TX_MODULATED_CARRIER, 19);
}
break;
case 2:
// Power on third test TX_MOD, 2480 MHz, 0 dBm
{
HCI_EXT_ModemTestTxCmd(HCI_EXT_TX_MODULATED_CARRIER, 39);
}
break;
default:
break;
}