Spurious Util::get_true_random_vals() / stm32_rand_generate_blocking() timeout failure
Author: rsaxvcCreated Sep 27, 2026Updated Sep 27, 2026
Bug Report
I haven't seen this impact a single real device as this seems uncalled in master, but this is an area of code worthy of some suspicion.
Issue details
Every 2^32 microseconds - timeout_us (~1.2 hours) or so there's some risk that stm32_rand_generate_blocking() will spuriously fail early with a false timeout when uint32_t run_until = hrt_micros32() + timeout_us overflows and becomes less than hrt_micros32();
Version master / 4c98c9221ad6933ab1c70fba8a3900ba2ff02f3b
Platform [X] All
Hardware type Looks like any STM32 ChibiOS with #if HAL_USE_HW_RNG && defined(RNG)
Source: ArduPilot/ardupilot