This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SDK12 ble_app_buttonless_dfu

Hi,

Im tryin to use the ble_dfu service example from SDK12, I get DFU SERVICE NOT FOUND when trying to update from Android. Any suggestions what to look for?

I use S132v3, bootloader is flashed and I performed successful upload of the application via BLE when there was no app loaded.

  • I've checked it against clean sdk installation and it works. Here's the diff against freshly unpacked version of the sdk

    diff --git a/nRF5x_SDK12/components/ble/ble_services/ble_dfu/ble_dfu.c b/nRF5x_SDK12/components/ble/ble_services/ble_dfu/ble_dfu.c
    index 266d10c..2ad5d5c 100644
    --- a/nRF5x_SDK12/components/ble/ble_services/ble_dfu/ble_dfu.c
    +++ b/nRF5x_SDK12/components/ble/ble_services/ble_dfu/ble_dfu.c
    @@ -88,6 +88,7 @@ static uint32_t rx_char_add(ble_dfu_t * p_dfu, const ble_dfu_init_t * p_dfu_init
         memset(&char_md, 0, sizeof(char_md));
    
         char_md.char_props.notify = 1;
    +   char_md.char_props.write = 1;
         char_md.p_char_user_desc  = NULL;
         char_md.p_char_pf         = NULL;
         char_md.p_user_desc_md    = NULL;
    

    I use experimental_ble_app_buttonless_dfu as my guinea pig and nRF Connect for Android or PC as the trigger app. After connecting to Nordic_template enable notification on the unknown characteristic (DFU control point) inside unknown service (write 0x01 into it's CCCD) and then write 0x01 as characteristic value. Connection should be dropped and board should reboot. If you enable RTT logging the log will clearly say that it's going into bootloader.

  • Hi, I'm having the same problem. After enabling notifications and writing 0x01 as characteristic value, the device doesn't enter bootloader mode. This is the APP log:

     APP:INFO:Device is entering bootloader mode!
    :INFO:Erasing old settings at: 0x200021ac
    :INFO:Erasing: 0x200021ac, num: 1
    :INFO:Erase failed: 6
    :INFO:Failed to erase bootloader settings
    

    Looks like device is trying to enter the bootloader mode, but is unble to. I have tried with both debug bootloader and normal one.

  • As a Nordic employee I can confirm that this is a bug in the experimental buttonless DFU example. As correctly observed by @keton , the characteristic does not have the property enabled, i.e. the following line is missing.

      char_md.char_props.write  = 1;
    
  • I added the "char_md.char_props.write = 1;" change. I still receive the following error from nrfutil:

    Traceback (most recent call last):                                                                          
      File "C:\Python27\Scripts\nrfutil-script.py", line 9, in <module>                                         
        load_entry_point('nrfutil==1.5.3', 'console_scripts', 'nrfutil')()                                      
      File "c:\python27\lib\site-packages\click\core.py", line 716, in __call__                                 
        return self.main(*args, **kwargs)                                                                       
      File "c:\python27\lib\site-packages\click\core.py", line 696, in main                                     
        rv = self.invoke(ctx)                                                                                   
      File "c:\python27\lib\site-packages\click\core.py", line 1060, in invoke                                  
        return _process_result(sub_ctx.command.invoke(sub_ctx))                                                 
      File "c:\python27\lib\site-packages\click\core.py", line 1060, in invoke                                  
        return _process_result(sub_ctx.command.invoke(sub_ctx))                                                 
      File "c:\python27\lib\site-packages\click\core.py", line 889, in invoke                                   
        return ctx.invoke(self.callback, **ctx.params)                                                          
      File "c:\python27\lib\site-packages\click\core.py", line 534, in invoke                                   
        return callback(*args, **kwargs)                                                                        
      File "c:\python27\lib\site-packages\nordicsemi\__main__.py", line 613, in ble                             
        dfu.dfu_send_images()                                                                                   
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu.py", line 122, in dfu_send_images                  
        self._dfu_send_image(self.manifest.application)                                                         
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu.py", line 83, in _dfu_send_image                   
        self.dfu_transport.open()                                                                               
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 193, in open               
        target_device_addr = self.target_device_addr)                                                           
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 98, in connect             
        self.adapter.enable_notification(conn_handle=self.conn_handle, uuid=DFUAdapter.CP_UUID)                 
      File "c:\python27\lib\site-packages\wrapt\wrappers.py", line 561, in __call__                             
        args, kwargs)                                                                                           
      File "c:\python27\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 115, in wrapper                 
        err_code = wrapped(*args, **kwargs)                                                                     
      File "c:\python27\lib\site-packages\pc_ble_driver_py\ble_adapter.py", line 228, in enable_notification    
        raise NordicSemiException('CCCD not found')                                                             
    pc_ble_driver_py.exceptions.NordicSemiException: CCCD not found    
    
  • I made the following change to ble_dfu.h:

    -#define BLE_DFU_BASE_UUID   {{0x50, 0xEA, 0xDA, 0x30, 0x88, 0x83, 0xB8, 0x9F, 0x60, 0x4F, 0x15, 0xF3, 0x00, 0x00, 0x40, 0x8E}} /**< Used vendor specific UUID. */
    +#define BLE_DFU_BASE_UUID   {{0x50, 0xEA, 0xDA, 0x30, 0x88, 0x83, 0xB8, 0x9F, 0x60, 0x4F, 0x15, 0xF3, 0x00, 0x00, 0xC9, 0x8E}} /**< Used vendor specific UUID. */
    

    nrfutil now gives a different error:

    Traceback (most recent call last):
      File "C:\Python27\Scripts\nrfutil-script.py", line 9, in <module>
        load_entry_point('nrfutil==1.5.3', 'console_scripts', 'nrfutil')()
      File "c:\python27\lib\site-packages\click\core.py", line 716, in __call__
        return self.main(*args, **kwargs)
      File "c:\python27\lib\site-packages\click\core.py", line 696, in main
        rv = self.invoke(ctx)
      File "c:\python27\lib\site-packages\click\core.py", line 1060, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python27\lib\site-packages\click\core.py", line 1060, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\python27\lib\site-packages\click\core.py", line 889, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\python27\lib\site-packages\click\core.py", line 534, in invoke
        return callback(*args, **kwargs)
      File "c:\python27\lib\site-packages\nordicsemi\__main__.py", line 613, in ble
        dfu.dfu_send_images()
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu.py", line 122, in dfu_send_images
        self._dfu_send_image(self.manifest.application)
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu.py", line 90, in _dfu_send_image
        self.dfu_transport.send_init_packet(data)
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 227, in send_init_packet
        response = self.__select_command()
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 323, in __select_command
        return self.__select_object(0x01)
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 333, in __select_object
        response = self.__get_response(DfuTransportBle.OP_CODE['ReadObject'])
      File "c:\python27\lib\site-packages\nordicsemi\dfu\dfu_transport_ble.py", line 388, in __get_response
        raise NordicSemiException('No Response: 0x{:02X}'.format(resp[0]))
    pc_ble_driver_py.exceptions.NordicSemiException: No Response: 0x20
    
Related