This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Android DFU library

答复 答复 转发 Android DFU library.msg

Hi!We used a 52832 to make a bracelet. Now some apps on Huawei phones can't be remotely upgraded by the ring. We have verified that Nordic's official Android DFU library throws a bug in the firmware upgrade. Therefore, during the upgrade process, whether the mobile phone is sent incompletely or the wristband is not completely received, our APP cannot be detected here.Before using nRF Sniffer to capture packets, there is no data during the upgrade process.Before using nRF Sniffer to capture packets, there is no data during the upgrade process.Above have our software testing environment, please check.
According to the log of nova 2s combined with the DFU library code analysis, the following is the error when the data is verified.
The error is as follows:
Sending Calculate Checksum command (Op Code = 3)
08-27 11:38:24.029 1637 1802 W bt_btif : HAL bt_gatt_callbacks->client->notify_cb
08-27 11:38:24.030 7911 8203 I DfuImpl : Checksum received (Offset = 256, CRC = 975ECD47)
08-27 11:38:24.030 7911 8203 W DfuImpl : 3840 bytes were lost!
08-27 11:38:24.031 7911 8203 I DfuImpl : CRC does not match! Expected 491D1F48 but found 975ECD47. Retrying...(3/3)
The program sends the data three times and reports the same error.
The judgment is that the receiving firmware data is incomplete and the upgrade fails.

Is DFU lib usage problem or data compatibility issue? Is there a solution?
Thank you for your reply!

Parents
  • Hi Hung Bui,

    The following models of HUAWEI mobile phone upgrades have failed:
    Hai Si Kirin 970: Glory V10\Note 10\Play, Huawei P20 Pro\nova 3\Mate 10

    Kirin 659: Glory 9 Youth Edition \ Play 7X \ Mai Mang 6 \nova 2 \nova 3e \ Enjoy 7s

    Kirin 960:nova 2S, glory 9

    You said that the nRFToolbox DFU tool upgrade package failed to upload. I checked it. This tool is only suitable for Q8 smart bracelet upgrade.

    The data packet we obtained with nrf sniffer d0:77:21:0c:14:cd should be the data of the upgrade process, please answer this question, if my way is wrong, please guide.Attachment is the upgrade process video, please check.Thank you!

  • I'm not familiar with the app you showed. I'm not sure what exactly the app doing. 

    You would need to describe me:

    - How does the DFU process should work ? Could you describe a normal DFU update process as you know ? 

    - Do you use our bootloader or use your own bootloader ?

    - Is it buttonless update or it requires switching to bootloader via a button press ? 

    - We can't really read Chinese so it's harder for us to understand what you show. I would suggest you to contact our local FAE to get more help. Do you have contact to our local support in china ? 

    - The sniffer trace d0.pcapng doesn't contain any data about a connection, it only has the advertising packets which don't help much. 

    - Please try to test using nRFToolbox/nRFConnect and record the screen. 

Reply
  • I'm not familiar with the app you showed. I'm not sure what exactly the app doing. 

    You would need to describe me:

    - How does the DFU process should work ? Could you describe a normal DFU update process as you know ? 

    - Do you use our bootloader or use your own bootloader ?

    - Is it buttonless update or it requires switching to bootloader via a button press ? 

    - We can't really read Chinese so it's harder for us to understand what you show. I would suggest you to contact our local FAE to get more help. Do you have contact to our local support in china ? 

    - The sniffer trace d0.pcapng doesn't contain any data about a connection, it only has the advertising packets which don't help much. 

    - Please try to test using nRFToolbox/nRFConnect and record the screen. 

Children
  • Hi Hung Bui,

    Thank you very much for your reply. The FAE in China does not know how to solve this problem, so we will contact you directly. Please help me solve it.

    I will describe to you the process of upgrading with the app.First bind the bracelet to the APP and log in, then use the APP to send an upgrade command to the bracelet and wait for the upgrade.“升级” means upgrade at video 48s, after the data may be what you need

    The app obtains the interface at github.com/.../documentation. The code related to the data sent by the mobile phone in the firmware upgrade is in the DFU library, so the mobile phone sends and receives during the upgrade process. What, our APP is unable to find out.

    The bootloader is yours.Is it buttonless update.

    Using the nrfConnect official app to upgrade with the same offline package can be successful (including Huawei mobile phones)

  • Hi Yangamin, 

    The error " Remote DFU not supported" usually happens when the phone caches the attribute table of the device when running in normal operation mode. Then when the device switching to bootloader mode the phone doesn't do a new service discovery. This results that the phone couldn't find the DFU service to do DFU and report that "Remote DFU not supported". 

    If we can have a sniffer trace of the process it could be more clear if it's the case. 

    The way to fix this is to make sure you have service changed characteristic on both the application and the bootloader. And send a service changed indication when you switch. Please look for IS_SRVC_CHANGED_CHARACT_PRESENT in your code and check if you call pm_local_database_has_changed() or not

    However, this issue should not be related to what you described in the original question, where the CRC error happens. Please try to get another log and sniffer trace. 

Related