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

Failed to set security (-12) whn the connection is happening on UART example

Hi everybody,

I am with two custom oards that include nrf52840 chip, one acting as central and one as peripheal.

This example is custom to get multilink, for that i save the handlers of connections on array to make the managments. 

I succes connecting my central to an nrf53 without problems, but when i try to connect to the nrf52840 (only one at the same time currently) i get this error when the connected function is triggered

Produced by:

Somebody can help me o discover why and how to close it?

Thank everybody,

regards.

Parents
  • I update with new information, for check and try to debug i get the original UART example central and peripheral and put it on the devices. The same error is triggered too. When this error is triggered theorically the conection is maded, but there aren't communication between devices. I suppose that is a Kconfig modification that i make and i am not be able to identify. There are some way to set a fixed security param statically on defconfig to avoid this problem on future??

Reply
  • I update with new information, for check and try to debug i get the original UART example central and peripheral and put it on the devices. The same error is triggered too. When this error is triggered theorically the conection is maded, but there aren't communication between devices. I suppose that is a Kconfig modification that i make and i am not be able to identify. There are some way to set a fixed security param statically on defconfig to avoid this problem on future??

Children
  • Hi 

    Have you tested the same on standard nRF52840DK's?

    What Kconfig modifications did you make to the original example?

    Do you have custom board files for the hardware you are using?

    Best regards
    Torbjørn

  • Hi,

    I don't have two nRF52840DK's. I have 2 custom boards and 2 nrf53dks

    Yes i make my custom board files as this video explain: https://www.youtube.com/watch?v=KSivO9Cf1TE 

    The only difference between nrf52840dk and my custom board are assigment of leds, buttons and uart.

    This is my Kconfig:

    # nRF52840 DK NRF52840 board configuration
    
    # Copyright (c) 2016 Nordic Semiconductor ASA
    # SPDX-License-Identifier: Apache-2.0
    
    config BOARD_ENABLE_DCDC
    	bool "Enable DCDC mode"
    	select SOC_DCDC_NRF52X
    	default y
    	depends on BOARD_NRF52840DK_NRF52840
    
    config BT_EXT_ADV
        bool "Extended Advertising and Scanning support"
        depends on BT_HCI && BT
        help
          Select this to enable Extended Advertising API support.
          This enables support for advertising with multiple advertising sets,
          extended advertising data, and advertising on LE Coded PHY.
          It enables support for receiving extended advertising data as a
          scanner, including support for advertising data over the LE coded PHY.
          It enables establishing connections over LE Coded PHY
    
    config SHELL_BACKEND_DUMMY
        bool "Enable dummy backend."
        depends on SHELL_BACKENDS && SHELL
        help
          Enable dummy backend which can be used to execute commands with no
          need for physical transport interface.
    
    config BT_USER_PHY_UPDATE
        bool "User control of PHY Update Procedure"
        depends on BT_PHY_UPDATE && BT_CONN && BT_HCI_HOST && BT_HCI && BT
        help
          Enable application access to initiate the PHY Update Procedure.
          The application can also register a callback to be notified about PHY
          changes on the connection. The current PHY info is available in the
          connection info.
    
    config BT_SCAN_BLOCKLIST
        bool "Scanning device blocklist"
        depends on BT_SCAN && BT
        help
          Scanning device blocklist. Scanning module ignores
          any devices which are on this list.
    
    config BT_SCAN_BLOCKLIST_LEN
        int "Blocklist maximum device count"
        default 19
        depends on BT_SCAN_BLOCKLIST && BT_SCAN && BT
        help
          Maximum blocklist devices count.
    
    config BT_MAX_CONN
        int "Maximum number of simultaneous connections"
        range 1 64
        default 19
        depends on BT_CONN && BT_HCI && BT
        help
          Maximum number of simultaneous Bluetooth connections
          supported.
    
    config BT_SCAN_FILTER_ENABLE
        bool "Enabling filters for the Scan library."
        default n
        depends on BT_SCAN && BT
        help
          Enabling filters for the Scan library.
    
    config BT_SCAN_NAME_CNT
        int "Number of name filters"
        default 2
        depends on BT_SCAN_FILTER_ENABLE && BT_SCAN && BT
        help
          Number of name filters
    
    config BT_CTLR_TX_PWR_DYNAMIC_CONTROL
        bool "Tx Power Dynamic Control"
        depends on BT_HCI_VS_EXT && BT_CTLR && BT_HCI && BT
        help
          Enable dynamic control of Tx power per role/connection.
          Provides HCI VS commands to set and get the current Tx
          power on an individual role/connection basis.
    
    config BT_CTLR_ADVANCED_FEATURES
        bool "Show advanced features"
        depends on BT_LL_SW_SPLIT && BT_CTLR && BT_HCI && BT
        help
          Makes advanced features visible to controller developers.
    
    config BT_CTLR_CONN_RSSI
        bool "Connection RSSI"
        default y if BT_HCI_RAW
        depends on BT_CTLR_CONN_RSSI_SUPPORT && BT_CONN && BT_CTLR && BT_HCI && BT
        help
          Enable connection RSSI measurement.
    
    config BT_CTLR_TX_PWR
        bool "Tx Power"
        default BT_CTLR_TX_PWR_0
        depends on BT_CTLR && BT_HCI && BT
        help
          Select the supported BLE Radio transmit power level in dBm.
    

    I will concrete the situation: I was working normally with a custom board as central and nrf53 as peripheral and i can connect without problems, in the past i could connect two custom_board too. But arrived to a  point that i unknown I only succes on connect with one nrf53. In the rest of cases(another nrf53 and the other custom_board) the error of secrity is triggered.

    The curiosity thing is that both nrf53 i upload the same code and the same child image and only in one i succes on the connexion. Another curiosity is that uploading the same code on both devices, on the programmer seems this:

    Device that i am able to connect      

    Device that i am not able to connect     

     

    Thn you for the fast response,

    regards.

  • Hi another time, the issue is closed, i get the error due to CONFIG_BT_SCAN_NAME_CNT=1 when i have a multilink system, setting it to CONFIG_BT_SCAN_NAME_CNT=19 is solved and the error never appears

Related