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

NRF52 linkage error.

Hello.
I am reading this manual infocenter.nordicsemi.com/index.jsp
and trying to compile but there is an error durring linkage phase,
Linkage nrf_init:
undefined symbol ble_conn_params_init
so my guess is that I need some binary file to pass this to linker because this is not compilation error meaning headers are fine but I'm missing library function. So my question is what should I do?

Here is the code:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ble_conn_params.h"


#define FIRST_CONN_PARAMS_UPDATE_DELAY   5000            // 5 seconds delay before negotiation is initiated.
#define NEXT_CONN_PARAMS_UPDATE_DELAY    30000           // 30 seconds delay for subsequent request to be sent in case parameters are not updated as requested.
#define MAX_CONN_PARAMS_UPDATE_COUNT     3               // Number of times negotiation is attempted.
#define MIN_CONN_INTERVAL                MSEC_TO_UNITS(7.5, UNIT_1_25_MS)       // Minimum connection interval (7.5 ms).
#define MAX_CONN_INTERVAL                MSEC_TO_UNITS(30, UNIT_1_25_MS)        // Maximum connection interval (30 ms).
#define SLAVE_LATENCY                    6                                      // Slave latency.
#define CONN_SUP_TIMEOUT                 MSEC_TO_UNITS(300, UNIT_10_MS)         // Connection supervisory timeout (300 ms).


/*********************************************************************
*
*       main()
*
*  Function description
*   Application entry point.
*/
int main(void)
{
  ble_conn_params_init_t conn_param_init;
  ble_gap_conn_params_t  preferred_conn_param;
  ret_code_t             retval;
  memset(&conn_param_init, 0, sizeof(ble_conn_params_init_t));
  // Connection parameters preferred by the application.
  preferred_conn_param.min_conn_interval = MIN_CONN_INTERVAL;
  preferred_conn_param.max_conn_interval = MAX_CONN_INTERVAL;
  preferred_conn_param.slave_latency     = SLAVE_LATENCY;
  preferred_conn_param.conn_sup_timeout  = CONN_SUP_TIMEOUT;
  conn_param_init.p_conn_params                  = &preferred_conn_param;
  conn_param_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY;
  conn_param_init.next_conn_params_update_delay  = NEXT_CONN_PARAMS_UPDATE_DELAY;
  conn_param_init.max_conn_params_update_count   = MAX_CONN_PARAMS_UPDATE_COUNT;
  conn_param_init.start_on_notify_cccd_handle    = BLE_GATT_HANDLE_INVALID;
  conn_param_init.disconnect_on_fail             = false;
  conn_param_init.evt_handler                    = NULL;
  conn_param_init.error_handler                  = NULL;
  // Initialize and set up connection parameter negotiation module.
  retval = ble_conn_params_init(&conn_param_init);
  if(retval == NRF_SUCCESS)
  {
      // Procedure request succeeded. Connection parameters will be negotiated as requested.
      // BLE_CONN_PARAMS_EVT_SUCCEEDED or BLE_CONN_PARAMS_EVT_FAILED
      // will be notified if parameter negotiation is successful or not.
  }
  else
  {
      // Procedure request failed.
  }
  return 0;

}

I think I get it, there is no such thing like binary file of the library, everything I need from this libary I should compile manually. Am I right?


Best regards.

Parents Reply Children
No Data
Related