Part Number: CC2642R
Hello,
I would like to fill an entropy pool of 64 bytes in 10ms.
After reading the documentation, I think I can do this by first changing the entropy pool compile flag to 8 (TRNGCC26XX_ENTROPY_POOL_SIZE=8) and recompiling TRNGCC26XX.c. I have done this and I have verified that that entropyPoolBuffer has 8 elements instead of 4.
Second, I've created a second TRNG configuration with a entropy generation cycles of 60000. When I open the handle, I've verified the samplesPerCycle on the object is 60000.
I then wrote the following test code for Simple Peripheral when I press the left button:
/*********************************************************************
* @fn SimplePeripheral_trng_test
*
* @brief tests TRNG.
*
* @param none
*/
static void SimplePeripheral_trng_test(void)
{
static TRNG_Handle handle = NULL;
CryptoKey entropyKey1, entropyKey2;
uint8_t entropyBuffer1[32] = {0};
uint8_t entropyBuffer2[32] = {0};
if(handle == NULL)
handle = TRNG_open(CONFIG_TRNG_1, NULL);
if(handle != NULL)
{
//TRNGCC26XX_setSamplesPerCycle(handle, 60000);
CryptoKeyPlaintext_initBlankKey(&entropyKey1, entropyBuffer1, 32);
TRNG_generateKey(handle, &entropyKey1);
CryptoKeyPlaintext_initBlankKey(&entropyKey2, entropyBuffer2, 32);
TRNG_generateKey(handle, &entropyKey2);
//TRNG_close(handle); Leave TRNG handle open
}
else
{
ASSERT(0);
}
}
I captured the following with Energy Trace and it's taking 50ms for the test code:

Can you help me understand why it's taking 50msec when I'm expecting 10ms.
Thanks,
Dawn
