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

Custom Board Programming

Dear Nordic

I have custom board(nRF52840) its not detecting through Jlink (from nRF52 DK). 

I tried to connect nRF52840 dongle(using J2 in dongle) with same setup its detected and i can flash program to it

when i tried to connect to my board its shows cannot connect to target. I need some help to detect my board

Supply voltage of my custom board

VDDH--->3.7 v

I get VDD_nRF -->3.1V

VDD-->3.1V

Is it any other voltage source need to be check for proper working of chip(nRF52840)?

Can you help me to solve this issue?

Program Interface voltage:-3.3v

I need some support to detect My custom board using Jlink 

  • So you have connected it like described here, right? Note that the GND detect must be connected to GND on the DK.

    The programming chip on the nRF52DK supports only 3.0v. Is it possible to power it with this while programming? 

    BR,

    Edvin

  • Thanks for your replay now board detected i tested some peripherals(uart) its work but the BLE part is not working no transmission occurs 

    i just tested examples provide by nordic(sdk 15)

    is it any modification needed?

    32 mhz HF and 32 khz LF are used

    code works fine(debuged) but no ble transmission occurs 

    is it any problem in HF clock?

    how i tested HF works fine?

    i need some help

  • Hello,

    Glad to hear it was detected in the end.

    There are a few possible sources.

    Did you remember to upload the softdevice before programming the BLE examples? For the nRF52840 you should use the S140 softdevice from the SDK that you use, located in <SDK_root_folder>\components\softdevice\s140\hex\s140_nrf52_X.Y.Z_softdevice.hex where XYZ is the version number. If you use SDK15.0.0, it is 6.0.0.

    Regarding the clocks:

    What are your clock specifications (both HF and LF). Particularly accuracy (PPM) of the LFXTAL, which is the most common reason for BLE examples not working.

    You should make sure that these specs are reflected in your LFXTAL defines in sdk_config.h. NRF_SDH_CLOCK_LF_SRC should be 1 (XTAL). NRF_SDH_CLOCK_LF_ACCURACY should be at >= the actual accuracy.

    Check out these things first, as they are most usually the issue. If that doesn't work, what is the capacitance of your LFXTAL? And what capacitors (pF) do you have attached on it? In figure 1. Circuit configuration no. 1 schematic, that would be C17 and C18, and also the capacitance of the XTAL itself?

    Best regards,

    Edvin

  • Thanks for your replay

    S140 is flashed and i debug the program everything fine but not transmission occurs

    HF :-32MHz ±25ppm Crystal

    LF:- 32.768 kHz and 20 PPM

    NRF_SDH_CLOCK_LF_SRC is 1 in sdk_config.h

    NRF_SDH_CLOCK_LF_ACCURACY  is 7

    capacitance provide at HF is 12 pF

    Capacitance at LF is 12.5 pF

    Is it any test to find crystal oscillate properly?

    I found from nordic devzone search

    You could also add this code at the start of main(), and check that you are not getting stuck in the while loop. If you get stuck in the while-loop, then you have some problem with the HF crystal.

      // Start HFCLK from crystal oscillator. The radio needs crystal to function correctly.
      NRF_CLOCK->TASKS_HFCLKSTART = 1;
      while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);

    I tested as per this document https://devzone.nordicsemi.com/f/nordic-q-a/29839/ble-not-starting-in-custom-board-of-nrf52832

     

    int main(void)
    {
    bool erase_bonds;

    // Initialize.
    NRF_CLOCK->TASKS_HFCLKSTART = 1;
    while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);
    log_init();
    timer_init();
    NRF_LOG_INFO("Calixto example started.");
    buttons_leds_init(&erase_bonds);
    power_management_init();
    ble_stack_init();
    gap_params_init();
    gatt_init();
    conn_params_init();
    db_discovery_init();
    peer_manager_init();
    hrs_c_init();
    rscs_c_init();
    services_init();
    advertising_init();

    // Start execution.
    NRF_LOG_INFO("Relay example started.");

    if (erase_bonds == true)
    {
    // Scanning and advertising is done upon PM_EVT_PEERS_DELETE_SUCCEEDED event.
    delete_bonds();
    }
    else
    {
    adv_scan_start();
    }
    // Enter main loop.
    for (;;)
    {
    idle_state_handle();
    // NRF_LOG_INFO("loop");
    }
    }

     

    It's stucked in while loop is it any problem?

    and also one more question is it any additional configuration needed for enabling external crystal ?

  • If it doesn't go past the while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0); that would suggest that there are some issues with the XTAL.

    I tested it on a DK, and it passes this check.

    What you can try to check that everything else is working is to use the following NRF_SDH_CLOCK_LF defines:

    #define NRF_SDH_CLOCK_LF_SRC 0
    #define NRF_SDH_CLOCK_LF_RC_CTIV 1
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0
    #define NRF_SDH_CLOCK_LF_ACCURACY 1

    This will enable the RC Oscillator as the clock source. Try to use this, and see if the device starts advertising in one of the ble_peripheral examples.

    If not:

    Are you sure this is where the application is hanging (the while check)?

    If it is:

    What is your C17 and C18 from the figure in my previous reply?

    Best regards,

    Edvin

Related