driver: Timer / Counter initialization incorrect for timer2 with BLE on nRF52840 #69216
Labels
bug
The issue is a bug, or the PR is fixing a bug
platform: nRF
Nordic nRFx
priority: low
Low impact/importance bug
Describe the bug
An initialization value is incorrect if timer2 is enabled (and used in counter mode) with BLE (where timer0 and timer1 are disabled) on nRF52840.
Please also mention any information which could help others to understand
the problem you're facing:
drivers/counter/counter_nrfx_timer.c
uses a Nordic HAL value to initialize.timer
.This is out-of-sync with devicetree information as timer0 and timer1 are disabled but
timer2 is enabled because:
devicetree
implies that devicetree starts indexing instances from 0 based on enabled devices, and then indexes disabled devices. So, devicetree index for timer2 (0) and HAL index for timer2 (2) differ.
see: commit 9a27906
To Reproduce
Steps to reproduce the behavior:
samples/bluetooth/broadcaster
prj.conf
boards/nrf52840dk_nrf52840.overlay
with:reg
ininit_timer
. It is 0x40008000 and should be 0x4000a000Expected behavior
timer2 should operate correctly as a counter.
Impact
Very low priority (workaround is to revert commit above).
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: