Blinky sample code not working on nrf52840 custom board

Hi , 

Our custom board uses the nRF52840 chip, and we followed the Nordic official webinar 'Adding Custom Board Support in nRF Connect SDK' during development.

We noticed that the blinky sample example does not work in debug mode or after flashing. In debug mode, the code halts somewhere in reset.s or sometimes the cpu_idle file, but it never reaches the main function.

After significant troubleshooting, we discovered that the LED blinks and single stepping becomes possible if we enable the internal RC oscillator with the following configurations in the prj.conf file:

#Internal RC low-frequency oscillator (LFRC)
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y

We're also working with the hardware team to investigate potential issues with the external crystal or capacitors. We'd like to investigate the issue from a firmware perspective simultaneously. The same problem has been observed on three separate boards.


Thanks & Regards,
Gaurav 



 

  • Hi

    I would highly recommend that you open a new case where you ask for a schematic/pcb review as to me it sounds like a HW issue. 

    Do you have any external LC crystal? 

    If not the prj.conf should look like the following

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y

    Are you using any bootloader? If so it must be set in the child image as well

    If you are planning on using the DCDC remember Configuring this in Zephyr is as simple as setting the kconfig "CONFIG_SOC_DCDC_NRF52X" to "y" for DC/DC and "n" for LDO. Same for VDDH: "CONFIG_SOC_DCDC_NRF52X_HV". It's enabled by default in the DK, so I'm just mentioning it

    Regards

    Runar

  • Hi 

    Thanks for the quick reply.

    - Yes, prj.config contains the following settings:

    #External Crystal Oscillator and accuracy selection:
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    #Internal RC low-frequency oscillator (LFRC)
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y

    - Are you using any bootloader? If so it must be set in the child image as well
    ans--- For hardware bring up we are just using Blinky sample code as it is 


    - Thanks for the information about the config settings for enabling DC-DC and VDDH. However, I hope these settings are unrelated to the crystal/clock configuration. Please confirm.


    - I appreciate the suggestion to review the hardware. I'll discuss this with my hardware team and take action accordingly.

    - Meanwhile , assuming it's not a hardware issue, are there any troubleshooting tips for the firmware? Otherwise, how can we confirm a hardware problem through tests?



    Thanks , 
    Gaurav 

  • When you are booting your device, do you get any form for logs? 

    To me this looks like a crystal issue but i would expect it to work when you set it to use internal crystal, however if you want I can set the case to private and you can upload your custom board so that I can have a look at it. I think that would be the best way to go about it

    Regards

    Runar

  • There are no logs since this is a very basic project with only GPIO enabled for LED blinking.

    as mentioned earlier , It works when set up to use the internal crystal by setting CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y.

    Please let me know what data or files you need to review. Since this is a sample LED blinking project, there is no proprietary information. Let me know how to share the docs / files 



  • If it works without any issue using internal LPCR then I honestly don't see the need to do more debugging at this stage. And rather have a look at they design where we pay attention to the crystals .  Just to confirm, it works without debugging and stepping when using internal crystal? 

    However if the issue persist then I would like to have a look at the custom boards .dts to see if there is anything that stands out

    Regards

    Runar 

Related