This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320TCI6618: HELP with TRNG module in the Security accelerator

Part Number: TMS320TCI6618

Hi I'm looking to use the built-in solution to generated a random number with the parts implemented in the security accelerator. But I'm stuck with the activation of it.

Please I'm looking for a solution that can enable the TRUE NUMBER GENERATOR.

  • Hi,

    I've notified the team. They will post their feedback directly here.

    Best Regards,
    Yordan
  • Please check sections 2.14.1 and 4.5 of SPRUGY6B (Security Accelerator user guide). Section 2.14.1 describes (at a high level) that the SA LLD is used to abstract the registers that are described in 4.5. It is also likely that there is test code in the LLD that activates TRNG.
  • Thanks for the response. In fact I already read this parts of the Security Accelerator user guide.

    The main purpose of my research is about the utilization of the TRNG in standalone mode to generate a randoms numbers without generate it in the main cores.

    In fact I already find the registers of the TRNG part but after some research I found that I need to activate its power domain.
    Sow I am looking for some help to activate it.
  • Are you familiar with the .gel files that perform initialization when you connect the EVM to CCS? There is code there that performs the sequence for powering up all the PCS domains. I thought that it powers everything up by default. In any case you can use this for powering up PA/SA.
  • Thanks for the tips with the .get and the default state of the PCS domains. As I see the SA LLD deals with the TRNG and its configuration but I don't any download link about it. Do you have a link to download it and get the parts of the TRNG utilization.
  • I believe the SA is somewhat restricted and you must go through the TI FAE that supports your company. The other option is to program it directly using the register information in section 4.5 of the user guide.
  • I try to program the register but they doesn't show any changes. In fact I really think that the power domain are down and some acknowledgement about the .gel will be needed.

    I post a sample of the code for you if needed :

    	struct trng {
    		unsigned long int lsw;
    		unsigned long int msw;
    		unsigned long int status;
    		unsigned long int reserved;
    		unsigned long int intack;
    		unsigned long int control;
    		unsigned long int config;
    	};
    
    	int count=0;
    	unsigned long int result;
    	unsigned long int lastResult = NULL;
    	volatile trng* ptr = (trng *) 0x020e4000;
    	volatile long int * cmd_status = (long int *) 0x020C0008;
    	volatile long int * PDSTAT2 = (long int *) 0x02350208;
    	volatile long int * PDCTL2 = (long int *) 0x02350308;
    	LM(LE, "TRNG START") ;
    
    	//print current config
    	LM(LE, "TRNG-content_without_conf lsw %08x", ptr->lsw);
    	LM(LE, "TRNG-content_without_conf msw %08x", ptr->msw);
    	LM(LE, "TRNG-content_without_conf status %08x", ptr->status);
    	LM(LE, "TRNG-content_without_conf intack %08x", ptr->intack);
    	LM(LE, "TRNG-content_without_conf control %08x", ptr->control);
    	LM(LE, "cmd_status config %08x", *cmd_status);
    
    	//ENABLE TRNG module
    	*cmd_status |= 0x8;
    	LM(LE, "cmd_status config_edited %08x", *cmd_status);
    
    	//set up the max and min refill cycles in trng config
    	ptr->config = static_cast<unsigned int>(0x8200);
    
    	//startup fiel in the trng config
    	ptr->control = static_cast<unsigned int>(0x10001);
    
    	//print the curent config
    	LM(LE, "TRNG-content_conf control %08x", ptr->control);
    	LM(LE, "TRNG-content_conf config %08x", ptr->config);		
    	while(count < 10)
    	{
    		if(ptr->status == 0x00000001)
    		{
    			result = ptr->msw;	
    			LM(LE, "test TRNG: %d", result);
    			if ( result == lastResult)
    			{
    				LM(LE, "Same TRNG 2 times: \n %d \n %d ", lastResult, result);
    			}
    			else
    			{
    				lastResult = result;
    				
    			}
    		ptr->intack = 0x00000000;		
    		}
    	}

  • I'm still looking for some help with my project. Did you get any tips for my to try program it with registers.