Jeff Brower wrote: >JF- > >Thanks, great explanation. That might explain something else I saw on a project a >while ago. That was sort of the situation. However Ther was no software that came with the XDS560. It was all updates from TIs website. It was all extremely smoth out of the box. /Regards, P Ligander >-Jeff > >jfbuggen wrote: >>Hello, >> >>I had noticed some time ago a strange behavior with CCS 2.1, >>related to "far" definitions and #pragma DATA_SECTION. >>Your problem could perhaps be related to this. >>I didn't follow this topic very much later, so that I don't >>know if this has been fixed in CCS 2.20. >> >>If, in a .c file, you declare a variable : >> >>#pragma DATA_SECTION(myVar, ".mySection"); >>unsigned long myVar; >> >>The presence of the pragma means that you want to >>put the variable in a specific section. Since this is >>not the .bss (32K max) section, the compiler has to use >>a "far" addressing to access the variable. >>Thus, the presence of the pargma tells to the compiler >>that it has to use "far" addressing, even if you didn't >>use the keyword "far" when declaring the variable. >> >>If you have declared the same variable in a header file : >> >>extern unsigned long myVar; >> >>...and you include this header file in another .c file, >>when compiling this second .c file, the compiler is not >>aware of the fact that myVar is not in .bss (since there >>is no "far" keyword, and the pragma DATA_SECTION may not >>be put in the header file). >>As a result, the compiler performs "near" addressing to >>access the myVar. This is of course an error. >> >>The workaround I used is to use explicitely the keyword >>"far" for every variable placed in a specific section. >>Thus, everytime you use the #pragma DATA_SECTION, you should >>add the "far" keyword in the variable declaration : >> >>C file : >>#pragma DATA_SECTION(myVar, ".mySection"); >>far unsigned long myVar; >> >>H file : >>extern far unsigned long myVar; >> >>Regards, >> >>J-F >> >> > >_____________________________________ >Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. > >_____________________________________ >About this discussion group: > >To Join: Send an email to > >To Post: Send an email to > >To Leave: Send an email to > >Archives: http://www.yahoogroups.com/group/c6x > >Other Groups: http://www.dsprelated.com >">http://docs.yahoo.com/info/terms/ > > |