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

How to Program RF-BM-ND01 (nrf51822) BLE4.0

Hi,

I have RF-BM-ND01 (nrf51822) BLE4.0 module and i am programming it using nrfjprog tool. and i am using nrf SDK12 to program examples. i tried to flash  softdevice S130, S120 and its examples flash downloading successfully. but i dont know whether code is running or not (because TX and Rx are disabled in hardware and i am using CLK and SDA pins to download code).

Please suggest me which softdevice version i need to use.

So please guid me to program RF-BM-ND01 (nrf51822) BLE4.0.

Parents
  • thanks for the Quick reply.

    Actually, my module is RF-BM-ND01.  i am able to download hex file on it. but it is not advertising at all. so is it possible to use nrf12.3 SDK for  RF-BM-ND01 module?

    I even tried to download s130 from SDK12.3 and downloaded BLE_app_uart example file inRF-BM-ND01, the download was successful but the application is not running(not observed any advertisements in nrf connect app).

  • Hi,

    The RF-BM-ND01 module is based on a nRF51822 chip, so you can use any SDK with support for it. The latest SDK for nRF51 is SDK 12.3, so you are using the correct SDK. A typical issue when using SDK examples with modules is that some modules does not include the optional 32.768 kHz crystal, but the SDK examples assume it is present out of the box. If that is the case, using a unmodified example will not work, as the SoftDevice will attempt to start the non-existing crystal oscillator.

    Assuming this is the problem, you have to adjust the SoftDevice configuration so that it uses the internal LFRC oscillator instead. In most SDK examples, that means that you need to change the nrf_clock_lf_cfg_t instance which is passed to softdevice_handler_init(), for instance by setting it to something like this:

    #define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_RC,              \
                                     .rc_ctiv       = 0,                                \
                                     .rc_temp_ctiv  = 0,                                \
                                     .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM}

  •  tried to change crystal frequency as

    // Low frequency clock source to be used by the SoftDevice

    #ifdef S210

    #define NRF_CLOCK_LFCLKSRC      NRF_CLOCK_LFCLKSRC_XTAL_20_PPM

    #else

    #define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_RC,            \

                                     .rc_ctiv       = 0,                                \

                                     .rc_temp_ctiv  = 0,                                \

                                     .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM}

    #endif

    in file location 

    /nRF5_SDK_12.3.0_d7731ad/components/boards/pca10028.h

    still i am facing issue.

  • I see. Then some debugging is required:

    1. Have you remembered to flash the SoftDevice as well as the application .hex?
    2. Can you put a breakpoint in the beginning of the main function to verify that the application starts and you are able to debug?
    3. ...
