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

A well working project for nRF51822 with SDK12.2.0 fails after migration to nRF52840 with SDK16.0.0

The project for nRF51822 was developed on base of example ble_peripheral ble_app_hrs for pca10028/s130
with an additional vendor specific service with 128-bit UUID for an MIDI service.

The UUID were set to:

#define BLE_UUID_MIDI_BASE_UUID   { { 0x00, 0xC7, 0xC4, 0x4E, 0xE3, 0x6C, 0x51, 0xA7, 0x33, 0x4B, 0xE8, 0xED, 0x5A, 0x0E, 0xB8, 0x03 } }
#define BLE_UUID_MIDI_SERVICE     0x0E5A
#define BLE_UUID_MIDI_CHARACTERISTC_UUID  { { 0xF3, 0x6B, 0x10, 0x9D, 0x66, 0xF2, 0xA9, 0xA1, 0x12, 0x41, 0x68, 0x38, 0xDB, 0xE5, 0x72, 0x77 } }
#define BLE_UUID_MIDI_CHARACTERISTIC     0xE5DB

and the advertising to:
ble_uuid_t m_adv_uuids[] =
  {{ BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE },
   { BLE_UUID_MIDI_SERVICE, BLE_UUID_TYPE_VENDOR_BEGIN }};


with the following changes for sdk_config.h:
#define BLE_HRS_ENABLED 0    //1
#define ADC_ENABLED 1        //0
#define APP_UART_ENABLED 1    //0
#define NRF_LOG_ENABLED 1    //0
#define NRF_LOG_BACKEND_SERIAL_USES_UART 0    //1
#define NRF_LOG_BACKEND_SERIAL_USES_RTT 1    //0


services_init() was called before advertising_init() and everything was fine.

Now for nRF52840 I used the same base example ble_peripheral ble_app_hrs for pca10056/s140 with SDK16.0.0.
The same UUID settings
and the following changes for sdk_config.h (ADC is not implemented at this time):
#define BLE_HRS_ENABLED 0    //1
#define NRF_SDH_BLE_VS_UUID_COUNT 1        //0

again services_init() is called before advertising_init() 


resulting in the "Fatal error" in ble_advdata.c at

// Get GAP device name and length
err_code = sd_ble_gap_device_name_get(&p_encoded_data[(*p_offset) + AD_DATA_OFFSET], &actual_length);
VERIFY_SUCCESS(err_code);


What do I need to fix making the project run?
Thank you for any hints on this issue!

Parents Reply Children
No Data
Related