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.
Tool/software: Code Composer Studio
Hi all,
I create one new F28069 project with compiler version v18.12.4.LTS and F28069.cmd, enable C2000 Hex Utility and select Binary output format(--binary), then build this project and get below warnings,
section f28069_test.out(.cinit) at 07e81ceh falls in unconfigured
section f28069_test.out(.text) at 07e8000h falls in unconfigured
In F28069.cmd, the FLASHA setting is as below, it seems that hex2000 misunderstand the .text and .cinit are at the address of two times the origin address of FLASHA(0x3F4000 x 2 = 0x7E8000).
FLASHA : origin = 0x3F4000, length = 0x003F80
For further evaluation, I use same method and create a new F280049 project, build this project with no problem and generate a binary file. I find that root cause is the origin address of flash memory settings, hex2000 will show the warnings as long as the .origin address exceed 0x1FFEFF.
Is it reasonable? How can I fix this F28069 binary generating problem? Please advise your idea.
Thanks and regards,
Luke
Please search the C28x assembly tools manual for the sub-chapter titled TI-TXT Hex Format (--ti_txt Option). Even though this discusses a different hex output format, the solution described is the same for binary output. In brief, you have to double the addresses and lengths in the ROMS directive in the hex command file.
Thanks and regards,
-George
George,
I saw several articles here and advised double the address and lengths in the ROMS directive to solve this problem , but when I try this method, double address and length of FLASHA as below, I get a new warning message,
MEMORY
{
PAGE 0:
....
FLASHA : origin = 0x7E8000, length = 0x007F00
PAGE 1:
....
}
New warning messages here:
section f28069_test.out(.cinit) at 0fd01ceh fallsin unconfigured
section f28069_test.out(.text) at 0fd0000h falls in unconfigured
Is there anything I am missing? Can double address/length really solve this problem?
Regards,
Luke
It appears you have changed the linker command file, and not the hex utility command file. The linker command file does not change. Only the hex utility command file needs to have the addresses and lengths doubled.
Thanks and regards,
-George
George,
Yes, you are right, I am doing linker command file modification and cannot solve this problem.
I am using CCSv9.3 and have no idea how to modify hex utility command file, would you please advise one example for this case?
Thanks and regards,
Luke
I apologize. I overlooked the fact that you currently do not have a hex command file.
Please start all over, and try this different way to solve your problem.
Do not make any changes to the linker command file. Do not enable the hex utility, or use the binary output format.
Read this documentation about post-build steps in CCS. Note the example it has about creating a binary file. Use that example.
Thanks and regards,
-George
George,
Thanks, this method does generate .bin file. I have further questions below and need your comments,
Thanks for your help.
Luke
Luke Chen said:Seems that binary output format option of CCS is useless to this case, what's the function this option works for?
The Windows batch file tiobj2bin.bat, which your post-build step calls, uses the binary output feature of the hex utility.
Luke Chen said:Because of your help, I can generate binary file now. What should I do if I want to use CCS and generate TI-TXT format file?
Remove the post-build step that calls tiobj2bin.bat. Enable the hex utility. Select TI-TXT format. Add a hex command file to the project. My first post in this thread points to the documentation about the contents of that command file.
Note that, as an alternative to the post-build step with tiobj2bin.bat, you could do the same thing, but with binary output format instead of TI-TXT.
Luke Chen said:When I select intel output format and build this new project, it generates .hex and .i01 files even I move all the directives to PAGE 0. How should I do so that CCS generates .hex file only?
The usual solution is to add the hex utility option --romwidth=16. To understand why, please search the C28x assembly tools manual for the sub-chapter titled Understanding Memory Widths.
Thanks and regards,
-George
George,
Regarding TI-TXT format generation, I studied the tools manual but still have no idea how to add a hex command file to my CCS project. Could you please advise more, how to do this based on this new CCS F28069 project?
Thanks for your help.
Luke
Add a new source file to your CCS project, right next to your other source files. In the project build settings for the hex utility, in the text box named Command-line pattern, add the name of this new file. Note when the hex utility executes, the current directory is not the root of the project, but the directory named after the current build configuration (often Debug). Thus, to refer to a source file, you have to write ..\name_of_file.
A screen shot is attached below. In that screen shot, the name of the hex utility command file is commands.hex.
Thanks and regards,
-George
George,
Thanks, it works now. And, it also works if I use Command "${CG_TOOL_HEX}" ..\commands.hex instead, I can use this hex command file to generate binary output format, too.
After having further evaluations, I have two questions below,
Please help me to understand the questions above, thanks for your help.
Luke
Luke Chen said:Because binary format is a file without address information, I must use fill directive in linker command file so that linker fills data(for example, 0xFFFF) in unused area, then we are able to generate correct binary file. If I don't use fill directive and select CCS --fill = 0xFFFF instead, hex utility doesn't fill data in unused spaces. Do you know the reason?
To solve this problem, do not use the fill features in the linker. The hex utility has a solution called image mode. For the details, please search the C28x assembly tools manual for the sub-chapter titled Image Mode and the --fill Option.
Luke Chen said:I select F280049 creating a new main.c project and find that I don't have to use hex command file, just use CCS hex utility options and then I can generate TI-TXT and Binary outputs. As I mentioned in my first post, seems that as long as the addresses of flash memory below 0x1FFEFF, hex utility is able to do TI-TXT and binary format conversion without hex command files. Do you have any comments on this situation?
The address range of a C28x CPU core is from 0 to 0x3FFFFF. Each address location corresponds to one 16-bit word. When working with the hex utility and TI-TXT or binary output, addresses and lengths are in terms of, not 16-bit words, but 8-bit bytes. Thus, addresses and lengths are doubled. This is true whether a ROMS directive (which can only be supplied in a hex utility command file) is used or not. If the highest C28x address in use (in terms of 16-bit words) is less than or equal to 0x1FFFFF, then this doubling is still less than the address range maximum of 0x3FFFFF, and no diagnostics are issued.
Thanks and regards,
-George