You copied the Doc URL to your clipboard.

Base iteration

The base iteration is used to find the minimum sample counter value for which Arm® TRNG operates properly, under typical operating conditions.

These conditions are:

  • The second-longest ring-oscillator.
  • Typical voltage.
  • Typical temperature.
  • Typical process corner.

The minimum sample counter value is found by calling CC_TST_TRNG with increasing values of sampleCount (starting with 1) until it exits successfully.

Note

In many systems, the test succeeds immediately (with sampleCount=1), which is an expected and even desirable result.

Finding minimum sample counter value:

/* Buffer size should be at least 25K Bytes (200K bits) */
#define BUF_SIZE    (25*1000)
#define TRNG_TST_OK  0
	char Buffer[BUF_SIZE];
	int sampleCount;
	for (sampleCount = 1; ; sampleCount ++) {
		int rv = CC_TST_TRNG(
					/* regBaseAddress = */  TRNG_HW_ADDRESS,
					/* TRNGMode = */        0,
					/* roscLength = */      2,
					/* sampleCount = */     sampleCount,
					/* buffSize = */        sizeof(Buffer),
					/* dataBuff_ptr = */    Buffer);
		if (rv == TRNG_TST_OK) break;
	}
	minValidSampleCount = sampleCount;
Was this page helpful? Yes No