connection lose immediatly after bonding

hi all,

I am doing a firmware-porting from ST blueNRG to Nordic nRF52810, with Segger Emb. St. The module is on a peripheral sensor and via android smartphone I have an application, of which I don't know the total operation because it is made by external developers.

this what is set on the blueNRG:

SLAVE_BONDING_USAGE = yes,
MITM_MODE = yes,
SECURE_CONNECTION_SUPPORT = Secure Connections Pairing supported but optional
KEYPRESS_NOTIFICATION = no,
MIN_KEY_SIZE = 7,
MAX_KEY_SIZE = 16,
policy = USE_FIXED_PIN_FOR_PAIRING,
Peripheral_Pass_Key= 123456,
IDENTITY_ADDRESS_TYPE = Random (static) Identity Address


These are the data set for peering on nRF52810:

#define SEC_PARAM_BOND 1 /**< Perform bonding. */
#define SEC_PARAM_MITM 1 /**< Man In The Middle protection is enabled. */
#define SEC_PARAM_LESC 0 /**< LE Secure Connections not enabled. */
#define SEC_PARAM_KEYPRESS 0 /**< Keypress notifications not enabled. */
#define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_DISPLAY_ONLY /**< Display Only. */
#define SEC_PARAM_OOB 0 /**< Out Of Band data not available. */
#define SEC_PARAM_MIN_KEY_SIZE 7 /**< Minimum encryption key size. */
#define SEC_PARAM_MAX_KEY_SIZE 16 /**< Maximum encryption key size. */
#define PASSKEY_LENGTH 6 //**

When I connect, after pairing, correctly entering the passkey (e.g.123456), the app asks me to enter a 16byte login key (all 0).
When I enter it and press submit, I see from the debug info the following message:

app: Data len is set to 0x9B(155)
app: ATT MTU exchange completed. central 0xF7 peripheral 0xF7
app: BLE event received. Event type = 85

Immediately the app loses the BLE connection

Can anyone suggest me an idea of what might be happening and where I could investigate?

Any clue may be helpful...

tanks

Fabrizio

Related