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.

CRC Table .text section

Other Parts Discussed in Thread: TMS320F28023, CONTROLSUITE

Hi All,


I am working on a TMS320F28023 with CCS 4.25(CGT 6.0.1).
I need a linker generated CRC of my used .text sections so that later on, I can check this at runtime to verify the integrity of the binary.

So I searched through the forum and found the assembly tools reference guide ( www.ti.com/lit/spru513 ).
But I've got still some questions:

1)    Is it posible to make only one crc_value over the hole .text section?
    (???Feeding the CRC call in the linker with an executable object module or a memery map or something else where the objektfiles are already mapped to ONE objektfile???)

2)    At the moment CRC calculation at runtime is made with a LUT like this:
    2.1)    Split highbyte and lowbyte
    2.2)    Mirror highbyte and lowbyte
    2.3)    Calculate CRC of lowbyte with LUT
    2.4)    Calculate CRC of highbyte with LUT
    2.5)    All words calculated? -> mirror the CRC32 Sum.
    
    Is there an easier way e.g. without mirroring the hole bytes or useing an other LUT?
    
Thanks.


Ralf   

  • Ralf,

    1) Yes you should be able to CRC the whole text section.  Typically I would do something like this:

    .text >: FLASHXYZ, PAGE = 0, crc_table(_CRCTestVector)

    but keep in mind you can also apply the crc_table operator to group as well.  In the case that the operator is applied to a group, a separate CRC is generated for each member of the group.

    2) I believe our supplied CRC algorithm works similar to what you have described.  We have examples of how to do a CRC both with and without the VCU (only present on F2806x devices) in the VCU library.  This code also has options to generate the look-up table on the fly or store it in flash (semi-)permanently.

    Regards,

    Trey

  • Trey,

    1) Is exactly what I am looking for. *thumbs up*

    2) Because I've got an TMS320F28023 I have to do this in software. Is there an other way to get the VCU library without installing the ControlSuite?

    Thank you for your reply.

    Regards,

    Ralf

  • Ralf,

    Technically I should encourage you to download controlSUITE, but I like breaking the rules ; )

    8877.vcu.zip

    Trey

  • God bless your rebellious charakter :-D

    Thanks a lot.

    Regards,

    Ralf

  • Me again...

    is it right that i can't see all entries of my generated crc table in the debugmode?

    I've defined three sections where the linker has to calculate the CRC32 checksum:


    .text        : > FLASHA, PAGE = 0, crc_table(_golden_CRC_values, algorithm=CRC32_PRIME)

    .lut1       : > FLASHB,     PAGE = 0, crc_table(_golden_CRC_values, algorithm=CRC32_PRIME)

    .lut2       : > FLASHB,     PAGE = 0, crc_table(_golden_CRC_values, algorithm=CRC32_PRIME)

    ...

     .TI.crctab            : > FLASHC,        PAGE=0


    In the *. map-file are the right three entries:


    LINKER GENERATED CRC TABLES

    _golden_CRC_values @ 003f2000 records: 3, size/record: 8, table size: 26
        .lut1: algorithm=CRC32_PRIME(ID=0), page=0, load addr=003f4000, size=00001000, CRC=5d102247
        .lut2: algorithm=CRC32_PRIME(ID=0), page=0, load addr=003f5000, size=00000200, CRC=36368b8b
        .text: algorithm=CRC32_PRIME(ID=0), page=0, load addr=003f6000, size=00000c9d, CRC=88f1457e


    But if I start the debugger, I can only see one record in the crc_table but num_recs says there are three:

    So I searched for the declaration in the crc_tbl.h and there is only one element of CRC_RECORD in the CRC_TABLE struct!

    Acces at element 1 or 2 at runtime is possible, but...

    Is that right or a bug?

    Regards

    Ralf

  • Ralf,

    No this is not a bug.  Because of the way the tables are defined only the first entry shows up in the watch window.  If you look at the memory window near the address of the first record, you should see the other two records right after it. 

    If we defined the struct to have more than one record, it would potentially take up more space than is actually used in a given application (imagine an application with only one CRC record).  If you modify the struct to match the 3 entries you have in your application they should start to show up in the watch window.  Make sense?


    Trey

  • Trey,

    yeah it make sense.

    Because the Compiler don't know how many CRC_RECORDS available. First one who knows that is the Linker (F28xx.cmd File).

    But it is a little bit confusing for the first time. A pointer to the CRC_RECORDS would be more clearly.

    If you don't manipulate the Linker it will depend on a double allocation of the same memory because the CRC_RECORDS has only one element.

    Rigth?

    Regards

    Ralf