In the uwb_rng_request function at the end it waits for a semaphore to be posted, signaling the end of transactions:
|
err = dpl_sem_pend(&rng->sem, DPL_TIMEOUT_NEVER); // Wait for completion of transactions |
|
if (err != DPL_OK) { |
|
goto early_exit; |
|
} |
But this semaphore is release in tx_comeplete():
|
switch(rng->code) { |
|
case UWB_DATA_CODE_SS_TWR ... UWB_DATA_CODE_DS_TWR_EXT_END: |
|
RNG_STATS_INC(tx_complete); |
|
if (rng->control.complete_after_tx) { |
|
dpl_sem_release(&rng->sem); |
|
rng_issue_complete(inst); |
|
} |
|
rng->control.complete_after_tx = 0; |
|
return true; |
|
break; |
|
default: |
|
return false; |
|
} |
|
} |
This function is then calling all the rng_complete functions, these could be scheduling an another request, or setting the radio to listen is this is done in ISR context or in another thread with a higher priority than the thread that triggered the uwb_rng_request then the first thread will be locked waiting for the semaphore to be released. This could fix itself in the long run, but if the device was set to listen forever then that thread would be definitively blocked.
In the
uwb_rng_requestfunction at the end it waits for a semaphore to be posted, signaling the end of transactions:uwb-core/lib/uwb_rng/src/uwb_rng.c
Lines 535 to 538 in 66f4686
But this semaphore is release in
tx_comeplete():uwb-core/lib/uwb_rng/src/uwb_rng.c
Lines 913 to 926 in 66f4686
This function is then calling all the
rng_completefunctions, these could be scheduling an another request, or setting the radio to listen is this is done in ISR context or in another thread with a higher priority than the thread that triggered theuwb_rng_requestthen the first thread will be locked waiting for the semaphore to be released. This could fix itself in the long run, but if the device was set to listen forever then that thread would be definitively blocked.