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

Unable to bond when using the bootloader

Hi, I'm trying to use the example bootloader with the new NRF52, everything seems to work fine except that I'm unable to bond to the device when the bootloader is installed. The same test HRS application bonds just fine when the bootloader is not installed.

These are the Master Control Panel logs:

As I can see on the log, when trying to bond it receives an HCI EventCode 0x0A which is described on the BT spec as: SYNCHRONOUS CONNECTION LIMIT TO A DEVICE EXCEEDED. I've been struggling with it for hours but I've been unable to find a solution so any help would be appreciated.

Test scenario:

  • Flash s132_nrf52_1.0.0-3.alpha_softdevice.hex
  • Flash dfu_test_bootloader_b.hex
  • Install dfu_test_app_hrm_s132.zip through the MCP
  • Start discovery, connect and try to bond

Thank you

EDIT: I just noticed it throws a 0x0D HCI event code before the 0x0A:

[480113664][ScriptMethodCallThread] TST-Client: Discarded <HciEvent: eventCode=0x0D> - <HciEvent: eventCode=0x0D>

This one is described as "Connection Rejected Due To Limited Resources".

Parents
  • Hi Planas,

    I have reproduced and confirmed the issue here.

    It was the issue with pstorage, due to the fact that we don't rearrange the pstorage data properly when the bootloader is installed. And pstorage will try to overwrite the area the bootloader already occupied.

    The fix is to move the pstorage data area under the bootloader if the bootloader is existing on the flash (bootloader address is written in the UICR).

    What you need to is to replace

    #define BOOTLOADER_ADDRESS        PSTORAGE_FLASH_EMPTY_MASK
    

    with

    #define NRF_UICR_BOOT_START_ADDRESS     (NRF_UICR_BASE + 0x14)  
    
    #define BOOTLOADER_ADDRESS         *((uint32_t *)NRF_UICR_BOOT_START_ADDRESS)
    

    in file pstorage_platform.h in your application source code.

    I will report this issue internally. It will be fixed in the future release of the SDK.

Reply
  • Hi Planas,

    I have reproduced and confirmed the issue here.

    It was the issue with pstorage, due to the fact that we don't rearrange the pstorage data properly when the bootloader is installed. And pstorage will try to overwrite the area the bootloader already occupied.

    The fix is to move the pstorage data area under the bootloader if the bootloader is existing on the flash (bootloader address is written in the UICR).

    What you need to is to replace

    #define BOOTLOADER_ADDRESS        PSTORAGE_FLASH_EMPTY_MASK
    

    with

    #define NRF_UICR_BOOT_START_ADDRESS     (NRF_UICR_BASE + 0x14)  
    
    #define BOOTLOADER_ADDRESS         *((uint32_t *)NRF_UICR_BOOT_START_ADDRESS)
    

    in file pstorage_platform.h in your application source code.

    I will report this issue internally. It will be fixed in the future release of the SDK.

Children
Related