完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
你好,
有没有办法在ARM9上生成随机数?我不想使用LBC RAND()/sRAND(),而是宁可求助于NXPMCU产品(HTTP://www. nxp.com)/NoSQL文件/LPC31 3031,PDF中存在的处理器原生RNG,所以它也可能存在于FX3中。 如果是,有一个简单的方法来使用它吗?如果不是,有没有其他建议的方式来产生一个像样的熵量(大约4K在一个镜头)? 提前感谢, Markus 以上来自于百度翻译 以下为原文 Hi there, is there a way to generate random numbers by facilities on the ARM9? I don't want to use the libc rand()/srand() but would rather resort to the processors native RNG, which does exist in the NXP MCU product (http://www.nxp.com/documents/data_sheet/LPC3130_31.pdf), so it might as well be present in the FX3. If it is, is there an easy way to use it? If not, is there any other recommended way to generate a decent amount of entropy (about 4k at a shot)? Thanks in advance, /Markus |
|
相关推荐
3个回答
|
|
|
嗨,Markus,
我们没有一个随机发生器上的FX3硅。唯一的硬件选项是设置一个GPIO定时器,具有低周期(周期=要产生的值的范围),并对其进行采样以获得随机数。 CYU3PGPIOSETFIXCONFIGIG函数可用于设置定时器: CYU3PGPIOFieldCopyIt t GPIOCONF= { CyFoE,CyFalse,CyFalse,CyFalse, CYU-U3PGPIOOYMODEMIDEA静态,/GPIO本身不受影响,我们只需使用定时器。*/ CyuU3pGPooIoNoIIn,/*没有与此定时器关联的中断。*/ CYU-U3PGPIOIOTIMERYHYFRQ,/*在GPIOIIT中选择的高时钟频率下运行GPIO。*/ 0,/*启动定时器在0。*/ RealthyMax,/*将周期设置为要生成的数字的范围。*/ 0,门槛是不在乎的。*/ }; CYU3PGPIOSET-FixFixFigg(0,GPIOCONF); 然后可以使用CYU3PGPIOXION SAMPrPulOW函数获得当前计时器值作为随机数。 请注意,需要将随机数MAX设置为低值以获得良好的熵。 谢谢, Sai Krishna。 以上来自于百度翻译 以下为原文 Hi Markus, We do not have a random generator on the FX3 silicon. The only hardware option is to set up a GPIO timer with a low period (period = range of values to be generated) and sample it to get the random number. The CyU3PGpioSetComplexConfig function can be used as follows to set up the timer: CyU3PGpioComplexConfig_t gpioConf = { CyFalse, CyFalse, CyFalse, CyFalse, CY_U3P_GPIO_MODE_STATIC, /* The GPIO itself is not to be affected, we just use the timer. */ CY_U3P_GPIO_NO_INTR, /* No interrupts associated with this timer. */ CY_U3P_GPIO_TIMER_HIGH_FREQ, /* Run the GPIO at the high clock frequency selected at GpioInit. */ 0, /* Start timer at 0. */ RANDOM_MAX, /* Set the period to the range of the numbers to be generated. */ 0 /* The threshold is don't care. */ }; CyU3PGpioSetComplexConfig (0, &gpioConf); The CyU3PGpioComplexSampleNow function can then be used to get the current timer value to serve as a random number. Please note that the RANDOM_MAX needs to be set to a low value to be able to get good entropy. Thanks, Sai Krishna. |
|
|
|
|
|
我想你也可以使用ApCYU3pGETTIME获取系统时间。我做了一些运算,得到一个随机数。
以上来自于百度翻译 以下为原文 I think you can also use the api CyU3PGetTime to get the system time. I do some operation on it to get a random number . |
|
|
|
|
|
你好
谁能告诉我如何将CYU3PGPIO复杂采样的时钟号转换为时间 以上来自于百度翻译 以下为原文 hi who can tell me how to convert the number of tick from CyU3PGpioComplexSampleNow to time |
|
|
|
|
只有小组成员才能发言,加入小组>>
786个成员聚集在这个小组
加入小组cyUSB3014一直显示2.1,不能到3.0情况,谁遇到过
7088 浏览 0 评论
2477 浏览 1 评论
2166 浏览 1 评论
4031 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
2074 浏览 6 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
7572浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
6118浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
742浏览 2评论
710浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
7965浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 17:48 , Processed in 0.597349 second(s), Total 76, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2624