Reply Children
  • When i am trying to debug i am getting issues like

    No source available for "0xfffffffe" 

    where as NRF51 development board is working fine with the same soft device and application but RF-BM-ND01 is not.

    i am unable to find datasheet reagarding RF-BM-ND01

    and here is the log for RF-BM-ND01:-

    SEGGER J-Link GDB Server V6.12i Command Line Version

    JLinkARM.dll V6.12i (DLL compiled Feb  3 2017 15:29:31)

    -----GDB Server start settings-----

    GDBInit file:                  none

    GDB Server Listening port:     2331

    SWO raw output listening port: 2332

    Terminal I/O port:             2333

    Accept remote connection:      localhost only

    Generate logfile:              off

    Verify download:               on

    Init regs on start:            on

    Silent mode:                   off

    Single run mode:               on

    Target connection timeout:     0 ms

    ------J-Link related settings------

    J-Link Host interface:         USB

    J-Link script:                 none

    J-Link settings file:          none

    ------Target related settings------

    Target device:                 nRF52

    Target interface:              SWD

    Target interface speed:        1000kHz

    Target endian:                 little

    Connecting to J-Link...

    J-Link is connected.

    Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 12 2018 11:44:41

    Hardware: V1.00

    S/N: 682403177

    Checking target voltage...

    Target voltage: 3.30 V

    Listening on TCP/IP port 2331

    Connecting to target...WARNING: Identified core does not match configuration. (Found: Cortex-M0, Configured: Cortex-M4)

    Connected to target

    Waiting for GDB connection...Connected to 127.0.0.1

    Reading all registers

    Read 4 bytes @ address 0x00000000 (Data = 0x000007C0)

    Read 2 bytes @ address 0x00000000 (Data = 0x07C0)

    Target interface speed set to 1000 kHz

    Resetting target

    Halting target CPU...

    ...Target halted (PC = 0x000006D0)

    R0 = FFFFFFFF, R1 = FFFFFFFF, R2 = FFFFFFFF, R3 = FFFFFFFF

    R4 = FFFFFFFF, R5 = FFFFFFFF, R6 = FFFFFFFF, R7 = FFFFFFFF

    R8 = FFFFFFFF, R9 = FFFFFFFF, R10= FFFFFFFF, R11= FFFFFFFF

    R12= FFFFFFFF, R13= 000007C0, MSP= 000007C0, PSP= FFFFFFFC

    R14(LR) = FFFFFFFF, R15(PC) = 000006D0

    XPSR C1000000, APSR C0000000, EPSR 01000000, IPSR 00000000

    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00

    Reading all registers

    Read 4 bytes @ address 0x000006D0 (Data = 0x4C174916)

    Read 2 bytes @ address 0x000006D0 (Data = 0x4916)

    Select auto target interface speed (1000 kHz)

    Flash breakpoints enabled

    Semi-hosting enabled (Handle on BKPT)

    Semihosting I/O set to TELNET Client

    SWO disabled succesfully.

    SWO enabled succesfully.

    Read 4 bytes @ address 0x000006D0 (Data = 0x4C174916)

    Read 2 bytes @ address 0x000006D0 (Data = 0x4916)

    Downloading 15952 bytes @ address 0x0001B000 - Verified OK

    Downloading 6608 bytes @ address 0x0001EE50 - Verified OK

    Downloading 8 bytes @ address 0x00020820 - Verified OK

    Downloading 148 bytes @ address 0x00020828 - Verified OK

    Comparing flash   [....................] Done.

    Verifying flash   [....................] Done.

    Writing register (PC = 0x1cee0100)

    Read 4 bytes @ address 0x0001EE1C (Data = 0x480A2103)

    Read 2 bytes @ address 0x0001EE1C (Data = 0x2103)

    Resetting target

    Halting target CPU...

    ...Target halted (PC = 0x000006D0)

    R0 = FFFFFFFF, R1 = FFFFFFFF, R2 = FFFFFFFF, R3 = FFFFFFFF

    R4 = FFFFFFFF, R5 = FFFFFFFF, R6 = FFFFFFFF, R7 = FFFFFFFF

    R8 = FFFFFFFF, R9 = FFFFFFFF, R10= FFFFFFFF, R11= FFFFFFFF

    R12= FFFFFFFF, R13= 000007C0, MSP= 000007C0, PSP= FFFFFFFC

    R14(LR) = FFFFFFFF, R15(PC) = 000006D0

    XPSR C1000000, APSR C0000000, EPSR 01000000, IPSR 00000000

    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00

    Reading all registers

    Read 4 bytes @ address 0x000006D0 (Data = 0x4C174916)

    Read 2 bytes @ address 0x000006D0 (Data = 0x4916)

    Starting target CPU...

    ...Target halted (DBGRQ, PC = 0xFFFFFFFE)

    Reading all registers

    Read 4 bytes @ address 0xFFFFFFFE (Data = 0x02BCED00)

    Read 2 bytes @ address 0xFFFFFFFE (Data = 0x0000)

    Read 4 bytes @ address 0x20007FFC (Data = 0x00000000)

    Reading 64 bytes @ address 0x20007FC0

    Read 4 bytes @ address 0x00000000 (Data = 0x000007C0)

    Read 4 bytes @ address 0x00000000 (Data = 0x000007C0)

    Read 4 bytes @ address 0x00000000 (Data = 0x000007C0)

  • Hi,

    This did not tell me much, other than that you are using GDB to successfully (?) debug the device. If you are unfamiliar with GDB then I recommend using a more modern and user friendly IDE such as Keil. If you have a Makefile project and don't want to migrate it, then you can still use a modern debugger, such as Segger Ozone, which works very well with GCC.

  • Hi,

    I am able to debug nrf51 development kit. it is working fine for me and I am able to run all example applications.

    if I am trying to debug RF-BM-ND01 with j-Link debugger  it is throwing the exception  No source available for "0xfffffffe"

    One thing I observed is whatever applications flashing on NRF51822QFAC is working fine.But RF-BM-

    ND01 which is NRF51822QFAA is giving trouble(softdevice and application downloading successfully but not running)

  • Hi,

    There is no fundamental difference between the nRF51 DK and any nRF51 module, so it should be the same. Have you tried looking at older threads with this error?

  • Hi Einar Thorsrud,

    Thank you very much for the support, finally, I made it. 

    issue is with both clock frequency and ld file.

    Now its works perfectly by changing ld file by 

    MEMORY

    {

      FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000

      RAM (rwx) :  ORIGIN = 0x20002080, LENGTH = 0x1f80

    }

    Thanks for the support

Related