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.

CC8530: Change Product IDs for manufacturing

Part Number: CC8530


Hi, and thanks for all of the help previously,

During manufacturing, we are looking at putting some information into the product ID, which may be different for each unit. The rest of the configuration will be unchanged, just different product IDs.

Changing the configuration using the TI configurator would be a real problem in manufacturing, so I'm looking for an easier way. I've noticed that changing the product ID only changes 3 spots in the hex file. 2 spots are the changes in product ID and the last, at the end, looks like it may be a checksum.

So my questions are:

- is there a tool which will modify the Product ID in a hex file?

- Or, could I make my own tool which updates the Product ID and then redoes the checksum? For that I would need information on how the checksum is calculated and over what range.

- Or does anyone have a third way :)

I appreciate any help on this.

Thanks,

Brian

  • Hi Brian,

    I am not aware of any tools that can modify the product ID in an existing hex file. If you however are positive on which bytes are the actual Product ID it should be straight forward to make such a tool yourself. You should of course be very careful in not modifying anything else in the file :-)

    For the checksum calculation you can take a look here: en.wikipedia.org/.../Intel_HEX

    Regards,
    Fredrik
  • Hi Fredrik,

    By checksum, I didn't mean the checksum at the end of each line in an hex file, I meant at the bottom of the image. I'm assuming that the total image would be protected by checksum, and it looks like that. But I would need information about the format of the image, and how the checksum is calculated to allow for 'patching' the product id in the image.

    With the ability to 'patch' the hex, our manufacturing process will be extremely complicated. I hope there is a solution.

    Thanks,
    Brian
  • Hi Brian,

    Here is the code for calculating the image checksum:

        ...
        // Recalculate the image CRC (stored big-endian)
        const quint32 CRC_ADDR = 0x10000 - 0x0400 - 4;
        quint32 imageCrcBe = PwcUtils::flipUint32(calcImageCrc(pHexFile, 0x00008000, CRC_ADDR - 0x8000));
        pHexFile->Set(CRC_ADDR, 4, (BYTE*) &imageCrcBe);
        ...
    
    
    static const quint32 pCrc32Lut[16] = {
        0x00000000, 0x1DB71064, 0x3B6E20C8, 0x26D930AC, 0x76DC4190, 0x6B6B51F4, 0x4DB26158, 0x5005713C,
        0xEDB88320, 0xF00F9344, 0xD6D6A3E8, 0xCB61B38C, 0x9B64C2B0, 0x86D3D2D4, 0xA00AE278, 0xBDBDF21C
    };
    
    
    #define CRC32_INIT     0xFFFFFFFF ///< Initial accumulator value
    #define CRC32_POLY     0x04C11DB7 ///< CRC polynomial (00000100 11000001 00011101 10110111)
    #define CRC32_RPOLY    0xEDB88320 ///< CRC reverse polynomial (11101101 10111000 10000011 00100000)
    #define CRC32_FINAL    0xFFFFFFFF ///< Final XOR operand
    
    
    quint32 PwcImageGenerator::calcImageCrc(CebalHexFile* pHexFile, quint32 addr, int byteCount) {
        quint32 d, ind;
        quint32 acc = CRC32_INIT;
    
        // For each byte...
        while (byteCount--) {
            d = pHexFile->Get(addr++);
            ind = (acc & 0x0F) ^ (d & 0x0F);
            acc = (acc >> 4) ^ pCrc32Lut[ind];
            ind = (acc & 0x0F) ^ (d >> 4);
            acc = (acc >> 4) ^ pCrc32Lut[ind];
        }
    
        return acc ^ CRC32_FINAL;
    } // calcImageCrc
    

    Regards,
    Fredrik

  • Hi Fredrik,

    Thanks! I'll do some python code and run it against an unmodified hex and make sure that I can generate the same checksum.

    Right now this looks like EXACTLY the info I need.

    Best regards,
    Brian