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.

Memory offset errors

Hi,

I am using CCS version 3.3 and a tool 'VectorCAST' for unit testing. I get errors as follows when I use the tool with the CCS project:

"S0000009.asm", ERROR!   at line 58183: [E0200] Offset out of range
         B         L6823,UNC             ; |12236|

"S0000009.asm", ERROR!   at line 58240: [E0200] Offset out of range
         B         L6824,UNC             ; |12259|

"S0000009.asm", ERROR!   at line 58339: [E0200] Offset out of range
         B         L6824,UNC             ; |12307|

"S0000009.asm", ERROR!   at line 58366: [E0200] Offset out of range
         B         L6824,UNC             ; |12319|

"S0000009.asm", ERROR!   at line 58374: [E0200] Offset out of range
         B         L6824,UNC             ; |12322|

.....

I have  contacted the tool manufacturer for solving this problem, but he advised me to contact TI. Can anyone please give me a clue as to what can be wrong here? The tool supports CCS version 3.1, and I am using CCS 3.3. Is there some difference between these two versions in memory referencing that might be causing such errors?

Thanks,

Darshana

  • Which device family is this?  C2000?  

    My guess is that this branch instruction is PC-relative and the destination label is too far away for the branch to reach it.  A PC relative branch is one where an offset, encoded in the instruction, is added to the PC to compute the address of the branch destination.  The size of this offset determines how far away the destination can be.  To make up a simple example, an 8-bit signed offset can branch to address that is -128 to 127 bytes (or maybe words) away.  If the branch destination is farther away than that, the assembler complains with a diagnostic like the one you have here.  Since I don't know what device this branch instruction is for, I cannot be more specific.  If I'm right, then the problem you are seeing will occur regardless of which CCS version you use.

    Hope this helps ...

    -George

     

  • I am working with C2000 device family.

    Well, my guess was similar to what you explained, but I wasn't sure of it. And I can't find any way to remove these offset errors either.

    Thanks a lot for your help.

    Regards,

    Darshana

  • Is the source file for S0000009 an assembly file or C file?

  • If the function where the errors are occurring is a very large function, it may just be that it exceeds the limits of the implementation.  The compiler in CCS 3.1 might by chance arrange the code such that none of the branches are too far to reach, but that the compiler in 3.3 does it differently.  What does the function in question look like?  A big switch statement or perhaps a lot of return statements?  Breaking the function into smaller chunks may help.

  • Which compiler version and switches?  I'm wondering because for 28x using BF is the norm but for for an old legacy 27x using B is the norm. It is possible to use B with a 28x via a compile switch so perhaps this is being done. Or maybe the compile switch is set for 27x which is not desired.

    As the Archaeologist and George mentioned before, B and BF use a 16-bit offset and accept some conditional codes.

    There is also a LB that uses a 22-bit address or a pointer (XAR7), but it is not conditional.

    -Lori