From fc0f80391c6a788dc4108d890aa058f4524edf1a Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Tue, 11 Dec 2018 14:57:57 +0100 Subject: [PATCH] Bluetooth: nordic ECB hal: Bugfix for simulation 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 --- subsys/bluetooth/controller/hal/nrf5/ecb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/hal/nrf5/ecb.c b/subsys/bluetooth/controller/hal/nrf5/ecb.c index 7dc3c46be815e5..e3923f688eaf6d 100644 --- a/subsys/bluetooth/controller/hal/nrf5/ecb.c +++ b/subsys/bluetooth/controller/hal/nrf5/ecb.c @@ -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