soc: arm: nordic_nrf: unrevert provide custom busy_wait implementations
This reverts commit bd24b31139
.
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: https://github.com/zephyrproject-rtos/zephyr/issues/11626#issuecomment-487243369
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
parent
c76dd1edb7
commit
da3f7feaf8
4 changed files with 20 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue