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.

MSP430F2122: migration from IAR ORG statement to CSS

Part Number: MSP430F2122

I want to migrate from IAR to CSS, assembler only (no C program). There is now one problem left: 

How do I migrate from ORG statement of IAR? I want to store (assemble) some data byte in the info memory. 

I tried several options. 

IAR:

ORG 1040h

DB 1,2,3,4

CCS:

.sect ".infoC" ;(.infoC is defined in the include file "MSP430F2122.h")

.byte 1,2,3,4

This didn't work, does not store the bytes into info memory, No error message during debug. 

I used the "erease program and info memory" option (in the debug option window). Erasing is done but no programming. 

  • Hello Schroedinger,

    I'm a bit rusty on the assembly side of coding but here is what I came up with and verified it works.  Let me know if you have trouble getting this to work for you.

  • Thanks you for the info, but this doesn't work either. 

    at the end I have these statements, this works: 

    .sect ".int03" ; FFF6h, Port 2
    .short TIMERP2
    .sect ".int08" ; FFF0h, Timer A1
    .short TIMELP
    .sect ".reset" ; MSP430 RESET Vector
    .word RESET

    .end

    I don't know, why I could not use simply

    .sect ".infoD"

    .byte a,b,c

    This lines are very similar the the statements above and also defined in the Linker file. 

    If i put the statement

    .word a,b,c

    at the end of the program, it also works (but then the location varies if I change something in the program). It should be possible to place some bytes on a specific memory adress. 

  • That's odd.

    I checked the .map file to see where the linker placed my word and I see it placed it at first location in INFOA.

    Let me make sure I'm following you correctly...are you placing these in your .asm file or the linker .cmd file?

  • 1. I placed your proposal in the .cmd-file (.myConst : load INFOA) and in the .asm-file (peach ...) as you wrote. 

    2. everything what I wrote in may last mail was done  in the .asm-file only. 

    I checked it with the memory window of the debug window, also with th disassembler window. 

    Is "peach" only a label which can be missed? Is there a leading blank? 

  • Hi Karl,

    "peach" is just a label I use to reference the location in INFOA where I have 2-bytes (a const word var in FLASH that cannot be modified during run-time., ie read only), Without this, I'm pretty sure you will get a build error.  You have to provide some label for the assembler if you intend to reference this location somewhere in your code.

    For example below, where value is a variable -> value  .equ   R4

                mov.w    peach,value

  • Hi Dennis, 

    after a lot of trials with ".sect" which didn't work at all I use a work around with non fixed storage of constants and labels which works. 

    From all I have read in some TI docs I don't understand why it didn't work.  

    Thanks for you support. 

    Best regards

    Karl 

**Attention** This is a public forum