marcmoliz
marcmoliz

Reputation: 1

Add execution start addres to SREC file using bincopy

I'm writing a Python script to merge different SREC files into a single one using bincopy. However, when I process the different files, the SREC non-data records are lost and after merging only the records counter is added. I noticed that there is a bincopy function to get the execution start address but I would like to append it after merging. Is there any way to do so?

Thank you.

def createJtagFile(_srecFilePath, _binFiles):
    _mergedBinFile = bincopy.BinFile()
    for _binFile in _binFiles:
        if None != _binFile:
            for _seg in _binFile.segments:
                _mergedBinFile.add_binary(_seg.data,
                                          address = _seg.address,
                                          overwrite = True)
    ### Add the execution start address here

    with open(_srecFilePath + ".mot", 'w+') as _srecFile:
        _srecFile.write(_mergedBinFile.as_srec())

Upvotes: 0

Views: 93

Answers (0)

Related Questions