Skip to content

timer: cortex_m_systick: Compilation error if CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME is defined #100040

Description

@ydamigos

Describe the bug

Timer cortex_m_systick fails to build if CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME is defined

Regression of commit b9a39a7

Regression

  • This is a regression.

Steps to reproduce

west build -p -b qemu_cortex_m3 samples/hello_world -- -DCONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME=y

Relevant log output

/home/user/projects/zephyrproject/zephyr/drivers/timer/cortex_m_systick.c:23:48: error: division by zero in #if
   23 | #define CYC_PER_TICK (z_clock_hw_cycles_per_sec/CONFIG_SYS_CLOCK_TICKS_PER_SEC)
      |                                                ^
/home/user/projects/zephyrproject/zephyr/drivers/timer/cortex_m_systick.c:33:20: note: in expansion of macro 'CYC_PER_TICK'
   33 | #if (COUNTER_MAX / CYC_PER_TICK) == 1

Impact

Not sure

Environment

v4.30 Release

Additional Context

No response

Activity

  1. added
    bugThe issue is a bug, or the PR is fixing a bug
    on Nov 25, 2025
  2. added theissue type on Nov 25, 2025
  3. self-assigned this
    on Nov 25, 2025
  4. added a commit that references this issue on Dec 5, 2025
    cc4bc45
  5. added a commit that references this issue on Feb 2, 2026
    6360997
  6. added a commit that references this issue on Mar 15, 2026
    739668a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

RegressionSomething, which was working, does not anymorearea: ARMARM (32-bit) ArchitecturebugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bug

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions