nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

51822 bootloader setting

Hi,

    recently I'm building dfu function on my board, using nrf51822 qfaa and softdevice s110. 


Here is the situation, I get two 51822 modules:

-one is Raytac MDBT40using nRF51822 QFAAH00, called A

-the other I'm not sure, using nRF51822 QFAAH10, called B

From Nordic documentthe x in the build code is 0..9 for production release.


At first, I run dfu_dual_bank_ble sample code on 51DK. Here is the original bootloader address:

I got B module earlier than A. I change to custom board and change address:

It works well on B.


Then, I repeat the steps on A module. The same bootloader can be loaded to A, but it can't work, even advertising.

I've checked if I only load s110 and application, it works.


Is there something I misunderstood or miss checking?


Thank you very much.

  • Hi Edvin,

    So if you have an LFXTAL (32kHz physical xtal) with 20PPM accuracy, that is fine. If not, look in the enum from nrf_sdm.h, line 100, and find one entry that suits your HW. If you don't have an LFXTAL, try using NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION.

    I've changed it into "NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION" already.

    If that doesn't work, then have you tried debugging? Try setting a breakpoint in the main() function of the bootloader. What happens? Is it reached?`Try to compare the working and non working device, and see if you see any difference in behavior.

    Yes, I just use debug mode for a while. It stops and shows this error when the code comes to nrf_delay.h. 

    The other module, which can work well, stops at other place.

    I think there are answers about these errors in devzone, but I haven't figure it out yet.

  • How have you connected the programmer to your boards, and what programmer are you using?

  • Hi Edvin,

      I use either Keil or nrfgo studio through Jlink. 

      If I try to use programmer in nrf connect for desktop, it cannot read my board. It might be some problem which I haven't figure out yet.

  • Have you tried using nrfjprog (nrf command line tools)

    But you never see these JLink - Cortex-M Error when you debug your application (without bootloader)?

    When you try to debug the bootloader, does the JLink error come immediately, or does it reach the main() function first?

  • Hi Edvin,

      Raytac engineer helps me to find out a little different.

    In my project which is transformed from SDK sample code, I use these argument setting:

    And these are Raytac engineer using (I was told that he uses SDK, too):

    So, I try the following 3 argument settings:

    1. --family NRF51 --program "#H"     ➜ I use at first 
    2. --reset --program "#H"         ➜ Raytac uses
    3. --reset --family NRF51 --program "#H     ➜ I mix 1 & 2

    Both setting 2 and 3 lead modules to work.

    After I turn back to try setting 1, modules work, too.

    It seems there is something wrong if I keep using setting 1; and in 2 or 3 Keil fixes the problems.

    Thank you for your help.

Related