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

Programming 3rd-Party nRF51822

Hello All Slight smile

Since 3 days now, I am trying to program my third party beacon board PTR9048 with the PCA10028. I'm pretty sure, that I connected it correctly, because I can program the SoftDevice on it, and can the it in nRFgo Studio as well. I tried flashing the Beacon_app_example with nRFgo Studio and in Linux via command line.. Flash executes without an error, so I guess it flashes somehow and somewhere. 

I assume, that the problem is either about memory organisation, because the nRF51822 got less RAM or it is about the pin-out of the CUSTOM-BOARD. I read something about this, but in one post there was said, that is not mandatory customizing this. And in additon I read something about crystal speed, but I do not know how to adjust this.

So concluded: Flashing Softdevice and Application works without error, I cannot see device in a Bluetooth Scan, so the example is not working.

Thanks for your help.

Parents
  • Im sorry, I really dont get the mistake fixed..

    I tried your code, it didnt compile, so I search for the definitions of the oscillators and used it like this:

    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, NULL);

    It compiles and I can flash, but it is the same as before, no errors but I cannot see the device in a bluetooth scan.

    I was using the Keil, so I will show you my settings, maybe you can see the mistake directly..

    Due to the cheap china hardware, I cannot find a good Documentation, but I guess the xtal on the board is 13,56MHz. With this setting it was not working either.

    This ist SDK10 now, with S130 v1.0.0

    Thank you for the previous help!

  • Where is the device stuck if you enter debug mode? It should be able to get past the SOFTDEVICE_HANDLER_INIT(..) with that input.

    Try running from a "clean slate", by issuing a "nrfjprog -e" from command line.

    After that, flash the softdevice ("nrfjprog --program <path/to/softdevice_s130...hex>"), then the application.

     

    Best regards,

    Håkon

  • Did you accommodate for the RAM size being smaller on your device? Your current device has 16k of RAM while examples assume it is the 32k RAM variant of the nRF51822 (QFAC)

  • Yes I left the Flash the same and for RAM I changed the Lenght to 0x4000.

  • The RAM length should be 0x1800, as the softdevice uses 0x2800 (0x4000 - 0x2800 = 0x1800). I suspect you're running out of RAM, which will cause a HardFault in the CPU.

  • Okay, so I tried many things now.. The RAM size seems to not be the problem.
    I use the P09 now to get some Messages via UART out. So this is working and the code
    does not stuck somewhere.
    In my Opinion there is a problem about the clock, so here is what I did:

    In the SDK_config:
    #define CLOCK_CONFIG_XTAL_FREQ 255
    #define CLOCK_CONFIG_LF_SRC 0

    In this post (devzone.nordicsemi.com/.../16578 I read about HF Clock not working so I tried whats said there:

    NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
    NRF_CLOCK->TASKS_HFCLKSTART = 1;
    while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
    {
    // Wait for started event to occur. Note: will spin forever if crystal isnt working
    __NOP();
    }

    So before I call that the HFCLKSTAT is 0x00010000, and after 0x00010001 like mentioned in the post,

    but in a Bluetooth Scan I can still not see the device...

    Any suggestions anymore?

    Thank you for your help!

  • Hi,

     

    If you take an untouched example, for instance ble_app_hrs, then do the following alterations:

    1. Change the IRAM1 size from 0x5800 to 0x1800

    2. Set the LFCLK to RC oscillator: SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_8000MS_CALIBRATION, NULL);

    3. compile and load the firmware.

     

    Do you still have issues?

    If yes; try to erase the whole chip (nrfjprog -e) and reprogram the S130 softdevice v1.0 (This is the version used in SDK v10), then load your program again.

    Still have issues? Enter debug mode in Keil, and see where it stops.

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    If you take an untouched example, for instance ble_app_hrs, then do the following alterations:

    1. Change the IRAM1 size from 0x5800 to 0x1800

    2. Set the LFCLK to RC oscillator: SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_8000MS_CALIBRATION, NULL);

    3. compile and load the firmware.

     

    Do you still have issues?

    If yes; try to erase the whole chip (nrfjprog -e) and reprogram the S130 softdevice v1.0 (This is the version used in SDK v10), then load your program again.

    Still have issues? Enter debug mode in Keil, and see where it stops.

     

    Kind regards,

    Håkon

Children
No Data
Related