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/MSP430F6779: I can't using #pragma segment on CCS

Part Number: MSP430F6779


Tool/software: Code Composer Studio

I want to migrate my code from IAR5 to CCS9.3. but

#pragma segment="FLASHCODE"                
#pragma segment="RAMCODE"

I don't found "#pragma segment" and the definition of "Segment" in C/C++ Compiler manual (slau132u.pdf) but I found in IAR C/C++ Compiler

and I don't use "__segment_begin" and "__segment_end" in CCS

flash_start_ptr = (uint8_t)__segment_begin("FLASHCODE");
flash_end_ptr = (uint8_t)__segment_end("FLASHCODE");
RAM_start_ptr = (uint8_t)__segment_begin("RAMCODE");

And I also have a question about "RAMCODE" and "FLASHCODE". It isn't defined in the C or H file. but It is define in IAR Linker file (.xcl file)

-QRAMCODE=FLASHCODE		
-Z(DATA)RAMCODE=4C00-6BFF	
//-Z(CODE)FLASHCODE=1500-157F 	

I need help finding a definition of "Segment". And commands to use substitution of CCS. 

PS. I have tried to find methods in "Migration of C Code from IAR 2.x, 3.x, or 4.x to CCS" in slau157ar. But it didn't cover what I needed.
.

Best Regard  

Ittiphat :)

  • Ittiphat Chalermsan said:
    I have tried to find methods in "Migration of C Code from IAR 2.x, 3.x, or 4.x to CCS" in slau157ar. But it didn't cover what I needed

    Please search the latest version of the CCS Manual for MSP430 for a sub-chapter titled Migration of C Code from IAR.  As far as I am aware, this is the only documentation TI supplies on this topic.  The sub-chapter titled Data and Function Placement looks to be on point to your situation.

    Ittiphat Chalermsan said:
    I also have a question about "RAMCODE" and "FLASHCODE".

    In the same manual, the sub-chapter titled Predefined Memory Segment Names talks about that.  Unfortunately, those exact segment names are not shown.  So, you have to compare the TI and IAR linker command files.  To gain a general understanding of TI linker command files, please see the article Linker Command File Primer.

    Thanks and regards,

    -George