Other Parts Discussed in Thread: ENERGYTRACE
您好!
我想在10ms 内填充一个64字节的熵池。
阅读完文档后、我认为可以首先将熵池编译标志更改为8 (TRNGCC26XX_entropy_pool_size=8)并重新编译 TRNGCC26XX.c 来实现这一点 我已经这样做了、并且已经验证了 entropyPoolBuffer 具有8个元素而不是4个元素。
其次、我创建了第二个 TRNG 配置、其熵生成周期为60000。 当我打开句柄时、我已经验证了对象上的 samplesPerCycle 为60000。
然后、当我按下左侧按钮时、我为 Simple Peripheral 编写了以下测试代码:
/*********************************************************************
* @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);
}
}
我使用 Energytrace 捕获了以下内容、测试代码需要50ms 的时间:

您能不能帮助我理解为什么在我预计10ms 时需要50ms。
谢谢、
黎明
