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

problems of migrating SDK5 nrf51422 to nrf5182

Hi.

I struggled to migrate ble blinky example of nrf5 (nrf51422) to nrf51822 using KEIL (SDK5 v12.3) but failed

Here are what I tried.

Firstly, I changed target device from nrf51422 to nrf51822 as below

And I changed parameters of  ROM and RAM as below.

And then download the S130 and application code as usual but it seems the code doesn't work.

Please tell me what I missed.

Junho.

  • Hi,

    It should not be necessary to do this, the nRF51822 and nRF51422 are identical except from ANT support.

    Have you tried debugging the application to see if any error codes are returned? You seem to have allocated very little RAM space for the softdevice (the minimum required RAM). Unless you use very few features of the softdevice, you will most likely need more. The typical default values in the ble_peripheral examples in SDK 12.3.0 is

    START = 0x20001fe8, SIZE = 0x6018. If you use xxAB package, SIZE should be reduced by 0x4000, i.e., set to 0x2018.

    Best regards,
    Jørgen

  • Dear Jørgen 

    Thanks for the reply.

    Other examples without ble like pheripheral blinky works fine in the hardware.

    However, examples including ble doesn't works.

    I changed the RAM space as your suggestion as below.

    As this try also failed, I tried debugging and found unsolved error.

    The code stops in the ble_stack_init and more precisely, SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);

    Here are Options for the project

    And here are the Defines of the code


    DEBUG BLE_STACK_SUPPORT_REQD NRF51822 BOARD_PCA10028_beacon NRF_SD_BLE_API_VERSION=2 S130 NRF51 SOFTDEVICE_PRESENT SWI_DISABLE0

  • Are you running this on a custom board? If you are, does your board contain the 32.768 kHz LF crystal? The behavior you explain can indicate that the softdevice is waiting for the clock to start. If you do not have the LF crystal on your board, you can use the internal RC oscillator.

  • Yes. Actually, it is the custom board which is not what we made.

    We bought the BLE beacon with nrf51822 chip and we'd like to reprogram it.

    It seems using internal RC oscillator will work whether the board has the LF crustal or not.

    How can we use the RC oscillator?

  • MnP_Junho said:
    It seems using internal RC oscillator will work whether the board has the LF crustal or not.

    Yes, that is correct.

    MnP_Junho said:
    How can we use the RC oscillator?

    If you have not modified the example, the clock config will be collected from the board header file. It looks like you have a custom board file (BOARD_PCA10028_beacon). Open the board header file, look for the definition of NRF_CLOCK_LFCLKSRC, and replace it with this:

    #define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_RC,              \
                                     .rc_ctiv       = 16,                               \
                                     .rc_temp_ctiv  = 2,                                \
                                     .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}

Related