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

Putting working program from nRF51DK onto a nRF51822 on custom board

I've developed a PCB containing the nRF51822. I am trying to uploaded the example program "ble_app_uart_s110_pca10028" to it, but the chip is not broadcasting (so I assume the program isn't uploaded correctly). I have uploaded the same program to the nRF51DK (Developer Kit) and it works fine on the nRF51DK.

I'm trying to program the 51822 using the nRFDK debugging pins.

Unfortunately, the nRF51422 on the Development Kit and the nRF51822 on the custom PCB aren't pin compatible.

I've tried going into the pca10028 header file and changing the pins around. I changed all the active pins being used by the board accordingly. The only pins I need are the RX and TX pins I've set up as Pins 47 and 48.

I've tried following the instructions here : devzone.nordicsemi.com/.../

and here : devzone.nordicsemi.com/.../

Thanks, I really appreciate any help. I've been stuck on this for close to a month.

Here is the schematic: image description

  • @andy: I would suggest you to start first by uploading a firmware that blink an LED or toggle a GPIO pin on your custom board. Having that you can verify if you can properly flash a hex file on your board and your chip on the board can work properly.

    After that you can try flashing the softdevice, and a simple BLE example, HRM for example. It should work regardless the incompatible GPIOTE onthe DK and your board. Make sure you have configure the softdevice init to match with your 32kHz clock source.

  • Hi Hung,

    Thank you for your reply.

    Following your suggestion, I was able to successfully toggle a pin on my custom board. However, I tried to upload the HRM example from SDK9 with the softdevice110 that is in SDK9. The chip did not broadcast to my phone. I uploaded the same example with the same softdevice to the nRF51DK and it worked fine.

    I did not configure the softdevice init to 32kHz, though. Could you tell me how to do that? (I am very new to this). I hope that will solve my problem.

  • Here is a note about my setup: The chip on my custom PCB is connected to the SWCLK, SWDIO, GND, VREF pins on the nRF51DK. When I give power to the PCB, nRFgo Studio recognizes the chip is nRF51822 (instead of the nRF51DK chip which is nRF51422). I am using Kiel uVision5 to compile the examples from NRF51_SDK_9.0.0. I then go to nRFgo Studio and do the following: 1) Erase All. 2) In the Program SoftDevice tab, I select "nRF51_SDK_9.0.0_2e23562/components/softdevice/s110/hex/s110_softdevice.hex", and click Program. 3) In the Program Application tab, I select "nRF51_SDK_9.0.0_2e23562/examples/ble_peripheral/ble_app_hrs/pca10028/s110/arm5_no_packs/_build/nrf51422_xxac_s110.hex" and click Program. The nRFgo Log says Softdevice programmed successfully and Application programmed successfully. I open nRF Toolbox on my iPhone, select HRM, and press Connect, but nothing is broadcasting.

  • @andy: if you look into the code in main.c you can find this line:

    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);
    

    Change it to

    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, NULL);
    

    Will make the stack uses the 32kHz RC instead of the 32kHz crystal.

    You can send me your board schematic and PCB layout for checking.

  • Hi Hung,

    Unfortunately, changing the Softdevice init did not help. Do I need to select the correct Options for Target in Keil uVision?

    Right now these are my settings: Device: nRF51433_xxAC (however I tried changing this to nRF51822_xxAA but it did not help).

    Target: Xtal (MHz) -- "12.0" Operating system -- "None" ARM Compiler -- "Use default compiler version" Read/Only Memory Areas -- IROM1 (box is checked) Start-- "0x0" Size -- "0x40000" Startup (circle is checked)
    Read/Write Memory Areas -- IRAM1 (box is checked) Start -- "0x20000000" Size -- "0x8000"

    C/C++: Define: BLE_STACK_SUPPORT_REQD BOARD_PCA10028 S110 NRF51 SOFTDEVICE_PRESENT SWI_DISABLE0 One ELF Section per Function (box is checked)

    Asm: Define: BLE_STACK_SUPPORT_REQD BOARD_PCA10028 S110 NRF51 SOFTDEVICE_PRESENT SWI_DISABLE0

    Also, I cannot attach a photo on this thread, so I am not sure how to share my board schematic.

Related