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.

Computed CRC after booting from HPI host

I am able to boot my C6747 application from HPI host using AISgen tool. From the host side I wrote a simple code that parses the address, size and data section ignoring all others AIS commands. So far so good, now I'd like to ensure the data integrity by means of CRC computation but I have some doubts.

  • This concern the slave-boot mode and, from my understand, I cannot validate CRC during boot since I'm using the HPI interface. Is this true?
  • I could also compute CRC after booting on both sides. I think there will be no problems on the host side but I wonder how could I do it on the C6747. In this case, to perform the CRC, I would have to get address and size sections information at runtime and I don't know if it is possible.

Any ideas from your side?

Gaston

  • Gaston,

    From the ROM perspective, AIS format is not needed for HPI boot (Section 4, http://focus.ti.com/lit/an/sprab41c/sprab41c.pdf).

    Can you please provide more details on the requirement to calculate CRC both on the host and the device? One option is to use have a small code at the begining of the boot image that runs and calculates the CRC for the rest of the image (however in this approach, if there is a CRC issue with the CRC check code, it would go undetected).

    Thanks,
    Gaurav

  • Hello Gaurav,

    Gaurav said:
    From the ROM perspective, AIS format is not needed for HPI boot (Section 4, http://focus.ti.com/lit/an/sprab41c/sprab41c.pdf).

    Yes I know it but you can use AISgen to generate a monolithic image as Jeff suggested in this post. In my case host has be able to load almost 20 code sections to C6747. 

    Gaurav said:
    Can you please provide more details on the requirement to calculate CRC both on the host and the device?

    Well, the main requirement is that my application has several sections and I cannot avoid it. AISgen provides CRC value at the end of each code section so the host parser just has to take these values and compares it to the calculate CRC by C6747. The question is how could C6747 compute CRC while booting from HPI, could it be possible by means of C6747 bootloader? If I could ask for the moon I'd say:

    1. Host loads section A to C6747 (from binary file generated by AIS and enabling CRC option)
    2. After loading section A, Host requests appropriate CRC calculated by C6747 bootloader.
    3. Host compares requested CRC to the calculated one by AISgen tool.
    4. goto 1 - Start again loading next code section.

    Gaurav said:
    One option is to use have a small code at the begining of the boot image that runs and calculates the CRC for the rest of the image (however in this approach, if there is a CRC issue with the CRC check code, it would go undetected).

    Here you suggest that CRC could be calculated by C6747 after boot at runtime. Anyway, the image changes every time you change the application code. Therefore, many code sections will be changed, and regarding to the small code for CRC calculation, you would have to write a different one for each case.

    I hope I've made myself clear. Please, let me know if you need any clarification.

    Gaston

  • Gaston said:

    Well, the main requirement is that my application has several sections and I cannot avoid it. AISgen provides CRC value at the end of each code section so the host parser just has to take these values and compares it to the calculate CRC by C6747. The question is how could C6747 compute CRC while booting from HPI, could it be possible by means of C6747 bootloader? If I could ask for the moon I'd say:

    1. Host loads section A to C6747 (from binary file generated by AIS and enabling CRC option)
    2. After loading section A, Host requests appropriate CRC calculated by C6747 bootloader.
    3. Host compares requested CRC to the calculated one by AISgen tool.
    4. goto 1 - Start again loading next code section.

    Gaston,

    The ROM code cannot do this during an HPI boot, (CRC checking only can be done by the ROM boot loader in AIS boot modes).  Your host loader should be the one who does this.  After copying a section of data to the C6747, you should read it back and calculate the CRC over that data according the the formula given in the boot loader app note. Then your loader would compare the calculated value against the value in the AIS file, generated by the AIS utility.  You have to understand that in your case, your host loader is acting as the boot loader (it is parsing the AIS, it is loading the sections of data, it will need to calculate the CRCs).

    Regards, Daniel