Originally posted in the C/C++ compiler forum: http://e2e.ti.com/support/development_tools/compiler/f/343/p/244099/853683.aspx#853683
I am looking into a method for verifying the correct download of software to the C6670. Basically, my approach will read initialized sections generated at compile time and compute a checksum value by parsing the ELF file immediately after the generation of my executable file. The sections are grouped together for convenience using a supplemental linker command file and the .cfg is modified to inform sysbios to "exclude" these sections when linking. At runtime, the address range of the initialized section is read and the run time checksum is computed. There are two problems that have occurred, so far:
1) When reading the .text section (done from executable code in a different section), there seem to be faulty reads. Data is read as a 32-bit word at a time. Occasionally, the read of a memory address will result in only the upper 16 bits to be correct and the lower 16-bits to be wrong. When looking at a dump of the memory at the problematic address, it was observed that the address was storing two compact instructions, with an .fphead instruction adjacent. Now, I was thinking that shouldn't matter since we are doing a simple read of the memory and not executing instructions from this portion of code. It was also attempted to read the .text section as 16-bit words, but the same read error was observed. Any ideas on how to correct this behavoir? (Note, compiling with the "--no_compress" option doesn't seem to remove all the compact instructions, which still show up in various sysbios specific parts of the .text section.)
2) Some of the initialized sections created by the compiler in the ELF format don't seem to be relocatable. Specifically, they include the .rodata and .neardata sections. They have been added to my supplemental linker command file and specified to be excluded in my Sysbios configuration (.cfg) file. However, these sections still show up in the linker command file generated by sysbios. This results in me getting a map file with an empty duplicate section where I specified. Is there a way to take control of these particular sections from the Sysbios?
I am using the v7.4.1 of the compiler tools and v6.33.6.50 of Sys/Bios. Thanks!