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

DFU SERVICE ERROR WHILE ACTIVATING BLE UART SERVICE

Hi,

I’m running the  SDK 17, S132 and I do have the PC10040 board.

My embedded bluetooth application will work as a BLE UART, I will send and receive small blocks of data to configure my application.

I tested the example  SDK_17 / examples /ble_peripheral\ble_app_uart with success.

I intend to add  the SECURE DFU with bluetooth,

I tested examples\dfu\secure_bootloader\pca10040_s132_ble with examples\ble_peripheral\ble_app_buttonless_dfu. Everything works fine.

When I try to have DFU + BLE UART services active I’ve got errors while I’m starting advertising_init() 

SETUP

#define NUS_SERVICE_UUID_TYPE           BLE_UUID_TYPE_VENDOR_BEGIN                 

BLE_NUS_DEF(m_nus, NRF_SDH_BLE_TOTAL_LINK_COUNT);                                  

NRF_BLE_GATT_DEF(m_gatt);                                               

NRF_BLE_QWR_DEF(m_qwr);                                                

BLE_ADVERTISING_DEF(m_advertising);                              

static ble_uuid_t m_adv_uuids[] = { {BLE_UUID_NUS_SERVICE, NUS_SERVICE_UUID_TYPE }, {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE}};



static void advertising_init(void)

{

    uint32_t                       err_code;

    ble_advertising_init_t           init;

    

    memset(&init, 0, sizeof(init));

    init.advdata.name_type               = BLE_ADVDATA_FULL_NAME;

    init.advdata.include_appearance      = true;

    init.advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;

    char n = 0;

       init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids2) / sizeof(m_adv_uuids2[0]);

       init.advdata.uuids_complete.p_uuids  = m_adv_uuids2;

        

    advertising_config_get(&init.config);

    init.evt_handler = on_adv_evt;

    err_code = ble_advertising_init(&m_advertising, &init);   <====== I DO HAVE ERROR HERE !!!!

    APP_ERROR_CHECK(err_code);

    ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);

}

Parents
  • Hi Torbjon,


    I changed the ble_uuid_t definition, I used the same UUID_TYPE and after that I did not have more errors:

    static ble_uuid_t m_adv_uuids[] = { {BLE_UUID_NUS_SERVICE, BLE_UUID_TYPE_BLE }, {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE}};


    I loaded  dfu/secure_bootloader and ble_peripheral\ble_app_buttonless_dfu, I noticed that the aplication goes to BootLoader during the start and I'm not able to run ble_app_buttonless_dfu.

    I had to create the ZIP file with ble_app_buttonless_dfu an send thru nRF connect aplication.

    Is there a way to set up the boot enviroment to run ble_app_buttonless_dfu after uploading it?

    Thanks in advance,

  • Hi 

    carloscoelho said:
    I changed the ble_uuid_t definition, I used the same UUID_TYPE and after that I did not have more errors:

    This might build and run OK, but the problem with this method is that you will advertise the wrong NUS service UUID. 

    The BLE_UUID_NUS_SERVICE has to go together with the NUS_SERVICE_UUID_TYPE, otherwise the UUID will not be correct. 

    I would recommend either removing the BLE_UUID_DEVICE_INFORMATION_SERVICE from the list, or add the UUID's to the scan response packet and not the advertise packet.  

    carloscoelho said:
    I loaded  dfu/secure_bootloader and ble_peripheral\ble_app_buttonless_dfu, I noticed that the aplication goes to BootLoader during the start and I'm not able to run ble_app_buttonless_dfu.

    Yes, this is a common issue if you don't use the bootloader to load the application, but load everything using nrfjprog or SES. 

    Please refer to this article for some pointers on how to handle this. 

    Also, if you have more detailed questions on DFU I recommend opening a new ticket, since I have limited experience with this ;)

    Best regards
    Torbjørn

  • Hi Torbjon,

    Thank you for the informations, I was able to load the application with this procedure.

    I will open a new ticket with DFU questions,

    Best regards

  • Hi 

    I am glad to hear you got it working. The best of luck with your project Slight smile

    Best regards
    Torbjørn

Reply Children
Related