This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How properly configure nrf52840 so it can boot?

According to another question here:

devzone.nordicsemi.com/.../

I'm stuck with waiting for the LFCLK to boot forever.

Normally, keil has a .s startup file that dictates the procedures taken after powering up, or if we are talking about a PIC chip, I can configure all the boot related registers easily in mplabx IDE, but I'm still scratching my head as to where to do the equivalent for an nrf52840.

Is there a config file I can write to? A macro definition I can modify? Or is it in the .s file?

I'm using keil uv5.

I want to use external 32Mhz HFCLK and internal 32.768khz RC LFCLK, where to properly set them up?

Are these 2 the only thing I have to worry about when configuring the chip to start properly?

Parents
  • It is not bother, it's why I'm here! While the SD is enabled the application will have limited access to the clock peripheral, so you won't be able to directly configure the clocks. I would like you to try something for me, using the hrs example from SDK13.0.0, change the sdk_config clock source to RC, like you did. And in the ble_stack_init function, change this snippet

    nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;		
    // Initialize the SoftDevice handler module.
    SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
    

    To this

    nrf_clock_lf_cfg_t clock_lf_cfg;
    clock_lf_cfg.source = NRF_CLOCK_LF_SRC_RC;
    clock_lf_cfg.rc_ctiv = 16;
    clock_lf_cfg.rc_temp_ctiv = 2;		
    		
    // Initialize the SoftDevice handler module.
    SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
    

    This works on my end with the pca10056, so it should be a good place to start debugging.

Reply
  • It is not bother, it's why I'm here! While the SD is enabled the application will have limited access to the clock peripheral, so you won't be able to directly configure the clocks. I would like you to try something for me, using the hrs example from SDK13.0.0, change the sdk_config clock source to RC, like you did. And in the ble_stack_init function, change this snippet

    nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;		
    // Initialize the SoftDevice handler module.
    SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
    

    To this

    nrf_clock_lf_cfg_t clock_lf_cfg;
    clock_lf_cfg.source = NRF_CLOCK_LF_SRC_RC;
    clock_lf_cfg.rc_ctiv = 16;
    clock_lf_cfg.rc_temp_ctiv = 2;		
    		
    // Initialize the SoftDevice handler module.
    SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
    

    This works on my end with the pca10056, so it should be a good place to start debugging.

Children
No Data
Related