Skip to content

nrf9160: use 32Mhz HFCLK #29977

@parthitce

Description

@parthitce

Describe the bug

  • As per datasheet, user manual and hardware specification, doc, it's mentioned that nrf9160dk can run in 2 frequencies.
  1. 32KHz (32768Hz) from RTC
  2. 32MHz (32000000) from High Frequency Clock
  • Default value for CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC is 32Khz here.
  • Default value for SYS_CLOCK_TICKS_PER_SEC. is 32KHz here.

When compiling & running any sample applications for nrf9160 with the default hardware and software frequency of operation is 32KHz. With the default settings, nrf9160dk runs fine without any problem.

We want to run nrf9160 with High Frequency clock i.e 32MHz (32000000Hz). So to achieve the same, I added the below configurations to prj.conf.

CONFIG_NRF_RTC_TIMER=n
CONFIG_CORTEX_M_SYSTICK=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32000000
CONFIG_SYS_CLOCK_TICKS_PER_SEC=32000000

Adding this configuration to any sample application, fails to boot the target.

To Reproduce
Steps to reproduce the behavior:

  1. Compile any sample application with below configuration added to prj.conf
CONFIG_NRF_RTC_TIMER=n
CONFIG_CORTEX_M_SYSTICK=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32000000
CONFIG_SYS_CLOCK_TICKS_PER_SEC=32000000

Expected behavior
nrf9160dk should boot fine.

Impact
Application business logic and further discussion is detailed here.

Logs and console output
Console log for thread sample tried with 32MHz

*** Booting Zephyr OS build zephyr-v2.4.0-1445-g9d1c47521f13  ***
Toggled led0; counter=0
Toggled led1; counter=0

Environment (please complete the following information):

  • git SHA: 9d1c475
  • Environment: Linux
  • Toolchain: 0.11.4

Metadata

Metadata

Labels

StalebugThe issue is a bug, or the PR is fixing a bugplatform: nRFNordic nRFxpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions