Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Response value 6: Operation Failed when attempting to write 0x01 Start DFU to DFU Control Point

Hi, 

I'm getting back "01 10 06" when attempting to send 0x01 Start DFU to the DFU Control Point from my gateway which is a Pi3 running Noble. Notifications are enabled. With the NRF ToolBox I do not seem to get this error. If I send 0x05 or 0x06 from the gateway, the peripheral reboots perfectly fine. 

Code:

 static _reconnect(peripheral) {
    peripheral.once('disconnect', (error)=>{
      console.log("Final d/c")
    })
    peripheral.connect((error)=>{
      console.log("Connected, about to send 0x01 to control point")
      peripheral.discoverServices([DFU_UPDATE_SERVICE], (error_, services) => {
        let dfuService = services[0]
        dfuService.discoverCharacteristics([DFU_CONTROL_POINT, DFU_PACKET_CHAR], (error__, characteristics) => {
          let controlPointChar = characteristics[1]
          let dfuPacketChar = characteristics[0]
          // Must enable notifications (subscribe in Noble) to write to control point
          this._initResponseListener(controlPointChar)
          controlPointChar.subscribe((er)=>{
            let dat = Buffer.from(new Uint8Array([START_DFU]))
            // Notification param must be false

            controlPointChar.write(dat, false, (error___) => {
              console.log("Wrote 0x01 to Ctrl Pt..", error___)
            })
                        //this._sendImageSize(controlPointChar, dfuPacketChar)
          })
       })
      })
    })
  }

  static _initResponseListener(controlPointChar) {
    controlPointChar.on('data', (data, isNotification)=>{
      console.log("Control pt res:", data)
      console.log("isNotif:", isNotification)
    })
  }

Logs:

Connected, about to send 0x01 to control point
Wrote 0x01 to Ctrl Pt.. null
Control pt res: <Buffer 10 01 06>
isNotif: true

Related