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?

  • 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

  • Looks like you are using the correct flags at least. Just to confirm, the exact same application .hex (without DEVELOP_IN_NRF52832) and s112 runs fine on the 52832)? Could you search through your project to see if DEVELOP_IN_NRF52832 is being used other places in your code (not just system_nrf52810.c)?

  • Yes, DEVELOP_IN_NRF52832  is only being used in system_nrf52810.c

    If It helps, I am have code that is using the saadc.

    To be clear, the nrf52810 can advertise correctly. But It hangs when trying to connect. See the picture below.

    I am currently developing from the ble_peripheral/bls_app_hts example.


  • I tried the ble_peripheral/bls_app_hts from SDK 15.0.0 on 52810 without DEVELOP_IN_NRF52832, and did not experience the connection problem. Maybe this could be HW related. Are you using an external crystal for the low frequency clock? In that case, could you try to use the internal RC oscillator? Inaccurate frequency may explain why the phone fails to connect.  

    Here is the .hex file I used for test (LEDs and Buttons disabled and RSOSC enabled):

    nrf52810_hts_w_softdevice.hex

Related