raspberrypi / pico-sdk

BSD 3-Clause "New" or "Revised" License
3.24k stars 837 forks source link

hard_assert in initialise_rand() when all perf counters in use #1733

Closed roliver-rpi closed 2 weeks ago

roliver-rpi commented 2 weeks ago

pico_rand will hard_assert when attempting to initialise_rand() if it is unable to find any bus fabric performance counters that are not in their reset state.

kilograham commented 2 weeks ago

See

// PICO_CONFIG: PICO_RAND_ENTROPY_SRC_BUS_PERF_COUNTER, Enable/disable use of a bus performance counter as an entropy source, type=bool, default=1, group=pico_rand
#ifndef PICO_RAND_ENTROPY_SRC_BUS_PERF_COUNTER
#define PICO_RAND_ENTROPY_SRC_BUS_PERF_COUNTER 1
#endif

You can turn off use of a perf counter as an entropy source by setting PICO_RAND_ENTROPY_SRC_BUS_PERF_COUNTER=0 in your compile definitions