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.

Parents
  • 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    
    
Reply
  • 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    
    
Children
  • 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
    
  • I logged the first three bytes of data received in on_ctrlpt_write(). nrfutil is sending 0x06 0x01 0x90. The nRF is sending 0x20 for the first byte of its response, but nrfutil is expecting 0x60.

    I could change DFU_OP_RESPONSE_CODE in ble_dfu.h to 0x60, but I'm not sure that's heading in the right direction. Shouldn't nrfutil be sending a 0x01 for the first byte of its command in order to jump to the bootloader? How does nrfutil know whether the nRF is in the application or the bootloader (and hence, whether to send the jump to boot command)?

  • Hi, Daniel. Please take a look at the sequence chart at infocenter.nordicsemi.com/index.jsp where a request\respond codes are explored.

  • Thanks, Konstantin

    How does that information relate to infocenter.nordicsemi.com/.../group__ble__dfu.html

    That page defines 0x01 as BLE_DFU_ENTER_BOOTLOADER, whereas your link defines 0x01 as Create Object.

  • The sequence chart could be applied when your device already in DFU mode. So the numbers your mentioned means that nrfutils thinks you in DFU mode. To trigger DFU mode the buttonless example uses a DFU service control point and the page you mentioned explains how.

Related