The issue is that after a buttonless DFU is completed the new firmware runs as expected but the new advertised name doesn't change.
device name in firmware before DFU p27_5f0181cb63ff
device name in firmware after DFU p28_5f0181cb63ff however after DFU the device is still advertising as DFU p27_5f0181cb63ff
if I then connect to the device with nRF Connect view the services and disconnect then the advertised name is seen correctly as p28_5f0181cb63ff
I am using nRF5_SDK_15.2.0_9412b96 and secure_bootloader_ble_s140_pca10056
It seems for some reason the DEVICE_NAME is not updated/fetched on completion of a secure DFU
#define DEVICE_NAME DEVICE_NAME_PREFIX SOFTWARE_VERSION
Any pointers much appreciated
static void gap_params_init(void)
sprintf(&strDeviceName, "%s_%.2x%.2x%.2x%.2x%.2x%.2x", &DEVICE_NAME,
err_code = sd_ble_gap_device_name_set(&sec_mode, (uint8_t *) strDeviceName, strlen(strDeviceName));
// err_code = sd_ble_gap_device_name_set(&sec_mode,
// (const uint8_t *)strDeviceName,
/* YOUR_JOB: Use an appearance value matching the application's use case.
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_);
memset(&gap_conn_params, 0, sizeof(gap_conn_params));
gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
gap_conn_params.slave_latency = SLAVE_LATENCY;
gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT;
err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
We need to verify if the advertising device name is actually not changed or it's just the phone didn't update the advertising packet.
Please try to turn off and on Bluetooth, on the phone, remove any bond information with the original device.
Also you can use nRF Connect on PC to verify the actual advertising packet.
Ok have tested using nRF Connect on the PC and it operates as expected and the DEVICE_NAME updates correctly. So as you say it looks like an issue with caching on the phone or the application.
I guess if the cached info is held in the phone and cannot be invalidated by the application then it will be hard for you to fix. I am talking about IOS here not Android as I haven't yet tested android due to lack of a device.