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.

[E9999] when using .label

Hello.

I'd like to explain what i am working at:

I'm programming a custom BSL for MSP430 using CCS V5.2.1 assembler. I want to clear the MSP430 flash memory and reprogram it while running BSL code.

So i copy my main routine to RAM so that execution of code isn't stopped while accessing flash. First, i added the BSL flash memory to the memory map in the

linker command file. Then i added a section for the pure BSL flash code: ".bsltext : > BSLFLASH" and then a section for the copied code ".bslloop : load = BSLFLASH,

run = RAM" as described in chapter 75 in SLAU131.

So, i have some code to copy to ram. Let's say:

                     .sect ".bslloop"

                      .label startcopy

destination: mov.w #2,r6

                       mov.w #8,r9

                       .label endcopy

So, if ".bslloop" is placed at address 0x3100 (flash, load time) and is assembled to run at 0x2000 (RAM, run time), "startcopy" should be 0x3100, "destination"

should be 0x2000 and "endcopy" should be at about 0x3106.

I'd like to use these labels as follows:

          mov.w #startcopy,r4

          mov.w #destination,r5

copy: mov.w @r4+,0(r5)

          incd r5

          cmp.w #endcopy,r4

          jne copy

This doesn't work. I have to use

mov.w &start,r4

...

cmp.w &stop,r4

...

start: .word startcopy

stop: .word endcopy

why do i have to do it this way? The linker should know the addresses as long it's an multi pass linker.

cheers

Gunther

  • Gunther,

    The .label directive creates a load label which is treated differently than regular labels in the assembler.  I'll have to dig to find the history behind it.

    Is your goal to save code size?

    Have you tried using the symbols from linker command file using LOAD_START() and RUN_START() from slau131g.pdf 7.8.2?

    Also, when I tried to reproduce your error, I assembled the user guide example without errors, then applied your shortcut and got [E0004] instead of [E9999].  Could you post your example code?  I think there are more issues than just the indirection labels start/stop.

    Thanks

    Greg