Can't detect the custom device after uploading ble_app_beacon example (nRF52810)

Hi,

I developed a custom board with nRF52810. Here is my schematic: 

Layout:

I can succesfully upload the "ble_app_beacon" example in SDK17.1.0 with softdevice112 using Segger Embedded Studio.

I power my device with STLink and use JTAG to program it. I connected the GND of STLink and JTAG to achive this. 

I can debug too.

Dont mind the commented lines. I tried to toggle a LED in order to make sure that i can program the device correctly and it worked.

The problem is device is not detectable. I dont think the BLE works properly. Here is my setup. I connected an external 2.4GHz antenna in case my PCB antenna is not good.

I dont know what to do. 

Any help would be great.

Regards,

Mert 

Parents
  • Hi,

     

    Both softdevice.hex + application is loaded, which is good.

    Could you try to run this sequence and see if the HFXO starts up properly?

    NRF_CLOCK->TASKS_HFCLKSTART = 1;
    while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);
    NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;

     

    If you hang in the while-loop, there is a problem with your 32M xtal.

     

    Kind regards,

    Håkon

  • Hi Håkon,

    Thank you for your quick reply.

    The code stucks at while loop. You are correct.

    Tomorrow I will check my hardware with oscilloscope and make sure i have good crystal. Maybe i will solder a new one.

    Thanks,

    Regards,

    Mert

  • Hi Mert,

     

    Good to hear that you found the source of the problem. Usually this is because of excess solder, so try ohm'ing from the can of the crystal to the XC1/XC2 pins. If they read as <10 ohm, it is likely a short from the side of the crystal or underneath it.

     

    Kind regards,

    Håkon

  • Hi Håkon,

    The problem was with solder of XC1 and XC2 pins on the processor. Now thanks to you i finally be able to detect my device. Now I have one more question. My low frequency crystal does not seem to work even though i resoldered everything and make sure the connections are good.I think it happens because of the code We added previously.

    NRF_CLOCK->TASKS_HFCLKSTART = 1;
    while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);
    NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;

    Do you think i am right? I will try it when i go back home.

    Regards,

    Mert

  • Hi,

     

    With 12 pF loading caps, your 32k xtal needs to have a CL of 8 pF (C=2*CL-4pF).

    You should check the spec of your 32k xtal.

     

    If all this aligns, you can start the lfclk simillarly as the hfclk:

    /* Start low frequency crystal oscillator for app_timer(used by bsp)*/
    NRF_CLOCK->LFCLKSRC            = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
    NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    NRF_CLOCK->TASKS_LFCLKSTART    = 1;
    
    while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0)
    {
    }

     

    Same thing applies, if it hangs in that loop, you have lfclk problems.

    Note that this must be called before softdevice init.

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    With 12 pF loading caps, your 32k xtal needs to have a CL of 8 pF (C=2*CL-4pF).

    You should check the spec of your 32k xtal.

     

    If all this aligns, you can start the lfclk simillarly as the hfclk:

    /* Start low frequency crystal oscillator for app_timer(used by bsp)*/
    NRF_CLOCK->LFCLKSRC            = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
    NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    NRF_CLOCK->TASKS_LFCLKSTART    = 1;
    
    while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0)
    {
    }

     

    Same thing applies, if it hangs in that loop, you have lfclk problems.

    Note that this must be called before softdevice init.

     

    Kind regards,

    Håkon

Children
No Data
Related