[U-Boot] Random number generator - why I need it

Hi,
I'm using customized U-Boot 2011.03 (for Amlogic platform).
What I need is solution for getting random number (on first boot) which will be written to ubootenv. Let's say I have 100 strings stored in string array of board file.
On first boot I have to pick one random string from list and write it to ubootenv (range 0..99). Writing to ubootenv is not problem, problem is randomization. My current tries ended up in getting same number each time (2 different algorithms). Does anyone have solution for this?
Keep in mind that my PCB does not have RTC battery and does not store time, so on each power on clock is back to default (1970).
Thanx and best regards, Stanislav Vlasic

Hello Stanislav,
On 18-07-14 16:41, Stanislav Vlasic wrote:
What I need is solution for getting random number (on first boot) which will be written to ubootenv.
mm, you forgot to describe why.. and what you mean with random.
Anyway, can't the host programming the device not provide a pseudo random number. It likely has far better provision for that...
Regards, Jeroen
participants (2)
-
Jeroen Hofstee
-
Stanislav Vlasic