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

Unable to connect (bond) to nrf52810 using nrfConnect

Hi, I have been developing on the nRF52832. I am now in the process of moving to the nRF52810.

I am using the SDK v15. 

I have commented out the DEVELOP_IN_NRF52832 define in the pca10040e Makefile.

It seems to be working OK. I can see the device on the nrf connect app. However, when I click connect, it is unable to connect.

 

If I comment back in DEVELOP_IN_NRF52832 and switch back to the nRF52832, everything works perfectly.

I have made my own custom service. But I don't think that should matter. Any ideas?

Parents
  • Hi,

    When you developed your application on the 52832, did you use the s132 or s112 softdevice? Also, can you provide a list of the defines you have in your Makefile? Reason I ask is that I wonder if the application might be using APIs not available in s112.

      

  • I used the s132 soft device originally, however, when I flash the nrf52832 with the s112 soft device it works fine aswell. 

    Is this the part of the Makefile that your after?

    # Libraries common to all targets
    LIB_FILES += \
    
    # Optimization flags
    OPT = -Os -g3
    # Uncomment the line below to enable link time optimization
    #OPT += -flto
    
    # C flags common to all targets
    CFLAGS += $(OPT)
    CFLAGS += -DBOARD_PCA10040
    CFLAGS += -DCONFIG_GPIO_AS_PINRESET
    # CFLAGS += -DDEVELOP_IN_NRF52832
    CFLAGS += -DFLOAT_ABI_SOFT
    CFLAGS += -DNRF52810_XXAA
    CFLAGS += -DNRF52_PAN_74
    CFLAGS += -DNRF_SD_BLE_API_VERSION=6
    CFLAGS += -DS112
    CFLAGS += -DSOFTDEVICE_PRESENT
    CFLAGS += -DSWI_DISABLE0
    CFLAGS += -mcpu=cortex-m4
    CFLAGS += -mthumb -mabi=aapcs
    CFLAGS += -Wall -Werror
    CFLAGS += -mfloat-abi=soft
    # keep every function in a separate section, this allows linker to discard unused ones
    CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
    CFLAGS += -fno-builtin -fshort-enums
    
    # C++ flags common to all targets
    CXXFLAGS += $(OPT)
    
    # Assembler flags common to all targets
    ASMFLAGS += -g3
    ASMFLAGS += -mcpu=cortex-m4
    ASMFLAGS += -mthumb -mabi=aapcs
    ASMFLAGS += -mfloat-abi=soft
    ASMFLAGS += -DBOARD_PCA10040
    ASMFLAGS += -DCONFIG_GPIO_AS_PINRESET
    # ASMFLAGS += -DDEVELOP_IN_NRF52832
    ASMFLAGS += -DFLOAT_ABI_SOFT
    ASMFLAGS += -DNRF52810_XXAA
    ASMFLAGS += -DNRF52_PAN_74
    ASMFLAGS += -DNRF_SD_BLE_API_VERSION=6
    ASMFLAGS += -DS112
    ASMFLAGS += -DSOFTDEVICE_PRESENT
    ASMFLAGS += -DSWI_DISABLE0
    
    # Linker flags
    LDFLAGS += $(OPT)
    LDFLAGS += -mthumb -mabi=aapcs -L$(SDK_ROOT)/modules/nrfx/mdk -T$(LINKER_SCRIPT)
    LDFLAGS += -mcpu=cortex-m4
    # let linker dump unused sections
    LDFLAGS += -Wl,--gc-sections
    # use newlib in nano version
    LDFLAGS += --specs=nano.specs
    
    nrf52810_xxaa: CFLAGS += -D__HEAP_SIZE=2048
    nrf52810_xxaa: CFLAGS += -D__STACK_SIZE=2048
    nrf52810_xxaa: ASMFLAGS += -D__HEAP_SIZE=2048
    nrf52810_xxaa: ASMFLAGS += -D__STACK_SIZE=2048
    
    # Add standard libraries at the very end of the linker input, after all objects
    # that may need symbols provided by these libraries.
    LIB_FILES += -lc -lnosys -lm
    
    
    .PHONY: default help
    
    # Default target - first one defined
    default: nrf52810_xxaa

  • I just commented out buttons_leds_init(&erase_bonds); in main so that the IOs did not get initialized. Meant to type RCOSC (RC oscillator).

    So it appears that the problem might be related to the pinout, or have you changed the default pins already?

  • Hmm, when I commented out the buttons_led_init(&erase_bonds) the device didn't even advertise. Perhaps I will try that again just in case.

    I might send a copy of my pin out when I get the chance. I haven't changed any default pins from the downloaded sdk.

    I have re-flashed your .hex a number of times and it works perfectly every time. Perhaps the sdk_config is different? I can send copy of my sdk_config if you think that might help?

  • I have done the following steps.

    1. Downloaded sdk v15
    2. Point toolchain to gcc folder
    3. Commented out buttons_leds_init(&erase_bonds);
    -> And removed the -Werror flag to hide the unused function warning
    4. Commented out the two DDEVELOP_IN_NRF52832 flags in the Makefile
    5. Made these changes to the sdk_config
    -> Set CLOCK_CONFIG_LF_SRC to RC
    -> Set NRFX_CLOCK_CONFIG_LF_SRC to RC
    -> Set NRF_SDH_CLOCK_LF_SRC to NRF_CLOCK_LF_SRC_RC
    -> Set NRF_SDH_CLOCK_LF_ACCURACY to NRF_CLOCK_LF_ACCURACY_500_PPM

    Then I did the following

    make clean
    make erase
    make flash_softdevice
    make flash

    I am still having issues. Is there something I am missing. There must be some reason why your hex file works perfectly. Can you think of what other step I should do? 

  • Strange, I don't see any relevant differences with your approach compared to what I did. Are you testing with a "clean" SDK copy, or is it possible that there are other changes in your code base? Attached is the code I used here. 

    nRF5_SDK_15.0.0_52810_hts.zip

     

     

  • Thank you!

    My device works!

    I changed the SoftDevice calibration timer interval from:

    #define NRF_SDH_CLOCK_LF_RC_CTIV 0
     
    To:
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
Reply Children
No Data
Related