aon_timer_is_running() is true on boot in SDK 2.3.1! Previously the timer would have to be started #3180
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk#3180
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pico SDK 2.3.1 on Pico 2 W
On boot the aon_timer_is_running() is reported as started, yet does not have a "current" calendar date set. Previous versions of the SDK did not have the aon timer running at boot.
Test case:
int main( void )
{
stdio_init_all();
sleep_ms(2000);
...
}
Use Case:
I check the aon_timer to see if the SNTP has sync-ed time to the Pico 2 W. The can pull calendar and time stamps from aon.
Can you clarify what you mean by “On boot”? The Always On timer continues running over typical chip resets (e.g. resets from
picotoolorOpenOCD, see 7.3 in the datasheet for more details), so this could be expected behaviour.Additionally, nothing should have changed in this area in 2.3.1, so could you double check you can’t reproduce the issue with 2.3.0 or 2.2.0?
By on boot i mean on first run of main function.
Confirmed on Pico SDK 2.3.0 that
aon_timer_is_running()==false on entry into main. On 2.3.1 aon_timer_is_running()==true.
You suggest that the timer may be continuing to run after a software load via picotool or swd. If that was the case then the aon timer would retain count of current date in seconds. In fact its return near zero count, suggesting it has been reset and started in bootloader code prior to main being started.
It is possible something very strange has happened in my environment, but I honestly cant see what.
Can you provide minimal example program code that shows this behaviour? I can’t reproduce this using the code you included, when I run that it is always false.
Could you also confirm that you’re seeing this issue on a power-on boot?
I will do that and update here.
Thanks for screening.
Further testing shows that this is state of AON carrying over from the prior build. That SWD load and soft resets are not stopping the timer. Apologies for reporting.
I suggest it is worth making it clear that the AON timer survives flashing and other resets in the documentation somewhere. Unless you are expecting that behaviour, the best advice is to always stop the timer at the beginning of main.
Learnt something new about the Pico 2 today, so thanks for that.
Plus additional side effect of low_power module. Going into a lower power dormant mode turns on the aon timer if it wasn't previously running, and it continues to run on wake-up. Understandable, but also an undocumented side effect of low_power_dormant_for_ms.
@jondurrant I've raised a docs fix in #3187 - does that resolve this issue for you?
@jondurrant Just asking out of curiosity: Based on your new understanding, do you know why you were claiming that this was a change in behaviour between SDK 2.3.0 and SDK 2.3.1 ?
Hi,
I was seeing the 2.3.0 to 2.3.1 as issue due to order of testing and using
SWD rather than hard power reset. Plus adding complexity of some low power
stability fixes requiring work around between 2.3.0 and 2.3.1 which ment I
wasnt testing exactly the same code base.
Jon
On Mon, 7 Sept 2026, 12:47 Andrew Scheller, @.***>
wrote:
Yes thank you for doing that.
Jon
On Mon, 7 Sept 2026, 12:33 will-v-pi, @.***> wrote: