Skip to content
Permalink
Browse files

soc: arm: nordic_nrf: unrevert provide custom busy_wait implementations

This reverts commit bd24b31.

While the test case failure described in #14186 is associated with the
cycle-based busy-wait implementation, that test is fragile, and fails
less frequently once the incongruence between ticks-per-second and the
32 KiHz RTC clock are resolved.  It also assumes that the system clock
is more stable than the infrastructure underlying the the busy-wait
implementation, which is not necessarily true.

The gross inaccuracies in the standard busy-wait on Nordic described in
issue #11626 justify restoring the custom solution.

As this applies to all Nordic devices, move the setting to the top-level
Kconfig.defconfig.

See: #11626 (comment)

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
  • Loading branch information...
pabigot authored and carlescufi committed Apr 27, 2019
1 parent c76dd1e commit da3f7feaf8f48b04d018b25ee8c729013880361a
@@ -17,6 +17,9 @@ config SYS_CLOCK_TICKS_PER_SEC
int
default 128

config ARCH_HAS_CUSTOM_BUSY_WAIT
default y

config BUILD_OUTPUT_HEX
default y

@@ -59,4 +59,16 @@ static int nordicsemi_nrf51_init(struct device *arg)
return 0;
}

#define DELAY_CALL_OVERHEAD_US 2

void z_arch_busy_wait(u32_t time_us)
{
if (time_us <= DELAY_CALL_OVERHEAD_US) {
return;
}

time_us -= DELAY_CALL_OVERHEAD_US;
nrfx_coredep_delay_us(time_us);
}

SYS_INIT(nordicsemi_nrf51_init, PRE_KERNEL_1, 0);
@@ -81,4 +81,9 @@ static int nordicsemi_nrf52_init(struct device *arg)
return 0;
}

void z_arch_busy_wait(u32_t time_us)
{
nrfx_coredep_delay_us(time_us);
}

SYS_INIT(nordicsemi_nrf52_init, PRE_KERNEL_1, 0);
@@ -12,9 +12,6 @@ source "soc/arm/nordic_nrf/nrf91/Kconfig.defconfig.nrf91*"
config SOC_SERIES
default "nrf91"

config ARCH_HAS_CUSTOM_BUSY_WAIT
default y

config SYS_POWER_MANAGEMENT
default y

0 comments on commit da3f7fe

Please sign in to comment.
You can’t perform that action at this time.