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.

CCS/MSP430F5328: .text and .data in one section

Part Number: MSP430F5328

Tool/software: Code Composer Studio

Hello, 

I am working on a MSP430F5328 with Code Composer Studio 7.2.0.00013, compiler TI v16.9.3.LTS. 

I have created some sections to place some of the code in a specific address range with the #pragma CODE_SECTIONS(). That is working well.
Only some of the const strings I use in those functions where placed in .const instead in the sections I created.
With the #pragma DATA_SECTION() I can force that the const strings are also placed in my created section.
But then I get the following warning:

#849-D The section <section name> contains incompatible objects <object name 1> (text) and <object name 2> (data). <object name 2> will not be included in <section name>.

- How can I solve this warning?
- Is it allowed to place .text and .data in the same section? 

I tried some different things and found out that sometimes it is allowed to place some functions and data in the same section but with another function the previous warning is shown.
What is the correct way to handle this? 

Best regards,

Jeroen

  • Hello,

    I will have to get back to you on this as I ask for clarification with the Compiler team.
  • Hello Jace,

    Ok, thank you. I look forward to your reply. 

    Best regards, 

    Jeroen

  • Jeroen Begeer said:
    - Is it allowed to place .text and .data in the same section? 

    No

    Jeroen Begeer said:
    What is the correct way to handle this? 

    Please tell me the larger problem you want to solve, without any regard for the pragmas or sections you might use to solve it.  There is probably a way to do it.

    Thanks and regards,

    -George

  • Hello George,

    I have a project where it must be possible to update another part of the code.
    So part 1 of the code which will not be changed and that part contains the functionality to update part 2 of the code.
    But part 1 must be able to function when part 2 is removed. 

    So part 1 must be full stand alone and part 2 must be full stand alone.
    That is the reason that I place the code and data for part 1 in a specific section and code and data for part 2 in other section. 

    Best regards,

    Jeroen

  • I suspect you are confused into thinking that all of part 1 must be in single section, and all of part 2 must be in another section.  That is not the case.  Each part can be made up of multiple sections.  When sections are first created, they must all contain one thing: code, initialized data, or uninitialized data.  But, when you combine the sections in your linker command file, you can allocate sections of different types into the same memory range.  I think it would be helpful if you read the first part of the article Linker Command File Primer.

    Thanks and regards,

    -George

**Attention** This is a public forum