Skip to content

random function is not generating random numbers #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5hu5ky opened this issue Apr 1, 2021 · 4 comments
Open

random function is not generating random numbers #21

5hu5ky opened this issue Apr 1, 2021 · 4 comments

Comments

@5hu5ky
Copy link

5hu5ky commented Apr 1, 2021

random function is not generating random numbers.

For example:

...
print("Random Value: ", atecc.random(rnd_min=200, rnd_max=1000024))
...

always returns 2040

...
print("Random Value: ", atecc.random(rnd_min=0, rnd_max=1024))
...

always returns 1016

Tested on a RPi 3B v1.2 using 3.3v
Code used to test - https://github.com/adafruit/Adafruit_CircuitPython_ATECC/blob/master/examples/atecc_simpletest.py

@AdamCummick
Copy link

@5hu5ky I've seen the exact same behavior. Locking the chip started generating new random numbers, though it's created some other issues(CRC mismatch, can't find device) I'm still digging though.

@5hu5ky
Copy link
Author

5hu5ky commented Apr 20, 2021

@AdamCummick - thanks for the tip on locking the chip. I will try that as well...

@dexterac
Copy link

dexterac commented Feb 6, 2022

I am noticing same issue. Chip only generates 40 or 2040.

@DJDevon3
Copy link

I've noticed the same behavior with the same exact value being set as the random value. I figured out the CRC Mismatch issue is due to too high of a wake frequency clock. You can manually set the frequency to 75000 and it will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants