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

INVALID PARAMS when migrating to security mode 1 level 4

I am attempting to migrate my BLE project to a higher security level with bonding.  Was mode 1 level 2 and am upgrading to mode 1 level 4.  When I change the configuration to the following:

Fullscreen
1
2
3
4
5
6
7
8
#define SEC_PARAM_BOND 1 /**< Perform bonding. */
#define SEC_PARAM_MITM 0 /**< Man In The Middle protection not required. */
#define SEC_PARAM_LESC 1 /**< LE Secure Connections not enabled. */
#define SEC_PARAM_KEYPRESS 0 /**< Keypress notifications not enabled. */
#define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /**< No I/O capabilities. */
#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. */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I get [NRF ERROR INVALID PARAM] errors when adding my second service and even when trying to sd_ble_gap_device_name_set.  I'm not sure where I should be looking for the problem and how to find out what which parameter is invalid.

I'm very new to this so any help would be great.  Thanks