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

Migrating Custom Service from SDK11 to the SDK12

Hi!,

I'm trying to migrate my app with one Service and two Characteristics from SDK11 to the SDK12.

I'm using ble_app_uart as template but when I initialized my custom service the board (NRF52-DK) stop advertising and printf not works.

#include <stdint.h>
#include <string.h>
#include "nordic_common.h"
#include "nrf.h"
#include "ble.h"
#include "ble_advdata.h"
#include "ble_advertising.h"
#include "ble_conn_params.h"
#include "ble_gap.h"
#include "ble_gatt.h"
#include "ble_hci.h"
#include "ble_stack_handler_types.h"
#include "ble_types.h"
#include "pca10040.h"
#include "softdevice_handler.h"
#include "app_timer.h"
#include "app_button.h"
#include "ble_nus.h"
#include "app_uart.h"
#include "app_util_platform.h"
#include "bsp.h"
#include "bsp_btn_ble.h"
#include "device_manager.h"  // Unresolved inclusion: "device_manager.h"
#include "my_custom_service.h"

static ble_nus_t                        m_nus;                                      /**< Structure to identify the Nordic UART Service. */

static uint16_t                         m_conn_handle = BLE_CONN_HANDLE_INVALID;    /**< Handle of the current connection. */

static ble_uuid_t       m_adv_uuids[] = {{BLE_UUID_MY_SERVICE_UUID, BLE_UUID_TYPE_VENDOR_BEGIN}};

ble_os_t								m_service;

If I added my service to the function services_init:

my_custom_service_init(&m_service);

I have this error:

Compiling file: main.c
../../../main.c:46:28: fatal error: device_manager.h: No such file or directory
 #include "device_manager.h"
                            ^
compilation terminated.
../../../../../../components/toolchain/gcc/Makefile.common:108: fallo en las instrucciones para el objetivo '_build/nrf52832_xxaa_main.c.o'
make: *** [_build/nrf52832_xxaa_main.c.o] Error 1

device_manager not exist in SDK12, How I can to fix this?

Best regards

