在使用C2000开发,生成Hex文件时,出现生成了2个文件的问题(一个hex文件,一个i10文件,需要将两个文件合并才是完整的烧写文件)。
从网上查找资料得知原因为:cmd文件中,将带有初始化代码段分别放到了PAGE0和PAGE1中。只需要将待初始化部分的代码段全部放到PAGE0中,再进行编译,就会只生成一个完整的HEX文件。
验证有效,记录一下!
转载网页查到资料说明如下:
If you use hex utility version 17.6.0.STS, then you are probably experiencing the bug described in this forum thread.
Otherwise, my best guess is that you have an initialized section on PAGE 1, and you shouldn't. Visit this article for background on memory pages. The hex utility only converts initialized sections, like .text and .data. Uninitialized sections, like the stack and .ebss, are ignored. Usually (bordering on always), a C2000 linker command file has initialized sections on PAGE 0, and uninitialized sections on PAGE 1. The hex utility always outputs data for PAGE 0 and PAGE 1 in different files. Usually, no output is needed for PAGE 1, and so only one file is output. If, for some reason, there are initialized sections on PAGE 0 and PAGE 1, then two files are output. If you have not specified a name for the second output file, then the hex utility automatically chooses an output file name and issues the warning diagnostic you show in your post.
Thanks and regards,
-George
https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/761417/compiler-tms320f28377s-warning-data-is-being-written-to-auto-generated-file
把带有初始化部分的地址段 定义在cmd的page0 就只生成一个hex了。