MetaMotion R Firmware update

Attempting to update firmware with swift sdk, but getting the error:
"Could not perform DFU. Firmware 0.2.2 requires bootloader version \'0.2.1\' which does not exist."

MetaMotion is on 1.4.2 firmware, 0.3 hardware

Comments

    • What version are you trying to update to?
    • Can the iOS MetaBase app update the firmware?
  • I'm not specifying the build to update to, so it should be the latest (1.4.4). Metabase can update the firmware

  • edited January 2019

    Metabase on iOS successfully updates the firmware yes. In my app I:

    • connect to 5 metawear devices
    • call metawear.checkForFirmwareUpdate() on all of them which returns FirmwareBuild values indicating new firmware versions are available, which is correct (the devices are on 1.4.2)
    • select a single device to update the firmware of (the others are still connected but not doing anything)
    • call metawear.updateFirmware(delegate: self, build: nil) which gives the error

    I've tried with a single device connected also, but the result is the same (as expected)

  • umm, a fix for the swift sdk or am I doing something incorrect?

  • edited January 2019

    Can you post a simple swift function calling the firmware functions that result in the error?

  • edited January 2019

    After some more investigating it seems modifying the connection parameters causes it to fail:
    This works:

    MetaWearScanner.shared.startScan(allowDuplicates: false) { metawear in         
        if self.metawear == nil {
            self.metawear = metawear
            MetaWearScanner.shared.stopScan()
    
            //connect
            metawear.connectAndSetup().continueOnSuccessWith { _ in
                metawear.flashLED(color: UIColor.white, intensity: 1, _repeat: 255, onTime: 1000, period: 2000)
                mbl_mw_settings_set_tx_power(metawear.board, 4)
    
            //read battery
            }.continueOnSuccessWithTask {
                return mbl_mw_settings_get_battery_state_data_signal(metawear.board).read()
    
            //abort if battery < 50, otherwise check for firmware update
            }.continueOnSuccessWithTask { batteryData -> Task<FirmwareBuild?> in
                let mblBatteryState = batteryData.valueAs() as MblMwBatteryState
                print ("Battery charge: \(mblBatteryState.charge)")
    
                guard mblBatteryState.charge >= 50 else { return Task<FirmwareBuild?>(error: MetaWearError.operationFailed(message: "Battery must have at least 50% charge"))  }
    
                return metawear.checkForFirmwareUpdate()
    
            //update firmware
            }.continueOnSuccessWithTask { firmwareBuild in
                print (firmwareBuild?.firmwareRev ?? "Firmware is already the latest version")
                return firmwareBuild == nil ? Task<()>(()) : metawear.updateFirmware(delegate: self, build: nil)
    
            //results
            }.continueOnSuccessWith {
                print ("success")
    
            }.continueOnErrorWith {error in
                print (error)
    
            }
        }
    }
    

    This doesn't:

    MetaWearScanner.shared.startScan(allowDuplicates: false) { metawear in       
        if self.metawear == nil {
            MetaWearScanner.shared.stopScan()
            self.metawear = metawear
    
            //connect
            metawear.connectAndSetup().continueOnSuccessWith { _ in
                metawear.flashLED(color: UIColor.white, intensity: 1, _repeat: 255, onTime: 1000, period: 2000)
                mbl_mw_settings_set_tx_power(metawear.board, 4)
                mbl_mw_settings_set_connection_parameters(metawear.board, 15, 15, 0, 6000)
    
            //read battery
            }.continueOnSuccessWithTask {
                return mbl_mw_settings_get_battery_state_data_signal(metawear.board).read()
    
            //abort if battery < 50, otherwise check for firmware update
            }.continueOnSuccessWithTask { batteryData -> Task<FirmwareBuild?> in
                let mblBatteryState = batteryData.valueAs() as MblMwBatteryState
                print ("Battery charge: \(mblBatteryState.charge)")
    
                guard mblBatteryState.charge >= 50 else { return Task<FirmwareBuild?>(error: MetaWearError.operationFailed(message: "Battery must have at least 50% charge"))  }
    
                return metawear.checkForFirmwareUpdate()
    
            //update firmware
            }.continueOnSuccessWithTask { firmwareBuild in
                print (firmwareBuild?.firmwareRev ?? "Firmware is already the latest version")
                return firmwareBuild == nil ? Task<()>(()) : metawear.updateFirmware(delegate: self, build: nil)
    
            //results
            }.continueOnSuccessWith {
                print ("success")
    
            }.continueOnErrorWith {error in
                print (error)
    
            }
        }
    }
    

    I can happily live with that, but it seems a strange error to get for that mis-configuration

  • I agree the behavior is odd, but there is no reason to adjust the connection interval prior to perform the firmware update.

Sign In or Register to comment.