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

nRF52832 Custom board not advertising after flashing Custom Bootloader (Buttonless)

Hi, 

I followed this page, downloaded SDK 15.1.0 and I was able to compile and build Custom bootloader (after adding custom board, also changed in makefile as well) for Custom board of nRF52832 in the provided secure bootloader option using arm gcc.

But, after successfully flashing softdevice and bootloader on the board using nRF gostudio, nRF52832 stops advertising, but i can see the led on. But, I can't see my device in nRF connect. I also tried flashing softdevice, bootloader and application in the respective order, all were successfully flashed but no advertisement as well and I can see led on only after holding buttonpress.

My plan is to implement buttonless feature for the bootloader and hence have disabled NRF_BL_DFU_ENTER_METHOD_BUTTON and enabled NRF_BL_DFU_ENTER_METHOD_BUTTONLESS in sdk_config.h and have set "enter_buttonless_dfu" in nrf_dfu_settings_init() of nrf_dfu_settings.c.  Also, I want to know even though I have disabled NRF_BL_DFU_ENTER_METHOD_BUTTON, why do I have to define NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN (I get error if I don't define) ?

Could anyone guide further regarding the issue and let me know, if I am doing something wrong?

Regards,

Nagarjun CS

Parents
  • Hi,

    Do you have the optional 32KHz crystal mounted on your custom board? If not, please make sure you have selected the internal RC oscillator as the low-frequency clock source in sdk_config (default is xtal):

    // </h> 
    //==========================================================
    
    // <h> Clock - SoftDevice clock configuration
    
    //==========================================================
    // <o> NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
     
    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    // <2=> NRF_CLOCK_LF_SRC_SYNTH 
    
    #ifndef NRF_SDH_CLOCK_LF_SRC
    #define NRF_SDH_CLOCK_LF_SRC 0
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
    #ifndef NRF_SDH_CLOCK_LF_RC_CTIV
    #define NRF_SDH_CLOCK_LF_RC_CTIV 8
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
    // <i> How often (in number of calibration intervals) the RC oscillator shall be calibrated
    // <i>  if the temperature has not changed.
    
    #ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
     
    // <0=> NRF_CLOCK_LF_ACCURACY_250_PPM 
    // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM 
    // <2=> NRF_CLOCK_LF_ACCURACY_150_PPM 
    // <3=> NRF_CLOCK_LF_ACCURACY_100_PPM 
    // <4=> NRF_CLOCK_LF_ACCURACY_75_PPM 
    // <5=> NRF_CLOCK_LF_ACCURACY_50_PPM 
    // <6=> NRF_CLOCK_LF_ACCURACY_30_PPM 
    // <7=> NRF_CLOCK_LF_ACCURACY_20_PPM 
    // <8=> NRF_CLOCK_LF_ACCURACY_10_PPM 
    // <9=> NRF_CLOCK_LF_ACCURACY_5_PPM 
    // <10=> NRF_CLOCK_LF_ACCURACY_2_PPM 
    // <11=> NRF_CLOCK_LF_ACCURACY_1_PPM 
    
    #ifndef NRF_SDH_CLOCK_LF_ACCURACY
    #define NRF_SDH_CLOCK_LF_ACCURACY 1
    #endif

    Otherwise, the Softdevice will enter an infinite loop waiting for the non-existent crystal to start up.

    Also, I want to know even though I have disabled NRF_BL_DFU_ENTER_METHOD_BUTTON, why do I have to define NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN (I get error if I don't define) ?

     That's an oversight from us, which we have fixed in SDK 17.0.0. It should have been possible to compile the bootloader without defining any buttons.

    Regards,

    Vidar

  • Hi Vidar,

    I re-verified my settings and changes I made in nrf_bootloader.c. Now, it advertises (but only button press method) with above changes in sdk_config.h and later i flash my application .zip package using nrf connect. And, board did not restart after button. So, when I checked I had to adjust RAM size.



    I adjusted these in .ld file and now settings looks like this.

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x52000
      RAM (rwx) :  ORIGIN = 0x200038D8, LENGTH = 0xC728
    }
    


    And still I get error,
    <debug> nrf_sdh_ble: RAM starts at 0x200038D8 
    <error> app: Fatal error

    I am using Softdevice 132 6.1.0. Could you help me out what am I doing wrong?

    Regards,
    Nagarjun CS

  • I realized that soon and took care of it instantly and corrected it in sdk_config. But, after i corrected I get no debug messages after flash.

     

  • Nagarjun said:
    But, after i corrected I get no debug messages after flash.

     Did you build the project without any errors and was is flashed successfully? What do you observe on the board, is it advertising?

  • Okay, starting from building from building bootloader, i built the secure_bootloader project with no errors (after adding custom_board.h and enabling buttonless features in sdk_config) and flashed the soft device and bootloader succesfully. Now, the device advertises successfully in DFU mode, there is no problem there.

    But, after I flash my application (built with no errors)even though flashing is succesfull the device shutsdown without advertising. I checked if memory adjustements have to be so,i attahced debugger, but I see no debug results.

  • Nagarjun said:
    But, after I flash my application (built with no errors)even though flashing is succesfull the device shutsdown without advertising. I checked if memory adjustements have to be so,i attahced debugger, but I see no debug results.

     Seems that maybe you are overwriting the application due to the flash memory settings. 

    • Could you change the FLASH settings to what is used in a SDK example, for example the dfu secure example?
    • You have obviously changed the Link count in the config file. What other changes have you done? A specific reason for why you changed this?
    • Have you tried a unmodified SDK DFU example? 
  • Thanks alot issue has been resolved, it was mainly because, when i downloaded SDK 15.x.x i did not pay much heed to migration document, that was the problem regarding advertisement issue. I am using older SDK everything seems fine now.

    To answer your questions:

    1. I was using same flash setting than I got debug suggestion to change it.
    2. I just added disabled DFU enter through button press and enabled buttonless method and as well adjusted clock source as suggested above. 
    3. I did it succesfully flashed but no advertisement.

    Regards,
    Nagarjun CS

Reply
  • Thanks alot issue has been resolved, it was mainly because, when i downloaded SDK 15.x.x i did not pay much heed to migration document, that was the problem regarding advertisement issue. I am using older SDK everything seems fine now.

    To answer your questions:

    1. I was using same flash setting than I got debug suggestion to change it.
    2. I just added disabled DFU enter through button press and enabled buttonless method and as well adjusted clock source as suggested above. 
    3. I did it succesfully flashed but no advertisement.

    Regards,
    Nagarjun CS

Children
No Data
Related