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

the clock function is not working in esb_ptx example for nRF52832

Hi, 

as I said before I am working with nRF52832. I can connect with nrf and program it. for example I can make an LED to blink. but when I run the esb_ptx example the program doesn't pass through the clock_initialize() line. I am using the CX2016DB32000D0WZRC1 chip as the crystal. can you help me to find the problem.   

Parents
  • Hi,

    but when I run the esb_ptx example the program doesn't pass through the clock_initialize() line.

    There is no function called clock_initialize in the SDK 17 (which I see you are using in another question). There is a clocks_start() in the esb_ptx example, though. Is that the one?

    That is implemented like this:

    void clocks_start( void )
    {
        NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
        NRF_CLOCK->TASKS_HFCLKSTART = 1;
    
        while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);
    }

    So the only thing that could make this not return is if the HFCLKSTARTED event never happens. Can you double check with a debugger if this really is the problem, and the while loop never exits? If so, there is likely a problem with the HF crystal on your HW.

  • you are right, it is clock_start(). when I comment clock_start() the program runs properly and the LED start blinking, but when the clock_start() line is active, it stops there. I checked the crystal an I even changed it but noting happen. the crystal that i am using has all the features that is said in datasheet. 

  • Hi,

    Masoumeh said:
    I checked the crystal an I even changed it but noting happen. the crystal that i am using has all the features that is said in datasheet. 

    It does not necessarily need to be a problem with the crystal itself, butit could be a problem with the circuitry around the crystal. Can you double check the load caps and that the soldering is OK etc? Please check all the solderings of X1, C2 and C1, and thee connections with the IC on the XC1 and XC2 pins (see snippet from reference circuitry for QFAA below)

  • I checked them. the soldering and connections are ok. the caps are 12pf, also I reduce the value of the C1,2 but noting happen. 

  • I see. I do not have any other suggestions, then. Just to double check, did you verify that execution is stuck in the loop waiting for HFCLKSTARTED? And also just to be sure, can you test the code on a DK if you have that around so that we know it works on good HW?

  • I have a DK but it's for nrf51822. and the program is working on it. also I loaded the program that is written for 10040 pca in SDK12.3 that I am using for nrf51822 in to my nrf52832 and still it's not working. can it be a problem with the crystal?  or the nrf52832 IC?

  • Hi,

    Masoumeh said:
    can it be a problem with the crystal?  or the nrf52832 IC?

    Yes. I cannot pinpoint exactly where the problem is, but the example should work and there is really no way the clocks_start() function could fail if the HW is functional. So something in your HW is preventing the HFXO from starting properly.

    Have you had your custom board reviewed by Nordic? If not, I suggest you upload your schematics and layout and get it reviewed. If that is OK, then there is likely something fishy with the components, PCB, soldering or other, and so it make sense to test another board and see if that works or not (chances are you will not have the same physical defect on the next one).

Reply
  • Hi,

    Masoumeh said:
    can it be a problem with the crystal?  or the nrf52832 IC?

    Yes. I cannot pinpoint exactly where the problem is, but the example should work and there is really no way the clocks_start() function could fail if the HW is functional. So something in your HW is preventing the HFXO from starting properly.

    Have you had your custom board reviewed by Nordic? If not, I suggest you upload your schematics and layout and get it reviewed. If that is OK, then there is likely something fishy with the components, PCB, soldering or other, and so it make sense to test another board and see if that works or not (chances are you will not have the same physical defect on the next one).

Children
Related