Part Number: TMS320F280039
Tool/software:
I configured the linker to produce memory CRC on a few sections, as described in the manual TMS320C28x Assembly Language Tools, in Appendix C.
The code (as in the attached minimal project) is mostly a copy of the manual one, with a few changes.
That worked fine, until the section under test included the testing code itself, producing a wrong CRC.
I considered if my (small) changes to the original code were disruptive. However, the results were always correct in the other memory sections, and also when working on the same set of binary data on a PC version.
How to test it:
- Build and load the example project
- Add a breakpoint in
ref_check_CRC()before/after thegen_crc()call, that is used on each of the CRCs generated by linker: on error, the resulting CRC is different from the expected
Note that:
- The failing section is read-only, nothing changes during the execution
- To make sure: I saved the failing section to disk as a binary file and ran the same CRC code recompiled for PC on it, with the correct result
- My code has no active printf(). However, enabling their code also produces some sections CRC errors - have no clue why yet
- In the attached test code I added a directive
#pragma SET_CODE_SECTION(".crc_code")that when enabled moves the CRC calculation in another section: this makes the CRC on.textsection work
Does anybody spot any colossal mistake that I overlooked in my example?