Setup
-
SDK/OS: nRF Connect SDK v3.1.0, Zephyr v4.1.99
-
Board: custom board
Summary
I am measuring the time from reset (or power-on) to the first user code execution on the nRF5340 application core. Consistently, 90 ms elapses before my earliest possible SYS_INIT(EARLY, 0) callback runs. I need to understand whether this delay is expected and whether any part of it can be reduced.
What I measured
I added the following instrumentation to bootloader/mcuboot/boot/zephyr/main.c to emit GPIO pulses at the earliest possible Zephyr init levels:
static inline void init_spike_pin(void)
{
nrf_gpio_cfg_output(NRF_GPIO_PIN_MAP(1, 0));
}
static inline void spike(void)
{
nrf_gpio_pin_set(NRF_GPIO_PIN_MAP(1, 0));
nrf_gpio_pin_clear(NRF_GPIO_PIN_MAP(1, 0));
}
static int timing_early_init(void)
{
init_spike_pin();
spike();
return 0;
}
SYS_INIT(timing_early_init, EARLY, 0);
static int timing_pre_kernel_1_init(void)
{
spike();
spike();
return 0;
}
SYS_INIT(timing_pre_kernel_1_init, PRE_KERNEL_1, 0);Using a logic analyzer I measured the time from the reset event (or 3V3 rail rise) to the first GPIO pulse. It is consistently 90ms.
The delay is consistent across all reset sources.
Questions:
1. Is 90 ms from reset to first instruction expected on the nRF5340 application core?
2. What specifically runs during this 90 ms?
3. Is there any way to reduce this delay?
For context, my application has a hard requirement to be operational within 300 ms of power-on, so any reduction here will be highly beneficial.
Happy to share further details if helpful. Thank you in advance!