This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Application core clock frequency configuration

Hi, 

I tried to configure application core frequency from 128 MHz to 64 Mhz using thee function:

nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK,NRF_CLOCK_HFCLK_DIV_2);

but I've got an error:  "This code is not supposed to be compiled when neither POWER nor CLOCK is enabled."

 

I've checked on the forum and I found this thread: 

https://devzone.nordicsemi.com/f/nordic-q-a/62533/using-16mhz-spim-on-nrf5340-pdk

The author mentioned that he set the clock configuration directly - How can I do that without throwing the error?

Thanks, 

Marta

Parents Reply
  • Hi Jonathan,

    Unfortunately, non of those configuration works. Just to clarify:

    - I'm using secure build so I've changed the CONFIG_COMPILER_OPT="-DNRF_CLOCK=NRF_CLOCK_NS -DNRFX_CLOCK_ENABLED=1" to CONFIG_COMPILER_OPT="-DNRF_CLOCK=NRF_CLOCK_S -DNRFX_CLOCK_ENABLED=1" but neither works

    - Should nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK,NRF_CLOCK_HFCLK_DIV_2); be the first function in main or maybe it should be somewhere else?

    I still get "undefine reference" so I tried code:


    NRF_CLOCK_NS.HFCLKCTRL = CLOCK_HFCLKCTRL_HCLK_Div1 << CLOCK_HFCLKCTRL_HCLK_Pos;

    There is some parenthesis missing: "expected identifier or '(' before 'NRF_CLOCK_Type'
    1> ../src/main.c:30:1: note: in expansion of macro 'NRF_CLOCK_NS'"

     

    Thanks, 

    Marta

Children
Related