Hi Team,
We are using the nRF52840 DK for one of our project, as part of that we are using the RNG functionality with CC310 Library.
When we call this "CRYS_RND_GenerateVector" function at fixed interval like for every 6 or 5 sec, over the period of time board is getting the WDT Reset.
Could any one help me out what is causing this issue, I have shared the code snippet as well for this.
1. Is there any way we can generate the RNG without using the CC310 Library like by using the any SW dependent library.
2. Is there any Dependency between CC310 RNG and WDT Peripherals.
How best we can use the RNG functionalities by using any library for nRF52840 Apart from CC310.
Regards,
Srinivas.V
uint32_t rng_vector_generate(uint8_t * const p_target, uint8_t size)
{
uint8_t rndTest_AddInputData[RANDOM_BUFF_SIZE] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F};
rndState_ptr = &rndState;
rndWorkBuff_ptr = &rndWorkBuff;
NVIC_EnableIRQ(CRYPTOCELL_IRQn);
NRF_CRYPTOCELL->ENABLE = 1;
/*Init SaSi library*/
ret = SaSi_LibInit();
if (ret != SA_SILIB_RET_OK)
{
return ret;
}
ret = CRYS_RndInit(rndState_ptr, rndWorkBuff_ptr);
if (ret != SA_SILIB_RET_OK)
{
return ret;
}
/*Generate random vector 1*/
ret = CRYS_RND_GenerateVector(rndState_ptr,RANDOM_BUFF_SIZE, p_target);
if ((ret != SA_SILIB_RET_OK) && (ret == CRYS_RND_RESEED_COUNTER_OVERFLOW_ERROR ))
{
/*Set additional input for rng seed*/
ret = CRYS_RND_AddAdditionalInput(rndState_ptr, rndTest_AddInputData, 16);
if (ret != SA_SILIB_RET_OK)
{
return ret;
}
/*Reseed rnd using added input (new seed will be generated using additional input)*/
ret = CRYS_RND_Reseeding(rndState_ptr, rndWorkBuff_ptr);
if (ret != SA_SILIB_RET_OK)
{
return ret;
}
ret = CRYS_RND_GenerateVector(rndState_ptr,RANDOM_BUFF_SIZE, p_target);
if (ret != SA_SILIB_RET_OK)
{
return ret;
}
}
SaSi_LibFini();
// Disable the CryptoCell IRQ
NVIC_DisableIRQ(CRYPTOCELL_IRQn);
NRF_CRYPTOCELL->ENABLE = 0;
ret = CRYS_RND_UnInstantiation(rndState_ptr);
}