Getting "CRC does not match!" in nRF Connect iOS mobile application

I am trying to integrate GitHub - NordicSemiconductor/IOS-DFU-Library: OTA DFU Library for Mac and iOS, compatible with nRF5x SoCs library in one of the SwiftUI mobile application. The integration was easy due to really well documentation instructions on the library page. 

I went ahead and tried to load my ZIP file, but it gave me "CRC does not match!" error in the logs, and then DFU process just stuck at aero progress.

Then I tried to load DFU using your app, which is currently on AppStore - nRF Connect for Mobile on the App Store (apple.com), but I got the same log

I am trying to integrate GitHub - NordicSemiconductor/IOS-DFU-Library: OTA DFU Library for Mac and iOS, compatible with nRF5x SoCs (v4.11.1) pod library in one of the SwiftUI mobile application project. The integration was seamless due to really well documentation instructions on the library page. 

I went ahead and tried to load my ZIP file, but it gave me "CRC does not match!" error in the logs, and then DFU process just stuck at zero progress.

Then I tried to load DFU using your app, which is currently on AppStore - nRF Connect for Mobile on the App Store (apple.com), but I got the same error in log (attached TXT version log from nRF iOS app)

File Name: myDfuFile.zip
Parts: 1
Size: 118 KB
Soft Device Size: Zero KB
Bootloader Size: Zero KB
[Callback] Central Manager did update state to: Powered ON
Connecting to ABDC617280049...
centralManager.connect(peripheral, options: nil)
[Callback] Central Manager did connect peripheral
Connected to ABCD617280049
Discovering services...
peripheral.discoverServices(nil)
Services discovered
Starting Secure DFU...
Connected to ABCD617280049
Services discovered
Secure DFU Service found
Discovering characteristics in DFU Service...
peripheral.discoverCharacteristics(nil, for: FE59)
DFU characteristics discovered
MTU set to 43
Enabling notifications for 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.setNotifyValue(true, for: 8EC90001-F315-4F60-9FB8-838830DAEA50)
Notifications enabled for 8EC90001-F315-4F60-9FB8-838830DAEA50
Secure DFU Control Point notifications enabled
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x0601, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600601000100000000000000000000
Command object selected (Max size = 256, Offset = 0, CRC = 00000000) received
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x010143000000, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600101
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x020000, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600201
Packet Receipt Notif disabled (Op Code = 2, Value = 0)
Writing to characteristic 8EC90002-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x0a410801123d080110888ef9371a028c0120002800300038b097074224080312203d06d39007b6f8, for: 8EC90002-F315-4F60-9FB8-838830DAEA50, type: .withoutResponse)
Writing to characteristic 8EC90002-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0xb6af2ee12083d0e564d22e9a734e6d00201d98841f830d4a604800, for: 8EC90002-F315-4F60-9FB8-838830DAEA50, type: .withoutResponse)
Command object sent (CRC = AAF6B2D4)
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x03, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 6003010000000000000000
Checksum (Offset = 0, CRC = 00000000) received
CRC does not match! Retrying...
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x010143000000, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600101
Writing to characteristic 8EC90002-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x0a410801123d080110888ef9371a028c0120002800300038b097074224080312203d06d39007b6f8, for: 8EC90002-F315-4F60-9FB8-838830DAEA50, type: .withoutResponse)
Writing to characteristic 8EC90002-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0xb6af2ee12083d0e564d22e9a734e6d00201d98841f830d4a604800, for: 8EC90002-F315-4F60-9FB8-838830DAEA50, type: .withoutResponse)
Command object sent (CRC = AAF6B2D4)
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x03, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 6003010000000000000000
Checksum (Offset = 0, CRC = 00000000) received
CRC does not match! Retrying...
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x010143000000, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600101
Writing to characteristic 8EC90002-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x0a410801123d080110888ef9371a028c0120002800300038b097074224080312203d06d39007b6f8, for: 8EC90002-F315-4F60-9FB8-838830DAEA50, type: .withoutResponse)
Writing to characteristic 8EC90002-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0xb6af2ee12083d0e564d22e9a734e6d00201d98841f830d4a604800, for: 8EC90002-F315-4F60-9FB8-838830DAEA50, type: .withoutResponse)
Command object sent (CRC = AAF6B2D4)
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x03, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 6003010000000000000000
Checksum (Offset = 0, CRC = 00000000) received
CRC does not match!
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x0c, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50

I also tried nRF Connect Android app from Play Store, with same BLE device and same ZIP file, it worked!

I am not sure why iOS DFU library or nRF Connect iOS app giving CRC error.

Any help would be appreciated.

I have tested this on iPod Touch (iOS 14.8)

Parents Reply
  • Hi Meet,

    Meet said:
    The process you mentioned to test loading zip file on my nRF50 worked through nRF connect iOS application. It means nRF iOS application is working. Do you have any idea why my zip file giving "CRC Does not match!" error on iOS and same file working on Android nRF app?

    If the zip file in nRF5_SDK_for_Thread_and_Zigbee_v4.1.0_32ce5f8\examples\dfu\secure_dfu_test_images\ble works on both iOS and Android apps but your zip file gives "CRC Does not match!", shouldn't you check your zip file next step? Can you explain how you build your application based on which sample or document?

    Best regards,

    Charlie

Children
  • Hi Charlie,

    I contacted one of our firmware engineer who created the zip file. He said that he used Nordic tool to generate zip file from .bin file.

    My iOS SwiftUI application code to initiate DFU process looks like below:

    if let dfuZipFileName = dfuZipFileName, let dfuFileURL: URL = Bundle.main.url(forResource: dfuZipFileName, withExtension: "zip") {
        let selectedFirmware = DFUFirmware(urlToZipFile: dfuFileURL)
        // Use the DFUServiceInitializer to initialize the DFU process.
        let dfuServiceInitiator = DFUServiceInitiator().with(firmware: selectedFirmware!)
    
        dfuServiceInitiator.delegate = self // - to be informed about current state and errors
        dfuServiceInitiator.progressDelegate = self // - to show progress bar
        dfuServiceInitiator.logger = self // - to get log info
        dfuServiceInitiator.packetReceiptNotificationParameter = 1 // default is 12
        dfuServiceInitiator.dataObjectPreparationDelay = 0.3
        dfuServiceController = dfuServiceInitiator.start(target: peripheral)
    }

    Note: I have also tried dfuServiceInitiator.forceDfu = true, but that also gave same CRC error.

    I have some questions:

    1. Does CRC check is mandatory process to initiate DFU process?
    2. Can you explain how the process works of DFU with regards to CRC generation?
      I believe that if I am loading a zip file to my BLE sensor, which has a DFU characteristics. Does my sensor generating CRC, is there any chance my sensor's DFU implementation generating wrong CRC?!
    3. Is there any configuration in iOS DFU library where I can disable checking CRC checksum and proceed directly loading DFU?
Related