Compile ERROR "undefined reference to `sys_clock_cycle_get_32'" with custom board

Earlier I was using nRFconnect SDK 2.1.2. Everything works perfectly fine with that. Many features were added in that project. Now I want to port my project to latest SDK 2.3.0. During the porting I am seeing a compile error "undefined reference to `sys_clock_cycle_get_32".


Issue is only observed with custom board. I have attached a sample project. Which compiles fine with nRF5340DK_nRF5340_cpuapp But it fails with following error with my custom board. The custom board is exact copy of nRF5340DK_nRF5340 just replaced the name with "Dial_Board".

Can you please help me find out what exactly going wrong in my case? Thanks.

b0\zephyr && C:\ncs\toolchains\v2.3.0\opt\bin\cmake.exe -E echo ""
c:/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: zephyr/libzephyr.a(soc.c.obj): in function `arch_k_cycle_get_32':
C:\ncs\v2.3.0\zephyr\include\zephyr\arch\arm\aarch32\misc.h:26: undefined reference to `sys_clock_cycle_get_32'
c:/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:\ncs\v2.3.0\zephyr\include\zephyr\arch\arm\aarch32\misc.h:26: undefined reference to `sys_clock_cycle_get_32'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
[245/282] Building C object zephyr/kernel/CMakeFiles/kernel.dir/timeout.c.obj
nRF5340_Dial_Board_2.3.0.zip

Parents
  • NSIB (b0) has the RTC disabled by default.

    You can enable this by either

    -- -Db0_CONFIG_NRF_RTC_TIMER=y

    or setting CONFIG_NRF_RTC_TIMER=y in child_image/b0.conf

    Regards,
    Sigurd Hellesvik

  • Mostly putting this here for anyone else searching for this.

    If you look at <workspace>/nrf/sample/bootloader/prj.conf, it explicitly recommends against enabling the RTC.

    Copy the contents of <workspace>/nrf/sample/bootloader/prj.conf and <workspace>/nrf/sample/bootloader/boards/nrf5340dk_nrf5340_cpuapp.conf into <workspace>/<project>/child_image/b0/boards/<boardname>.conf

    As of the 2.6.1 build system, using <project>/child_image/b0/boards/<boardname>.conf will prevent loading the original prj.conf file, and there's not a better way to associate this with a specific board.

    Note, you will get a warning about an anomaly because

    CONFIG_SYS_CLOCK_EXISTS=n

    You'll need to determine if this impacts you.

Reply
  • Mostly putting this here for anyone else searching for this.

    If you look at <workspace>/nrf/sample/bootloader/prj.conf, it explicitly recommends against enabling the RTC.

    Copy the contents of <workspace>/nrf/sample/bootloader/prj.conf and <workspace>/nrf/sample/bootloader/boards/nrf5340dk_nrf5340_cpuapp.conf into <workspace>/<project>/child_image/b0/boards/<boardname>.conf

    As of the 2.6.1 build system, using <project>/child_image/b0/boards/<boardname>.conf will prevent loading the original prj.conf file, and there's not a better way to associate this with a specific board.

    Note, you will get a warning about an anomaly because

    CONFIG_SYS_CLOCK_EXISTS=n

    You'll need to determine if this impacts you.

Children
No Data
Related