Parents
  • Hi!,

    I have implemented some functions of the peer_manager in my project but I'm getting undefined references to peer_manager functions.

    This is my main function:

    /**@brief Application main function.
     */
    int main(void)
    {
        uint32_t err_code;
        bool erase_bonds = true;
    
        // Initialize.
        APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);
        uart_init();
    
        buttons_leds_init(&erase_bonds);
        peer_manager_init(erase_bonds);
        ble_stack_init();
        gap_params_init();
        services_init();
        advertising_init();
        conn_params_init();
    
        printf("\r\nInit!\r\n");
        err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
        APP_ERROR_CHECK(err_code);
    
        // Enter main loop.
        for (;;)
        {
            power_manage();
        }
    }
    

    The Makefile:

    # Source files common to all targets
    SRC_FILES += \
      $(SDK_ROOT)/components/libraries/button/app_button.c \
      $(SDK_ROOT)/components/libraries/util/app_error.c \
      $(SDK_ROOT)/components/libraries/util/app_error_weak.c \
      $(SDK_ROOT)/components/libraries/fifo/app_fifo.c \
      $(SDK_ROOT)/components/libraries/timer/app_timer.c \
      $(SDK_ROOT)/components/libraries/uart/app_uart_fifo.c \
      $(SDK_ROOT)/components/libraries/util/app_util_platform.c \
      $(SDK_ROOT)/components/libraries/fstorage/fstorage.c \
      $(SDK_ROOT)/components/libraries/hardfault/hardfault_implementation.c \
      $(SDK_ROOT)/components/libraries/util/nrf_assert.c \
      $(SDK_ROOT)/components/libraries/uart/retarget.c \
      $(SDK_ROOT)/components/drivers_nrf/clock/nrf_drv_clock.c \
      $(SDK_ROOT)/components/drivers_nrf/common/nrf_drv_common.c \
      $(SDK_ROOT)/components/drivers_nrf/gpiote/nrf_drv_gpiote.c \
      $(SDK_ROOT)/components/drivers_nrf/uart/nrf_drv_uart.c \
      $(PROJ_DIR)/../../bsp/bsp.c \
      $(PROJ_DIR)/../../bsp/bsp_btn_ble.c \
      $(PROJ_DIR)/main.c \
      $(PROJ_DIR)/my_custom_service.c \
      $(SDK_ROOT)/components/ble/common/ble_advdata.c \
      $(SDK_ROOT)/components/ble/ble_advertising/ble_advertising.c \
      $(SDK_ROOT)/components/ble/common/ble_conn_params.c \
      $(SDK_ROOT)/components/ble/common/ble_srv_common.c \
      $(SDK_ROOT)/components/toolchain/gcc/gcc_startup_nrf52.S \
      $(SDK_ROOT)/components/toolchain/system_nrf52.c \
      $(SDK_ROOT)/components/ble/ble_services/ble_nus/ble_nus.c \
      $(SDK_ROOT)/components/softdevice/common/softdevice_handler/softdevice_handler.c \
      $(SDK_ROOT)/components/ble/peer_manager/gatt_cache_manager.c \
      $(SDK_ROOT)/components/ble/peer_manager/gatts_cache_manager.c \
      $(SDK_ROOT)/components/ble/peer_manager/id_manager.c \
      $(SDK_ROOT)/components/ble/peer_manager/peer_database.c \
      $(SDK_ROOT)/components/ble/peer_manager/peer_data.c \
      $(SDK_ROOT)/components/ble/peer_manager/peer_data_storage.c \
      $(SDK_ROOT)/components/ble/peer_manager/peer_id.c \
      $(SDK_ROOT)/components/ble/peer_manager/peer_manager.c \
      $(SDK_ROOT)/components/ble/peer_manager/pm_buffer.c \
      $(SDK_ROOT)/components/ble/peer_manager/pm_mutex.c \
      $(SDK_ROOT)/components/ble/peer_manager/security_dispatcher.c \
      $(SDK_ROOT)/components/ble/peer_manager/security_manager.c \
      $(SDK_ROOT)/components/ble/common/ble_conn_state.c \
      $(SDK_ROOT)/components/libraries/fds/fds.c \
      $(SDK_ROOT)/components/libraries/util/sdk_mapped_flags.c \
    
    # Include folders common to all targets
    INC_FOLDERS += \
      $(PROJ_DIR)/config/ble_app_uart_pca10040_s132 \
      $(PROJ_DIR)/config \
      $(SDK_ROOT)/components/drivers_nrf/comp \
      $(SDK_ROOT)/components/drivers_nrf/twi_master \
      $(SDK_ROOT)/components/ble/ble_services/ble_ancs_c \
      $(SDK_ROOT)/components/ble/ble_services/ble_ias_c \
      $(SDK_ROOT)/components/libraries/pwm \
      $(SDK_ROOT)/components/softdevice/s132/headers/nrf52 \
      $(SDK_ROOT)/components/libraries/log \
      $(SDK_ROOT)/components/ble/ble_services/ble_gls \
      $(SDK_ROOT)/components/libraries/fstorage \
      $(SDK_ROOT)/components/drivers_nrf/i2s \
      $(SDK_ROOT)/components/drivers_nrf/gpiote \
      $(SDK_ROOT)/components/libraries/fifo \
      $(SDK_ROOT)/components/drivers_nrf/common \
      $(SDK_ROOT)/components/ble/ble_advertising \
      $(SDK_ROOT)/components/drivers_nrf/adc \
      $(SDK_ROOT)/components/ble/ble_services/ble_bas_c \
      $(SDK_ROOT)/components/ble/ble_services/ble_hrs_c \
      $(PROJ_DIR)/../../bsp \
      $(SDK_ROOT)/components/ble/ble_dtm \
      $(SDK_ROOT)/components/libraries/crc16 \
      $(SDK_ROOT)/components/libraries/mailbox \
      $(SDK_ROOT)/components/ble/ble_services/ble_rscs_c \
      $(SDK_ROOT)/components/drivers_nrf/uart \
      $(SDK_ROOT)/components/ble/common \
      $(SDK_ROOT)/components/ble/ble_services/ble_lls \
      $(SDK_ROOT)/components/drivers_nrf/wdt \
      $(SDK_ROOT)/components/ble/ble_services/ble_bas \
      $(SDK_ROOT)/components/libraries/experimental_section_vars \
      $(SDK_ROOT)/components/softdevice/s132/headers \
      $(SDK_ROOT)/components/ble/ble_services/ble_ans_c \
      $(SDK_ROOT)/components/libraries/slip \
      $(SDK_ROOT)/components/libraries/mem_manager \
      $(SDK_ROOT)/components/drivers_nrf/hal \
      $(SDK_ROOT)/components/ble/ble_services/ble_nus_c \
      $(SDK_ROOT)/components/drivers_nrf/rtc \
      $(SDK_ROOT)/components/ble/ble_services/ble_ias \
      $(SDK_ROOT)/components/drivers_nrf/ppi \
      $(SDK_ROOT)/components/ble/ble_services/ble_dfu \
      $(SDK_ROOT)/components/drivers_nrf/twis_slave \
      $(SDK_ROOT)/components \
      $(SDK_ROOT)/components/libraries/scheduler \
      $(SDK_ROOT)/components/ble/ble_services/ble_lbs \
      $(SDK_ROOT)/components/ble/ble_services/ble_hts \
      $(SDK_ROOT)/components/drivers_nrf/delay \
      $(SDK_ROOT)/components/toolchain/cmsis/include \
      $(SDK_ROOT)/components/drivers_nrf/timer \
      $(SDK_ROOT)/components/libraries/util \
      $(SDK_ROOT)/components/drivers_nrf/pwm \
      ../config \
      $(SDK_ROOT)/components/libraries/csense_drv \
      $(SDK_ROOT)/components/libraries/csense \
      $(SDK_ROOT)/components/drivers_nrf/rng \
      $(SDK_ROOT)/components/libraries/low_power_pwm \
      $(SDK_ROOT)/components/libraries/hardfault \
      $(SDK_ROOT)/components/ble/ble_services/ble_cscs \
      $(SDK_ROOT)/components/libraries/uart \
      $(SDK_ROOT)/components/libraries/hci \
      $(SDK_ROOT)/components/drivers_nrf/spi_slave \
      $(SDK_ROOT)/components/drivers_nrf/lpcomp \
      $(SDK_ROOT)/components/libraries/timer \
      $(SDK_ROOT)/components/toolchain \
      $(SDK_ROOT)/components/libraries/led_softblink \
      $(SDK_ROOT)/components/drivers_nrf/qdec \
      $(SDK_ROOT)/components/ble/ble_services/ble_cts_c \
      $(SDK_ROOT)/components/drivers_nrf/spi_master \
      $(SDK_ROOT)/components/ble/ble_services/ble_nus \
      $(SDK_ROOT)/components/ble/ble_services/ble_hids \
      $(SDK_ROOT)/components/drivers_nrf/pdm \
      $(SDK_ROOT)/components/libraries/crc32 \
      $(SDK_ROOT)/components/ble/peer_manager \
      $(SDK_ROOT)/components/drivers_nrf/swi \
      $(SDK_ROOT)/components/ble/ble_services/ble_tps \
      $(SDK_ROOT)/components/ble/ble_services/ble_dis \
      $(SDK_ROOT)/components/device \
      $(SDK_ROOT)/components/ble/nrf_ble_qwr \
      $(SDK_ROOT)/components/libraries/button \
      $(SDK_ROOT)/components/drivers_nrf/saadc \
      $(SDK_ROOT)/components/ble/ble_services/ble_lbs_c \
      $(SDK_ROOT)/components/ble/ble_racp \
      $(SDK_ROOT)/components/toolchain/gcc \
      $(SDK_ROOT)/components/libraries/fds \
      $(SDK_ROOT)/components/libraries/twi \
      $(SDK_ROOT)/components/drivers_nrf/clock \
      $(SDK_ROOT)/components/ble/ble_services/ble_rscs \
      $(SDK_ROOT)/components/softdevice/common/softdevice_handler \
      $(SDK_ROOT)/components/ble/ble_services/ble_hrs \
      $(SDK_ROOT)/components/libraries/log/src \
      $(SDK_ROOT)/components/ble/peer_manager \
      $(SDK_ROOT)/components/libraries/fds \
      $(SDK_ROOT)/components/libraries/fstorage \
      $(SDK_ROOT)/components/libraries/experimental_section_vars \
    

    The errors:

    image description

    You think I need to add something else?

    Best regards

  • What are the errors? From your picture I only see some red lines under BLE_NUS_MAX_DATA_LEN and m_nus. None of these are related to peer manager, they are part of the Nordic UART service.

Reply Children
No Data
Related