Skip to content

Commit

Permalink
Bluetooth: nordic ECB hal: Bugfix for simulation
Browse files Browse the repository at this point in the history
Fix in the do_ecb() function
In real HW this function busy waits for the ECB to be done.
In simulation with the POSIX arch a WFE was added to avoid that
infinite loop.
But this function is called with the ECB interrupts disabled.
In normal builds other interrupts will awake the CPU very soon
after entering into that WFE, and the problem was not discovered.

But, in controller only builds, during some conformance tests,
the loop will hang as no other interrupts are coming.

=> Replace the WFE() with a k_busy_wait (only for simulation)

Signed-off-by: Alberto Escolar Piedras <[email protected]>
  • Loading branch information
aescolar authored and carlescufi committed Dec 12, 2018
1 parent afbbb97 commit fc0f803
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/bluetooth/controller/hal/nrf5/ecb.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static void do_ecb(struct ecb_param *ecb)
(NRF_ECB->EVENTS_ERRORECB == 0) &&
(NRF_ECB->ECBDATAPTR != 0)) {
#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
__WFE();
k_busy_wait(10);
#else
/*__WFE();*/
#endif
Expand Down

0 comments on commit fc0f803

Please sign in to comment.