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.

generate crc through linker for all of flash

Hi,

 

I'm very new to crc and have some questions.  I'd like to generate crc values for all of flash, and am looking at doing this through the linker generated crc table using the crc_table function.

 

I have a couple of questions:

- can the crc value be created for multiple .obj files, or does each file need it's own crc value if generated from the linker?

I know I can have multiple lines like:

.section_to_be_verified_1: {a1.obj(.text)}

crc_table(_my_crc_table_for_a1_and_c1)

.section_to_be_verified_3: {c1.obj(.text)}

crc_table(_my_crc_table_for_a1_and_c1, algorithm=TMS570_CRC64_ISO)

But this will require > 50 entries...there has to be a better way!

- is there any benefit to having multiple crc values across flash over one crc value for all of flash?

 

Thanks,

David 

  • David,

    I do not think that you can generate CRC table from link command file. However, I have passed your post to a co-worker in case I am missing some TI tools.

    Thanks and regards,

    Zhaohong

  • It should be able to.  See  SPNU118L ARM Assembly Language Tools v5.1 section 8.9

    Thanks,

    David

  • David,

    The linker's implementation of CRC is to create a CRC value for every output section. There is no advantage for doing it this way. It is just an artifact of the implementation. 

    Why are you splitting each object file into a separate .section_to_be_verified_x section? If you place all the input sections you want to generate crc for into a single output section, only one crc value will be generated.

    .section_to_be_verified : { a1.obj(.text) c1.obj(.text) } crc_table(_my_crc_table_for_a1_and_c1)

  • The code splitting it is example code from the SPNU118L.

     

    It sounds like I can't simply calculate a CRC value for an entire memory section.  Listing all of the .obj files is not a good solution for me.  I'll continue to search for another way.

     

    Thanks

  • David,

    If you want to calculate CRC for everything in flash, you should apply the crc_table operator to all sections that are placed in flash memory. You can use the same table name so you only have to call the verify function once. You will still have multiple table entries, but it should be much less than 50.

  • I think that would work, as I only have a few sections located in flash.  Can you provide an example of applying the crc_table operator without specifying a .obj file?  I can't find anything related to it in the user guide and can't get the syntax correct.

     

    Thanks for your help.

  • You're command file should be something like:

    .text    > FLASH crc_table(flash_crc_table)
    .const > FLASH crc_table(flash_crc_table)
    .cinit   > FLASH crc_table(flash_crc_table)

  • Thanks.  I'll give it a try