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.

Flash Monitor Example on MSP430F449 with CCE



Hi everybody,

im am using the CCE V3.1 and want to use the flash monitor example from ti.com (SLAA341).

At first i used the free IAR compiler to test the program and it worked fine (i could enter the commands and the terminal showed me the correct answers).

Then i tried the CCE (which i have to use here at work)  but there seems to be a problem with the assembler directives in "flash_monitor.s43". I read chapter C from the "FET Users Guide" (slau157h.pdf) and transformed almost every assembler directive to CCE-compatible directives but i have still some problems:

1. i dont know what to do with ASEG, ASEGN, ORG and RSEG (in another example code ( fet440_uart01_09600) ORG was simply converted to .text!?). Some explications would be nice too.

2. how can i initialize the stack pointer? the line
"mov.w   #SFE(CSTACK),SP         ; Initialize stackpointer"
doesnt work with CCE...

Maybe there is already a CCE-compatible assembler file (like "flash_monitor.asm")?

I am sorry for my bad english...hope you understand me anyway.

Stephan

 

Update:

i "eliminated" every error by commenting the line...then i had only 1 error "The following symbols are" at an unknown location (!?)
I found out that #SFE (initializing stackpointer just above) is defined nowhere and after changing it to #0x0800 there no more errors..well, no errors in the code but there are other linking errors :-)
Does anybody know whats the meaning of #SFE ?? (again: there is no definition in any header file! [flash_monitor.h, TargetDefs.h, msp430x44x.h, lnk_mps430f449.cmd])
I know #GIE , for example, which is defined in msp430x44x.h and used in the line above stackpointer initialization...but #SFE?

  • As you discovered, the monitor code and application note were developed with IAR.  Therefore, I would suggest looking at the IAR version of the MSP430 code generation tools and C run-time support files.
    I found SFE discussed in the MSP430 IAR Assembler Reference Guide.  This Assembler operator is defined as Segment End.

    There is an example of initializing the Stack Pointer in the CCE Run-time support library source rtssrc.zip in boot.c.  This is found in the code generation tools directory.

    MOV.W    #__STACK_END,SP

  • Hi again,
    now i get no error messages but one:
    "The following symbols are undefined: 1 Assembly Error, No Assembly Warning
    MEM_START

    ???
    i cant find MEM_START anywhere!!
    there are several lines including #UMEM_START or #UMEM_SIZE and if i delete these lines, i have no assembly errors anymore.

    This must be some IAR specific code or declaration, but i cant find any definition or explanation not to mention how to port it to CCE comform code...

    Any idea?

  • I see MEM_START defined in flash_monitor.h which is included in flash_monitor.s43.

  • Argl !!!

    [:$]

    ... aaah, i know...my glasses must have been dirty !!! [8-|]

    Thank you!

    On the other hand, i included flash_monitor.h at the beginning with " .cdecls    C,LIST, "flash_monitor.h" " !?!?
    Well, it doesnt matter now, i use the f449 so i can replace mem_start etc. with the hex adresses...

    Thank you again!!!

     

    Update:
    The next problem:
    i got 3 (linking) error messages like "placement fails for object ".reset" "...
    There are Interrupt Vector Definitions at the end of flash_monitor.s43 and i ported the code like SLAU157G page 74...
    Actually i am reading SLAU131C but i still dont know why this errors occur!?

  • Hi,
    i already posted my next problem: the linker can't place the objects .int03 (UART Interrupt vector), .int05 (TIMERA interrupt vector) and .reset (guess what? RESET vector [;)] ).
    I read the CCE FAQ http://tiexpressdsp.com/index.php?title=CCE_FAQ#What_does_the_CCE_linker_error:_.27placement_fails_for_object_.22xxx.22.27_mean_and_how_to_fix_it.3F but i don't really understand how to modify the linker command exactly!?
    At chapter 3.2.1 (SLAA341 page 9) is the instruction how to modify the linker command file for IAR and i changed the range of space in the linker command file for CCE the same way:

    old IAR file:

    // Constant data
    -Z(CONST)DATA16_C,DATA16_ID,DIFUNCT=1100-FFDF
    // Code
    -Z(CODE)CSTART,ISR_CODE=1100-FFDF
    -P(CODE)CODE=1100-FFDF
    // Interrupt vectors
    -Z(CODE)INTVEC=FFE0-FFFF
    -Z(CODE)RESET=FFFE-FFFF

    new IAR file:

    // Constant data
    -Z(CONST)DATA16_C,DATA16_ID,DIFUNCT=1100-FBDF
    // Code
    -Z(CODE)CSTART,ISR_CODE=1100-FBDF
    -P(CODE)CODE=1100-FBDF
    // Interrupt vectors
    -Z(CODE)INTVEC=FBE0-FBFF
    -Z(CODE)RESET=FBFE-FBFF

    my new CCE linker command file:

    MEMORY
    {
        SFR                     : origin = 0x0000, length = 0x0010
        PERIPHERALS_8BIT        : origin = 0x0010, length = 0x00F0
        PERIPHERALS_16BIT       : origin = 0x0100, length = 0x0100
        RAM                     : origin = 0x0200, length = 0x0800
        INFOA                   : origin = 0x1080, length = 0x0080
        INFOB                   : origin = 0x1000, length = 0x0080
        FLASH                   : origin = 0x1100, length = 0xEADF
        INT00                   : origin = 0xFBE0, length = 0x0002
        INT01                   : origin = 0xFBE2, length = 0x0002
        INT02                   : origin = 0xFBE4, length = 0x0002
        INT03                   : origin = 0xFBE6, length = 0x0002
        INT04                   : origin = 0xFBE8, length = 0x0002
        INT05                   : origin = 0xFBEA, length = 0x0002
        INT06                   : origin = 0xFBEC, length = 0x0002
        INT07                   : origin = 0xFBEE, length = 0x0002
        INT08                   : origin = 0xFBF0, length = 0x0002
        INT09                   : origin = 0xFBF2, length = 0x0002
        INT10                   : origin = 0xFBF4, length = 0x0002
        INT11                   : origin = 0xFBF6, length = 0x0002
        INT12                   : origin = 0xFBF8, length = 0x0002
        INT13                   : origin = 0xFBFA, length = 0x0002
        INT14                   : origin = 0xFBFC, length = 0x0002
        RESET                   : origin = 0xFBFE, length = 0x0002
    }

    but i get the same error(s) anyway...

    How should i modify the linker command file?

  • I solved the problem this way:

    1. added a second list of interrupt vectors starting at 0xFBE0 (like in the IAR linker command file) to the CCE Linker Command File like this (changing flash size too):

    MEMORY {
    ...
        FLASH                   : origin = 0x1100, length = 0xEAE0
        INT100                    : origin = 0xFBE0, length = 0x0002
        INT101                    : origin = 0xFBE2, length = 0x0002
    ...
        RESET1                    : origin = 0xFBFE, length = 0x0002
    ... }
    SECTIONS {
    ...
        .int100   : {} > INT100                /* MSP430 INTERRUPT VECTORS 2         */
        .int101   : {} > INT101
    ...
    }

    2. changed the vectors at the end of the assembler code to the new ones:
        .sect    ".int100"   
        .short    Int_Priority_0    ;**      DW  Int_Priority_0  ;FBE0
        .sect   ".int101"   
        .short    Int_Priority_1    ;**        DW  Int_Priority_1  ;FBE2

    3. in assembler code: changed the command to jump back to the user application from
    mov.w #APP_START, R10        (APP_START seems to be 0xFBFE (= reset vector used by assembler code) according to flash_monitor.h) to
    mov.w #0xFFFE, R10

    Now the demo applications starts, puts a welcome message, with STRG+C i am able to switch to the monitor where i am able to dump the checksum or memory like with IAR...well the next problem is i cant update flash even with IAR but thats another post. [;)]
    (and the line feed command \r\n and the null character dont work with CCE, but that are minor problems...)

    Thanks!

**Attention** This is a public forum