Hi, @youssef ! Thanks for that!
I just figured out what was happening, I was looking for low-power functions inside both USB and UWB code, but it was actually the HFCLK.
The HFCLK is used by the USB driver, the nrf_drv_clock_hfclk needs a request for each peripheral/resource using it, USB has a request, but UWB doesn’t. The nrf_drv_clock_hfclk is set like only USB is using it and when USB releases it stops. The solution is to add a new request for UWB:
In main_cli()
look for BoardInit()
, it calls peripherals_init()
which has the clock initialization.
There you will find a call for nrf_drv_clock_lfclk_request(NULL)
, right before this line you should add the nrf_drv_clock_hfclk_request(NULL)
.
This single call will solve the problem, but Nordic sets the call with a verification before proceeding:
nrf_drv_clock_hfclk_request(NULL);
while (!nrf_drv_clock_hfclk_is_running())
{
// spin lock
}
Well, that’s it! Thanks for spotting this issue!
Kind regards!