Other Parts Discussed in Thread: SYSCONFIG
Tool/software: Code Composer Studio
I'm running into an exception with the code below. TRNG was added in SysConfig. hwiStackPeak is 516/1024. Could this be a memory leak?
#include <ti/drivers/TRNG.h>
#include <ti/drivers/cryptoutils/cryptokey/CryptoKeyPlaintext.h>
#define KEY_LENGTH_BYTES 3
void* mainThread(void *arg0) {
...
TRNG_Handle rndHandle;
int_fast16_t rndRes;
CryptoKey entropyKey;
uint8_t entropyBuffer[KEY_LENGTH_BYTES];
rndHandle = TRNG_open(CONFIG_TRNG_0, NULL);
if (!rndHandle) {
while (1);
}
CryptoKeyPlaintext_initBlankKey(&entropyKey, entropyBuffer,KEY_LENGTH_BYTES);
rndRes = TRNG_generateEntropy(rndHandle, &entropyKey);
if (rndRes != TRNG_STATUS_SUCCESS) {
while (1);
}
TRNG_close(rndHandle);
...
}