This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ40Z50-R1: BQ40Z50-R1 srec programming issue

Part Number: BQ40Z50-R1
Other Parts Discussed in Thread: BQ40Z50, BQSTUDIO, BQ9004

Hi

The customer uses the following code to programming the .srec to Gauge:

from DriveBqBoxClass import BqDrive
from ctypes import *
import sys
from time import sleep
import os
def error(err):
    bqsbb_file = "./bqSBB.dll"
    bqsbb_dll = CDLL(bqsbb_file)
    bqsbb_dll. TranslateErrorbqSBB.restype = c_char_p
    error = bqsbb_dll. TranslateErrorbqSBB(c_int(err))
    sen = ''
    for i in error:
      sen = sen+chr(i)
    print(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 # Maximum size of standard SMB Blocks
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\\MultiPrograme\\commmgr.exe"
srec2_file = 'D:\\project\\pythonArea\\MultiPrograme\\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(pointer(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))
error(prosrec)
When the ROM platform is 9002 (BQ40Z50), it can be programed normally, but when the ROM platform is 9004, it cannot be programed normally (the IC is not invalid, and it can be programed normally using BQstudio). The error is as follows:
Instruction flash checksum calculated from srec does not match checksum returned from device after programming.
Please help check it.
Thanks
Star