请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:BQ40Z50-R1 主题中讨论的其他器件:BQ40Z50、 BQSTUDIO、BQ9004
您好
客户使用以下代码对.srec 编程到 Gauge:
从 DriveBqBoxClass 导入 BqDrive
从 ctypes 导入 *
导入 sys
从 时间 导入 睡眠
导入 操作系统
默认 错误(err):
bqsbb_file = "./bqSBB.dll"
bqsbb_dll = CDLL (bqsbb_file)
bqsbb_dll 的文件。 TranlateErrorbqSBB.restype = c_char_p
错误 = bqsbb_dll。 TranslateErrorbqSBB (c_int (err))
SEN =''
对于 I IN 错误:
SEN = SEN+CHR (I)
打印(sen)
arry256 = c_char*256
section1_base = 0x4000
section2_BASE = 0x100000
section3_BASE = 0x140000
section1_size = 8*1024
section2_size = 56*1024
section3_size = 512
SEC1_CMD = 0xF
SEC234_CMD = 0x5
SMB_BLOCK_MAX = 32 #标准 SMB 块的最大大小
DATA_ARRAY_INDEX = 0
bqsbb_file = "./bqSBB.dll"
bqsbb_dll = CDLL (bqsbb_file)
cmdPipeName = Arry256()
dataPipeName = Arry256()
priorityPipeName = Arry256()
evDeviceName = Arry256()
MERRY = Arry256()
CAMP_FILE = "./CMAPI.dll"
bqxrw_file = "./bq80xrw.dll"
camp_dll = CDLL (camp_file)
bqxrw_dll = CDLL (bqxrw_file)
commmgr_file = "D:\project\\pythonArea\\MultiProgramme\\commmgr.exe"
srec2_file = 'D:\\project\\pythonArea\\MultiProgramme\\73.srec '
c = camp_dll。 SetupAppwithFirstFreeAdapter (pointer (cmdPipeName)、pointer (dataPipeName)、
pointer (priorityPipeName)、pointer (evDeviceName)、c_char_p(commmgr_file.encode())、
c_int (256)、c_int (1))
##open_container = bqsbb_dll.OpenContainerInitDLL (指针(dataPipeName)、c_char_p(Bqz_file.encode())
##error (open_container)
prosrec = bqsbb_dll。 ProgSegmentsfromSrec (pointer (dataPipeName)、c_char_p (srec2_file.encode ()))
# prosrec = bqsbb_dll。 ProgSegmentsfromSrec (pointer (dataPipeName)、c_char_p (srec2_file.encode ())、c_int (2))
# prosrec = bqsbb_dll。 ProgSegmentsfromSrec (pointer (dataPipeName)、c_char_p (srec2_file.encode ())、c_int (1))
错误(假体)
当 ROM 平台为9002 (BQ40Z50)时、它可以正常编程、但当 ROM 平台为9004时、无法正常编程(IC 无效、可以使用 BQstudio 进行正常编程)。 错误如下:
从 srec 计算出的指令闪存校验和与编程后从器件返回的校验和不匹配。
请帮助检查它。
谢谢
星形