How to adjust frequency offset of NRF5340

Dear Nordic Engineers

I have a problem and would like to ask you  about the  frequency offset of NRF5340. 

As  we all know, if I would like to adjust the frequency offset of NRF52 series chip, I can adjust capacitance next to 32M crystal oscillator.

I read the design of NRF5340, the 32M crystal oscillator side does not have capacitance.

So I would like to know how to adjust the frequency offset of NRF5340.

Our customer's board used the NRF5340. Its frequency offset is 38KHz. They would like a smaller frequency offset.

Did I need to use software to change frequency offset or change cap. next to 32M oscillator?

If it needs to use software to change frequency offset, how to modify in the DTM program?

Best regards.

Parents
  • Hi,

    yes, then you must adjust the internal capacitors, if the frequency is higher then you want it to be, then adjust the capacitor to be larger then it is. 

    See using internal capacitors

    Best regards,
    Kaja

  • Dear kaja

    I read these conversations and I tryed to modify them into the DTM program.

     How to use internal capacitors on nrf5340? 

     RE: Can the software adjust the internal load capacitance of the nrf5340 crystal oscillator 

    1、I will try to add the following code to the NCS\v1.9.1\nrf\samples\bluetooth\direct_test_mode\prj.conf file

    CONFIG_SOC_HFXO_CAP_INTERNAL =y
    CONFIG_SOC_HFXO_CAP_INT_VALUE_X2 =20
    But it seems not to be applied.
    2、I read the following link.
    It means that I can use  external load capacitors.
    So how can I set the code to use external load capacitors.?
    3、
    I try to add the following code to the main.c of direct_test_mode.
    #include <hal/nrf_oscillators.h>
    nrf_oscillators_hfxo_cap_set(NRF_OSCILLATORS, false, 0);
    I build the code and it reprots some errors:
    -- Configuring done
    -- Generating done
    -- Build files have been written to: E:/NCS/v1.9.1/nrf/samples/bluetooth/direct_test_mode/build_PTR9840
    -- west build: building application
    [1/170] Creating directories for 'empty_app_core_subimage'
    [2/170] No download step for 'empty_app_core_subimage'
    [3/170] No update step for 'empty_app_core_subimage'
    [4/170] No patch step for 'empty_app_core_subimage'
    [5/170] No configure step for 'empty_app_core_subimage'
    [5/170] Performing build step for 'empty_app_core_subimage'
    [1/126] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
    [2/126] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
    [3/126] Generating include/generated/driver-validation.h
    [4/126] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
    [5/126] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
    [6/126] Generating include/generated/offsets.h
    [7/126] Building C object zephyr/arch/common/CMakeFiles/isr_tables.dir/isr_tables.c.obj
    [8/126] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi_on_reset.S.obj
    [9/126] Building C object zephyr/arch/common/CMakeFiles/arch__common.dir/sw_isr_common.c.obj
    [10/126] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap_helper.S.obj
    [11/126] Generating linker_zephyr_pre0.cmd
    [12/126] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi.c.obj
    [13/126] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap.c.obj
    [14/126] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj
    [15/126] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/prep_c.c.obj
    [16/126] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/thread.c.obj
    [17/126] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/isr_wrapper.S.obj
    [18/126] Linking C static library zephyr\arch\common\libisr_tables.a
    [19/126] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault_s.S.obj
    [20/126] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/exc_exit.S.obj
    [21/126] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj
    [22/126] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/vector_table.S.obj
    [23/126] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/irq_init.c.obj
    [24/126] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/scb.c.obj
    [25/126] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/reset.S.obj
    [26/126] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fpu.c.obj
    [27/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/stdout_console.c.obj
    [28/126] Linking C static library zephyr\arch\common\libarch__common.a
    [29/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strspn.c.obj
    [30/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strstr.c.obj
    [31/126] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/thread_abort.c.obj
    [32/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/atoi.c.obj
    [33/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/string.c.obj
    [34/126] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/CMakeFiles/arch__arm__core__aarch32__cortex_m__cmse.dir/arm_core_cmse.c.obj
    [35/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/bsearch.c.obj
    [36/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/strtol.c.obj
    [37/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/malloc.c.obj
    [38/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/abort.c.obj
    [39/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/strtoul.c.obj
    [40/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/exit.c.obj
    [41/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strncasecmp.c.obj
    [42/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/qsort.c.obj
    [43/126] Linking C static library zephyr\arch\arch\arm\core\aarch32\cortex_m\libarch__arm__core__aarch32__cortex_m.a
    [44/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/fprintf.c.obj
    [45/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/sprintf.c.obj
    [46/126] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/time/gmtime.c.obj
    [47/126] Linking C static library zephyr\arch\arch\arm\core\aarch32\cortex_m\cmse\libarch__arm__core__aarch32__cortex_m__cmse.a
    [48/126] Building C object modules/nrf/lib/fatal_error/CMakeFiles/..__nrf__lib__fatal_error.dir/fatal_error.c.obj
    [49/126] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread_common.c.obj
    [50/126] Building C object zephyr/boards/boards/arm/nrf5340dk_nrf5340_cpuapp/CMakeFiles/boards__arm__nrf5340dk_nrf5340.dir/nrf5340_cpunet_reset.c.obj
    [51/126] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/nanosleep.c.obj
    [52/126] Building C object modules/nrf/drivers/hw_cc310/CMakeFiles/..__nrf__drivers__hw_cc310.dir/hw_cc310.c.obj
    [53/126] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/nrfx_glue.c.obj
    [54/126] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/E_/NCS/v1.9.1/modules/hal/nordic/nrfx/helpers/nrfx_flag32_allocator.c.obj
    [55/126] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/E_/NCS/v1.9.1/modules/hal/nordic/nrfx/mdk/system_nrf5340_application.c.obj
    [56/126] Building C object zephyr/kernel/CMakeFiles/kernel.dir/main_weak.c.obj
    [57/126] Building C object zephyr/kernel/CMakeFiles/kernel.dir/banner.c.obj
    [58/126] Linking C static library zephyr\lib\posix\liblib__posix.a
    [59/126] Linking C static library zephyr\lib\libc\minimal\liblib__libc__minimal.a
    [60/126] Linking C static library modules\nrf\lib\fatal_error\lib..__nrf__lib__fatal_error.a
    [61/126] Linking C static library zephyr\boards\boards\arm\nrf5340dk_nrf5340_cpuapp\libboards__arm__nrf5340dk_nrf5340.a
    [62/126] Building C object zephyr/kernel/CMakeFiles/kernel.dir/errno.c.obj
    [63/126] Linking C static library modules\hal_nordic\nrfx\libmodules__hal_nordic__nrfx.a
    [64/126] Building C object zephyr/kernel/CMakeFiles/kernel.dir/device.c.obj
    [65/126] Linking C static library modules\nrf\drivers\hw_cc310\lib..__nrf__drivers__hw_cc310.a
    [66/126] Building C object zephyr/kernel/CMakeFiles/kernel.dir/init.c.obj
    [67/126] Building C object zephyr/kernel/CMakeFiles/kernel.dir/version.c.obj
    [68/126] Building C object zephyr/kernel/CMakeFiles/kernel.dir/fatal.c.obj
    [69/126] Building C object zephyr/kernel/CMakeFiles/kernel.dir/kheap.c.obj
    [70/126] Building C object zephyr/kernel/CMakeFiles/kernel.dir/thread.c.obj
    [71/126] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mem_slab.c.obj
    [72/126] Building C object CMakeFiles/app.dir/src/main.c.obj
    [73/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32c_sw.c.obj
    [74/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32_sw.c.obj
    [75/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf.c.obj
    [76/126] Building C object zephyr/kernel/CMakeFiles/kernel.dir/xip.c.obj
    [77/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc7_sw.c.obj
    [78/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc8_sw.c.obj
    [79/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
    [80/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc16_sw.c.obj
    [81/126] Linking C static library app\libapp.a
    [82/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
    [83/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
    [84/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
    [85/126] Linking C static library zephyr\kernel\libkernel.a
    [86/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
    [87/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
    [88/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
    [89/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/thread_entry.c.obj
    [90/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
    [91/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
    [92/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap-validate.c.obj
    [93/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/multi_heap.c.obj
    [94/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/reboot.c.obj
    [95/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
    [96/126] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
    [97/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
    [98/126] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/nrf53/soc.c.obj
    [99/126] Building ASM object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/common/soc_nrf_common.S.obj
    [100/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_complete.c.obj
    [101/126] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_enabled_instances.c.obj
    [102/126] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/tracing/tracing_none.c.obj
    [103/126] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v1.9.1/nrf/subsys/partition_manager/flash_map_partition_manager.c.obj
    [104/126] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/bitarray.c.obj
    [105/126] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj
    [106/126] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v1.9.1/nrfxlib/crypto/nrf_cc312_platform/src/nrf_cc3xx_platform_abort_zephyr.c.obj
    [107/126] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v1.9.1/nrfxlib/crypto/nrf_cc312_platform/src/nrf_cc3xx_platform_no_mutex_zephyr.c.obj
    [108/126] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_base_addresses.c.obj
    [109/126] Building C object zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj
    [110/126] Generating linker_zephyr_pre1.cmd
    [111/126] Linking C static library zephyr\libzephyr.a
    [112/126] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/fatal.c.obj
    [113/126] Linking C static library zephyr\arch\arch\arm\core\aarch32\libarch__arm__core__aarch32.a
    [114/126] Linking C executable zephyr\zephyr_pre0.elf
    
    [115/126] Generating dev_handles.c
    [116/126] Building C object zephyr/CMakeFiles/zephyr_pre1.dir/misc/empty_file.c.obj
    [117/126] Building C object zephyr/CMakeFiles/zephyr_pre1.dir/dev_handles.c.obj
    [118/126] Linking C executable zephyr\zephyr_pre1.elf
    
    [119/126] Generating linker.cmd
    [120/126] Generating isr_tables.c, isrList.bin
    [121/126] Building C object zephyr/CMakeFiles/zephyr_final.dir/misc/empty_file.c.obj
    [122/126] Building C object zephyr/CMakeFiles/zephyr_final.dir/isr_tables.c.obj
    [123/126] Building C object zephyr/CMakeFiles/zephyr_final.dir/dev_handles.c.obj
    [124/126] Linking C executable zephyr\zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 3996 B 1 MB 0.38%
    SRAM: 3304 B 512 KB 0.63%
    IDT_LIST: 0 GB 2 KB 0.00%
    [125/126] Generating zephyr/app.hex
    [126/126] Generating zephyr/merged_CPUAPP.hex
    [89/170] Building C object CMakeFiles/app.dir/src/main.c.obj
    FAILED: CMakeFiles/app.dir/src/main.c.obj
    E:\NCS\v1.9.1\toolchain\opt\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=v2.7.99-ncs1-1 -DKERNEL -DNRF5340_XXAA_NETWORK -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -I../. -IE:/NCS/v1.9.1/zephyr/include -Izephyr/include/generated -IE:/NCS/v1.9.1/zephyr/soc/arm/nordic_nrf/nrf53 -IE:/NCS/v1.9.1/zephyr/soc/arm/nordic_nrf/common/. -IE:/NCS/v1.9.1/nrf/include -IE:/NCS/v1.9.1/modules/hal/cmsis/CMSIS/Core/Include -IE:/NCS/v1.9.1/modules/hal/nordic/nrfx -IE:/NCS/v1.9.1/modules/hal/nordic/nrfx/drivers/include -IE:/NCS/v1.9.1/modules/hal/nordic/nrfx/mdk -IE:/NCS/v1.9.1/zephyr/modules/hal_nordic/nrfx/. -IE:/NCS/v1.9.1/modules/debug/segger/SEGGER -IE:/NCS/v1.9.1/modules/debug/segger/Config -IE:/NCS/v1.9.1/zephyr/modules/segger/. -I../src/fem/. -isystem E:/NCS/v1.9.1/zephyr/lib/libc/minimal/include -isystem e:/ncs/v1.9.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem e:/ncs/v1.9.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -Os -imacros E:/NCS/v1.9.1/nrf/samples/bluetooth/direct_test_mode/build_PTR9840/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33+nodsp -mthumb -mabi=aapcs -mfp16-format=ieee -imacros E:/NCS/v1.9.1/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=E:/NCS/v1.9.1/nrf/samples/bluetooth/direct_test_mode=CMAKE_SOURCE_DIR -fmacro-prefix-map=E:/NCS/v1.9.1/zephyr=ZEPHYR_BASE -fmacro-prefix-map=E:/NCS/v1.9.1=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles\app.dir\src\main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c ../src/main.c
    In file included from e:\NCS\v1.9.1\nrf\samples\bluetooth\direct_test_mode\src\main.c:10:
    E:\NCS\v1.9.1\modules\hal\nordic\nrfx\hal\nrf_oscillators.h:53:41: error: 'OSCILLATORS_XOSC32KI_INTCAP_INTCAP_External' undeclared here (not in a function)
    53 | NRF_OSCILLATORS_LFXO_CAP_EXTERNAL = OSCILLATORS_XOSC32KI_INTCAP_INTCAP_External, ///< Use external capacitors.
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    E:\NCS\v1.9.1\modules\hal\nordic\nrfx\hal\nrf_oscillators.h:54:41: error: 'OSCILLATORS_XOSC32KI_INTCAP_INTCAP_C6PF' undeclared here (not in a function)
    54 | NRF_OSCILLATORS_LFXO_CAP_6PF = OSCILLATORS_XOSC32KI_INTCAP_INTCAP_C6PF, ///< Use 6 pF internal capacitors.
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    E:\NCS\v1.9.1\modules\hal\nordic\nrfx\hal\nrf_oscillators.h:55:41: error: 'OSCILLATORS_XOSC32KI_INTCAP_INTCAP_C7PF' undeclared here (not in a function)
    55 | NRF_OSCILLATORS_LFXO_CAP_7PF = OSCILLATORS_XOSC32KI_INTCAP_INTCAP_C7PF, ///< Use 7 pF internal capacitors.
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    E:\NCS\v1.9.1\modules\hal\nordic\nrfx\hal\nrf_oscillators.h:56:41: error: 'OSCILLATORS_XOSC32KI_INTCAP_INTCAP_C9PF' undeclared here (not in a function)
    56 | NRF_OSCILLATORS_LFXO_CAP_9PF = OSCILLATORS_XOSC32KI_INTCAP_INTCAP_C9PF, ///< Use 9 pF internal capacitors.
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    E:\NCS\v1.9.1\modules\hal\nordic\nrfx\hal\nrf_oscillators.h:66:56: error: unknown type name 'NRF_OSCILLATORS_Type'; did you mean 'NRF_OSCILLATORS_H__'?
    66 | NRF_STATIC_INLINE void nrf_oscillators_lfxo_bypass_set(NRF_OSCILLATORS_Type * p_reg, bool enable);
    | ^~~~~~~~~~~~~~~~~~~~
    | NRF_OSCILLATORS_H__
    E:\NCS\v1.9.1\modules\hal\nordic\nrfx\hal\nrf_oscillators.h:74:53: error: unknown type name 'NRF_OSCILLATORS_Type'; did you mean 'NRF_OSCILLATORS_H__'?
    74 | NRF_STATIC_INLINE void nrf_oscillators_lfxo_cap_set(NRF_OSCILLATORS_Type * p_reg,
    | ^~~~~~~~~~~~~~~~~~~~
    | NRF_OSCILLATORS_H__
    E:\NCS\v1.9.1\modules\hal\nordic\nrfx\hal\nrf_oscillators.h:89:53: error: unknown type name 'NRF_OSCILLATORS_Type'; did you mean 'NRF_OSCILLATORS_H__'?
    89 | NRF_STATIC_INLINE void nrf_oscillators_hfxo_cap_set(NRF_OSCILLATORS_Type * p_reg,
    | ^~~~~~~~~~~~~~~~~~~~
    | NRF_OSCILLATORS_H__
    E:\NCS\v1.9.1\modules\hal\nordic\nrfx\hal\nrf_oscillators.h:94:56: error: unknown type name 'NRF_OSCILLATORS_Type'; did you mean 'NRF_OSCILLATORS_H__'?
    94 | NRF_STATIC_INLINE void nrf_oscillators_lfxo_bypass_set(NRF_OSCILLATORS_Type * p_reg, bool enable)
    | ^~~~~~~~~~~~~~~~~~~~
    | NRF_OSCILLATORS_H__
    E:\NCS\v1.9.1\modules\hal\nordic\nrfx\hal\nrf_oscillators.h:100:53: error: unknown type name 'NRF_OSCILLATORS_Type'; did you mean 'NRF_OSCILLATORS_H__'?
    100 | NRF_STATIC_INLINE void nrf_oscillators_lfxo_cap_set(NRF_OSCILLATORS_Type * p_reg,
    | ^~~~~~~~~~~~~~~~~~~~
    | NRF_OSCILLATORS_H__
    E:\NCS\v1.9.1\modules\hal\nordic\nrfx\hal\nrf_oscillators.h:106:53: error: unknown type name 'NRF_OSCILLATORS_Type'; did you mean 'NRF_OSCILLATORS_H__'?
    106 | NRF_STATIC_INLINE void nrf_oscillators_hfxo_cap_set(NRF_OSCILLATORS_Type * p_reg,
    | ^~~~~~~~~~~~~~~~~~~~
    | NRF_OSCILLATORS_H__
    ../src/main.c: In function 'main':
    e:\NCS\v1.9.1\nrf\samples\bluetooth\direct_test_mode\src\main.c:26:5: warning: implicit declaration of function 'nrf_oscillators_hfxo_cap_set' [-Wimplicit-function-declaration]
    26 | nrf_oscillators_hfxo_cap_set(NRF_OSCILLATORS, false, 0);
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    e:\NCS\v1.9.1\nrf\samples\bluetooth\direct_test_mode\src\main.c:26:34: error: 'NRF_OSCILLATORS' undeclared (first use in this function); did you mean 'NRF_OSCILLATORS_H__'?
    26 | nrf_oscillators_hfxo_cap_set(NRF_OSCILLATORS, false, 0);
    | ^~~~~~~~~~~~~~~
    | NRF_OSCILLATORS_H__
    e:\NCS\v1.9.1\nrf\samples\bluetooth\direct_test_mode\src\main.c:26:34: note: each undeclared identifier is reported only once for each function it appears in
    [97/170] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'e:\NCS\v1.9.1\toolchain\opt\bin\cmake.EXE' --build 'e:\NCS\v1.9.1\nrf\samples\bluetooth\direct_test_mode\build_PTR9840'
    Pls give me some suggestions for these problems.
    Best regards.
  • Hi,

    you need to write these values in the prj.conf

    CONFIG_SOC_HFXO_CAP_INTERNAL =y

    CONFIG_SOC_HFXO_CAP_INT_VALUE_X2 =20

    in the empty_app_core.

    In this way, you can change the values of internal capacitors.

    Alternatively, you could use only

    CONFIG_SOC_HFXO_CAP_INTERNAL =n

    to disable internal ones in software (in the same prj.conf) and then add external capacitors.


    Best regards,
    Kaja

  • Dear Kaja

    Thank you for your suggestion.This way is very effectual.

    Best regards.

Reply Children
No Data
Related