In your firmware did you set the initial device address to 0xffffffffffff?
Does your function call return with success?
The issue is, within 7 boards, I will have 6 different addresses (so 2 boards actually end up having the same "random" address)
I assume there is little to no entropy on these system, so that would be why it's hard to generate many random addresses?
The function call should create pseudo-random addresses. The same address should certainly not appear within 6 iterations.
Is your NVRAM EEPROM or SFLASH?
When these duplicate addresses appear, are they the same addresses each time? Or is it always different duplicate addresses each time?
Are the two boards that produce duplicate addresses always the same two boards or do different boards produce duplicates each time?
I couldn't replicate the bug lately. Was I severely unlucky? Or maybe had an issue with my code. I don't really have time to try and replicate the issue. On the next batch on chips we program I will keep an eye open and report here if I see anything wrong.
Out of curiosity, how is it possible for the function to generate pseudo-random id? Each cpu we program has the exact same firmware image, where can entropy come from?
2 of 2 people found this helpful
I dug into this one a little bit and I found that our random number generator is a HW block introducing actual entropy into the API. Not pseudo-random as I had said before.
Additionally, I found that you may prevent possible duplicate numbers by postponing your call to the random generator (set random addr) to as late a time as possible in your firmware. Issues could present if the HW RNG doesn't have enough time to warm up.