进入工程,Shift + 鼠标右键,打开Powershell窗口,输入命令即可!
PS D:\best2300a_2500i_ibrt> python .\generate_crc32_of_image.py .\best2300a_ibrt_anc.bin
dir = .\
Size of the image .\best2300a_ibrt_anc.bin is 1121660
location of the crc32 is 3996
bytes to generate crc32 1121577
No SwVer,Please check code!
No HwVer,Please check code!
Generate CRC is 0xf4b631b9L
2
PS D:\best2300a_2500i_ibrt>
把生成的.bin文件,放在手机中,即可通过恒玄BES Toolbox工具连接,选择刚刚生成的文件给耳机进行升级。
generate_crc32_of_image.py内容:
import sys
import os
import io
import binascii
import shutil
import datetime
class crc32:
crc32_table = [
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
0x1adad47dL, 0x6d