请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TMS320TCI6618 大家好、我希望使用内置解决方案生成一个随机数、其中包含在安全加速器中实现的器件。 但我一直在激活它。
请注意、我正在寻找一个能够启用真正的数字发生器的解决方案。
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.
大家好、我希望使用内置解决方案生成一个随机数、其中包含在安全加速器中实现的器件。 但我一直在激活它。
请注意、我正在寻找一个能够启用真正的数字发生器的解决方案。
我尝试对寄存器进行编程、但它们不显示任何更改。 实际上、我确实认为电源域已关闭、需要对.gel 进行一些确认。
如果需要,我会为您发布代码示例:
struct Trng{
unsigned long int lsw;
unsigned long int msw;
unsigned long int status;
unsigned long int reserved;
unsigned long
int 控件;
unsigned long int config;
};
int count=0;
unsigned long int 结果;
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"=(long int *)、%02350208
);volatile lw_sw-lw_sw/print/lw./lw./lw./lw.sw-sw/lw./print/lw.
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);
//启用 TRNG 模块
* cmd_status |= 0x8;
LM (LE、"cmd_status config_edited %08x"、* cmd_status);
//在 Trng config
ptr->config = static_cast 中设置最大和最小重填周期 (0x8200);
//配置
中的启动命令 ptr->control = static_cast (0x10001);
//打印 curent config
LM (LE、"TRNG-content_conf control %08x"、PTR->control);
LM (LE、"TRNG-content_conf config %08x"、 ptr ->配置);
while (count < 10)
{
if (ptr -> status = 0x00000001)
{
Result = ptr -> msw;
LM (LE、"test TRNG:%d"、Result);
if (results = lastResult)
{
LM (LE、"same TRNG 2次:\n %d %d "、lastResult)
;}r = 0x0000Result;}结果= 0x0000Result;}